!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!i(t)}function i(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[i=t&&t.failIfMajorPerformanceCaveat]&&(r[i]=function(t){var i=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(t);if(!i)return!1;var r=i.createShader(i.VERTEX_SHADER);return!(!r||i.isContextLost())&&(i.shaderSource(r,"void main() {}"),i.compileShader(r),!0===i.getShaderParameter(r,i.COMPILE_STATUS))}(i)),r[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=i);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),i=r;function r(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){var i,r,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)(r=1))return r;for(;io?i=n:r=n,n=.5*(r-i)+i}return n},r.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}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,i=t.y-this.y;return e*e+i*i},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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,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),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,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 a="undefined"!=typeof self?self:{};function s(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0;i0;)e[i]=arguments[i+1];for(var r=0,n=e;r>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function x(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 b(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function w(t,e){return-1!==t.indexOf(e,t.length-e.length)}function I(t,e,i){var r={};for(var n in t)r[n]=e.call(i||this,t[n],n,t);return r}function S(t,e,i){var r={};for(var n in t)e.call(i||this,t[n],n,t)&&(r[n]=t[n]);return r}function T(t){return Array.isArray(t)?t.map(T):"object"==typeof t&&t?I(t,T):t}var A={};function z(t){A[t]||("undefined"!=typeof console&&console.warn(t),A[t]=!0)}function E(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function k(t){for(var e=0,i=0,r=t.length,n=r-1,o=void 0,a=void 0;i@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,i,r,n){var o=r||n;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){var i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}var D=null;function M(t){if(null==D){var e=t.navigator?t.navigator.userAgent:null;D=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return D}function L(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var B,R,F=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,V=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,U={now:F,frame:function(t){var e=O(t);return{cancel:function(){return V(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var i=a.document.createElement("canvas"),r=i.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return i.width=t.width,i.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return B||(B=a.document.createElement("a")),B.href=t,B.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==R&&(R=a.matchMedia("(prefers-reduced-motion: reduce)")),R.matches)}},j={create:function(t,e,i){var r=a.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r},createNS:function(t,e){return a.document.createElementNS(t,e)}},N=a.document&&a.document.documentElement.style;function q(t){if(!N)return t[0];for(var e=0;e=0?0:t.button},j.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var Y,J,Q={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},$={supported:!1,testSupport:function(t){!tt&&J&&(et?it(t):Y=t)}},tt=!1,et=!1;function it(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,J),t.isContextLost())return;$.supported=!0}catch(t){}t.deleteTexture(e),tt=!0}a.document&&((J=a.document.createElement("img")).onload=function(){Y&&it(Y),Y=null,et=!0},J.onerror=function(){tt=!0,Y=null},J.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var rt="01",nt=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function ot(t){return 0===t.indexOf("mapbox:")}nt.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",rt,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},nt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},nt.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},nt.prototype.normalizeStyleURL=function(t,e){if(!ot(t))return t;var i=lt(t);return i.path="/styles/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},nt.prototype.normalizeGlyphsURL=function(t,e){if(!ot(t))return t;var i=lt(t);return i.path="/fonts/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},nt.prototype.normalizeSourceURL=function(t,e){if(!ot(t))return t;var i=lt(t);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||e)},nt.prototype.normalizeSpriteURL=function(t,e,i,r){var n=lt(t);return ot(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+i,this._makeAPIURL(n,this._customAccessToken||r)):(n.path+=""+e+i,ct(n))},nt.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ot(t))return t;var i=lt(t);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,(U.devicePixelRatio>=2||512===e?"@2x":"")+($.supported?".webp":"$1")),i.path=i.path.replace(/^.+\/v4\//,"/"),i.path="/v4"+i.path;var r=this._customAccessToken||function(t){for(var e=0,i=t;e=0&&t.params.splice(n,1)}if("/"!==r.path&&(t.path=""+r.path+t.path),!Q.REQUIRE_ACCESS_TOKEN)return ct(t);if(!(e=e||Q.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+i);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+i);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),ct(t)};var at=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function st(t){return at.test(t)}var ut=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function lt(t){var e=t.match(ut);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 ct(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function pt(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var ht=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ht.prototype.getStorageKey=function(t){var e,i=pt(Q.ACCESS_TOKEN);return e=i&&i.u?a.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):Q.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},ht.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{var r=a.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var n=a.localStorage.getItem(i);n&&(this.anonId=n)}catch(t){z("Unable to read from LocalStorage")}},ht.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){z("Unable to write to LocalStorage")}},ht.prototype.processRequests=function(t){},ht.prototype.postEvent=function(t,e,i,r){var n=this;if(Q.EVENTS_URL){var o=lt(Q.EVENTS_URL);o.params.push("access_token="+(r||Q.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:rt,userId:this.anonId},s=e?m(a,e):a,u={url:ct(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=Rt(u,(function(t){n.pendingRequest=null,i(t),n.saveEventData(),n.processRequests(r)}))}},ht.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var ft,dt,mt=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)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,i,r){this.skuToken=i;var n=!(!r&&!Q.ACCESS_TOKEN),o=Array.isArray(t)&&t.some((function(t){return ot(t)||st(t)}));Q.EVENTS_URL&&n&&o&&this.queueRequest({id:e,timestamp:Date.now()},r)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var i=this.queue.shift(),r=i.id,n=i.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),x(this.anonId)||(this.anonId=v()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}(ht),yt=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)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){Q.EVENTS_URL&&Q.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return ot(t)||st(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 i=pt(Q.ACCESS_TOKEN),r=i?i.u:Q.ACCESS_TOKEN,n=r!==this.eventData.tokenU;x(this.anonId)||(this.anonId=v(),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=r)}),t)}},e}(ht)),_t=yt.postTurnstileEvent.bind(yt),gt=new mt,vt=gt.postMapLoadEvent.bind(gt),xt=500,bt=50;function wt(){a.caches&&!ft&&(ft=a.caches.open("mapbox-tiles"))}function It(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var St,Tt=1/0;function At(t){++Tt>bt&&(t.getActor().send("enforceCacheSizeLimit",xt),Tt=0)}function zt(){return null==St&&(St=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),St}var Et={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Et);var kt=function(t){function e(e,i,r){401===i&&st(r)&&(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=i,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Ct=C()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href};var Pt,Dt,Mt=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(Ct())&&!/^\w+:/.test(i))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var i,r=new a.AbortController,n=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Ct(),signal:r.signal}),o=!1,s=!1,u=(i=n.url).indexOf("sku=")>0&&st(i);"json"===t.type&&n.headers.set("Accept","application/json");var l=function(i,r,o){if(!s){if(i&&"SecurityError"!==i.message&&z(i),r&&o)return c(r);var l=Date.now();a.fetch(n).then((function(i){if(i.ok){var r=u?i.clone():null;return c(i,r,l)}return e(new kt(i.statusText,i.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(i,r,u){("arrayBuffer"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text()).then((function(t){s||(r&&u&&function(t,e,i){if(wt(),ft){var r={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var n=P(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-i<42e4||function(t,e){if(void 0===dt)try{new Response(new ReadableStream),dt=!0}catch(t){dt=!1}dt?e(t.body):t.blob().then(e)}(e,(function(e){var i=new a.Response(e,r);wt(),ft&&ft.then((function(e){return e.put(It(t.url),i)})).catch((function(t){return z(t.message)}))})))}}(n,r,u),o=!0,e(null,t,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(wt(),!ft)return e(null);var i=It(t.url);ft.then((function(t){t.match(i).then((function(r){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),i=P(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(r);t.delete(i),n&&t.put(i,r.clone()),e(null,r,n)})).catch(e)})).catch(e)}(n,l):l(null,null),{cancel:function(){s=!0,o||r.abort()}}}(t,e);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){var i=new a.XMLHttpRequest;for(var r in i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer"),t.headers)i.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){var r=i.response;if("json"===t.type)try{r=JSON.parse(i.response)}catch(t){return e(t)}e(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new kt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:function(){return i.abort()}}}(t,e)},Lt=function(t,e){return Mt(m(t,{type:"json"}),e)},Bt=function(t,e){return Mt(m(t,{type:"arrayBuffer"}),e)},Rt=function(t,e){return Mt(m(t,{method:"POST"}),e)},Ft="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Pt=[],Dt=0;var Ot=function(t,e){if($.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Dt>=Q.MAX_PARALLEL_IMAGE_REQUESTS){var i={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Pt.push(i),i}Dt++;var r=!1,n=function(){if(!r)for(r=!0,Dt--;Pt.length&&Dt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},qt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Zt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Gt=function(t,e,i,r){this.message=(t?t+": ":"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function Xt(t){var e=t.value;return e?[new Gt(t.key,e,"constants have been deprecated as of v8")]:[]}function Wt(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var r=0,n=e;r":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ce=[Qt,$t,te,ee,ie,ae,re,ue(ne),se];function pe(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!pe(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 i=0,r=ce;i255?255:t}function n(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in i)return i[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.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===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),p=s.substr(u+1,l-(u+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=o(p.pop());case"rgb":return 3!==p.length?null:[n(p[0]),n(p[1]),n(p[2]),h];case"hsla":if(4!==p.length)return null;h=o(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,_=2*m-y;return[r(255*a(_,y,f+1/3)),r(255*a(_,y,f)),r(255*a(_,y,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,me=function(t,e,i,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=i,this.a=r};me.parse=function(t){if(t){if(t instanceof me)return t;if("string"==typeof t){var e=de(t);if(e)return new me(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},me.prototype.toString=function(){var t=this.toArray(),e=t[1],i=t[2],r=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(i)+","+r+")"},me.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},me.black=new me(0,0,0,1),me.white=new me(1,1,1,1),me.transparent=new me(0,0,0,0),me.red=new me(1,0,0,1);var ye=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ye.prototype.compare=function(t,e){return this.collator.compare(t,e)},ye.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var _e=function(t,e,i,r,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n},ge=function(t){this.sections=t};ge.fromString=function(t){return new ge([new _e(t,null,null,null,null)])},ge.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ge.factory=function(t){return t instanceof ge?t:ge.fromString(t)},ge.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ge.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function be(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof me)return!0;if(t instanceof ye)return!0;if(t instanceof ge)return!0;if(t instanceof ve)return!0;if(Array.isArray(t)){for(var e=0,i=t;e2){var s=t[1];if("string"!=typeof s||!(s in Ae)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=Ae[s],r++}else o=ne;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],r++}i=ue(o,a)}else i=Ae[n];for(var u=[];r1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Ee=function(t){this.type=ae,this.sections=t};Ee.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var r=[],n=!1,o=1;o<=t.length-1;++o){var a=t[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,$t)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,ue(te))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,ie)))return null;var c=r[r.length-1];c.scale=s,c.font=u,c.textColor=l}else{var p=e.parse(t[o],1,ne);if(!p)return null;var h=p.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:p,scale:null,font:null,textColor:null})}}return new Ee(r)},Ee.prototype.evaluate=function(t){return new ge(this.sections.map((function(e){var i=e.content.evaluate(t);return we(i)===se?new _e("",i,null,null,null):new _e(Ie(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Ee.prototype.eachChild=function(t){for(var e=0,i=this.sections;e-1),i},ke.prototype.eachChild=function(t){t(this.input)},ke.prototype.outputDefined=function(){return!1},ke.prototype.serialize=function(){return["image",this.input.serialize()]};var Ce={"to-boolean":ee,"to-color":ie,"to-number":$t,"to-string":te},Pe=function(t,e){this.type=t,this.args=e};Pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var r=Ce[i],n=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":xe(e[0],e[1],e[2],e[3])))return new me(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Te(i||"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=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oe(t,e){var i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*8192),Math.round(r*n*8192)]}function Ve(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function Ue(t,e){for(var i,r,n,o,a,s,u,l=!1,c=0,p=e.length;c0&&s<0||a<0&&s>0}function qe(t,e,i){for(var r=0,n=i;ri[2]){var n=.5*r,o=t[0]-i[0]>n?-r:i[0]-t[0]>n?r:0;0===o&&(o=t[0]-i[2]>n?-r:i[2]-t[0]>n?r:0),t[0]+=o}Re(e,t)}function Ke(t,e,i,r){for(var n=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[],s=0,u=t;s=0)return!1;var i=!0;return t.eachChild((function(t){i&&!ti(t,e)&&(i=!1)})),i}Je.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(be(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var r=0;re))throw new Te("Input is not a number.");o=a-1}return 0}ii.prototype.parse=function(t,e,i,r,n){return void 0===n&&(n={}),e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)},ii.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new ze(e,[t]):"coerce"===i?new Pe(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 r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];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&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=i(o,a,e.typeAnnotation||"coerce");else o=i(o,a,e.typeAnnotation||"assert")}if(!(o instanceof Se)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof ei)return t(e.boundExpression);if(e instanceof Le&&"error"===e.name)return!1;if(e instanceof Be)return!1;if(e instanceof Je)return!1;var i=e instanceof Pe||e instanceof ze,r=!0;return e.eachChild((function(e){r=i?r&&t(e):r&&e instanceof Se})),!!r&&Qe(e)&&ti(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new Me;try{o=new Se(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},ii.prototype.concat=function(t,e,i){var r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new ii(this.registry,r,e||null,n,this.errors)},ii.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Yt(r,t))},ii.prototype.checkSubtype=function(t,e){var i=pe(t,e);return i&&this.error(i),i};var ni=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,n=i;r=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,n);if(!c)return null;n=n||c.type,r.push([a,c])}return new ni(n,i,r)},ni.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);var n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[ri(e,r)].evaluate(t)},ni.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ai=Object.freeze({__proto__:null,number:oi,color:function(t,e,i){return new me(oi(t.r,e.r,i),oi(t.g,e.g,i),oi(t.b,e.b,i),oi(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,r){return oi(t,e[r],i)}))}}),si=6/29*3*(6/29),ui=Math.PI/180,li=180/Math.PI;function ci(t){return t>.008856451679035631?Math.pow(t,1/3):t/si+4/29}function pi(t){return t>6/29?t*t*t:si*(t-4/29)}function hi(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fi(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function di(t){var e=fi(t.r),i=fi(t.g),r=fi(t.b),n=ci((.4124564*e+.3575761*i+.1804375*r)/.95047),o=ci((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-ci((.0193339*e+.119192*i+.9503041*r)/1.08883)),alpha:t.a}}function mi(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*pi(e),i=.95047*pi(i),r=1.08883*pi(r),new me(hi(3.2404542*i-1.5371385*e-.4985314*r),hi(-.969266*i+1.8760108*e+.041556*r),hi(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}function yi(t,e,i){var r=e-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var _i={forward:di,reverse:mi,interpolate:function(t,e,i){return{l:oi(t.l,e.l,i),a:oi(t.a,e.a,i),b:oi(t.b,e.b,i),alpha:oi(t.alpha,e.alpha,i)}}},gi={forward:function(t){var e=di(t),i=e.l,r=e.a,n=e.b,o=Math.atan2(n,r)*li;return{h:o<0?o+360:o,c:Math.sqrt(r*r+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*ui,i=t.c;return mi({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:yi(t.h,e.h,i),c:oi(t.c,e.c,i),l:oi(t.l,e.l,i),alpha:oi(t.alpha,e.alpha,i)}}},vi=Object.freeze({__proto__:null,lab:_i,hcl:gi}),xi=function(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=n;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={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,$t)))return null;var u=[],l=null;"interpolate-hcl"===i||"interpolate-lab"===i?l=ie:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=p)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([p,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new xi(l,i,r,n,u):e.error("Type "+le(l)+" is not interpolatable.")},xi.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);var n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);var o=ri(e,r),a=xi.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=i[o].evaluate(t),u=i[o+1].evaluate(t);return"interpolate"===this.operator?ai[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?gi.reverse(gi.interpolate(gi.forward(s),gi.forward(u),a)):_i.reverse(_i.interpolate(_i.forward(s),_i.forward(u),a))},xi.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e=i.length)throw new Te("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new Te("Array index must be an integer, but found "+e+" instead.");return i[e]},Si.prototype.eachChild=function(t){t(this.index),t(this.input)},Si.prototype.outputDefined=function(){return!1},Si.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ti=function(t,e){this.type=ee,this.needle=t,this.haystack=e};Ti.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,ne),r=e.parse(t[2],2,ne);return i&&r?he(i.type,[ee,te,$t,Qt,ne])?new Ti(i,r):e.error("Expected first argument to be of type boolean, string, number or null, but found "+le(i.type)+" instead"):null},Ti.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!fe(e,["boolean","string","number","null"]))throw new Te("Expected first argument to be of type boolean, string, number or null, but found "+le(we(e))+" instead.");if(!fe(i,["string","array"]))throw new Te("Expected second argument to be of type array or string, but found "+le(we(i))+" instead.");return i.indexOf(e)>=0},Ti.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Ti.prototype.outputDefined=function(){return!0},Ti.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ai=function(t,e,i){this.type=$t,this.needle=t,this.haystack=e,this.fromIndex=i};Ai.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,ne),r=e.parse(t[2],2,ne);if(!i||!r)return null;if(!he(i.type,[ee,te,$t,Qt,ne]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+le(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,$t);return n?new Ai(i,r,n):null}return new Ai(i,r)},Ai.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!fe(e,["boolean","string","number","null"]))throw new Te("Expected first argument to be of type boolean, string, number or null, but found "+le(we(e))+" instead.");if(!fe(i,["string","array"]))throw new Te("Expected second argument to be of type array or string, but found "+le(we(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(e,r)}return i.indexOf(e)},Ai.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Ai.prototype.outputDefined=function(){return!1},Ai.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var zi=function(t,e,i,r,n,o){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o};zi.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 i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n={},o=[],a=2;aNumber.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(i){if(l.checkSubtype(i,we(h)))return null}else i=we(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,r);if(!f)return null;r=r||f.type,o.push(f)}var d=e.parse(t[1],1,ne);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,r);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(i,d.type)?null:new zi(i,r,d,n,o,m):null},zi.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(we(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},zi.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},zi.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},zi.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],r={},n=0,o=Object.keys(this.cases).sort();n=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,ne),r=e.parse(t[2],2,$t);if(!i||!r)return null;if(!he(i.type,[ue(ne),te,ne]))return e.error("Expected first argument to be of type array or string, but found "+le(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,$t);return n?new ki(i.type,i,r,n):null}return new ki(i.type,i,r)},ki.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!fe(e,["string","array"]))throw new Te("Expected first argument to be of type array or string, but found "+le(we(e))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return e.slice(i,r)}return e.slice(i)},ki.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},ki.prototype.outputDefined=function(){return!1},ki.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Mi=Di("==",(function(t,e,i){return e===i}),Pi),Li=Di("!=",(function(t,e,i){return e!==i}),(function(t,e,i,r){return!Pi(0,e,i,r)})),Bi=Di("<",(function(t,e,i){return e",(function(t,e,i){return e>i}),(function(t,e,i,r){return r.compare(e,i)>0})),Fi=Di("<=",(function(t,e,i){return e<=i}),(function(t,e,i,r){return r.compare(e,i)<=0})),Oi=Di(">=",(function(t,e,i){return e>=i}),(function(t,e,i,r){return r.compare(e,i)>=0})),Vi=function(t,e,i,r,n){this.type=te,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};Vi.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,$t);if(!i)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=e.parse(r.locale,1,te)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,te)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,$t)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,$t))?null:new Vi(i,n,o,a,s)},Vi.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))},Vi.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)},Vi.prototype.outputDefined=function(){return!1},Vi.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 Ui=function(t){this.type=$t,this.input=t};Ui.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+le(i.type)+" instead."):new Ui(i):null},Ui.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 Te("Expected value to be of type string or array, but found "+le(we(e))+" instead.")},Ui.prototype.eachChild=function(t){t(this.input)},Ui.prototype.outputDefined=function(){return!1},Ui.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ji={"==":Mi,"!=":Li,">":Ri,"<":Bi,">=":Oi,"<=":Fi,array:ze,at:Si,boolean:ze,case:Ei,coalesce:wi,collator:Be,format:Ee,image:ke,in:Ti,"index-of":Ai,interpolate:xi,"interpolate-hcl":xi,"interpolate-lab":xi,length:Ui,let:Ii,literal:Se,match:zi,number:ze,"number-format":Vi,object:ze,slice:ki,step:ni,string:ze,"to-boolean":Pe,"to-color":Pe,"to-number":Pe,"to-string":Pe,var:ei,within:Je};function Ni(t,e){var i=e[0],r=e[1],n=e[2],o=e[3];i=i.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);var a=o?o.evaluate(t):1,s=xe(i,r,n,a);if(s)throw new Te(s);return new me(i/255*a,r/255*a,n/255*a,a)}function qi(t,e){return t in e}function Zi(t,e){var i=e[t];return void 0===i?null:i}function Gi(t){return{type:t}}function Xi(t){return{result:"success",value:t}}function Wi(t){return{result:"error",value:t}}function Hi(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ki(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Yi(t){return!!t.expression&&t.expression.interpolated}function Ji(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Qi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function $i(t){return t}function tr(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function er(t,e,i,r,n){return tr(typeof i===n?r[i]:void 0,t.default,e.default)}function ir(t,e,i){if("number"!==Ji(i))return tr(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];var n=ri(t.stops.map((function(t){return t[0]})),i);return t.stops[n][1]}function rr(t,e,i){var r=void 0!==t.base?t.base:1;if("number"!==Ji(i))return tr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];var o=ri(t.stops.map((function(t){return t[0]})),i),a=function(t,e,i,r){var n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=ai[e.type]||$i;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=vi[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var i=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==r)return l(i,r,a)}}:l(s,u,a)}function nr(t,e,i){return"color"===e.type?i=me.parse(i):"formatted"===e.type?i=ge.fromString(i.toString()):"resolvedImage"===e.type?i=ve.fromString(i.toString()):Ji(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),tr(i,t.default,e.default)}Le.register(ji,{error:[{kind:"error"},[te],function(t,e){throw new Te(e[0].evaluate(t))}],typeof:[te,[ne],function(t,e){return le(we(e[0].evaluate(t)))}],"to-rgba":[ue($t,4),[ie],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[ie,[$t,$t,$t],Ni],rgba:[ie,[$t,$t,$t,$t],Ni],has:{type:ee,overloads:[[[te],function(t,e){return qi(e[0].evaluate(t),t.properties())}],[[te,re],function(t,e){var i=e[1];return qi(e[0].evaluate(t),i.evaluate(t))}]]},get:{type:ne,overloads:[[[te],function(t,e){return Zi(e[0].evaluate(t),t.properties())}],[[te,re],function(t,e){var i=e[1];return Zi(e[0].evaluate(t),i.evaluate(t))}]]},"feature-state":[ne,[te],function(t,e){return Zi(e[0].evaluate(t),t.featureState||{})}],properties:[re,[],function(t){return t.properties()}],"geometry-type":[te,[],function(t){return t.geometryType()}],id:[ne,[],function(t){return t.id()}],zoom:[$t,[],function(t){return t.globals.zoom}],"heatmap-density":[$t,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[$t,[],function(t){return t.globals.lineProgress||0}],accumulated:[ne,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[$t,Gi($t),function(t,e){for(var i=0,r=0,n=e;r":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[ee,[ne],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ee,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[ee,[ue(te)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[ee,[ue(ne)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[ee,[te,ue(ne)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[ee,[te,ue(ne)],function(t,e){var i=e[0],r=e[1];return function(t,e,i,r){for(;i<=r;){var n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:ee,overloads:[[[ee,ee],function(t,e){var i=e[1];return e[0].evaluate(t)&&i.evaluate(t)}],[Gi(ee),function(t,e){for(var i=0,r=e;i0&&"string"==typeof t[0]&&t[0]in ji}function sr(t,e){var i=new ii(ji,[],e?function(t){var e={color:ie,string:te,number:$t,enum:te,boolean:ee,formatted:ae,resolvedImage:se};return"array"===t.type?ue(e[t.value]||ne,t.length):e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Xi(new or(r,e)):Wi(i.errors)}or.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},or.prototype.evaluate=function(t,e,i,r,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new Te("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ur=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!$e(e.expression)};ur.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)},ur.prototype.evaluate=function(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)};var lr=function(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!$e(e.expression),this.interpolationType=r};function cr(t,e){if("error"===(t=sr(t,e)).result)return t;var i=t.value.expression,r=Qe(i);if(!r&&!Hi(e))return Wi([new Yt("","data expressions not supported")]);var n=ti(i,["zoom"]);if(!n&&!Ki(e))return Wi([new Yt("","zoom expressions not supported")]);var o=function t(e){var i=null;if(e instanceof Ii)i=t(e.result);else if(e instanceof wi)for(var r=0,n=e.args;rr.maximum?[new Gt(e,i,i+" is greater than the maximum value "+r.maximum)]:[]}function mr(t){var e,i,r,n=t.valueSpec,o=Ht(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Ji(t.value.stops)&&"array"===Ji(t.value.stops[0])&&"object"===Ji(t.value.stops[0][0]),c=hr({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 Gt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],i=t.value;return e=e.concat(fr({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Ji(i)&&0===i.length&&e.push(new Gt(t.key,i,"array must have at least one stop")),e},default:function(t){return Fr({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new Gt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new Gt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Yi(t.valueSpec)&&c.push(new Gt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Hi(t.valueSpec)?c.push(new Gt(t.key,t.value,"property functions not supported")):s&&!Ki(t.valueSpec)&&c.push(new Gt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new Gt(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],o=t.value,s=t.key;if("array"!==Ji(o))return[new Gt(s,o,"array expected, "+Ji(o)+" found")];if(2!==o.length)return[new Gt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Ji(o[0]))return[new Gt(s,o,"object expected, "+Ji(o[0])+" found")];if(void 0===o[0].zoom)return[new Gt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Gt(s,o,"object stop key must have value")];if(r&&r>Ht(o[0].zoom))return[new Gt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ht(o[0].zoom)!==r&&(r=Ht(o[0].zoom),i=void 0,a={}),e=e.concat(hr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:dr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return ar(Kt(o[1]))?e.concat([new Gt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Fr({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function h(t,r){var s=Ji(t.value),u=Ht(t.value),l=null!==t.value?t.value:r;if(e){if(s!==e)return[new Gt(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 Gt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Hi(n)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Gt(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==i&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));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,i=t.slice(1);ee?1:0}function wr(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?Ir(t[1],t[2],"=="):"!="===i?Ar(Ir(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?Ir(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(wr))):"all"===i?["all"].concat(t.slice(1).map(wr)):"none"===i?["all"].concat(t.slice(1).map(wr).map(Ar)):"in"===i?Sr(t[1],t.slice(2)):"!in"===i?Ar(Sr(t[1],t.slice(2))):"has"===i?Tr(t[1]):"!has"===i?Ar(Tr(t[1])):"within"!==i||t}function Ir(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Sr(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(br)]]:["filter-in-small",t,["literal",e]]}}function Tr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ar(t){return["!",t]}function zr(t){return gr(Kt(t.value))?yr(Wt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,r=e.key;if("array"!==Ji(i))return[new Gt(r,i,"array expected, "+Ji(i)+" found")];var n,o=e.styleSpec,a=[];if(i.length<1)return[new Gt(r,i,"filter array must have at least 1 element")];switch(a=a.concat(_r({key:r+"[0]",value:i[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ht(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===Ht(i[1])&&a.push(new Gt(r,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&a.push(new Gt(r,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(n=Ji(i[1]))&&a.push(new Gt(r+"[1]",i[1],"string expected, "+n+" found"));for(var s=2;s=c[f+0]&&r>=c[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},Hr.prototype._forEachCell=function(t,e,i,r,n,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(i),p=this._convertToCellCoord(r),h=u;h<=c;h++)for(var f=l;f<=p;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,i,r,d,o,a,s))return}},Hr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Hr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Hr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,r=0;r=0)){var c=t[l];u[l]=Jr[s].shallow.indexOf(l)>=0?c:rn(c,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function nn(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||tn(t)||en(t)||ArrayBuffer.isView(t)||t instanceof Kr)return t;if(Array.isArray(t))return t.map(nn);if("object"==typeof t){var e=t.$name||"Object",i=Jr[e].klass;if(!i)throw new Error("can't deserialize unregistered class "+e);if(i.deserialize)return i.deserialize(t);for(var r=Object.create(i.prototype),n=0,o=Object.keys(t);n=0?s:nn(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var on=function(){this.first=!0};on.prototype.update=function(t,e){var i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=12288&&t<=12351},sn=function(t){return t>=12352&&t<=12447},un=function(t){return t>=12448&&t<=12543},ln=function(t){return t>=19968&&t<=40959},cn=function(t){return t>=44032&&t<=55215},pn=function(t){return t>=65072&&t<=65103},hn=function(t){return t>=65104&&t<=65135},fn=function(t){return t>=65280&&t<=65519};function dn(t){for(var e=0,i=t;e=12704&&t<=12735}(t)||function(t){return t>=12544&&t<=12591}(t)||pn(t)&&!(t>=65097&&t<=65103)||function(t){return t>=63744&&t<=64255}(t)||function(t){return t>=13056&&t<=13311}(t)||function(t){return t>=11904&&t<=12031}(t)||function(t){return t>=12736&&t<=12783}(t)||!(!an(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||function(t){return t>=13312&&t<=19903}(t)||ln(t)||function(t){return t>=12800&&t<=13055}(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||cn(t)||sn(t)||function(t){return t>=12272&&t<=12287}(t)||function(t){return t>=12688&&t<=12703}(t)||function(t){return t>=12032&&t<=12255}(t)||function(t){return t>=12784&&t<=12799}(t)||un(t)&&12540!==t||!(!fn(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)||!(!hn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||function(t){return t>=65040&&t<=65055}(t)||function(t){return t>=19904&&t<=19967}(t)||function(t){return t>=40960&&t<=42127}(t)||function(t){return t>=42128&&t<=42191}(t))))}function yn(t){return!(mn(t)||function(t){return!!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||an(t)||un(t)||function(t){return t>=57344&&t<=63743}(t)||pn(t)||hn(t)||fn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function _n(t){return t>=1424&&t<=2303||function(t){return t>=64336&&t<=65023}(t)||function(t){return t>=65136&&t<=65279}(t)}function gn(t,e){return!(!e&&_n(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function vn(t){for(var e=0,i=t;e-1&&(bn="error"),xn&&xn(t)};function Sn(){Tn.fire(new jt("pluginStateChange",{pluginStatus:bn,pluginURL:wn}))}var Tn=new qt,An=function(){return bn},zn=function(){if("deferred"!==bn||!wn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");bn="loading",Sn(),wn&&Bt({url:wn},(function(t){t?In(t):(bn="loaded",Sn())}))},En={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===bn||null!=En.applyArabicShaping},isLoading:function(){return"loading"===bn},setState:function(t){bn=t.pluginStatus,wn=t.pluginURL},isParsed:function(){return null!=En.applyArabicShaping&&null!=En.processBidirectionalText&&null!=En.processStyledBidirectionalText},getPluginURL:function(){return wn}},kn=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 on,this.transition={})};kn.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,r=t;ithis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}};var Cn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Qi(t))return new pr(t,e);if(ar(t)){var i=cr(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=me.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};Cn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Cn.prototype.possiblyEvaluate=function(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)};var Pn=function(t){this.property=t,this.value=new Cn(t,void 0)};Pn.prototype.transitioned=function(t,e){return new Mn(this.property,this.value,e,m({},t.transition,this.transition),t.now)},Pn.prototype.untransitioned=function(){return new Mn(this.property,this.value,null,{},0)};var Dn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Dn.prototype.getValue=function(t){return T(this._values[t].value.value)},Dn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Pn(this._values[t].property)),this._values[t].value=new Cn(this._values[t].property,null===e?void 0:T(e))},Dn.prototype.getTransition=function(t){return T(this._values[t].transition)},Dn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Pn(this._values[t].property)),this._values[t].transition=T(e)||void 0},Dn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);ethis.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r=1)return 1;var e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}(a))}return n};var Ln=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Ln.prototype.possiblyEvaluate=function(t,e,i){for(var r=new Fn(this._properties),n=0,o=Object.keys(this._values);nr.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},e.prototype.interpolate=function(t){return t},e}(Vn),jn=function(t){this.specification=t};jn.prototype.possiblyEvaluate=function(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new kn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new kn(Math.floor(e.zoom),e)),t.expression.evaluate(new kn(Math.floor(e.zoom+1),e)),e)}},jn.prototype._calculate=function(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},jn.prototype.interpolate=function(t){return t};var Nn=function(t){this.specification=t};Nn.prototype.possiblyEvaluate=function(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)},Nn.prototype.interpolate=function(){return!1};var qn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var i=t[e];i.specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new Cn(i,void 0),n=this.defaultTransitionablePropertyValues[e]=new Pn(i);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};Qr("DataDrivenProperty",Vn),Qr("DataConstantProperty",On),Qr("CrossFadedDataDrivenProperty",Un),Qr("CrossFadedProperty",jn),Qr("ColorRampProperty",Nn);var Zn=function(t){function e(e,i){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=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),i.layout&&(this._unevaluatedLayout=new Bn(i.layout)),i.paint)){for(var r in this._transitionablePaint=new Dn(i.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Fn(i.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){void 0===i&&(i={}),null!=e&&this._validate(Gr,"layers."+this.id+".layout."+t,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return w(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,i){if(void 0===i&&(i={}),null!=e&&this._validate(Zr,"layers."+this.id+".paint."+t,t,e,i))return!1;if(w(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||n||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,i){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&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,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},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),S(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,i,r,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Xr(this,t.call(Nr,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:Zt,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 Rn&&Hi(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(qt),Gn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xn=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},Wn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Hn(t,e){void 0===e&&(e=1);var i=0,r=0;return{members:t.map((function(t){var n=Gn[t.type].BYTES_PER_ELEMENT,o=i=Kn(i,Math.max(e,n)),a=t.components||1;return r=Math.max(r,n),i+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Kn(i,Math.max(r,e)),alignment:e}}function Kn(t,e){return Math.ceil(t/e)*e}Wn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Wn.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},Wn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Wn.prototype.clear=function(){this.length=0},Wn.prototype.resize=function(t){this.reserve(t),this.length=t},Wn.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)}},Wn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t},e}(Wn);Yn.prototype.bytesPerElement=4,Qr("StructArrayLayout2i4",Yn);var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,t},e}(Wn);Jn.prototype.bytesPerElement=8,Qr("StructArrayLayout4i8",Jn);var Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)},e.prototype.emplace=function(t,e,i,r,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Wn);Qn.prototype.bytesPerElement=12,Qr("StructArrayLayout2i4i12",Qn);var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)},e.prototype.emplace=function(t,e,i,r,n,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.uint8[u+4]=r,this.uint8[u+5]=n,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Wn);$n.prototype.bytesPerElement=8,Qr("StructArrayLayout2i4ub8",$n);var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t},e}(Wn);to.prototype.bytesPerElement=8,Qr("StructArrayLayout2f8",to);var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,o,a,s,u,l)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c){var p=10*t;return this.uint16[p+0]=e,this.uint16[p+1]=i,this.uint16[p+2]=r,this.uint16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=u,this.uint16[p+8]=l,this.uint16[p+9]=c,t},e}(Wn);eo.prototype.bytesPerElement=20,Qr("StructArrayLayout10ui20",eo);var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o,a,s,u,l,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,n,o,a,s,u,l,c,p)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=n,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(Wn);io.prototype.bytesPerElement=24,Qr("StructArrayLayout4i4ui4i24",io);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t},e}(Wn);ro.prototype.bytesPerElement=12,Qr("StructArrayLayout3f12",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint32[1*t+0]=e,t},e}(Wn);no.prototype.bytesPerElement=4,Qr("StructArrayLayout1ul4",no);var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,r,n,o,a,s,u)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l){var c=10*t,p=5*t;return this.int16[c+0]=e,this.int16[c+1]=i,this.int16[c+2]=r,this.int16[c+3]=n,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[p+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Wn);oo.prototype.bytesPerElement=20,Qr("StructArrayLayout6i1ul2ui20",oo);var ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)},e.prototype.emplace=function(t,e,i,r,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Wn);ao.prototype.bytesPerElement=12,Qr("StructArrayLayout2i2i2i12",ao);var so=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n)},e.prototype.emplace=function(t,e,i,r,n,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.int16[s+6]=n,this.int16[s+7]=o,t},e}(Wn);so.prototype.bytesPerElement=16,Qr("StructArrayLayout2f1f2i16",so);var uo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[a+1]=r,this.float32[a+2]=n,t},e}(Wn);uo.prototype.bytesPerElement=12,Qr("StructArrayLayout2ub2f12",uo);var lo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t},e}(Wn);lo.prototype.bytesPerElement=6,Qr("StructArrayLayout3ui6",lo);var co=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y){var _=this.length;return this.resize(_+1),this.emplace(_,t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_){var g=24*t,v=12*t,x=48*t;return this.int16[g+0]=e,this.int16[g+1]=i,this.uint16[g+2]=r,this.uint16[g+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=c,this.float32[v+7]=p,this.float32[v+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[v+10]=y,this.int16[g+22]=_,t},e}(Wn);co.prototype.bytesPerElement=48,Qr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",co);var po=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_,g,v,x,b,w,I,S,T,A,z){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_,g,v,x,b,w,I,S,T,A,z)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_,g,v,x,b,w,I,S,T,A,z,E){var k=34*t,C=17*t;return this.int16[k+0]=e,this.int16[k+1]=i,this.int16[k+2]=r,this.int16[k+3]=n,this.int16[k+4]=o,this.int16[k+5]=a,this.int16[k+6]=s,this.int16[k+7]=u,this.uint16[k+8]=l,this.uint16[k+9]=c,this.uint16[k+10]=p,this.uint16[k+11]=h,this.uint16[k+12]=f,this.uint16[k+13]=d,this.uint16[k+14]=m,this.uint16[k+15]=y,this.uint16[k+16]=_,this.uint16[k+17]=g,this.uint16[k+18]=v,this.uint16[k+19]=x,this.uint16[k+20]=b,this.uint16[k+21]=w,this.uint16[k+22]=I,this.uint32[C+12]=S,this.float32[C+13]=T,this.float32[C+14]=A,this.float32[C+15]=z,this.float32[C+16]=E,t},e}(Wn);po.prototype.bytesPerElement=68,Qr("StructArrayLayout8i15ui1ul4f68",po);var ho=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.float32[1*t+0]=e,t},e}(Wn);ho.prototype.bytesPerElement=4,Qr("StructArrayLayout1f4",ho);var fo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t},e}(Wn);fo.prototype.bytesPerElement=6,Qr("StructArrayLayout3i6",fo);var mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t},e}(Wn);mo.prototype.bytesPerElement=8,Qr("StructArrayLayout1ul2ui8",mo);var yo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t},e}(Wn);yo.prototype.bytesPerElement=4,Qr("StructArrayLayout2ui4",yo);var _o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint16[1*t+0]=e,t},e}(Wn);_o.prototype.bytesPerElement=2,Qr("StructArrayLayout1ui2",_o);var go=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,t},e}(Wn);go.prototype.bytesPerElement=16,Qr("StructArrayLayout4f16",go);var vo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,i),e}(Xn);vo.prototype.size=20;var xo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new vo(this,t)},e}(oo);Qr("CollisionBoxArray",xo);var bo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},i.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},i.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},i.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},i.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,i),e}(Xn);bo.prototype.size=48;var wo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new bo(this,t)},e}(co);Qr("PlacedSymbolArray",wo);var Io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},i.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},i.key.get=function(){return this._structArray.uint16[this._pos2+8]},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},i.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},i.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},i.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},i.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},i.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},i.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},i.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,i),e}(Xn);Io.prototype.size=68;var So=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Io(this,t)},e}(po);Qr("SymbolInstanceArray",So);var To=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ho);Qr("GlyphOffsetArray",To);var Ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(fo);Qr("SymbolLineVertexArray",Ao);var zo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,i),e}(Xn);zo.prototype.size=8;var Eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new zo(this,t)},e}(mo);Qr("FeatureIndexArray",Eo);var ko=Hn([{name:"a_pos",components:2,type:"Int16"}],4).members,Co=function(t){void 0===t&&(t=[]),this.segments=t};function Po(t,e){return 256*(t=p(Math.floor(t),0,255))+p(Math.floor(e),0,255)}Co.prototype.prepareSegment=function(t,e,i,r){var n=this.segments[this.segments.length-1];return t>Co.MAX_VERTEX_ARRAY_LENGTH&&z("Max vertices per segment is "+Co.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Co.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n},Co.prototype.get=function(){return this.segments},Co.prototype.destroy=function(){for(var t=0,e=this.segments;t>>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,i){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}})),Lo=t((function(t){t.exports=function(t,e){for(var i,r=t.length,n=e^r,o=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){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}})),Bo=Mo,Ro=Lo;Bo.murmur3=Mo,Bo.murmur2=Ro;var Fo=function(){this.ids=[],this.positions=[],this.indexed=!1};Fo.prototype.add=function(t,e,i,r){this.ids.push(Vo(t)),this.positions.push(e,i,r)},Fo.prototype.getPositions=function(t){for(var e=Vo(t),i=0,r=this.ids.length-1;i>1;this.ids[n]>=e?r=n:i=n+1}for(var o=[];this.ids[i]===e;)o.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return o},Fo.serialize=function(t,e){var i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,i,r,n){for(;r>1],a=r-1,s=n+1;;){do{a++}while(e[a]o);if(a>=s)break;Uo(e,a,s),Uo(i,3*a,3*s),Uo(i,3*a+1,3*s+1),Uo(i,3*a+2,3*s+2)}s-ra.x+1||ua.y+1)&&z("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function la(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ua(t):[]}}function ca(t,e,i,r,n){t.emplaceBack(2*e+(r+1)/2,2*i+(n+1)/2)}var pa=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 Yn,this.indexArray=new lo,this.segments=new Co,this.programConfigurations=new ra(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ha(t,e){for(var i=0;i1){if(ya(t,e))return!0;for(var r=0;r1?i:i.sub(e)._mult(n)._add(e))}function xa(t,e){for(var i,r,n,o=!1,a=0;ae.y!=(n=i[u]).y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(o=!o);return o}function ba(t,e){for(var i=!1,r=0,n=t.length-1;re.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}function wa(t,e,i){var r=i[0],n=i[2];if(t.xn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;var o=E(t,e,i[0]);return o!==E(t,e,i[1])||o!==E(t,e,i[2])||o!==E(t,e,i[3])}function Ia(t,e,i){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Sa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ta(t,e,i,r,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===i&&a._rotate(-r);for(var s=[],u=0;u=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;ca(this.layoutVertexArray,l,c,-1,-1),ca(this.layoutVertexArray,l,c,1,-1),ca(this.layoutVertexArray,l,c,1,1),ca(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},r)},Qr("CircleBucket",pa,{omit:["layers"]});var Aa=new qn({"circle-sort-key":new Vn(Zt.layout_circle["circle-sort-key"])}),za={paint:new qn({"circle-radius":new Vn(Zt.paint_circle["circle-radius"]),"circle-color":new Vn(Zt.paint_circle["circle-color"]),"circle-blur":new Vn(Zt.paint_circle["circle-blur"]),"circle-opacity":new Vn(Zt.paint_circle["circle-opacity"]),"circle-translate":new On(Zt.paint_circle["circle-translate"]),"circle-translate-anchor":new On(Zt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new On(Zt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new On(Zt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Vn(Zt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Vn(Zt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Vn(Zt.paint_circle["circle-stroke-opacity"])}),layout:Aa},Ea="undefined"!=typeof Float32Array?Float32Array:Array;function ka(){var t=new Ea(16);return Ea!=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 Ca(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 Pa(t,e){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],_=e[15],g=i*s-r*a,v=i*u-n*a,x=i*l-o*a,b=r*u-n*s,w=r*l-o*s,I=n*l-o*u,S=c*m-p*d,T=c*y-h*d,A=c*_-f*d,z=p*y-h*m,E=p*_-f*m,k=h*_-f*y,C=g*k-v*E+x*z+b*A-w*T+I*S;return C?(t[0]=(s*k-u*E+l*z)*(C=1/C),t[1]=(n*E-r*k-o*z)*C,t[2]=(m*I-y*w+_*b)*C,t[3]=(h*w-p*I-f*b)*C,t[4]=(u*A-a*k-l*T)*C,t[5]=(i*k-n*A+o*T)*C,t[6]=(y*x-d*I-_*v)*C,t[7]=(c*I-h*x+f*v)*C,t[8]=(a*E-s*A+l*S)*C,t[9]=(r*A-i*E-o*S)*C,t[10]=(d*w-m*x+_*g)*C,t[11]=(p*x-c*w-f*g)*C,t[12]=(s*T-a*z-u*S)*C,t[13]=(i*z-r*T+n*S)*C,t[14]=(m*v-d*b-y*g)*C,t[15]=(c*b-p*v+h*g)*C,t):null}function Da(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],_=e[14],g=e[15],v=i[0],x=i[1],b=i[2],w=i[3];return t[0]=v*r+x*s+b*p+w*m,t[1]=v*n+x*u+b*h+w*y,t[2]=v*o+x*l+b*f+w*_,t[3]=v*a+x*c+b*d+w*g,t[4]=(v=i[4])*r+(x=i[5])*s+(b=i[6])*p+(w=i[7])*m,t[5]=v*n+x*u+b*h+w*y,t[6]=v*o+x*l+b*f+w*_,t[7]=v*a+x*c+b*d+w*g,t[8]=(v=i[8])*r+(x=i[9])*s+(b=i[10])*p+(w=i[11])*m,t[9]=v*n+x*u+b*h+w*y,t[10]=v*o+x*l+b*f+w*_,t[11]=v*a+x*c+b*d+w*g,t[12]=(v=i[12])*r+(x=i[13])*s+(b=i[14])*p+(w=i[15])*m,t[13]=v*n+x*u+b*h+w*y,t[14]=v*o+x*l+b*f+w*_,t[15]=v*a+x*c+b*d+w*g,t}function Ma(t,e,i){var r,n,o,a,s,u,l,c,p,h,f,d,m=i[0],y=i[1],_=i[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]):(n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=r*m+s*y+p*_+e[12],t[13]=n*m+u*y+h*_+e[13],t[14]=o*m+l*y+f*_+e[14],t[15]=a*m+c*y+d*_+e[15]),t}function La(t,e,i){var r=i[0],n=i[1],o=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,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 Ba(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],p=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*r,t[1]=a*n+c*r,t[2]=s*n+p*r,t[3]=u*n+h*r,t[4]=l*n-o*r,t[5]=c*n-a*r,t[6]=p*n-s*r,t[7]=h*n-u*r,t}function Ra(t,e,i,r,n,o,a){var s=1/(e-i),u=1/(r-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+i)*s,t[13]=(n+r)*u,t[14]=(a+o)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,i=arguments.length;i--;)e+=t[i]*t[i];return Math.sqrt(e)});var Fa=Da;function Oa(t){var e=new Ea(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}var Va,Ua=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};function ja(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*a,t[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*a,t[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*a,t[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*a,t}Va=new Ea(3),Ea!=Float32Array&&(Va[0]=0,Va[1]=0,Va[2]=0),function(){var t=new Ea(4);Ea!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Na=function(t){var e=t[0],i=t[1];return e*e+i*i},qa=(function(){var t=new Ea(2);Ea!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,za)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new pa(t)},e.prototype.queryRadius=function(t){var e=t;return Ia("circle-radius",this,e)+Ia("circle-stroke-width",this,e)+Sa(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,o,a,s){for(var u=Ta(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),c="map"===this.paint.get("circle-pitch-alignment"),p=c?u:function(t,e){return t.map((function(t){return Za(t,e)}))}(u,s),h=c?l*a:l,f=0,d=r;ft.width||n.height>t.height||i.x>t.width-n.width||i.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||r.x>e.width-n.width||r.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;u80*i){r=o=t[0],n=a=t[1];for(var d=i;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-r,a-n))?1/l:0}return us(h,f,i,r,n,l),f}function as(t,e,i,r,n){var o,a;if(n===Cs(t,e,i,r)>0)for(o=e;o=e;o-=r)a=zs(o,t[o],t[o+1],a);return a&&bs(a,a.next)&&(Es(a),a=a.next),a}function ss(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!bs(r,r.next)&&0!==xs(r.prev,r,r.next))r=r.next;else{if(Es(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function us(t,e,i,r,n,o,a){if(t){!a&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=ys(n.x,n.y,e,i,r)),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,i,r,n,o,a,s,u,l=1;do{for(i=t,t=null,o=null,a=0;i;){for(a++,r=i,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,l*=2}while(a>1)}(n)}(t,r,n,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?cs(t,r,n,o):ls(t))e.push(s.i/i),e.push(t.i/i),e.push(u.i/i),Es(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?us(t=ps(ss(t),e,i),e,i,r,n,o,2):2===a&&hs(t,e,i,r,n,o):us(ss(t),e,i,r,n,o,1);break}}}function ls(t){var e=t.prev,i=t,r=t.next;if(xs(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(gs(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&xs(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function cs(t,e,i,r){var n=t.prev,o=t,a=t.next;if(xs(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=ys(n.x=l&&h&&h.z<=c;){if(p!==t.prev&&p!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==t.prev&&h!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&xs(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&xs(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function ps(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!bs(n,o)&&ws(n,r,r.next,o)&&Ts(n,o)&&Ts(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),Es(r),Es(r.next),r=t=o),r=r.next}while(r!==t);return ss(r)}function hs(t,e,i,r,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&vs(a,s)){var u=As(a,s);return a=ss(a,a.next),u=ss(u,u.next),us(a,e,i,r,n,o),void us(u,e,i,r,n,o)}s=s.next}a=a.next}while(a!==t)}function fs(t,e){return t.x-e.x}function ds(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=c&&n!==r.x&&gs(oi.x||r.x===i.x&&ms(i,r)))&&(i=r,h=u)),r=r.next}while(r!==l);return i}(t,e)){var i=As(e,t);ss(e,e.next),ss(i,i.next)}}function ms(t,e){return xs(t.prev,t,e.prev)<0&&xs(e.next,t,t.next)<0}function ys(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function _s(t){var e=t,i=t;do{(e.x=0&&(t-a)*(r-s)-(i-a)*(e-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function vs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ws(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Ts(t,e)&&Ts(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(xs(t.prev,t,e.prev)||xs(t,e.prev,e))||bs(t,e)&&xs(t.prev,t,t.next)>0&&xs(e.prev,e,e.next)>0)}function xs(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function bs(t,e){return t.x===e.x&&t.y===e.y}function ws(t,e,i,r){var n=Ss(xs(t,e,i)),o=Ss(xs(t,e,r)),a=Ss(xs(i,r,t)),s=Ss(xs(i,r,e));return n!==o&&a!==s||!(0!==n||!Is(t,i,e))||!(0!==o||!Is(t,r,e))||!(0!==a||!Is(i,t,r))||!(0!==s||!Is(i,e,r))}function Is(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Ss(t){return t>0?1:t<0?-1:0}function Ts(t,e){return xs(t.prev,t,t.next)<0?xs(t,e,t.next)>=0&&xs(t,t.prev,e)>=0:xs(t,e,t.prev)<0||xs(t,t.next,e)<0}function As(t,e){var i=new ks(t.i,t.x,t.y),r=new ks(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function zs(t,e,i,r){var n=new ks(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Es(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 ks(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cs(t,e,i,r){for(var n=0,o=e,a=i-r;or;){if(n-r>600){var a=n-r+1,s=i-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,i,Math.max(r,Math.floor(i-s*l/a+c)),Math.min(n,Math.floor(i+(a-s)*l/a+c)),o)}var p=e[i],h=r,f=n;for(Ds(e,r,i),o(e[n],p)>0&&Ds(e,r,n);h0;)f--}0===o(e[r],p)?Ds(e,r,f):Ds(e,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}(t,e,i||0,r||t.length-1,n||Ms)}function Ds(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function Ms(t,e){return te?1:0}function Ls(t,e){var i=t.length;if(i<=1)return[t];for(var r,n,o=[],a=0;a1)for(var u=0;u0&&i.holes.push(r+=t[n-1].length)}return i},rs.default=ns;var Os=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 Yn,this.indexArray=new lo,this.indexArray2=new yo,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new Co,this.segments2=new Co,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Os.prototype.populate=function(t,e,i){this.hasPattern=Rs("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],o=0,a=t;o>3}if(o--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new n(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Zs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,n=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos>3}if(r--,1===i||2===i)(n+=t.readSVarint())s&&(s=n),(o+=t.readSVarint())l&&(l=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,u,s,l]},Zs.prototype.toGeoJSON=function(t,e,i){var r,n,o=this.extent*Math.pow(2,i),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Zs.types[this.type];function c(t){for(var e=0;e>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}function Ys(t,e,i){if(3===t){var r=new Ws(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}Hs.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 qs(this._pbf,e,this.extent,this._keys,this._values)};var Js={VectorTile:function(t,e){this.layers=t.readFields(Ys,{},e)},VectorTileFeature:qs,VectorTileLayer:Ws},Qs=Js.VectorTileFeature.types,$s=Math.pow(2,13);function tu(t,e,i,r,n,o,a,s){t.emplaceBack(e,i,2*Math.floor(r*$s)+a,n*$s*2,o*$s*2,Math.round(s))}var eu=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 Qn,this.indexArray=new lo,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new Co,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function iu(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}eu.prototype.populate=function(t,e,i){this.features=[],this.hasPattern=Rs("fill-extrusion",this.layers,e);for(var r=0,n=t;r8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var m=0,y=0;y=1){var g=d[y-1];if(!iu(_,g)){p.vertexLength+4>Co.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=_.sub(g)._perp()._unit(),x=g.dist(_);m+x>32768&&(m=0),tu(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,m),tu(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,m),tu(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,m+=x),tu(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,m);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+u>Co.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===Qs[t.type]){for(var w=[],I=[],S=p.vertexLength,T=0,A=s;T=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(I&&_>l){var T=c.dist(f);if(T>2*p){var A=c.sub(c.sub(f)._mult(p/T)._round());this.updateDistance(f,A),this.addCurrentVertex(A,m,0,0,h),f=A}}var z=f&&d,E=z?i:s?"butt":r;if(z&&"round"===E&&(bn&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b100)g=y.mult(-1);else{var k=b*m.add(y).mag()/m.sub(y).mag();g._perp()._mult(k*(S?-1:1))}this.addCurrentVertex(c,g,0,0,h),this.addCurrentVertex(c,g.mult(-1),0,0,h)}else if("bevel"===E||"fakeround"===E){var C=-Math.sqrt(b*b-1),P=S?C:0,D=S?0:C;if(f&&this.addCurrentVertex(c,m,P,D,h),"fakeround"===E)for(var M=Math.round(180*w/Math.PI/20),L=1;L2*p){var U=c.add(d.sub(c)._mult(p/V)._round());this.updateDistance(c,U),this.addCurrentVertex(U,y,0,0,h),c=U}}}}},hu.prototype.addCurrentVertex=function(t,e,i,r,n,o){void 0===o&&(o=!1);var a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,n),this.addHalfVertex(t,a,s,o,!0,-r,n),this.distance>pu/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,i,r,n,o))},hu.prototype.addHalfVertex=function(t,e,i,r,n,o,a){var s=.5*(this.lineClips?this.scaledDistance*(pu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(r?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*i)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),n?this.e2=u:this.e1=u},hu.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},hu.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Qr("LineBucket",hu,{omit:["layers","patternFeatures"]});var fu=new qn({"line-cap":new On(Zt.layout_line["line-cap"]),"line-join":new Vn(Zt.layout_line["line-join"]),"line-miter-limit":new On(Zt.layout_line["line-miter-limit"]),"line-round-limit":new On(Zt.layout_line["line-round-limit"]),"line-sort-key":new Vn(Zt.layout_line["line-sort-key"])}),du={paint:new qn({"line-opacity":new Vn(Zt.paint_line["line-opacity"]),"line-color":new Vn(Zt.paint_line["line-color"]),"line-translate":new On(Zt.paint_line["line-translate"]),"line-translate-anchor":new On(Zt.paint_line["line-translate-anchor"]),"line-width":new Vn(Zt.paint_line["line-width"]),"line-gap-width":new Vn(Zt.paint_line["line-gap-width"]),"line-offset":new Vn(Zt.paint_line["line-offset"]),"line-blur":new Vn(Zt.paint_line["line-blur"]),"line-dasharray":new jn(Zt.paint_line["line-dasharray"]),"line-pattern":new Un(Zt.paint_line["line-pattern"]),"line-gradient":new Nn(Zt.paint_line["line-gradient"])}),layout:fu},mu=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,i){return i=new kn(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),t.prototype.possiblyEvaluate.call(this,e,i)},e.prototype.evaluate=function(e,i,r,n){return i=m({},i,{zoom:Math.floor(i.zoom)}),t.prototype.evaluate.call(this,e,i,r,n)},e}(Vn))(du.paint.properties["line-width"].specification);mu.useIntegerZoom=!0;var yu=function(t){function e(e){t.call(this,e,du),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ni,this.gradientVersion=(this.gradientVersion+1)%u)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i),this.paint._values["line-floorwidth"]=mu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new hu(t)},e.prototype.queryRadius=function(t){var e=t,i=_u(Ia("line-width",this,e),Ia("line-gap-width",this,e)),r=Ia("line-offset",this,e);return i/2+Math.abs(r)+Sa(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,o,a,s){var u=Ta(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*_u(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),c=this.paint.get("line-offset").evaluate(e,i);return c&&(r=function(t,e){for(var i=[],r=new n(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var gu=Hn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),vu=Hn([{name:"a_projected_pos",components:3,type:"Float32"}],4),xu=(Hn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Hn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),bu=(Hn([{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"}]),Hn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),wu=Hn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Iu(t,e,i){return t.sections.forEach((function(t){t.text=function(t,e,i){var r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),En.applyArabicShaping&&(t=En.applyArabicShaping(t)),t}(t.text,e,i)})),t}Hn([{name:"triangle",components:3,type:"Uint16"}]),Hn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Hn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Hn([{type:"Float32",name:"offsetX"}]),Hn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Su={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Tu=function(t,e,i,r,n){var o,a,s=8*n-r-1,u=(1<>1,c=-7,p=i?n-1:0,h=i?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)},Au=function(t,e,i,r,n,o){var a,s,u,l=8*o-n-1,c=(1<>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?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=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,n),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;t[i+f]=255&s,f+=d,s/=256,n-=8);for(a=a<0;t[i+f]=255&a,f+=d,a/=256,l-=8);t[i+f-d]|=128*m},zu=Eu;function Eu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Eu.Varint=0,Eu.Fixed64=1,Eu.Bytes=2,Eu.Fixed32=5;var ku="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Cu(t){return t.type===Eu.Bytes?t.readVarint()+t.pos:t.pos+1}function Pu(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Du(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function Mu(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Zu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Gu(t,e,i){1===t&&i.readMessage(Xu,e)}function Xu(t,e,i){if(3===t){var r=i.readMessage(Wu,{}),n=r.width,o=r.height,a=r.left,s=r.top,u=r.advance;e.push({id:r.id,bitmap:new Ka({width:n+6,height:o+6},r.bitmap),metrics:{width:n,height:o,left:a,top:s,advance:u}})}}function Wu(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function Hu(t){for(var e=0,i=0,r=0,n=t;r=0;h--){var f=a[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=a.pop();h>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Nu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Zu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Nu(this.buf,this.pos)+4294967296*Nu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Nu(this.buf,this.pos)+4294967296*Zu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Tu(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Tu(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(r=(112&(n=o[i.pos++]))>>4,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<3,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<10,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<17,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<24,n<128)return Pu(t,r,e);if(r|=(1&(n=o[i.pos++]))<<31,n<128)return Pu(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[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=this.pos;return this.pos=t,t-e>=12&&ku?function(t,e,i){return ku.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",n=e;n239?4:u>223?3:u>191?2:1;if(n+c>i)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&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,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=c}return r}(this.buf,e,t)},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!==Eu.Bytes)return t.push(this.readVarint(e));var i=Cu(this);for(t=t||[];this.pos127;);else if(e===Eu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Eu.Fixed32)this.pos+=4;else{if(e!==Eu.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;e268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,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,i){for(var r,n,o=0;o55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Du(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Au(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Au(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 i=0;i=128&&Du(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Eu.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Mu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Lu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Fu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Bu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ru,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ou,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Vu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Uu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ju,e)},writeBytesField:function(t,e){this.writeTag(t,Eu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Eu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Eu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Eu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Eu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Eu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Eu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Eu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Eu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Eu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ku=function(t,e){var i=e.pixelRatio,r=e.version,n=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=i,this.stretchX=n,this.stretchY=o,this.content=a,this.version=r},Yu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Yu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Yu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Yu.tlbr.get=function(){return this.tl.concat(this.br)},Yu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ku.prototype,Yu);var Ju=function(t,e){var i={},r={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,i,n),this.addImages(e,r,n);var o=Hu(n),a=new Ya({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=i[s].paddedRect;Ya.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var p=e[c],h=r[c].paddedRect,f=h.x+1,d=h.y+1,m=p.data.width,y=p.data.height;Ya.copy(p.data,a,{x:0,y:0},{x:f,y:d},p.data),Ya.copy(p.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),Ya.copy(p.data,a,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),Ya.copy(p.data,a,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),Ya.copy(p.data,a,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=a,this.iconPositions=i,this.patternPositions=r};Ju.prototype.addImages=function(t,e,i){for(var r in t){var n=t[r],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};i.push(o),e[r]=new Ku(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},Ju.prototype.patchUpdatedImages=function(t,e){for(var i in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)},Ju.prototype.patchUpdatedImage=function(t,e,i){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl;i.update(e.data,void 0,{x:r[0],y:r[1]})}},Qr("ImagePosition",Ku),Qr("ImageAtlas",Ju);var Qu={horizontal:1,vertical:2,horizontalOnly:3},$u=function(){this.scale=1,this.fontStack="",this.imageName=null};$u.forText=function(t,e){var i=new $u;return i.scale=t||1,i.fontStack=e,i},$u.forImage=function(t){var e=new $u;return e.imageName=t,e};var tl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};tl.fromFeature=function(t,e){for(var i=new tl,r=0;r=0&&r>=t&&el[this.text.charCodeAt(r)];r--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)},tl.prototype.substring=function(t,e){var i=new tl;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i},tl.prototype.toString=function(){return this.text},tl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,i){return Math.max(e,t.sections[i].scale)}),0)},tl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push($u.forText(t.scale,t.fontStack||e));for(var i=this.sections.length-1,r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var el={};function il(t){var e=.5,i=.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":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function rl(t,e){var i=e.expression;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new kn(t+1))};if("source"===i.kind)return{kind:"source"};for(var r=i.zoomStops,n=i.interpolationType,o=0;o0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],u||l){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new kn(this.zoom),m=0,y=t;m=0;for(var D=0,M=S.sections;D=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;u0},yl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs,n=i.vertexStartIndex;n1||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 i=0,r=this.symbolInstanceIndexes;i=0&&r.indexOf(t)===i&&e.addIndicesForPlacedSymbol(e.text,t)})),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Qr("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=hl;var _l=new qn({"symbol-placement":new On(Zt.layout_symbol["symbol-placement"]),"symbol-spacing":new On(Zt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new On(Zt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Vn(Zt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new On(Zt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new On(Zt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new On(Zt.layout_symbol["icon-ignore-placement"]),"icon-optional":new On(Zt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new On(Zt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Vn(Zt.layout_symbol["icon-size"]),"icon-text-fit":new On(Zt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new On(Zt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Vn(Zt.layout_symbol["icon-image"]),"icon-rotate":new Vn(Zt.layout_symbol["icon-rotate"]),"icon-padding":new On(Zt.layout_symbol["icon-padding"]),"icon-keep-upright":new On(Zt.layout_symbol["icon-keep-upright"]),"icon-offset":new Vn(Zt.layout_symbol["icon-offset"]),"icon-anchor":new Vn(Zt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new On(Zt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new On(Zt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new On(Zt.layout_symbol["text-rotation-alignment"]),"text-field":new Vn(Zt.layout_symbol["text-field"]),"text-font":new Vn(Zt.layout_symbol["text-font"]),"text-size":new Vn(Zt.layout_symbol["text-size"]),"text-max-width":new Vn(Zt.layout_symbol["text-max-width"]),"text-line-height":new On(Zt.layout_symbol["text-line-height"]),"text-letter-spacing":new Vn(Zt.layout_symbol["text-letter-spacing"]),"text-justify":new Vn(Zt.layout_symbol["text-justify"]),"text-radial-offset":new Vn(Zt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new On(Zt.layout_symbol["text-variable-anchor"]),"text-anchor":new Vn(Zt.layout_symbol["text-anchor"]),"text-max-angle":new On(Zt.layout_symbol["text-max-angle"]),"text-writing-mode":new On(Zt.layout_symbol["text-writing-mode"]),"text-rotate":new Vn(Zt.layout_symbol["text-rotate"]),"text-padding":new On(Zt.layout_symbol["text-padding"]),"text-keep-upright":new On(Zt.layout_symbol["text-keep-upright"]),"text-transform":new Vn(Zt.layout_symbol["text-transform"]),"text-offset":new Vn(Zt.layout_symbol["text-offset"]),"text-allow-overlap":new On(Zt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new On(Zt.layout_symbol["text-ignore-placement"]),"text-optional":new On(Zt.layout_symbol["text-optional"])}),gl={paint:new qn({"icon-opacity":new Vn(Zt.paint_symbol["icon-opacity"]),"icon-color":new Vn(Zt.paint_symbol["icon-color"]),"icon-halo-color":new Vn(Zt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Vn(Zt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Vn(Zt.paint_symbol["icon-halo-blur"]),"icon-translate":new On(Zt.paint_symbol["icon-translate"]),"icon-translate-anchor":new On(Zt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Vn(Zt.paint_symbol["text-opacity"]),"text-color":new Vn(Zt.paint_symbol["text-color"],{runtimeType:ie,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Vn(Zt.paint_symbol["text-halo-color"]),"text-halo-width":new Vn(Zt.paint_symbol["text-halo-width"]),"text-halo-blur":new Vn(Zt.paint_symbol["text-halo-blur"]),"text-translate":new On(Zt.paint_symbol["text-translate"]),"text-translate-anchor":new On(Zt.paint_symbol["text-translate-anchor"])}),layout:_l},vl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Qt,this.defaultValue=t};vl.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},vl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},vl.prototype.outputDefined=function(){return!1},vl.prototype.serialize=function(){return null},Qr("FormatSectionOverride",vl,{omit:["defaultValue"]});var xl=function(t){function e(e){t.call(this,e,gl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){if(t.prototype.recalculate.call(this,e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"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 n=[],o=0,a=r;o=0?1.2:1))}function Ul(t,e,i,r,n,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:n,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],Nl.loadGlyphRange(r,s,i.url,i.requestManager,(function(t,e){if(e){for(var r in e)i._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var n=0,a=u;n1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),p=Math.min(l,c),h=void 0,f=n/i*(r+1);if(s.isDash){var d=r-Math.abs(f);h=Math.sqrt(p*p+d*d)}else h=r-Math.sqrt(p*p+f*f);this.data[o+u]=Math.max(0,Math.min(255,h+128))}},Xl.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1))}var n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l1&&(u=t[++s]);var c=Math.abs(l-u.left),p=Math.abs(l-u.right),h=Math.min(c,p);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?h:-h)+128))}},Xl.prototype.addDash=function(t,e){var i=e?7:0,r=2*i+1;if(this.nextRow+r>this.height)return z("LineAtlas out of space"),null;for(var n=0,o=0;o",targetMapId:r,sourceMapId:o.mapId})}}},Hl.prototype.receive=function(t){var e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[i];var r=this.cancelCallbacks[i];delete this.cancelCallbacks[i],r&&r()}else C()||e.mustQueue?(this.tasks[i]=e,this.taskQueue.push(i),this.invoker.trigger()):this.processTask(i,e)},Hl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hl.prototype.processTask=function(t,e){var i=this;if(""===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(nn(e.error)):r(null,nn(e.data)))}else{var n=!1,o=M(this.globalScope)?void 0:[],a=e.hasCallback?function(e,r){n=!0,delete i.cancelCallbacks[t],i.target.postMessage({id:t,type:"",sourceMapId:i.mapId,error:e?rn(e):null,data:rn(r,o)},o)}:function(t){n=!0},s=null,u=nn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!n&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Kl=function t(e,i){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=g();for(var r=this.workerPool.acquire(this.id),n=0;nthis._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n},Jl.convert=function(t){return!t||t instanceof Jl?t:new Jl(t)};var Ql=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")};Ql.prototype.wrap=function(){return new Ql(h(this.lng,-180,180),this.lat)},Ql.prototype.toArray=function(){return[this.lng,this.lat]},Ql.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ql.prototype.distanceTo=function(t){var e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},Ql.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new Jl(new Ql(this.lng-i,this.lat-e),new Ql(this.lng+i,this.lat+e))},Ql.convert=function(t){if(t instanceof Ql)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ql(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ql(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var $l=2*Math.PI*6371008.8;function tc(t){return $l*Math.cos(t*Math.PI/180)}function ec(t){return(180+t)/360}function ic(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function rc(t,e){return t/tc(e)}function nc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var oc=function(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i};oc.fromLngLat=function(t,e){void 0===e&&(e=0);var i=Ql.convert(t);return new oc(ec(i.lng),ic(i.lat),rc(e,i.lat))},oc.prototype.toLngLat=function(){return new Ql(360*this.x-180,nc(this.y))},oc.prototype.toAltitude=function(){return this.z*tc(nc(this.y))},oc.prototype.meterInMercatorCoordinateUnits=function(){return 1/$l*(t=nc(this.y),1/Math.cos(t*Math.PI/180));var t};var ac=function(t,e,i){this.z=t,this.x=e,this.y=i,this.key=lc(0,t,t,e,i)};ac.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ac.prototype.url=function(t,e){var i,r,n,o,a,s=(r=this.y,n=this.z,o=Yl(256*(i=this.x),256*(r=Math.pow(2,n)-r-1),n),a=Yl(256*(i+1),256*(r+1),n),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,i){for(var r,n="",o=t;o>0;o--)n+=(e&(r=1<this.canonical.z?new uc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new uc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},uc.prototype.calculateScaledKey=function(t,e){var i=this.canonical.z-t;return t>this.canonical.z?lc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):lc(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)},uc.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>e&&t.canonical.y===this.canonical.y>>e},uc.prototype.children=function(t){if(this.overscaledZ>=t)return[new uc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new uc(e,this.wrap,e,i,r),new uc(e,this.wrap,e,i+1,r),new uc(e,this.wrap,e,i,r+1),new uc(e,this.wrap,e,i+1,r+1)]},uc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=i&&t.x=r&&t.y=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)},dc.prototype._unpackMapbox=function(t,e,i){return(256*t*256+256*e+i)/10-1e4},dc.prototype._unpackTerrarium=function(t,e,i){return 256*t+e+i/256-32768},dc.prototype.getPixels=function(){return new Ya({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},dc.prototype.backfillBorder=function(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,n=e*this.dim+this.dim,o=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-i*this.dim,l=o;l0&&(s[new uc(t.overscaledZ,n,e.z,r,e.y-1).key]={backfilled:!1},s[new uc(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},s[new uc(t.overscaledZ,a,e.z,o,e.y-1).key]={backfilled:!1}),e.y+10&&(i.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new jt("data",i))}}))},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 jt("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)e.fire(new Nt(t));else{var i={dataType:"source",sourceDataType:"content"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new jt("data",i))}})),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,i,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r),this},e.prototype._updateWorkerData=function(t){var e=this;this._loaded=!1;var i=m({},this.workerOptions),r=this._data;"string"==typeof r?(i.request=this.map._requestManager.transformRequest(U.resolveURL(r),Et.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(r),this.actor.send(this.type+".loadData",i,(function(r,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:i.source},null),t(r))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.loadTile=function(t,e){var i=this,r=t.actor?"reloadTile":"loadTile";t.actor=this.actor,t.request=this.actor.send(r,{type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:U.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(n,o){return delete t.request,t.unloadVectorData(),t.aborted?e(null):n?e(n):(t.loadVectorData(o,i.map.painter,"reloadTile"===r),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 m({},this._options,{type:this.type,data:this._data})},e.prototype.hasTransition=function(){return!1},e}(qt),_c=Hn([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),gc=function(t){function e(e,i,r,n){t.call(this),this.id=e,this.dispatcher=r,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(t,e){var i=this;this._loaded=!1,this.fire(new jt("dataloading",{dataType:"source"})),this.url=this.options.url,Ot(this.map._requestManager.transformRequest(this.url,Et.Image),(function(r,n){i._loaded=!0,r?i.fire(new Nt(r)):n&&(i.image=n,t&&(i.coordinates=t),e&&e(),i._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 jt("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 i=t.map(oc.fromLngLat);this.tileID=function(t){for(var e=1/0,i=1/0,r=-1/0,n=-1/0,o=0,a=t;oe.end(0)?this.fire(new Nt(new Gt("sources."+this.id,null,"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 i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,_c.members)),this.boundsSegments||(this.boundsSegments=Co.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 Ml(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.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}(gc),xc=function(t){function e(e,i,r,n){t.call(this,e,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new Nt(new Gt("sources."+e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Nt(new Gt("sources."+e,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new Nt(new Gt("sources."+e,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof a.HTMLCanvasElement||this.fire(new Nt(new Gt("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 Nt(new Gt("sources."+e,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.HTMLCanvasElement?this.options.canvas:a.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new Nt(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,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,_c.members)),this.boundsSegments||(this.boundsSegments=Co.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ml(e,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[r];"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=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},kc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Js.VectorTile(new zu(this.rawTileData)).layers,this.sourceLayerCoder=new Tc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},kc.prototype.query=function(t,e,i,r){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=xr(a.filter),l=t.queryGeometry,c=t.queryPadding*s,p=Pc(l),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=Pc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,i,r,o){return function(t,e,i,r,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new n(e,i),new n(e,o),new n(r,o),new n(r,i)];if(t.length>2)for(var c=0,p=l;c=0)return!0;return!1}(o,p)){var h=this.sourceLayerCoder.decode(i),f=this.vtLayers[h].feature(r);if(n.needGeometry){var d=la(f,!0);if(!n.filter(new kn(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!n.filter(new kn(this.tileID.overscaledZ),f))return;for(var y=this.getId(f,h),_=0;_r)n=!1;else if(e)if(this.expirationTimethis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Lc.prototype.has=function(t){return t.wrapped().key in this.data},Lc.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Lc.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},Lc.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Lc.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Lc.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this},Lc.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},Lc.prototype.filter=function(t){var e=[];for(var i in this.data)for(var r=0,n=this.data[i];r1||(Math.abs(i)>1&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),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._retainLoadedChildren=function(t,e,i,r){for(var n in this._tiles){var o=this._tiles[n];if(!(r[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)){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]){r[a.key]=a;break}}}},e.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r),o=this._getLoadedTile(n);if(o)return o}},e.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*i*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},e.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var r in this._tiles){var n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),i[n.tileID.key]=n}for(var o in this._tiles=i,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},e.prototype.update=function(t){var i=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new uc(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(r=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&&(r=r.filter((function(t){return i._source.hasTile(t)})))):r=[];var n=t.coveringZoomLevel(this._source),o=Math.max(n-e.maxOverzooming,this._source.minzoom),a=Math.max(n+e.maxUnderzooming,this._source.minzoom),s=this._updateRetainedTiles(r,n);if(zp(this._source.type)){for(var u={},l={},c=0,p=Object.keys(s);cthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],_=this.getTile(y);if(_&&_.hasData()){r[y.key]=y;continue}}else{var g=d.children(this._source.maxzoom);if(r[g[0].key]&&r[g[1].key]&&r[g[2].key]&&r[g[3].key])continue}for(var v=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))&&v&&(m=this._addTile(b)),m&&(r[b.key]=b,v=m.wasRequested(),m.hasData()))break}}}return r},e.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);var n=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(n))break;r=n}for(var o=0,a=e;o0||(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,i){var r=this,n=[],o=this.transform;if(!o)return n;for(var a=i?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(),c=1/0,p=1/0,h=-1/0,f=-1/0,d=0,m=u;d=0&&y[1].y+m>=0){var _=s.map((function(t){return a.getTilePoint(t)})),g=u.map((function(t){return a.getTilePoint(t)}));n.push({tile:i,tileID:a,queryGeometry:_,cameraQueryGeometry:g,scale:d})}}},g=0;g=U.now())return!0}return!1},e.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)},e.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)},e.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},e.prototype.setDependencies=function(t,e,i){var r=this._tiles[t];r&&r.setDependencies(e,i)},e.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return!i.hasDependency(t,e)}))},e}(qt);function Ap(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function zp(t){return"raster"===t||"image"===t||"video"===t}function Ep(){return new a.Worker(Zm.workerUrl)}Tp.maxOverzooming=10,Tp.maxUnderzooming=3;var kp="mapboxgl_preloaded_worker_pool",Cp=function(){this.active={}};Cp.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(r-o)/a:0;return this.points[n].mult(1-s).add(this.points[e].mult(s))};var Xp=function(t,e,i){var r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var o=0;o=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function Qp(t,e,i,r,o,a,s,u){var l=r?t.textSizeData:t.iconSizeData,c=ol(l,i.transform.zoom),p=[256/i.width*2+1,256/i.height*2+1],h=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;h.clear();for(var f=t.lineVertexArray,d=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=i.transform.width/i.transform.height,y=!1,_=0;_Math.abs(i.x-e.x)*r?{useVertical:!0}:(t===Qu.vertical?e.yi.x)?{needsFlipping:!0}:null}function eh(t,e,i,r,o,a,s,u,l,c,p,h,f,d){var m,y=e/24,_=t.lineOffsetX*y,g=t.lineOffsetY*y;if(t.numGlyphs>1){var v=t.glyphStartIndex+t.numGlyphs,x=t.lineStartIndex,b=t.lineStartIndex+t.lineLength,w=$p(y,u,_,g,i,p,h,t,l,a,f);if(!w)return{notEnoughRoom:!0};var I=Kp(w.first.point,s).point,S=Kp(w.last.point,s).point;if(r&&!i){var T=th(t.writingMode,I,S,d);if(T)return T}m=[w.first];for(var A=t.glyphStartIndex+1;A0?C.point:ih(h,k,z,1,o),D=th(t.writingMode,z,P,d);if(D)return D}var M=rh(y*u.getoffsetX(t.glyphStartIndex),_,g,i,p,h,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,l,a,f);if(!M)return{notEnoughRoom:!0};m=[M]}for(var L=0,B=m;L0?1:-1,m=0;r&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?u+s:u+s+1,_=o,g=o,v=0,x=0,b=Math.abs(f),w=[];v+x<=b;){if((y+=d)=l)return null;if(g=_,w.push(_),void 0===(_=h[y])){var I=new n(c.getx(y),c.gety(y)),S=Kp(I,p);if(S.signedDistanceFromCamera>0)_=h[y]=S.point;else{var T=y-d;_=ih(0===v?a:new n(c.getx(T),c.gety(T)),I,g,b-v+1,p)}}v+=x,x=g.dist(_)}var A=(b-v)/x,z=_.sub(g),E=z.mult(A)._add(g);E._add(z._unit()._perp()._mult(i*d));var k=m+Math.atan2(_.y-g.y,_.x-g.x);return w.push(E),{point:E,angle:k,path:w}}Xp.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Xp.prototype.insert=function(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},Xp.prototype.insertCircle=function(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)},Xp.prototype._insertBoxCell=function(t,e,i,r,n,o){this.boxCells[n].push(o)},Xp.prototype._insertCircleCell=function(t,e,i,r,n,o){this.circleCells[n].push(o)},Xp.prototype._query=function(t,e,i,r,n,o){if(i<0||t>this.width||r<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return!0;for(var s=0;s0:a},Xp.prototype._queryCircle=function(t,e,i,r,n){var o=t-i,a=t+i,s=e-i,u=e+i;if(a<0||o>this.width||u<0||s>this.height)return!r&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),r?l.length>0:l},Xp.prototype.query=function(t,e,i,r,n){return this._query(t,e,i,r,!1,n)},Xp.prototype.hitTest=function(t,e,i,r,n){return this._query(t,e,i,r,!0,n)},Xp.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Xp.prototype._queryCell=function(t,e,i,r,n,o,a,s){var u=a.seenUids,l=this.boxCells[n];if(null!==l)for(var c=this.bboxes,p=0,h=l;p=c[d+0]&&r>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[n];if(null!==m)for(var y=this.circles,_=0,g=m;_a*a+s*s},Xp.prototype._circleAndRectCollide=function(t,e,i,r,n,o,a){var s=(o-r)/2,u=Math.abs(t-(r+s));if(u>s+i)return!1;var l=(a-n)/2,c=Math.abs(e-(n+l));if(c>l+i)return!1;if(u<=s||c<=l)return!0;var p=u-s,h=c-l;return p*p+h*h<=i*i};var nh=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function oh(t,e){for(var i=0;i=1;P--)C.push(E.path[P]);for(var D=1;D0){for(var R=C[0].clone(),F=C[0].clone(),O=1;O=T.x&&F.x<=A.x&&R.y>=T.y&&F.y<=A.y?[C]:F.xA.x||F.yA.y?[]:function(t,e,i,r,o){for(var a=[],s=0;s=r&&h.x>=r||(p.x>=r?p=new n(r,p.y+(r-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x>=r&&(h=new n(r,p.y+(r-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round():h.y>=o&&(h=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round()),l&&p.equals(l[l.length-1])||a.push(l=[p]),l.push(h)))))}return a}([C],T.x,T.y,A.x,A.y)}for(var V=0,U=B;V=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},sh.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:i,height:r,anchor:t,textBoxScale:n,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:_,placedGlyphBoxes:g}):void 0},_h.prototype.placeLayerBucketPart=function(t,e,i){var r=this,n=t.parameters,o=n.bucket,a=n.layout,s=n.posMatrix,u=n.textLabelPlaneMatrix,l=n.labelToScreenMatrix,c=n.textPixelRatio,p=n.holdingForFade,h=n.collisionBoxArray,f=n.partiallyEvaluatedTextSize,d=n.collisionGroup,m=a.get("text-optional"),y=a.get("icon-optional"),_=a.get("text-allow-overlap"),g=a.get("icon-allow-overlap"),v="map"===a.get("text-rotation-alignment"),x="map"===a.get("text-pitch-alignment"),b="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),I=_&&(g||!o.hasIconData()||y),S=g&&(_||!o.hasTextData()||m);!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h);var T=function(t,n){if(!e[t.crossTileID])if(p)r.placements[t.crossTileID]=new ph(!1,!1,!1);else{var h,w=!1,T=!1,A=!0,z=null,E={box:null,offscreen:null},k={box:null,offscreen:null},C=null,P=null,D=0,M=0,L=0;n.textFeatureIndex?D=n.textFeatureIndex:t.useRuntimeCollisionCircles&&(D=t.featureIndex),n.verticalTextFeatureIndex&&(M=n.verticalTextFeatureIndex);var B=n.textBox;if(B){var R=function(e){var i=Qu.horizontal;if(o.allowVerticalPlacement&&!e&&r.prevPlacement){var n=r.prevPlacement.placedOrientations[t.crossTileID];n&&(r.placedOrientations[t.crossTileID]=n,r.markUsedOrientation(o,i=n,t))}return i},F=function(e,i){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var r=0,a=o.writingModes;r0&&(O=O.filter((function(t){return t!==V.anchor}))).unshift(V.anchor)}var U=function(e,i,n){for(var a=e.x2-e.x1,u=e.y2-e.y1,l=t.textBoxScale,p=b&&!g?i:null,h={box:[],offscreen:!1},f=_?2*O.length:O.length,m=0;m=O.length,t,o,n,p);if(y&&(h=y.placedGlyphBoxes)&&h.box&&h.box.length){w=!0,z=y.shift;break}}return h};F((function(){return U(B,n.iconBox,Qu.horizontal)}),(function(){var e=n.verticalTextBox;return o.allowVerticalPlacement&&!(E&&E.box&&E.box.length)&&t.numVerticalGlyphVertices>0&&e?U(e,n.verticalIconBox,Qu.vertical):{box:null,offscreen:null}})),E&&(w=E.box,A=E.offscreen);var j=R(E&&E.box);if(!w&&r.prevPlacement){var N=r.prevPlacement.variableOffsets[t.crossTileID];N&&(r.variableOffsets[t.crossTileID]=N,r.markUsedJustification(o,N.anchor,t,j))}}else{var q=function(e,i){var n=r.collisionIndex.placeCollisionBox(e,_,c,s,d.predicate);return n&&n.box&&n.box.length&&(r.markUsedOrientation(o,i,t),r.placedOrientations[t.crossTileID]=i),n};F((function(){return q(B,Qu.horizontal)}),(function(){var e=n.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&e?q(e,Qu.vertical):{box:null,offscreen:null}})),R(E&&E.box&&E.box.length)}}if(w=(h=E)&&h.box&&h.box.length>0,A=h&&h.offscreen,t.useRuntimeCollisionCircles){var Z=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),G=nl(o.textSizeData,f,Z),X=a.get("text-padding");C=r.collisionIndex.placeCollisionCircles(_,Z,o.lineVertexArray,o.glyphOffsetArray,G,s,u,l,i,x,d.predicate,t.collisionCircleDiameter,X),w=_||C.circles.length>0&&!C.collisionDetected,A=A&&C.offscreen}if(n.iconFeatureIndex&&(L=n.iconFeatureIndex),n.iconBox){var W=function(t){var e=b&&z?yh(t,z.x,z.y,v,x,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,g,c,s,d.predicate)};T=k&&k.box&&k.box.length&&n.verticalIconBox?(P=W(n.verticalIconBox)).box.length>0:(P=W(n.iconBox)).box.length>0,A=A&&P.offscreen}var H=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;if(H||K?K?H||(T=T&&w):w=T&&w:T=w=T&&w,w&&h&&h.box&&r.collisionIndex.insertCollisionBox(h.box,a.get("text-ignore-placement"),o.bucketInstanceId,k&&k.box&&M?M:D,d.ID),T&&P&&r.collisionIndex.insertCollisionBox(P.box,a.get("icon-ignore-placement"),o.bucketInstanceId,L,d.ID),C&&(w&&r.collisionIndex.insertCollisionCircles(C.circles,a.get("text-ignore-placement"),o.bucketInstanceId,D,d.ID),i)){var Y=o.bucketInstanceId,J=r.collisionCircleArrays[Y];void 0===J&&(J=r.collisionCircleArrays[Y]=new hh);for(var Q=0;Q=0;--z){var E=A[z];T(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var k=t.symbolInstanceStart;k=0&&(t.text.placedSymbolArray.get(s).crossTileID=n>=0&&s!==n?0:i.crossTileID)}},_h.prototype.markUsedOrientation=function(t,e,i){for(var r=e===Qu.horizontal||e===Qu.horizontalOnly?e:0,n=e===Qu.vertical?e:0,o=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];o0,g=r.placedOrientations[o.crossTileID],v=g===Qu.vertical,x=g===Qu.horizontal||g===Qu.horizontalOnly;if(s>0||u>0){var b=Ah(y.text);d(t.text,s,v?zh:b),d(t.text,u,x?zh:b);var w=y.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=w||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var I=r.variableOffsets[o.crossTileID];I&&r.markUsedJustification(t,I.anchor,o,g);var S=r.placedOrientations[o.crossTileID];S&&(r.markUsedJustification(t,"left",o,S),r.markUsedOrientation(t,S,o))}if(_){var T=Ah(y.icon),A=!(h&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(d(t.icon,o.numIconVertices,A?T:zh),t.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(t.icon,o.numVerticalIconVertices,A?zh:T),t.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var z=t.collisionArrays[i];if(z){var E=new n(0,0);if(z.textBox||z.verticalTextBox){var k=!0;if(l){var C=r.variableOffsets[m];C?(E=mh(C.anchor,C.width,C.height,C.textOffset,C.textBoxScale),c&&E._rotate(p?r.transform.angle:-r.transform.angle)):k=!1}z.textBox&&gh(t.textCollisionBox.collisionVertexArray,y.text.placed,!k||v,E.x,E.y),z.verticalTextBox&&gh(t.textCollisionBox.collisionVertexArray,y.text.placed,!k||x,E.x,E.y)}var P=Boolean(!x&&z.verticalIconBox);z.iconBox&&gh(t.iconCollisionBox.collisionVertexArray,y.icon.placed,P,h?E.x:0,h?E.y:0),z.verticalIconBox&&gh(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!P,h?E.x:0,h?E.y:0)}}},y=0;yt},_h.prototype.setStale=function(){this.stale=!0};var vh=Math.pow(2,25),xh=Math.pow(2,24),bh=Math.pow(2,17),wh=Math.pow(2,16),Ih=Math.pow(2,9),Sh=Math.pow(2,8),Th=Math.pow(2,1);function Ah(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*vh+e*xh+i*bh+e*wh+i*Ih+e*Sh+i*Th+e}var zh=0,Eh=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Eh.prototype.continuePlacement=function(t,e,i,r,n){for(var o=this._bucketParts;this._currentTileIndex2};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 Eh(a)),this._inProgressLayer.continuePlacement(i[a.source],this.placement,this._showCollisionBoxes,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},kh.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ch=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;rt.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 c=0;c1?"@2x":"",s=Lt(e.transformRequest(e.normalizeSpriteURL(t,a,".json"),Et.SpriteJSON),(function(t,e){s=null,o||(o=t,r=e,l())})),u=Ot(e.transformRequest(e.normalizeSpriteURL(t,a,".png"),Et.SpriteImage),(function(t,e){u=null,o||(o=t,n=e,l())}));function l(){if(o)i(o);else if(r&&n){var t=U.getImageData(n),e={};for(var a in r){var s=r[a],u=s.width,l=s.height,c=s.x,p=s.y,h=s.sdf,f=s.pixelRatio,d=s.stretchX,m=s.stretchY,y=s.content,_=new Ya({width:u,height:l});Ya.copy(t,_,{x:c,y:p},{x:0,y:0},{width:u,height:l}),e[a]={data:_,pixelRatio:f,sdf:h,stretchX:d,stretchY:m,content:y}}i(null,e)}}return{cancel:function(){s&&(s.cancel(),s=null),u&&(u.cancel(),u=null)}}}(t,this.map._requestManager,(function(t,i){if(e._spriteRequest=null,t)e.fire(new Nt(t));else if(i)for(var r in i)e.imageManager.addImage(r,i[r]);e.imageManager.setLoaded(!0),e._availableImages=e.imageManager.listImages(),e.dispatcher.broadcast("setImages",e._availableImages),e.fire(new jt("data",{dataType:"style"}))}))},e.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(e){var i=t.sourceLayer;if(i){var r=e.getSource();("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(i))&&this.fire(new Nt(new Error('Source layer "'+i+'" does not exist on source "'+r.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=[],i=0,r=t;i0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return i.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 Nt(new Error("An image with this name already exists.")));this.imageManager.addImage(t,e),this._afterImageUpdated(t)},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 Nt(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},e.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new jt("data",{dataType:"style"}))},e.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},e.prototype.addSource=function(t,e,i){var r=this;if(void 0===i&&(i={}),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 only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(e.type)>=0&&this._validate(Nr.source,"sources."+t,e,null,i))){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:r.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 Nt(new Error('Source "'+t+'" cannot be removed while layer "'+e+'" is using it.')));var i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new jt("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.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,i){void 0===i&&(i={}),this._checkLoaded();var r=t.id;if(this.getLayer(r))this.fire(new Nt(new Error('Layer with id "'+r+'" already exists on this map')));else{var n;if("custom"===t.type){if(Lh(this,function(t){var e=[],i=t.id;return void 0===i&&e.push({message:"layers."+i+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+i+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+i+': property "renderingMode" must be either "2d" or "3d"'}),e}(t)))return;n=zl(t)}else{if("object"==typeof t.source&&(this.addSource(r,t.source),t=m(t=T(t),{source:r})),this._validate(Nr.layer,"layers."+r,t,{arrayIndex:-1},i))return;n=zl(t),this._validateLayer(n),n.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[n.id]=n.serialize()}var o=e?this._order.indexOf(e):this._order.length;if(e&&-1===o)this.fire(new Nt(new Error('Layer with id "'+e+'" does not exist on this map.')));else{if(this._order.splice(o,0,r),this._layerOrderChanged=!0,this._layers[r]=n,this._removedLayers[r]&&n.source&&"custom"!==n.type){var a=this._removedLayers[r];delete this._removedLayers[r],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 i=this._order.indexOf(t);this._order.splice(i,1);var r=e?this._order.indexOf(e):this._order.length;e&&-1===r?this.fire(new Nt(new Error('Layer with id "'+e+'" does not exist on this map.'))):(this._order.splice(r,0,t),this._layerOrderChanged=!0)}}else this.fire(new Nt(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 i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],e.onRemove&&e.onRemove(this.map)}else this.fire(new Nt(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.hasLayer=function(t){return t in this._layers},e.prototype.setLayerZoomRange=function(t,e,i){this._checkLoaded();var r=this.getLayer(t);r?r.minzoom===e&&r.maxzoom===i||(null!=e&&(r.minzoom=e),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},e.prototype.setFilter=function(t,e,i){void 0===i&&(i={}),this._checkLoaded();var r=this.getLayer(t);if(r){if(!s(r.filter,e))return null==e?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(Nr.filter,"layers."+r.id+".filter",e,null,i)||(r.filter=T(e),this._updateLayer(r)))}else this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},e.prototype.getFilter=function(t){return T(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,i,r){void 0===r&&(r={}),this._checkLoaded();var n=this.getLayer(t);n?s(n.getLayoutProperty(e),i)||(n.setLayoutProperty(e,i,r),this._updateLayer(n)):this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},e.prototype.getLayoutProperty=function(t,e){var i=this.getLayer(t);if(i)return i.getLayoutProperty(e);this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style.")))},e.prototype.setPaintProperty=function(t,e,i,r){void 0===r&&(r={}),this._checkLoaded();var n=this.getLayer(t);n?s(n.getPaintProperty(e),i)||(n.setPaintProperty(e,i,r)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new Nt(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 i=t.source,r=t.sourceLayer,n=this.sourceCaches[i];if(void 0!==n){var o=n.getSource().type;"geojson"===o&&r?this.fire(new Nt(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||r?(void 0===t.id&&this.fire(new Nt(new Error("The feature id parameter must be provided."))),n.setFeatureState(r,t.id,e)):this.fire(new Nt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Nt(new Error("The source '"+i+"' does not exist in the map's style.")))},e.prototype.removeFeatureState=function(t,e){this._checkLoaded();var i=t.source,r=this.sourceCaches[i];if(void 0!==r){var n=r.getSource().type,o="vector"===n?t.sourceLayer:void 0;"vector"!==n||o?e&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new Nt(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(o,t.id,e):this.fire(new Nt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Nt(new Error("The source '"+i+"' does not exist in the map's style.")))},e.prototype.getFeatureState=function(t){this._checkLoaded();var e=t.source,i=t.sourceLayer,r=this.sourceCaches[e];if(void 0!==r){if("vector"!==r.getSource().type||i)return void 0===t.id&&this.fire(new Nt(new Error("The feature id parameter must be provided."))),r.getFeatureState(i,t.id);this.fire(new Nt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Nt(new Error("The source '"+e+"' does not exist in the map's style.")))},e.prototype.getTransition=function(){return m({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.serialize=function(){return S({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:I(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]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},e.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return"fill-extrusion"===e._layers[t].type},r={},n=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(i(a)){r[a]=o;for(var s=0,u=t;s=0;f--){var d=this._order[f];if(i(d))for(var m=n.length-1;m>=0;m--){var y=n[m].feature;if(r[y.layer.id] 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;}"),Hh=ff("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),Kh=ff("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Yh=ff("#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);}"),Jh=ff("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;}"),Qh=ff("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 vec3 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\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_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\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),$h=ff("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 vec3 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\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_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\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),tf=ff("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;}"),ef=ff("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\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_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\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=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 vec3 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\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_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\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;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;}"),rf=ff("#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 vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\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;}"),nf=ff("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;}"),of=ff("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);}"),af=ff("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\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,v_uv);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;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),sf=ff("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_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 pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(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;varying float v_width;\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 float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_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 lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_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);v_width=floorwidth;}"),uf=ff("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);}"),lf=ff("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;}"),cf=ff("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 vec4 a_pixeloffset;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;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\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*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),pf=ff("#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 vec4 a_pixeloffset;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;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\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+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),hf=ff("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\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 fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;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;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 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;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\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=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function ff(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,s={};return{fragmentSource:t=t.replace(i,(function(t,e,i,r,n){return s[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+i+" "+r+" "+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(i,(function(t,e,i,r,n){var o="float"===r?"vec2":"vec4",a=n.match(/color/)?"color":o;return s[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+o+" a_"+n+";\nvarying "+i+" "+r+" "+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+a+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+o+" a_"+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = a_"+n+";\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = unpack_mix_"+a+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n"})),staticAttributes:r,staticUniforms:a}}var df=Object.freeze({__proto__:null,prelude:Uh,background:jh,backgroundPattern:Nh,circle:qh,clippingMask:Zh,heatmap:Gh,heatmapTexture:Xh,collisionBox:Wh,collisionCircle:Hh,debug:Kh,fill:Yh,fillOutline:Jh,fillOutlinePattern:Qh,fillPattern:$h,fillExtrusion:tf,fillExtrusionPattern:ef,hillshadePrepare:rf,hillshade:nf,line:of,lineGradient:af,linePattern:sf,lineSDF:uf,raster:lf,symbolIcon:cf,symbolSDF:pf,symbolTextAndIcon:hf}),mf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function yf(t){for(var e=[],i=0;i>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}_f.prototype.draw=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m){var y,_=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var v=(y={},y[_.LINES]=2,y[_.TRIANGLES]=3,y[_.LINE_STRIP]=1,y)[e],x=0,b=c.get();x0?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:Of(n.paint.get("raster-hue-rotate"))};var o,a};function Of(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}var Vf,Uf=function(t,e,i,r,n,o,a,s,u,l){var c=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:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:c.width/c.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:+r,u_texsize:l,u_texture:0}},jf=function(t,e,i,r,n,o,a,s,u,l,c){var p=n.transform;return m(Uf(t,e,i,r,n,o,a,s,u,l),{u_gamma_scale:r?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:U.devicePixelRatio,u_is_halo:+c})},Nf=function(t,e,i,r,n,o,a,s,u,l){return m(jf(t,e,i,r,n,o,a,s,!0,u,!0),{u_texsize_icon:l,u_texture_icon:1})},qf=function(t,e,i){return{u_matrix:t,u_opacity:e,u_color:i}},Zf=function(t,e,i,r,n,o){return m(function(t,e,i,r){var n=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),a=i.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,i.transform.tileZoom)/l,p=c*(r.tileID.canonical.x+r.tileID.wrap*l),h=c*r.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/uh(r,1,i.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(r,o,i,n),{u_matrix:t,u_opacity:e})},Gf={fillExtrusion:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_lightpos:new Go(t,e.u_lightpos),u_lightintensity:new qo(t,e.u_lightintensity),u_lightcolor:new Go(t,e.u_lightcolor),u_vertical_gradient:new qo(t,e.u_vertical_gradient),u_opacity:new qo(t,e.u_opacity)}},fillExtrusionPattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_lightpos:new Go(t,e.u_lightpos),u_lightintensity:new qo(t,e.u_lightintensity),u_lightcolor:new Go(t,e.u_lightcolor),u_vertical_gradient:new qo(t,e.u_vertical_gradient),u_height_factor:new qo(t,e.u_height_factor),u_image:new No(t,e.u_image),u_texsize:new Zo(t,e.u_texsize),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade),u_opacity:new qo(t,e.u_opacity)}},fill:function(t,e){return{u_matrix:new Ko(t,e.u_matrix)}},fillPattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_image:new No(t,e.u_image),u_texsize:new Zo(t,e.u_texsize),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade)}},fillOutline:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_world:new Zo(t,e.u_world)}},fillOutlinePattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_world:new Zo(t,e.u_world),u_image:new No(t,e.u_image),u_texsize:new Zo(t,e.u_texsize),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade)}},circle:function(t,e){return{u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_scale_with_map:new No(t,e.u_scale_with_map),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_extrude_scale:new Zo(t,e.u_extrude_scale),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_matrix:new Ko(t,e.u_matrix)}},collisionBox:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pixels_to_tile_units:new qo(t,e.u_pixels_to_tile_units),u_extrude_scale:new Zo(t,e.u_extrude_scale),u_overscale_factor:new qo(t,e.u_overscale_factor)}},collisionCircle:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_inv_matrix:new Ko(t,e.u_inv_matrix),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_viewport_size:new Zo(t,e.u_viewport_size)}},debug:function(t,e){return{u_color:new Wo(t,e.u_color),u_matrix:new Ko(t,e.u_matrix),u_overlay:new No(t,e.u_overlay),u_overlay_scale:new qo(t,e.u_overlay_scale)}},clippingMask:function(t,e){return{u_matrix:new Ko(t,e.u_matrix)}},heatmap:function(t,e){return{u_extrude_scale:new qo(t,e.u_extrude_scale),u_intensity:new qo(t,e.u_intensity),u_matrix:new Ko(t,e.u_matrix)}},heatmapTexture:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_world:new Zo(t,e.u_world),u_image:new No(t,e.u_image),u_color_ramp:new No(t,e.u_color_ramp),u_opacity:new qo(t,e.u_opacity)}},hillshade:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_image:new No(t,e.u_image),u_latrange:new Zo(t,e.u_latrange),u_light:new Zo(t,e.u_light),u_shadow:new Wo(t,e.u_shadow),u_highlight:new Wo(t,e.u_highlight),u_accent:new Wo(t,e.u_accent)}},hillshadePrepare:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_image:new No(t,e.u_image),u_dimension:new Zo(t,e.u_dimension),u_zoom:new qo(t,e.u_zoom),u_unpack:new Xo(t,e.u_unpack)}},line:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_units_to_pixels:new Zo(t,e.u_units_to_pixels)}},lineGradient:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_units_to_pixels:new Zo(t,e.u_units_to_pixels),u_image:new No(t,e.u_image),u_image_height:new qo(t,e.u_image_height)}},linePattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_texsize:new Zo(t,e.u_texsize),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_image:new No(t,e.u_image),u_units_to_pixels:new Zo(t,e.u_units_to_pixels),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade)}},lineSDF:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_units_to_pixels:new Zo(t,e.u_units_to_pixels),u_patternscale_a:new Zo(t,e.u_patternscale_a),u_patternscale_b:new Zo(t,e.u_patternscale_b),u_sdfgamma:new qo(t,e.u_sdfgamma),u_image:new No(t,e.u_image),u_tex_y_a:new qo(t,e.u_tex_y_a),u_tex_y_b:new qo(t,e.u_tex_y_b),u_mix:new qo(t,e.u_mix)}},raster:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_tl_parent:new Zo(t,e.u_tl_parent),u_scale_parent:new qo(t,e.u_scale_parent),u_buffer_scale:new qo(t,e.u_buffer_scale),u_fade_t:new qo(t,e.u_fade_t),u_opacity:new qo(t,e.u_opacity),u_image0:new No(t,e.u_image0),u_image1:new No(t,e.u_image1),u_brightness_low:new qo(t,e.u_brightness_low),u_brightness_high:new qo(t,e.u_brightness_high),u_saturation_factor:new qo(t,e.u_saturation_factor),u_contrast_factor:new qo(t,e.u_contrast_factor),u_spin_weights:new Go(t,e.u_spin_weights)}},symbolIcon:function(t,e){return{u_is_size_zoom_constant:new No(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new No(t,e.u_is_size_feature_constant),u_size_t:new qo(t,e.u_size_t),u_size:new qo(t,e.u_size),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pitch:new qo(t,e.u_pitch),u_rotate_symbol:new No(t,e.u_rotate_symbol),u_aspect_ratio:new qo(t,e.u_aspect_ratio),u_fade_change:new qo(t,e.u_fade_change),u_matrix:new Ko(t,e.u_matrix),u_label_plane_matrix:new Ko(t,e.u_label_plane_matrix),u_coord_matrix:new Ko(t,e.u_coord_matrix),u_is_text:new No(t,e.u_is_text),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texture:new No(t,e.u_texture)}},symbolSDF:function(t,e){return{u_is_size_zoom_constant:new No(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new No(t,e.u_is_size_feature_constant),u_size_t:new qo(t,e.u_size_t),u_size:new qo(t,e.u_size),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pitch:new qo(t,e.u_pitch),u_rotate_symbol:new No(t,e.u_rotate_symbol),u_aspect_ratio:new qo(t,e.u_aspect_ratio),u_fade_change:new qo(t,e.u_fade_change),u_matrix:new Ko(t,e.u_matrix),u_label_plane_matrix:new Ko(t,e.u_label_plane_matrix),u_coord_matrix:new Ko(t,e.u_coord_matrix),u_is_text:new No(t,e.u_is_text),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texture:new No(t,e.u_texture),u_gamma_scale:new qo(t,e.u_gamma_scale),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_is_halo:new No(t,e.u_is_halo)}},symbolTextAndIcon:function(t,e){return{u_is_size_zoom_constant:new No(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new No(t,e.u_is_size_feature_constant),u_size_t:new qo(t,e.u_size_t),u_size:new qo(t,e.u_size),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pitch:new qo(t,e.u_pitch),u_rotate_symbol:new No(t,e.u_rotate_symbol),u_aspect_ratio:new qo(t,e.u_aspect_ratio),u_fade_change:new qo(t,e.u_fade_change),u_matrix:new Ko(t,e.u_matrix),u_label_plane_matrix:new Ko(t,e.u_label_plane_matrix),u_coord_matrix:new Ko(t,e.u_coord_matrix),u_is_text:new No(t,e.u_is_text),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texsize_icon:new Zo(t,e.u_texsize_icon),u_texture:new No(t,e.u_texture),u_texture_icon:new No(t,e.u_texture_icon),u_gamma_scale:new qo(t,e.u_gamma_scale),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_is_halo:new No(t,e.u_is_halo)}},background:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_opacity:new qo(t,e.u_opacity),u_color:new Wo(t,e.u_color)}},backgroundPattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_opacity:new qo(t,e.u_opacity),u_image:new No(t,e.u_image),u_pattern_tl_a:new Zo(t,e.u_pattern_tl_a),u_pattern_br_a:new Zo(t,e.u_pattern_br_a),u_pattern_tl_b:new Zo(t,e.u_pattern_tl_b),u_pattern_br_b:new Zo(t,e.u_pattern_br_b),u_texsize:new Zo(t,e.u_texsize),u_mix:new qo(t,e.u_mix),u_pattern_size_a:new Zo(t,e.u_pattern_size_a),u_pattern_size_b:new Zo(t,e.u_pattern_size_b),u_scale_a:new qo(t,e.u_scale_a),u_scale_b:new qo(t,e.u_scale_b),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_tile_units_to_pixels:new qo(t,e.u_tile_units_to_pixels)}}};function Xf(t,e,i,r,n,o,a){for(var s=t.context,u=s.gl,l=t.useProgram("collisionBox"),c=[],p=0,h=0,f=0;f0){var x=ka(),b=_;Fa(x,y.placementInvProjMatrix,t.transform.glCoordMatrix),Fa(x,x,y.placementViewportMatrix),c.push({circleArray:v,circleOffset:h,transform:b,invTransform:x}),h=p+=v.length/4}g&&l.draw(s,u.LINES,xp.disabled,bp.disabled,t.colorModeForRenderPass(),Ip.disabled,Af(_,t.transform,m),i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}}if(a&&c.length){var w=t.useProgram("collisionCircle"),I=new so;I.resize(4*p),I._trim();for(var S=0,T=0,A=c;T=0&&(m[_.associatedIconIndex]={shiftedAnchor:S,angle:T})}else oh(_.numGlyphs,f)}if(p){d.clear();for(var z=t.icon.placedSymbolArray,E=0;E0){var a=U.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,l=i.getSource(),c=n.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),h=!e||Math.abs(e.tileID.overscaledZ-c)>Math.abs(t.tileID.overscaledZ-c),f=h&&t.refreshedUponExpiration?1:p(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}}var nd=new me(1,0,0,1),od=new me(0,1,0,1),ad=new me(0,0,1,1),sd=new me(1,0,1,1),ud=new me(0,1,1,1);function ld(t,e,i,r){pd(t,0,e+i/2,t.transform.width,i,r)}function cd(t,e,i,r){pd(t,e-i/2,0,i,t.transform.height,r)}function pd(t,e,i,r,n,o){var a=t.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*U.devicePixelRatio,i*U.devicePixelRatio,r*U.devicePixelRatio,n*U.devicePixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function hd(t,e,i){var r=t.context,n=r.gl,o=i.posMatrix,a=t.useProgram("debug"),s=xp.disabled,u=bp.disabled,l=t.colorModeForRenderPass();r.activeTexture.set(n.TEXTURE0),t.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),a.draw(r,n.LINE_STRIP,s,u,l,Ip.disabled,Ef(o,me.red),"$debug",t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var c=e.getTileByID(i.key).latestRawTileData,p=Math.floor((c&&c.byteLength||0)/1024),h=e.getTile(i).tileSize,f=512/Math.min(h,512)*(i.overscaledZ/t.transform.zoom)*.5,d=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(d+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,d+" "+p+"kb"),a.draw(r,n.TRIANGLES,s,u,wp.alphaBlended,Ip.disabled,Ef(o,me.transparent,f),"$debug",t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var fd={symbol:function(t,e,i,r,n){if("translucent"===t.renderPass){var o=bp.disabled,a=t.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(t,e,i,r,n,o,a){for(var s=e.transform,u="map"===n,l="map"===o,c=0,p=t;c256&&this.clearStencil(),i.setColorMode(wp.disabled),i.setDepthMode(xp.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&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)},dd.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)},dd.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var x=this.style._layers[r[this.currentLayer]],b=n[x.source],w=l[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},dd.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i},dd.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new _f(this.context,t,df[t],e,Gf[t],this._showOverdrawInspector)),this.cache[i]},dd.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()},dd.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)},dd.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=a.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ml(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},dd.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var md=function(t,e){this.points=t,this.planes=e};md.fromInvProjectionMatrix=function(t,e,i){var r=Math.pow(2,i),n=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(e){return ja([],e,t)})).map((function(t){return function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}([],t,1/t[3]/e*r)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var e,i,r=function(t,e){var i=e[0],r=e[1],n=e[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}([],function(t,e,i){var r=e[0],n=e[1],o=e[2],a=i[0],s=i[1],u=i[2];return t[0]=n*u-o*s,t[1]=o*a-r*u,t[2]=r*s-n*a,t}([],Ua([],n[t[0]],n[t[1]]),Ua([],n[t[2]],n[t[1]]))),o=-((e=r)[0]*(i=n[t[1]])[0]+e[1]*i[1]+e[2]*i[2]);return r.concat(o)}));return new md(n,o)};var yd=function(t,e){this.min=t,this.max=e,this.center=function(t,e,i){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}([],this.min,this.max))};yd.prototype.quadrant=function(t){for(var e=[t%2==0,t<2],i=Oa(this.min),r=Oa(this.max),n=0;n=0;if(0===s)return 0;s!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,p=-Number.MAX_VALUE,h=0;hthis.max[l]-this.min[l])return 0}return 1};var _d=function(t,e,i,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r};_d.prototype.interpolate=function(t,e,i){return null!=e.top&&null!=t.top&&(this.top=oi(t.top,e.top,i)),null!=e.bottom&&null!=t.bottom&&(this.bottom=oi(t.bottom,e.bottom,i)),null!=e.left&&null!=t.left&&(this.left=oi(t.left,e.left,i)),null!=e.right&&null!=t.right&&(this.right=oi(t.right,e.right,i)),this},_d.prototype.getCenter=function(t,e){var i=p((this.left+t-this.right)/2,0,t),r=p((this.top+e-this.bottom)/2,0,e);return new n(i,r)},_d.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},_d.prototype.clone=function(){return new _d(this.top,this.bottom,this.left,this.right)},_d.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var gd=function(t,e,i,r,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=t||0,this._maxZoom=e||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new Ql(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new _d,this._posMatrixCache={},this._alignedPosMatrixCache={}},vd={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};gd.prototype.clone=function(){var t=new gd(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,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._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},vd.minZoom.get=function(){return this._minZoom},vd.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},vd.maxZoom.get=function(){return this._maxZoom},vd.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},vd.minPitch.get=function(){return this._minPitch},vd.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},vd.maxPitch.get=function(){return this._maxPitch},vd.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},vd.renderWorldCopies.get=function(){return this._renderWorldCopies},vd.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},vd.worldSize.get=function(){return this.tileSize*this.scale},vd.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},vd.size.get=function(){return new n(this.width,this.height)},vd.bearing.get=function(){return-this.angle/Math.PI*180},vd.bearing.set=function(t){var e=-h(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=function(){var t=new Ea(4);return Ea!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}(),function(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(i),u=Math.cos(i);t[0]=r*u+o*s,t[1]=n*u+a*s,t[2]=r*-s+o*u,t[3]=n*-s+a*u}(this.rotationMatrix,this.rotationMatrix,this.angle))},vd.pitch.get=function(){return this._pitch/Math.PI*180},vd.pitch.set=function(t){var e=p(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},vd.fov.get=function(){return this._fov/Math.PI*180},vd.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())},vd.zoom.get=function(){return this._zoom},vd.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())},vd.center.get=function(){return this._center},vd.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},vd.padding.get=function(){return this._edgeInsets.toJSON()},vd.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},vd.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},gd.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},gd.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()},gd.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},gd.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new sc(0,t)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new n(0,0)),r=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(i.x,r.x,o.x,a.x)),u=Math.floor(Math.max(i.x,r.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&e.push(new sc(l,t));return e},gd.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),i=e;if(void 0!==t.minzoom&&et.maxzoom&&(e=t.maxzoom);var r=oc.fromLngLat(this.center),n=Math.pow(2,e),o=[n*r.x,n*r.y,0],a=md.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e),s=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(s=e);var u=function(t){return{aabb:new yd([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],c=[],p=e,h=t.reparseOverscaled?i:e;if(this._renderWorldCopies)for(var f=1;f<=3;f++)l.push(u(-f)),l.push(u(f));for(l.push(u(0));l.length>0;){var d=l.pop(),m=d.x,y=d.y,_=d.fullyVisible;if(!_){var g=d.aabb.intersects(a);if(0===g)continue;_=2===g}var v=d.aabb.distanceX(o),x=d.aabb.distanceY(o),b=Math.max(Math.abs(v),Math.abs(x));if(d.zoom===p||b>3+(1<=s)c.push({tileID:new uc(d.zoom===p?h:d.zoom,d.wrap,d.zoom,m,y),distanceSq:Na([o[0]-.5-m,o[1]-.5-y])});else for(var w=0;w<4;w++){var I=(m<<1)+w%2,S=(y<<1)+(w>>1);l.push({aabb:d.aabb.quadrant(w),zoom:d.zoom+1,x:I,y:S,wrap:d.wrap,fullyVisible:_})}}return c.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},gd.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},vd.unmodified.get=function(){return this._unmodified},gd.prototype.zoomScale=function(t){return Math.pow(2,t)},gd.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},gd.prototype.project=function(t){var e=p(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new n(ec(t.lng)*this.worldSize,ic(e)*this.worldSize)},gd.prototype.unproject=function(t){return new oc(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},vd.point.get=function(){return this.project(this.center)},gd.prototype.setLocationAtPoint=function(t,e){var i=this.pointCoordinate(e),r=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(t),o=new oc(n.x-(i.x-r.x),n.y-(i.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},gd.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},gd.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},gd.prototype.locationCoordinate=function(t){return oc.fromLngLat(t)},gd.prototype.coordinateLocation=function(t){return t.toLngLat()},gd.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],i=[t.x,t.y,1,1];ja(e,e,this.pixelMatrixInverse),ja(i,i,this.pixelMatrixInverse);var r=e[3],n=i[3],o=e[1]/r,a=i[1]/n,s=e[2]/r,u=i[2]/n,l=s===u?0:(0-s)/(u-s);return new oc(oi(e[0]/r,i[0]/n,l)/this.worldSize,oi(o,a,l)/this.worldSize)},gd.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return ja(e,e,this.pixelMatrix),new n(e[0]/e[3],e[1]/e[3])},gd.prototype.getBounds=function(){return(new Jl).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)))},gd.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Jl([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},gd.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])},gd.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var i=t.key,r=e?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];var n=t.canonical,o=this.worldSize/this.zoomScale(n.z),a=n.x+Math.pow(2,n.z)*t.wrap,s=Ca(new Float64Array(16));return Ma(s,s,[a*o,n.y*o,0]),La(s,s,[o/8192,o/8192,1]),Da(s,e?this.alignedProjMatrix:this.projMatrix,s),r[i]=new Float32Array(s),r[i]},gd.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},gd.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,i,r,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;o=ic(p[1])*this.worldSize,t=(a=ic(p[0])*this.worldSize)-oa&&(r=a-y)}if(this.lngRange){var _=f.x,g=l.x/2;_-gu&&(i=u-g)}void 0===i&&void 0===r||(this.center=this.unproject(new n(void 0!==i?i:f.x,void 0!==r?r:f.y))),this._unmodified=c,this._constraining=!1}},gd.prototype._calcMatrices=function(){if(this.height){var t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=Math.PI/2+this._pitch,i=this._fov*(.5+t.y/this.height),r=Math.sin(i)*this.cameraToCenterDistance/Math.sin(p(Math.PI-e-i,.01,Math.PI-.01)),n=this.point,o=n.x,a=n.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),u=this.height/50,l=new Float64Array(16);!function(t,e,i,r,n){var o,a=1/Math.tan(e/2);t[0]=a/i,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?(t[10]=(n+r)*(o=1/(r-n)),t[14]=2*n*r*o):(t[10]=-1,t[14]=-2*r)}(l,this._fov,this.width/this.height,u,s),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,La(l,l,[1,-1,1]),Ma(l,l,[0,0,-this.cameraToCenterDistance]),function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],p=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*r,t[5]=a*n+c*r,t[6]=s*n+p*r,t[7]=u*n+h*r,t[8]=l*n-o*r,t[9]=c*n-a*r,t[10]=p*n-s*r,t[11]=h*n-u*r}(l,l,this._pitch),Ba(l,l,this.angle),Ma(l,l,[-o,-a,0]),this.mercatorMatrix=La([],l,[this.worldSize,this.worldSize,this.worldSize]),La(l,l,[1,1,rc(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l,this.invProjMatrix=Pa([],this.projMatrix);var c=this.width%2/2,h=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),m=o-Math.round(o)+f*c+d*h,y=a-Math.round(a)+f*h+d*c,_=new Float64Array(l);if(Ma(_,_,[m>.5?m-1:m,y>.5?y-1:y,0]),this.alignedProjMatrix=_,La(l=ka(),l,[this.width/2,-this.height/2,1]),Ma(l,l,[1,-1,0]),this.labelPlaneMatrix=l,La(l=ka(),l,[1,-1,1]),Ma(l,l,[-1,-1,0]),La(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=Da(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=Pa(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},gd.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 ja(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},gd.prototype.getCameraPoint=function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n(0,t))},gd.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return[t[0],e];for(var i=e.x,r=e.y,o=e.x,a=e.y,s=0,u=t;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},xd.prototype._updateHashUnthrottled=function(){var t=a.location.href.replace(/(#.+)?$/,this.getHashString());try{a.history.replaceState(a.history.state,null,t)}catch(t){}};var bd={linearity:.3,easing:l(0,0,.3,1)},wd=m({deceleration:2500,maxSpeed:1400},bd),Id=m({deceleration:20,maxSpeed:1400},bd),Sd=m({deceleration:1e3,maxSpeed:360},bd),Td=m({deceleration:1e3,maxSpeed:90},bd),Ad=function(t){this._map=t,this.clear()};function zd(t,e){(!t.duration||t.duration0&&e-t[0].time>160;)t.shift()},Ad.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var e={zoom:0,bearing:0,pitch:0,pan:new n(0,0),pinchAround:void 0,around:void 0},i=0,r=this._inertiaBuffer;i=this._clickTolerance||this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.dblclick=function(t){return this._firePreventable(new kd(t.type,this._map,t))},Dd.prototype.mouseover=function(t){this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.mouseout=function(t){this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.touchstart=function(t){return this._firePreventable(new Cd(t.type,this._map,t))},Dd.prototype.touchmove=function(t){this._map.fire(new Cd(t.type,this._map,t))},Dd.prototype.touchend=function(t){this._map.fire(new Cd(t.type,this._map,t))},Dd.prototype.touchcancel=function(t){this._map.fire(new Cd(t.type,this._map,t))},Dd.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Dd.prototype.isEnabled=function(){return!0},Dd.prototype.isActive=function(){return!1},Dd.prototype.enable=function(){},Dd.prototype.disable=function(){};var Md=function(t){this._map=t};Md.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Md.prototype.mousemove=function(t){this._map.fire(new kd(t.type,this._map,t))},Md.prototype.mousedown=function(){this._delayContextMenu=!0},Md.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kd("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Md.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new kd(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Md.prototype.isEnabled=function(){return!0},Md.prototype.isActive=function(){return!1},Md.prototype.enable=function(){},Md.prototype.disable=function(){};var Ld=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Bd(t,e){for(var i={},r=0;rthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){for(var e=new n(0,0),i=0,r=t;i30)&&(this.aborted=!0)}}},Rd.prototype.touchend=function(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Fd=function(t){this.singleTap=new Rd(t),this.numTaps=t.numTaps,this.reset()};Fd.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Fd.prototype.touchstart=function(t,e,i){this.singleTap.touchstart(t,e,i)},Fd.prototype.touchmove=function(t,e,i){this.singleTap.touchmove(t,e,i)},Fd.prototype.touchend=function(t,e,i){var r=this.singleTap.touchend(t,e,i);if(r){var n=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(n&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var Od=function(){this._zoomIn=new Fd({numTouches:1,numTaps:2}),this._zoomOut=new Fd({numTouches:2,numTaps:1}),this.reset()};Od.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Od.prototype.touchstart=function(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)},Od.prototype.touchmove=function(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)},Od.prototype.touchend=function(t,e,i){var r=this,n=this._zoomIn.touchend(t,e,i),o=this._zoomOut.touchend(t,e,i);return n?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Od.prototype.touchcancel=function(){this.reset()},Od.prototype.enable=function(){this._enabled=!0},Od.prototype.disable=function(){this._enabled=!1,this.reset()},Od.prototype.isEnabled=function(){return this._enabled},Od.prototype.isActive=function(){return this._active};var Vd={0:1,2:2},Ud=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Ud.prototype.blur=function(){this.reset()},Ud.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Ud.prototype._correctButton=function(t,e){return!1},Ud.prototype._move=function(t,e){return{}},Ud.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=j.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},Ud.prototype.mousemoveWindow=function(t,e){var i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){var i=Vd[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)0&&(this._active=!0);var r=Bd(i,e),o=new n(0,0),a=new n(0,0),s=0;for(var u in r){var l=r[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,r[u]=l)}if(this._touches=r,!(sMath.abs(t.x)}var Qd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,Jd(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,i){var r=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,n,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,i){if(void 0!==this._valid)return this._valid;var r=t.mag()>=2,n=e.mag()>=2;if(r||n){if(!r||!n)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return Jd(t)&&Jd(e)&&o}},e}(Gd),$d={panStep:100,bearingStep:15,pitchStep:10},tm=function(){var t=$d;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function em(t){return t*(2-t)}tm.prototype.blur=function(){this.reset()},tm.prototype.reset=function(){this._active=!1},tm.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var i=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:em,zoom:i?Math.round(u)+i*(t.shiftKey?2:1):u,bearing:s.getBearing()+r*e._bearingStep,pitch:s.getPitch()+n*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},tm.prototype.enable=function(){this._enabled=!0},tm.prototype.disable=function(){this._enabled=!1,this.reset()},tm.prototype.isEnabled=function(){return this._enabled},tm.prototype.isActive=function(){return this._active},tm.prototype.disableRotation=function(){this._rotationDisabled=!0},tm.prototype.enableRotation=function(){this._rotationDisabled=!1};var im=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._handler=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,b(["_onTimeout"],this)};im.prototype.setZoomRate=function(t){this._defaultZoomRate=t},im.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},im.prototype.isEnabled=function(){return!!this._enabled},im.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},im.prototype.isZooming=function(){return!!this._zooming},im.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},im.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},im.prototype.wheel=function(t){if(this.isEnabled()){var e=t.deltaMode===a.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=U.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*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._active||this._start(t)),t.preventDefault()}},im.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},im.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var e=j.mousePos(this._el,t);this._around=Ql.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},im.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var e=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);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*r))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,a="number"==typeof this._targetZoom?this._targetZoom:e.zoom,s=this._startZoom,u=this._easing,l=!1;if("wheel"===this._type&&s&&u){var c=Math.min((U.now()-this._lastWheelEventTime)/200,1);o=oi(s,a,u(c)),c<1?this._frameId||(this._frameId=!0):l=!0}else o=a,l=!0;return this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},im.prototype._smoothOutEasing=function(t){var e=c;if(this._prevEase){var i=this._prevEase,r=(U.now()-i.start)/i.duration,n=i.easing(r+.01)-i.easing(r),o=.27/Math.sqrt(n*n+1e-4)*.01;e=l(o,Math.sqrt(.0729-o*o),.25,1)}return this._prevEase={start:U.now(),duration:t,easing:e},e},im.prototype.blur=function(){this.reset()},im.prototype.reset=function(){this._active=!1};var rm=function(t,e){this._clickZoom=t,this._tapZoom=e};rm.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},rm.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},rm.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},rm.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var nm=function(){this.reset()};nm.prototype.reset=function(){this._active=!1},nm.prototype.blur=function(){this.reset()},nm.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}},nm.prototype.enable=function(){this._enabled=!0},nm.prototype.disable=function(){this._enabled=!1,this.reset()},nm.prototype.isEnabled=function(){return this._enabled},nm.prototype.isActive=function(){return this._active};var om=function(){this._tap=new Fd({numTouches:1,numTaps:1}),this.reset()};om.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},om.prototype.touchstart=function(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))},om.prototype.touchmove=function(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var r=e[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,i)},om.prototype.touchend=function(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)},om.prototype.touchcancel=function(){this.reset()},om.prototype.enable=function(){this._enabled=!0},om.prototype.disable=function(){this._enabled=!1,this.reset()},om.prototype.isEnabled=function(){return this._enabled},om.prototype.isActive=function(){return this._active};var am=function(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i};am.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},am.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},am.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},am.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var sm=function(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i};sm.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},sm.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},sm.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},sm.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var um=function(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};um.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},um.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},um.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},um.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},um.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},um.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var lm=function(t){return t.zoom||t.drag||t.pitch||t.rotate},cm=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(jt);function pm(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var hm=function(t,e){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ad(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e),b(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[a.document,"mousemove",{capture:!0}],[a.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[a,"blur",void 0]];for(var r=0,n=this._listeners;ro?Math.min(2,I):Math.max(.5,I),m=Math.pow(c,1-t),_=r.unproject(b.add(w.mult(t*m)).mult(n));r.setLocationAtPoint(r.renderWorldCopies?_.wrap():_,y)}i._fireMoveEvents(e)}),(function(t){i._afterEase(e,t)}),t),this},e.prototype._prepareEase=function(t,e,i){void 0===i&&(i={}),this._moving=!0,e||i.moving||this.fire(new jt("movestart",t)),this._zooming&&!i.zooming&&this.fire(new jt("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new jt("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new jt("pitchstart",t))},e.prototype._fireMoveEvents=function(t){this.fire(new jt("move",t)),this._zooming&&this.fire(new jt("zoom",t)),this._rotating&&this.fire(new jt("rotate",t)),this._pitching&&this.fire(new jt("pitch",t))},e.prototype._afterEase=function(t,e){if(!this._easeId||!e||this._easeId!==e){delete this._easeId;var i=this._zooming,r=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new jt("zoomend",t)),r&&this.fire(new jt("rotateend",t)),n&&this.fire(new jt("pitchend",t)),this.fire(new jt("moveend",t))}},e.prototype.flyTo=function(t,e){var i=this;if(!t.essential&&U.prefersReducedMotion){var r=y(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,e)}this.stop(),t=m({offset:[0,0],speed:1.2,curve:1.42,easing:c},t);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),h="zoom"in t?p(+t.zoom,o.minZoom,o.maxZoom):a,f="bearing"in t?this._normalizeBearing(t.bearing,s):s,d="pitch"in t?+t.pitch:u,_="padding"in t?t.padding:o.padding,g=o.zoomScale(h-a),v=n.convert(t.offset),x=o.centerPoint.add(v),b=o.pointLocation(x),w=Ql.convert(t.center||b);this._normalizeCenter(w);var I=o.project(b),S=o.project(w).sub(I),T=t.curve,A=Math.max(o.width,o.height),z=A/g,E=S.mag();if("minZoom"in t){var k=p(Math.min(t.minZoom,a,h),o.minZoom,o.maxZoom),C=A/o.zoomScale(k-a);T=Math.sqrt(C/E*2)}var P=T*T;function D(t){var e=(z*z-A*A+(t?-1:1)*P*P*E*E)/(2*(t?z:A)*P*E);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function L(t){return(Math.exp(t)+Math.exp(-t))/2}var B=D(0),R=function(t){return L(B)/L(B+T*t)},F=function(t){return A*((L(B)*(M(e=B+T*t)/L(e))-M(B))/P)/E;var e},O=(D(1)-B)/T;if(Math.abs(E)<1e-6||!isFinite(O)){if(Math.abs(A-z)<1e-6)return this.easeTo(t,e);var V=zt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=d!==u,this._padding=!o.isPaddingEqual(_),this._prepareEase(e,!1),this._ease((function(t){var r=t*O,n=1/R(r);o.zoom=1===t?h:a+o.scaleZoom(n),i._rotating&&(o.bearing=oi(s,f,t)),i._pitching&&(o.pitch=oi(u,d,t)),i._padding&&(o.interpolatePadding(l,_,t),x=o.centerPoint.add(v));var c=1===t?w:o.unproject(I.add(S.mult(F(r))).mult(n));o.setLocationAtPoint(o.renderWorldCopies?c.wrap():c,x),i._fireMoveEvents(e)}),(function(){return i._afterEase(e)}),t),this},e.prototype.isEasing=function(){return!!this._easeFrameId},e.prototype.stop=function(){return this._stop()},e.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e)}if(!t){var r=this.handlers;r&&r.stop(!1)}return this},e.prototype._ease=function(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=U.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},e.prototype._renderFrameCallback=function(){var t=Math.min((U.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=h(t,-180,180);var i=Math.abs(t-e);return Math.abs(t-360-e)180?-360:i<-180?360:0}},e}(qt),dm=function(t){void 0===t&&(t={}),this.options=t,b(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};dm.prototype.getDefaultPosition=function(){return"bottom-right"},dm.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=j.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=j.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),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},dm.prototype.onRemove=function(){j.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},dm.prototype._setElementTitle=function(t,e){var i=this._map._getUIString("AttributionControl."+e);t.title=i,t.setAttribute("aria-label",i)},dm.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},dm.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||Q.ACCESS_TOKEN}];if(t){var i=e.reduce((function(t,i,r){return i.value&&(t+=i.key+"="+i.value+(r=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)}},dm.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var mm=function(){b(["_updateLogo"],this),b(["_updateCompact"],this)};mm.prototype.onAdd=function(t){this._map=t,this._container=j.create("div","mapboxgl-ctrl");var e=j.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),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},mm.prototype.onRemove=function(){j.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},mm.prototype.getDefaultPosition=function(){return"bottom-left"},mm.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},mm.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}},mm.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 ym=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ym.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},ym.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,r=e?this._queue.concat(e):this._queue;ie.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new gd(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(t.call(this,r,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 ym,this._controls=[],this._mapId=g(),this._locale=m({},_m,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new nt(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof vm))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),b(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1),a.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new hm(this,e),this._hash=e.hash&&new xd("string"==typeof e.hash&&e.hash||void 0).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,m({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new dm({customAttribution:e.customAttribution})),this.addControl(new mm,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)})),this.on("data",(function(t){i._update("style"===t.dataType),i.fire(new jt(t.dataType+"data",t))})),this.on("dataloading",(function(t){i.fire(new jt(t.dataType+"dataloading",t))}))}t&&(i.__proto__=t),(i.prototype=Object.create(t&&t.prototype)).constructor=i;var r={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,e){if(void 0===e&&(e=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new Nt(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=t.onAdd(this);this._controls.push(t);var r=this._controlPositions[e];return-1!==e.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new Nt(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},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(t){var e=this._containerDimensions(),i=e[0],r=e[1];if(i===this.transform.width&&r===this.transform.height)return this;this._resizeCanvas(i,r),this.transform.resize(i,r),this.painter.resize(i,r);var n=!this._moving;return n&&this.fire(new jt("movestart",t)).fire(new jt("move",t)),this.fire(new jt("resize",t)),n&&this.fire(new jt("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(Jl.convert(t)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=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")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(Ql.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(n.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,i){var r,n=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:i,delegates:{mousemove:function(r){var a=n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?o||(o=!0,i.call(n,new kd(t,n,r.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:i,delegates:{mousemove:function(r){(n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(n,new kd(t,n,r.originalEvent)))},mouseout:function(e){a&&(a=!1,i.call(n,new kd(t,n,e.originalEvent)))}}}}return{layer:e,listener:i,delegates:(r={},r[t]=function(t){var r=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(n,t),delete t.features)},r)}},i.prototype.on=function(e,i,r){if(void 0===r)return t.prototype.on.call(this,e,i);var n=this._createDelegatedListener(e,i,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n),n.delegates)this.on(o,n.delegates[o]);return this},i.prototype.once=function(e,i,r){if(void 0===r)return t.prototype.once.call(this,e,i);var n=this._createDelegatedListener(e,i,r);for(var o in n.delegates)this.once(o,n.delegates[o]);return this},i.prototype.off=function(e,i,r){var n=this;return void 0===r?t.prototype.off.call(this,e,i):(this._delegatedListeners&&this._delegatedListeners[e]&&function(t){for(var o=t[e],a=0;a180;){var a=i.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=i.width&&a.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}Am.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),j.disableDrag()},Am.prototype.move=function(t,e){var i=this.map,r=this.mouseRotate.mousemoveWindow(t,e);if(r&&r.bearingDelta&&i.setBearing(i.getBearing()+r.bearingDelta),this.mousePitch){var n=this.mousePitch.mousemoveWindow(t,e);n&&n.pitchDelta&&i.setPitch(i.getPitch()+n.pitchDelta)}},Am.prototype.off=function(){var t=this.element;j.removeEventListener(t,"mousedown",this.mousedown),j.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),j.removeEventListener(t,"touchmove",this.touchmove),j.removeEventListener(t,"touchend",this.touchend),j.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Am.prototype.offTemp=function(){j.enableDrag(),j.removeEventListener(a,"mousemove",this.mousemove),j.removeEventListener(a,"mouseup",this.mouseup)},Am.prototype.mousedown=function(t){this.down(m({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),j.mousePos(this.element,t)),j.addEventListener(a,"mousemove",this.mousemove),j.addEventListener(a,"mouseup",this.mouseup)},Am.prototype.mousemove=function(t){this.move(t,j.mousePos(this.element,t))},Am.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Am.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=j.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Am.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=j.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Am.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new jt("dragstart"))),this.fire(new jt("drag")))},e.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new jt("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._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},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.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},e.prototype.getRotation=function(){return this._rotation},e.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},e.prototype.getRotationAlignment=function(){return this._rotationAlignment},e.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},e.prototype.getPitchAlignment=function(){return this._pitchAlignment},e}(qt),Dm={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Mm=0,Lm=!1,Bm=function(t){function e(e){t.call(this),this.options=m({},Dm,e),b(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.onAdd=function(t){var e;return this._map=t,this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),e=this._setupUI,void 0!==Cm?e(Cm):void 0!==a.navigator.permissions?a.navigator.permissions.query({name:"geolocation"}).then((function(t){e(Cm="denied"!==t.state)})):e(Cm=!!a.navigator.geolocation),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(a.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),j.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Mm=0,Lm=!1},e.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitudee.getEast()||i.latitudee.getNorth())},e.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},e.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new jt("outofmaxbounds",t)),this._updateMarker(),void this._finish();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 jt("geolocate",t)),this._finish()}},e.prototype._updateCamera=function(t){var e=new Ql(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,r=m({bearing:this._map.getBearing()},this.options.fitBoundsOptions);this._map.fitBounds(e.toBounds(i),r,{geolocateSource:!0})},e.prototype._updateMarker=function(t){if(t){var e=new Ql(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(e).addTo(this._map),this._userLocationDotMarker.setLngLat(e).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},e.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),r=e.distanceTo(i),n=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=n+"px",this._circleElement.style.height=n+"px"},e.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},e.prototype._onError=function(t){if(this._map){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"),this._geolocateButton.disabled=!0;var e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Lm)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new jt("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;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=j.create("button","mapboxgl-ctrl-geolocate",this._container),j.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){z("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=j.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Pm(this._dotElement),this._circleElement=j.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pm({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){t.geolocateSource||"ACTIVE_LOCK"!==e._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(e._watchState="BACKGROUND",e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),e.fire(new jt("trackuserlocationend")))}))},e.prototype.trigger=function(){if(!this._setup)return z("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 jt("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Mm--,Lm=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new jt("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 jt("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Mm>1?(t={maximumAge:6e5,timeout:0},Lm=!0):(t=this.options.positionOptions,Lm=!1),this._geolocationWatchID=a.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else a.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},e.prototype._clearWatch=function(){a.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}(qt),Rm={maxWidth:100,unit:"metric"},Fm=function(t){this.options=m({},Rm,t),b(["_onMove","setUnit"],this)};function Om(t,e,i){var r=i&&i.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]),a=t.unproject([r,n]),s=o.distanceTo(a);if(i&&"imperial"===i.unit){var u=3.2808*s;u>5280?Vm(e,r,u/5280,t._getUIString("ScaleControl.Miles")):Vm(e,r,u,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?Vm(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Vm(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):Vm(e,r,s,t._getUIString("ScaleControl.Meters"))}function Vm(t,e,i,r){var n,o,a,s=(n=i,(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)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+r}Fm.prototype.getDefaultPosition=function(){return"bottom-left"},Fm.prototype._onMove=function(){Om(this._map,this._container,this.options)},Fm.prototype.onAdd=function(t){return this._map=t,this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Fm.prototype.onRemove=function(){j.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Fm.prototype.setUnit=function(t){this.options.unit=t,Om(this._map,this._container,this.options)};var Um=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof a.HTMLElement?this._container=t.container:z("Full screen control 'container' must be a DOM element.")),b(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in a.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in a.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in a.document&&(this._fullscreenchange="MSFullscreenChange")};Um.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",z("This device does not support fullscreen mode.")),this._controlContainer},Um.prototype.onRemove=function(){j.remove(this._controlContainer),this._map=null,a.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Um.prototype._checkFullscreenSupport=function(){return!!(a.document.fullscreenEnabled||a.document.mozFullScreenEnabled||a.document.msFullscreenEnabled||a.document.webkitFullscreenEnabled)},Um.prototype._setupUI=function(){var t=this._fullscreenButton=j.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);j.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.document.addEventListener(this._fullscreenchange,this._changeIcon)},Um.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Um.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Um.prototype._isFullscreen=function(){return this._fullscreen},Um.prototype._changeIcon=function(){(a.document.fullscreenElement||a.document.mozFullScreenElement||a.document.webkitFullscreenElement||a.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Um.prototype._onClickFullscreen=function(){this._isFullscreen()?a.document.exitFullscreen?a.document.exitFullscreen():a.document.mozCancelFullScreen?a.document.mozCancelFullScreen():a.document.msExitFullscreen?a.document.msExitFullscreen():a.document.webkitCancelFullScreen&&a.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 jm={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Nm=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),qm=function(t){function e(e){t.call(this),this.options=m(Object.create(jm),e),b(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new jt("open")),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&j.remove(this._content),this._container&&(j.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new jt("close")),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Ql.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},e.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},e.prototype.getElement=function(){return this._container},e.prototype.setText=function(t){return this.setDOMContent(a.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,i=a.document.createDocumentFragment(),r=a.document.createElement("body");for(r.innerHTML=t;e=r.firstChild;)i.appendChild(e);return this.setDOMContent(i)},e.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},e.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},e.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=j.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},e.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},e.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},e.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},e.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},e.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=j.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},e.prototype._onMouseUp=function(t){this._update(t.point)},e.prototype._onMouseMove=function(t){this._update(t.point)},e.prototype._onDrag=function(t){this._update(t.point)},e.prototype._update=function(t){var e=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=j.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=j.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._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zm(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),r=this.options.anchor,o=function t(e){if(e){if("number"==typeof e){var i=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new n(0,0),top:new n(0,e),"top-left":new n(i,i),"top-right":new n(-i,i),bottom:new n(0,-e),"bottom-left":new n(i,-i),"bottom-right":new n(-i,-i),left:new n(e,0),right:new n(-e,0)}}if(e instanceof n||Array.isArray(e)){var r=n.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}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(!r){var a,s=this._container.offsetWidth,u=this._container.offsetHeight;a=i.y+o.bottom.ythis._map.transform.height-u?["bottom"]:[],i.xthis._map.transform.width-s/2&&a.push("right"),r=0===a.length?"bottom":a.join("-")}var l=i.add(o[r]).round();j.setTransform(this._container,Em[r]+" translate("+l.x+"px,"+l.y+"px)"),km(this._container,r,"popup")}},e.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Nm);t&&t.focus()}},e.prototype._onClose=function(){this.remove()},e}(qt),Zm={version:"1.13.3",supported:e,setRTLTextPlugin:function(t,e,i){if(void 0===i&&(i=!1),"deferred"===bn||"loading"===bn||"loaded"===bn)throw new Error("setRTLTextPlugin cannot be called multiple times.");wn=U.resolveURL(t),bn="deferred",xn=e,Sn(),i||zn()},getRTLTextPluginStatus:An,Map:wm,NavigationControl:Tm,GeolocateControl:Bm,AttributionControl:dm,ScaleControl:Fm,FullscreenControl:Um,Popup:qm,Marker:Pm,Style:Oh,LngLat:Ql,LngLatBounds:Jl,Point:n,MercatorCoordinate:oc,Evented:qt,config:Q,prewarm:function(){Mp().acquire(kp)},clearPrewarmedResources:function(){var t=Pp;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(kp),Pp=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return Q.ACCESS_TOKEN},set accessToken(t){Q.ACCESS_TOKEN=t},get baseApiUrl(){return Q.API_URL},set baseApiUrl(t){Q.API_URL=t},get workerCount(){return Cp.workerCount},set workerCount(t){Cp.workerCount=t},get maxParallelImageRequests(){return Q.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){Q.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){!function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))}(t)},workerUrl:""};return Zm})); //# sourceMappingURL=mapbox-gl-csp.js.map