diff --git a/asset-manifest.json b/asset-manifest.json index 201e333..4f96b5c 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,17 +1,17 @@ { "files": { "main.css": "/azure-maps-creator-onboarding-tool/static/css/main.65bba988.css", - "main.js": "/azure-maps-creator-onboarding-tool/static/js/main.b0fd8960.js", + "main.js": "/azure-maps-creator-onboarding-tool/static/js/main.51dc9172.js", "static/js/585.1ad2578d.chunk.js": "/azure-maps-creator-onboarding-tool/static/js/585.1ad2578d.chunk.js", "static/js/322.513328f7.chunk.js": "/azure-maps-creator-onboarding-tool/static/js/322.513328f7.chunk.js", "index.html": "/azure-maps-creator-onboarding-tool/index.html", "main.65bba988.css.map": "/azure-maps-creator-onboarding-tool/static/css/main.65bba988.css.map", - "main.b0fd8960.js.map": "/azure-maps-creator-onboarding-tool/static/js/main.b0fd8960.js.map", + "main.51dc9172.js.map": "/azure-maps-creator-onboarding-tool/static/js/main.51dc9172.js.map", "585.1ad2578d.chunk.js.map": "/azure-maps-creator-onboarding-tool/static/js/585.1ad2578d.chunk.js.map", "322.513328f7.chunk.js.map": "/azure-maps-creator-onboarding-tool/static/js/322.513328f7.chunk.js.map" }, "entrypoints": [ "static/css/main.65bba988.css", - "static/js/main.b0fd8960.js" + "static/js/main.51dc9172.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 6a3525e..0e5aab4 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Azure Maps Creator Onboarding Tool
\ No newline at end of file +Azure Maps Creator Onboarding Tool
\ No newline at end of file diff --git a/static/js/main.b0fd8960.js b/static/js/main.51dc9172.js similarity index 99% rename from static/js/main.b0fd8960.js rename to static/js/main.51dc9172.js index d017b76..91133a0 100644 --- a/static/js/main.b0fd8960.js +++ b/static/js/main.51dc9172.js @@ -1,3 +1,3 @@ -/*! For license information please see main.b0fd8960.js.LICENSE.txt */ -(()=>{var e={2127:(e,t,n)=>{"use strict";var r=n(2538);function i(e){var t=[1/0,1/0,-1/0,-1/0];return r.coordEach(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]{"use strict";function n(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function r(e,t,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(e[0])||!p(e[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:e},t,r)}function i(e,t,r){void 0===r&&(r={});for(var i=0,o=e;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},t.radiansToLength=u,t.lengthToRadians=d,t.lengthToDegrees=function(e,t){return h(d(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=h,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return u(d(e,t),n)},t.convertArea=function(e,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[n];if(!i)throw new Error("invalid original units");var o=t.areaFactors[r];if(!o)throw new Error("invalid final units");return e/i*o},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},2538:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7872);function i(e,t,n){if(null!==e)for(var r,o,a,s,l,c,u,d,h=0,p=0,f=e.type,m="FeatureCollection"===f,g="Feature"===f,y=m?e.features.length:1,v=0;vc||p>u||f>d)return l=i,c=n,u=p,d=f,void(a=0);var m=r.lineString([l,i],e.properties);if(!1===t(m,n,o,f,a))return!1;a++,l=i}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,n,i){if(null!==e.geometry){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(!1===t(e,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s{"use strict";n.r(t),n.d(t,{AuthenticationType:()=>Nh,ControlPosition:()=>o,ControlStyle:()=>a,HtmlMarker:()=>Mh,Map:()=>GB,Pixel:()=>nc,Popup:()=>Ih,PopupTemplate:()=>YB,Shape:()=>su,_getAssetDomain:()=>Xp,_getDomain:()=>Jp,_hasMaxParallelImageRequests:()=>Wp,_hasSetAuthenticationOptions:()=>Up,_hasSetDomain:()=>qp,_hasSetLanguage:()=>Kp,_hasSetSessionId:()=>Yp,_hasSetStyleDefinitionsPath:()=>Vp,_hasSetStyleDefinitionsVersion:()=>Hp,_hasSetView:()=>Zp,_hasWorkerCount:()=>Gp,addImageTemplate:()=>Dp,clearPrewarmedResources:()=>jp,control:()=>Ru,data:()=>_u,default:()=>XB,getAllImageTemplateNames:()=>zp,getAuthenticationOptions:()=>cp,getDomain:()=>dp,getImageTemplate:()=>Fp,getLanguage:()=>yp,getMaxParallelImageRequests:()=>gp,getSessionId:()=>vp,getStaticAssetsDomain:()=>up,getStyleAPIVersion:()=>fp,getStyleDefinitionsPath:()=>hp,getStyleDefinitionsVersion:()=>pp,getSubscriptionKey:()=>_p,getUserRegion:()=>bp,getVersion:()=>xp,getView:()=>wp,getWorkerCount:()=>mp,internal:()=>J,isSupported:()=>Sp,layer:()=>yh,math:()=>Tu,prewarm:()=>Bp,setAuthenticationOptions:()=>Cp,setDomain:()=>Ep,setLanguage:()=>Mp,setMaxParallelImageRequests:()=>Pp,setSessionId:()=>Op,setStyleAPIVersion:()=>Tp,setStyleDefinitionsPath:()=>kp,setStyleDefinitionsVersion:()=>Ip,setSubscriptionKey:()=>Rp,setUserRegion:()=>Lp,setView:()=>Np,setWorkerCount:()=>Ap,source:()=>ud});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,a,s={exports:{}},l=(function(){var e;e=function(){var e,t,n;function r(r,i){var o,a;e?t?(o="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",e(a={}),n=i(a),"undefined"!=typeof window&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))):t=i:e=i}return r(0,(function(e){function t(e,t,n,r){return new(n=n||Promise)((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r=i;function i(e,t){this.x=e,this.y=t}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x;return t*t+(e=e.y-this.y)*e},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y;e=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=e,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=(e=Math.sin(e),t*this.x-e*this.y);e=e*this.x+t*this.y;return this.x=n,this.y=e,this},_rotateAround:function(e,t){var n=Math.cos(e),r=(e=Math.sin(e),t.x+n*(this.x-t.x)-e*(this.y-t.y));e=t.y+e*(this.x-t.x)+n*(this.y-t.y);return this.x=r,this.y=e,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(e){return e instanceof i||!Array.isArray(e)?e:new i(e[0],e[1])};var o=n(r),a=s;function s(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}s.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(11?t-1:0),r=1;r(t.y-e.y)*(n.x-e.x)}function C(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}let E=null;function k(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}const I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function T(e,n,r,i,o){return t(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");var t,a,s,l,c,u,d,h,p,f=new VideoFrame(e,{timestamp:0});try{var m=null==f?void 0:f.format;if(!m||!m.startsWith("BGR")&&!m.startsWith("RGB"))throw new Error("Unrecognized format "+m);var g=m.startsWith("BGR"),y=new Uint8ClampedArray(i*o*4);if(yield f.copyTo(y,(t=e,a=n,s=r,l=i,c=o,u=4*Math.max(-a,0),u=(Math.max(0,s)-s)*l*4+u,d=4*l,h=Math.max(0,a),p=Math.max(0,s),{rect:{x:h,y:p,width:Math.min(t.width,a+l)-h,height:Math.min(t.height,s+c)-p},layout:[{offset:u,stride:d}]})),g)for(let e=0;ecancelAnimationFrame(t)}},getImageData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){var t=window.document.createElement("canvas"),n=t.getContext("2d",{willReadFrequently:!0});if(n)return t.width=e.width,t.height=e.height,n.drawImage(e,0,0,e.width,e.height),n;throw new Error("failed to create canvas 2d context")},resolveURL:e=>((M=M||document.createElement("a")).href=e,M.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(O=null==O?matchMedia("(prefers-reduced-motion: reduce)"):O).matches}},L={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class N extends Error{constructor(e,t,n,r){super("AJAXError: ".concat(t," (").concat(e,"): ")+n),this.status=e,this.statusText=t,this.url=n,this.body=r}}const D=C()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href,F=e=>L.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))];function z(e,t){const n=new AbortController,r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:D(),signal:n.signal});let i=!1,o=!1;"json"===e.type&&r.headers.set("Accept","application/json");const a=n=>{("arrayBuffer"===e.type||"image"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text()).then((e=>{o||(i=!0,t(null,e,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((e=>{o||t(new Error(e.message))}))};return o||fetch(r).then((n=>n.ok?a(n):n.blob().then((r=>t(new N(n.status,n.statusText,e.url,r)))))).catch((e=>{20!==e.code&&t(new Error(e.message))})),{cancel:()=>{o=!0,i||n.abort()}}}function B(e,t){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t);if(!C())return(F(e.url)||z)(e,t)}if(!(e=>/^file:/.test(e)||/^file:/.test(D())&&!/^\w+:/.test(e))(e.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return z(e,t);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}{var n=e,r=t;const i=new XMLHttpRequest;i.open(n.method||"GET",n.url,!0),"arrayBuffer"!==n.type&&"image"!==n.type||(i.responseType="arraybuffer");for(const e in n.headers)i.setRequestHeader(e,n.headers[e]);return"json"===n.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===n.credentials,i.onerror=()=>{r(new Error(i.statusText))},i.onload=()=>{if((200<=i.status&&i.status<300||0===i.status)&&null!==i.response){let t=i.response;if("json"===n.type)try{t=JSON.parse(i.response)}catch(e){return r(e)}r(null,t,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else{var e=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});r(new N(i.status,i.statusText,n.url,e))}},i.send(n.body),{cancel:()=>i.abort()}}}const j=function(e,t){return B(g(e,{type:"arrayBuffer"}),t)};function U(e){var t;return!e||e.indexOf("://")<=0||0===e.indexOf("data:image/")||0===e.indexOf("blob:")||(e=new URL(e),t=window.location,e.protocol===t.protocol&&e.host===t.host)}function q(e,t,n){n[e]&&-1!==n[e].indexOf(t)||(n[e]=n[e]||[],n[e].push(t))}function V(e,t,n){n&&n[e]&&-1!==(t=n[e].indexOf(t))&&n[e].splice(t,1)}class H{constructor(e){g(this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.type=e}}class G extends H{constructor(e){super("error",g({error:e},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}class W{on(e,t){return this._listeners=this._listeners||{},q(e,t,this._listeners),this}off(e,t){return V(e,t,this._listeners),V(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},q(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){var n=(e="string"==typeof e?new H(e,t||{}):e).type;if(this.listens(n)){for(const t of(e.target=this)._listeners&&this._listeners[n]?this._listeners[n].slice():[])t.call(this,e);for(const t of this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[])V(n,t,this._oneTimeListeners),t.call(this,e);(t=this._eventedParent)&&(g(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),t.fire(e))}else e instanceof G&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&0":{},">=":{},"<":{},"<=":{},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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"}}};const Y=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Z(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return;for(let n=0;n1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[];for(var[n,r]of(this.parent=e,this.bindings={},t))this.bindings[n]=r}concat(e){return new oe(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const ae={kind:"null"},se={kind:"number"},le={kind:"string"},ce={kind:"boolean"},ue={kind:"color"},de={kind:"object"},he={kind:"value"},pe={kind:"collator"},fe={kind:"formatted"},me={kind:"padding"},ge={kind:"resolvedImage"},ye={kind:"variableAnchorOffsetCollection"};function ve(e,t){return{kind:"array",itemType:e,N:t}}function _e(e){var t;return"array"===e.kind?(t=_e(e.itemType),"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")):e.kind}const be=[ae,se,le,ce,ue,fe,de,ve(he),me,ge,ye];function we(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!we(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of be)if(!we(e,t))return null}return"Expected ".concat(_e(e)," but found ").concat(_e(t)," instead.")}function xe(e,t){return t.some((t=>t.kind===e.kind))}function Se(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Ce(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const Ee=.96422,ke=.82521,Ie=4/29,Te=6/29,Ae=3*Te*Te,Pe=Math.PI/180,Me=180/Math.PI;function Oe(e){return(e%=360)<0&&(e+=360),e}function Re(e){let[t,n,r,i]=e;return function(e){let t,o;var a=Ne((.2225045*(e=Le(e))+.7168786*(n=Le(n))+.0606169*(r=Le(r)))/1);return[(e=(e===n&&n===r?t=o=a:(t=Ne((.4360747*e+.3850649*n+.1430804*r)/Ee),o=Ne((.0139322*e+.0971045*n+.7141733*r)/ke)),116*a-16))<0?0:e,500*(t-a),200*(a-o),i]}(t)}function Le(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ne(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ae+Ie}function De(e){let[t,n,r,i]=e;return t=(t+16)/116,n=isNaN(n)?t:t+n/500,r=isNaN(r)?t:t-r/200,t=1*ze(t),[Fe(3.1338561*(n=Ee*ze(n))-1.6168667*t-.4906146*(r=ke*ze(r))),Fe(-.9787684*n+1.9161415*t+.033454*r),Fe(.0719453*n-.2289914*t+1.4052427*r),i]}function Fe(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:1Te?e*e*e:Ae*(e-Ie)}function Be(e){return parseInt(e.padEnd(2,e),16)/255}function je(e,t){return Ue(t?e/100:e,0,1)}function Ue(e,t,n){return Math.min(Math.max(t,e),n)}function qe(e){return!e.some(Number.isNaN)}const Ve={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class He{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r)||this.overwriteGetter("rgb",[e,t,n,r])}static parse(e){return e instanceof He?e:"string"==typeof e&&(e=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];var t,n,r,i;if(i=Ve[e])return[i,a,o]=i,[i/255,a/255,o/255,1];if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e))return i=e.length<6?1:2,[Be(e.slice(a=1,a+=i)),Be(e.slice(a,a+=i)),Be(e.slice(a,a+=i)),Be(e.slice(a,a+i)||"ff")];if(e.startsWith("rgb")&&(o=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/))){var o,[,a,i,o,s,l,c,u,d,h,p,f]=o;return(" "===(o=[o||" ",c||" ",h].join(""))||" /"===o||",,"===o||",,,"===o)&&(h="%%%"===(c=[i,l,d].join(""))?100:""===c?255:0)&&qe(o=[Ue(+a/h,0,1),Ue(+s/h,0,1),Ue(+u/h,0,1),p?je(+p,f):1])?o:void 0}if(i=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/)){var f,[,l,d,c,a,s,u,h,p]=i;if((" "===(f=[d||" ",a||" ",u].join(""))||" /"===f||",,"===f||",,,"===f)&&qe(o=[+l,Ue(+c,0,100),Ue(+s,0,100),h?je(+h,p):1]))return[t,n,r,e]=[o][0],t=Oe(t),n/=100,r/=100,[m(0),m(8),m(4),e]}function m(e){e=(e+t/30)%12;var i=n*Math.min(r,1-r);return r-i*Math.max(-1,Math.min(e-3,9-e,1))}}(e))?new He(...e,!1):void 0}get rgb(){var{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter("rgb",[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter("hcl",function(e){var[e,t,n,r]=Re(e),i=Math.sqrt(t*t+n*n);return[Math.round(1e4*i)?Oe(Math.atan2(n,t)*Me):NaN,i,e,r]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Re(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){var[e,t,n,r]=this.rgb;return"rgba(".concat([e,t,n].map((e=>Math.round(255*e))).join(","),",").concat(r,")")}}He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1);class Ge{constructor(e,t,n){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale||[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale||[]).resolvedOptions().locale}}class We{constructor(e,t,n,r,i){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i}}class Ke{constructor(e){this.sections=e}static fromString(e){return new Ke([new We(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Ke?e:Ke.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class Ye{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ye)return e;if("number"==typeof e)return new Ye([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||4e.outputDefined()))}}const at={"to-boolean":ce,"to-color":ue,"to-number":se,"to-string":le};class st{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");var n=e[0];if(!at[n])throw new Error("Can't parse ".concat(n," as it is not part of the known types"));if(("to-boolean"===n||"to-string"===n)&&2!==e.length)return t.error("Expected one argument.");n=at[n];var r=[];for(let o=1;oe.outputDefined()))}}const lt=["Unknown","Point","LineString","Polygon"];class ct{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?lt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(this._parseColorCache[e]=He.parse(e))}}class ut{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new oe,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];this.registry=e,this.path=n,this.key=n.map((e=>"[".concat(e,"]"))).join(""),this.scope=i,this.errors=o,this.expectedType=r,this._isConstant=t}parse(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(t?this.concat(t,n,r):this)._parse(e,i)}_parse(e,t){function n(e,t,n){return"assert"===n?new ot(t,[e]):"coerce"===n?new st(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found ".concat(typeof r,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;if(i=this.registry[r]){let a=i.parse(e,this);if(!a)return null;if(this.expectedType){var i=this.expectedType,o=a.type;if("string"!==i.kind&&"number"!==i.kind&&"boolean"!==i.kind&&"object"!==i.kind&&"array"!==i.kind||"value"!==o.kind)if("color"!==i.kind&&"formatted"!==i.kind&&"resolvedImage"!==i.kind||"value"!==o.kind&&"string"!==o.kind)if("padding"!==i.kind||"value"!==o.kind&&"number"!==o.kind&&"array"!==o.kind)if("variableAnchorOffsetCollection"!==i.kind||"value"!==o.kind&&"array"!==o.kind){if(this.checkSubtype(i,o))return null}else a=n(a,i,t.typeAnnotation||"coerce");else a=n(a,i,t.typeAnnotation||"coerce");else a=n(a,i,t.typeAnnotation||"coerce");else a=n(a,i,t.typeAnnotation||"assert")}if(!(a instanceof nt)&&"resolvedImage"!==a.type.kind&&this._isConstant(a)){o=new ct;try{a=new nt(a.type,a.evaluate(o))}catch(r){return this.error(r.message),null}}return a}return this.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(e,t,n){return e="number"==typeof e?this.path.concat(e):this.path,n=n?this.scope.concat(n):this.scope,new ut(this.registry,this._isConstant,e,t||null,n,this.errors)}error(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r"[".concat(e,"]"))).join(""),this.errors.push(new ie(n,e))}checkSubtype(e,t){return(e=we(e,t))&&this.error(e),e}}class dt{constructor(e,t,n){this.type=pe,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");if("object"!=typeof(e=e[1])||Array.isArray(e))return t.error("Collator options argument must be an object.");var n=t.parse(void 0!==e["case-sensitive"]&&e["case-sensitive"],1,ce);if(!n)return null;var r=t.parse(void 0!==e["diacritic-sensitive"]&&e["diacritic-sensitive"],1,ce);if(!r)return null;let i=null;return e.locale&&!(i=t.parse(e.locale,1,le))?null:new dt(n,r,i)}evaluate(e){return new Ge(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const ht=8192;function pt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function ft(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function mt(e,t){var n=(180+e[0])/360;e=e[1],e=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360,t=Math.pow(2,t.z);return[Math.round(n*t*ht),Math.round(e*t*ht)]}function gt(e,t){let n=!1;for(let c=0,u=t.length;ca[1]!=l[1]>a[1]&&a[0]<(l[0]-s[0])*(a[1]-s[1])/(l[1]-s[1])+s[0]&&(n=!n)}}var i,o,a,s,l;return n}function yt(e,t,n,r){var i=e[0]-n[0],o=(e=e[1]-n[1],t[0]-n[0]),a=(t=t[1]-n[1],r[0]-n[0]);n=i*(r=r[1]-n[1])-a*e,i=o*r-a*t;return 0n[2]){var i=.5*r;let t=e[0]-n[0]>i?-r:n[0]-e[0]>i?r:0;0===t&&(t=e[0]-n[2]>i?-r:n[2]-e[0]>i?r:0),e[0]+=t}pt(t,e)}function St(e,t,n,r){var i=Math.pow(2,r.z)*ht,o=[r.x*ht,r.y*ht],a=[];for(const l of e)for(const e of l){var s=[e.x+o[0],e.y+o[1]];xt(s,t,n,i),a.push(s)}return a}function Ct(e,t,n,r){var i=Math.pow(2,r.z)*ht,o=[r.x*ht,r.y*ht],a=[];for(const c of e){var s=[];for(const e of c){var l=[e.x+o[0],e.y+o[1]];pt(t,l),s.push(l)}a.push(s)}if(t[2]-t[0]<=i/2){(r=t)[0]=r[1]=1/0,r[2]=r[3]=-1/0;for(const e of a)for(const r of e)xt(r,t,n,i)}return a}class Et{constructor(e,t){this.type=ce,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if($e(e[1])){var n=e[1];if("FeatureCollection"===n.type)for(let e=0;e{let[n]=t;return!Array.isArray(n)||n.length===e.length-1}));let l=null;for([r,i]of s){l=new ut(t.registry,Tt,t.path,null,t.scope);var c=[];let o=!1;for(let t=1;t{let[t]=e;return function(e){return Array.isArray(e)?"(".concat(e.map(_e).join(", "),")"):"(".concat(_e(e.type),"...)")}(t)})).join(" | ");var f=[];for(let n=1;n{n=t?n&&Tt(e):n&&e instanceof nt})),!!n&&At(e)&&Mt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function At(e){if(e instanceof It){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Et)return!1;let t=!0;return e.eachChild((e=>{t&&!At(e)&&(t=!1)})),t}function Pt(e){if(!(e instanceof It&&"feature-state"===e.name)){let t=!0;return e.eachChild((e=>{t&&!Pt(e)&&(t=!1)})),t}}function Mt(e,t){if(e instanceof It&&0<=t.indexOf(e.name))return!1;let n=!0;return e.eachChild((e=>{n&&!Mt(e,t)&&(n=!1)})),n}function Ot(e,t){var n=e.length-1;let r=0,i=n;for(var o,a,s;r<=i;)if(a=e[o=Math.floor((r+i)/2)],s=e[o+1],a<=t){if(o===n||t=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);if(!(s=t.parse(a,l,i)))return null;i=i||s.type,r.push([o,s])}return new Rt(i,n,r)}evaluate(e){var t,n,r=this.labels,i=this.outputs;return(1===r.length||(t=this.input.evaluate(e))<=r[0]?i[0]:t>=r[(n=r.length)-1]?i[n-1]:i[Ot(r,t)]).evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Lt(e,t,n){return e+n*(t-e)}function Nt(e,t,n){return e.map(((e,r)=>Lt(e,t[r],n)))}const Dt={number:Lt,color:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb";switch(r){case"rgb":var[i,o,a,s]=Nt(e.rgb,t.rgb,n);return new He(i,o,a,s,!1);case"hcl":{var[i,o,a,s]=e.hcl,[l,c,u,d]=t.hcl;let r,h;if(isNaN(i)||isNaN(l))isNaN(i)?isNaN(l)?r=NaN:(r=l,1!==a&&0!==a||(h=c)):(r=i,1!==u&&0!==u||(h=o));else{let e=l-i;i"number"!=typeof e||e<0||1=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);if(!(d=t.parse(u,h,l)))return null;l=l||d.type,s.push([c,d])}return Ce(l,se)||Ce(l,ue)||Ce(l,me)||Ce(l,ye)||Ce(l,ve(se))?new Ft(l,n,r,i,s):t.error("Type ".concat(_e(l)," is not interpolatable."))}evaluate(e){var t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);if(r>=t[(i=t.length)-1])return n[i-1].evaluate(e);var i,o=t[i=Ot(t,r)],a=(t=t[i+1],Ft.interpolationFactor(this.interpolation,r,o,t)),s=n[i].evaluate(e),l=n[i+1].evaluate(e);switch(this.operator){case"interpolate":return Dt[this.type.kind](s,l,a);case"interpolate-hcl":return Dt.color(s,l,a,"hcl");case"interpolate-lab":return Dt.color(s,l,a,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function zt(e,t,n,r){return e-=n,0==(r-=n)?0:1===t?e/r:(Math.pow(t,e)-1)/(Math.pow(t,r)-1)}class Bt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let n=null;const r=t.expectedType;r&&"value"!==r.kind&&(n=r);var i=[];for(const a of e.slice(1)){var o=t.parse(a,1+i.length,n,void 0,{typeAnnotation:"omit"});if(!o)return null;n=n||o.type,i.push(o)}if(n)return r&&i.some((e=>we(r,e.type)))?new Bt(he,i):new Bt(n,i);throw new Error("No output type")}evaluate(e){let t,n=null,r=0;for(const i of this.args)if(r++,null!==(n=(n=i.evaluate(e))&&n instanceof Je&&!n.available&&(t=t||n.name,n=null,r===this.args.length)?t:n))break;return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}class jt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));var n=[];for(let a=1;a",(function(e,t,n){return n=",(function(e,t,n){return n<=t}),(function(e,t,n,r){return 0<=r.compare(t,n)}));class Xt{constructor(e){this.type=fe,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");var n=e[1];if(!Array.isArray(n)&&"object"==typeof n)return t.error("First argument must be an image or text section.");var r=[];let i=!1;for(let s=1;s<=e.length-1;++s){var o=e[s];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let e=null;if(o["font-scale"]&&!(e=t.parse(o["font-scale"],1,se)))return null;let n=null;if(o["text-font"]&&!(n=t.parse(o["text-font"],1,ve(le))))return null;let a=null;if(o["text-color"]&&!(a=t.parse(o["text-color"],1,ue)))return null;(o=r[r.length-1]).scale=e,o.font=n,o.textColor=a}else{if(!(o=t.parse(e[s],1,he)))return null;var a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:o,scale:null,font:null,textColor:null})}}return new Xt(r)}evaluate(e){return new Ke(this.sections.map((t=>{var n=t.content.evaluate(e);return et(n)===ge?new We("",n,null,null,null):new We(tt(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}const Jt={"==":Ht,"!=":Gt,">":Kt,"<":Wt,">=":Zt,"<=":Yt,array:ot,at:class e{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(t,n){var r;return 3!==t.length?n.error("Expected 2 arguments, but found ".concat(t.length-1," instead.")):(r=n.parse(t[1],1,se),t=n.parse(t[2],2,ve(n.expectedType||he)),r&&t?(n=t.type,new e(n.itemType,r,t)):null)}evaluate(e){var t=this.index.evaluate(e);e=this.input.evaluate(e);if(t<0)throw new rt("Array index out of bounds: ".concat(t," < 0."));if(t>=e.length)throw new rt("Array index out of bounds: ".concat(t," > ").concat(e.length-1,"."));if(t!==Math.floor(t))throw new rt("Array index must be an integer, but found ".concat(t," instead."));return e[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},boolean:ot,case:class e{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return n.error("Expected an odd number of arguments.");let r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);var i=[];for(let e=1;e{let[,t]=e;return t.outputDefined()}))&&this.otherwise.outputDefined()}},coalesce:Bt,collator:dt,format:Xt,image:class e{constructor(e){this.type=ge,this.input=e}static parse(t,n){return 2!==t.length?n.error("Expected two arguments."):(t=n.parse(t[1],1,le))?new e(t):n.error("No image name provided.")}evaluate(e){var t=this.input.evaluate(e),n=Je.fromString(t);return n&&e.availableImages&&(n.available=-1Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof e&&Math.floor(e)!==e)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,et(e)))return null}else r=et(e);if(void 0!==o[String(e)])return l.error("Branch labels must be unique.");o[String(e)]=a.length}if(!(s=n.parse(s,e,i)))return null;i=i||s.type,a.push(s)}var c,u=n.parse(t[1],1,he);return!u||!(c=n.parse(t[t.length-1],t.length-1,i))||"value"!==u.type.kind&&n.concat(1).checkSubtype(r,u.type)?null:new e(r,i,u,o,a,c)}evaluate(e){var t=this.input.evaluate(e);return(et(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}},number:ot,"number-format":class e{constructor(e,t,n,r,i){this.type=le,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i}static parse(t,n){if(3!==t.length)return n.error("Expected two arguments.");var r=n.parse(t[1],1,se);if(!r)return null;if("object"!=typeof(t=t[2])||Array.isArray(t))return n.error("NumberFormat options argument must be an object.");let i=null;if(t.locale&&!(i=n.parse(t.locale,1,le)))return null;let o=null;if(t.currency&&!(o=n.parse(t.currency,1,le)))return null;let a=null;if(t["min-fraction-digits"]&&!(a=n.parse(t["min-fraction-digits"],1,se)))return null;let s=null;return t["max-fraction-digits"]&&!(s=n.parse(t["max-fraction-digits"],1,se))?null:new e(r,i,o,a,s)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},object:ot,slice:class e{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(t,n){var r,i;return t.length<=2||5<=t.length?n.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead.")):(r=n.parse(t[1],1,he),i=n.parse(t[2],2,se),r&&i?xe(r.type,[ve(he),le,he])?4===t.length?(t=n.parse(t[3],3,se))?new e(r.type,r,i,t):null:new e(r.type,r,i):n.error("Expected first argument to be of type array or string, but found ".concat(_e(r.type)," instead")):null)}evaluate(e){var t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(Se(t,["string","array"]))return this.endIndex?(e=this.endIndex.evaluate(e),t.slice(n,e)):t.slice(n);throw new rt("Expected first argument to be of type array or string, but found ".concat(_e(et(t))," instead."))}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},step:Rt,string:ot,"to-boolean":st,"to-color":st,"to-number":st,"to-string":st,var:kt,within:Et};function Qt(e,t){let[n,r,i,o]=t;if(n=n.evaluate(e),r=r.evaluate(e),i=i.evaluate(e),o=o?o.evaluate(e):1,e=Qe(n,r,i,o))throw new rt(e);return new He(n/255,r/255,i/255,o,!1)}function $t(e,t){return void 0===(t=t[e])?null:t}function en(e){return{type:e}}function tn(e){return{result:"success",value:e}}function nn(e){return{result:"error",value:e}}function rn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function on(e){return e.expression&&-1[e[0],r(e[1])]))),e.default?e.default=r(e.default):e.default=r(t.default)}if(e.colorSpace&&"rgb"!==(n=e.colorSpace)&&"hcl"!==n&&"lab"!==n)throw new Error('Unknown color space: "'.concat(e.colorSpace,'"'));let a,s,l;if("exponential"===o)a=fn;else if("interval"===o)a=pn;else if("categorical"===o){a=hn,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error('Unknown function type "'.concat(o,'"'));a=mn}if(r){var c={},u=[];for(let t=0;te[0])),evaluate(n,i){let{zoom:o}=n;return fn({stops:r,base:e.base},t,o).evaluate(o,i)}}}return i?{kind:"camera",interpolationType:r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null,interpolationFactor:Ft.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:n=>{let{zoom:r}=n;return a(e,t,r,s,l)}}:{kind:"source",evaluate:(n,r)=>void 0===(r=r&&r.properties?r.properties[e.property]:void 0)?dn(e.default,t.default):a(e,t,r,s,l)}}function dn(e,t,n){return void 0!==e?e:void 0!==t?t:void 0!==n?n:void 0}function hn(e,t,n,r,i){return dn(typeof n===i?r[n]:void 0,e.default,t.default)}function pn(e,t,n){return"number"!==sn(n)?dn(e.default,t.default):(1===(t=e.stops.length)||n<=e.stops[0][0]?e.stops[0]:n>=e.stops[t-1][0]?e.stops[t-1]:(t=Ot(e.stops.map((e=>e[0])),n),e.stops[t]))[1]}function fn(e,t,n){var r=void 0!==e.base?e.base:1;if("number"!==sn(n))return dn(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];i=Ot(e.stops.map((e=>e[0])),n);const o=function(e,t,n,r){return e-=n,0==(r-=n)?0:1===t?e/r:(Math.pow(t,e)-1)/(Math.pow(t,r)-1)}(n,r,e.stops[i][0],e.stops[i+1][0]),a=e.stops[i][1],s=e.stops[i+1][1],l=Dt[t.type]||cn;return"function"==typeof a.evaluate?{evaluate(){for(var t=arguments.length,n=new Array(t),r=0;r{let[n]=t;throw new rt(n.evaluate(e))}],typeof:[le,[he],(e,t)=>{let[n]=t;return _e(et(n.evaluate(e)))}],"to-rgba":[ve(se,4),[ue],(e,t)=>{let[n]=t;return function(e,t){var[t,e,n,r]=t.evaluate(e).rgb;return[255*t,255*e,255*n,r]}(e,n)}],rgb:[ue,[se,se,se],Qt],rgba:[ue,[se,se,se,se],Qt],has:{type:ce,overloads:[[[le],(e,t)=>{let[n]=t;return n.evaluate(e)in e.properties()}],[[le,de],(e,t)=>{let[n,r]=t;return n.evaluate(e)in r.evaluate(e)}]]},get:{type:he,overloads:[[[le],(e,t)=>{let[n]=t;return $t(n.evaluate(e),e.properties())}],[[le,de],(e,t)=>{let[n,r]=t;return $t(n.evaluate(e),r.evaluate(e))}]]},"feature-state":[he,[le],(e,t)=>{let[n]=t;return $t(n.evaluate(e),e.featureState||{})}],properties:[de,[],e=>e.properties()],"geometry-type":[le,[],e=>e.geometryType()],id:[he,[],e=>e.id()],zoom:[se,[],e=>e.globals.zoom],"heatmap-density":[se,[],e=>e.globals.heatmapDensity||0],"line-progress":[se,[],e=>e.globals.lineProgress||0],accumulated:[he,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[se,en(se),(e,t)=>{let n=0;for(const r of t)n+=r.evaluate(e);return n}],"*":[se,en(se),(e,t)=>{let n=1;for(const r of t)n*=r.evaluate(e);return n}],"-":{type:se,overloads:[[[se,se],(e,t)=>{let[n,r]=t;return n.evaluate(e)-r.evaluate(e)}],[[se],(e,t)=>{let[n]=t;return-n.evaluate(e)}]]},"/":[se,[se,se],(e,t)=>{let[n,r]=t;return n.evaluate(e)/r.evaluate(e)}],"%":[se,[se,se],(e,t)=>{let[n,r]=t;return n.evaluate(e)%r.evaluate(e)}],ln2:[se,[],()=>Math.LN2],pi:[se,[],()=>Math.PI],e:[se,[],()=>Math.E],"^":[se,[se,se],(e,t)=>{let[n,r]=t;return Math.pow(n.evaluate(e),r.evaluate(e))}],sqrt:[se,[se],(e,t)=>{let[n]=t;return Math.sqrt(n.evaluate(e))}],log10:[se,[se],(e,t)=>{let[n]=t;return Math.log(n.evaluate(e))/Math.LN10}],ln:[se,[se],(e,t)=>{let[n]=t;return Math.log(n.evaluate(e))}],log2:[se,[se],(e,t)=>{let[n]=t;return Math.log(n.evaluate(e))/Math.LN2}],sin:[se,[se],(e,t)=>{let[n]=t;return Math.sin(n.evaluate(e))}],cos:[se,[se],(e,t)=>{let[n]=t;return Math.cos(n.evaluate(e))}],tan:[se,[se],(e,t)=>{let[n]=t;return Math.tan(n.evaluate(e))}],asin:[se,[se],(e,t)=>{let[n]=t;return Math.asin(n.evaluate(e))}],acos:[se,[se],(e,t)=>{let[n]=t;return Math.acos(n.evaluate(e))}],atan:[se,[se],(e,t)=>{let[n]=t;return Math.atan(n.evaluate(e))}],min:[se,en(se),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[se,en(se),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[se,[se],(e,t)=>{let[n]=t;return Math.abs(n.evaluate(e))}],round:[se,[se],(e,t)=>{let[n]=t;return n=n.evaluate(e),n<0?-Math.round(-n):Math.round(n)}],floor:[se,[se],(e,t)=>{let[n]=t;return Math.floor(n.evaluate(e))}],ceil:[se,[se],(e,t)=>{let[n]=t;return Math.ceil(n.evaluate(e))}],"filter-==":[ce,[le,he],(e,t)=>{let[n,r]=t;return e.properties()[n.value]===r.value}],"filter-id-==":[ce,[he],(e,t)=>{let[n]=t;return e.id()===n.value}],"filter-type-==":[ce,[le],(e,t)=>{let[n]=t;return e.geometryType()===n.value}],"filter-<":[ce,[le,he],(e,t)=>{let[n,r]=t;return e=e.properties()[n.value],n=r.value,typeof e==typeof n&&e{let[n]=t;return e=e.id(),n=n.value,typeof e==typeof n&&e":[ce,[le,he],(e,t)=>{let[n,r]=t;return e=e.properties()[n.value],n=r.value,typeof e==typeof n&&n":[ce,[he],(e,t)=>{let[n]=t;return e=e.id(),n=n.value,typeof e==typeof n&&n{let[n,r]=t;return e=e.properties()[n.value],n=r.value,typeof e==typeof n&&e<=n}],"filter-id-<=":[ce,[he],(e,t)=>{let[n]=t;return e=e.id(),n=n.value,typeof e==typeof n&&e<=n}],"filter->=":[ce,[le,he],(e,t)=>{let[n,r]=t;return e=e.properties()[n.value],n=r.value,typeof e==typeof n&&n<=e}],"filter-id->=":[ce,[he],(e,t)=>{let[n]=t;return e=e.id(),n=n.value,typeof e==typeof n&&n<=e}],"filter-has":[ce,[he],(e,t)=>{let[n]=t;return n.value in e.properties()}],"filter-has-id":[ce,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ce,[ve(le)],(e,t)=>{let[n]=t;return 0<=n.value.indexOf(e.geometryType())}],"filter-id-in":[ce,[ve(he)],(e,t)=>{let[n]=t;return 0<=n.value.indexOf(e.id())}],"filter-in-small":[ce,[le,ve(he)],(e,t)=>{let[n,r]=t;return 0<=r.value.indexOf(e.properties()[n.value])}],"filter-in-large":[ce,[le,ve(he)],(e,t)=>{let[n,r]=t;for(var i=e.properties()[n.value],o=r.value,a=0,s=r.value.length-1;a<=s;){var l=a+s>>1;if(o[l]===i)return!0;o[l]>i?s=l-1:a=1+l}return!1}],all:{type:ce,overloads:[[[ce,ce],(e,t)=>{let[n,r]=t;return n.evaluate(e)&&r.evaluate(e)}],[en(ce),(e,t)=>{for(const n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:ce,overloads:[[[ce,ce],(e,t)=>{let[n,r]=t;return n.evaluate(e)||r.evaluate(e)}],[en(ce),(e,t)=>{for(const n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[ce,[ce],(e,t)=>{let[n]=t;return!n.evaluate(e)}],"is-supported-script":[ce,[le],(e,t)=>{let[n]=t;var r=e.globals&&e.globals.isSupportedScript;return!r||r(n.evaluate(e))}],upcase:[le,[le],(e,t)=>{let[n]=t;return n.evaluate(e).toUpperCase()}],downcase:[le,[le],(e,t)=>{let[n]=t;return n.evaluate(e).toLowerCase()}],concat:[le,en(he),(e,t)=>t.map((t=>tt(t.evaluate(e)))).join("")],"resolved-locale":[le,[pe],(e,t)=>{let[n]=t;return n.evaluate(e).resolvedLocale()}]});class gn{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new ct,this._defaultValue=t?function(e){return"color"===e.type&&ln(e.default)?new He(0,0,0,0):"color"===e.type?He.parse(e.default)||null:"padding"===e.type?Ye.parse(e.default)||null:"variableAnchorOffsetCollection"===e.type?Xe.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,n,r,i,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||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)return a;throw new rt("Expected value to be one of ".concat(Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", "),", but found ").concat(JSON.stringify(a)," instead."))}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function yn(e){return Array.isArray(e)&&0{const r=e(t);r instanceof ie?n=r:!n&&r?n=new ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&r&&n!==r&&(n=new ie("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}(r))||i?r instanceof ie?nn([r]):r instanceof Ft&&!an(t)?nn([new ie("",'"interpolate" expressions cannot be used with this property')]):r?(i=r instanceof Ft?r.interpolation:void 0,tn(new bn(n?"camera":"composite",e.value,r.labels,i))):tn(new _n(n?"constant":"source",e.value)):nn([new ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]):nn([new ie("","zoom expressions not supported")]):nn([new ie("","data expressions not supported")])}class xn{constructor(e,t){this._parameters=e,this._specification=t,re(this,un(this._parameters,this._specification))}static deserialize(e){return new xn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Sn(e){if(!0===e||!1===e)return 1;if(Array.isArray(e)&&0!==e.length)switch(e[0]){case"has":return 2<=e.length&&"$id"!==e[1]&&"$type"!==e[1];case"in":return 3<=e.length&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!Sn(t)&&"boolean"!=typeof t)return;return 1;default:return 1}}const Cn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function En(e){if(null==e)return{filter:()=>!0,needGeometry:!1};const t=vn(e=Sn(e)?e:In(e),Cn);if("error"===t.result)throw new Error(t.value.map((e=>e.key+": "+e.message)).join(", "));return{filter:(e,n,r)=>t.value.evaluate(e,n,{},r),needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let n=1;n"===t||"<="===t||">="===t?Tn(e[1],e[2],t):"any"===t?(n=e.slice(1),["any"].concat(n.map(In))):"all"===t?["all"].concat(e.slice(1).map(In)):"none"===t?["all"].concat(e.slice(1).map(In).map(Mn)):"in"===t?An(e[1],e.slice(2)):"!in"===t?Mn(An(e[1],e.slice(2))):"has"===t?Pn(e[1]):"!has"===t?Mn(Pn(e[1])):"within"!==t||e)}function Tn(e,t,n){switch(e){case"$type":return["filter-type-"+n,t];case"$id":return["filter-id-"+n,t];default:return["filter-"+n,e,t]}}function An(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return 200typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(kn)]]:["filter-in-small",e,["literal",t]]}}function Pn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Mn(e){return["!",e]}function On(e){let t="";for(const n of Y)t+="/"+function e(t){var n=typeof t;if("number"==n||"boolean"==n||"string"==n||null==t)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(const r of t)n+=e(r)+",";return n+"]"}var r=Object.keys(t).sort();let i="{";for(let o=0;oe.maximum?[new ne(t,n,n+" is greater than the maximum value "+e.maximum)]:[]}function Bn(e){const t=e.valueSpec,n=Ln(e.value.type);let r,i,o,a={};var s="categorical"!==n&&void 0===e.value.property,l=!s;const c="array"===sn(e.value.stops)&&"array"===sn(e.value.stops[0])&&"object"===sn(e.value.stops[0][0]);var u=Dn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===n)return[new ne(e.key,e.value,'identity function may not have a "stops" property')];let t=[];var r=e.value;return t=t.concat(Fn({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===sn(r)&&0===r.length&&t.push(new ne(e.key,r,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===n&&s&&u.push(new ne(e.key,e.value,'missing required property "property"')),"identity"===n||e.value.stops||u.push(new ne(e.key,e.value,'missing required property "stops"')),"exponential"===n&&e.valueSpec.expression&&!an(e.valueSpec)&&u.push(new ne(e.key,e.value,"exponential functions not supported")),8<=e.styleSpec.$version&&(l&&!rn(e.valueSpec)?u.push(new ne(e.key,e.value,"property functions not supported")):s&&!on(e.valueSpec)&&u.push(new ne(e.key,e.value,"zoom functions not supported"))),"categorical"!==n&&!c||void 0!==e.value.property||u.push(new ne(e.key,e.value,'"property" property is required')),u;function d(e){let n=[];var r=e.value,s=e.key;if("array"!==sn(r))return[new ne(s,r,"array expected, ".concat(sn(r)," found"))];if(2!==r.length)return[new ne(s,r,"array length 2 expected, length ".concat(r.length," found"))];if(c){if("object"!==sn(r[0]))return[new ne(s,r,"object expected, ".concat(sn(r[0])," found"))];if(void 0===r[0].zoom)return[new ne(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new ne(s,r,"object stop key must have value")];if(o&&o>Ln(r[0].zoom))return[new ne(s,r[0].zoom,"stop zoom values must appear in ascending order")];Ln(r[0].zoom)!==o&&(o=Ln(r[0].zoom),i=void 0,a={}),n=n.concat(Dn({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:zn,value:h}}))}else n=n.concat(h({key:s+"[0]",value:r[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return yn(Nn(r[1]))?n.concat([new ne(s+"[1]",r[1],"expressions are not allowed in function stops.")]):n.concat(e.validateSpec({key:s+"[1]",value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function h(e,o){var s=sn(e.value),l=Ln(e.value);o=null!==e.value?e.value:o;if(r){if(s!==r)return[new ne(e.key,o,s+" stop domain type must match previous stop domain type "+r)]}else r=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ne(e.key,o,"stop domain value must be a number, string, or boolean")];if("number"===s||"categorical"===n)return"categorical"!==n||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&void 0!==i&&lnew ne(""+e.key+t.key,e.value,t.message)));if(t=t.value.expression||t.value._styleExpression.expression,"property"===e.expressionContext&&"text-font"===e.propertyKey&&!t.outputDefined())return[new ne(e.key,e.value,'Invalid data expression for "'.concat(e.propertyKey,'". Output values must be contained as literals within the expression.'))];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Pt(t))return[new ne(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Pt(t))return[new ne(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Mt(t,["zoom","feature-state"]))return[new ne(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!At(t))return[new ne(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Un(e){var t=e.key,n=e.value,r=(e=e.valueSpec,[]);return Array.isArray(e.values)?-1===e.values.indexOf(Ln(n))&&r.push(new ne(t,n,"expected one of [".concat(e.values.join(", "),"], ").concat(JSON.stringify(n)," found"))):-1===Object.keys(e.values).indexOf(Ln(n))&&r.push(new ne(t,n,"expected one of [".concat(Object.keys(e.values).join(", "),"], ").concat(JSON.stringify(n)," found"))),r}function qn(e){return Sn(Nn(e.value))?jn(re({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){const n=t.value,r=t.key;if("array"!==sn(n))return[new ne(r,n,"array expected, ".concat(sn(n)," found"))];const i=t.styleSpec;let o,a=[];if(n.length<1)return[new ne(r,n,"filter array must have at least 1 element")];switch(a=a.concat(Un({key:r+"[0]",value:n[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ln(n[0])){case"<":case"<=":case">":case">=":2<=n.length&&"$type"===Ln(n[1])&&a.push(new ne(r,n,'"$type" cannot be use with operator "'.concat(n[0],'"')));case"==":case"!=":3!==n.length&&a.push(new ne(r,n,'filter array for operator "'.concat(n[0],'" must have 3 elements')));case"in":case"!in":2<=n.length&&"string"!==(o=sn(n[1]))&&a.push(new ne(r+"[1]",n[1],"string expected, ".concat(o," found")));for(let e=2;e{e in n&&t.push(new ne(r,n[e],'"'.concat(e,'" is prohibited for ref layers')))})),a.layers.forEach((t=>{Ln(t.id)===c&&(e=t)})),e?e.ref?t.push(new ne(r,n.ref,"ref cannot reference another ref layer")):l=Ln(e.type):t.push(new ne(r,n.ref,'ref layer "'.concat(c,'" not found')))}else"background"!==l&&(n.source?(o=(i=a.sources&&a.sources[n.source])&&Ln(i.type),i?"vector"===o&&"raster"===l?t.push(new ne(r,n.source,'layer "'.concat(n.id,'" requires a raster source'))):"raster-dem"!==o&&"hillshade"===l?t.push(new ne(r,n.source,'layer "'.concat(n.id,'" requires a raster-dem source'))):"raster"===o&&"raster"!==l?t.push(new ne(r,n.source,'layer "'.concat(n.id,'" requires a vector source'))):"vector"!==o||n["source-layer"]?"raster-dem"===o&&"hillshade"!==l?t.push(new ne(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==l||!n.paint||!n.paint["line-gradient"]||"geojson"===o&&i.lineMetrics||t.push(new ne(r,n,'layer "'.concat(n.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):t.push(new ne(r,n,'layer "'.concat(n.id,'" must specify a "source-layer"'))):t.push(new ne(r,n.source,'source "'.concat(n.source,'" not found')))):t.push(new ne(r,n,'missing required property "source"')));return t=t.concat(Dn({key:r,value:n,valueSpec:s.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:r+".type",value:n.type,valueSpec:s.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:"type"}),filter:qn,layout:e=>Dn({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Gn(re({layerType:l},e))}}),paint:e=>Dn({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Hn(re({layerType:l},e))}})}}))}function Kn(e){var t=e.value,n=(e=e.key,sn(t));return"string"!==n?[new ne(e,t,"string expected, ".concat(n," found"))]:[]}const Yn={promoteId:function(e){let{key:t,value:n}=e;if("string"===sn(n))return Kn({key:t,value:n});var r=[];for(const i in n)r.push(...Kn({key:t+"."+i,value:n[i]}));return r}};function Zn(e){var t=e.value,n=e.key,r=e.styleSpec,i=e.style,o=e.validateSpec;if(!t.type)return[new ne(n,t,'"type" is required')];var a=Ln(t.type);let s;switch(a){case"vector":case"raster":return Dn({key:n,value:t,valueSpec:r["source_"+a.replace("-","_")],style:e.style,styleSpec:r,objectElementValidators:Yn,validateSpec:o});case"raster-dem":return function(e){var t=null!=(s=e.sourceName)?s:"",n=e.value,r=e.styleSpec,i=r.source_raster_dem,o=e.style;let a=[];var s=sn(n);if(void 0!==n)if("object"!==s)a.push(new ne("source_raster_dem",n,"object expected, ".concat(s," found")));else{var l="custom"===Ln(n.encoding),c=["redFactor","greenFactor","blueFactor","baseShift"],u=e.value.encoding?'"'.concat(e.value.encoding,'"'):"Default";for(const s in n)!l&&c.includes(s)?a.push(new ne(s,n[s],'In "'.concat(t,'": "').concat(s,'" is only valid when "encoding" is set to "custom". ').concat(u," encoding found"))):i[s]?a=a.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:o,styleSpec:r})):a.push(new ne(s,n[s],'unknown property "'.concat(s,'"')))}return a}({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:o});case"geojson":if(s=Dn({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:o,objectElementValidators:Yn}),t.cluster)for(const e in t.clusterProperties){var[l,c]=t.clusterProperties[e],l="string"==typeof l?[l,["accumulated"],["get",e]]:l;s.push(...jn({key:"".concat(n,".").concat(e,".map"),value:c,validateSpec:o,expressionContext:"cluster-map"})),s.push(...jn({key:"".concat(n,".").concat(e,".reduce"),value:l,validateSpec:o,expressionContext:"cluster-reduce"}))}return s;case"video":return Dn({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:o,styleSpec:r});case"image":return Dn({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:o,styleSpec:r});case"canvas":return[new ne(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Un({key:n+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:o,styleSpec:r})}}function Xn(e){var t=e.value,n=e.styleSpec,r=n.light,i=e.style;let o=[];var a=sn(t);if(void 0!==t){if("object"!==a)return o.concat([new ne("light",t,"object expected, ".concat(a," found"))]);for(const a in t){var s=a.match(/^(.*)-transition$/);o=s&&r[s[1]]&&r[s[1]].transition?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n})):r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],validateSpec:e.validateSpec,style:i,styleSpec:n})):o.concat([new ne(a,t[a],'unknown property "'.concat(a,'"'))])}}return o}function Jn(e){var t=e.value,n=e.styleSpec,r=n.terrain,i=e.style;let o=[];var a=sn(t);if(void 0!==t){if("object"!==a)return o.concat([new ne("terrain",t,"object expected, ".concat(a," found"))]);for(const a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],validateSpec:e.validateSpec,style:i,styleSpec:n})):o.concat([new ne(a,t[a],'unknown property "'.concat(a,'"'))])}return o}function Qn(e){let t=[];var n=e.value,r=e.key;if(Array.isArray(n)){var i=[],o=[];for(const a in n)n[a].id&&i.includes(n[a].id)&&t.push(new ne(r,n,"all the sprites' ids must be unique, but ".concat(n[a].id," is duplicated"))),i.push(n[a].id),n[a].url&&o.includes(n[a].url)&&t.push(new ne(r,n,"all the sprites' URLs must be unique, but ".concat(n[a].url," is duplicated"))),o.push(n[a].url),t=t.concat(Dn({key:"".concat(r,"[").concat(a,"]"),value:n[a],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return Kn({key:r,value:n})}const $n={"*":()=>[],array:Fn,boolean:function(e){var t=e.value,n=(e=e.key,sn(t));return"boolean"!==n?[new ne(e,t,"boolean expected, ".concat(n," found"))]:[]},number:zn,color:function(e){var t=e.key,n=sn(e=e.value);return"string"!==n?[new ne(t,e,"color expected, ".concat(n," found"))]:He.parse(String(e))?[]:[new ne(t,e,'color expected, "'.concat(e,'" found'))]},constants:Rn,enum:Un,filter:qn,function:Bn,layer:Wn,object:Dn,source:Zn,light:Xn,terrain:Jn,string:Kn,formatted:function(e){return 0===Kn(e).length?[]:jn(e)},resolvedImage:function(e){return 0===Kn(e).length?[]:jn(e)},padding:function(e){var t=e.key,n=e.value;if("array"!==sn(n))return zn({key:t,value:n,valueSpec:{}});{if(n.length<1||41&&void 0!==arguments[1]?arguments[1]:K,n=[];return n=n.concat(er({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:er,objectElementValidators:{glyphs:tr,"*":()=>[]}})),ir(n=e.constants?n.concat(Rn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:er})):n)}function rr(e){return function(t){return e({...t,validateSpec:er})}}function ir(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function or(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r=u[0+d]&&r>=u[1+d])?(a[h]=!0,o.push(c[h])):a[h]=!1)}}}_forEachCell(e,t,n,r,i,o,a,s){var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(r);for(let p=l;p<=u;p++)for(let l=c;l<=d;l++){var h=this.d*l+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&i.call(this,e,t,n,r,h,o,a,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;var e=this.cells,t=3+this.cells.length+1+1;let n=0;for(let a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if(dr[e])throw new Error(e+" is already registered.");Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),dr[e]={klass:t,omit:n.omit||[],shallow:n.shallow||[]}}hr("Object",Object),hr("TransferableGridIndex",ur),hr("Color",He),hr("Error",Error),hr("AJAXError",N),hr("ResolvedImage",Je),hr("StylePropertyFunction",xn),hr("StyleExpression",gn,{omit:["_evaluator"]}),hr("ZoomDependentExpression",bn),hr("ZoomConstantExpression",_n),hr("CompoundExpression",It,{omit:["_evaluate"]});for(const Kc in Jt)Jt[Kc]._classRegistryKey||hr("Expression_"+Kc,Jt[Kc]);function pr(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function fr(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob)return e;if(pr(e))return t&&t.push(e),e;if(k(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e))return r=e,t&&t.push(r.buffer),r;if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){var n=[];for(const r of e)n.push(fr(r,t));return n}if("object"!=typeof e)throw new Error("can't serialize object of type "+typeof e);var r=e.constructor,i=r._classRegistryKey;if(!i)throw new Error("can't serialize object of unregistered class");if(!dr[i])throw new Error(i+" is not registered.");var o,a=r.serialize?r.serialize(e,t):{};if(r.serialize){if(t&&a===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const n in e)!e.hasOwnProperty(n)||0<=dr[i].omit.indexOf(n)||(o=e[n],a[n]=0<=dr[i].shallow.indexOf(n)?o:fr(o,t));e instanceof Error&&(a.message=e.message)}if(a.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(a.$name=i),a}function mr(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||pr(e)||k(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(mr);if("object"!=typeof e)throw new Error("can't deserialize object of type "+typeof e);var t=e.$name||"Object";if(!dr[t])throw new Error("can't deserialize unregistered class "+t);var n=dr[t].klass;if(!n)throw new Error("can't deserialize unregistered class "+t);if(n.deserialize)return n.deserialize(e);var r,i=Object.create(n.prototype);for(const o of Object.keys(e))"$name"!==o&&(r=e[o],i[o]=0<=dr[t].shallow.indexOf(o)?r:mr(r));return i}class gr{constructor(){this.first=!0}update(e,t){var n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom128<=e&&e<=255,Arabic:e=>1536<=e&&e<=1791,"Arabic Supplement":e=>1872<=e&&e<=1919,"Arabic Extended-A":e=>2208<=e&&e<=2303,"Hangul Jamo":e=>4352<=e&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>5120<=e&&e<=5759,Khmer:e=>6016<=e&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>6320<=e&&e<=6399,"General Punctuation":e=>8192<=e&&e<=8303,"Letterlike Symbols":e=>8448<=e&&e<=8527,"Number Forms":e=>8528<=e&&e<=8591,"Miscellaneous Technical":e=>8960<=e&&e<=9215,"Control Pictures":e=>9216<=e&&e<=9279,"Optical Character Recognition":e=>9280<=e&&e<=9311,"Enclosed Alphanumerics":e=>9312<=e&&e<=9471,"Geometric Shapes":e=>9632<=e&&e<=9727,"Miscellaneous Symbols":e=>9728<=e&&e<=9983,"Miscellaneous Symbols and Arrows":e=>11008<=e&&e<=11263,"CJK Radicals Supplement":e=>11904<=e&&e<=12031,"Kangxi Radicals":e=>12032<=e&&e<=12255,"Ideographic Description Characters":e=>12272<=e&&e<=12287,"CJK Symbols and Punctuation":e=>12288<=e&&e<=12351,Hiragana:e=>12352<=e&&e<=12447,Katakana:e=>12448<=e&&e<=12543,Bopomofo:e=>12544<=e&&e<=12591,"Hangul Compatibility Jamo":e=>12592<=e&&e<=12687,Kanbun:e=>12688<=e&&e<=12703,"Bopomofo Extended":e=>12704<=e&&e<=12735,"CJK Strokes":e=>12736<=e&&e<=12783,"Katakana Phonetic Extensions":e=>12784<=e&&e<=12799,"Enclosed CJK Letters and Months":e=>12800<=e&&e<=13055,"CJK Compatibility":e=>13056<=e&&e<=13311,"CJK Unified Ideographs Extension A":e=>13312<=e&&e<=19903,"Yijing Hexagram Symbols":e=>19904<=e&&e<=19967,"CJK Unified Ideographs":e=>19968<=e&&e<=40959,"Yi Syllables":e=>40960<=e&&e<=42127,"Yi Radicals":e=>42128<=e&&e<=42191,"Hangul Jamo Extended-A":e=>43360<=e&&e<=43391,"Hangul Syllables":e=>44032<=e&&e<=55215,"Hangul Jamo Extended-B":e=>55216<=e&&e<=55295,"Private Use Area":e=>57344<=e&&e<=63743,"CJK Compatibility Ideographs":e=>63744<=e&&e<=64255,"Arabic Presentation Forms-A":e=>64336<=e&&e<=65023,"Vertical Forms":e=>65040<=e&&e<=65055,"CJK Compatibility Forms":e=>65072<=e&&e<=65103,"Small Form Variants":e=>65104<=e&&e<=65135,"Arabic Presentation Forms-B":e=>65136<=e&&e<=65279,"Halfwidth and Fullwidth Forms":e=>65280<=e&&e<=65519};function vr(e){for(const t of e)if(br(t.charCodeAt(0)))return!0;return!1}function _r(e){for(const n of e)if(t=n.charCodeAt(0),yr.Arabic(t)||yr["Arabic Supplement"](t)||yr["Arabic Extended-A"](t)||yr["Arabic Presentation Forms-A"](t)||yr["Arabic Presentation Forms-B"](t))return;var t;return 1}function br(e){return 746===e||747===e||!(e<4352)&&(yr["Bopomofo Extended"](e)||yr.Bopomofo(e)||yr["CJK Compatibility Forms"](e)&&!(65097<=e&&e<=65103)||yr["CJK Compatibility Ideographs"](e)||yr["CJK Compatibility"](e)||yr["CJK Radicals Supplement"](e)||yr["CJK Strokes"](e)||!(!yr["CJK Symbols and Punctuation"](e)||12296<=e&&e<=12305||12308<=e&&e<=12319||12336===e)||yr["CJK Unified Ideographs Extension A"](e)||yr["CJK Unified Ideographs"](e)||yr["Enclosed CJK Letters and Months"](e)||yr["Hangul Compatibility Jamo"](e)||yr["Hangul Jamo Extended-A"](e)||yr["Hangul Jamo Extended-B"](e)||yr["Hangul Jamo"](e)||yr["Hangul Syllables"](e)||yr.Hiragana(e)||yr["Ideographic Description Characters"](e)||yr.Kanbun(e)||yr["Kangxi Radicals"](e)||yr["Katakana Phonetic Extensions"](e)||yr.Katakana(e)&&12540!==e||!(!yr["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||65306<=e&&e<=65310||65339===e||65341===e||65343===e||65371<=e&&e<=65503||65507===e||65512<=e&&e<=65519)||!(!yr["Small Form Variants"](e)||65112<=e&&e<=65118||65123<=e&&e<=65126)||yr["Unified Canadian Aboriginal Syllabics"](e)||yr["Unified Canadian Aboriginal Syllabics Extended"](e)||yr["Vertical Forms"](e)||yr["Yijing Hexagram Symbols"](e)||yr["Yi Syllables"](e)||!!yr["Yi Radicals"](e))}function wr(e){return!(br(e)||yr["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||yr["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||yr["Letterlike Symbols"](e)||yr["Number Forms"](e)||yr["Miscellaneous Technical"](e)&&(8960<=e&&e<=8967||8972<=e&&e<=8991||8996<=e&&e<=9e3||9003===e||9085<=e&&e<=9114||9150<=e&&e<=9165||9167===e||9169<=e&&e<=9179||9186<=e&&e<=9215)||yr["Control Pictures"](e)&&9251!==e||yr["Optical Character Recognition"](e)||yr["Enclosed Alphanumerics"](e)||yr["Geometric Shapes"](e)||yr["Miscellaneous Symbols"](e)&&!(9754<=e&&e<=9759)||yr["Miscellaneous Symbols and Arrows"](e)&&(11026<=e&&e<=11055||11088<=e&&e<=11097||11192<=e&&e<=11243)||yr["CJK Symbols and Punctuation"](e)||yr.Katakana(e)||yr["Private Use Area"](e)||yr["CJK Compatibility Forms"](e)||yr["Small Form Variants"](e)||yr["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||9984<=e&&e<=10087||10102<=e&&e<=10131||65532===e||65533===e)}function xr(e){return 1424<=e&&e<=2303||yr["Arabic Presentation Forms-A"](e)||yr["Arabic Presentation Forms-B"](e)}const Sr="deferred",Cr="loading",Er="loaded",kr="error";let Ir=null,Tr="unavailable",Ar=null;const Pr=function(e){e&&"string"==typeof e&&-1{e?Pr(e):(Tr=Er,Mr())}))}const Nr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Tr===Er||null!=Nr.applyArabicShaping,isLoading:()=>Tr===Cr,setState(e){if(!C())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Tr=e.pluginStatus,Ar=e.pluginURL},isParsed(){if(C())return null!=Nr.applyArabicShaping&&null!=Nr.processBidirectionalText&&null!=Nr.processStyledBidirectionalText;throw new Error("rtl-text-plugin is only parsed on the worker-threads")},getPluginURL(){if(C())return Ar;throw new Error("rtl-text-plugin url can only be queried from the worker threads")}};class Dr{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new gr,this.transition={})}isSupportedScript(e){return function(e,t){for(const r of e)if(n=r.charCodeAt(0),!t&&xr(n)||2304<=n&&n<=3583||3840<=n&&n<=4255||yr.Khmer(n))return!1;var n;return!0}(e,Nr.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){var e=this.zoom,t=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}}}class Fr{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(ln(e))return new xn(e,t);if(yn(e)){var n=wn(e,t);if("error"===n.result)throw new Error(n.value.map((e=>e.key+": "+e.message)).join(", "));return n.value}{let n=e;return"color"===t.type&&"string"==typeof e?n=He.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(n=Xe.parse(e)):n=Ye.parse(e),{kind:"constant",evaluate:()=>n}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}class zr{constructor(e){this.property=e,this.value=new Fr(e,void 0)}transitioned(e,t){return new jr(this.property,this.value,t,g({},e.transition,this.transition),e.now)}untransitioned(){return new jr(this.property,this.value,null,{},0)}}class Br{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return b(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new zr(this._values[e].property)),this._values[e].value=new Fr(this._values[e].property,null===t?void 0:b(t))}getTransition(e){return b(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new zr(this._values[e].property)),this._values[e].transition=b(t)||void 0}serialize(){var e={};for(const n of Object.keys(this._values)){var t;void 0!==(t=(void 0!==(t=this.getValue(n))&&(e[n]=t),this.getTransition(n)))&&(e[n+"-transition"]=t)}return e}transitioned(e,t){var n=new Ur(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(e,t._values[r]);return n}untransitioned(){var e=new Ur(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class jr{constructor(e,t,n,r,i){this.property=e,this.value=t,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){var r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),o=this.prior;return o?r>this.end||this.value.isDataDriven()?(this.prior=null,i):rr.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}}class Yr{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){if(void 0!==e.value)return"constant"===e.expression.kind?(n=e.expression.evaluate(t,null,{},n,r),this._calculate(n,n,n,t)):this._calculate(e.expression.evaluate(new Dr(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Dr(Math.floor(t.zoom),t)),e.expression.evaluate(new Dr(Math.floor(t.zoom+1),t)),t)}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}}class Zr{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)}interpolate(){return!1}}class Xr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){var t=((n=e[r]).specification.overridable&&this.overridableProperties.push(r),this.defaultPropertyValues[r]=new Fr(n,void 0)),n=this.defaultTransitionablePropertyValues[r]=new zr(n);this.defaultTransitioningPropertyValues[r]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=t.possiblyEvaluate({})}}}hr("DataDrivenProperty",Wr),hr("DataConstantProperty",Gr),hr("CrossFadedDataDrivenProperty",Kr),hr("CrossFadedProperty",Yr),hr("ColorRampProperty",Zr);const Jr="-transition";class Qr extends W{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new qr(t.layout)),t.paint)){this._transitionablePaint=new Br(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Hr(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t){var r="layers.".concat(this.id,".layout.")+e;if(this._validate(lr,r,e,t,n))return}"visibility"===e?this.visibility=t:this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){return e.endsWith(Jr)?this._transitionablePaint.getTransition(e.slice(0,-Jr.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t){var r="layers.".concat(this.id,".paint.")+e;if(this._validate(sr,r,e,t,n))return!1}var i;return e.endsWith(Jr)?(this._transitionablePaint.setTransition(e.slice(0,-Jr.length),t||void 0),!1):(n="cross-faded-data-driven"===(r=this._transitionablePaint._values[e]).property.specification["property-type"],i=r.value.isDataDriven(),r=r.value,this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e),(t=this._transitionablePaint._values[e].value).isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(e,r,t))}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),_(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!i||!1!==i.validate)&&cr(this,e.call(ar,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:K,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){var e=this.paint.get(t);if(e instanceof Vr&&rn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const $r={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ei{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ti{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){e>this.capacity&&(this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement),e=this.uint8,this._refreshViews(),e)&&this.uint8.set(e)}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ni(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;return{members:e.map((e=>{i=e.type;var i=$r[i].BYTES_PER_ELEMENT,o=n=ri(n,Math.max(t,i)),a=e.components||1;return r=Math.max(r,i),n+=i*a,{name:e.name,type:e.type,components:a,offset:o}})),size:ri(n,Math.max(r,t)),alignment:t}}function ri(e,t){return Math.ceil(e/t)*t}class ii extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){var r=2*e;return this.int16[0+r]=t,this.int16[1+r]=n,e}}ii.prototype.bytesPerElement=4,hr("StructArrayLayout2i4",ii);class oi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){var i=3*e;return this.int16[0+i]=t,this.int16[1+i]=n,this.int16[2+i]=r,e}}oi.prototype.bytesPerElement=6,hr("StructArrayLayout3i6",oi);class ai extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){var o=4*e;return this.int16[0+o]=t,this.int16[1+o]=n,this.int16[2+o]=r,this.int16[3+o]=i,e}}ai.prototype.bytesPerElement=8,hr("StructArrayLayout4i8",ai);class si extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){var s=6*e;return this.int16[0+s]=t,this.int16[1+s]=n,this.int16[2+s]=r,this.int16[3+s]=i,this.int16[4+s]=o,this.int16[5+s]=a,e}}si.prototype.bytesPerElement=12,hr("StructArrayLayout2i4i12",si);class li extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){var s=4*e,l=8*e;return this.int16[0+s]=t,this.int16[1+s]=n,this.uint8[4+l]=r,this.uint8[5+l]=i,this.uint8[6+l]=o,this.uint8[7+l]=a,e}}li.prototype.bytesPerElement=8,hr("StructArrayLayout2i4ub8",li);class ci extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){var r=2*e;return this.float32[0+r]=t,this.float32[1+r]=n,e}}ci.prototype.bytesPerElement=8,hr("StructArrayLayout2f8",ci);class ui extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,n,r,i,o,a,s,l,c)}emplace(e,t,n,r,i,o,a,s,l,c,u){var d=10*e;return this.uint16[0+d]=t,this.uint16[1+d]=n,this.uint16[2+d]=r,this.uint16[3+d]=i,this.uint16[4+d]=o,this.uint16[5+d]=a,this.uint16[6+d]=s,this.uint16[7+d]=l,this.uint16[8+d]=c,this.uint16[9+d]=u,e}}ui.prototype.bytesPerElement=20,hr("StructArrayLayout10ui20",ui);class di extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,d){var h=this.length;return this.resize(h+1),this.emplace(h,e,t,n,r,i,o,a,s,l,c,u,d)}emplace(e,t,n,r,i,o,a,s,l,c,u,d,h){var p=12*e;return this.int16[0+p]=t,this.int16[1+p]=n,this.int16[2+p]=r,this.int16[3+p]=i,this.uint16[4+p]=o,this.uint16[5+p]=a,this.uint16[6+p]=s,this.uint16[7+p]=l,this.int16[8+p]=c,this.int16[9+p]=u,this.int16[10+p]=d,this.int16[11+p]=h,e}}di.prototype.bytesPerElement=24,hr("StructArrayLayout4i4ui4i24",di);class hi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){var i=3*e;return this.float32[0+i]=t,this.float32[1+i]=n,this.float32[2+i]=r,e}}hi.prototype.bytesPerElement=12,hr("StructArrayLayout3f12",hi);class pi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[+e+0]=t,e}}pi.prototype.bytesPerElement=4,hr("StructArrayLayout1ul4",pi);class fi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,n,r,i,o,a,s,l)}emplace(e,t,n,r,i,o,a,s,l,c){var u=10*e,d=5*e;return this.int16[0+u]=t,this.int16[1+u]=n,this.int16[2+u]=r,this.int16[3+u]=i,this.int16[4+u]=o,this.int16[5+u]=a,this.uint32[3+d]=s,this.uint16[8+u]=l,this.uint16[9+u]=c,e}}fi.prototype.bytesPerElement=20,hr("StructArrayLayout6i1ul2ui20",fi);class mi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){var s=6*e;return this.int16[0+s]=t,this.int16[1+s]=n,this.int16[2+s]=r,this.int16[3+s]=i,this.int16[4+s]=o,this.int16[5+s]=a,e}}mi.prototype.bytesPerElement=12,hr("StructArrayLayout2i2i2i12",mi);class gi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){var a=4*e,s=8*e;return this.float32[0+a]=t,this.float32[1+a]=n,this.float32[2+a]=r,this.int16[6+s]=i,this.int16[7+s]=o,e}}gi.prototype.bytesPerElement=16,hr("StructArrayLayout2f1f2i16",gi);class yi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){var o=12*e,a=3*e;return this.uint8[0+o]=t,this.uint8[1+o]=n,this.float32[1+a]=r,this.float32[2+a]=i,e}}yi.prototype.bytesPerElement=12,hr("StructArrayLayout2ub2f12",yi);class vi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){var i=3*e;return this.uint16[0+i]=t,this.uint16[1+i]=n,this.uint16[2+i]=r,e}}vi.prototype.bytesPerElement=6,hr("StructArrayLayout3ui6",vi);class _i extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g)}emplace(e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g,y){var v=24*e,_=12*e,b=48*e;return this.int16[0+v]=t,this.int16[1+v]=n,this.uint16[2+v]=r,this.uint16[3+v]=i,this.uint32[2+_]=o,this.uint32[3+_]=a,this.uint32[4+_]=s,this.uint16[10+v]=l,this.uint16[11+v]=c,this.uint16[12+v]=u,this.float32[7+_]=d,this.float32[8+_]=h,this.uint8[36+b]=p,this.uint8[37+b]=f,this.uint8[38+b]=m,this.uint32[10+_]=g,this.int16[22+v]=y,e}}_i.prototype.bytesPerElement=48,hr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",_i);class bi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g,y,v,_,b,w,x,S,C,E,k,I){var T=this.length;return this.resize(T+1),this.emplace(T,e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g,y,v,_,b,w,x,S,C,E,k,I)}emplace(e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g,y,v,_,b,w,x,S,C,E,k,I,T){var A=32*e,P=16*e;return this.int16[0+A]=t,this.int16[1+A]=n,this.int16[2+A]=r,this.int16[3+A]=i,this.int16[4+A]=o,this.int16[5+A]=a,this.int16[6+A]=s,this.int16[7+A]=l,this.uint16[8+A]=c,this.uint16[9+A]=u,this.uint16[10+A]=d,this.uint16[11+A]=h,this.uint16[12+A]=p,this.uint16[13+A]=f,this.uint16[14+A]=m,this.uint16[15+A]=g,this.uint16[16+A]=y,this.uint16[17+A]=v,this.uint16[18+A]=_,this.uint16[19+A]=b,this.uint16[20+A]=w,this.uint16[21+A]=x,this.uint16[22+A]=S,this.uint32[12+P]=C,this.float32[13+P]=E,this.float32[14+P]=k,this.uint16[30+A]=I,this.uint16[31+A]=T,e}}bi.prototype.bytesPerElement=64,hr("StructArrayLayout8i15ui1ul2f2ui64",bi);class wi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[+e+0]=t,e}}wi.prototype.bytesPerElement=4,hr("StructArrayLayout1f4",wi);class xi extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){var i=3*e;return this.uint16[0+6*e]=t,this.float32[1+i]=n,this.float32[2+i]=r,e}}xi.prototype.bytesPerElement=12,hr("StructArrayLayout1ui2f12",xi);class Si extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){var i=4*e;return this.uint32[0+2*e]=t,this.uint16[2+i]=n,this.uint16[3+i]=r,e}}Si.prototype.bytesPerElement=8,hr("StructArrayLayout1ul2ui8",Si);class Ci extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){var r=2*e;return this.uint16[0+r]=t,this.uint16[1+r]=n,e}}Ci.prototype.bytesPerElement=4,hr("StructArrayLayout2ui4",Ci);class Ei extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[+e+0]=t,e}}Ei.prototype.bytesPerElement=2,hr("StructArrayLayout1ui2",Ei);class ki extends ti{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){var o=4*e;return this.float32[0+o]=t,this.float32[1+o]=n,this.float32[2+o]=r,this.float32[3+o]=i,e}}ki.prototype.bytesPerElement=16,hr("StructArrayLayout4f16",ki);class Ii extends ei{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new o(this.anchorPointX,this.anchorPointY)}}Ii.prototype.size=20;class Ti extends fi{get(e){return new Ii(this,e)}}hr("CollisionBoxArray",Ti);class Ai extends ei{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Ai.prototype.size=48;class Pi extends _i{get(e){return new Ai(this,e)}}hr("PlacedSymbolArray",Pi);class Mi extends ei{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Mi.prototype.size=64;class Oi extends bi{get(e){return new Mi(this,e)}}hr("SymbolInstanceArray",Oi);class Ri extends wi{getoffsetX(e){return this.float32[+e+0]}}hr("GlyphOffsetArray",Ri);class Li extends oi{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}hr("SymbolLineVertexArray",Li);class Ni extends ei{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Ni.prototype.size=12;class Di extends xi{get(e){return new Ni(this,e)}}hr("TextAnchorOffsetArray",Di);class Fi extends ei{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Fi.prototype.size=8;class zi extends Si{get(e){return new Fi(this,e)}}hr("FeatureIndexArray",zi);class Bi extends ii{}class ji extends ii{}class Ui extends ii{}class qi extends si{}class Vi extends li{}class Hi extends ci{}class Gi extends ui{}class Wi extends di{}class Ki extends hi{}class Yi extends pi{}class Zi extends mi{}class Xi extends yi{}class Ji extends vi{}class Qi extends Ci{}const $i=ni([{name:"a_pos",components:2,type:"Int16"}],4).members;class eo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=e}prepareSegment(e,t,n,r){let i=this.segments[this.segments.length-1];return e>eo.MAX_VERTEX_ARRAY_LENGTH&&x("Max vertices per segment is ".concat(eo.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ")+e),(!i||i.vertexLength+e>eo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,n,r){return new eo([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])}}function to(e,t){return 256*(e=f(Math.floor(e),0,255))+f(Math.floor(t),0,255)}eo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,hr("SegmentVector",eo);const no=ni([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);Gt={exports:{}},Kt={exports:{},exports:function(e,t){for(var n,r,i=3&e.length,o=e.length-i,a=t,s=3432918353,l=461845907,c=0;c>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*l+(((r>>>16)*l&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(n>>>16)&65535)<<16);switch(r=0,i){case 3:r^=(255&e.charCodeAt(c+2))<<16;case 2:r^=(255&e.charCodeAt(c+1))<<8;case 1:a^=r=(65535&(r=(r=(65535&(r^=255&e.charCodeAt(c)))*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*l+(((r>>>16)*l&65535)<<16)&4294967295}return a=2246822507*(65535&(a=(a^=e.length)^a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}},Wt={exports:{},exports:function(e,t){for(var n,r=e.length,i=t^r,o=0;4<=r;)n=1540483477*(65535&(n=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16),r-=4,++o;switch(r){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}},Zt=Kt.exports,Yt=Wt.exports,Gt.exports=Zt,Gt.exports.murmur3=Zt,Gt.exports.murmur2=Yt;var ro=n(Gt.exports);class io{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,r){this.ids.push(oo(e)),this.positions.push(t,n,r)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");var t=oo(e);let n=0,r=this.ids.length-1;for(;n>1;this.ids[i]>=t?r=i:n=1+i}for(var o=[];this.ids[n]===t;){var a=this.positions[3*n],s=this.positions[3*n+1],l=this.positions[3*n+2];o.push({index:a,start:s,end:l}),n++}return o}static serialize(e,t){var n=new Float64Array(e.ids);return ao(n,e=new Uint32Array(e.positions),0,n.length-1),t&&t.push(n.buffer,e.buffer),{ids:n,positions:e}}static deserialize(e){var t=new io;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function oo(e){var t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:ro(String(e))}function ao(e,t,n,r){for(;n>1];let o=n-1,a=r+1;for(;;){for(;e[++o]i;);if(o>=a)break;so(e,o,a),so(t,3*o,3*a),so(t,3*o+1,3*a+1),so(t,3*o+2,3*a+2)}a-n"u_"+e)),this.type=n}setUniform(e,t,n){e.set(n.constantOr(this.value))}getBinding(e,t,n){return new("color"===this.type?ho:co)(e,t)}}class go{constructor(e,t){this.uniformNames=t.map((e=>"u_"+e)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,n,r){(r="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null)&&e.set(r)}getBinding(e,t,n){return new("u_pattern"===n.substr(0,9)?uo:co)(e,t)}}class yo{constructor(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:"a_"+e,type:"Float32",components:"color"===n?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(e,t,n,r,i){var o=this.paintVertexArray.length;t=this.expression.evaluate(new Dr(0),t,{},r,[],i);this.paintVertexArray.resize(e),this._setPaintValue(o,e,t)}updatePaintArray(e,t,n,r){n=this.expression.evaluate({zoom:0},n,r),this._setPaintValue(e,t,n)}_setPaintValue(e,t,n){if("color"===this.type){var r=fo(n);for(let n=e;n"u_".concat(e,"_t"))),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:"a_"+e,type:"Float32",components:"color"===n?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,n,r,i){var o=this.expression.evaluate(new Dr(this.zoom),t,{},r,[],i);t=this.expression.evaluate(new Dr(this.zoom+1),t,{},r,[],i),r=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(r,e,o,t)}updatePaintArray(e,t,n,r){var i=this.expression.evaluate({zoom:this.zoom},n,r);n=this.expression.evaluate({zoom:this.zoom+1},n,r);this._setPaintValue(e,t,i,n)}_setPaintValue(e,t,n,r){if("color"===this.type){var i=fo(n),o=fo(r);for(let n=e;n"#define HAS_UNIFORM_"+e)))}return e}getBinderAttributes(){var e=[];for(const n in this.binders){var t=this.binders[n];if(t instanceof yo||t instanceof vo)for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const r of e)this.programConfigurations[r.id]=new bo(r,t,n);this.needsUpload=!1,this._featureMap=new io,this._bufferOffset=0}populatePaintArrays(e,t,n,r,i,o){for(const a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(e,t,r,i,o);void 0!==t.id&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,r){for(const i of n)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function xo(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function So(e,t,n){var r={color:{source:ci,composite:ki},number:{source:wi,composite:ci}};return(e={"line-pattern":{source:Gi,composite:Gi},"fill-pattern":{source:Gi,composite:Gi},"fill-extrusion-pattern":{source:Gi,composite:Gi}}[e])&&e[n]||r[t][n]}hr("ConstantBinder",mo),hr("CrossFadedConstantBinder",go),hr("SourceExpressionBinder",yo),hr("CrossFadedCompositeBinder",_o),hr("CompositeExpressionBinder",vo),hr("ProgramConfiguration",bo,{omit:["_buffers"]}),hr("ProgramConfigurationSet",wo);const Co=8192,Eo=Math.pow(2,14)-1,ko=-Eo-1;function Io(e){var t=Co/e.extent,n=e.loadGeometry();for(let s=0;si.x+1||ai.y+1)&&x("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return n}function To(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Io(e):[]}}function Ao(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}class Po{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ji,this.indexArray=new Ji,this.segments=new eo,this.programConfigurations=new wo(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){var r,i,o,a,s=this.layers[0],l=[];let c=null,u=!1;for({feature:r,id:i,index:o,sourceLayerIndex:a}of("circle"===s.type&&(c=s.layout.get("circle-sort-key"),u=!c.isConstant()),e)){var d,h=this.layers[0]._featureFilter.needGeometry,p=To(r,h);this.layers[0]._featureFilter.filter(new Dr(this.zoom),p,n)&&(d=u?c.evaluate(p,{},n):void 0,h={id:i,properties:r.properties,type:r.type,sourceLayerIndex:a,index:o,geometry:h?p.geometry:Io(r),patterns:{},sortKey:d},l.push(h))}u&&l.sort(((e,t)=>e.sortKey-t.sortKey));for(const v of l){var{geometry:f,index:m,sourceLayerIndex:g}=v,y=e[m].feature;this.addFeature(v,f,m,n),t.featureIndex.insert(y,f,m,g,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$i),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,r){for(const s of t)for(const t of s){var i=t.x,o=t.y;if(!(i<0||i>=Co||o<0||o>=Co)){var a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey);const t=a.vertexLength;Ao(this.layoutVertexArray,i,o,-1,-1),Ao(this.layoutVertexArray,i,o,1,-1),Ao(this.layoutVertexArray,i,o,1,1),Ao(this.layoutVertexArray,i,o,-1,1),this.indexArray.emplaceBack(t,t+1,t+2),this.indexArray.emplaceBack(t,t+3,t+2),a.vertexLength+=4,a.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r)}}function Mo(e,t){for(let n=0;nt.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function zo(e,t){let n=!1;for(let o=0,a=e.length-1;ot.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(n=!n)}return n}function Bo(e,t,n){var r=t.paint.get(e).value;return"constant"===r.kind?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function jo(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Uo(e,t,n,r,i){if(!t[0]&&!t[1])return e;var a=o.convert(t)._mult(i),s=("viewport"===n&&a._rotate(-r),[]);for(let o=0;ota(e,t)))}(e,s),u=l?t*a:t;for(const p of r)for(const e of p){var d=l?e:ta(e,s);let t=u;var h=Qo([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?t*=h[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(t*=o.cameraToCenterDistance/h[3]),Oo(c,d,t))return!0}return!1}}function ta(e,t){return e=Qo([],[e.x,e.y,0,1],t),new o(e[0]/e[3],e[1]/e[3])}class na extends Po{}let ra;hr("HeatmapBucket",na,{omit:["layers"]});var ia={get paint(){return ra=ra||new Xr({"heatmap-radius":new Wr(K.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Wr(K.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Gr(K.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Zr(K.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Gr(K.paint_heatmap["heatmap-opacity"])})}};function oa(e,t,n,r){let{width:i,height:o}=t;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==i*o*n)throw new RangeError("mismatched image size. expected: ".concat(r.length," but got: ")+i*o*n)}else r=new Uint8Array(i*o*n);return e.width=i,e.height=o,e.data=r,e}function aa(e,t,n){let{width:r,height:i}=t;var o;r===e.width&&i===e.height||(sa(e,o=oa({},{width:r,height:i},n),{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,i)},n),e.width=r,e.height=i,e.data=o.data)}function sa(e,t,n,r,i,o){if(0!==i.width&&0!==i.height){if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");var a=e.data,s=t.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let u=0;u{t[e.evaluationKey]=o,o=e.expression.evaluate(t),i.data[n+r+0]=Math.floor(255*o.r/o.a),i.data[n+r+1]=Math.floor(255*o.g/o.a),i.data[n+r+2]=Math.floor(255*o.b/o.a),i.data[n+r+3]=Math.floor(255*o.a)};if(e.clips)for(let c=0,u=0;c=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<=i&&a=r.x&&r.x>=u&&i!==r.x&&xa(on.x||r.x===n.x&&function(e,t){return Sa(e.prev,e,t.prev)<0&&Sa(t.next,e,e.next)<0}(n,r)))&&(n=r,h=l),(r=r.next)!==c;);return n}(e,t);return n?(va(e=Aa(n,e),e.next),va(n,n.next)):t}(s[i],n);return n}(e,t,u,n)),e.length>80*n){for(var h=r=e[0],p=i=e[1],f=n;f=y&&b&&b.z<=v;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==a&&xa(s,u,l,d,c,h,_.x,_.y)&&0<=Sa(_.prev,_,_.next))return;if(_=_.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==a&&xa(s,u,l,d,c,h,b.x,b.y)&&0<=Sa(b.prev,b,b.next))return;b=b.nextZ}for(;_&&_.z>=y;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==a&&xa(s,u,l,d,c,h,_.x,_.y)&&0<=Sa(_.prev,_,_.next))return;_=_.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==a&&xa(s,u,l,d,c,h,b.x,b.y)&&0<=Sa(b.prev,b,b.next))return;b=b.nextZ}return 1}}(e,r,i,o):function(e){var t=e.prev,n=e;if(!(0<=Sa(t,n,e=e.next))){for(var r=t.x,i=n.x,o=e.x,a=t.y,s=n.y,l=e.y,c=r=c&&p.x<=d&&p.y>=u&&p.y<=h&&xa(r,a,i,s,o,l,p.x,p.y)&&0<=Sa(p.prev,p,p.next))return;p=p.next}return 1}}(e))t.push(x.i/n|0),t.push(e.i/n|0),t.push(S.i/n|0),Ma(e),e=S.next,C=S.next;else if((e=S)===C){a?1===a?_a(e=function(e,t,n){var r=e;do{var i=r.prev,o=r.next.next}while(!Ca(i,o)&&Ea(i,r,r.next,o)&&Ta(i,o)&&Ta(o,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),Ma(r),Ma(r.next),r=e=o),(r=r.next)!==e);return va(r)}(va(e),t,n),t,n,r,i,o,2):2===a&&function(e,t,n,r,i,o){var a=e;do{for(var s,l=a.next.next;l!==a.prev;){if(a.i!==l.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ea(n,n.next,e,t))return 1}while((n=n.next)!==e)}(e,t)&&(Ta(e,t)&&Ta(t,e)&&function(e,t){for(var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),(n=n.next)!==e;);return r}(e,t)&&(Sa(e.prev,e,t.prev)||Sa(e,t.prev,t))||Ca(e,t)&&0=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Ia(e){return 0e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ui,this.indexArray=new Ji,this.indexArray2=new Qi,this.programConfigurations=new wo(e.layers,e.zoom),this.segments=new eo,this.segments2=new eo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){this.hasPattern=ja("fill",this.layers,t);var r,i,o,a,s=this.layers[0].layout.get("fill-sort-key"),l=!s.isConstant(),c=[];for({feature:r,id:i,index:o,sourceLayerIndex:a}of e){var u,d=this.layers[0]._featureFilter.needGeometry,h=To(r,d);this.layers[0]._featureFilter.filter(new Dr(this.zoom),h,n)&&(u=l?s.evaluate(h,{},n,t.availableImages):void 0,d={id:i,properties:r.properties,type:r.type,sourceLayerIndex:a,index:o,geometry:d?h.geometry:Io(r),patterns:{},sortKey:u},c.push(d))}l&&c.sort(((e,t)=>e.sortKey-t.sortKey));for(const y of c){var{geometry:p,index:f,sourceLayerIndex:m}=y,g=(this.hasPattern?(g=Ua("fill",this.layers,y,this.zoom,t),this.patternFeatures.push(g)):this.addFeature(y,p,f,n,{}),e[f].feature);t.featureIndex.insert(g,p,f,m,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}addFeatures(e,t,n){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ma),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,n,r,i){for(const h of za(t,500)){let e=0;for(const t of h)e+=t.length;var o=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),a=o.vertexLength,s=[],l=[];for(const t of h)if(0!==t.length){t!==h[0]&&l.push(s.length/2);var c=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),u=c.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(u+t.length-1,u),s.push(t[0].x),s.push(t[0].y);for(let e=1;e>3),o--,1===i||2===i)a+=n.readSVarint(),s+=n.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new Xa(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}return e&&l.push(e),l},Ja.prototype.bbox=function(){for(var e,t=this._pbf,n=(t.pos=this._geometry,t.readVarint()+t.pos),r=1,i=0,o=0,a=0,s=1/0,l=-1/0,c=1/0,u=-1/0;t.pos>3),i--,1===r||2===r)(o+=t.readSVarint())>3;t=1==r?e.readString():2==r?e.readFloat():3==r?e.readDouble():4==r?e.readVarint64():5==r?e.readVarint():6==r?e.readSVarint():7==r?e.readBoolean():null}return t}(n))}es.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");return this._pbf.pos=this._features[e],e=this._pbf.readVarint()+this._pbf.pos,new $a(this._pbf,e,this.extent,this._keys,this._values)};var ns=Zt;function rs(e,t,n){3===e&&(e=new ns(n,n.readVarint()+n.pos)).length&&(t[e.name]=e)}Za.VectorTile=function(e,t){this.layers=e.readFields(rs,{},t)},Za.VectorTileFeature=Wt,Za.VectorTileLayer=Zt;const is=Za.VectorTileFeature.types,os=Math.pow(2,13);function as(e,t,n,r,i,o,a,s){e.emplaceBack(t,n,2*Math.floor(r*os)+a,i*os*2,o*os*2,Math.round(s))}class ss{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new qi,this.centroidVertexArray=new Bi,this.indexArray=new Ji,this.programConfigurations=new wo(e.layers,e.zoom),this.segments=new eo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){for(var{feature:r,id:i,index:o,sourceLayerIndex:a}of(this.features=[],this.hasPattern=ja("fill-extrusion",this.layers,t),e)){var s=this.layers[0]._featureFilter.needGeometry,l=To(r,s);this.layers[0]._featureFilter.filter(new Dr(this.zoom),l,n)&&(i={id:i,sourceLayerIndex:a,index:o,geometry:s?l.geometry:Io(r),properties:r.properties,type:r.type,patterns:{}},this.hasPattern?this.features.push(Ua("fill-extrusion",this.layers,i,this.zoom,t)):this.addFeature(i,i.geometry,o,n,{}),t.featureIndex.insert(r,i.geometry,o,a,this.index,!0))}}addFeatures(e,t,n){for(const i of this.features){var r=i.geometry;this.addFeature(i,r,i.index,t,n)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ya),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ka.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,n,r,i){var o={x:0,y:0,vertexCount:0};for(const m of za(t,500)){let t=0;for(const e of m)t+=e.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const e of m)if(0!==e.length&&!cs(e)){let t=0;for(let r=0;reo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)),s=c.sub(a)._perp()._unit(),32768eo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray)),"Polygon"===is[e.type]){var u=[],d=[],h=n.vertexLength;for(const e of m)if(0!==e.length){e!==m[0]&&d.push(u.length/2);for(let t=0;tCo)||e.y===t.y&&(e.y<0||e.y>Co)}function cs(e){return e.every((e=>e.x<0))||e.every((e=>e.x>Co))||e.every((e=>e.y<0))||e.every((e=>e.y>Co))}let us;hr("FillExtrusionBucket",ss,{omit:["layers","features"]});var ds={get paint(){return us=us||new Xr({"fill-extrusion-opacity":new Gr(K["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Wr(K["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Gr(K["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Gr(K["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Kr(K["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Wr(K["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Wr(K["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Gr(K["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class hs extends Qr{constructor(e){super(e,ds)}createBucket(e){return new ss(e)}queryRadius(){return jo(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,n,r,i,a,s,l){return e=Uo(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),s=this.paint.get("fill-extrusion-height").evaluate(t,n),t=this.paint.get("fill-extrusion-base").evaluate(t,n),n=function(e,t,n,r){var i=[];for(const s of e){var a=[s.x,s.y,r,1];Qo(a,a,t),i.push(new o(a[0]/a[3],a[1]/a[3]))}return i}(e,l,0,0),e=function(e,t,n,r){var i=[],a=[],s=r[8]*t,l=r[9]*t,c=r[10]*t,u=r[11]*t,d=r[8]*n,h=r[9]*n,p=r[10]*n,f=r[11]*n;for(const E of e){var m=[],g=[];for(const e of E){var y=e.x,v=e.y,_=r[0]*y+r[4]*v+r[12],b=r[1]*y+r[5]*v+r[13],w=r[2]*y+r[6]*v+r[14],x=(y=r[3]*y+r[7]*v+r[15],v=w+c,y+u),S=_+d,C=b+h;w=w+p,y=y+f;(b=((_=new o((_+s)/x,(b+l)/x)).z=v/x,m.push(_),new o(S/y,C/y))).z=w/y,g.push(b)}i.push(m),a.push(g)}return[i,a]}(r,t,s,l),function(e,t,n){let r=1/0;Ro(n,t)&&(r=fs(n,t[0]));for(let c=0;ce.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Vi,this.layoutVertexArray2=new Hi,this.indexArray=new Ji,this.programConfigurations=new wo(e.layers,e.zoom),this.segments=new eo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){this.hasPattern=ja("line",this.layers,t);var r,i,o,a,s=this.layers[0].layout.get("line-sort-key"),l=!s.isConstant(),c=[];for({feature:r,id:i,index:o,sourceLayerIndex:a}of e){var u,d=this.layers[0]._featureFilter.needGeometry,h=To(r,d);this.layers[0]._featureFilter.filter(new Dr(this.zoom),h,n)&&(u=l?s.evaluate(h,{},n):void 0,d={id:i,properties:r.properties,type:r.type,sourceLayerIndex:a,index:o,geometry:d?h.geometry:Io(r),patterns:{},sortKey:u},c.push(d))}l&&c.sort(((e,t)=>e.sortKey-t.sortKey));for(const y of c){var{geometry:p,index:f,sourceLayerIndex:m}=y,g=(this.hasPattern?(g=Ua("line",this.layers,y,this.zoom,t),this.patternFeatures.push(g)):this.addFeature(y,p,f,n,{}),e[f].feature);t.featureIndex.insert(g,p,f,m,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}addFeatures(e,t,n){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,gs)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ms),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,n,r,i){var o=this.layers[0].layout,a=o.get("line-join").evaluate(e,{}),s=o.get("line-cap"),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const u of t)this.addLine(u,e,a,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)}addLine(e,t,n,r,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;tl&&2*u<(y=t.dist(x))&&(y=t.sub(t.sub(x)._mult(u/y)._round()),this.updateDistance(x,y),this.addCurrentVertex(y,S,0,0,d),x=y),x&&c);let I=y?n:a?"butt":r;if(y&&"round"===I&&(p5&&void 0!==arguments[5]&&arguments[5];var a=t.x+t.y*n,s=t.y-t.x*n,l=-t.x+t.y*r,c=-t.y-t.x*r;this.addHalfVertex(e,a,s,o,!1,n,i),this.addHalfVertex(e,l,c,o,!0,-r,i),this.distance>_s/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,n,r,i,o))}addHalfVertex(e,t,n,r,i,o,a){var s=this;let{x:l,y:c}=e;return function(e){var c=.5*(s.lineClips?s.scaledDistance*(_s-1):s.scaledDistance);s.layoutVertexArray.emplaceBack((l<<1)+(r?1:0),(e<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&c)<<2,c>>6),s.lineClips&&(l=s.scaledDistance-s.lineClips.start,r=s.lineClips.end-s.lineClips.start,s.layoutVertexArray2.emplaceBack(l/r,s.lineClipsArray.length)),e=a.vertexLength++;0<=s.e1&&0<=s.e2&&(s.indexArray.emplaceBack(s.e1,s.e2,e),a.primitiveLength++),i?s.e2=e:s.e1=e}(c)}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}let ws,xs;hr("LineBucket",bs,{omit:["layers","patternFeatures"]});var Ss={get paint(){return xs=xs||new Xr({"line-opacity":new Wr(K.paint_line["line-opacity"]),"line-color":new Wr(K.paint_line["line-color"]),"line-translate":new Gr(K.paint_line["line-translate"]),"line-translate-anchor":new Gr(K.paint_line["line-translate-anchor"]),"line-width":new Wr(K.paint_line["line-width"]),"line-gap-width":new Wr(K.paint_line["line-gap-width"]),"line-offset":new Wr(K.paint_line["line-offset"]),"line-blur":new Wr(K.paint_line["line-blur"]),"line-dasharray":new Yr(K.paint_line["line-dasharray"]),"line-pattern":new Kr(K.paint_line["line-pattern"]),"line-gradient":new Zr(K.paint_line["line-gradient"])})},get layout(){return ws=ws||new Xr({"line-cap":new Gr(K.layout_line["line-cap"]),"line-join":new Wr(K.layout_line["line-join"]),"line-miter-limit":new Gr(K.layout_line["line-miter-limit"]),"line-round-limit":new Gr(K.layout_line["line-round-limit"]),"line-sort-key":new Wr(K.layout_line["line-sort-key"])})}};class Cs extends Wr{possiblyEvaluate(e,t){return t=new Dr(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,r){return t=g({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,r)}}let Es;class ks extends Qr{constructor(e){super(e,Ss),this.gradientVersion=0,Es||((Es=new Cs(Ss.paint.properties["line-width"].specification)).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){"line-gradient"===e&&(function(e){return void 0!==e._styleExpression}(e=this.gradientExpression())?this.stepInterpolant=e._styleExpression.expression instanceof Rt:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Es.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new bs(e)}queryRadius(e){var t=Is(Bo("line-width",this,e),Bo("line-gap-width",this,e));e=Bo("line-offset",this,e);return t/2+Math.abs(e)+jo(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,n,r,i,a,s){return e=Uo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),a=s/2*Is(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),function(e,t,n){for(let i=0;i{var r,i;e.text=(e=e.text,i=n,"uppercase"===(r=(r=t).layout.get("text-transform").evaluate(i,{}))?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),e=Nr.applyArabicShaping?Nr.applyArabicShaping(e):e)})),e}Yt=ni([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),ni([{name:"triangle",components:3,type:"Uint16"}]),ni([{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"}]),ni([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ni([{type:"Float32",name:"offsetX"}]),ni([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ni([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Rs={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var Ls=24,Ns=(Gt={read:function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<>1,u=-7,d=n?i-1:0,h=n?-1:1;i=e[t+d];for(d+=h,o=i&(1<<-u)-1,i>>=-u,u+=s;0>=-u,u+=r;0>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1;o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-a))<1&&(a--,r*=2),2<=(t+=1<=a+u?d/r:d*Math.pow(2,1-u))*r&&(a++,r/=2),c<=a+u?(s=0,a=c):1<=a+u?(s=(t*r-1)*Math.pow(2,i),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));8<=i;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<>>0):4294967296*(t>>>0)+(e>>>0)}function qs(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;e<=i;i--)n.buf[i+r]=n.buf[i]}function Vs(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function el(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Ds.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Qs(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=el(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Qs(this.buf,this.pos)+Qs(this.buf,this.pos+4)*Fs;return this.pos+=8,e},readSFixed64:function(){var e=Qs(this.buf,this.pos)+el(this.buf,this.pos+4)*Fs;return this.pos+=8,e},readFloat:function(){var e=Ns.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Ns.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=127&(i=(o=this.buf)[this.pos++]);if(i<128)return t;if(t|=(127&(i=o[this.pos++]))<<7,i<128)return t;if(t|=(127&(i=o[this.pos++]))<<14,i<128)return t;if(t|=(127&(i=o[this.pos++]))<<21,i<128)return t;var n,r,i=t|=(15&o[this.pos])<<28,o=e;if(n=(112&(r=(e=(t=this).buf)[t.pos++]))>>4,r<128)return Us(i,n,o);if(n|=(127&(r=e[t.pos++]))<<3,r<128)return Us(i,n,o);if(n|=(127&(r=e[t.pos++]))<<10,r<128)return Us(i,n,o);if(n|=(127&(r=e[t.pos++]))<<17,r<128)return Us(i,n,o);if(n|=(127&(r=e[t.pos++]))<<24,r<128)return Us(i,n,o);if(n|=(1&(r=e[t.pos++]))<<31,r<128)return Us(i,n,o);throw new Error("Expected varint not more than 10 bytes")},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;if(12<=(this.pos=e)-t&&Bs)return n=this.buf,Bs.decode(n.subarray(t,e));for(var n,r,i,o,a=this.buf,s=e,l="",c=t;c>>10&1023|55296),d=56320|1023&d),l+=String.fromCharCode(d),c+=h}return l},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Ds.Bytes)return e.push(this.readVarint(t));var n=js(this);for(e=e||[];this.pos>>=7,r.buf[r.pos++]=127&n|128,n>>>=7,r.buf[r.pos++]=127&n|128,n>>>=7,r.buf[r.pos++]=127&n|128,n>>>=7,r.buf[r.pos]=127&n,i),t);t=(7&n)<<4;i.buf[i.pos++]|=t|((n>>>=3)?128:0),n&&(i.buf[i.pos++]=127&n|((n>>>=7)?128:0),n)&&(i.buf[i.pos++]=127&n|((n>>>=7)?128:0),n)&&(i.buf[i.pos++]=127&n|((n>>>=7)?128:0),n)&&(i.buf[i.pos++]=127&n|((n>>>=7)?128:0),n)&&(i.buf[i.pos++]=127&n)}else this.realloc(4),this.buf[this.pos++]=127&e|(127>>=7)|(127>>=7)|(127>>7&127)},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,o=0;o>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos),e=this.pos-t;128<=e&&qs(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(e){this.realloc(4),Ns.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Ns.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;nt.h-e.h));var r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}];let i=0,o=0;for(const l of e)for(let e=r.length-1;0<=e;e--){var a,s=r[e];if(!(l.w>s.w||l.h>s.h)){l.x=s.x,l.y=s.y,o=Math.max(o,l.y+l.h),i=Math.max(i,l.x+l.w),l.w===s.w&&l.h===s.h?(a=r.pop(),e=e&&pl[this.text.charCodeAt(n)];n--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){var n=new dl;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(ul.forText(e.scale,e.fontStack||t));var n=this.sections.length-1;for(let r=0;rr&&(r=B)}else{if((B=(j=S[N.fontStack])&&j[F])&&B.rect)s=B.rect,a=B.metrics;else{var U;if(!(U=(U=x[N.fontStack])&&U[F]))continue;a=U.metrics}o=(M-N.scale)*Ls}z?(w.verticalizable=!0,L.push({glyph:F,imageName:l,x:t,y:y+o,vertical:z,scale:N.scale,fontStack:N.fontStack,sectionIndex:D,metrics:a,rect:s}),t+=c*N.scale+I):(L.push({glyph:F,imageName:l,x:t,y:y+o,vertical:z,scale:N.scale,fontStack:N.fontStack,sectionIndex:D,metrics:a,rect:s}),t+=a.advance*N.scale+I)}0!==L.length&&(q=t-I,_=Math.max(q,_),function(e,t,n,r,i){if(r||i){var o=(o=e[n]).metrics.advance*o.scale,a=(e[n].x+o)*r;for(let t=0;t<=n;t++)e[t].x-=a,e[t].y+=i}}(L,0,L.length-1,P,r)),t=0;var q=E*M+r;R.lineOffset=Math.max(r,O),y+=q,b=Math.max(q,b)}else y+=E;++$}m=y-cl;var{horizontalAlign:f,verticalAlign:d}=_l(f);{var V=w.positionedLines,H=P,G=f,W=d,K=_,Y=b,Z=E,X=m,J=a.length,Q=(H-G)*K;let e=0;e=Y!==Z?-X*W-cl:(-W*J+.5)*Z;for(const t of V)for(const n of t.positionedGlyphs)n.x+=Q,n.y+=e}w.top+=-d*m,w.bottom=w.top+m,w.left+=-f*_,w.right=w.left+_}return!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return;return 1}(t)&&o}const pl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fl={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function ml(e,t,n,r,i,o){return t.imageName?(r=r[t.imageName])?r.displaySize[0]*t.scale*Ls/o+i:0:(o=(r=n[t.fontStack])&&r[e])?o.metrics.advance*t.scale+i:0}function gl(e,t,n,r){var i=Math.pow(e-t,2);return r?eo&&(n*=(a=r/o)/a,i=a)),{x1:t,y1:n,x2:t+r,y2:n+i}}function wl(e,t,n,r,i,o){let a;(e=e.image).content&&(s=e.content,l=e.pixelRatio||1,a=[s[0]/l,s[1]/l,e.displaySize[0]-s[2]/l,e.displaySize[1]-s[3]/l]);var s=t.left*o,l=t.right*o;let c,u,d,h;return u="width"===n||"both"===n?(h=i[0]+s-r[3],i[0]+l+r[1]):(h=i[0]+(s+l-e.displaySize[0])/2)+e.displaySize[0],s=t.top*o,l=t.bottom*o,d="height"===n||"both"===n?(c=i[1]+s-r[0],i[1]+l+r[2]):(c=i[1]+(s+l-e.displaySize[1])/2)+e.displaySize[1],{image:e,top:c,right:u,bottom:d,left:h,collisionPadding:a}}const xl=255,Sl=128,Cl=32640;function El(e,t){if("constant"===(t=t.expression).kind)return{kind:"constant",layoutSize:t.evaluate(new Dr(e+1))};if("source"===t.kind)return{kind:"source"};{var{zoomStops:n,interpolationType:r}=t;let a=0;for(;ae.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Yo([]),this.placementViewportMatrix=Yo([]);var n=this.layers[0]._unevaluatedLayout._values,r=(n=(this.textSizeData=El(this.zoom,n["text-size"]),this.iconSizeData=El(this.zoom,n["icon-size"]),this.layers[0].layout)).get("symbol-sort-key"),i=n.get("symbol-z-order");this.canOverlap="never"!==kl(n,"text-overlap","text-allow-overlap")||"never"!==kl(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&!r.isConstant(),r="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=r&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((t=>e.WritingMode[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Ol(new wo(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new Ol(new wo(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new Ri,this.lineVertexArray=new Li,this.symbolInstances=new Oi,this.textAnchorOffsets=new Di}calculateGlyphDependencies(e,t,n,r,i){for(let a=0;ae.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}}update(e,t,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,n))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){var n=this.lineVertexArray.length;if(void 0!==e.segment){let n=e.dist(t[e.segment+1]),o=e.dist(t[e.segment]);var r={};for(let i=e.segment+1;ir[e]-r[t]||i[t]-i[e])),o}addToSortKeyRanges(e,t){var n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(1{0<=e&&n.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),0<=t.verticalPlacedTextSymbolIndex&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),0<=t.placedIconSymbolIndex&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),0<=t.verticalPlacedIconSymbolIndex&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Nl,Dl;hr("SymbolBucket",Ll,{omit:["layers","collisionBoxArray","features","compareText"]}),Ll.MAX_GLYPHS=65535,Ll.addDynamicAttributes=Pl;var Fl={get paint(){return Dl=Dl||new Xr({"icon-opacity":new Wr(K.paint_symbol["icon-opacity"]),"icon-color":new Wr(K.paint_symbol["icon-color"]),"icon-halo-color":new Wr(K.paint_symbol["icon-halo-color"]),"icon-halo-width":new Wr(K.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Wr(K.paint_symbol["icon-halo-blur"]),"icon-translate":new Gr(K.paint_symbol["icon-translate"]),"icon-translate-anchor":new Gr(K.paint_symbol["icon-translate-anchor"]),"text-opacity":new Wr(K.paint_symbol["text-opacity"]),"text-color":new Wr(K.paint_symbol["text-color"],{runtimeType:ue,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Wr(K.paint_symbol["text-halo-color"]),"text-halo-width":new Wr(K.paint_symbol["text-halo-width"]),"text-halo-blur":new Wr(K.paint_symbol["text-halo-blur"]),"text-translate":new Gr(K.paint_symbol["text-translate"]),"text-translate-anchor":new Gr(K.paint_symbol["text-translate-anchor"])})},get layout(){return Nl=Nl||new Xr({"symbol-placement":new Gr(K.layout_symbol["symbol-placement"]),"symbol-spacing":new Gr(K.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Gr(K.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Wr(K.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Gr(K.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Gr(K.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Gr(K.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Gr(K.layout_symbol["icon-ignore-placement"]),"icon-optional":new Gr(K.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Gr(K.layout_symbol["icon-rotation-alignment"]),"icon-size":new Wr(K.layout_symbol["icon-size"]),"icon-text-fit":new Gr(K.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Gr(K.layout_symbol["icon-text-fit-padding"]),"icon-image":new Wr(K.layout_symbol["icon-image"]),"icon-rotate":new Wr(K.layout_symbol["icon-rotate"]),"icon-padding":new Wr(K.layout_symbol["icon-padding"]),"icon-keep-upright":new Gr(K.layout_symbol["icon-keep-upright"]),"icon-offset":new Wr(K.layout_symbol["icon-offset"]),"icon-anchor":new Wr(K.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Gr(K.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Gr(K.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Gr(K.layout_symbol["text-rotation-alignment"]),"text-field":new Wr(K.layout_symbol["text-field"]),"text-font":new Wr(K.layout_symbol["text-font"]),"text-size":new Wr(K.layout_symbol["text-size"]),"text-max-width":new Wr(K.layout_symbol["text-max-width"]),"text-line-height":new Gr(K.layout_symbol["text-line-height"]),"text-letter-spacing":new Wr(K.layout_symbol["text-letter-spacing"]),"text-justify":new Wr(K.layout_symbol["text-justify"]),"text-radial-offset":new Wr(K.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Gr(K.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Wr(K.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Wr(K.layout_symbol["text-anchor"]),"text-max-angle":new Gr(K.layout_symbol["text-max-angle"]),"text-writing-mode":new Gr(K.layout_symbol["text-writing-mode"]),"text-rotate":new Wr(K.layout_symbol["text-rotate"]),"text-padding":new Gr(K.layout_symbol["text-padding"]),"text-keep-upright":new Gr(K.layout_symbol["text-keep-upright"]),"text-transform":new Wr(K.layout_symbol["text-transform"]),"text-offset":new Wr(K.layout_symbol["text-offset"]),"text-allow-overlap":new Gr(K.layout_symbol["text-allow-overlap"]),"text-overlap":new Gr(K.layout_symbol["text-overlap"]),"text-ignore-placement":new Gr(K.layout_symbol["text-ignore-placement"]),"text-optional":new Gr(K.layout_symbol["text-optional"])})}};class zl{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:ae,this.defaultValue=e}evaluate(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}hr("FormatSectionOverride",zl,{omit:["defaultValue"]});class Bl extends Qr{constructor(e){super(e,Fl)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement"))if(e=this.layout.get("text-writing-mode")){var n=[];for(const t of e)n.indexOf(t)<0&&n.push(t);this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"];this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,r){return n=this.layout.get(e).evaluate(t,{},n,r),(r=this._unevaluatedLayout._values[e]).isDataDriven()||yn(r.value)||!n?n:function(e,t){return t.replace(/{([^{}]+)}/g,((t,n)=>e&&n in e?String(e[n]):""))}(t.properties,n)}createBucket(e){return new Ll(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const n of Fl.paint.overridableProperties)if(Bl.hasPaintOverride(this.layout,n)){var e=this.paint.get(n),t=new zl(e);t=new gn(t,e.property.specification);let r=null;r="constant"===e.value.kind||"source"===e.value.kind?new _n("source",t):new bn("composite",t,e.value.zoomStops),this.paint._values[n]=new Vr(e.property,r,e.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!(!this.layout||t.isDataDriven()||n.isDataDriven())&&Bl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){e=e.get("text-field");const n=Fl.paint.properties[t];let r=!1;const i=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(r=!0)};if("constant"===e.value.kind&&e.value.value instanceof Ke)i(e.value.value.sections);else if("source"===e.value.kind){const n=e=>{var t;r||(e instanceof nt&&et(e.value)===fe?(t=e.value,i(t.sections)):e instanceof Xt?i(e.sections):e.eachChild(n))};(t=e.value)._styleExpression&&n(t._styleExpression.expression)}return r}}let jl;var Ul={get paint(){return jl=jl||new Xr({"background-color":new Gr(K.paint_background["background-color"]),"background-pattern":new Yr(K.paint_background["background-pattern"]),"background-opacity":new Gr(K.paint_background["background-opacity"])})}};class ql extends Qr{constructor(e){super(e,Ul)}}let Vl;var Hl={get paint(){return Vl=Vl||new Xr({"raster-opacity":new Gr(K.paint_raster["raster-opacity"]),"raster-hue-rotate":new Gr(K.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Gr(K.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Gr(K.paint_raster["raster-brightness-max"]),"raster-saturation":new Gr(K.paint_raster["raster-saturation"]),"raster-contrast":new Gr(K.paint_raster["raster-contrast"]),"raster-resampling":new Gr(K.paint_raster["raster-resampling"]),"raster-fade-duration":new Gr(K.paint_raster["raster-fade-duration"])})}};class Gl extends Qr{constructor(e){super(e,Hl)}}class Wl extends Qr{constructor(e){super(e,{}),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Kl{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){delete this._channel,this._callback=()=>{}}}const Yl=6371008.8;class Zl{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,90, lat: }, an object {lon: , lat: }, or an array of [, ]");return new Zl(Number("lng"in e?e.lng:e.lon),Number(e.lat))}}const Xl=2*Math.PI*Yl;function Jl(e){return Xl*Math.cos(e*Math.PI/180)}function Ql(e){return(180+e)/360}function $l(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function ec(e,t){return e/Jl(t)}function tc(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class nc{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e=Zl.convert(e),new nc(Ql(e.lng),$l(e.lat),ec(t,e.lat))}toLngLat(){return new Zl(function(e){return 360*e-180}(this.x),tc(this.y))}toAltitude(){return function(e,t){return e*Jl(tc(t))}(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Xl*function(e){return 1/Math.cos(e*Math.PI/180)}(tc(this.y))}}function rc(e,t,n){return[e*(n=2*Math.PI*6378137/256/Math.pow(2,n))-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}class ic{constructor(e,t,n){if(e<0||25=Math.pow(2,e)||t<0||t>=Math.pow(2,e))throw new Error("x=".concat(t,", y=").concat(n,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," 0<=z<=25 "));this.z=e,this.x=t,this.y=n,this.key=sc(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,n){var r=function(e,t,n){var r=rc(256*e,256*(t=Math.pow(2,n)-t-1),n);return e=rc(256*(e+1),256*(t+1),n),r[0]+","+r[1]+","+e[0]+","+e[1]}(this.x,this.y,this.z),i=function(e,t,n){let r,i="";for(let o=e;0>t&&e.y===this.y>>t}getTilePoint(e){var t=Math.pow(2,this.z);return new o((e.x*t-this.x)*Co,(e.y*t-this.y)*Co)}toString(){return"".concat(this.z,"/").concat(this.x,"/")+this.y}}class oc{constructor(e,t){this.wrap=e,this.canonical=t,this.key=sc(e,t.z,t.z,t.x,t.y)}}class ac{constructor(e,t,n,r,i){if(e= z; overscaledZ = ".concat(e,"; z = ")+n);this.overscaledZ=e,this.wrap=t,this.canonical=new ic(n,+r,+i),this.key=sc(t,e,n,r,i)}clone(){return new ac(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ")+this.overscaledZ);var t=this.canonical.z-e;return e>this.canonical.z?new ac(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ac(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ")+this.overscaledZ);var n=this.canonical.z-e;return e>this.canonical.z?sc(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):sc(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){var t;return e.wrap===this.wrap&&(t=this.canonical.z-e.canonical.z,0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t)}children(e){var t,n;return this.overscaledZ>=e?[new ac(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)]:(e=this.canonical.z+1,t=2*this.canonical.x,n=2*this.canonical.y,[new ac(e,this.wrap,e,t,n),new ac(e,this.wrap,e,1+t,n),new ac(e,this.wrap,e,t,1+n),new ac(e,this.wrap,e,1+t,1+n)])}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n))x('"'.concat(n,'" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".'));else{this.stride=t.height;var s=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=i,this.blueFactor=o,this.baseShift=a;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;ethis.max&&(this.max=l),l=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}unpack(e,t,n){return e*this.redFactor+t*this.greenFactor+n*this.blueFactor-this.baseShift}getPixels(){return new ca({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let r=t*this.dim,i=t*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}var s=-t*this.dim,l=-n*this.dim;for(let c=o;c=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can't be >= this._numberToString.length ")+this._numberToString.length);return this._numberToString[e]}}class uc{constructor(e,t,n,r,i){this.type="Feature",(this._vectorTileFeature=e)._z=t,e._x=n,e._y=r,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){var e={geometry:this.geometry};for(const t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class dc{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new ur(Co,16,0),this.grid3D=new ur(Co,16,0),this.featureIndexArray=new zi,this.promoteId=t}insert(e,t,n,r,i,o){var a=this.featureIndexArray.length,s=(this.featureIndexArray.emplaceBack(n,r,i),o?this.grid3D:this.grid);for(let d=0;dfunction(e,t,n,r,i){for(const o of e)if(t<=o.x&&n<=o.y&&r>=o.x&&i>=o.y)return!0;var a=[new o(t,n),new o(t,i),new o(r,i),new o(r,n)];if(2i.x&&t.x>i.x||e.yi.y&&t.y>i.y))return(r=S(e,t,n[0]))!==S(e,t,n[1])||r!==S(e,t,n[2])||r!==S(e,t,n[3])}(e[o],e[o+1],a))return!0;return!1}(e.cameraQueryGeometry,t-c,n-c,r+c,i+c))))d.push(m);d.sort(fc);var h={};let p;for(let o=0;o(o=o||Io(t),n.queryIntersectsFeature(l,t,r,o,this.z,e.transform,a,e.pixelPosMatrix))))}}return h}loadMatchingFeature(e,t,n,r,i,o,a,s,l,c,u){var d=this.bucketLayerIDs[t];if(!o||function(e,t){for(let n=0;n(o=t instanceof Hr?t.get(o):null)&&o.evaluate?o.evaluate(n,r,i):o))}function pc(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x),i=Math.max(i,o.y);return{minX:t,minY:n,maxX:r,maxY:i}}function fc(e,t){return t-e}function mc(e,t,n,r,i){var a=[];for(let l=0;l=r&&u.x>=r)||(l.x>=r?l=new o(r,l.y+(u.y-l.y)*((r-l.x)/(u.x-l.x)))._round():u.x>=r&&(u=new o(r,l.y+(u.y-l.y)*((r-l.x)/(u.x-l.x)))._round()),l.y>=i&&u.y>=i)||(l.y>=i?l=new o(l.x+(u.x-l.x)*((i-l.y)/(u.y-l.y)),i)._round():u.y>=i&&(u=new o(l.x+(u.x-l.x)*((i-l.y)/(u.y-l.y)),i)._round()),c&&l.equals(c[c.length-1])||(c=[l],a.push(c)),c.push(u))}}return a}hr("FeatureIndex",dc,{omit:["rawTileData","sourceLayerCoder"]});class gc extends o{constructor(e,t,n,r){super(e,t),this.angle=n,void 0!==r&&(this.segment=r)}clone(){return new gc(this.x,this.y,this.angle,this.segment)}}function yc(e,t,n,r,i){if(void 0!==t.segment&&0!==n){let c=t,u=t.segment+1,d=0;for(;d>-n/2;){if(--u<0)return;d-=e[u].dist(c),c=e[u]}d+=e[u].dist(e[u+1]),u++;var o=[];let h=0;for(;dr;)h-=o.shift().angleDelta;if(h>i)return;u++,d+=s.dist(l)}}return 1}function vc(e){let t=0;for(let n=0;ne+t[1]-t[0];const f=d.reduce(p,0),m=h.reduce(p,0);var g,y,v,_=c-m;let b=0,w=f,x=0,S=m,C=0,E=p=l-f,k=0,I=_;a.content&&r&&(y=(g=a.content)[2]-g[0],v=g[3]-g[1],a.contentMatch&&a.content&&(u=bl(e)),b=Sc(d,0,g[0]),x=Sc(h,0,g[1]),w=Sc(d,g[0],g[2]),S=Sc(h,g[1],g[3]),C=g[0]-b,k=g[1]-x,E=y-w,I=v-S);const T=u.x1,A=u.y1,P=u.x2-T,M=u.y2-A;var O=(e,r,i,l)=>{var c=(e.stretch-b)/w*P+T,u=e.fixed-C-E*e.stretch/f,d=(r.stretch-x)/S*M+A,h=r.fixed-k-I*r.stretch/m,p=(i.stretch-b)/w*P+T,g=i.fixed-C-E*i.stretch/f,y=(l.stretch-x)/S*M+A,v=l.fixed-k-I*l.stretch/m,_=new o(c,d);d=new o(p,d),p=new o(p,y),c=new o(c,y),y=new o(u/s,h/s),u=new o(g/s,v/s),(h=t*Math.PI/180)&&(g=Math.sin(h),v=Math.cos(h),_._matMult(h=[v,-g,g,v]),d._matMult(h),c._matMult(h),p._matMult(h)),g=e.stretch+e.fixed,v=i.stretch+i.fixed,h=r.stretch+r.fixed,e=l.stretch+l.fixed;return{tl:_,tr:d,bl:c,br:p,tex:{x:a.paddedRect.x+1+g,y:a.paddedRect.y+1+h,w:v-g,h:e-h},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:y,pixelOffsetBR:u,minFontScaleX:E/s/P,minFontScaleY:I/s/M,isSDF:n}};if(r&&(a.stretchX||a.stretchY)){var R=Cc(d,p,f),L=Cc(h,_,m);for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ic;if(this.data=e,this.length=this.data.length,this.compare=t,0>1)-1;0<=n;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){var e,t;if(0!==this.length)return e=this.data[0],t=this.data.pop(),this.length--,0>1,o=t[i];if(0<=n(r,o))break;t[e]=o,e=i}t[e]=r}_down(e){for(var{data:t,compare:n}=this,r=this.length>>1,i=t[e];e1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=1/0,i=1/0,a=-1/0,s=-1/0;var l=e[0];for(let o=0;oa)&&(a=c.x),(!o||c.y>s)&&(s=c.y)}var u=a-r,d=s-i,h=Math.min(u,d);let p=h/2;var f=new kc([],Ac);if(0===h)return new o(r,i);for(let o=r;om.d||!m.d)&&(m=y,n)&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,g),y.max-m.d<=t||(p=y.h/2,f.push(new Pc(y.p.x-p,y.p.y-p,p,e)),f.push(new Pc(y.p.x+p,y.p.y-p,p,e)),f.push(new Pc(y.p.x-p,y.p.y+p,p,e)),f.push(new Pc(y.p.x+p,y.p.y+p,p,e)),g+=4)}return n&&(console.log("num probes: "+g),console.log("best distance: "+m.d)),m.p}function Ac(e,t){return t.max-e.max}function Pc(e,t,n,r){this.p=new o(e,t),this.h=n,this.d=function(e,t){let n=!1,r=1/0;for(let s=0;se.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n),r=Math.min(r,Do(e,o,a))}}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}e.TextAnchorEnum=void 0,(Zt=e.TextAnchorEnum||(e.TextAnchorEnum={}))[Zt.center=1]="center",Zt[Zt.left=2]="left",Zt[Zt.right=3]="right",Zt[Zt.top=4]="top",Zt[Zt.bottom=5]="bottom",Zt[Zt["top-left"]=6]="top-left",Zt[Zt["top-right"]=7]="top-right",Zt[Zt["bottom-left"]=8]="bottom-left",Zt[Zt["bottom-right"]=9]="bottom-right";const Mc=Number.POSITIVE_INFINITY;function Oc(e,t){if(t[1]!==Mc){var n=e,r=t[0],i=t[1];let o=0,a=0;switch(r=Math.abs(r),i=Math.abs(i),n){case"top-right":case"top-left":case"top":a=i-7;break;case"bottom-right":case"bottom-left":case"bottom":a=7-i}switch(n){case"top-right":case"bottom-right":case"right":o=-r;break;case"top-left":case"bottom-left":case"left":o=r}return[o,a]}{n=e;var o=t[0];let r=0,i=0;var a=(o=o<0?0:o)/Math.SQRT2;switch(n){case"top-right":case"top-left":i=a-7;break;case"bottom-right":case"bottom-left":i=7-a;break;case"bottom":i=7-o;break;case"top":i=o-7}switch(n){case"top-right":case"bottom-right":r=-a;break;case"top-left":case"bottom-left":r=a;break;case"left":r=o;break;case"right":r=-o}return[r,i]}}function Rc(e,t,n){var r=e.layout,i=null==(i=r.get("text-variable-anchor-offset"))?void 0:i.evaluate(t,{},n);if(i){var o=i.values,a=[];for(let e=0;ee*Ls));s.startsWith("top")?l[1]-=7:s.startsWith("bottom")&&(l[1]+=7),a[e+1]=l}return new Xe(a)}if(i=r.get("text-variable-anchor")){let o;var c=(o=void 0!==(e=e._unevaluatedLayout).getValue("text-radial-offset")?[r.get("text-radial-offset").evaluate(t,{},n)*Ls,Mc]:r.get("text-offset").evaluate(t,{},n).map((e=>e*Ls)),[]);for(const e of i)c.push(e,Oc(e,o));return new Xe(c)}return null}function Lc(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nc(e,t,n,r,i,a,s,l,c,u,d,h,p,f,m){n=function(e,t,n,r,i,a,s,l){var c=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(const x of t.positionedLines)for(const e of x.positionedGlyphs)if(e.rect){var d=e.rect||{};let r=4,a=!0,S=1,C=0;var h,p=(i||l)&&e.vertical,f=e.metrics.advance*e.scale/2,m=(l&&t.verticalizable&&(m=(e.scale-1)*Ls,h=(Ls-e.metrics.width*e.scale)/2,C=x.lineOffset/2-(e.imageName?-h:m)),e.imageName&&(a=(h=s[e.imageName]).sdf,S=h.pixelRatio,r=1/S),i?[e.x+f,e.y]:[0,0]);let E=i?[0,0]:[e.x+f+n[0],e.y+n[1]-C],k=[0,0];p&&(k=E,E=[0,0]);var g=e.metrics.isDoubleResolution?2:1,y=(e.metrics.left-r)*e.scale-f+E[0],v=(-e.metrics.top-r)*e.scale+E[1],_=y+d.w/g*e.scale/S,b=(g=v+d.h/g*e.scale/S,new o(y,v)),w=(v=new o(_,v),y=new o(y,g),_=new o(_,g),p&&(g=new o(-f,f-cl),p=-Math.PI/2,f=12-f,w=e.imageName?f:0,f=new o(22-f,-w),w=new o(...k),b._rotateAround(p,g)._add(f)._add(w),v._rotateAround(p,g)._add(f)._add(w),y._rotateAround(p,g)._add(f)._add(w),_._rotateAround(p,g)._add(f)._add(w)),c&&(p=Math.sin(c),g=Math.cos(c),b._matMult(f=[g,-p,p,g]),v._matMult(f),y._matMult(f),_._matMult(f)),new o(0,0));p=new o(0,0),u.push({tl:b,tr:v,bl:y,br:_,tex:d,writingMode:t.writingMode,glyphOffset:m,sectionIndex:e.sectionIndex,isSDF:a,pixelOffsetTL:w,pixelOffsetBR:p,minFontScaleX:0,minFontScaleY:0})}return u}(0,n,l,i,a,s,r,e.allowVerticalPlacement);let g=null;"source"===(r=e.textSizeData).kind?(g=[Sl*i.layout.get("text-size").evaluate(s,{})])[0]>Cl&&x("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat(xl,'. Reduce your "text-size".')):"composite"===r.kind&&((g=[Sl*f.compositeTextSizes[0].evaluate(s,{},m),Sl*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>Cl||g[1]>Cl)&&x("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat(xl,'. Reduce your "text-size".')),e.addSymbols(e.text,n,g,l,a,s,u,t,c.lineStartIndex,c.lineLength,p,m);for(const o of d)h[o]=e.text.placedSymbolArray.length-1;return 4*n.length}function Dc(e){for(const t in e)return e[t];return null}const Fc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];function zc(e,t,n,r,i,o){var a;i-r<=n||(function e(t,n,r,i,o,a){for(;is&&Bc(t,n,i,o);ls;)c--}n[2*i+a]===s?Bc(t,n,i,c):(c++,Bc(t,n,c,o)),c<=r&&(i=c+1),r<=c&&(o=c-1)}}(e,t,a=r+i>>1,r,i,o),zc(e,t,n,r,a-1,1-o),zc(e,t,n,1+a,i,1-o))}function Bc(e,t,n,r){jc(e,n,r),jc(t,2*n,2*r),jc(t,2*n+1,2*r+1)}function jc(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Uc(e,t,n,r){return(e-=n)*e+(n=t-r)*n}e.PerformanceMarkers=void 0,(Gt=e.PerformanceMarkers||(e.PerformanceMarkers={})).create="create",Gt.load="load",Gt.fullLoad="fullLoad";let qc=null,Vc=[];const Hc=1e3/60,Gc="loadTime",Wc="fullLoadTime";Zt={mark(e){performance.mark(e)},frame(e){var t;null!=qc&&(t=e-qc,Vc.push(t)),qc=e},clearMetrics(){qc=null,Vc=[],performance.clearMeasures(Gc),performance.clearMeasures(Wc);for(const t in e.PerformanceMarkers)performance.clearMarks(e.PerformanceMarkers[t])},getPerformanceMetrics(){performance.measure(Gc,e.PerformanceMarkers.create,e.PerformanceMarkers.load),performance.measure(Wc,e.PerformanceMarkers.create,e.PerformanceMarkers.fullLoad);var t=performance.getEntriesByName(Gc)[0].duration,n=performance.getEntriesByName(Wc)[0].duration,r=Vc.length,i=1/(Vc.reduce(((e,t)=>e+t),0)/r/1e3),o=Vc.filter((e=>e>Hc)).reduce(((e,t)=>e+(t-Hc)/Hc),0);return{loadTime:t,fullLoadTime:n,fps:i,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}},e.AJAXError=N,e.Actor=class{constructor(e,t,n){this.receive=e=>{var t,n=(e=e.data).id;!n||e.targetMapId&&this.mapId!==e.targetMapId||(""===e.type?(delete this.tasks[n],t=this.cancelCallbacks[n],delete this.cancelCallbacks[n],t&&t()):C()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e))},this.process=()=>{var e,t;this.taskQueue.length&&(e=this.taskQueue.shift(),t=this.tasks[e],delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t)&&this.processTask(e,t)},this.target=e,this.parent=t,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Kl(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=C()?e:window}send(e,t,n,r){var i=this;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return function(e){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(i.callbacks[a]=n);var s=[];e={id:a,type:e,hasCallback:!!n,targetMapId:r,mustQueue:o,sourceMapId:i.mapId,data:fr(t,s)};return i.target.postMessage(e,{transfer:s}),{cancel:()=>{n&&delete i.callbacks[a];var e={id:a,type:"",targetMapId:r,sourceMapId:i.mapId};i.target.postMessage(e)}}}(e)}processTask(e,t){if(""===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(mr(t.error)):n(null,mr(t.data)))}else{let o=!1;const a=[];n=t.hasCallback?(t,n)=>{o=!0,delete this.cancelCallbacks[e],t={id:e,type:"",sourceMapId:this.mapId,error:t?fr(t):null,data:fr(n,a)},this.target.postMessage(t,{transfer:a})}:e=>{o=!0};let s=null;var r,i=mr(t.data);this.parent[t.type]?s=this.parent[t.type](t.sourceMapId,i,n):"getWorkerSource"in this.parent?(r=t.type.split("."),s=this.parent.getWorkerSource(t.sourceMapId,r[0],i.source)[r[1]](i,n)):n(new Error("Could not find function "+t.type)),!o&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},e.AlphaImage=la,e.CanonicalTileID=ic,e.CollisionBoxArray=Ti,e.CollisionCircleLayoutArray=class extends gi{},e.Color=He,e.DEMData=lc,e.DataConstantProperty=Gr,e.DictionaryCoder=cc,e.EXTENT=Co,e.ErrorEvent=G,e.EvaluationParameters=Dr,e.Event=H,e.Evented=W,e.FeatureIndex=dc,e.FillBucket=qa,e.FillExtrusionBucket=ss,e.GeoJSONFeature=uc,e.ImageAtlas=ll,e.ImagePosition=sl,e.KDBush=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var n,[r,i]=new Uint8Array(t,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");if(1!=(r=i>>4))throw new Error("Got v".concat(r," data when expected v1."));if(r=Fc[15&i])return[i]=new Uint16Array(t,2,1),[n]=new Uint32Array(t,4,1),new e(n,i,r,t);throw new Error("Unrecognized array type.")}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;var i=Fc.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(i<0)throw new Error("Unexpected typed array class: ".concat(n,"."));r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){var n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return zc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[];s.length;){var c=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=a)for(let a=d;a<=u;a++){var h=o[2*a],p=o[2*a+1];e<=h&&h<=n&&t<=p&&p<=r&&l.push(i[a])}else{var f=d+u>>1,m=o[2*f],g=o[2*f+1];e<=m&&m<=n&&t<=g&&g<=r&&l.push(i[f]),(0===c?e<=m:t<=g)&&(s.push(d),s.push(f-1),s.push(1-c)),(0===c?m<=n:g<=r)&&(s.push(1+f),s.push(u),s.push(1-c))}}return l}within(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:r,coords:i,nodeSize:o}=this,a=[0,r.length-1,0],s=[],l=n*n;a.length;){var c=a.pop()||0,u=a.pop()||0,d=a.pop()||0;if(u-d<=o)for(let n=d;n<=u;n++)Uc(i[2*n],i[2*n+1],e,t)<=l&&s.push(r[n]);else{var h=d+u>>1,p=i[2*h],f=i[2*h+1];Uc(p,f,e,t)<=l&&s.push(r[h]),(0===c?e-n<=p:t-n<=f)&&(a.push(d),a.push(h-1),a.push(1-c)),(0===c?p<=e+n:f<=t+n)&&(a.push(1+h),a.push(u),a.push(1-c))}}return s}},e.LineBucket=bs,e.LineStripIndexArray=class extends Ei{},e.LngLat=Zl,e.MercatorCoordinate=nc,e.ONE_EM=Ls,e.OverscaledTileID=ac,e.PerformanceUtils=Zt,e.Point=o,e.Pos3dArray=class extends oi{},e.PosArray=Bi,e.Properties=Xr,e.Protobuf=nl,e.QuadTriangleArray=class extends vi{},e.RGBAImage=ca,e.RasterBoundsArray=class extends ai{},e.RequestPerformance=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.SegmentVector=eo,e.SymbolBucket=Ll,e.Transitionable=Br,e.TriangleIndexArray=Ji,e.Uniform1f=co,e.Uniform1i=class extends lo{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.Uniform2f=class extends lo{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.Uniform3f=class extends lo{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.Uniform4f=uo,e.UniformColor=ho,e.UniformMatrix4f=class extends lo{constructor(e,t){super(e,t),this.current=po}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);else for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.UnwrappedTileID=oc,e.ValidationError=ne,e.ZoomHistory=gr,e.__awaiter=t,e.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},e.addDynamicAttributes=Pl,e.arrayBufferToImage=function(e,t){const n=new Image;n.onload=()=>{t(null,n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=I}))},n.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));var r=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?URL.createObjectURL(r):I},e.arrayBufferToImageBitmap=function(e,t){e=new Blob([new Uint8Array(e)],{type:"image/png"}),createImageBitmap(e).then((e=>{t(null,e)})).catch((e=>{t(new Error("Could not load image because of ".concat(e.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))}))},e.asyncAll=function(e,t,n){if(!e.length)return n(null,[]);let r=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),i[a]=t,0==--r&&n(o,i)}))}))},e.bezier=p,e.browser=R,e.clamp=f,e.clipLine=mc,e.clone=function(e){var t=new Wo(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=b,e.clone$2=function(e){var t=new Wo(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=Yt,e.config=L,e.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.create=function(){var e=new Wo(16);return Wo!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=Ko,e.create$2=function(){var e=new Wo(4);return Wo!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.createExpression=vn,e.createFilter=En,e.createLayout=ni,e.createStyleLayer=function(e){if("custom"===e.type)return new Wl(e);switch(e.type){case"background":return new ql(e);case"circle":return new ea(e);case"fill":return new Wa(e);case"fill-extrusion":return new hs(e);case"heatmap":return new da(e);case"hillshade":return new fa(e);case"line":return new ks(e);case"raster":return new Gl(e);case"symbol":return new Bl(e)}},e.cross=function(e,t,n){var r=t[0],i=t[1],o=(t=t[2],n[0]),a=n[1];return n=n[2],e[0]=i*n-t*a,e[1]=t*o-r*n,e[2]=r*a-i*o,e},e.deepEqual=function e(t,n){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r{e in t&&(n[e]=t[e])})),n}(e[n],t[e[n].ref]));return e},e.diffStyles=function(e,t){if(!e)return[{command:X.setStyle,args:[t]}];let n=[];try{if(!Z(e.version,t.version))return[{command:X.setStyle,args:[t]}];Z(e.center,t.center)||n.push({command:X.setCenter,args:[t.center]}),Z(e.zoom,t.zoom)||n.push({command:X.setZoom,args:[t.zoom]}),Z(e.bearing,t.bearing)||n.push({command:X.setBearing,args:[t.bearing]}),Z(e.pitch,t.pitch)||n.push({command:X.setPitch,args:[t.pitch]}),Z(e.sprite,t.sprite)||n.push({command:X.setSprite,args:[t.sprite]}),Z(e.glyphs,t.glyphs)||n.push({command:X.setGlyphs,args:[t.glyphs]}),Z(e.transition,t.transition)||n.push({command:X.setTransition,args:[t.transition]}),Z(e.light,t.light)||n.push({command:X.setLight,args:[t.light]});const p={};var r=[];!function(e,t,n,r){let i;for(i in t=t||{},e=e||{})!Object.prototype.hasOwnProperty.call(e,i)||Object.prototype.hasOwnProperty.call(t,i)||Q(i,n,r);for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?Z(e[i],t[i])||("geojson"===e[i].type&&"geojson"===t[i].type&&function(e,t,n){let r;for(r in e[n])if(Object.prototype.hasOwnProperty.call(e[n],r)&&"data"!==r&&!Z(e[n][r],t[n][r]))return;for(r in t[n])if(Object.prototype.hasOwnProperty.call(t[n],r)&&"data"!==r&&!Z(e[n][r],t[n][r]))return;return 1}(e,t,i)?n.push({command:X.setGeoJSONSourceData,args:[i,t[i].data]}):(a=t,Q(o=i,s=n,r),J(o,a,s))):J(i,t,n));var o,a,s}(e.sources,t.sources,r,p);const f=[];e.layers&&e.layers.forEach((e=>{p[e.source]?n.push({command:X.removeLayer,args:[e.id]}):f.push(e)})),n=n.concat(r);{var i=f,o=t.layers,a=n;o=o||[];var s=(i=i||[]).map(ee),l=o.map(ee),c=i.reduce(te,{}),u=o.reduce(te,{}),d=s.slice(),h=Object.create(null);let e,r,p,m,g,y,v;for(e=0,r=0;e{}}},e.groupByLayout=function(e,t){var n={};for(let o=0;o@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,n,r,i)=>(r=r||i,t[n]=!r||r.toLowerCase(),""))),t["max-age"]&&(e=parseInt(t["max-age"],10),isNaN(e)?delete t["max-age"]:t["max-age"]=e),t},e.parseGlyphPbf=function(e){return new nl(e).readFields(rl,[])},e.pbf=Wt,e.performSymbolLayout=function(t){t.bucket.createArrays();var n,r,i=512*t.bucket.overscaling,o=(t.bucket.tilePixelRatio=Co/i,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1,t.bucket.layers[0]),a=o.layout,s={layoutIconSize:(i=o._unevaluatedLayout._values)["icon-size"].possiblyEvaluate(new Dr(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Dr(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Dr(18))};"composite"===t.bucket.textSizeData.kind&&(({minZoom:n,maxZoom:r}=t.bucket.textSizeData),s.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Dr(n),t.canonical),i["text-size"].possiblyEvaluate(new Dr(r),t.canonical)]),"composite"===t.bucket.iconSizeData.kind&&(({minZoom:n,maxZoom:r}=t.bucket.iconSizeData),s.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Dr(n),t.canonical),i["icon-size"].possiblyEvaluate(new Dr(r),t.canonical)]);const l=a.get("text-line-height")*Ls;var c="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement"),u=a.get("text-keep-upright"),d=a.get("text-size");for(const v of t.bucket.features){const n=a.get("text-font").evaluate(v,{},t.canonical).join(","),r=d.evaluate(v,{},t.canonical),i=s.layoutTextSize.evaluate(v,{},t.canonical);var h=s.layoutIconSize.evaluate(v,{},t.canonical);const _={horizontal:{},vertical:void 0},b=v.text;let w=[0,0];if(b){const s=b.toString();var p=a.get("text-letter-spacing").evaluate(v,{},t.canonical)*Ls;const d=_r(s)?p:0,h=a.get("text-anchor").evaluate(v,{},t.canonical);var f=Rc(o,v,t.canonical);f||(p=a.get("text-radial-offset").evaluate(v,{},t.canonical),w=p?Oc(h,[p*Ls,Mc]):a.get("text-offset").evaluate(v,{},t.canonical).map((e=>e*Ls)));let x=c?"center":a.get("text-justify").evaluate(v,{},t.canonical);const S=a.get("symbol-placement"),C="point"===S?a.get("text-max-width").evaluate(v,{},t.canonical)*Ls:0;if(p=()=>{t.bucket.allowVerticalPlacement&&vr(s)&&(_.vertical=hl(b,t.glyphMap,t.glyphPositions,t.imagePositions,n,C,l,h,"left",d,w,e.WritingMode.vertical,!0,S,i,r))},!c&&f){var m,g=new Set;if("auto"===x)for(let e=0;e3&&void 0!==arguments[3]?arguments[3]:1;return[(t=(e=e.get("icon-padding").evaluate(t,{},n))&&e.values)[0]*r,t[1]*r,t[2]*r,t[3]*r]}(p,n,d,t.tilePixelRatio),C=p.get("text-max-angle")/180*Math.PI,E="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),k="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),I=p.get("symbol-placement"),T=b/2,A=p.get("icon-text-fit");let P;i&&"none"!==A&&(t.allowVerticalPlacement&&r.vertical&&(P=wl(i,r.vertical,A,p.get("icon-text-fit-padding"),f,g)),m)&&(i=wl(i,m,A,p.get("icon-text-fit-padding"),f,g));var M=(l,h)=>{if(!(h.x<0||h.x>=Co||h.y<0||h.y>=Co)){var p=t,m=h;h=l;var g=r;l=i;var v=o,b=P,C=t.layers[0],I=t.collisionBoxArray,T=n.index,A=n.sourceLayerIndex,M=t.index,O=y,R=[w,w,w,w],L=E,N=c,D=_,F=S,z=k,B=f,j=n,U=a,q=u,V=d,H=s,G=p.addToLineVertexArray(m,h);let $,ee,te,ne,re=0,ie=0,oe=0,ae=0,se=-1,le=-1;var W={};let ce=ro("");if(p.allowVerticalPlacement&&g.vertical&&(h=C.layout.get("text-rotate").evaluate(j,{},V)+90,K=g.vertical,te=new Ec(I,m,T,A,M,K,O,R,L,h),b)&&(ne=new Ec(I,m,T,A,M,b,D,F,L,h)),l){var K=C.layout.get("icon-rotate").evaluate(j,{}),Y=xc(l,K,q,h="none"!==C.layout.get("icon-text-fit"));b=b?xc(b,K,q,h):void 0;let t=null;"source"===(q=(ee=new Ec(I,m,T,A,M,l,D,F,!1,K),re=4*Y.length,p.iconSizeData)).kind?(t=[Sl*C.layout.get("icon-size").evaluate(j,{})])[0]>Cl&&x("".concat(p.layerIds[0],': Value for "icon-size" is >= ').concat(xl,'. Reduce your "icon-size".')):"composite"===q.kind&&((t=[Sl*U.compositeIconSizes[0].evaluate(j,{},V),Sl*U.compositeIconSizes[1].evaluate(j,{},V)])[0]>Cl||t[1]>Cl)&&x("".concat(p.layerIds[0],': Value for "icon-size" is >= ').concat(xl,'. Reduce your "icon-size".')),p.addSymbols(p.icon,Y,t,B,z,j,e.WritingMode.none,m,G.lineStartIndex,G.lineLength,-1,V),se=p.icon.placedSymbolArray.length-1,b&&(ie=4*b.length,p.addSymbols(p.icon,b,t,B,z,j,e.WritingMode.vertical,m,G.lineStartIndex,G.lineLength,-1,V),le=p.icon.placedSymbolArray.length-1)}var Z=Object.keys(g.horizontal);for(const t of Z){var X=g.horizontal[t],J=($||(ce=ro(X.text),J=C.layout.get("text-rotate").evaluate(j,{},V),$=new Ec(I,m,T,A,M,X,O,R,L,J)),1===X.positionedLines.length);if(oe+=Nc(p,m,X,v,C,L,j,N,G,g.vertical?e.WritingMode.horizontal:e.WritingMode.horizontalOnly,J?Z:[t],W,se,U,V),J)break}g.vertical&&(ae+=Nc(p,m,g.vertical,v,C,L,j,N,G,e.WritingMode.vertical,["vertical"],W,le,U,V)),h=$?$.boxStartIndex:p.collisionBoxArray.length,l=$?$.boxEndIndex:p.collisionBoxArray.length,D=te?te.boxStartIndex:p.collisionBoxArray.length,F=te?te.boxEndIndex:p.collisionBoxArray.length,q=ee?ee.boxStartIndex:p.collisionBoxArray.length,Y=ee?ee.boxEndIndex:p.collisionBoxArray.length,b=ne?ne.boxStartIndex:p.collisionBoxArray.length,B=ne?ne.boxEndIndex:p.collisionBoxArray.length;let ue=-1;z=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t,ue=z($,ue),ue=z(te,ue),ue=z(ee,ue),(z=-1<(ue=z(ne,ue))?1:0)&&(ue*=H/Ls),p.glyphOffsetArray.length>=Ll.MAX_GLYPHS&&x("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==j.sortKey&&p.addToSortKeyRanges(p.symbolInstances.length,j.sortKey);H=Rc(C,j,V);var[H,Q]=function(t,n){var r=t.length,i=null==n?void 0:n.values;if(0<(null==i?void 0:i.length))for(let s=0;sc)return u=(c-l)/f,d=Dt.number(h.x,p.x,u),u=Dt.number(h.y,p.y,u),(d=new gc(d,u,p.angleTo(h),m))._round(),!a||yc(e,d,s,a,t)?d:void 0;l+=f}}(e,C,r.vertical||m,i,0,v))&&M(e,O)}else if("Polygon"===n.type)for(const e of za(n.geometry,0)){var R=Tc(e,16);M(e[0],new gc(R.x,R.y,0))}else if("LineString"===n.type)for(const e of n.geometry)M(e,new gc(e[0].x,e[0].y,0));else if("Point"===n.type)for(const e of n.geometry)for(const t of e)M([t],new gc(t.x,t.y,0))}(t.bucket,v,_,S,t.imageMap,s,i,h,w,C,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.perspective=function(e,t,n,r,i){return t=1/Math.tan(t/2),e[0]=t/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(n=1/(r-i)),e[14]=2*i*r*n):(e[10]=-1,e[14]=-2*r),e},e.pick=function(e,t){var n={};for(let i=0;i2&&void 0!==arguments[2]&&arguments[2];if(Tr===Sr||Tr===Cr||Tr===Er)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ar=R.resolveURL(e),Tr=Sr,Ir=t,Mr(),n||Lr()},e.sphericalToCartesian=function(e){let[t,n,r]=e;return n=(n+=90)*(Math.PI/180),r*=Math.PI/180,{x:t*Math.cos(n)*Math.sin(r),y:t*Math.sin(n)*Math.sin(r),z:t*Math.cos(r)}},e.sqrLen=function(e){var t=e[0];return t*t+(e=e[1])*e},e.sub=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},e.toEvaluationFeature=To,e.transformMat3=function(e,t,n){var r=t[0],i=t[1];t=t[2];return e[0]=r*n[0]+i*n[3]+t*n[6],e[1]=r*n[1]+i*n[4]+t*n[7],e[2]=r*n[2]+i*n[5]+t*n[8],e},e.transformMat4=Qo,e.transformMat4$1=function(e,t,n){var r=t[0];t=t[1];return e[0]=n[0]*r+n[4]*t+n[12],e[1]=n[1]*r+n[5]*t+n[13],e},e.translate=function(e,t,n){var r,i,o,a,s,l,c,u,d,h,p,f,m=n[0],g=n[1];n=n[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*n+t[12],e[13]=t[1]*m+t[5]*g+t[9]*n+t[13],e[14]=t[2]*m+t[6]*g+t[10]*n+t[14],e[15]=t[3]*m+t[7]*g+t[11]*n+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=h,e[10]=p,e[11]=f,e[12]=r*m+s*g+d*n+t[12],e[13]=i*m+l*g+h*n+t[13],e[14]=o*m+c*g+p*n+t[14],e[15]=a*m+u*g+f*n+t[15]),e},e.triggerPluginCompletionEvent=Pr,e.unicodeBlockLookup=yr,e.uniqueId=function(){return y++},e.v8Spec=K,e.validateCustomStyleLayer=function(e){var t=[],n=e.id;return void 0===n&&t.push({message:"layers.".concat(n,': missing required property "id"')}),void 0===e.render&&t.push({message:"layers.".concat(n,': missing required method "render"')}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:"layers.".concat(n,': property "renderingMode" must be either "2d" or "3d"')}),t},e.validateLight=Ht,e.validateStyle=ar,e.vectorTile=Za,e.warnOnce=x,e.wrap=m})),r(0,(function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,n){for(const s of t){this._layerConfigs[s.id]=s;var r=this._layers[s.id]=e.createStyleLayer(s);r._featureFilter=e.createFilter(r.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(const e of n)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};for(const s of e.groupByLayout(Object.values(this._layerConfigs),this.keyCache)){var i=s.map((e=>this._layers[e.id])),o=i[0];if("none"!==o.visibility){var a=o.source||"";let e=this.familiesBySource[a];e=e||(this.familiesBySource[a]={});let t=e[a=o.sourceLayer||"_geojsonTileLayer"];(t=t||(e[a]=[])).push(i)}}}}class n{constructor(t){var n={},r=[];for(const e in t){var i=t[e],o=n[e]={};for(const e in i){var a,s=i[+e];s&&0!==s.bitmap.width&&0!==s.bitmap.height&&(a={x:0,y:0,w:s.bitmap.width+2,h:s.bitmap.height+2},r.push(a),o[e]={rect:a,metrics:s.metrics})}}var{w:l,h:c}=e.potpack(r),u=new e.AlphaImage({width:l||1,height:c||1});for(const f in t){var d=t[f];for(const t in d){var h,p=d[+t];p&&0!==p.bitmap.width&&0!==p.bitmap.height&&(h=n[f][t].rect,e.AlphaImage.copy(p.bitmap,u,{x:0,y:0},{x:h.x+1,y:h.y+1},p.bitmap))}}this.image=u,this.positions=n}}e.register("GlyphAtlas",n);class r{constructor(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(t,r,o,a,s){this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var l=new e.DictionaryCoder(Object.keys(t.layers).sort());const c=new e.FeatureIndex(this.tileID,this.promoteId),u=(c.bucketLayerIDs=[],{}),d={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:o};var h=r.familiesBySource[this.source];for(const n in h){var p=t.layers[n];if(p){1===p.version&&e.warnOnce('Vector tile source "'.concat(this.source,'" layer "').concat(n,'" ')+"does not use vector tile spec v2 and therefore may have some rendering errors.");var f=l.encode(n),m=[];for(let e=0;ee.id))))}}}let _,b,w,x;r=e.mapObject(d.glyphDependencies,(e=>Object.keys(e).map(Number))),this.inFlightDependencies.forEach((e=>null==e?void 0:e.cancel())),this.inFlightDependencies=[];const S=++this.dependencySentinel;function C(){if(_)return s(_);if(b&&w&&x){var t=new n(b),r=new e.ImageAtlas(w,x);for(const n in u){var a=u[n];a instanceof e.SymbolBucket?(i(a.layers,this.zoom,o),e.performSymbolLayout({bucket:a,glyphMap:b,glyphPositions:t.positions,imageMap:w,imagePositions:r.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):a.hasPattern&&(a instanceof e.LineBucket||a instanceof e.FillBucket||a instanceof e.FillExtrusionBucket)&&(i(a.layers,this.zoom,o),a.addFeatures(d,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:Object.values(u).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?b:null,iconMap:this.returnDependencies?w:null,glyphPositions:this.returnDependencies?t.positions:null})}}Object.keys(r).length?this.inFlightDependencies.push(a.send("getGlyphs",{uid:this.uid,stacks:r,source:this.source,tileID:this.tileID,type:"glyphs"},((e,t)=>{S!==this.dependencySentinel||_||(_=e,b=t,C.call(this))}))):b={},(r=Object.keys(d.iconDependencies)).length?this.inFlightDependencies.push(a.send("getImages",{icons:r,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{S!==this.dependencySentinel||_||(_=e,w=t,C.call(this))}))):w={},(r=Object.keys(d.patternDependencies)).length?this.inFlightDependencies.push(a.send("getImages",{icons:r,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{S!==this.dependencySentinel||_||(_=e,x=t,C.call(this))}))):x={},C.call(this)}}function i(t,n,r){var i=new e.EvaluationParameters(n);for(const e of t)e.recalculate(i,r)}function o(t,n){const r=e.getArrayBuffer(t.request,((r,i,o,a)=>{if(r)n(r);else if(i)try{var s=new e.vectorTile.VectorTile(new e.Protobuf(i));n(null,{vectorTile:s,rawData:i,cacheControl:o,expires:a})}catch(o){s=31===(r=new Uint8Array(i))[0]&&139===r[1];let e="Unable to parse the tile at ".concat(t.request.url,", ");e+=s?"please make sure the data is not gzipped and that you have configured the relevant header in the server":"got error: "+o.messge,n(new Error(e))}}));return()=>{r.cancel(),n()}}class a{constructor(e,t,n,r){this.actor=e,this.layerIndex=t,this.availableImages=n,this.loadVectorData=r||o,this.fetching={},this.loading={},this.loaded={}}loadTile(t,n){const i=t.uid,o=(this.loading||(this.loading={}),!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request)),a=this.loading[i]=new r(t);a.abort=this.loadVectorData(t,((t,r)=>{if(delete this.loading[i],t||!r)return a.status="done",this.loaded[i]=a,n(t);const s=r.rawData,l={},c=(r.expires&&(l.expires=r.expires),r.cacheControl&&(l.cacheControl=r.cacheControl),{});o&&(t=o.finish())&&(c.resourceTiming=JSON.parse(JSON.stringify(t))),a.vectorTile=r.vectorTile,a.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,r)=>{if(delete this.fetching[i],t||!r)return n(t);n(null,e.extend({rawTileData:s.slice(0)},r,l,c))})),this.loaded=this.loaded||{},this.loaded[i]=a,this.fetching[i]={rawTileData:s,cacheControl:l,resourceTiming:c}}))}reloadTile(t,n){var r=this.loaded;const i=t.uid;r&&r[i]&&((r=r[i]).showCollisionBoxes=t.showCollisionBoxes,"parsing"===r.status?r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,r)=>{if(t||!r)return n(t,r);let o;var a,s;o=this.fetching[i]?(({rawTileData:t,cacheControl:a,resourceTiming:s}=this.fetching[i]),delete this.fetching[i],e.extend({rawTileData:t.slice(0)},r,a,s)):r,n(null,o)})):"done"===r.status&&(r.vectorTile?r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,n):n()))}abortTile(e,t){var n=this.loading;e=e.uid;n&&n[e]&&n[e].abort&&(n[e].abort(),delete n[e]),t()}removeTile(e,t){var n=this.loaded;e=e.uid;n&&n[e]&&delete n[e],t()}}class s{constructor(){this.loaded={}}loadTile(t,n){return e.__awaiter(this,void 0,void 0,(function*(){var{uid:r,encoding:i,rawImageData:o,redFactor:a,greenFactor:s,blueFactor:l,baseShift:c}=t,u=o.width+2,d=o.height+2;u=e.isImageBitmap(o)?new e.RGBAImage({width:u,height:d},yield e.getImageData(o,-1,-1,u,d)):o,d=new e.DEMData(r,u,i,a,s,l,c);this.loaded=this.loaded||{},this.loaded[r]=d,n(null,d)}))}removeTile(e){var t=this.loaded;e=e.uid;t&&t[e]&&delete t[e]}}function l(e,t){if(0!==e.length){c(e[0],t);for(var n=1;n=Math.abs(s)?n-l+s:s-l+n,n=l}0<=n+r!=!!t&&e.reverse()}var u=e.getDefaultExportFromCjs((function e(t,n){var r,i=t&&t.type;if("FeatureCollection"===i)for(r=0;r>31}function k(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,o=0,a=n.length,s=0;se},M=Math.fround||(T=new Float32Array(1),e=>(T[0]=+e,T[0]));class O{constructor(e){this.options=Object.assign(Object.create(P),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){var{log:t,minZoom:n,maxZoom:r}=this.options,i=(t&&console.time("total time"),"prepare ".concat(e.length," points")),o=(t&&console.time(i),this.points=e,[]);for(let u=0;u=n;u--){var c=+Date.now();l=this.trees[u]=this._createTree(this._cluster(l,u)),t&&console.log("z%d: %d clusters in %dms",u,l.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;var r=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;var o=Math.max(-90,Math.min(90,e[3]));if(360<=e[2]-e[0])n=-180,i=180;else if(n>i)return e=this.getClusters([n,r,180,o],t),a=this.getClusters([-180,r,i,o],t),e.concat(a);var a=(e=this.trees[this._limitZoom(t)]).range(N(n),D(o),N(i),D(r)),s=e.data,l=[];for(const u of a){var c=this.stride*u;l.push(1=o.length)throw new Error(r);n=this.options.radius/(this.options.extent*Math.pow(2,n-1));var a=o[t*this.stride],s=(t=o[t*this.stride+1],[]);for(const c of i.within(a,t,n)){var l=c*this.stride;o[4+l]===e&&s.push(1t&&(n+=s[f+5])}if(n>p&&n>=o){let e,r=u*p,o=d*p,a=-1;var m=((_/c|0)<<5)+(t+1)+this.points.length;for(const n of h){var g,y=n*c;s[2+y]<=t||(s[2+y]=t,g=s[y+5],r+=s[y]*g,o+=s[1+y]*g,s[4+y]=m,i&&(e||(e=this._map(s,_,!0),a=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,y))))}s[_+4]=m,l.push(r/n,o/n,1/0,m,-1,n),i&&l.push(a)}else{for(let e=0;e>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){var r;return 1>1,s=n-t,l=e[t],c=e[t+1],u=e[n],d=e[n+1],h=t+3;ha)&&(n.numSimplified++,s.push(t[l]),s.push(t[l+1])),n.numPoints++;if(i){for(var c=s,u=(i=o,0),d=0,h=c.length,p=h-2;d{const r=t.promoteId;if(t.request)return e.getJSON(t.request,((e,t,i,o)=>{this._dataUpdateable=le(t,r)?ce(t,r):void 0,n(e,t,i,o)}));if("string"==typeof t.data)try{var i=JSON.parse(t.data);this._dataUpdateable=le(i,r)?ce(i,r):void 0,n(null,i)}catch(i){n(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")))}else t.dataDiff?this._dataUpdateable?(function(e,t,n){if(t.removeAll&&e.clear(),t.remove)for(const l of t.remove)e.delete(l);if(t.add)for(const l of t.add){var r=se(l,n);null!=r&&e.set(r,l)}if(t.update)for(const l of t.update){let t=e.get(l.id);if(null!=t){var i=l.newGeometry||l.removeAllProperties,o=!l.removeAllProperties&&(0<(null==(o=l.removeProperties)?void 0:o.length)||0<(null==(o=l.addOrUpdateProperties)?void 0:o.length));if((i||o)&&(t=Object.assign({},t),e.set(l.id,t),o)&&(t.properties=Object.assign({},t.properties)),l.newGeometry&&(t.geometry=l.newGeometry),l.removeAllProperties)t.properties={};else if(0<(null==(i=l.removeProperties)?void 0:i.length))for(const e of l.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if(0<(null==(i=l.addOrUpdateProperties)?void 0:i.length))for(var{key:a,value:s}of l.addOrUpdateProperties)t.properties[a]=s}}}(this._dataUpdateable,t.dataDiff,r),n(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):n(new Error("Cannot update existing geojson data in "+t.source)):n(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,i&&(this.loadGeoJSON=i)}loadGeoJSONTile(t,n){if(t=t.tileID.canonical,!this._geoJSONIndex)return n(null,null);if(!(t=this._geoJSONIndex.getTile(t.z,t.x,t.y)))return n(null,null);t=new class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t}feature(t){return new class{constructor(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){var t=[];for(const n of this._feature.geometry)t.push([new e.Point(n[0],n[1])]);return t}var n=[];for(const i of this._feature.geometry){var r=[];for(const t of i)r.push(new e.Point(t[0],t[1]));n.push(r)}return n}toGeoJSON(e,t,n){return d.call(this,e,t,n)}}(this._features[t])}}(t.features);let r=A(t);n(null,{vectorTile:t,rawData:(r=0===r.byteOffset&&r.byteLength===r.buffer.byteLength?r:new Uint8Array(r)).buffer})}loadData(t,n){var r;null!=(r=this._pendingRequest)&&r.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request);this._pendingCallback=n,this._pendingRequest=this.loadGeoJSON(t,((r,o)=>{if(delete this._pendingCallback,delete this._pendingRequest,r||!o)return n(r);if("object"!=typeof o)return n(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")));u(o,!0);try{if(t.filter){const n=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===n.result)throw new Error(n.value.map((e=>e.key+": "+e.message)).join(", "));o={type:"FeatureCollection",features:o.features.filter((e=>n.value.evaluate({zoom:0},e)))}}this._geoJSONIndex=t.cluster?new O(function(t){let{superclusterOptions:n,clusterProperties:r}=t;if(r&&n){const t={},a={},s={accumulated:null,zoom:0},l={properties:null},c=Object.keys(r);for(const n of c){var[i,o]=r[n],o=e.createExpression(o),i=e.createExpression("string"==typeof i?[i,["accumulated"],["get",n]]:i);t[n]=o.value,a[n]=i.value}n.map=e=>{l.properties=e;var n={};for(const r of c)n[r]=t[r].evaluate(s,l);return n},n.reduce=(e,t)=>{l.properties=t;for(const n of c)s.accumulated=e[n],e[n]=a[n].evaluate(s,l)}}return n}(t)).load(o.features):function(e,t){return new oe(e,t)}(o,t.geojsonVtOptions)}catch(r){return n(r)}this.loaded={};var a;o={};i&&(a=i.finish())&&(o.resourceTiming={},o.resourceTiming[t.source]=JSON.parse(JSON.stringify(a))),n(null,o)}))}reloadTile(e,t){var n=this.loaded,r=e.uid;return n&&n[r]?super.reloadTile(e,t):this.loadTile(e,t)}removeSource(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class de{constructor(t){this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:a,geojson:ue},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error('Worker source with name "'.concat(e,'" already registered.'));this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}setReferrer(e,t){this.referrer=t}setImages(e,t,n){this.availableImages[e]=t;for(const i in this.workerSources[e]){var r=this.workerSources[e][i];for(const e in r)r[e].availableImages=t}n()}setLayers(e,t,n){this.getLayerIndex(e).replace(t),n()}updateLayers(e,t,n){this.getLayerIndex(e).update(t.layers,t.removedIds),n()}loadTile(e,t,n){this.getWorkerSource(e,t.type,t.source).loadTile(t,n)}loadDEMTile(e,t,n){this.getDEMWorkerSource(e,t.source).loadTile(t,n)}reloadTile(e,t,n){this.getWorkerSource(e,t.type,t.source).reloadTile(t,n)}abortTile(e,t,n){this.getWorkerSource(e,t.type,t.source).abortTile(t,n)}removeTile(e,t,n){this.getWorkerSource(e,t.type,t.source).removeTile(t,n)}removeDEMTile(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)}removeSource(e,t,n){var r;this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]&&(r=this.workerSources[e][t.type][t.source],delete this.workerSources[e][t.type][t.source],void 0!==r.removeSource?r.removeSource(t,n):n())}loadWorkerSource(e,t,n){try{this.self.importScripts(t.url),n()}catch(e){n(e.toString())}}syncRTLPluginState(t,n,r){try{e.plugin.setState(n);var i,o=e.plugin.getPluginURL();e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=o&&(this.self.importScripts(o),r((i=e.plugin.isParsed())?void 0:new Error("RTL Text Plugin failed to import scripts from "+o),i))}catch(t){r(t.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||[]}getLayerIndex(e){let n=this.layerIndexes[e];return n||(this.layerIndexes[e]=new t)}getWorkerSource(e,t,n){return this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),this.workerSources[e][t][n]||(this.workerSources[e][t][n]=new this.workerSourceTypes[t]({send:(t,n,r)=>{this.actor.send(t,n,r,e)}},this.getLayerIndex(e),this.getAvailableImages(e))),this.workerSources[e][t][n]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new s),this.demWorkerSources[e][t]}}return e.isWorker()&&(self.worker=new de(self)),de})),r(0,(function(e){var t,n,r="3.6.1";class i{static testProp(e){if(i.docStyle)for(let t=0;t3&&void 0!==arguments[3]?arguments[3]:{};"passive"in r?e.addEventListener(t,n,r):e.addEventListener(t,n,r.capture)}static removeEventListener(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"passive"in r?e.removeEventListener(t,n,r):e.removeEventListener(t,n,r.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",i.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",i.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",i.suppressClickInternal,!0)}),0)}static getScale(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static mousePos(t,n){var r,o;return t?(o=(r=i.getScale(t)).boundingClientRect,new e.Point((n.clientX-o.left)/r.x-t.clientLeft,(n.clientY-o.top)/r.y-t.clientTop)):new e.Point(n.clientX,n.clientY)}static touchPos(t,n){var r=t.getBoundingClientRect(),i=[];for(let o=0;o{n=[],r=0,i=0,a={}},Ze.addThrottleControl=e=>{var t=i++;return a[t]=e,t},Ze.removeThrottleControl=e=>{delete a[e],l()},Ze.getImage=function(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];o.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*");const a={requestParameters:e,supportImageRefresh:i,callback:t,cancelled:!1,completed:!1,cancel:()=>{a.completed||a.cancelled||(a.cancelled=!0,a.innerRequest&&(a.innerRequest.cancel(),r--),l())}};return n.push(a),l(),a};const s=(t,n,i,o,a,s)=>{i?n(i):o instanceof HTMLImageElement||e.isImageBitmap(o)?n(null,o):o&&(i=o,o=(e,t)=>{null!=e?n(e):null!=t&&n(null,t,{cacheControl:a,expires:s})},"function"==typeof createImageBitmap?e.arrayBufferToImageBitmap(i,o):e.arrayBufferToImage(i,o)),t.cancelled||(t.completed=!0,r--,l())},l=()=>{var t=(()=>{var e=Object.keys(a);let t=!1;if(0{const{requestParameters:n,supportImageRefresh:r,callback:i}=t;return e.extend(n,{type:"image"}),(!1!==r||e.isWorker()||e.getProtocolAction(n.url)||n.headers&&!Object.keys(n.headers).reduce(((e,t)=>e&&"accept"===t),!0)?e.makeRequest:c)(n,((e,n,r,o)=>{s(t,i,e,n,r,o)}))})(o),r++,o.innerRequest=i)}},c=(t,n)=>{const r=new Image;var i=t.url;let o=!1;return(t=t.credentials)&&"include"===t?r.crossOrigin="use-credentials":(t&&"same-origin"===t||!e.sameOrigin(i))&&(r.crossOrigin="anonymous"),r.fetchPriority="high",r.onload=()=>{n(null,r),r.onerror=r.onload=null},r.onerror=()=>{o||n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),r.onerror=r.onload=null},r.src=i,{cancel:()=>{o=!0,r.src=""}}}}t.resetRequestQueue(),(Ze=n=n||{}).Glyphs="Glyphs",Ze.Image="Image",Ze.Source="Source",Ze.SpriteImage="SpriteImage",Ze.SpriteJSON="SpriteJSON",Ze.Style="Style",Ze.Tile="Tile",Ze.Unknown="Unknown";class d{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeSpriteURL(e,t,n){return e=function(e){var t=e.match(h);if(t)return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]};throw new Error('Unable to parse URL "'.concat(e,'"'))}(e),e.path+=""+t+n,function(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}(e)}setTransformRequest(e){this._transformRequestFn=e}}const h=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function p(e){var t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&02&&void 0!==arguments[2])||arguments[2];var r=this.getImage(e);if(n&&(r.data.width!==t.data.width||r.data.height!==t.data.height))throw new Error("size mismatch between old image (".concat(r.data.width,"x").concat(r.data.height,") and new image (").concat(t.data.width,"x").concat(t.data.height,")."));t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){var t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e,t){let n=!0;if(!this.isLoaded())for(const r of e)this.images[r]||(n=!1);this.isLoaded()||n?this._notify(e,t):this.requestors.push({ids:e,callback:t})}_notify(t,n){var r={};for(const i of t){let t=this.getImage(i);t||(this.fire(new e.Event("styleimagemissing",{id:i})),t=this.getImage(i)),t?r[i]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,contentMatch:t.contentMatch,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.warnOnce('Image "'.concat(i,'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.'))}n(null,r)}getPixelSize(){var{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(t){var n=this.patterns[t],r=this.getImage(t);return r?(n&&n.position.version===r.version?n:(n?n.position.version=r.version:(n={w:r.data.width+2,h:r.data.height+2,x:0,y:0},r=new e.ImagePosition(n,r),this.patterns[t]={bin:n,position:r}),this._updatePatternAtlas(),this.patterns[t])).position:null}bind(e){var t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new m(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){var t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:n,h:r}=e.potpack(t);var i=this.atlasImage;i.resize({width:n||1,height:r||1});for(const l in this.patterns){var o=(a=this.patterns[l].bin).x+1,a=a.y+1,s=this.getImage(l).data;const t=s.width,n=s.height;e.RGBAImage.copy(s,i,{x:0,y:0},{x:o,y:a},{width:t,height:n}),e.RGBAImage.copy(s,i,{x:0,y:n-1},{x:o,y:a-1},{width:t,height:1}),e.RGBAImage.copy(s,i,{x:0,y:0},{x:o,y:a+n},{width:t,height:1}),e.RGBAImage.copy(s,i,{x:t-1,y:0},{x:o-1,y:a},{width:1,height:n}),e.RGBAImage.copy(s,i,{x:0,y:0},{x:o+t,y:a},{width:1,height:n})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const r of t){var n;this.callbackDispatchedThisFrame[r]||(this.callbackDispatchedThisFrame[r]=!0,(n=this.getImage(r))||e.warnOnce('Image with ID: "'.concat(r,'" was not found')),e.renderStyleImage(n)&&this.updateImage(r,n))}}}const y=1e20;function v(e,t,n,r,i,o,a,s,l){for(let c=t;c{let{stack:n,id:r}=e,i=this.entries[n];var o=(i=i||(this.entries[n]={glyphs:{},requests:{},ranges:{}})).glyphs[r];if(void 0!==o)t(null,{stack:n,id:r,glyph:o});else if(o=this._tinySDF(i,n,r))i.glyphs[r]=o,t(null,{stack:n,id:r,glyph:o});else{const e=Math.floor(r/256);if(65535<256*e)t(new Error("glyphs > 65535 not supported"));else if(i.ranges[e])t(null,{stack:n,id:r,glyph:o});else if(this.url){let o=i.requests[e];o||(o=i.requests[e]=[],b.loadGlyphRange(n,e,this.url,this.requestManager,((t,n)=>{if(n){for(const e in n)this._doesCharSupportLocalGlyph(+e)||(i.glyphs[+e]=n[+e]);i.ranges[e]=!0}for(const e of o)e(t,n);delete i.requests[e]}))),o.push(((e,i)=>{e?t(e):i&&t(null,{stack:n,id:r,glyph:i[r]||null})}))}else t(new Error("glyphsUrl is not set"))}}),((e,t)=>{if(e)n(e);else if(t){var r,i,o,a={};for({stack:r,id:i,glyph:o}of t)(a[r]||(a[r]={}))[i]=o&&{id:o.id,bitmap:o.bitmap.clone(),metrics:o.metrics};n(null,a)}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(e.unicodeBlockLookup["CJK Unified Ideographs"](t)||e.unicodeBlockLookup["Hangul Syllables"](t)||e.unicodeBlockLookup.Hiragana(t)||e.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,r){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){let o=t.tinySDF;if(!o){let e="400";/bold/i.test(n)?e="900":/medium/i.test(n)?e="500":/light/i.test(n)&&(e="200"),o=t.tinySDF=new b.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:e})}return n=o.draw(String.fromCharCode(r)),{id:r,bitmap:new e.AlphaImage({width:n.width||60,height:n.height||60},n.data),metrics:{width:n.glyphWidth/2||24,height:n.glyphHeight/2||24,left:n.glyphLeft/2+.5||0,top:n.glyphTop/2-27.5||-8,advance:n.glyphAdvance/2||24,isDoubleResolution:!0}}}}}b.loadGlyphRange=function(t,r,i,o,a){var s=255+(r*=256);o=o.transformRequest(i.replace("{fontstack}",t).replace("{range}",r+"-"+s),n.Glyphs);e.getArrayBuffer(o,((t,n)=>{if(t)a(t);else if(n){var r={};for(const t of e.parseGlyphPbf(n))r[t.id]=t;a(null,r)}}))},b.TinySDF=class{constructor(){let{fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=t,this.cutoff=r,this.radius=n,r=this.size=e+4*t,n=this._createCanvas(r),t=this.ctx=n.getContext("2d",{willReadFrequently:!0}),t.font=a+" ".concat(o," ").concat(e,"px ")+i,t.textBaseline="alphabetic",t.textAlign="left",t.fillStyle="black",this.gridOuter=new Float64Array(r*r),this.gridInner=new Float64Array(r*r),this.f=new Float64Array(r),this.z=new Float64Array(r+1),this.v=new Uint16Array(r)}_createCanvas(e){var t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){var{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(e),n=Math.ceil(n),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-i))),s=Math.min(this.size-this.buffer,n+Math.ceil(r)),l=a+2*this.buffer,o=s+2*this.buffer,c=Math.max(l*o,0),u=new Uint8ClampedArray(c),i={data:u,width:l,height:o,glyphWidth:a,glyphHeight:s,glyphTop:n,glyphLeft:0,glyphAdvance:t};if(0!==a&&0!==s){var{ctx:r,buffer:d,gridInner:h,gridOuter:p}=this,f=(r.clearRect(d,d,a,s),r.fillText(e,d,d+n),r.getImageData(d,d,a,s));p.fill(y,0,c),h.fill(0,0,c);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.validateLight,t,n))for(const e in t){var r=t[e];e.endsWith(x)?this._transitionable.setTransition(e.slice(0,-x.length),r):this._transitionable.setValue(e,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,r){return(!r||!1!==r.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.v8Spec})))}}class E{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){var n=e.join(",")+String(t);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(e,t)),this.dashEntry[n]}getDashRanges(e,t,n){var r=[],i=e.length%2==1?-e[e.length-1]*n:0,o=e[0]*n;let a=!0,s=(r.push({left:i,right:o,isDash:a,zeroLength:0===e[0]}),e[0]);for(let c=1;cthis.height)return e.warnOnce("LineAtlas out of space"),null;let s=0;for(let e=0;e{e.send(t,n,r)}),r=r||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.actors.forEach((e=>{e.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}}function I(t,r,i){function o(n,r){if(n)return i(n);r&&(n=e.pick(e.extend(r,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]),r.vector_layers&&(n.vectorLayers=r.vector_layers,n.vectorLayerIds=n.vectorLayers.map((e=>e.id))),i(null,n))}return t.url?e.getJSON(r.transformRequest(t.url,n.Source),o):e.browser.frame((()=>o(null,t)))}class T{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(t){return this._ne=t instanceof e.LngLat?new e.LngLat(t.lng,t.lat):e.LngLat.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.LngLat?new e.LngLat(t.lng,t.lat):e.LngLat.convert(t),this}extend(t){var n,r=this._sw,i=this._ne;let o,a;if(t instanceof e.LngLat)o=t,a=t;else{if(!(t instanceof T))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?(n=t,this.extend(T.convert(n))):this.extend(e.LngLat.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.LngLat.convert(t)):this;if(o=t._sw,a=t._ne,!o||!a)return this}return r||i?(r.lng=Math.min(o.lng,r.lng),r.lat=Math.min(o.lat,r.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)):(this._sw=new e.LngLat(o.lng,o.lat),this._ne=new e.LngLat(a.lng,a.lat)),this}getCenter(){return new e.LngLat((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.LngLat(this.getWest(),this.getNorth())}getSouthEast(){return new e.LngLat(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}isEmpty(){return!(this._sw&&this._ne)}contains(t){var{lng:t,lat:n}=e.LngLat.convert(t),n=this._sw.lat<=n&&n<=this._ne.lat;let r=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=t&&t>=this._ne.lng),n&&r}static convert(e){return e instanceof T?e:e&&new T(e)}static fromLngLat(t){return function(n){var r=(n=360*n/40075017)/Math.cos(Math.PI/180*t.lat);return new T(new e.LngLat(t.lng-r,t.lat-n),new e.LngLat(t.lng+r,t.lat+n))}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}}class A{constructor(e,t,n){this.bounds=T.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(t){var n=Math.pow(2,t.z);const r=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*n),i=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*n),a=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=r&&t.x=i&&t.y{this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=I(this._options,this.map._requestManager,((t,n)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new e.ErrorEvent(t)):n&&(e.extend(this,n),n.bounds&&(this.tileBounds=new A(n.bounds,this.minzoom,this.maxzoom)),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))},this.serialize=()=>e.extend({},this._options),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(n,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(e,t){var r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function i(n,r){return delete e.request,e.aborted?t(null):n&&404!==n.status?t(n):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}(r={request:this.map._requestManager.transformRequest(r,n.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId}).request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=t:e.request=e.actor.send("reloadTile",r,i.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",r,i.bind(this)))}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0)}unloadTile(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class M extends e.Evented{constructor(t,n,r,i){super(),this.id=t,this.dispatcher=r,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},n),e.extend(this,e.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=I(this._options,this.map._requestManager,((t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):n&&(e.extend(this,n),n.bounds&&(this.tileBounds=new A(n.bounds,this.minzoom,this.maxzoom)),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}serialize(){return e.extend({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,r){var i=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.request=t.getImage(this.map._requestManager.transformRequest(i,n.Tile),((t,n,i)=>{delete e.request,e.aborted?(e.state="unloaded",r(null)):t?(e.state="errored",r(t)):n&&(this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),i=(t=this.map.painter.context).gl,e.texture=this.map.painter.getTileTexture(n.width),e.texture?e.texture.update(n,{useMipmap:!0}):(e.texture=new m(t,n,i.RGBA,{useMipmap:!0}),e.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),t.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax)),e.state="loaded",r(null))}),this.map._refreshExpiredTiles)}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t()}unloadTile(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}hasTransition(){return!1}}class O extends M{constructor(t,n,r,i){super(t,n,r,i),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(r,i){var o=r.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);o=this.map._requestManager.transformRequest(o,n.Tile);function a(e,t){e&&(r.state="errored",i(e)),t&&(r.dem=t,r.needsHillshadePrepare=!0,r.needsTerrainPrepare=!0,r.state="loaded",i(null))}r.neighboringTiles=this._getNeighboringTiles(r.tileID),r.request=t.getImage(o,((t,n,o)=>e.__awaiter(this,void 0,void 0,(function*(){var s;delete r.request,r.aborted?(r.state="unloaded",i(null)):t?(r.state="errored",i(t)):n&&(this.map._refreshExpiredTiles&&r.setExpiryData(o),s=e.isImageBitmap(n)&&e.offscreenCanvasSupported()?n:yield function(t){return e.__awaiter(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.isOffscreenCanvasDistorted()){var n=t.width+2,r=t.height+2;try{return new e.RGBAImage({width:n,height:r},yield e.readImageUsingVideoFrame(t,-1,-1,n,r))}catch(n){}}return e.browser.getImageData(t,1)}))}(n),s={uid:r.uid,coord:r.tileID,source:this.id,rawImageData:s,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift},r.actor&&"expired"!==r.state||(r.actor=this.dispatcher.getActor(),r.actor.send("loadDEMTile",s,a)))}))),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){var n=t.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,o=0===n.x?t.wrap-1:t.wrap,a=(n.x+1+r)%r,s=n.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,o,n.z,i,n.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},0{this._updateWorkerData()},this.serialize=()=>e.extend({},this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=r.getActor(),this.setEventedParent(i),this._data=n.data,this._options=e.extend({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId,t=e.EXTENT/this.tileSize,this.workerOptions=e.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*t,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*t,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:e.EXTENT,radius:(n.clusterRadius||50)*t,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(void 0!==e.clusterRadius&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),void 0!==e.clusterMaxZoom)&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom),this._updateWorkerData(),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this}getClusterLeaves(e,t,n,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:n},r),this}_updateWorkerData(t){var r=e.extend({},this.workerOptions);t?r.dataDiff=t:"string"==typeof this._data?(r.request=this.map._requestManager.transformRequest(e.browser.resolveURL(this._data),n.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.Event("dataloading",{dataType:"source"})),this.actor.send(this.type+".loadData",r,((t,n)=>{if(this._pendingLoads--,this._removed||n&&n.abandoned)this.fire(new e.Event("dataabort",{dataType:"source"}));else{let r=null;n&&n.resourceTiming&&n.resourceTiming[this.id]&&(r=n.resourceTiming[this.id].slice(0)),t?this.fire(new e.ErrorEvent(t)):(n={dataType:"source"},this._collectResourceTiming&&r&&0{if(delete e.request,e.unloadVectorData(),!e.aborted){if(r)return t(r);e.loadVectorData(i,this.map.painter,"reloadTile"==n)}return t(null)}))}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var L=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class N extends e.Evented{constructor(r,i,o,a){super(),this.load=(r,i)=>{this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=t.getImage(this.map._requestManager.transformRequest(this.url,n.Image),((t,n)=>{this._request=null,this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):n&&(this.image=n,r&&(this.coordinates=r),i&&i(),this._finishLoading())}))},this.prepare=()=>{if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new m(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let i=!1;for(const e in this.tiles){var r=this.tiles[e];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture,i=!0)}i&&this.fire(new e.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=r,this.dispatcher=o,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(a),this.options=i}loaded(){return this._loaded}updateImage(e){return e.url&&(this._request&&(this._request.cancel(),this._request=null),this.options.url=e.url,this.load(e.coordinates,(()=>{this.texture=null}))),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){return t=(this.coordinates=t).map(e.MercatorCoordinate.fromLngLat),this.tileID=function(t){let n=1/0,r=1/0,i=-1/0,o=-1/0;for(const e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),o=Math.max(o,e.y);t=i-n;var a=o-r;t=Math.max(t,a),a=Math.max(0,Math.floor(-Math.log(t)/Math.LN2)),t=Math.pow(2,a);return new e.CanonicalTileID(a,Math.floor((n+i)/2*t),Math.floor((r+o)/2*t))}(t),this.minzoom=this.maxzoom=this.tileID.z,t=t.map((e=>this.tileID.getTilePoint(e)._round())),this._boundsArray=new e.RasterBoundsArray,this._boundsArray.emplaceBack(t[0].x,t[0].y,0,0),this._boundsArray.emplaceBack(t[1].x,t[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(t[3].x,t[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(t[2].x,t[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e).buckets={}:e.state="errored",t(null)}hasTransition(){return!1}}class D extends N{constructor(t,r,i,o){super(t,r,i,o),this.load=()=>{this._loaded=!1;var t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,n.Source).url);e.getVideo(this.urls,((t,n)=>{this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):n&&(this.video=n,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))},this.prepare=()=>{if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new m(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let i=!1;for(const e in this.tiles){var r=this.tiles[e];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture,i=!0)}i&&this.fire(new e.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=r}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){var n;this.video&&(t<(n=this.video.seekable).start(0)||t>n.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the ".concat(n.start(0)," and ").concat(n.end(0),"-second mark.")))):this.video.currentTime=t)}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class F extends N{constructor(t,n,r,i){super(t,n,r,i),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let 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 n=this.map.painter.context,r=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new m(n,this.canvas,r.RGBA,{premultiply:!0});let o=!1;for(const e in this.tiles){var i=this.tiles[e];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture,o=!0)}o&&this.fire(new e.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+t,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+t,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+t,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+t,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+t,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const z={},B=e=>{switch(e){case"geojson":return R;case"image":return N;case"raster":return M;case"raster-dem":return O;case"vector":return P;case"video":return D;case"canvas":return F}return z[e]};function j(t,n,r,i,o,a){var s,l,c,u=function(e,t,n){if(e)for(const o of e){var r=t[o];if(r&&r.source===n&&"fill-extrusion"===r.type)return!0}else for(const o in t){var i=t[o];if(i.source===n&&"fill-extrusion"===i.type)return!0}return!1}(o&&o.layers,n,t.id),d=a.maxPitchScaleFactor(),h=((i=t.tilesIn(i,d,u)).sort(U),[]);for(const f of i)h.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(n,r,t._state,f.queryGeometry,f.cameraQueryGeometry,f.scale,o,a,d,(s=t.transform,l=f.tileID,void 0,c=e.create(),e.translate(c,c,[1,1,0]),e.scale(c,c,[.5*s.width,.5*s.height,1]),e.multiply(c,c,s.calculatePosMatrix(l.toUnwrapped()))))});var p=function(e){var t={},n={};for(const c of e){var r=c.queryResults,i=c.wrappedTileID,o=n[i]=n[i]||{};for(const e in r){var a=r[e],s=o[e]=o[e]||{},l=t[e]=t[e]||[];for(const e of a)s[e.featureIndex]||(s[e.featureIndex]=!0,l.push(e))}}return t}(h);for(const e in p)p[e].forEach((e=>{e=e.feature;var n=t.getFeatureState(e.layer["source-layer"],e.id);e.source=e.layer.source,e.layer["source-layer"]&&(e.sourceLayer=e.layer["source-layer"]),e.state=n}));return p}function U(e,t){return e=e.tileID,t=t.tileID,e.overscaledZ-t.overscaledZ||e.canonical.y-t.canonical.y||e.wrap-t.wrap||e.canonical.x-t.canonical.x}class q{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.uniqueId(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){(e+=this.timeAdded)t.getLayer(e))).filter(Boolean);if(0!==e.length){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)n[t.id]=r}}return n}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){var i=this.buckets[t];if(i instanceof e.SymbolBucket){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){var o=this.buckets[t];if(o instanceof e.SymbolBucket&&o.hasRTLText){this.hasRTLText=!0,e.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const e in this.buckets){var a=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(e).queryRadius(a))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.CollisionBoxArray}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const r in this.buckets){var t=this.buckets[r];t.uploadPending()&&t.upload(e)}var n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new m(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new m(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,n,r,i,o,a,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:a,queryPadding:this.queryPadding*l},e,t,n):{}}querySourceFeatures(t,n){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var i=r.loadVTLayers(),o=n&&n.sourceLayer?n.sourceLayer:"",a=i._geojsonTileLayer||i[o];if(a){var s=e.createFilter(n&&n.filter),{z:l,x:c,y:u}=this.tileID.canonical,d={z:l,x:c,y:u};for(let n=0;nr?e=!1:!n||this.expirationTime{this.remove(e,i)}),n)),this.data[r].push(i),this.order.push(r),this.order.length>this.max&&(t=this._getAndRemoveByKey(this.order[0]))&&this.onRemove(t),this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){return(e=this.data[e])?e[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){var n;return this.has(e)&&(e=e.wrapped().key,t=void 0===t?0:this.data[e].indexOf(t),n=this.data[e][t],this.data[e].splice(t,1),n.timeout&&clearTimeout(n.timeout),0===this.data[e].length&&delete this.data[e],this.onRemove(n.value),this.order.splice(this.order.indexOf(e),1)),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(e){var t=[];for(const n in this.data)for(const r of this.data[n])e(r.value)||t.push(r);for(const n of t)this.remove(n.value.tileID,n)}}class H{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,r){var i=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.extend(this.stateChanges[t][i],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(const e in this.state[t][i])r[e]||(this.deletedStates[t][i][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(e,t,n){if(!(null===this.deletedStates[e])){var r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&void 0!==t)null!==this.deletedStates[e][r]&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][n]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}}getState(t,n){var r=String(n),i=this.state[t]||{},o=this.stateChanges[t]||{},a=e.extend({},i[r],o[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){if(null===(i=this.deletedStates[t][n]))return{};for(const e in i)delete a[e]}return a}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(t,n){var r={};for(const a in this.stateChanges){this.state[a]=this.state[a]||{};var i={};for(const t in this.stateChanges[a])this.state[a][t]||(this.state[a][t]={}),e.extend(this.state[a][t],this.stateChanges[a][t]),i[t]=this.state[a][t];r[a]=i}for(const a in this.deletedStates){this.state[a]=this.state[a]||{};var o={};if(null===this.deletedStates[a])for(const e in this.state[a])o[e]={},this.state[a][e]={};else for(const e in this.deletedStates[a]){if(null===this.deletedStates[a][e])this.state[a][e]={};else for(const t of Object.keys(this.deletedStates[a][e]))delete this.state[a][e][t];o[e]=this.state[a][e]}r[a]=r[a]||{},e.extend(r[a],o)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const e in t)t[e].setFeatureState(r,n)}}class G extends e.Evented{constructor(e,t,n){super(),this.id=e,this.dispatcher=n,this.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,n,r)=>{if((t=new(B(t.type))(e,t,n,r)).id!==e)throw new Error("Expected Source id to be ".concat(e," instead of ")+t.id);return t})(e,t,n,this),this._tiles={},this._cache=new V(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new H,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(!this._sourceErrored){if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain){if(!this._updated)return!1;for(const t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){var e;this._paused&&(e=this._shouldReloadOnResume,this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform)&&this.update(this.transform,this.terrain)}_loadTile(e,t){return this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,(()=>{}))}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,(()=>{})),this._source.fire(new e.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){var t=this._tiles[n];t.upload(e),t.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(W).map((e=>e.key))}getRenderableIds(t){var n=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&n.push(this._tiles[e]);return t?n.sort(((t,n)=>{t=t.tileID,n=n.tileID;var r=new e.Point(t.canonical.x,t.canonical.y)._rotate(this.transform.angle),i=new e.Point(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return t.overscaledZ-n.overscaledZ||i.y-r.y||i.x-r.x})).map((e=>e.tileID.key)):n.map((e=>e.tileID)).sort(W).map((e=>e.key))}hasRenderableParent(e){return!!(e=this.findLoadedParent(e,0))&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(e,t){var n=this._tiles[e];n&&("loading"!==n.state&&(n.state=t),this._loadTile(n,this._tileLoaded.bind(this,n,e,t)))}_tileLoaded(t,n,r,i){i?(t.state="errored",404!==i.status?this._source.fire(new e.ErrorEvent(i,{tile:t})):this.update(this.transform,this.terrain)):(t.timeAdded=e.browser.now(),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.Event("data",{dataType:"source",tile:t,coord:t.tileID})))}_backfillDEM(e){var t=this.getRenderableIds();for(let i=0;in)){let n=a.tileID;for(;a&&a.tileID.overscaledZ>t+1;){var i=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[i.key])&&a.hasData()&&(n=i)}let o=n;for(;o.overscaledZ>t;)if(e[(o=o.scaledTo(o.overscaledZ-1)).key]){r[n.key]=n;break}}}}findLoadedParent(e,t){var n;if(e.key in this._loadedParentTiles)return(n=this._loadedParentTiles[e.key])&&n.tileID.overscaledZ>=t?n:null;for(let i=e.overscaledZ-1;i>=t;i--){var r=e.scaledTo(i);if(r=this._getLoadedTile(r))return r}}_getLoadedTile(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(t){var n=Math.ceil(t.width/this._source.tileSize)+1,r=(t=Math.ceil(t.height/this._source.tileSize)+1,null===this._maxTileCacheZoomLevels?e.config.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels);n=Math.floor(n*t*r),t="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(t)}handleWrapJump(e){var t=void 0===this._prevLng?e:this._prevLng,n=Math.round((e-t)/360);if(this._prevLng=e,n){var r={};for(const e in this._tiles){var i=this._tiles[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+n),r[i.tileID.key]=i}this._tiles=r;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles){var o=this._tiles[e];this._setTileReloadTimer(e,o)}}}update(t,n){if(this.transform=t,this.terrain=n,this._sourceLoaded&&!this._paused){let _;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?_=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(_=t.coveringTiles({tileSize:(this.usedForTerrain?this:this._source).tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(_=_.filter((e=>this._source.hasTile(e))))):_=[];t=t.coveringZoomLevel(this._source);var r=Math.max(t-G.maxOverzooming,this._source.minzoom),i=Math.max(t+G.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){var o,a={};for(const e of _)e.canonical.z>this._source.minzoom&&(a[(o=e.scaledTo(e.canonical.z-1)).key]=o,a[(o=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)))).key]=o);_=_.concat(Object.values(a))}var s=0===_.length&&!this._updated&&this._didEmitContent,l=(this._updated=!0,s&&this.fire(new e.Event("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id})),this._updateRetainedTiles(_,t));if(K(this._source.type)){var c={},u={},d=(s=Object.keys(l),e.browser.now());for(const e of s){var h=l[e],p=this._tiles[e];!p||0!==p.fadeEndTime&&p.fadeEndTime<=d||((p=this.findLoadedParent(h,r))&&(this._addTile(p.tileID),c[p.tileID.key]=p.tileID),u[e]=h)}this._retainLoadedChildren(u,t,i,l);for(const e in c)l[e]||(this._coveredTiles[e]=!0,l[e]=c[e]);if(n){var f={},m={};for(const e of _)this._tiles[e.key].hasData()?f[e.key]=e:m[e.key]=e;for(const e in m){var g=m[e].children(this._source.maxzoom);this._tiles[g[0].key]&&this._tiles[g[1].key]&&this._tiles[g[2].key]&&this._tiles[g[3].key]&&(f[g[0].key]=l[g[0].key]=g[0],f[g[1].key]=l[g[1].key]=g[1],f[g[2].key]=l[g[2].key]=g[2],f[g[3].key]=l[g[3].key]=g[3],delete m[e])}for(const e in m){var y=this.findLoadedParent(m[e],this._source.minzoom);if(y){f[y.tileID.key]=l[y.tileID.key]=y.tileID;for(const e in f)f[e].isChildOf(y.tileID)&&delete f[e]}}for(const e in this._tiles)f[e]||(this._coveredTiles[e]=!0)}}for(const e in l)this._tiles[e].clearFadeHold();for(const t of e.keysDifference(this._tiles,l)){var v=this._tiles[t];v.hasSymbolBuckets&&!v.holdingForFade()?v.setHoldDuration(this.map._fadeDuration):v.hasSymbolBuckets&&!v.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache()}}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var n={},r={},i=Math.max(t-G.maxOverzooming,this._source.minzoom),o=Math.max(t+G.maxUnderzooming,this._source.minzoom),a={};for(const h of e){var s=this._addTile(h);n[h.key]=h,s.hasData()||tthis._source.maxzoom){var l=h.children(this._source.maxzoom)[0],c=this.getTile(l);if(c&&c.hasData()){n[l.key]=l;continue}}else if(n[(c=h.children(this._source.maxzoom))[0].key]&&n[c[1].key]&&n[c[2].key]&&n[c[3].key])continue;let o=e.wasRequested();for(let t=h.overscaledZ-1;t>=i;--t){var u=h.scaledTo(t);if(r[u.key])break;if(r[u.key]=!0,e=!(e=this.getTile(u))&&o?this._addTile(u):e){var d=e.hasData();if((o||d)&&(n[u.key]=u),o=e.wasRequested(),d)break}}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const n in this._tiles){var e=[];let r,i=this._tiles[n].tileID;for(;0{this._reloadTile(e,"expired"),delete this._timers[e]}),t))}_removeTile(e){var t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),0o.pointCoordinate(e,this.terrain))),s=r.map((e=>o.pointCoordinate(e,this.terrain))),l=this.getIds();let p=1/0,f=1/0,m=-1/0,g=-1/0;for(const e of s)p=Math.min(p,e.x),f=Math.min(f,e.y),m=Math.max(m,e.x),g=Math.max(g,e.y);for(let t=0;tt.getTilePoint(e))),d=s.map((e=>t.getTilePoint(e))),i.push({tile:c,tileID:t,queryGeometry:h,cameraQueryGeometry:d,scale:u}))}}}return i}getVisibleCoordinates(e){e=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(K(this._source.type)){var t=e.browser.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(e,t,n){this._state.updateState(e=e||"_geojsonTileLayer",t,n)}removeFeatureState(e,t,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,n)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,n){(e=this._tiles[e])&&e.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(const n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(n,"reloading");this._cache.filter((n=>!n.hasDependency(e,t)))}}function W(e,t){var n=Math.abs(2*e.wrap)-(e.wrap<0),r=Math.abs(2*t.wrap)-(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function K(e){return"raster"===e||"image"===e||"video"===e}G.maxOverzooming=10,G.maxUnderzooming=3;const Y="mapboxgl_preloaded_worker_pool";class Z{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Y]}numActive(){return Object.keys(this.active).length}}let X;function J(){return X=X||new Z}Ze=Math.floor(e.browser.hardwareConcurrency/2),Z.workerCount=e.isSafari(globalThis)?Math.max(Math.min(Ze,3),1):1;class Q{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let n=1;nthis.width||r<0||t>this.height)return[];var s=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return[{key:null,x1:e,y1:t,x2:n,y2:r}];for(let e=0;ethis.width||l<0||s>this.height)&&(this._forEachCell(o,s,a,l,this._queryCellCircle,o=[],{hitTest:!0,overlapMode:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),0=d[0+h]&&r>=d[1+h]&&(!s||s(p))&&(!c||!$(u,p.overlapMode))&&(o.push({key:p,x1:d[h],y1:d[1+h],x2:d[2+h],y2:d[3+h]}),c))return!0}}if(null!==(a=this.circleCells[i])){var f=this.circles;for(const i of a)if(!l.circle[i]){l.circle[i]=!0;var m=3*i,g=this.circleKeys[i];if(this._circleAndRectCollide(f[m],f[1+m],f[2+m],e,t,n,r)&&(!s||s(g))&&(!c||!$(u,g.overlapMode))){var y=f[m],v=f[1+m];m=f[2+m];if(o.push({key:g,x1:y-m,y1:v-m,x2:y+m,y2:v+m}),c)return!0}}}return!1}_queryCellCircle(e,t,n,r,i,o,a,s){var{circle:l,seenUids:c,overlapMode:u}=a;if(null!==(a=this.boxCells[i])){var d=this.bboxes;for(const e of a)if(!c.box[e]){c.box[e]=!0;var h=4*e,p=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,d[0+h],d[1+h],d[2+h],d[3+h])&&(!s||s(p))&&!$(u,p.overlapMode))return o.push(!0),!0}}if(null!==(a=this.circleCells[i])){var f=this.circles;for(const e of a)if(!c.circle[e]){c.circle[e]=!0;var m=3*e,g=this.circleKeys[e];if(this._circlesCollide(f[m],f[1+m],f[2+m],l.x,l.y,l.radius)&&(!s||s(g))&&!$(u,g.overlapMode))return o.push(!0),!0}}}_forEachCell(e,t,n,r,i,o,a,s){var l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),d=this._convertToYCellCoord(r);for(let p=l;p<=u;p++)for(let l=c;l<=d;l++){var h=this.xCellCount*l+p;if(i.call(this,e,t,n,r,h,o,a,s))return}}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,r,i,o){return(r-=e)*r+(e=i-t)*e<(i=n+o)*i}_circleAndRectCollide(e,t,n,r,i,o,a){return!((o=(o-r)/2)+n<(e=Math.abs(e-(r+o)))||(r=(a-i)/2)+n<(a=Math.abs(t-(i+r)))||!(e<=o||a<=r||(t=e-o)*t+(i=a-r)*i<=n*n))}}function te(t,n,r,i,o){var a=e.create();return n?(e.scale(a,a,[1/o,1/o,1]),r||e.rotateZ(a,a,i.angle)):e.multiply(a,i.labelPlaneMatrix,t),a}function ne(t,n,r,i,o){return n?(n=e.clone(t),e.scale(n,n,[o,o,1]),r||e.rotateZ(n,n,-i.angle),n):i.glCoordMatrix}function re(t,n,r){let i;return r?(i=[t.x,t.y,r(t.x,t.y),1],e.transformMat4(i,i,n)):fe(i=[t.x,t.y,0,1],i,n),r=i[3],{point:new e.Point(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function ie(e,t){return.5+e/t*.5}function oe(e,t,n,r,i,o,a,s,l,c,u,d,h){var p=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,m=s.lineStartIndex+s.lineLength,g=t.getoffsetX(s.glyphStartIndex);t=t.getoffsetX(p-1);return(p=de(e*g,n,r,i,o,a,s.segment,f,m,l,c,u,d,h))&&(g=de(e*t,n,r,i,o,a,s.segment,f,m,l,c,u,d,h))?{first:p,last:g}:null}function ae(t,n,r,i){if(t===e.WritingMode.horizontal){var o=Math.abs(r.y-n.y);if(Math.abs(r.x-n.x)*ir.x)?{needsFlipping:!0}:null}function se(t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g){var y=n/24,v=t.lineOffsetX*y,_=t.lineOffsetY*y;let b;if(1=c)return null;x+=S,w=b,g=m;var I={projectionCache:h,lineVertexArray:u,labelPlaneMatrix:d,tileAnchorPoint:a,distanceFromAnchor:x,getElevation:f,previousVertex:w,direction:y,absOffsetX:C};if(b=ce(_,I),0===r)E.push(w),k=b.sub(w);else{let t;var T=b.sub(w);t=0===T.mag()?ue(ce(_+y,I).sub(b),r,y):ue(T,r,y),g=g||w.add(t),m=function(t,n,r,i,o,a,s,l){var{projectionCache:c,direction:u}=l;if(!c.offsets[t]){if(n=r.add(n),t+u1&&void 0!==arguments[1]?arguments[1]:new ee(e.width+200,e.height+200,25),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ee(e.width+200,e.height+200,25);this.transform=e,this.grid=t,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,n,r,i,o){o=n*(r=this.projectAndGetPerspectiveRatio(r,e.anchorPointX,e.anchorPointY,o)).perspectiveRatio,n=e.x1*o+r.point.x;var a=e.y1*o+r.point.y,s=e.x2*o+r.point.x;e=e.y2*o+r.point.y;return!this.isInsideGrid(n,a,s,e)||"always"!==t&&this.grid.hitTest(n,a,s,e,t,i)||r.perspectiveRatiore(e,l,f))),n=g.some((e=>e.signedDistanceFromCamera<=0))?[]:g.map((e=>e.point)));let r=[];if(0=u.x&&k.x<=o.x&&E.y>=u.y&&k.y<=o.y?[n]:k.xo.x||k.yo.y?[]:e.clipLine([n],u.x,u.y,o.x,o.y)}for(const e of r){w.reset(e,.25*b);let n=0;n=w.length<=.5*b?1:Math.ceil(w.paddedLength/C)+1;for(let e=0;e=this.screenRightBoundary||r<100||t>this.screenBottomBoundary}isInsideGrid(e,t,n,r){return 0<=n&&ee.collisionGroupID===t}}return this.collisionGroups[e]}}function Se(t,n,r,i,o){var{horizontalAlign:t,verticalAlign:a}=e.getAnchorAlignment(t);return new e.Point(-(t-.5)*n+i[0]*o,-(a-.5)*r+i[1]*o)}function Ce(t,n,r,i,o,a){var{x1:t,x2:s,y1:l,y2:c,anchorPointX:u,anchorPointY:d}=t;n=new e.Point(n,r);return i&&n._rotate(o?a:-a),{x1:t+n.x,y1:l+n.y,x2:s+n.x,y2:c+n.y,anchorPointX:u,anchorPointY:d}}class Ee{constructor(e,t,n,r,i){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new me(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new xe(r),this.collisionCircleArrays={},(this.prevPlacement=i)&&(i.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,r,i){var o=r.getBucket(n),a=r.latestFeatureIndex;if(o&&a&&n.id===o.layerIds[0]){n=r.collisionBoxArray;var s=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/e.EXTENT,u=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),d="map"===s.get("text-pitch-alignment"),h="map"===s.get("text-rotation-alignment"),p=ge(r,1,this.transform.zoom),f=te(u,d,h,this.transform,p);let _=null;d&&(d=ne(u,d,h,this.transform,p),_=e.multiply([],this.transform.labelPlaneMatrix,d)),this.retainedQueryData[o.bucketInstanceId]=new we(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);var m={bucket:o,layout:s,posMatrix:u,textLabelPlaneMatrix:f,labelToScreenMatrix:_,scale:l,textPixelRatio:c,holdingForFade:r.holdingForFade(),collisionBoxArray:n,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(i)for(const e of o.sortKeyRanges){var{sortKey:g,symbolInstanceStart:y,symbolInstanceEnd:v}=e;t.push({sortKey:g,symbolInstanceStart:y,symbolInstanceEnd:v,parameters:m})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:m})}}attemptAnchorPlacement(t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g){var y=e.TextAnchorEnum[t.textAnchor],v=Se(y,r,i,t=[t.textOffset0,t.textOffset1],o);n=this.collisionIndex.placeCollisionBox(Ce(n,v.x,v.y,a,s,this.transform.angle),d,l,c,u.predicate,g);if((!m||0!==this.collisionIndex.placeCollisionBox(Ce(m,v.x,v.y,a,s,this.transform.angle),d,l,c,u.predicate,g).box.length)&&0this.terrain.getElevation(k,e,t):null;var T=(t,d)=>{if(!n[t.crossTileID])if(u)this.placements[t.crossTileID]=new _e(!1,!1,!1);else{let u=!1,P=!1,M=!0,O=null,R={box:null,offscreen:null},L={box:null,offscreen:null},N=null,D=null,F=0,z=0,B=0;d.textFeatureIndex?F=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(F=t.featureIndex),d.verticalTextFeatureIndex&&(z=d.verticalTextFeatureIndex);const j=d.textBox;if(j){var _=n=>{let r=e.WritingMode.horizontal;return i.allowVerticalPlacement&&!n&&this.prevPlacement&&(n=this.prevPlacement.placedOrientations[t.crossTileID])&&(this.placedOrientations[t.crossTileID]=n,r=n,this.markUsedOrientation(i,r,t)),r},S=(n,r)=>{if(i.allowVerticalPlacement&&0((e=this.collisionIndex.placeCollisionBox(e,g,c,a,p.predicate,I))&&e.box&&e.box.length&&(this.markUsedOrientation(i,n,t),this.placedOrientations[t.crossTileID]=n),e);S((()=>n(j,e.WritingMode.horizontal)),(()=>{var r=d.verticalTextBox;return i.allowVerticalPlacement&&0{var d=e.x2-e.x1,h=e.y2-e.y1,f=t.textBoxScale,m=x&&"never"===v?s:null;let y={box:[],offscreen:!1},_="never"===g?1:2,S="never";o&&_++;for(let v=0;v<_;v++){for(let s=n;ss(j,d.iconBox,e.WritingMode.horizontal)),(()=>{var n=d.verticalTextBox,r=R&&R.box&&R.box.length;return i.allowVerticalPlacement&&!r&&0(e=x&&O?Ce(e,O.x,O.y,b,w,this.transform.angle):e,this.collisionIndex.placeCollisionBox(e,v,c,a,p.predicate,I)),P=0<(D=L&&L.box&&L.box.length&&d.verticalIconBox?S(d.verticalIconBox):S(d.iconBox)).box.length,M=M&&D.offscreen);k=f||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices;var T=m||0===t.numIconVertices;if(k||T?T?k||(P=P&&u):u=P&&u:P=u=P&&u,u&&_&&_.box&&(L&&L.box&&z?this.collisionIndex.insertCollisionBox(_.box,g,o.get("text-ignore-placement"),i.bucketInstanceId,z,p.ID):this.collisionIndex.insertCollisionBox(_.box,g,o.get("text-ignore-placement"),i.bucketInstanceId,F,p.ID)),P&&D&&this.collisionIndex.insertCollisionBox(D.box,v,o.get("icon-ignore-placement"),i.bucketInstanceId,B,p.ID),N&&(u&&this.collisionIndex.insertCollisionCircles(N.circles,g,o.get("text-ignore-placement"),i.bucketInstanceId,F,p.ID),r)){var A=i.bucketInstanceId;let e=this.collisionCircleArrays[A];void 0===e&&(e=this.collisionCircleArrays[A]=new be);for(let t=0;t{for(let r=0;r{0<=n&&(t.text.placedSymbolArray.get(n).hidden=e||i?1:0)})),0<=m.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(m.verticalPlacedTextSymbolIndex).hidden=e||w?1:0),(x=((S=this.variableOffsets[m.crossTileID])&&this.markUsedJustification(t,S.anchor,m,b),this.placedOrientations[m.crossTileID]))&&(this.markUsedJustification(t,"left",m,x),this.markUsedOrientation(t,x,m))}if(_&&(y=Le(r.icon),g=!(h&&m.verticalPlacedIconSymbolIndex&&i),0<=m.placedIconSymbolIndex&&(S=g?y:Ne,f(t.icon,m.numIconVertices,S),t.icon.placedSymbolArray.get(m.placedIconSymbolIndex).hidden=r.icon.isHidden()),0<=m.verticalPlacedIconSymbolIndex)&&(b=g?Ne:y,f(t.icon,m.numVerticalIconVertices,b),t.icon.placedSymbolArray.get(m.verticalPlacedIconSymbolIndex).hidden=r.icon.isHidden()),(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&(x=t.collisionArrays[C])){let n=new e.Point(0,0);if(x.textBox||x.verticalTextBox){let e=!0;c&&((_=this.variableOffsets[v])?(n=Se(_.anchor,_.width,_.height,_.textOffset,_.textBoxScale),u&&n._rotate(d?this.transform.angle:-this.transform.angle)):e=!1),x.textBox&&ke(t.textCollisionBox.collisionVertexArray,r.text.placed,!e||i,n.x,n.y),x.verticalTextBox&&ke(t.textCollisionBox.collisionVertexArray,r.text.placed,!e||w,n.x,n.y)}g=Boolean(!w&&x.verticalIconBox),x.iconBox&&ke(t.iconCollisionBox.collisionVertexArray,r.icon.placed,g,h?n.x:0,h?n.y:0),x.verticalIconBox&&ke(t.iconCollisionBox.collisionVertexArray,r.icon.placed,!g,h?n.x:0,h?n.y:0)}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error("bucket.text.opacityVertexArray.length (= ".concat(t.text.opacityVertexArray.length,") !== bucket.text.layoutVertexArray.length (= ").concat(t.text.layoutVertexArray.length,") / 4"));if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error("bucket.icon.opacityVertexArray.length (= ".concat(t.icon.opacityVertexArray.length,") !== bucket.icon.layoutVertexArray.length (= ").concat(t.icon.layoutVertexArray.length,") / 4"));t.bucketInstanceId in this.collisionCircleArrays&&(i=this.collisionCircleArrays[t.bucketInstanceId],t.placementInvProjMatrix=i.invProjMatrix,t.placementViewportMatrix=i.viewportMatrix,t.collisionCircleArray=i.circles,delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function ke(e,t,n,r,i){e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0)}const Ie=Math.pow(2,25),Te=Math.pow(2,24),Ae=Math.pow(2,17),Pe=Math.pow(2,16),Me=Math.pow(2,9),Oe=Math.pow(2,8),Re=Math.pow(2,1);function Le(e){var t;return 0!==e.opacity||e.placed?1===e.opacity&&e.placed?4294967295:(t=e.placed?1:0,(e=Math.floor(127*e.opacity))*Ie+t*Te+e*Ae+t*Pe+e*Me+t*Oe+e*Re+t):0}const Ne=0;class De{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,n,r,i){for(var o=this._bucketParts;this._currentTileIndexe.sortKey-t.sortKey)));this._currentPartIndex!this._forceFullPlacement&&2s)){if(this._inProgressLayer||(this._inProgressLayer=new De(a)),this._inProgressLayer.continuePlacement(r[a.source],this.placement,this._showCollisionBoxes,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const ze=512/e.EXTENT/2;class Be{constructor(t,n,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};var i,o,a=new Map;for(let e=0;e({x:Math.floor(e.anchorX*ze),y:Math.floor(e.anchorY*ze)}))),crossTileIDs:o.map((e=>e.crossTileID))};if(128{let{crossTileIDs:t}=e;return t}))}}class je{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ue{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){var t=Math.round((e-this.lng)/360);if(0!==t)for(const o in this.indexes){var n=this.indexes[o],r={};for(const e in n){var i=n[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),r[i.tileID.key]=i}this.indexes[o]=r}this.lng=e}addBucket(e,t,n){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let l=0;le.overscaledZ)for(const n in i){var o=i[n];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,r)}else{var a=i[e.scaledTo(Number(l)).key];a&&a.findMatches(t.symbolInstances,e,r)}}for(let l=0;l{t[e]=!0}));for(const n in this.layerIndexes)t[n]||delete this.layerIndexes[n]}}const Ve=(t,n)=>e.emitValidationErrors(t,n&&n.filter((e=>"source.canvas"!==e.identifier))),He=e.pick(e.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Ge=e.pick(e.operations,["setCenter","setZoom","setBearing","setPitch"]),We=e.emptyStyle();class Ke extends e.Evented{constructor(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.map=t,this.dispatcher=new k(J(),this,t._getMapId()),this.imageManager=new g,this.imageManager.setEventedParent(this),this.glyphManager=new b(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new E(256,512),this.crossTileSymbolIndex=new qe,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());const r=this;this._rtlTextPluginCallback=Ke.registerForPluginStateChange((t=>{t={pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},r.dispatcher.broadcast("syncRTLPluginState",t,((t,n)=>{if(e.triggerPluginCompletionEvent(t),n&&n.every((e=>e)))for(const e in r.sourceCaches){var i=r.sourceCaches[e].getSource().type;"vector"!==i&&"geojson"!==i||r.sourceCaches[e].reload()}}))})),this.on("data",(e=>{if("source"===e.dataType&&"metadata"===e.sourceDataType&&(e=this.sourceCaches[e.sourceId])){var t=e.getSource();if(t&&t.vectorLayerIds)for(const e in this._layers){var n=this._layers[e];n.source===t.id&&this._validateLayer(n)}}}))}loadURL(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;this.fire(new e.Event("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate,t=this.map._requestManager.transformRequest(t,n.Style),this._request=e.getJSON(t,((t,n)=>{this._request=null,t?this.fire(new e.ErrorEvent(t)):n&&this._load(n,r,i)}))}loadJSON(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame((()=>{this._request=null,n.validate=!1!==n.validate,this._load(t,n,r)}))}loadEmpty(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(We,{validate:!1})}_load(t,n,r){var i=n.transformStyle?n.transformStyle(r,t):t;if(!n.validate||!Ve(this,e.validateStyle(i))){this._loaded=!0;for(const e in(this.stylesheet=i).sources)this.addSource(e,i.sources[e],{validate:!1});i.sprite?this._loadSprite(i.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(i.glyphs),this._createLayers(),this.light=new C(this.stylesheet.light),this.map.setTerrain(null!=(r=this.stylesheet.terrain)?r:null),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}}_createLayers(){var t=e.derefLayers(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(const r of t){var n=e.createStyleLayer(r);n.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=n}}_loadSprite(r){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.imageManager.setLoaded(!1),this._spriteRequest=function(r,i,o,a){const s=(r=p(r)).length;var l=1{delete c[r],u[p]=t,f(a,u,d,e,s)})),h=i.transformRequest(i.normalizeSpriteURL(m,l,".png"),n.SpriteImage);const o=p+"_"+h.url;c[o]=t.getImage(h,((e,t)=>{delete c[o],d[p]=t,f(a,u,d,e,s)}))}return{cancel(){for(const e of Object.values(c))e.cancel()}}}(r,this.map._requestManager,this.map.getPixelRatio(),((t,n)=>{if(this._spriteRequest=null,t)this.fire(new e.ErrorEvent(t));else if(n)for(const e in n){this._spritesImagesIds[e]=[];for(const t of this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in n))):[])this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const t in n[e]){var r="default"===e?t:e+":"+t;this._spritesImagesIds[e].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,n[e][t],!1):this.imageManager.addImage(r,n[e][t]),i&&(this._changedImages[r]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"})),o&&o(t)}))}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}_validateLayer(t){var n,r=this.sourceCaches[t.source];r&&(n=t.sourceLayer)&&("geojson"===(r=r.getSource()).type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(n))&&this.fire(new e.ErrorEvent(new Error('Source layer "'.concat(n,'" ')+'does not exist on source "'.concat(r.id,'" ')+'as specified by style layer "'.concat(t.id,'".'))))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e){var t=this._serializedAllLayers();if(!e||0===e.length)return Object.values(t);var n=[];for(const r of e)t[r]&&n.push(t[r]);return n}_serializedAllLayers(){var e=this._serializedLayers;if(!e){e=this._serializedLayers={};for(const n of Object.keys(this._layers)){var t=this._layers[n];"custom"!==t.type&&(e[n]=t.serialize())}}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(this._loaded){var n=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(r.length||i.length)&&this._updateWorkerLayers(r,i);for(const e in this._updatedSources){var o=this._updatedSources[e];if("reload"===o)this._reloadSource(e);else{if("clear"!==o)throw new Error("Invalid action "+o);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}var a={};for(const e in this.sourceCaches){var s=this.sourceCaches[e];a[e]=s.used,s.used=!1}for(const e of this._order){var l=this._layers[e];l.recalculate(t,this._availableImages),!l.isHidden(t.zoom)&&l.source&&(this.sourceCaches[l.source].used=!0)}for(const t in a){var c=this.sourceCaches[t];a[t]!==c.used&&c.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new e.Event("data",{dataType:"style"}))}}_updateTilesForChangedImages(){var e=Object.keys(this._changedImages);if(e.length){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(e),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();var r=this.serialize();if(t=n.transformStyle?n.transformStyle(r,t):t,Ve(this,e.validateStyle(t)))return!1;if((t=e.clone$1(t)).layers=e.derefLayers(t.layers),n=e.diffStyles(r,t).filter((e=>!(e.command in Ge))),0===n.length)return!1;if(r=n.filter((e=>!(e.command in He))),0e.command)).join(", "),"."));for(const e of n)"setTransition"!==e.command&&this[e.command].apply(this,e.args);return this.stylesheet=t,!(this._serializedLayers=null)}addImage(t,n){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error('An image named "'.concat(t,'" already exists.'))));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error('An image named "'.concat(t,'" does not exist.'))));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error('Source "'.concat(t,'" already exists.'));if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: ".concat(Object.keys(n).join(", "),"."));if(!(0<=["vector","raster","geojson","video","image"].indexOf(n.type))||!this._validate(e.validateStyle.source,"sources."+t,n,null,r)){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const e=this.sourceCaches[t]=new G(t,n,this.dispatcher);e.style=this,e.setEventedParent(this,(()=>({isSourceLoaded:e.loaded(),source:e.serialize(),sourceId:t}))),e.onAdd(this.map),this._changed=!0}}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'.concat(t,'" cannot be removed while layer "').concat(r,'" is using it.'))));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID="+e);if("geojson"!==(e=this.sourceCaches[e].getSource()).type)throw new Error("geojsonSource.type is ".concat(e.type,", which is !== 'geojson"));e.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer "'.concat(i,'" already exists on this map.'))));else{let o;if("custom"===t.type){if(Ve(this,e.validateCustomStyleLayer(t)))return;o=e.createStyleLayer(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},r))return;o=e.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}})}r=n?this._order.indexOf(n):this._order.length,n&&-1===r?this.fire(new e.ErrorEvent(new Error('Cannot add layer "'.concat(i,'" before non-existing layer "').concat(n,'".')))):(this._order.splice(r,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type&&(t=this._removedLayers[i],delete this._removedLayers[i],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())),this._updateLayer(o),o.onAdd&&o.onAdd(this.map))}}moveLayer(t,n){var r;this._checkLoaded(),this._changed=!0,this._layers[t]?t!==n&&(r=this._order.indexOf(t),this._order.splice(r,1),r=n?this._order.indexOf(n):this._order.length,n&&-1===r?this.fire(new e.ErrorEvent(new Error('Cannot move layer "'.concat(t,'" before non-existing layer "').concat(n,'".')))):(this._order.splice(r,0,t),this._layerOrderChanged=!0)):this.fire(new e.ErrorEvent(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be moved."))))}removeLayer(t){this._checkLoaded();var n,r=this._layers[t];r?(r.setEventedParent(null),n=this._order.indexOf(t),this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)):this.fire(new e.ErrorEvent(new Error('Cannot remove non-existing layer "'.concat(t,'".'))))}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(t,n,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error('Cannot set the zoom range of non-existing layer "'.concat(t,'".'))))}setFilter(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();var i=this.getLayer(t);i?e.deepEqual(i.filter,n)||(null==n?(i.filter=void 0,this._updateLayer(i)):this._validate(e.validateStyle.filter,"layers.".concat(i.id,".filter"),n,null,r)||(i.filter=e.clone$1(n),this._updateLayer(i))):this.fire(new e.ErrorEvent(new Error('Cannot filter non-existing layer "'.concat(t,'".'))))}getFilter(t){return e.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();var o=this.getLayer(t);o?e.deepEqual(o.getLayoutProperty(n),r)||(o.setLayoutProperty(n,r,i),this._updateLayer(o)):this.fire(new e.ErrorEvent(new Error('Cannot style non-existing layer "'.concat(t,'".'))))}getLayoutProperty(t,n){var r=this.getLayer(t);if(r)return r.getLayoutProperty(n);this.fire(new e.ErrorEvent(new Error('Cannot get style of non-existing layer "'.concat(t,'".'))))}setPaintProperty(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();var o=this.getLayer(t);o?e.deepEqual(o.getPaintProperty(n),r)||(o.setPaintProperty(n,r,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error('Cannot style non-existing layer "'.concat(t,'".'))))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(t,n){this._checkLoaded();var r=t.source,i=t.sourceLayer,o=this.sourceCaches[r];void 0===o?this.fire(new e.ErrorEvent(new Error("The source '".concat(r,"' does not exist in the map's style.")))):"geojson"===(r=o.getSource().type)&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==r||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,t.id,n)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();var r,i=t.source,o=this.sourceCaches[i];void 0===o?this.fire(new e.ErrorEvent(new Error("The source '".concat(i,"' does not exist in the map's style.")))):(r="vector"===(i=o.getSource().type)?t.sourceLayer:void 0,"vector"!==i||r?n&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(r,t.id,n):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))))}getFeatureState(t){this._checkLoaded();var n=t.source,r=t.sourceLayer,i=this.sourceCaches[n];if(void 0===i)this.fire(new e.ErrorEvent(new Error("The source '".concat(n,"' does not exist in the map's style."))));else{if("vector"!==i.getSource().type||r)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(r,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}}getTransition(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){var t,n,r,i;if(this._loaded)return t=e.mapObject(this.sourceCaches,(e=>e.serialize())),n=this._serializeByIds(this._order),r=this.map.getTerrain()||void 0,i=this.stylesheet,e.filterObject({version:i.version,name:i.name,metadata:i.metadata,light:i.light,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:t,layers:n,terrain:r},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){var t=e=>"fill-extrusion"===this._layers[e].type,n={},r=[];for(let u=this._order.length-1;0<=u;u--){var i=this._order[u];if(t(i)){n[i]=u;for(const t of e){var o=t[i];if(o)for(const e of o)r.push(e)}}}r.sort(((e,t)=>t.intersectionZ-e.intersectionZ));var a=[];for(let u=this._order.length-1;0<=u;u--){var s=this._order[u];if(t(s))for(let e=r.length-1;0<=e;e--){var l=r[e].feature;if(n[l.layer.id]{var n,r=p.featureSortOrder;return r?(n=r.indexOf(e.featureIndex),r.indexOf(t.featureIndex)-n):t.featureIndex-e.featureIndex}));for(const e of h)d.push(e)}}for(const p in s)s[p].forEach((t=>{t=t.feature;var r=e[p];r=n[r.source].getFeatureState(t.layer["source-layer"],t.id),t.source=t.layer.source,t.layer["source-layer"]&&(t.sourceLayer=t.layer["source-layer"]),t.state=r}));return s}(this._layers,s,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,n){return n&&n.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n),(t=this.sourceCaches[t])?function(e,t){var n=e.getRenderableIds().map((t=>e.getTileByID(t))),r=[],i={};for(let s=0;s{z[e]=t})(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))}getLight(){return this.light.getLight()}setLight(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();var r,i=this.light.getLight();let o=!1;for(const a in t)if(!e.deepEqual(t[a],i[a])){o=!0;break}o&&(r={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)},this.light.setLight(t,n),this.light.updateTransitions(r))}_validate(t,n,r,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!o||!1!==o.validate)&&Ve(this,t.call(e.validateStyle,e.extend({key:n,style:this.serialize(),value:r,styleSpec:e.v8Spec},i)))}_remove(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this.sourceCaches){var n=this.sourceCaches[e];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const t in this.sourceCaches)this.sourceCaches[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(t,n,r,i){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=!1,s=!1;var l={};for(const e of this._order){var c=this._layers[e];if("symbol"===c.type){if(!l[c.source]){const e=this.sourceCaches[c.source];l[c.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}c=this.crossTileSymbolIndex.addLayer(c,l[c.source],t.center.lng),a=a||c}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),t.zoom))&&(this.pauseablePlacement=new Fe(t,this.map.terrain,this._order,o,n,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const e of this._order){var u=this._layers[e];"symbol"===u.type&&this.placement.updateLayerOpacities(u,l[u.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,t,n){this.imageManager.getImages(t.icons,n),this._updateTilesForChangedImages(),(n=this.sourceCaches[t.source])&&n.setDependencies(t.tileID.key,t.type,t.icons)}getGlyphs(e,t,n){this.glyphManager.getGlyphs(t.stacks,n),(n=this.sourceCaches[t.source])&&n.setDependencies(t.tileID.key,t.type,[""])}getResource(t,n,r){return e.makeRequest(n,r)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded(),t&&this._validate(e.validateStyle.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;this._checkLoaded(),t=[{id:t,url:n}],n=[...p(this.stylesheet.sprite),...t],this._validate(e.validateStyle.sprite,"sprite",n,null,r)||(this.stylesheet.sprite=n,this._loadSprite(t,!0,i))}removeSprite(t){this._checkLoaded();var n=p(this.stylesheet.sprite);if(n.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;n.splice(n.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=01&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;this._checkLoaded(),t&&this._validate(e.validateStyle.sprite,"sprite",t,null,n)||((this.stylesheet.sprite=t)?this._loadSprite(t,!0,r):(this._unloadSprite(),r&&r(null)))}}Ke.registerForPluginStateChange=e.registerForPluginStateChange;var Ye=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ze="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Xe={prelude:Je("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:Je("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Je("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Je("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:Je("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Je("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:Je("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Je("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),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;}"),collisionCircle:Je("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);}"),debug:Je("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,get_elevation(a_pos),1);}"),fill:Je("#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);}"),fillOutline:Je("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;}"),fillOutlinePattern:Je("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;}"),fillPattern:Je("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);}"),fillExtrusion:Je("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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);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;}"),fillExtrusionPattern:Je("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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float 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;}"),hillshadePrepare:Je("#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;}"),hillshade:Je("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;}"),line:Je("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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:Je("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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:Je("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:Je("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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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);}"),raster:Je("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;}"),symbolIcon:Je("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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;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),z,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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:Je("#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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:Je("#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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));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);}"),terrain:Je("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ze),terrainDepth:Je("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Ze),terrainCoords:Je("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ze)};function Je(e,t){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=(o=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g))?o.concat(i):i;const a={};return{fragmentSource:e=e.replace(n,((e,t,n,r,i)=>(a[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(i,"\nvarying ").concat(n," ").concat(r," ").concat(i,";\n#else\nuniform ").concat(n," ").concat(r," u_").concat(i,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(i,"\n ").concat(n," ").concat(r," ").concat(i," = u_").concat(i,";\n#endif\n")))),vertexSource:t=t.replace(n,((e,t,n,r,i)=>{var o="float"===r?"vec2":"vec4",s=i.match(/color/)?"color":o;return a[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(i,"\nuniform lowp float u_").concat(i,"_t;\nattribute ").concat(n," ").concat(o," a_").concat(i,";\nvarying ").concat(n," ").concat(r," ").concat(i,";\n#else\nuniform ").concat(n," ").concat(r," u_").concat(i,";\n#endif\n"):"vec4"==s?"\n#ifndef HAS_UNIFORM_u_".concat(i,"\n ").concat(i," = a_").concat(i,";\n#else\n ").concat(n," ").concat(r," ").concat(i," = u_").concat(i,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(i,"\n ").concat(i," = unpack_mix_").concat(s,"(a_").concat(i,", u_").concat(i,"_t);\n#else\n ").concat(n," ").concat(r," ").concat(i," = u_").concat(i,";\n#endif\n"):"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(i,"\nuniform lowp float u_").concat(i,"_t;\nattribute ").concat(n," ").concat(o," a_").concat(i,";\n#else\nuniform ").concat(n," ").concat(r," u_").concat(i,";\n#endif\n"):"vec4"==s?"\n#ifndef HAS_UNIFORM_u_".concat(i,"\n ").concat(n," ").concat(r," ").concat(i," = a_").concat(i,";\n#else\n ").concat(n," ").concat(r," ").concat(i," = u_").concat(i,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(i,"\n ").concat(n," ").concat(r," ").concat(i," = unpack_mix_").concat(s,"(a_").concat(i,", u_").concat(i,"_t);\n#else\n ").concat(n," ").concat(r," ").concat(i," = u_").concat(i,";\n#endif\n")})),staticAttributes:r,staticUniforms:o}}class Qe{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,n,r,i,o,a,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==r.length;for(let u=0;!c&&u({u_depth:new e.Uniform1i(t,n.u_depth),u_terrain:new e.Uniform1i(t,n.u_terrain),u_terrain_dim:new e.Uniform1f(t,n.u_terrain_dim),u_terrain_matrix:new e.UniformMatrix4f(t,n.u_terrain_matrix),u_terrain_unpack:new e.Uniform4f(t,n.u_terrain_unpack),u_terrain_exaggeration:new e.Uniform1f(t,n.u_terrain_exaggeration)}))(t,p),this.binderUniforms=r?r.getUniforms(t,p):[]}}}draw(e,t,n,r,i,o,a,s,l,c,u,d,h,p,f,m,g,y){var v=e.gl;if(!this.failedToCreate){if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(o),s){e.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),e.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(const e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}for(const e in this.fixedUniforms)this.fixedUniforms[e].set(a[e]);f&&f.setUniforms(e,this.binderUniforms,h,{zoom:p});let b=0;switch(t){case v.LINES:b=2;break;case v.TRIANGLES:b=3;break;case v.LINE_STRIP:b=1}for(const n of d.get()){var _=n.vaos||(n.vaos={});(_[l]||(_[l]=new Qe)).bind(e,this,c,f?f.getPaintVertexBuffers():[],u,n.vertexOffset,m,g,y),v.drawElements(t,n.primitiveLength*b,v.UNSIGNED_SHORT,n.primitiveOffset*b*2)}}}}function tt(e,t,n){var r=1/ge(n,1,t.transform.tileZoom),i=Math.pow(2,n.tileID.overscaledZ);i=(t=n.tileSize*Math.pow(2,t.transform.tileZoom)/i)*(n.tileID.canonical.x+n.tileID.wrap*i),t*=n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[r,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[i>>16,t>>16],u_pixel_coord_lower:[65535&i,65535&t]}}const nt=(t,n,r,i)=>{var o=n.style.light,a=[(a=o.properties.get("position")).x,a.y,a.z],s=e.create$1();"viewport"===o.properties.get("anchor")&&e.fromRotation(s,-n.transform.angle),e.transformMat3(a,a,s),n=o.properties.get("color");return{u_matrix:t,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[n.r,n.g,n.b],u_vertical_gradient:+r,u_opacity:i}},rt=(t,n,r,i,o,a,s)=>e.extend(nt(t,n,r,i),tt(a,n,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),it=e=>({u_matrix:e}),ot=(t,n,r,i)=>e.extend(it(t),tt(r,n,i)),at=(e,t)=>({u_matrix:e,u_world:t}),st=(t,n,r,i,o)=>e.extend(ot(t,n,r,i),{u_world:o}),lt=(e,t,n)=>{var r=ge(n,1,t.zoom),i=Math.pow(2,t.zoom-n.tileID.overscaledZ);n=n.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[t.pixelsToGLUnits[0]/(r*i),t.pixelsToGLUnits[1]/(r*i)],u_overscale_factor:n}},ct=(e,t,n)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}),ut=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}},dt=e=>({u_matrix:e}),ht=(t,n,r,i)=>{var o=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),s=r.paint.get("hillshade-accent-color");let l=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(l-=t.transform.angle);var c=!t.options.moving;return{u_matrix:i?i.posMatrix:t.transform.calculatePosMatrix(n.tileID.toUnwrapped(),c),u_image:0,u_latrange:(i=n.tileID,t=Math.pow(2,i.canonical.z),i=i.canonical.y,[new e.MercatorCoordinate(0,i/t).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/t).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),l],u_shadow:o,u_highlight:a,u_accent:s}},pt=(t,n)=>{var r=n.stride,i=e.create();return e.ortho(i,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(i,i,[0,-e.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:n.getUnpackVector()}},ft=(e,t,n,r)=>{var i=e.transform;return{u_matrix:gt(e,t,n,r),u_ratio:1/ge(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}};function mt(e,t){return 1/ge(e,1,t.tileZoom)}function gt(e,t,n,r){return e.translatePosMatrix((r||t.tileID).posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const yt=(e,t,n,r,i)=>({u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:0<(e=i.paint.get("raster-saturation"))?1-1/(1.001-e):-e,u_contrast_factor:0<(t=i.paint.get("raster-contrast"))?1/(1-t):1+t,u_spin_weights:(n=i.paint.get("raster-hue-rotate"),n*=Math.PI/180,r=Math.sin(n),[(2*(n=Math.cos(n))+1)/3,(-Math.sqrt(3)*r-n+1)/3,(Math.sqrt(3)*r-n+1)/3])}),vt=(e,t,n,r,i,o,a,s,l,c)=>{var u=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:c,u_texture:0}},_t=(t,n,r,i,o,a,s,l,c,u,d)=>{var h=o.transform;return e.extend(vt(t,n,r,i,o,a,s,l,c,u),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+d})},bt=(t,n,r,i,o,a,s,l,c,u)=>e.extend(_t(t,n,r,i,o,a,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1}),wt=(t,n,r,i,o,a)=>e.extend(function(e,t,n,r){var i=n.imageManager.getPattern(e.from.toString()),{width:o,height:a}=(e=n.imageManager.getPattern(e.to.toString()),n.imageManager.getPixelSize()),s=Math.pow(2,r.tileID.overscaledZ),l=(s=(l=r.tileSize*Math.pow(2,n.transform.tileZoom)/s)*(r.tileID.canonical.x+r.tileID.wrap*s),l*r.tileID.canonical.y);return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:e.tl,u_pattern_br_b:e.br,u_texsize:[o,a],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:e.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/ge(r,1,n.transform.tileZoom),u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}(i,a,r,o),{u_matrix:t,u_opacity:n}),xt={fillExtrusion:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_opacity:new e.Uniform1f(t,n.u_opacity)}),fillExtrusionPattern:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,n.u_height_factor),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade),u_opacity:new e.Uniform1f(t,n.u_opacity)}),fill:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}),fillPattern:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}),fillOutline:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world)}),fillOutlinePattern:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}),circle:(t,n)=>({u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,n.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}),collisionBox:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,n.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,n.u_overscale_factor)}),collisionCircle:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,n.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,n.u_viewport_size)}),debug:(t,n)=>({u_color:new e.UniformColor(t,n.u_color),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_overlay:new e.Uniform1i(t,n.u_overlay),u_overlay_scale:new e.Uniform1f(t,n.u_overlay_scale)}),clippingMask:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}),heatmap:(t,n)=>({u_extrude_scale:new e.Uniform1f(t,n.u_extrude_scale),u_intensity:new e.Uniform1f(t,n.u_intensity),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}),heatmapTexture:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_color_ramp:new e.Uniform1i(t,n.u_color_ramp),u_opacity:new e.Uniform1f(t,n.u_opacity)}),hillshade:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_latrange:new e.Uniform2f(t,n.u_latrange),u_light:new e.Uniform2f(t,n.u_light),u_shadow:new e.UniformColor(t,n.u_shadow),u_highlight:new e.UniformColor(t,n.u_highlight),u_accent:new e.UniformColor(t,n.u_accent)}),hillshadePrepare:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_dimension:new e.Uniform2f(t,n.u_dimension),u_zoom:new e.Uniform1f(t,n.u_zoom),u_unpack:new e.Uniform4f(t,n.u_unpack)}),line:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels)}),lineGradient:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_image:new e.Uniform1i(t,n.u_image),u_image_height:new e.Uniform1f(t,n.u_image_height)}),linePattern:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_texsize:new e.Uniform2f(t,n.u_texsize),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_image:new e.Uniform1i(t,n.u_image),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}),lineSDF:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,n.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,n.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,n.u_sdfgamma),u_image:new e.Uniform1i(t,n.u_image),u_tex_y_a:new e.Uniform1f(t,n.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,n.u_tex_y_b),u_mix:new e.Uniform1f(t,n.u_mix)}),raster:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_tl_parent:new e.Uniform2f(t,n.u_tl_parent),u_scale_parent:new e.Uniform1f(t,n.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,n.u_buffer_scale),u_fade_t:new e.Uniform1f(t,n.u_fade_t),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image0:new e.Uniform1i(t,n.u_image0),u_image1:new e.Uniform1i(t,n.u_image1),u_brightness_low:new e.Uniform1f(t,n.u_brightness_low),u_brightness_high:new e.Uniform1f(t,n.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,n.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,n.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,n.u_spin_weights)}),symbolIcon:(t,n)=>({u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture)}),symbolSDF:(t,n)=>({u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,n.u_is_halo)}),symbolTextAndIcon:(t,n)=>({u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texsize_icon:new e.Uniform2f(t,n.u_texsize_icon),u_texture:new e.Uniform1i(t,n.u_texture),u_texture_icon:new e.Uniform1i(t,n.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,n.u_is_halo)}),background:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_color:new e.UniformColor(t,n.u_color)}),backgroundPattern:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image:new e.Uniform1i(t,n.u_image),u_pattern_tl_a:new e.Uniform2f(t,n.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,n.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,n.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,n.u_pattern_br_b),u_texsize:new e.Uniform2f(t,n.u_texsize),u_mix:new e.Uniform1f(t,n.u_mix),u_pattern_size_a:new e.Uniform2f(t,n.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,n.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,n.u_scale_a),u_scale_b:new e.Uniform1f(t,n.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,n.u_tile_units_to_pixels)}),terrain:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_texture:new e.Uniform1i(t,n.u_texture),u_ele_delta:new e.Uniform1f(t,n.u_ele_delta)}),terrainDepth:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ele_delta:new e.Uniform1f(t,n.u_ele_delta)}),terrainCoords:(t,n)=>({u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_texture:new e.Uniform1i(t,n.u_texture),u_terrain_coords_id:new e.Uniform1f(t,n.u_terrain_coords_id),u_ele_delta:new e.Uniform1f(t,n.u_ele_delta)})};class St{constructor(e,t,n){var r=(this.context=e).gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){var t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}}const Ct={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Et{constructor(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,n=(this.context=e).gl,this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error("Length of new data is ".concat(e.length,", which doesn't match current length of ")+this.length);var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;rt.style.map.terrain.getElevation(ve,e,n):null,F="map"===r.layout.get("text-rotation-alignment");{void 0,void 0,void 0,U=void 0,void 0,void 0,void 0,void 0,void 0,K=void 0,void 0,void 0,void 0,J=void 0,void 0,$=void 0,void 0,de=void 0,ae=void 0,le=void 0,oe=void 0,ce=void 0,ue=void 0;var z=k,B=ve.posMatrix,j=t,U=o,q=M,V=T,H=y,G=u,W=F,K=D,Y=U?z.textSizeData:z.iconSizeData,Z=e.evaluateSizeForZoom(Y,j.transform.zoom),X=[256/j.width*2+1,256/j.height*2+1],J=(U?z.text:z.icon).dynamicLayoutVertexArray,Q=(J.clear(),z.lineVertexArray),$=(U?z.text:z.icon).placedSymbolArray,ee=j.transform.width/j.transform.height;let n=!1;for(let t=0;t<$.length;t++){var oe,ae,le,ce,ue,de=$.get(t);if(de.hidden||de.writingMode===e.WritingMode.vertical&&!n)pe(de.numGlyphs,J);else{let t;n=!1,K?(t=[de.anchorX,de.anchorY,K(de.anchorX,de.anchorY),1],e.transformMat4(t,t,B)):fe(t=[de.anchorX,de.anchorY,0,1],t,B),ae=X,oe=void 0,oe=(le=t)[0]/le[3],le=le[1]/le[3],(!(oe>=-ae[0]&&oe<=ae[0]&&le>=-ae[1]&&le<=ae[1])||(oe=t[3],le=ie(j.transform.cameraToCenterDistance,oe),ae=e.evaluateSizeForFeature(Y,Z,de),oe=H?ae/le:ae*le,le=re(ae=new e.Point(de.anchorX,de.anchorY),q,K).point,n=(ue=se(de,oe,!(ce={projections:{},offsets:{}}),G,B,q,V,z.glyphOffsetArray,Q,J,le,ae,ce,ee,W,K)).useVertical,ue.notEnoughRoom)||n||ue.needsFlipping&&se(de,oe,!0,G,B,q,V,z.glyphOffsetArray,Q,J,le,ae,ce,ee,W,K).notEnoughRoom)&&pe(de.numGlyphs,J)}}(U?z.text:z.icon).dynamicLayoutVertexBuffer.updateData(J)}}let p;F=t.translatePosMatrix(ve.posMatrix,E,a,s),D=v||o&&S||N?_n:M,U=t.translatePosMatrix(T,E,a,s,!0),N=A&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);var he={program:O,buffers:I,uniformValues:p=A?k.iconsInText?bt(P.kind,R,_,y,t,F,D,U,n,d):_t(P.kind,R,_,y,t,F,D,U,o,n,!0):vt(P.kind,R,_,y,t,F,D,U,o,n),atlasTexture:i,atlasTextureIcon:h,atlasInterpolation:l,atlasInterpolationIcon:c,isSDF:A,hasHalo:N};if(b&&k.canOverlap){w=!0;for(const t of I.segments.get())C.push({segments:new e.SegmentVector([t]),sortKey:t.sortKey,state:he,terrainData:L})}else C.push({segments:I.segments,sortKey:0,state:he,terrainData:L})}}}w&&C.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of C){var me,ye=e.state;p.activeTexture.set(f.TEXTURE0),ye.atlasTexture.bind(ye.atlasInterpolation,f.CLAMP_TO_EDGE),ye.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),ye.atlasTextureIcon)&&ye.atlasTextureIcon.bind(ye.atlasInterpolationIcon,f.CLAMP_TO_EDGE),ye.isSDF&&(me=ye.uniformValues,ye.hasHalo&&(me.u_is_halo=1,wn(ye.buffers,e.segments,r,t,ye.program,x,d,h,me,e.terrainData)),me.u_is_halo=0),wn(ye.buffers,e.segments,r,t,ye.program,x,d,h,ye.uniformValues,e.terrainData)}}function wn(e,t,n,r,i,o,a,s,l,c){var u=r.context,d=u.gl;i.draw(u,d.TRIANGLES,o,a,s,gn.disabled,l,c,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function xn(t,n,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var o=t.context,a=o.gl,s=mn.disabled,l=new hn([a.ONE,a.ONE],e.Color.transparent,[!0,!0,!0,!0]);{var c=t,u=r,d=(_=o).gl;_.activeTexture.set(d.TEXTURE1),_.viewport.set([0,0,c.width/4,c.height/4]);let e=u.heatmapFbo;e?(d.bindTexture(d.TEXTURE_2D,e.colorAttachment.get()),_.bindFramebuffer.set(e.framebuffer)):(b=d.createTexture(),d.bindTexture(d.TEXTURE_2D,b),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),e=u.heatmapFbo=_.createFramebuffer(c.width/4,c.height/4,!1,!1),function(e,t,n,r){var i=e.gl,o=null!=(o=e.HALF_FLOAT)?o:i.UNSIGNED_BYTE;e=null!=(e=e.RGBA16F)?e:i.RGBA;i.texImage2D(i.TEXTURE_2D,0,e,t.width/4,t.height/4,0,i.RGBA,o,null),r.colorAttachment.set(n)}(_,c,b,e))}o.clear({color:e.Color.transparent});for(let e=0;e{var o=e.create();return{u_matrix:o,u_world:[(e.ortho(o,0,t.width,t.height,0,0,1),t=t.context.gl).drawingBufferWidth,t.drawingBufferHeight],u_image:r,u_color_ramp:i,u_opacity:n.paint.get("heatmap-opacity")}})(d,u,0,1),null,u.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,u.paint,d.transform.zoom)}}}function Sn(e,t,n,r,i){if(n&&r&&r.imageAtlas){let o=(r=r.imageAtlas.patternPositions)[n.to.toString()],a=r[n.from.toString()];o&&a||(o=r[n=i.getPaintProperty(t)],a=r[n]),o&&a&&e.setConstantPatternPositions(o,a)}}function Cn(e,t,n,r,i,o,a){var s=e.context.gl,l="fill-pattern",c=n.paint.get(l),u=c&&c.constantOr(1),d=n.getCrossfadeParameters();let h,p,f,m,g;h=a?(p=u&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s.LINES):(p=u?"fillPattern":"fill",s.TRIANGLES);var y=c.constantOr(null);for(const E of r){var v,_,b,w,x,S,C=t.getTile(E);u&&!C.patternsLoaded()||(v=C.getBucket(n))&&(_=v.programConfigurations.get(n.id),b=e.useProgram(p,_),w=e.style.map.terrain&&e.style.map.terrain.getTerrainData(E),u&&(e.context.activeTexture.set(s.TEXTURE0),C.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),_.updatePaintBuffers(d)),Sn(_,l,y,C,n),x=((w?E:null)||E).posMatrix,x=e.translatePosMatrix(x,C,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor")),f=a?(m=v.indexBuffer2,g=v.segments2,S=[s.drawingBufferWidth,s.drawingBufferHeight],"fillOutlinePattern"===p&&u?st(x,e,d,C,S):at(x,S)):(m=v.indexBuffer,g=v.segments,u?ot(x,e,d,C):it(x)),b.draw(e.context,h,i,e.stencilModeForClipping(E),o,gn.disabled,f,w,n.id,v.layoutVertexBuffer,m,g,n.paint,e.transform.zoom,_))}}function En(e,t,n,r,i,o,a){var s=e.context,l=s.gl,c="fill-extrusion-pattern",u=n.paint.get(c),d=u.constantOr(1),h=n.getCrossfadeParameters(),p=n.paint.get("fill-extrusion-opacity"),f=u.constantOr(null);for(const x of r){var m,g,y,v,_,b=t.getTile(x),w=b.getBucket(n);w&&(m=e.style.map.terrain&&e.style.map.terrain.getTerrainData(x),g=w.programConfigurations.get(n.id),y=e.useProgram(d?"fillExtrusionPattern":"fillExtrusion",g),d&&(e.context.activeTexture.set(l.TEXTURE0),b.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),g.updatePaintBuffers(h)),Sn(g,c,f,b,n),v=e.translatePosMatrix(x.posMatrix,b,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),_=n.paint.get("fill-extrusion-vertical-gradient"),b=d?rt(v,e,_,p,x,h,b):nt(v,e,_,p),y.draw(s,s.gl.TRIANGLES,i,o,a,gn.backCCW,b,m,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,e.transform.zoom,g,e.style.map.terrain&&w.centroidVertexBuffer))}}const kn=new e.Color(1,0,0,1),In=new e.Color(0,1,0,1),Tn=new e.Color(0,0,1,1),An=new e.Color(1,0,1,1),Pn=new e.Color(0,1,1,1);function Mn(e,t,n,r){Rn(e,0,t+n/2,e.transform.width,n,r)}function On(e,t,n,r){Rn(e,t-n/2,0,n,e.transform.height,r)}function Rn(e,t,n,r,i,o){var a=e.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,n*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function Ln(e,t,n){var r=e.context,i=r.gl,o=e.colorModeForRenderPass(),a=new fn(i.LEQUAL,fn.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh();r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height]);for(const d of n){var c=e.renderToTexture.getTexture(d),u=t.getTerrainData(d.tileID);c={u_matrix:c=(r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,c.texture),e.transform.calculatePosMatrix(d.tileID.toUnwrapped())),u_texture:0,u_ele_delta:t.getMeshFrameDelta(e.transform.zoom)};s.draw(r,i.TRIANGLES,a,mn.disabled,o,gn.backCCW,c,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class Nn{constructor(t,n){this.context=new pn(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.create(),renderTime:0},this.setup(),this.numSublayers=G.maxUnderzooming+G.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new qe}resize(e,t,n){if(this.width=Math.floor(e*n),this.height=Math.floor(t*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const r of this.style._order)this.style._layers[r].resize()}setup(){var t,n=this.context;(t=((t=((t=((t=((t=((t=new e.PosArray).emplaceBack(0,0),t.emplaceBack(e.EXTENT,0),t.emplaceBack(0,e.EXTENT),t.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=n.createVertexBuffer(t,Ye.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2),new e.PosArray)).emplaceBack(0,0),t.emplaceBack(e.EXTENT,0),t.emplaceBack(0,e.EXTENT),t.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=n.createVertexBuffer(t,Ye.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5),new e.RasterBoundsArray)).emplaceBack(0,0,0,0),t.emplaceBack(e.EXTENT,0,e.EXTENT,0),t.emplaceBack(0,e.EXTENT,0,e.EXTENT),t.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=n.createVertexBuffer(t,L.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2),new e.PosArray)).emplaceBack(0,0),t.emplaceBack(1,0),t.emplaceBack(0,1),t.emplaceBack(1,1),this.viewportBuffer=n.createVertexBuffer(t,Ye.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2),new e.LineStripIndexArray)).emplaceBack(0),t.emplaceBack(1),t.emplaceBack(3),t.emplaceBack(2),t.emplaceBack(0),this.tileBorderIndexBuffer=n.createIndexBuffer(t),new e.TriangleIndexArray)).emplaceBack(0,1,2),t.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=n.createIndexBuffer(t),n=this.context.gl;this.stencilClearMode=new mn({func:n.ALWAYS,mask:0},0,255,n.ZERO,n.ZERO,n.ZERO)}clearStencil(){var t=this.context,n=t.gl,r=(this.nextStencilID=1,this.currentStencilSource=void 0,e.create());e.ortho(r,0,this.width,this.height,0,0,1),e.scale(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,fn.disabled,this.stencilClearMode,hn.disabled,gn.disabled,dt(r),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource!==e.source&&e.isTileClipped()&&t&&t.length){this.currentStencilSource=e.source;var n=this.context,r=n.gl,i=(256t.overscaledZ-e.overscaledZ)),e[e.length-1].overscaledZ),r=e[0].overscaledZ-n+1;if(1n.source&&!n.isHidden(t)?[e.sourceCaches[n.source]]:[]))).filter((e=>"vector"===e.getSource().type)),i=i.filter((e=>"vector"!==e.getSource().type));const o=e=>{(!n||n.getSource().maxzoomo(e))),n||i.forEach((e=>o(e))),n}(this.style,this.transform.zoom))&&function(t,n,r){for(let g=0;g "+a.overscaledZ),function(e,t){e.initDebugOverlayCanvas();var n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(i,a=y+" ".concat(m,"kB")),u.draw(s,l.TRIANGLES,d,h,hn.alphaBlended,gn.disabled,ut(c,e.Color.transparent,o),null,"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments),u.draw(s,l.LINE_STRIP,d,h,p,gn.disabled,ut(c,e.Color.red),f,"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments)}}(this,r,r.getVisibleCoordinates()),this.options.showPadding&&function(e){var t,n,r=e.transform.padding;Rn(t=e,(n=(Mn(e,e.transform.height-(r.top||0),3,kn),Mn(e,r.bottom||0,3,In),On(e,r.left||0,3,Tn),On(e,e.transform.width-(r.right||0),3,An),r=e.transform.centerPoint).x)-1,(e=e.transform.height-r.y)-10,2,20,r=Pn),Rn(t,n-10,e-1,20,2,r)}(this),this.context.setDefault()}renderLayer(t,n,r,i){if(!r.isHidden(this.transform.zoom)&&("background"===r.type||"custom"===r.type||(i||[]).length))switch(this.id=r.id,r.type){case"symbol":!function(t,n,r,i,o){if("translucent"===t.renderPass){var a=mn.disabled,s=t.colorModeForRenderPass();if(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset")){var l=i,c=t,u=r,d=n,h=r.layout.get("text-rotation-alignment"),p=r.layout.get("text-pitch-alignment"),f=o,m=c.transform,g="map"===h,y="map"===p;for(const t of l){var v,_,b,w,x=d.getTile(t),S=x.getBucket(u);S&&S.text&&S.text.segments.get().length&&(v=S.textSizeData,v=e.evaluateSizeForZoom(v,m.zoom),_=ge(x,1,c.transform.zoom),_=te(t.posMatrix,y,g,c.transform,_),b="none"!==u.layout.get("icon-text-fit")&&S.hasIconData(),v)&&(x=Math.pow(2,m.zoom-x.tileID.overscaledZ),w=c.style.map.terrain?(e,n)=>c.style.map.terrain.getElevation(t,e,n):null,function(t,n,r,i,o,a,s,l,c,u,d){var h=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,m={};p.clear();for(let A=0;A{var i,o=e.transform;let a,s;return s="map"===r.paint.get("circle-pitch-alignment")?(a=!0,[i=ge(n,1,o.zoom),i]):(a=!1,o.pixelsToGLUnits),{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,n,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:s}})(t,m,g,r),terrainData:x};if(l)for(const t of y.segments.get())f.push({segments:new e.SegmentVector([t]),sortKey:t.sortKey,state:S});else f.push({segments:y.segments,sortKey:0,state:S})}}l&&f.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of f){var{programConfiguration:C,program:E,layoutVertexBuffer:k,indexBuffer:I,uniformValues:T,terrainData:A}=e.state,P=e.segments;E.draw(c,u.TRIANGLES,d,h,p,gn.disabled,T,A,r.id,k,I,P,r.paint,t.transform.zoom,C)}}}}(t,n,r,i);break;case"heatmap":xn(t,n,r,i);break;case"line":!function(t,n,r,i){if("translucent"===t.renderPass){var o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1)){var s,l,c,u,d,h,p,f,g,y,v=t.depthModeForSublayer(0,fn.ReadOnly),_=t.colorModeForRenderPass(),b=r.paint.get("line-dasharray"),w=r.paint.get("line-pattern"),x=w.constantOr(1),S=r.paint.get("line-gradient"),C=r.getCrossfadeParameters(),E=x?"linePattern":b?"lineSDF":S?"lineGradient":"line",k=t.context,I=k.gl;let o=!0;for(const a of i){var T=n.getTile(a);if(!x||T.patternsLoaded()){var A=T.getBucket(r);if(A){var P,M,O=A.programConfigurations.get(r.id),R=t.context.program.get(),L=t.useProgram(E,O),N=(R=o||L.program!==R,t.style.map.terrain&&t.style.map.terrain.getTerrainData(a)),D=((D=w.constantOr(null))&&T.imageAtlas&&(P=(M=T.imageAtlas).patternPositions[D.to.toString()],M=M.patternPositions[D.from.toString()],P)&&M&&O.setConstantPatternPositions(P,M),N?a:null),F=x?(M=r,p=C,f=D,y=g=void 0,y=mt(P=T,g=(h=t).transform),{u_matrix:gt(h,P,M,f),u_texsize:P.imageAtlasTexture.size,u_ratio:1/ge(P,1,g.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[y,p.fromScale,p.toScale],u_fade:p.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}):b?(f=T,h=r,y=b,p=C,g=D,d=u=F=u=l=c=l=void 0,l=(s=t).transform,c=s.lineAtlas,l=mt(f,l),u="round"===h.layout.get("line-cap"),F=c.getDash(y.from,u),y=c.getDash(y.to,u),u=F.width*p.fromScale,d=y.width*p.toScale,e.extend(ft(s,f,h,g),{u_patternscale_a:[l/u,-F.height/2],u_patternscale_b:[l/d,-y.height/2],u_sdfgamma:c.width/(256*Math.min(u,d)*s.pixelRatio)/2,u_image:0,u_tex_y_a:F.y,u_tex_y_b:y.y,u_mix:p.t})):S?(l=t,c=T,u=r,d=A.lineClipsArray.length,s=D,e.extend(ft(l,c,u,s),{u_image:0,u_image_height:d})):ft(t,T,r,D);if(x)k.activeTexture.set(I.TEXTURE0),T.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),O.updatePaintBuffers(C);else if(b&&(R||t.lineAtlas.dirty))k.activeTexture.set(I.TEXTURE0),t.lineAtlas.bind(k);else if(S){let i=(D=A.gradients[r.id]).texture;if(r.gradientVersion!==D.version){let o=256;r.stepInterpolant&&(T=n.getSource().maxzoom,R=a.canonical.z===T?Math.ceil(1<Math.abs(t.tileID.overscaledZ-r))&&t.refreshedUponExpiration?1:e.clamp(o?s:1-a,0,1),t.refreshedUponExpiration&&1<=s&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-i}:{opacity:i,mix:0}):{opacity:1,mix:0}}(y,f,n,r,t.transform,t.style.map.terrain);let i,_;var g="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR,y=(o.activeTexture.set(a.TEXTURE0),y.texture.bind(g,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(a.TEXTURE1),f?(f.texture.bind(g,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i=Math.pow(2,f.tileID.overscaledZ-y.tileID.overscaledZ),_=[y.tileID.canonical.x*i%1,y.tileID.canonical.y*i%1]):y.texture.bind(g,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),g=(y=(f=t.style.map.terrain&&t.style.map.terrain.getTerrainData(v))?v:null)?y.posMatrix:t.transform.calculatePosMatrix(v.toUnwrapped(),h),yt(g,_||[0,0],i||1,m,r));s instanceof N?l.draw(o,a.TRIANGLES,p,mn.disabled,c,gn.disabled,y,f,r.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):l.draw(o,a.TRIANGLES,p,u[v.overscaledZ],c,gn.disabled,y,f,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}}(t,n,r,i);break;case"background":!function(e,t,n,r){var i=n.paint.get("background-color"),o=n.paint.get("background-opacity");if(0!==o){var a=e.context,s=a.gl,l=e.transform,c=l.tileSize,u=n.paint.get("background-pattern");if(!e.isPatternMissing(u)){var d=!u&&1===i.a&&1===o&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===d){var h=mn.disabled,p=e.depthModeForSublayer(0,"opaque"==d?fn.ReadWrite:fn.ReadOnly),f=e.colorModeForRenderPass(),m=e.useProgram(u?"backgroundPattern":"background"),g=(d=r||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain}),u&&(a.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context)),n.getCrossfadeParameters());for(const t of d){var y=r?t.posMatrix:e.transform.calculatePosMatrix(t.toUnwrapped()),v=(y=u?wt(y,o,e,u,{tileID:t,tileSize:c},g):{u_matrix:y,u_opacity:o,u_color:i},e.style.map.terrain&&e.style.map.terrain.getTerrainData(t));m.draw(a,s.TRIANGLES,p,h,f,gn.disabled,y,v,n.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}}(t,0,r,i);break;case"custom":!function(e,t,n){var r,i=e.context;n=n.implementation,"offscreen"===e.renderPass?(r=n.prerender)&&(e.setCustomLayerDefaults(),i.setColorMode(e.colorModeForRenderPass()),r.call(n,i.gl,e.transform.customLayerMatrix()),i.setDirty(),e.setBaseState()):"translucent"===e.renderPass&&(e.setCustomLayerDefaults(),i.setColorMode(e.colorModeForRenderPass()),i.setStencilMode(mn.disabled),r="3d"===n.renderingMode?new fn(e.context.gl.LEQUAL,fn.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,fn.ReadOnly),i.setDepthMode(r),n.render(i.gl,e.transform.customLayerMatrix()),i.setDirty(),e.setBaseState(),i.bindFramebuffer.set(null))}(t,0,r)}}translatePosMatrix(t,n,r,i,o){var a;return r[0]||r[1]?((i=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0)&&(a=Math.sin(i),i=Math.cos(i),r=[r[0]*i-r[1]*a,r[0]*a+r[1]*i]),a=[o?r[0]:ge(n,r[0],this.transform.zoom),o?r[1]:ge(n,r[1],this.transform.zoom),0],i=new Float32Array(16),e.translate(i,t,a),i):t}saveTileTexture(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){return(e=this._tileTextures[e])&&0{var o=1/(r=e.transformMat4([],r,t))[3]/n*i;return e.mul$1(r,r,[o,o,1/r[3],o])}));return r=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{var n=e.sub([],o[t[0]],o[t[1]]),r=e.sub([],o[t[2]],o[t[1]]);n=e.normalize([],e.cross([],n,r)),r=-e.dot(n,o[t[1]]);return n.concat(r)})),new Dn(o,r)}}class Fn{constructor(t,n){this.min=t,this.max=n,this.center=e.scale$1([],e.add([],this.min,this.max),.5)}quadrant(t){var n=[t%2==0,t<2],r=e.clone$2(this.min),i=e.clone$2(this.max);for(let e=0;ethis.max[e]-this.min[e])return 0}return 1}}class zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(t,n,r){return null!=n.top&&null!=t.top&&(this.top=e.interpolate.number(t.top,n.top,r)),null!=n.bottom&&null!=t.bottom&&(this.bottom=e.interpolate.number(t.bottom,n.bottom,r)),null!=n.left&&null!=t.left&&(this.left=e.interpolate.number(t.left,n.left,r)),null!=n.right&&null!=t.right&&(this.right=e.interpolate.number(t.right,n.right,r)),this}getCenter(t,n){return t=e.clamp((this.left+t-this.right)/2,0,t),n=e.clamp((this.top+n-this.bottom)/2,0,n),new e.Point(t,n)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new zn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Bn{constructor(t,n,r,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||!!o,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){var e=new Bn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this._minEleveationForCurrentTile=e._minEleveationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.Point(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){t=-e.wrap(t,-180,180)*Math.PI/180,this.angle!==t&&(this._unmodified=!1,this.angle=t,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){t=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI,this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){e=Math.min(Math.max(e,this.minZoom),this.maxZoom),this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){return e=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize)),Math.max(0,e)}getVisibleUnwrappedCoordinates(t){var n=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies){var r=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),o=this.pointCoordinate(new e.Point(this.width,this.height)),a=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),l=Math.floor(Math.max(r.x,i.x,o.x,a.x));for(let r=s-1;r<=l+1;r++)0!==r&&n.push(new e.UnwrappedTileID(r,t))}return n}coveringTiles(t){let n=this.coveringZoomLevel(t);var r=n;if(void 0!==t.minzoom&&nt.maxzoom&&(n=t.maxzoom);var i=this.pointCoordinate(this.getCameraPoint()),o=e.MercatorCoordinate.fromLngLat(this.center);const a=Math.pow(2,n);var s=[a*i.x,a*i.y,0],l=[a*o.x,a*o.y,0],c=Dn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n);let u=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(u=n);var d=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,h=e=>({aabb:new Fn([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),p=[],f=[],m=n,g=t.reparseOverscaled?r:n;if(this._renderWorldCopies)for(let e=1;e<=3;e++)p.push(h(-e)),p.push(h(e));for(p.push(h(0));0=u)x=m-y.zoom,w=s[0]-.5-(v<>1),I=y.zoom+1;let i=y.aabb.quadrant(r);t.terrain&&(C=new e.OverscaledTileID(I,y.wrap,I,E,k),S=null!=(S=(C=t.terrain.getMinMaxElevation(C)).minElevation)?S:this.elevation,C=null!=(C=C.maxElevation)?C:this.elevation,i=new Fn([i.min[0],i.min[1],S],[i.max[0],i.max[1],C])),p.push({aabb:i,zoom:I,x:E,y:k,wrap:y.wrap,fullyVisible:n})}}return f.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){var n=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(n)*this.worldSize)}unproject(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){var n,r,i,o,a=this.pointLocation(this.centerPoint,t);t=t.getElevationForLngLatZoom(a,this.tileZoom);this.elevation-t&&(r=this.getCameraPosition(),r=e.MercatorCoordinate.fromLngLat(r.lngLat,r.altitude),i=e.MercatorCoordinate.fromLngLat(a,t),o=r.x-i.x,n=r.y-i.y,r=r.z-i.z,i=Math.sqrt(o*o+n*n+r*r),o=this.scaleZoom(this.cameraToCenterDistance/i/this.tileSize),this._elevation=t,this._center=a,this.zoom=o)}setLocationAtPoint(t,n){n=this.pointCoordinate(n);var r=this.pointCoordinate(this.centerPoint);t=this.locationCoordinate(t),t=new e.MercatorCoordinate(t.x-(n.x-r.x),t.y-(n.y-r.y));this.center=this.coordinateLocation(t),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(t){return e.MercatorCoordinate.fromLngLat(t)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(t,n){if(n&&null!=(n=n.pointCoordinate(t)))return n;n=[t.x,t.y,0,1],t=[t.x,t.y,1,1];var r=(e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(t,t,this.pixelMatrixInverse),n[3]),i=t[3],o=n[1]/r,a=t[1]/i,s=n[2]/r,l=s==(l=t[2]/i)?0:(0-s)/(l-s);return new e.MercatorCoordinate(e.interpolate.number(n[0]/r,t[0]/i,l)/this.worldSize,e.interpolate.number(o,a,l)/this.worldSize)}coordinatePoint(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.pixelMatrix;return t=[t.x*this.worldSize,t.y*this.worldSize,n,1],e.transformMat4(t,t,r),new e.Point(t[0]/t[3],t[1]/t[3])}getBounds(){var t=Math.max(0,this.height/2-this.getHorizon());return(new T).extend(this.pointLocation(new e.Point(0,t))).extend(this.pointLocation(new e.Point(this.width,t))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new T([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var r,i,o,a=t.key,s=n?this._alignedPosMatrixCache:this._posMatrixCache;return s[a]||(r=t.canonical,i=this.worldSize/this.zoomScale(r.z),t=r.x+Math.pow(2,r.z)*t.wrap,o=e.identity(new Float64Array(16)),e.translate(o,o,[t*i,r.y*i,0]),e.scale(o,o,[i/e.EXTENT,i/e.EXTENT,1]),e.multiply(o,n?this.alignedProjMatrix:this.projMatrix,o),s[a]=new Float32Array(o)),s[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;let a,s,l,c,u=-90,d=90,h=-180,p=180;var t,n=this.size,r=this._unmodified,i=(this.latRange&&(i=this.latRange,u=e.mercatorYfromLat(i[1])*this.worldSize,d=e.mercatorYfromLat(i[0])*this.worldSize,a=d-ud)&&(c=d-t),void 0===(l=this.lngRange&&(o=(h+p)/2,(t=e.wrap(i.x,o-this.worldSize/2,o+this.worldSize/2))-(o=n.x/2)p)?p-o:l)&&void 0===c||(this.center=this.unproject(new e.Point(void 0!==l?l:i.x,void 0!==c?c:i.y)).wrap())),this._unmodified=r,this._constraining=!1}}_calcMatrices(){if(this.height){var t=this._fov/2,n=this.centerOffset,r=this.point.x,i=this.point.y;this.cameraToCenterDistance=.5/Math.tan(t)*this.height,this._pixelPerMeter=e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let l=e.identity(new Float64Array(16));e.scale(l,l,[this.width/2,-this.height/2,1]),e.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=e.identity(new Float64Array(16)),e.scale(l,l,[1,-1,1]),e.translate(l,l,[-1,-1,0]),e.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;var o=(t=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch))-(a=Math.min(this.elevation,this._minEleveationForCurrentTile))*this._pixelPerMeter/Math.cos(this._pitch),a=a<0?o:t,s=(o=Math.PI/2+this._pitch,t=this._fov*(.5+n.y/this.height),t=Math.sin(t)*a/Math.sin(e.clamp(Math.PI-o-t,.01,Math.PI-.01)),this.getHorizon());s=2*Math.atan(s/this.cameraToCenterDistance)*(.5+n.y/(2*s)),o=Math.sin(s)*a/Math.sin(e.clamp(Math.PI-o-s,.01,Math.PI-.01)),s=Math.min(t,o),t=1.01*(Math.cos(Math.PI/2-this._pitch)*s+a),o=this.height/50,s=(l=new Float64Array(16),e.perspective(l,this._fov,this.width/this.height,o,t),l[8]=2*-n.x/this.width,l[9]=2*n.y/this.height,e.scale(l,l,[1,-1,1]),e.translate(l,l,[0,0,-this.cameraToCenterDistance]),e.rotateX(l,l,this._pitch),e.rotateZ(l,l,this.angle),e.translate(l,l,[-r,-i,0]),this.mercatorMatrix=e.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),e.scale(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,l),e.translate(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=e.invert([],l),this.pixelMatrix3D=e.multiply(new Float64Array(16),this.labelPlaneMatrix,l),this.width%2/2),a=this.height%2/2,o=Math.cos(this.angle),t=Math.sin(this.angle),n=r-Math.round(r)+o*s+t*a,r=i-Math.round(i)+o*a+t*s,i=new Float64Array(l);if(e.translate(i,i,[.5{a=null,o&&(e.apply(r,i),a=setTimeout(s,t),o=!1)};return function(){for(var e=arguments.length,t=new Array(e),l=0;l{var e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")},this._onHashChange=()=>{var e,t=this._getCurrentHash();return 3<=t.length&&!t.some((e=>isNaN(e)))&&(e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing(),this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0)},this._updateHashUnthrottled=()=>{var e=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,e)}catch(e){}},this._updateHash=jn(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){var t=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=(r=Math.pow(10,r),Math.round(t.lng*r)/r),o=(t=Math.round(t.lat*r)/r,r=this._map.getBearing(),this._map.getPitch());let a="";if(a+=e?"/".concat(i,"/").concat(t,"/")+n:n+"/".concat(t,"/")+i,(r||o)&&(a+="/"+Math.round(10*r)/10),o&&(a+="/"+Math.round(o)),this._hashName){const t=this._hashName;let n=!1;return e=window.location.hash.slice(1).split("&").map((e=>{var r=e.split("=")[0];return r===t?(n=!0,r+"="+a):e})).filter((e=>e)),n||e.push(t+"="+a),"#"+e.join("&")}return"#"+a}}Ze={linearity:.3,easing:e.bezier(0,0,.3,1)};const qn=e.extend({deceleration:2500,maxSpeed:1400},Ze),Vn=e.extend({deceleration:20,maxSpeed:1400},Ze),Hn=e.extend({deceleration:1e3,maxSpeed:360},Ze),Gn=e.extend({deceleration:1e3,maxSpeed:90},Ze);class Wn{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:t})}_drainInertiaBuffer(){for(var t=this._inertiaBuffer,n=e.browser.now();03&&void 0!==arguments[3]?arguments[3]:{};var a=i.mousePos(n.getCanvasContainer(),r),s=n.unproject(a);super(t,e.extend({point:a,lngLat:s,originalEvent:r},o)),this._defaultPrevented=!1,this.target=n}}class Xn extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,r){var o="touchend"===t?r.changedTouches:r.touches,a=(o=i.touchPos(n.getCanvasContainer(),o)).map((e=>n.unproject(e))),s=o.reduce(((e,t,n,r)=>e.add(t.div(r.length))),new e.Point(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:n.unproject(s),originalEvent:r}),this._defaultPrevented=!1}}class Jn extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class Qn{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Jn(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Zn(e.type,this._map,e))}mouseup(e){this._map.fire(new Zn(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Zn(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Zn(e.type,this._map,e))}mouseover(e){this._map.fire(new Zn(e.type,this._map,e))}mouseout(e){this._map.fire(new Zn(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Xn(e.type,this._map,e))}touchmove(e){this._map.fire(new Xn(e.type,this._map,e))}touchend(e){this._map.fire(new Xn(e.type,this._map,e))}touchcancel(e){this._map.fire(new Xn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class $n{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Zn(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Zn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Zn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class er{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.Point.convert(t),this._map.terrain)}}class tr{constructor(e,t){this._map=e,this._tr=new er(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(i.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){var n,r,o;!this._active||this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)e.fitScreenCoordinates(r,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new e.Event(t,{originalEvent:n}))}}function nr(e,t){if(e.length!==t.length)throw new Error("The number of touches and points are not equal - touches ".concat(e.length,", points ")+t.length);var n={};for(let r=0;rthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){var n=new e.Point(0,0);for(const e of t)n._add(e);return n.div(t.length)}(n),this.touches=nr(r,n)))}touchmove(e,t,n){if(!this.aborted&&this.centroid){var r=nr(n,t);for(const e in this.touches){var i=this.touches[e],o=r[e];(!o||30this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom+1,around:o.unproject(r)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom-1,around:o.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ar{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(){for(var e=arguments.length,t=new Array(e),n=0;n{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=function(e){e.preventDefault()}},dr=e=>{let{enable:t,clickTolerance:n,bearingDegreesPerPixelMoved:r=.8}=e;var o=new lr({checkCorrectEvent:e=>0===i.mouseButton(e)&&e.ctrlKey||2===i.mouseButton(e)});return new ar({clickTolerance:n,move:(e,t)=>({bearingDelta:(t.x-e.x)*r}),moveStateManager:o,enable:t,assignEvents:ur})},hr=e=>{let{enable:t,clickTolerance:n,pitchDegreesPerPixelMoved:r=-.5}=e;var o=new lr({checkCorrectEvent:e=>0===i.mouseButton(e)&&e.ctrlKey||2===i.mouseButton(e)});return new ar({clickTolerance:n,move:(e,t)=>({pitchDelta:(t.y-e.y)*r}),moveStateManager:o,enable:t,assignEvents:ur})};class pr{constructor(e,t){this._minTouches=e.cooperativeGestures?2:1,this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.Point(0,0),setTimeout((()=>{this._cancelCooperativeMessage=!1}),200)}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._map._cooperativeGestures&&(2===this._minTouches&&n.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(e,!1,n.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(n.lengthMath.abs(e.x)}class wr extends fr{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){br((this._lastPoints=e)[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(!(this._map._cooperativeGestures&&this._currentTouchCount<3)){var r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}}}gestureBeginsVertically(e,t,n){var r,i;return void 0!==this._valid?this._valid:(i=2<=e.mag(),r=2<=t.mag(),i||r?i&&r?(i=0{var s=this._tr;a.easeTo({duration:300,easeId:"keyboardHandler",easing:Cr,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+n*this._bearingStep,pitch:s.pitch+r*this._pitchStep,offset:[-i*this._panStep,-o*this._panStep],center:s.center},{originalEvent:e})}}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Cr(e){return e*(2-e)}const Er=4.000244140625;class kr{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new er(e),this._el=e.getCanvasContainer(),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(this.isEnabled()){if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;var n=e.browser.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%Er==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":400Er?this._wheelZoomRate:this._defaultZoomRate;let e=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==e&&(e=1/e),n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale,this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*e))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}n="number"==typeof this._targetZoom?this._targetZoom:t.zoom;var r,i=this._startZoom,o=this._easing;let a,s=!1;return"wheel"===this._type&&i&&o?(r=o(o=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1)),a=e.interpolate.number(i,n,r),o<1?this._frameId||(this._frameId=!0):s=!0):(a=n,s=!0),this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}}_smoothOutEasing(t){let n=e.defaultEasing;var r,i;return this._prevEase&&(i=this._prevEase,r=(e.browser.now()-i.start)/i.duration,i=i.easing(.01+r)-i.easing(r),r=.27/Math.sqrt(i*i+1e-4)*.01,i=Math.sqrt(.0729-r*r),n=e.bezier(r,i,.25,1)),this._prevEase={start:e.browser.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ir{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Tr{constructor(e){this._tr=new er(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ar{constructor(){this._tap=new ir({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,n){var r,i,o;this._swipePoint||(this._tapTime?(r=t[0],i=e.timeStamp-this._tapTime<500,o=this._tapPoint.dist(r)<30,i&&o?0e.zoom||e.drag||e.pitch||e.rotate;class Lr extends e.Event{}function Nr(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Dr{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,e.type+"Window")},this.handleEvent=(e,t)=>{if("blur"===e.type)this.stop(!0);else{this._updatingCamera=!0;var n,r,o,a="renderFrame"===e.type?void 0:e,s={needsRenderFrame:!1},l={},c={},u=e.touches,d=u?this._getMapTouches(u):void 0,h=d?i.touchPos(this._el,d):i.mousePos(this._el,e);for({handlerName:n,handler:r,allowed:o}of this._handlers)if(r.isEnabled()){let i;this._blockedByActive(c,o,n)?r.reset():r[t||e.type]&&(i=r[t||e.type](e,h,d),this.mergeHandlerResult(s,l,i,n,a),i)&&i.needsRenderFrame&&this._triggerRenderFrame(),(i||r.isActive())&&(c[n]=r)}var p={};for(const e in this._previousActiveHandlers)c[e]||(p[e]=a);this._previousActiveHandlers=c,(Object.keys(p).length||Nr(s))&&(this._changes.push([s,l,p]),this._triggerRenderFrame()),(Object.keys(c).length||Nr(s))&&this._map._stop(!0),this._updatingCamera=!1,(u=s.cameraAnimation)&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Wn(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);var n,r,o;e=this._el;for([n,r,o]of(this._listeners=[[e,"touchstart",{passive:!0}],[e,"touchmove",{passive:!1}],[e,"touchend",void 0],[e,"touchcancel",void 0],[e,"mousedown",void 0],[e,"mousemove",void 0],[e,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[e,"mouseover",void 0],[e,"mouseout",void 0],[e,"dblclick",void 0],[e,"click",void 0],[e,"keydown",{capture:!1}],[e,"keyup",void 0],[e,"wheel",{passive:!1}],[e,"contextmenu",void 0],[window,"blur",void 0]],this._listeners))i.addEventListener(n,r,n===document?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(var[e,t,n]of this._listeners)i.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){var t=this._map,n=t.getCanvasContainer(),r=(this._add("mapEvent",new Qn(t,e)),t.boxZoom=new tr(t,e)),o=(r=(this._add("boxZoom",r),e.interactive&&e.boxZoom&&r.enable(),new or(t)),new Tr(t)),a=(r=(t.doubleClickZoom=new Ir(o,r),this._add("tapZoom",r),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable(),new Ar),o=(this._add("tapDragZoom",r),t.touchPitch=new wr(t)),o=(this._add("touchPitch",o),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch),dr(e)),hr(e));t.dragRotate=new Mr(e,o,a),this._add("mouseRotate",o,["mousePitch"]),this._add("mousePitch",a,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable(),o=(e=>{let{enable:t,clickTolerance:n}=e;var r=new lr({checkCorrectEvent:e=>0===i.mouseButton(e)&&!e.ctrlKey});return new ar({clickTolerance:n,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:r,enable:t,assignEvents:ur})})(e),a=new pr(e,t),t.dragPan=new Pr(n,o,a),this._add("mousePan",o),this._add("touchPan",a,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan),o=new _r,a=new yr,t.touchZoomRotate=new Or(n,a,o,r),this._add("touchRotate",o,["touchPan","touchZoom"]),this._add("touchZoom",a,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),n=t.scrollZoom=new kr(t,(()=>this._triggerRenderFrame())),this._add("scrollZoom",n,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom),r=t.keyboard=new Sr(t);this._add("keyboard",r),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new $n(t))}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(var{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(var{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Rr(this._eventsInProgress))||this.isZooming()}_blockedByActive(e,t,n){for(const r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1}_getMapTouches(e){var t=[];for(const r of e){var n=r.target;this._el.contains(n)&&t.push(r)}return t}mergeHandlerResult(t,n,r,i,o){r&&(e.extend(t,r),t={handlerName:i,originalEvent:r.originalEvent||o},void 0!==r.zoomDelta&&(n.zoom=t),void 0!==r.panDelta&&(n.drag=t),void 0!==r.pitchDelta&&(n.pitch=t),void 0!==r.bearingDelta)&&(n.rotate=t)}_applyChanges(){var t,n,r,i={},o={},a={};for([t,n,r]of this._changes)t.panDelta&&(i.panDelta=(i.panDelta||new e.Point(0,0))._add(t.panDelta)),t.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+t.zoomDelta),t.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+t.bearingDelta),t.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+t.pitchDelta),void 0!==t.around&&(i.around=t.around),void 0!==t.pinchAround&&(i.pinchAround=t.pinchAround),t.noInertia&&(i.noInertia=t.noInertia),e.extend(o,n),e.extend(a,r);this._updateMapTransform(i,o,a),this._changes=[]}_updateMapTransform(e,t,n){const r=this._map,i=r._getTransformForUpdate();var o=r.terrain;if(!(Nr(e)||o&&this._terrainMovement))return this._fireEvents(t,n,!0);let{panDelta:a,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:d}=e;void 0!==d&&(u=d),r._stop(!0),u=u||r.transform.centerPoint;var h=i.pointLocation(a?u.sub(a):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),o?this._terrainMovement||!t.drag&&!t.zoom?t.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(a)):i.setLocationAtPoint(h,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(h,u),this._map.once("moveend",(()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,i.recalculateZoom(r.terrain)}))):i.setLocationAtPoint(h,u),r._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_fireEvents(t,n,r){var i=Rr(this._eventsInProgress),o=Rr(t),a={};for(const e in t){var s=t[e].originalEvent;this._eventsInProgress[e]||(a[e+"start"]=s),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){var l=t[e].originalEvent;this._fireEvent(e,l)}var c={};let u;for(const e in this._eventsInProgress){var{handlerName:d,originalEvent:h}=this._eventsInProgress[e];this._handlersById[d].isActive()||(delete this._eventsInProgress[e],u=n[d]||h,c[e+"end"]=u)}for(const e in c)this._fireEvent(e,c[e]);var p=Rr(this._eventsInProgress);r&&(i||o)&&!p&&(this._updatingCamera=!0,r=e=>0!==e&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Lr("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Fr extends e.Evented{constructor(t,n){super(),this._renderFrameCallback=()=>{var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,n,r){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},n),r)}panTo(t,n,r){return this.easeTo(e.extend({center:t},n),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,n,r){return this.easeTo(e.extend({zoom:t},n),r)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,n,r){return this.easeTo(e.extend({bearing:t},n),r)}resetNorth(t,n){return this.rotateTo(0,e.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())3&&void 0!==arguments[3]?arguments[3]:0)}easeTo(t,n){this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.defaultEasing},t)).animate||!t.essential&&e.browser.prefersReducedMotion)&&(t.duration=0);const r=this._getTransformForUpdate(),i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,d=("padding"in t?t:r).padding,h=e.Point.convert(t.offset);let p=r.centerPoint.add(h);var f=r.pointLocation(p),m=e.LngLat.convert(t.center||f);this._normalizeCenter(m);const g=r.project(f),y=r.project(m).sub(g),v=r.zoomScale(l-i);let _,b;return t.around&&(_=e.LngLat.convert(t.around),b=r.locationPoint(_)),f={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching},this._zooming=this._zooming||l!==i,this._rotating=this._rotating||o!==c,this._pitching=this._pitching||u!==a,this._padding=!r.isPaddingEqual(d),this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,f),this.terrain&&this._prepareElevation(m),this._ease((f=>{var m,w;this._zooming&&(r.zoom=e.interpolate.number(i,l,f)),this._rotating&&(r.bearing=e.interpolate.number(o,c,f)),this._pitching&&(r.pitch=e.interpolate.number(a,u,f)),this._padding&&(r.interpolatePadding(s,d,f),p=r.centerPoint.add(h)),this.terrain&&!t.freezeElevation&&this._updateElevation(f),_?r.setLocationAtPoint(_,b):(m=r.zoomScale(r.zoom-i),w=l>i?Math.min(2,v):Math.max(.5,v),w=Math.pow(w,1-f),f=r.unproject(g.add(y.mult(f*w)).mult(m)),r.setLocationAtPoint(r.renderWorldCopies?f.wrap():f,p)),this._applyUpdatedTransform(r),this._fireMoveEvents(n)}),(e=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,e)}),t),this}_prepareEase(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,n||r.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.Event("pitchstart",t))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);var n,r,i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);t<1&&i!==this._elevationTarget&&(r=(i-((n=this._elevationTarget-this._elevationStart)*t+this._elevationStart))/(1-t),this._elevationStart+=t*(n-r),this._elevationTarget=i),this.transform.elevation=e.interpolate.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(e){var t,n,r,i,o;this.transformCameraUpdate&&(e=e.clone(),({center:t,zoom:n,pitch:r,bearing:i,elevation:o}=this.transformCameraUpdate(e)),t&&(e.center=t),void 0!==n&&(e.zoom=n),void 0!==r&&(e.pitch=r),void 0!==i&&(e.bearing=i),void 0!==o&&(e.elevation=o),this.transform.apply(e))}_fireMoveEvents(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}_afterEase(t,n){var r,i;this._easeId&&n&&this._easeId===n||(delete this._easeId,this.fire(new e.Event("freezeElevation",{freeze:!1})),n=this._zooming,r=this._rotating,i=this._pitching,this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),r&&this.fire(new e.Event("rotateend",t)),i&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t)))}flyTo(t,n){if(!t.essential&&e.browser.prefersReducedMotion)return h=e.pick(t,["center","zoom","bearing","pitch","around"]),this.jumpTo(h,n);this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.defaultEasing},t);const r=this._getTransformForUpdate(),i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.clamp(+t.zoom,r.minZoom,r.maxZoom):i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,d=("padding"in t?t:r).padding;var h=r.zoomScale(l-i);const p=e.Point.convert(t.offset);let f=r.centerPoint.add(p);var m=r.pointLocation(f);const g=e.LngLat.convert(t.center||m),y=(this._normalizeCenter(g),r.project(m)),v=r.project(g).sub(y);let _=t.curve;const b=Math.max(r.width,r.height),w=b/h,x=v.mag(),S=("minZoom"in t&&(m=e.clamp(Math.min(t.minZoom,i,l),r.minZoom,r.maxZoom),h=b/r.zoomScale(m-i),_=Math.sqrt(h/x*2)),_*_);function C(e){return e=(w*w-b*b+(e?-1:1)*S*S*x*x)/(2*(e?w:b)*S*x),Math.log(Math.sqrt(e*e+1)-e)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function k(e){return(Math.exp(e)+Math.exp(-e))/2}const I=C(!1);let T=function(e){return k(I)/k(I+_*e)},A=function(e){return b*((k(I)*(E(e=I+_*e)/k(e))-E(I))/S)/x},P=(C(!0)-I)/_;if(Math.abs(x)<1e-6||!isFinite(P)){if(Math.abs(b-w)<1e-6)return this.easeTo(t,n);const e=wt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=u!==a,this._padding=!r.isPaddingEqual(d),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(g),this._ease((h=>{var m=h*P,_=1/T(m);r.zoom=1===h?l:i+r.scaleZoom(_),this._rotating&&(r.bearing=e.interpolate.number(o,c,h)),this._pitching&&(r.pitch=e.interpolate.number(a,u,h)),this._padding&&(r.interpolatePadding(s,d,h),f=r.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(h),h=1===h?g:r.unproject(y.add(v.mult(A(m))).mult(_));r.setLocationAtPoint(r.renderWorldCopies?h.wrap():h,f),this._applyUpdatedTransform(r),this._fireMoveEvents(n)}),(()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var n;return this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd&&(n=this._onEaseEnd,delete this._onEaseEnd,n.call(this,t)),e||(n=this.handlers)&&n.stop(!1),this}_ease(t,n,r){!1===r.animate||0===r.duration?(t(1),n()):(this._easeStart=e.browser.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=e.wrap(t,-180,180);var r=Math.abs(t-n);return Math.abs(t-360-n)0&&void 0!==arguments[0]?arguments[0]:{};this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=e=>{!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options&&this.options.compact,this._container=i.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=i.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=i.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){t=this._map._getUIString("AttributionControl."+t),e.title=t,e.setAttribute("aria-label",t)}_updateAttributions(){if(this._map.style){let r=[];this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=r.concat(this.options.customAttribution.map((e=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&r.push(this.options.customAttribution)),this._map.style.stylesheet&&(n=this._map.style.stylesheet,this.styleOwner=n.owner,this.styleId=n.id);var e=this._map.style.sourceCaches;for(const n in e){var t=e[n];(t.used||t.usedForTerrain)&&(t=t.getSource()).attribution&&r.indexOf(t.attribution)<0&&r.push(t.attribution)}(r=r.filter((e=>String(e).trim()))).sort(((e,t)=>e.length-t.length));var n=(r=r.filter(((e,t)=>{for(let n=t+1;n0&&void 0!==arguments[0]?arguments[0]:{};this._updateCompact=()=>{var e=this._container.children;e.length&&(e=e[0],this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact"))},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._compact=this.options&&this.options.compact,this._container=i.create("div","maplibregl-ctrl"),(e=i.create("a","maplibregl-ctrl-logo")).target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){i.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class jr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){var t=this._currentlyRunning;for(const n of t?this._queue.concat(t):this._queue)if(n.id===e)return void(n.cancelled=!0)}run(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");var t=this._currentlyRunning=this._queue;this._queue=[];for(const n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Ur={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var qr=e.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class Vr extends e.Evented{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];var r={};for(const i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))r[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.ortho(i.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),this._tiles[i.key]=new q(i,this.tileSize));for(const e in this._tiles)r[e]||delete this._tiles[e]}freeRtt(e){for(const n in this._tiles){var t=this._tiles[n];(!e||t.tileID.equals(e)||t.tileID.isChildOf(e)||e.isChildOf(t.tileID))&&(t.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(t){var n={};for(const c of this._renderableTilesKeys){var r,i,o,a,s,l=this._tiles[c].tileID;l.canonical.equals(t.canonical)?((r=t.clone()).posMatrix=new Float64Array(16),e.ortho(r.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),n[c]=r):l.canonical.isChildOf(t.canonical)?((r=t.clone()).posMatrix=new Float64Array(16),a=l.canonical.z-t.canonical.z,i=l.canonical.x-(l.canonical.x>>a<>a<>a,e.ortho(r.posMatrix,0,a,0,a,0,1),e.translate(r.posMatrix,r.posMatrix,[-i*a,-o*a,0]),n[c]=r):t.canonical.isChildOf(l.canonical)&&((i=t.clone()).posMatrix=new Float64Array(16),o=t.canonical.z-l.canonical.z,a=t.canonical.x-(t.canonical.x>>o<>o<>o,e.ortho(i.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),e.translate(i.posMatrix,i.posMatrix,[a*s,l*s,0]),e.scale(i.posMatrix,i.posMatrix,[1/2**o,1/2**o,0]),n[c]=i)}return n}getSourceTile(e,t){var n=this.sourceCache._source;let r=e.overscaledZ-this.deltaZoom;if((r=r>n.maxzoom?n.maxzoom:r)=n.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(e.scaledTo(r--).key);return i}tilesAfterTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return Object.values(this._tiles).filter((t=>t.timeAdded>=e))}}class Hr{constructor(e,t,n){this.painter=e,this.sourceCache=new Vr(t),this.options=n,this.exaggeration="number"==typeof n.exaggeration?n.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.EXTENT;var o;return 0<=n&&n3&&void 0!==arguments[3]?arguments[3]:e.EXTENT;return this.getDEMElevation(t,n,r,i)*this.exaggeration}getTerrainData(t){this._emptyDemTexture||(r=this.painter.context,n=new e.RGBAImage({width:1,height:1},new Uint8Array(4)),this._emptyDepthTexture=new m(r,n,r.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new m(r,new e.RGBAImage({width:1,height:1}),r.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.identity([]));var n=this.sourceCache.getSourceTile(t,!0),r=(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)&&(r=this.painter.context,n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new m(r,n.dem.getPixels(),r.gl.RGBA,{premultiply:!1}),n.demTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1),n&&n+n.tileID.key+t.key);if(r&&!this._demMatrixCache[r]){var i=this.sourceCache.sourceCache._source.maxzoom;let r=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=i?r=t.canonical.z-i:e.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));i=t.canonical.x-(t.canonical.x>>r<>r<>8<<4|e>>8,n[i+3]=0;var r=new e.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer));return(r=new m(t,r,t.gl.RGBA,{premultiply:!1})).bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=r}pointCoordinate(t){var n,r,i=new Uint8Array(4),o=(r=this.painter.context).gl;r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,o.RGBA,o.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null),t=i[0]+(i[2]>>4<<8),o=i[1]+((15&i[2])<<8);return(i=(r=this.coordsIndex[255-i[3]])&&this.sourceCache.getTileByID(r))?(r=this._coordsTextureSize,n=(1<e.id!==t)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");var e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length!e.inUse))}}const Wr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Kr{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Gr(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((n=>!e._layers[n].isHidden(t))),this._coordsDescendingInv={};for(const a in e.sourceCaches){this._coordsDescendingInv[a]={};for(const t of e.sourceCaches[a].getVisibleCoordinates()){var n=this.terrain.sourceCache.getTerrainCoords(t);for(const e in n)this._coordsDescendingInv[a][e]||(this._coordsDescendingInv[a][e]=[]),this._coordsDescendingInv[a][e].push(n[e])}}this._coordsDescendingInvStr={};for(const a of e._order){var r=e._layers[a],i=r.source;if(Wr[r.type]&&!this._coordsDescendingInvStr[i]){this._coordsDescendingInvStr[i]={};for(const e in this._coordsDescendingInv[i])this._coordsDescendingInvStr[i][e]=this._coordsDescendingInv[i][e].map((e=>e.key)).sort().join()}}for(const a of this._renderableTiles)for(const e in this._coordsDescendingInvStr){var o=this._coordsDescendingInvStr[e][a.tileID.key];o&&o!==a.rttCoords[e]&&(a.rtt=[])}}renderLayer(t){if(!t.isHidden(this.painter.transform.zoom)){var n=t.type,r=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Wr[n]&&(this._prevType&&Wr[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(Wr[this._prevType]||Wr[n]&&i){this._prevType=n;var o=this._stacks.length-1,a=this._stacks[o]||[];for(const t of this._renderableTiles){if(this.pool.isFull()&&(Ln(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(t),t.rtt[o]){var s=this.pool.getObjectForId(t.rtt[o].id);if(s.stamp===t.rtt[o].stamp){this.pool.useObject(s);continue}}var l=this.pool.getOrCreateFreeObject();this.pool.useObject(l),this.pool.stampObject(l),t.rtt[o]={id:l.id,stamp:l.stamp},r.context.bindFramebuffer.set(l.fbo.framebuffer),r.context.clear({color:e.Color.transparent,stencil:0}),r.currentStencilSource=void 0;for(let e=0;en.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&85{this._onCooperativeGesture(e,e[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=n.interactive,this._cooperativeGestures=n.cooperativeGestures,this._metaKey=0===navigator.platform.indexOf("Mac")?"metaKey":"ctrlKey",this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=n.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=n.preserveDrawingBuffer,this._antialias=n.antialias,this._trackResize=n.trackResize,this._bearingSnap=n.bearingSnap,this._refreshExpiredTiles=n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=n.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=n.collectResourceTiming,this._renderTaskQueue=new jr,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ur,n.locale),this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this.transformCameraUpdate=n.transformCameraUpdate,this._imageQueueHandle=t.addThrottleControl((()=>this.isMoving())),this._requestManager=new d(n.transformRequest),"string"==typeof n.container){if(this._container=document.getElementById(n.container),!this._container)throw new Error("Container '".concat(n.container,"' not found."))}else{if(!(n.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=n.container}if(n.maxBounds&&this.setMaxBounds(n.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),this.once("idle",(()=>{this._idleTriggered=!0})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let e=!1;const t=jn((e=>{this._trackResize&&!this._removed&&this.resize(e)._update()}),50);this._resizeObserver=new ResizeObserver((n=>{e?t(n):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Dr(this,n),this._cooperativeGestures&&this._setupCooperativeGestures();var r="string"==typeof n.hash&&n.hash||void 0;this._hash=n.hash&&new Un(r).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,e.extend({},n.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new zr({customAttribution:n.customAttribution})),n.maplibreLogo&&this.addControl(new Br,n.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(t=>{this.fire(new e.Event(t.dataType+"dataloading",t))})),this.on("dataabort",(t=>{this.fire(new e.Event("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,n){var r;return void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),t&&t.onAdd?(r=t.onAdd(this),this._controls.push(t),t=this._controlPositions[n],-1!==n.indexOf("bottom")?t.insertBefore(r,t.firstChild):t.appendChild(r),this):this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")))}removeControl(t){var n;return t&&t.onRemove?(-1<(n=this._controls.indexOf(t))&&this._controls.splice(n,1),t.onRemove(this),this):this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")))}hasControl(e){return-1=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(0<=e&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(e){return this._cooperativeGestures=e,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(t){return this.transform.locationPoint(e.LngLat.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.Point.convert(t),this.terrain)}isMoving(){var e;return this._moving||(null==(e=this.handlers)?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null==(e=this.handlers)?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null==(e=this.handlers)?void 0:e.isRotating())}_createDelegatedListener(e,t,n){if("mouseenter"===e||"mouseover"===e){let r=!1;return{layer:t,listener:n,delegates:{mousemove:i=>{var o=this.getLayer(t)?this.queryRenderedFeatures(i.point,{layers:[t]}):[];o.length?r||(r=!0,n.call(this,new Zn(e,this,i.originalEvent,{features:o}))):r=!1},mouseout:()=>{r=!1}}}}if("mouseleave"!==e&&"mouseout"!==e)return{layer:t,listener:n,delegates:{[e]:e=>{var r=this.getLayer(t)?this.queryRenderedFeatures(e.point,{layers:[t]}):[];r.length&&(e.features=r,n.call(this,e),delete e.features)}}};{let r=!1;return{layer:t,listener:n,delegates:{mousemove:i=>{(this.getLayer(t)?this.queryRenderedFeatures(i.point,{layers:[t]}):[]).length?r=!0:r&&(r=!1,n.call(this,new Zn(e,this,i.originalEvent)))},mouseout:t=>{r&&(r=!1,n.call(this,new Zn(e,this,t.originalEvent)))}}}}}on(e,t,n){if(void 0===n)return super.on(e,t);var r=this._createDelegatedListener(e,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(r);for(const i in r.delegates)this.on(i,r.delegates[i]);return this}once(e,t,n){if(void 0===n)return super.once(e,t);var r=this._createDelegatedListener(e,t,n);for(const i in r.delegates)this.once(i,r.delegates[i]);return this}off(e,t,n){return void 0===n?super.off(e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&(r=>{var i=this._delegatedListeners[e];for(let e=0;ethis._updateStyle(e,t)))}_lazyInitEmptyStyle(){this.style||(this.style=new Ke(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){var i;"string"==typeof t?(i=this._requestManager.transformRequest(t,n.Style),e.getJSON(i,((t,n)=>{t?this.fire(new e.ErrorEvent(t)):n&&this._updateDiff(n,r)}))):"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,n){try{this.style.setState(t,n)&&this._update(!0)}catch(Ze){e.warnOnce("Unable to perform style diff: ".concat(Ze.message||Ze.error||Ze,". Rebuilding the style from scratch.")),this._updateStyle(t,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(t){var n=this.style&&this.style.sourceCaches[t];if(void 0!==n)return n.loaded();this.fire(new e.ErrorEvent(new Error("There is no source with ID '".concat(t,"'"))))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){var n=this.style.sourceCaches[t.source];if(!n)throw new Error("cannot load terrain, because there exists no source with ID: "+t.source);for(const n in this.style._layers){var r=this.style._layers[n];"hillshade"===r.type&&r.source===t.source&&e.warnOnce("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Hr(this.painter,n,t),this.painter.renderToTexture=new Kr(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.Event("terrain",{terrain:t})),this}getTerrain(){var e;return null!=(e=null==(e=this.terrain)?void 0:e.options)?e:null}areTilesLoaded(){var e=this.style&&this.style.sourceCaches;for(const r in e){var t=e[r]._tiles;for(const e in t){var n=t[e];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0}addSourceType(e,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,n)}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(t,n){var r=this;return function(i){var o,a,s,l,{pixelRatio:i=1,sdf:c=!1,stretchX:u,stretchY:d,content:h,contentMatch:p}=i;if(r._lazyInitEmptyStyle(),!(n instanceof HTMLImageElement||e.isImageBitmap(n)))return void 0===n.width||void 0===n.height?r.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):(({width:o,height:a,data:s}=n),l=n,r.style.addImage(t,{data:new e.RGBAImage({width:o,height:a},new Uint8Array(s)),pixelRatio:i,stretchX:u,stretchY:d,content:h,contentMatch:p,sdf:c,version:0,userImage:l}),l.onAdd&&l.onAdd(r,t),r);({width:o,height:a,data:s}=e.browser.getImageData(n)),r.style.addImage(t,{data:new e.RGBAImage({width:o,height:a},s),pixelRatio:i,stretchX:u,stretchY:d,content:h,contentMatch:p,sdf:c,version:0})}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}updateImage(t,n){var r,i,o,a=this.style.getImage(t);return a?(({width:o,height:r,data:i}=n instanceof HTMLImageElement||e.isImageBitmap(n)?e.browser.getImageData(n):n),void 0===o||void 0===r?this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):o!==a.data.width||r!==a.data.height?this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(o=!(n instanceof HTMLImageElement||e.isImageBitmap(n)),a.data.replace(i,o),this.style.updateImage(t,a),this)):this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")))}getImage(e){return this.style.getImage(e)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e,r){t.getImage(this._requestManager.transformRequest(e,n.Image),r)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(e,t,n,r),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(e,t,n,r),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,n,(e=>{e||this._update(!0)})),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,(e=>{e||this._update(!0)})),this}setLight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){var e=this._container,t=(e.classList.add("maplibregl-map"),this._canvasContainer=i.create("div","maplibregl-canvas-container",e)),n=(t=(this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=i.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region"),this._containerDimensions()),this._getClampedPixelRatio(t[0],t[1]));this._resizeCanvas(t[0],t[1],n);const r=this._controlContainer=i.create("div","maplibregl-control-container",e),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{o[e]=i.create("div","maplibregl-ctrl-".concat(e," "),r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){var e=this._container;this._cooperativeGesturesScreen=i.create("div","maplibregl-cooperative-gesture-screen",e);let t="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(t="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map"),e="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map",this._cooperativeGesturesScreen.innerHTML='\n
'.concat(t,'
\n
').concat(e,"
\n "),this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){i.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(e,t,n){this._canvas.width=Math.floor(n*e),this._canvas.height=Math.floor(n*t),this._canvas.style.width=e+"px",this._canvas.style.height=t+"px"}_setupPainter(){const e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(n=>{t={requestedAttributes:e},n&&(t.statusMessage=n.statusMessage,t.type=n.type)}),{once:!0});var n,r=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!r)throw n="Failed to initialize WebGL",t?(t.message=n,new Error(JSON.stringify(t))):new Error(n);this.painter=new Nn(r,this.transform),o.testSupport(r)}_onCooperativeGesture(e,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded&&(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(t){var n=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),!this._removed){let i=!1;this.style&&this._styleDirty&&(this._styleDirty=!1,t=this.transform.zoom,r=e.browser.now(),this.style.zoomHistory.update(t,r),1===(r=(t=new e.EvaluationParameters(t,{now:r,fadeDuration:n,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()})).crossFadingFactor())&&r===this._crossFadingFactor||(i=!0,this._crossFadingFactor=r),this.style.update(t)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,n,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:n,showPadding:this.showPadding}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.PerformanceUtils.mark(e.PerformanceMarkers.load),this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();var r=this._sourcesDirty||this._styleDirty||this._placementDirty;return r||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),!this._loaded||this._fullyLoaded||r||(this._fullyLoaded=!0,e.PerformanceUtils.mark(e.PerformanceMarkers.fullLoad)),this}}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),t.removeThrottleControl(this._imageQueueHandle),null!=(n=this._resizeObserver)&&n.disconnect();var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),i.remove(this._canvasContainer),i.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),e.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new e.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=e.browser.frame((t=>{e.PerformanceUtils.frame(t),this._frame=null,this._render(t)})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&((this._showCollisionBoxes=e)?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return Yr}getCameraTargetElevation(){return this.transform.elevation}};const Xr=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},Jr={showCompass:!0,showZoom:!0,visualizePitch:!1};class Qr{constructor(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mousedown=t=>{this.startMouse(e.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),i.mousePos(this.element,t)),i.addEventListener(window,"mousemove",this.mousemove),i.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.moveMouse(e,i.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=i.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),i.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),i.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=i.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;var o=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=dr({clickTolerance:o,enable:!0}),this.touchRotate=(e=>{let{enable:t,clickTolerance:n,bearingDegreesPerPixelMoved:r=.8}=e;var i=new cr;return new ar({clickTolerance:n,move:(e,t)=>({bearingDelta:(t.x-e.x)*r}),moveStateManager:i,enable:t,assignEvents:Xr})})({clickTolerance:o,enable:!0}),this.map=t,r&&(this.mousePitch=hr({clickTolerance:a,enable:!0}),this.touchPitch=(e=>{let{enable:t,clickTolerance:n,pitchDegreesPerPixelMoved:r=-.5}=e;var i=new cr;return new ar({clickTolerance:n,move:(e,t)=>({pitchDelta:(t.y-e.y)*r}),moveStateManager:i,enable:t,assignEvents:Xr})})({clickTolerance:a,enable:!0})),i.addEventListener(n,"mousedown",this.mousedown),i.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),i.addEventListener(n,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),i.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),i.disableDrag()}moveMouse(e,t){var n=this.map,r=(this.mouseRotate.dragMove(e,t)||{}).bearingDelta;r&&n.setBearing(n.getBearing()+r),this.mousePitch&&(r=(this.mousePitch.dragMove(e,t)||{}).pitchDelta)&&n.setPitch(n.getPitch()+r)}moveTouch(e,t){var n=this.map,r=(this.touchRotate.dragMove(e,t)||{}).bearingDelta;r&&n.setBearing(n.getBearing()+r),this.touchPitch&&(r=(this.touchPitch.dragMove(e,t)||{}).pitchDelta)&&n.setPitch(n.getPitch()+r)}off(){var e=this.element;i.removeEventListener(e,"mousedown",this.mousedown),i.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),i.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),i.removeEventListener(window,"touchend",this.touchend),i.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){i.enableDrag(),i.removeEventListener(window,"mousemove",this.mousemove),i.removeEventListener(window,"mouseup",this.mouseup),i.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),i.removeEventListener(window,"touchend",this.touchend)}}let $r;function ei(t,n,r){var i,o,a;for(t=new e.LngLat(t.lng,t.lat),n&&(i=new e.LngLat(t.lng-360,t.lat),o=new e.LngLat(t.lng+360,t.lat),a=r.locationPoint(t).distSqr(n),r.locationPoint(i).distSqr(n)r.center.lng?t.lng-=360:t.lng+=360}return t}const ti={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function ni(e,t,n){var r=e.classList;for(const i in ti)r.remove("maplibregl-".concat(n,"-anchor-")+i);r.add("maplibregl-".concat(n,"-anchor-")+t)}class ri extends e.Evented{constructor(t){if(super(),this._onKeyPress=e=>{var t=e.code;e=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==e&&13!==e||this.togglePopup()},this._onMapClick=e=>{e=e.originalEvent.target;var t=this._element;this._popup&&(e===t||t.contains(e))&&this.togglePopup()},this._update=e=>{if(this._map){var t=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==e?void 0:e.type)&&("render"!==(null==e?void 0:e.type)||t)||this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=ei(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let n="",r=("viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n="rotateZ(".concat(this._rotation,"deg)"):"map"===this._rotationAlignment&&(n="rotateZ(".concat(this._rotation-this._map.getBearing(),"deg)")),"");"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX(".concat(this._map.getPitch(),"deg)")),e&&"moveend"!==e.type||(this._pos=this._pos.round()),i.setTransform(this._element,"".concat(ti[this._anchor]," translate(").concat(this._pos.x,"px, ").concat(this._pos.y,"px) ").concat(r," ")+n),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout((()=>{var e=this._map.unproject(this._pos),t=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=e.distanceTo(this._lngLat)>20*t?"0.2":"1.0",this._opacityTimeout=null}),100))}},this._onMove=t=>{var n;this._isDragging||(n=this._clickTolerance||this._map._clickTolerance,this._isDragging=t.point.dist(this._pointerdownPos)>=n),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 e.Event("dragstart"))),this.fire(new e.Event("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=e.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=i.create("div"),this._element.setAttribute("aria-label","Map marker");var n,r=i.createNS("http://www.w3.org/2000/svg","svg"),o=((n=((n=(r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41"),i.createNS("http://www.w3.org/2000/svg","g"))).setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd"),i.createNS("http://www.w3.org/2000/svg","g"))).setAttributeNS(null,"fill-rule","nonzero"),i.createNS("http://www.w3.org/2000/svg","g")),a=(o.setAttributeNS(null,"transform","translate(3.0, 29.0)"),o.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}]);for(const e of a){var s=i.createNS("http://www.w3.org/2000/svg","ellipse");s.setAttributeNS(null,"opacity","0.04"),s.setAttributeNS(null,"cx","10.5"),s.setAttributeNS(null,"cy","5.80029008"),s.setAttributeNS(null,"rx",e.rx),s.setAttributeNS(null,"ry",e.ry),o.appendChild(s)}var l,c,u=((c=((c=((l=((l=((a=i.createNS("http://www.w3.org/2000/svg","g")).setAttributeNS(null,"fill",this._color),i.createNS("http://www.w3.org/2000/svg","path"))).setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),a.appendChild(l),i.createNS("http://www.w3.org/2000/svg","g"))).setAttributeNS(null,"opacity","0.25"),l.setAttributeNS(null,"fill","#000000"),i.createNS("http://www.w3.org/2000/svg","path"))).setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),l.appendChild(c),i.createNS("http://www.w3.org/2000/svg","g"))).setAttributeNS(null,"transform","translate(6.0, 7.0)"),c.setAttributeNS(null,"fill","#FFFFFF"),i.createNS("http://www.w3.org/2000/svg","g")),d=(u.setAttributeNS(null,"transform","translate(8.0, 8.0)"),i.createNS("http://www.w3.org/2000/svg","circle")),h=(d.setAttributeNS(null,"fill","#000000"),d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"cx","5.5"),d.setAttributeNS(null,"cy","5.5"),d.setAttributeNS(null,"r","5.4999962"),i.createNS("http://www.w3.org/2000/svg","circle"));h.setAttributeNS(null,"fill","#FFFFFF"),h.setAttributeNS(null,"cx","5.5"),h.setAttributeNS(null,"cy","5.5"),h.setAttributeNS(null,"r","5.4999962"),u.appendChild(d),u.appendChild(h),n.appendChild(o),n.appendChild(a),n.appendChild(l),n.appendChild(c),n.appendChild(u),r.appendChild(n),r.setAttributeNS(null,"height",41*this._scale+"px"),r.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(r),this._offset=e.Point.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),ni(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(e){return this.remove(),(this._map=e).getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),i.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){var t;return this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e&&("offset"in e.options||(t=Math.abs(13.5)/Math.SQRT2,e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-1*(24.6+t)],"bottom-right":[-t,-1*(24.6+t)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset),this._popup=e,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)),this}getPopup(){return this._popup}togglePopup(){var e=this._popup;return e&&(e.isOpen()?e.remove():e.addTo(this._map)),this}getOffset(){return this._offset}setOffset(t){return this._offset=e.Point.convert(t),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const ii={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let oi=0,ai=!1;class si extends e.Evented{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker();else{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("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error("Unexpected watchState "+this._watchState)}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("maplibregl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t))}this._finish()}},this._updateCamera=t=>{var n=new e.LngLat(t.coords.longitude,t.coords.latitude),r=(t=t.coords.accuracy,this._map.getBearing());r=e.extend({bearing:r},this.options.fitBoundsOptions),n=T.fromLngLat(n,t);this._map.fitBounds(n,r,{geolocateSource:!0})},this._updateMarker=t=>{var n;t?(n=new e.LngLat(t.coords.longitude,t.coords.latitude),this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()):(this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove())},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&ai)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=i.create("button","maplibregl-ctrl-geolocate",this._container),i.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),!(this._geolocateButton.type="button")===t?(e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled."),t=this._map._getUIString("GeolocateControl.LocationNotAvailable"),this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)):(t=this._map._getUIString("GeolocateControl.FindMyLocation"),this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ri({element:this._dotElement}),this._circleElement=i.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ri({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",(t=>{var n=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||n||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.Event("trackuserlocationend")))}))},this.options=e.extend({},ii,t)}onAdd(e){return this._map=e,this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];void 0===$r||t?void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((t=>{$r="denied"!==t.state,e($r)})).catch((()=>{$r=!!window.navigator.geolocation,e($r)})):($r=!!window.navigator.geolocation,e($r)):e($r)}(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,oi=0,ai=!1}_isOutOfMapMaxBounds(e){var t=this._map.getMaxBounds();e=e.coords;return t&&(e.longitudet.getEast()||e.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error("Unexpected watchState "+this._watchState)}}_updateCircleRadius(){var e=(t=this._map.getBounds()).getSouthEast(),t=t.getNorthEast();e=e.distanceTo(t),t=this._map._container.clientHeight,e=Math.ceil(this._accuracy/(e/t)*2);this._circleElement.style.width=e+"px",this._circleElement.style.height=e+"px"}trigger(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":oi--,ai=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break;default:throw new Error("Unexpected watchState "+this._watchState)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error("Unexpected watchState "+this._watchState)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),oi++,ai=10&&void 0!==arguments[0]?arguments[0]:{};super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){i.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){var e=this._fullscreenButton=i.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);i.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.Event("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new e.Event("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}}const hi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},pi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class fi extends e.Evented{constructor(t){super(),this.remove=()=>(this._content&&i.remove(this._content),this._container&&(i.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 e.Event("close")),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var t=this._lngLat||this._trackPointer;if(this._map&&t&&this._content){if(!this._container){if(this._container=i.create("div","maplibregl-popup",this._map.getContainer()),this._tip=i.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const e of this.options.className.split(" "))this._container.classList.add(e);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ei(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e){t=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);let o=this.options.anchor;if(e=mi(this.options.offset),!o){var n=this._container.offsetWidth,r=this._container.offsetHeight;let i;i=t.y+e.bottom.ythis._map.transform.height-r?["bottom"]:[],t.xthis._map.transform.width-n/2&&i.push("right"),o=0===i.length?"bottom":i.join("-")}r=t.add(e[o]).round(),i.setTransform(this._container,"".concat(ti[o]," translate(").concat(r.x,"px,").concat(r.y,"px)")),ni(this._container,o,"popup")}}},this._onClose=()=>{this.remove()},this.options=e.extend(Object.create(hi),t)}addTo(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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){var t,n=document.createDocumentFragment(),r=document.createElement("body");for(r.innerHTML=e;t=r.firstChild;)n.appendChild(t);return this.setDOMContent(n)}getMaxWidth(){var e;return null==(e=this._container)?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=i.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){this._container&&this._container.classList.add(e)}removeClassName(e){this._container&&this._container.classList.remove(e)}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}_createCloseButton(){this.options.closeButton&&(this._closeButton=i.create("button","maplibregl-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))}_focusFirstElement(){var e;this.options.focusAfterOpen&&this._container&&(e=this._container.querySelector(pi))&&e.focus()}}function mi(t){var n;return t?"number"==typeof t?(n=Math.round(Math.abs(t)/Math.SQRT2),{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(n,n),"top-right":new e.Point(-n,n),bottom:new e.Point(0,-t),"bottom-left":new e.Point(n,-n),"bottom-right":new e.Point(-n,-n),left:new e.Point(t,0),right:new e.Point(-t,0)}):t instanceof e.Point||Array.isArray(t)?{center:n=e.Point.convert(t),top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}:{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}:mi(new e.Point(0,0))}const gi=r;class yi{static get version(){return gi}static get workerCount(){return Z.workerCount}static set workerCount(e){Z.workerCount=e}static get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return e.config.WORKER_URL}static set workerUrl(t){e.config.WORKER_URL=t}static addProtocol(t,n){e.config.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete e.config.REGISTERED_PROTOCOLS[t]}}return yi.Map=Ze,yi.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{var e=(t=this._map.getZoom())===this._map.getMaxZoom(),t=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=t,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",t.toString())},this._rotateCompassArrow=()=>{var e=this.options.visualizePitch?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5),") rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(this._map.transform.angle*(180/Math.PI),"deg)"):"rotate(".concat(this._map.transform.angle*(180/Math.PI),"deg)");this._compassIcon.style.transform=e},this._setButtonTitle=(e,t)=>{t=this._map._getUIString("NavigationControl."+t),e.title=t,e.setAttribute("aria-label",t)},this.options=e.extend({},Jr,t),this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),i.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),i.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=i.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Qr(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){i.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){return(e=i.create("button",e,this._container)).type="button",e.addEventListener("click",t),e}},yi.GeolocateControl=si,yi.AttributionControl=zr,yi.LogoControl=Br,yi.ScaleControl=class{constructor(t){this._onMove=()=>{ci(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,ci(this._map,this._container,this.options)},this.options=e.extend({},li,t)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},yi.FullscreenControl=di,yi.TerrainControl=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=e}onAdd(e){return this._map=e,this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=i.create("button","maplibregl-ctrl-terrain",this._container),i.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){i.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},yi.Popup=fi,yi.Marker=ri,yi.Style=Ke,yi.LngLat=e.LngLat,yi.LngLatBounds=T,yi.Point=e.Point,yi.MercatorCoordinate=e.MercatorCoordinate,yi.Evented=e.Evented,yi.AJAXError=e.AJAXError,yi.config=e.config,yi.CanvasSource=F,yi.GeoJSONSource=R,yi.ImageSource=N,yi.RasterDEMTileSource=O,yi.RasterTileSource=M,yi.VectorTileSource=P,yi.VideoSource=D,yi.setRTLTextPlugin=e.setRTLTextPlugin,yi.getRTLTextPluginStatus=e.getRTLTextPluginStatus,yi.prewarm=function(){J().acquire(Y)},yi.clearPrewarmedResources=function(){var e=X;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Y),X=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},F=function(){function e(){}return e.prototype.merge=function(){for(var t,n,r,i=[],o=0;owindow.innerWidth?window.innerWidth-o.width:i.x;o=i.y+i.height+o.height+4>window.innerHeight?i.y-o.height-4:i.y+i.height+4;n&&t.parentElement&&(i=t.parentElement?t.parentElement.getBoundingClientRect():null,e.style.position="absolute",a-=i.x,o-=i.y),e.style.transform="translate(".concat(a,"px, ").concat(o,"px)"),e.style.display="block"}void 0===n&&(n=!1),t.addEventListener("mouseover",r),t.addEventListener("focusin",r),t.addEventListener("keydown",(function(t){"Escape"!==t.key&&"Esc"!==t.key||"block"!==e.style.display||(t.stopPropagation(),e.style.display="none")}))},W=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),K=(function(e){e.TopLeft="top-left",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomRight="bottom-right",e.NonFixed="non-fixed"}(o=o||{}),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.position=o.NonFixed,t}return W(t,e),t}(F)),Y=function(){function e(e){var t;e&&(t=void 0,3<=(t="string"==typeof e?this.getRBGA(e):e).length)&&(this.r=t[0],this.g=t[1],this.b=t[2],3$.activateClickDelay&&e.setCamera({bearing:t.DefaultRotation},!0)})),e.events.add("rotate",(function(e){i.style.transform="rotate(".concat(-e.map.getCamera().bearing,"deg)")})),r},t.prototype.constructRightRotationButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("rotation-right"),r.setAttribute("aria-label","Rotate Right"),r.setAttribute("alt","Rotate Right"),r.setAttribute("type","button"),r.addEventListener("click",(function(){e.setCamera({bearing:e.getCamera().bearing-(n.options.inverted?-1:1)*n.options.rotationDegreesDelta,duration:t.RotationDuration,type:"ease"},!0)})),r},t.prototype.constructLeftRotationButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("rotation-left"),r.setAttribute("aria-label","Rotate Left"),r.setAttribute("alt","Rotate Left"),r.setAttribute("type","button"),r.addEventListener("click",(function(){e.setCamera({bearing:e.getCamera().bearing+(n.options.inverted?-1:1)*n.options.rotationDegreesDelta,duration:t.RotationDuration,type:"ease"},!0)})),r},t.DefaultRotation=0,t.RotationDuration=100,t.InvertOrderPositions=[o.BottomRight,o.TopRight],t}($),ie=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pitchDegreesDelta=10,t.style=a.light,t.inverted=!1,t}return ie(t,e),t}(F),ae=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),se=function(e){function t(t){var n=e.call(this)||this;return n.container=null,n.map=null,n.pitchButton=null,n.pitchIncrementButton=null,n.pitchDecrementButton=null,n.hasMouse=!1,n.hasFocus=!1,n.pitchChanged=function(e){return n.updatePitchButtonsState()},n.updatePitchButtonsState=function(){var e=n.map.getCamera().pitch<=0,t=60<=n.map.getCamera().pitch;n.hasFocus&&n.pitchButton&&(e||t)&&n.pitchButton.focus(),n.options.inverted?(n.pitchIncrementButton&&n.pitchIncrementButton.disabled!=e&&(n.pitchIncrementButton.disabled=e),n.pitchDecrementButton&&n.pitchDecrementButton.disabled!=t&&(n.pitchDecrementButton.disabled=t)):(n.pitchIncrementButton&&n.pitchIncrementButton.disabled!=t&&(n.pitchIncrementButton.disabled=t),n.pitchDecrementButton&&n.pitchDecrementButton.disabled!=e&&(n.pitchDecrementButton.disabled=e))},n.options=(new oe).merge(t),n}return ae(t,e),t.prototype.onAdd=function(e,n){var r=this,i=this.buildContainer(e,this.options.style,"Pitch Control"),o=this.constructPitchButton(e),a=this.constructPitchGrid(e,n),s=H("Reset to Default Pitch");return i.addEventListener("mouseover",(function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasMouse=!0,i.classList.add("in-use"),a.classList.remove("hidden-accessible-element")})),i.addEventListener("focusin",(function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasFocus=!0,i.classList.add("in-use"),a.classList.remove("hidden-accessible-element")})),i.addEventListener("mouseleave",(function(){r.hasMouse=!1,r.hasFocus||(delete r.lastActiveTime,i.classList.remove("in-use"),a.classList.add("hidden-accessible-element"))})),i.addEventListener("focusout",(function(e){e.relatedTarget instanceof Node&&i.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse)||(delete r.lastActiveTime,i.classList.remove("in-use"),a.classList.add("hidden-accessible-element"))})),a.addEventListener("keydown",(function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),o.focus(),i.classList.remove("in-use"),a.classList.add("hidden-accessible-element"))})),o.addEventListener("keydown",(function(e){"Escape"!==e.key&&"Esc"!==e.key||null==i||!i.classList.contains("in-use")||"none"!==(null==s?void 0:s.style.display)||(e.stopPropagation(),i.classList.remove("in-use"),a.classList.add("hidden-accessible-element"))})),n&&t.INVERT_ORDER_POSITIONS.includes(n.position)?(i.appendChild(a),i.appendChild(o),i.appendChild(s),G(s,i)):(i.appendChild(o),i.appendChild(s),G(s,i),i.appendChild(a)),this.map=e,this.container=i,this.pitchButton=o,e.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),i},t.prototype.onRemove=function(){this.container&&(this.container.remove(),this.container=null,this.pitchButton=null,this.pitchIncrementButton=null,this.pitchDecrementButton=null),this.map&&(this.map.events.remove("pitch",this.pitchChanged),this.map=null)},t.prototype.constructPitchGrid=function(e,n){var r=document.createElement("div"),i=(e=(r.classList.add("sub-container"),r.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(e),this.pitchDecrementButton=this.constructPitchDecrementButton(e),H("Increase Pitch")),H("Decrease Pitch"));return n&&t.INVERT_ORDER_POSITIONS.includes(n.position)?(r.appendChild(this.pitchDecrementButton),r.appendChild(i),G(i,this.pitchDecrementButton),r.appendChild(this.pitchIncrementButton),r.appendChild(e),G(e,this.pitchIncrementButton)):(r.appendChild(this.pitchIncrementButton),r.appendChild(e),G(e,this.pitchIncrementButton),r.appendChild(this.pitchDecrementButton),r.appendChild(i),G(i,this.pitchDecrementButton)),r},t.prototype.constructPitchButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch"),r.setAttribute("aria-label","Reset to Default Pitch"),r.setAttribute("alt","Reset to Default Pitch"),r.setAttribute("type","button"),r.addEventListener("click",(function(){event.timeStamp-n.lastActiveTime>$.activateClickDelay&&e.setCamera({pitch:t.DEFAULT_PITCH},!0)})),r},t.prototype.constructPitchDecrementButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch-down"),r.setAttribute("aria-label","Decrease Pitch"),r.setAttribute("alt","Decrease Pitch"),r.setAttribute("type","button"),r.addEventListener("click",(function(){e.setCamera({pitch:e.getCamera().pitch-(n.options.inverted?-1:1)*n.options.pitchDegreesDelta,duration:t.PITCH_DURATION_MS,type:"ease"},!0)})),r},t.prototype.constructPitchIncrementButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch-up"),r.setAttribute("aria-label","Increase Pitch"),r.setAttribute("alt","Increase Pitch"),r.setAttribute("type","button"),r.addEventListener("click",(function(){e.setCamera({pitch:e.getCamera().pitch+(n.options.inverted?-1:1)*n.options.pitchDegreesDelta,duration:t.PITCH_DURATION_MS,type:"ease"},!0)})),r},t.PITCH_DURATION_MS=100,t.DEFAULT_PITCH=0,t.INVERT_ORDER_POSITIONS=[o.BottomRight,o.TopRight],t}($),le=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ce=function(e){function t(t){var n=e.call(this)||this;return n.map=null,n.control=new c.ScaleControl({maxWidth:null==t?void 0:t.maxWidth,unit:null==t?void 0:t.unit}),n}return le(t,e),t.prototype.onAdd=function(e,t){this.map=e,null!=(n=null==(n=this.map)?void 0:n._getMap())&&n.addControl(this.control);var n=this.buildContainer(e,a.auto,"Scale Bar");return n.appendChild(null==(e=this.control)?void 0:e._container),n},t.prototype.onRemove=function(){var t;e.prototype.onRemove.call(this),null!=(t=null==(t=this.map)?void 0:t._getMap())&&t.removeControl(this.control),this.map=null},t.prototype.setUnit=function(e){var t;null!=(t=this.control)&&t.setUnit(e)},t}($);var ue=function(){this.__data__=[],this.size=0};var de=function(e,t){return e===t||e!=e&&t!=t},he=de;var pe=function(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1},fe=pe,me=Array.prototype.splice;function ge(e){var t=this.__data__;return!((e=fe(t,e))<0||(e==t.length-1?t.pop():me.call(t,e,1),--this.size,0))}var ye=pe;function ve(e){var t=this.__data__;return(e=ye(t,e))<0?void 0:t[e][1]}var _e=pe;function be(e){return-1<_e(this.__data__,e)}var we=pe;function xe(e,t){var n=this.__data__,r=we(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Se=ue,Ce=ge,Ee=ve,ke=be,Ie=xe;function Te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ss=xs(bs),Cs=ds,Es=ms,ks=Ss;function Is(e,t){return ks(Es(e,t,Cs),e+"")}var Ts=de,As=Mr,Ps=$n,Ms=Qe;function Os(e,t,n){var r;return!!Ms(n)&&!!("number"==(r=typeof t)?As(n)&&Ps(t,n.length):"string"==r&&t in n)&&Ts(n[t],e)}var Rs=Is,Ls=Os;function Ns(e){return Rs((function(t,n){var r=-1,i=n.length,o=1i[0]&&c[1]=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},el=function(e){function t(){var t=e.call(this)||this;return t.table=["Fast",["green","yellow","red","dark-red"],"Slow"],t.map=null,t.syncHiddenState=null,t}return Qs(t,e),t.prototype.onAdd=function(e){this.map=e;var t=this.buildContainer(e,a.auto,"Traffic Legend");e=this.buildTrafficLegendDiv(e);return t.setAttribute("role","definition"),t.appendChild(e),t},t.prototype.onRemove=function(){e.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},t.prototype.buildTrafficLegendDiv=function(e){var t,n,r,i,o=document.createElement("div"),a=(o.classList.add("traffic-legend","hidden"),o.setAttribute("alt","Traffic Legend"),document.createElement("table")),s=document.createElement("tr"),l=document.createElement("td"),c=(l.setAttribute("alt","Traffic"),l.appendChild(document.createTextNode("Traffic")),H("Traffic")),u=(l.classList.add("traffic-legend-title"),l.colSpan=6,s.appendChild(l),s.appendChild(c),G(c,l),a.appendChild(s),document.createElement("tr"));try{for(var d=$s(this.table),h=d.next();!h.done;h=d.next()){var p=h.value,f=document.createElement("td");if("Fast"===p||"Slow"===p)f.setAttribute("alt",p),f.appendChild(document.createTextNode(p)),f.classList.add("traffic-legend-text");else{f.classList.add("traffic-legend-colors"),f.setAttribute("aria-label","Traffic Legend"),f.setAttribute("role","img");try{r=void 0;for(var m=$s(p),g=m.next();!g.done;g=m.next()){var y=g.value,v=document.createElement("div");v.classList.add(y),f.appendChild(v)}}catch(n){r={error:n}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}u.appendChild(f);var _=H(p instanceof Array?"Traffic Legend":p);u.appendChild(_),G(_,f)}}catch(n){t={error:n}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}return a.appendChild(u),o.appendChild(a),this.syncHiddenState=function(t){"style"===t.dataType&&((t=e.getTraffic()).flow&&"none"!==t.flow?o.classList.remove("hidden"):o.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),e.events.add("styledata",this.syncHiddenState),o},t}($);function tl(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}function nl(e){return this.__data__.has(e)}var rl=un,il=tl,ol=nl;function al(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new rl;++t=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ac=6378137,sc=Math.PI/180,lc=180/Math.PI,cc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],uc=85.0511;function dc(e){return e*sc}function hc(e){return e*lc}function pc(e,t,n){return Math.min(Math.max(e,t),n)}function fc(e,t){var n=dc(t[1]-e[1]),r=dc(t[0]-e[0]);n=Math.pow(Math.sin(n/2),2)+Math.cos(dc(e[1]))*Math.cos(dc(t[1]))*Math.pow(Math.sin(r/2),2),e=2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n));return Math.round(ac*e*100)/100}function mc(e){if(e)switch(e.toLowerCase()){case"feet":case"foot":case"ft":return Wl.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return Wl.kilometers;case"miles":case"mile":case"mi":return Wl.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return Wl.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return Wl.yards;default:return Wl.meters}return Wl.meters}function gc(e){if(e)switch(e.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return Zl.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return Zl.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return Zl.knotsPerSecond;case"standardgravity":case"g":return Zl.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return Zl.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return Zl.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return Zl.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return Zl.kilometersPerHourSecond;default:return Zl.metersPerSecondSquared}return Zl.metersPerSecondSquared}function yc(e){if(e)switch(e){case"acres":case"ac":return Gl.acres;case"hectares":case"ha":return Gl.hectares;case"squareFeet":case"ft^2":case"ft2":return Gl.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return Gl.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return Gl.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return Gl.squareMiles;default:return Gl.squareMeters}return Gl.squareMeters}function vc(e){if(e)switch(e.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return Yl.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return Yl.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return Yl.knots;case"mach":case"m":return Yl.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return Yl.kilometersPerHour;default:return Yl.metersPerSecond}return Yl.metersPerSecond}function _c(e){if(e)switch(e.toLowerCase()){case"milliseconds":case"ms":return Kl.ms;case"minutes":case"minute":case"mins":case"min":return Kl.minutes;case"hours":case"hour":case"hr":case"h":return Kl.hours;case"days":case"day":case"d":return Kl.days;default:return Kl.seconds}return Kl.seconds}function bc(e){var t=0;if(e&&0=a.length||(t=(n=ic(a[c],2))[0],n=n[1],i=(o=ic(a[c+1],2))[0],o=o[1],180=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},su=function(e){function t(n,r,i){var o,a,s=e.call(this)||this;return"Feature"===n.type?(a=_a((o=n).geometry),i=o.properties?_a(o.properties):{},r=null==o.id||""===o.id?$l():o.id):(a=_a(n),r=null==r||""===r?$l():r,i=i?_a(i):{}),i[t._shapeIdPropName]=r,s.data=new ec(a,i,r),s._handleCircle(),s}return ou(t,e),t.prototype.addProperty=function(e,t){Hl(this.data.properties[e],t)||(this.data.properties[e]=_a(t),"subType"!==e&&"radius"!==e||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},t.prototype.getBounds=function(){var e,t,n,r,i,o=this.getCoordinates(),a=this.getType();if("Point"===a)i=this.circlePolygon?(s=this.circlePolygon.geometry.coordinates,uu.fromPositions(s[0])):new uu(s=o,s);else if("MultiPoint"===a||"LineString"===a){var s=o;i=uu.fromPositions(s)}else if("Polygon"===a)s=o,i=uu.fromPositions(s[0]);else if("MultiLineString"===a){s=o;try{for(var l=au(s),c=l.next();!c.done;c=l.next()){var u=c.value;i=uu.merge(i,uu.fromPositions(u))}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}else if("MultiPolygon"===a){s=o;try{for(var d=au(s),h=d.next();!h.done;h=d.next()){var p=h.value;i=uu.merge(i,uu.fromPositions(p[0]))}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}return i},t.prototype.getCoordinates=function(){return _a(this.data.geometry.coordinates)},t.prototype.getCircleCoordinates=function(){return this.circlePolygon?_a(this.circlePolygon.geometry.coordinates[0]):null},t.prototype.getId=function(){return this.data.id},t.prototype.getProperties=function(){return _a(this.data.properties)},t.prototype.getType=function(){return this.data.geometry.type},t.prototype.isCircle=function(){return t._isCircle(this.data)},t.prototype.isRectangle=function(){return t._isRectangle(this.data)},t.prototype.setCoordinates=function(e){e="Polygon"===this.getType()&&1===ru._getDimensions(e)?[e]:e,Hl(this.data.geometry.coordinates,e)||(this.data.geometry.coordinates=_a(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},t.prototype.setProperties=function(e){e[t._shapeIdPropName]=this.data.id,Hl(this.data.properties,e)||(this.data.properties=_a(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},t.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},t.prototype._toJson=function(){return this.circlePolygon||this.data},t.prototype._setDataSource=function(e){void 0===e||null==e?delete this.dataSource:this.dataSource=e},t.prototype._handleCircle=function(){var e;this.isCircle()?(e=t._getCirclePositions(this.data),this.circlePolygon=new ec(new iu([e]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},t._isCircle=function(e){return e&&e.geometry&&"Point"===e.geometry.type&&e.geometry.coordinates&&e.properties&&"string"==typeof e.properties.subType&&"circle"===e.properties.subType.toLowerCase()&&"number"==typeof e.properties.radius},t._isRectangle=function(e){if("Polygon"===e.geometry.type&&e.geometry.coordinates&&"string"==typeof e.properties.subType&&"rectangle"===e.properties.subType.toLowerCase()&&1===(e=e.geometry.coordinates).length){if(5===(e=e[0]).length)return e[0][0]===e[4][0]&&e[0][1]===e[4][1];if(4===e.length)return!0}return!1},t._getCirclePositions=function(e){return Fc(e.geometry.coordinates,e.properties.radius,72,"meters")},t._shapeIdPropName="_azureMapsShapeId",t}(X),lu=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cu=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},uu=function(e){function t(t,n){var r,i=this;return t&&n?i=(r=t)[2]&&n[2]?e.call(this,r[0],r[1],r[2]||0,n[0],n[1],n[2]||0)||this:e.call(this,r[0],r[1],n[0],n[1])||this:t&&(r=t)&&(4===r.length?i=e.call(this,r[0],r[1],r[2],r[3])||this:6<=r.length&&(i=e.call(this,r[0],r[1],r[2],r[3],r[4],r[5])||this)),i}return lu(t,e),t.fromBoundingBox=function(e){var n=t.getWest(e),r=t.getSouth(e),i=t.getEast(e);e=t.getNorth(e);return new t([n,r,i,e])},t.fromDimensions=function(e,n,r){var i=e[0],o=(e=e[1],Math.min(Math.max(e+r/2,-85.5),85.5));e=Math.min(Math.max(e-r/2,-85.5),85.5),r=jc(i+n/2);return new t([jc(i-n/2),e,r,o])},t.fromEdges=function(e,n,r,i){return new t([e,n,r,i])},t.containsPosition=function(e,n){var r=t.getCenter(e),i=Math.abs(r[1]-n[1]);180<(r=Math.abs(r[0]-n[0]))&&(r=360-r),n=t.getHeight(e),e=t.getWidth(e);return i<=n/2+1e-8&&r<=e/2+1e-8},t.containsBoundingBox=function(e,n){var r=e&&4===e.length,i=n&&4===n.length;return!(!r||!i)&&t.getWest(e)=p[0]?h[1]=Math.max(h[1],p[1]):(d.push(h),h=p),s++}d.push(h);var f=d.length,m=d[0][0]+360-d[f-1][1],g=[d[f-1][1],d[0][0]];for(s=1;st&&(i.push(n),r=n);return r!==n&&i.push(n),i}(e,t),t)),e};var ku=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Iu=function(){function e(t,n){this.M=e._calculateAffineTransform(t,n),this.inverseM=e._calculateAffineTransform(n,t)}return e.prototype.toTarget=function(e,t){return this.transformArray(e,this.M,t)},e.prototype.toSource=function(e,t){return this.transformArray(e,this.inverseM,t)},e.prototype.transformArray=function(e,t,n){var r,i;if(e&&Array.isArray(e)&&Array.isArray(e[0])){var o=[];try{for(var a=ku(e),s=a.next();!s.done;s=a.next()){var l=s.value;o.push(this.transform(l,t,n))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}return null},e.prototype.transform=function(e,t,n){var r=e[0]*t[0][3]+e[1]*t[1][3]+t[2][3];e=e[0]*t[0][4]+e[1]*t[1][4]+t[2][4];return"number"==typeof n&&0<=n?[Ec(r,n),Ec(e,n)]:[Ec(r,6),Ec(e,6)]},e._calculateAffineTransform=function(e,t){if(e.length!==t.length||e.length<1)throw new Error("Error: source and target arrays must have the same length.");var n=Math.min(e[0].length,t[0].length),r=n+1;if(e.lengthMath.abs(e[o][i])&&(o=a);if(t=e[o],e[o]=e[i],e[i]=t,Math.abs(e[i][i])<=1e-12)return!1;for(var s=i+1;s=h.length||(s=(l=ic(h[p],2))[0],l=l[1],u=(d=ic(h[p+1],2))[0],d=d[1],180=this.map._getMap().getMaxZoom(),t=uu.getSouth(this.map.getCamera().bounds)<=-85.0511&&uu.getNorth(this.map.getCamera().bounds)>=uc;t=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||t;this.zoomInButton&&this.zoomInButton.disabled!=e&&(this.zoomInButton.disabled=e,this.zoomInButton.setAttribute("aria-label",e?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=t&&(this.zoomOutButton.disabled=t,this.zoomOutButton.setAttribute("aria-label",e?"Zoom Out disabled":"Zoom Out"))},t.prototype.constructZoomInButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("zoom-in"),r.setAttribute("aria-label","Zoom In"),r.setAttribute("alt","Zoom In"),r.setAttribute("type","button"),r.addEventListener("click",(function(){var r;e.setCamera({maxBounds:null==(r=e._getMap().getMaxBounds())?void 0:r.toArray().flat(),zoom:e.getCamera().zoom+n.options.zoomDelta,duration:t.ZOOM_DURATION_MS,type:"ease"},!0)})),r},t.prototype.constructZoomOutButton=function(e){var n=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("zoom-out"),r.setAttribute("aria-label","Zoom Out"),r.setAttribute("alt","Zoom Out"),r.setAttribute("type","button"),r.addEventListener("click",(function(){var r;e.setCamera({maxBounds:null==(r=e._getMap().getMaxBounds())?void 0:r.toArray().flat(),zoom:e.getCamera().zoom-n.options.zoomDelta,duration:t.ZOOM_DURATION_MS,type:"ease"},!0)})),r},t.ZOOM_DURATION_MS=200,t}($),Ru=Object.freeze({__proto__:null,CompassControl:re,ControlBase:$,PitchControl:se,ScaleControl:ce,StyleControl:Gs,TrafficControl:Js,TrafficLegendControl:el,ZoomControl:Ou}),Lu=ga;function Nu(e,t){return Lu(e,5,t="function"==typeof t?t:void 0)}var Du=i(Nu),Fu=function(){function e(t){var n=this;this.attach=function(e){n.map!==e&&(n.map&&n.detachFromCurrentMap(),n.map=e,n.map.indicators._getCollectionDiv().appendChild(n.element),n.map.indicators.add(n))},this.remove=function(){n.detachFromCurrentMap(),n.element.remove()},this.getElement=function(){return n.element},this.detachFromCurrentMap=function(){n.map&&(n.map.indicators.remove(n),delete n.map)},this.element=document.createElement("div"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("role","option"),null!=t&&t.setSize&&this.element.setAttribute("aria-setsize",t.setSize.toString()),null!=t&&t.positionInSet&&this.element.setAttribute("aria-posinset",t.positionInSet.toString()),this.element.setAttribute("aria-label","data point"),this.element.classList.add(e.Css.hidden)}return e.Css={hidden:"hidden-accessible-element"},e}(),zu=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buffer=128,t.maxZoom=18,t.cluster=!1,t.clusterRadius=50,t.clusterMaxZoom=void 0,t.clusterProperties=void 0,t.lineMetrics=!1,t.tolerance=.375,t.clusterMinPoints=2,t.generateId=!1,t.promoteId=void 0,t.filter=void 0,t}return zu(t,e),t}(F),ju=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uu=function(e){function t(t){var n=e.call(this)||this;return n.id=t||$l(),n}return ju(t,e),t.prototype.getId=function(){return this.id},t.prototype._setMap=function(e,t){var n;void 0===t&&(t=!0),null==e||void 0===e?(n=this.map,delete this.map,t&&(this._invokeEvent("sourceremoved",this),n)&&n.events.invoke("sourceremoved",this)):(this.map=e,t&&(this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this)))},t}(X),qu=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vu=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hu=function(e){function t(t,n){return(t=e.call(this,t)||this).requestId=void 0,t.options=(new Bu).merge(_a(n)),t.shapes=[],t.shapesMap=new Z,t}return qu(t,e),t.prototype.add=function(e,t){this._addNoUpdate(e,t),this._updateSource()},t.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},t.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},t.prototype.getClusterExpansionZoom=function(e){var t=this;return new Promise((function(n,r){var i;t.map?(i=t.map._getMap().getSource(t.getId()))&&"geojson"===i.type&&i.getClusterExpansionZoom(e,(function(e,t){e?r(e):"number"==typeof t&&n(t)})):r("The DataSource hasn't been added to a map.")}))},t.prototype.getClusterChildren=function(e){var t=this;return new Promise((function(n,r){var i;t.map?(i=t.map._getMap().getSource(t.getId()))&&"geojson"===i.type&&i.getClusterChildren(e,(function(e,i){e?r(e):i&&n(t.map.sources._mapFeaturesToShapes(i,!1,t))})):r("The DataSource hasn't been added to a map.")}))},t.prototype.getClusterLeaves=function(e,t,n){var r=this;return new Promise((function(i,o){var a;r.map?(a=r.map._getMap().getSource(r.getId()))&&"geojson"===a.type&&a.getClusterLeaves(e,t,n,(function(e,t){e?o(e):t&&i(r.map.sources._mapFeaturesToShapes(t,!1,r))})):o("The DataSource hasn't been added to a map.")}))},t.prototype.getOptions=function(){return _a(this.options)},t.prototype.getShapes=function(){return Array.from(this.shapes)},t.prototype.importDataFromUrl=function(e){var t=this;return fetch(e,{method:"GET",mode:"cors"}).then((function(e){if(e.ok)return e.json();throw new Error("HTTP ".concat(e.status,": ").concat(e.statusText))})).then((function(e){t.add(e)}))},t.prototype.getShapeById=function(e){return this.shapes[this.shapesMap.get(e)]||null},t.prototype.remove=function(e){var t,n;e=Array.isArray(e)?e:[e];try{for(var r=Vu(e),i=r.next();!i.done;i=r.next()){var o=i.value;"number"==typeof o?this._removeByIndex(o):this._removeById(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this._updateSource()},t.prototype.removeById=function(e){var t,n;e=Array.isArray(e)?e:[e];try{for(var r=Vu(e),i=r.next();!i.done;i=r.next()){var o=i.value;this._removeById(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this._updateSource()},t.prototype.setOptions=function(e){e=(new Bu).merge(this.options,_a(e)),Hl(this.options,e)||(this._invokeEvent("datasourceupdated",this),this.options=e,this.map&&this.map._rebuildStyle())},t.prototype.setShapes=function(e){this._clearNoUpdate(),this.add(e)},t.prototype.toJson=function(){return new du(this.shapes.map((function(e){return e.toJson()})))},t.prototype._toJson=function(){return new du(this.shapes.map((function(e){return e._toJson()})))},t.prototype._buildSource=function(){var e={type:"geojson",data:this._toJson(),maxzoom:this.options.maxZoom,cluster:this.options.cluster,clusterRadius:this.options.clusterRadius,tolerance:this.options.tolerance,lineMetrics:this.options.lineMetrics,clusterProperties:this.options.clusterProperties,buffer:this.options.buffer,clusterMinPoints:this.options.clusterMinPoints,generateId:this.options.generateId,promoteId:this.options.promoteId,filter:this.options.filter};return"number"==typeof this.options.clusterMaxZoom&&(e.clusterMaxZoom=this.options.clusterMaxZoom),e},t.prototype._isDeepEqual=function(e){var t;return this.constructor===e.constructor&&(t=this._buildSource(),e=e._buildSource(),t.type===e.type)&&t.maxzoom===e.maxzoom&&t.cluster===e.cluster&&t.clusterRadius===e.clusterRadius&&t.tolerance===e.tolerance&&t.lineMetrics===e.lineMetrics&&JSON.stringify(t.clusterProperties)===JSON.stringify(e.clusterProperties)&&t.buffer===e.buffer&&t.clusterMinPoints===e.clusterMinPoints&&t.generateId===e.generateId&&t.promoteId===e.promoteId&&t.filter===e.filter},t.prototype._addNoUpdate=function(e,t){var n;e instanceof su?(this._addToSources(e,t),n=[e]):Array.isArray(e)?(n=e.map((function(e){return e instanceof su?e:new su(e)})),this._addToSources(n,t)):"FeatureCollection"===e.type?(n=e.features.map((function(e){return new su(e)})),this._addToSources(n,t)):"GeometryCollection"===e.type?(n=e.geometries.map((function(e){return new su(e)})),this._addToSources(n,t)):(e=new su(e),this._addToSources(e,t),n=[e]),this._invokeEvent("dataadded",n)},t.prototype._clearNoUpdate=function(){var e=this.shapes;this.shapes=[],this.shapesMap=new Z,e&&0=this.shapes.length)throw new Error("The specified remove index '".concat(e,"' ")+"is greater than the maximum possible index '".concat(this.shapes.length-1,"'"));t=this.shapes[e],this.shapesMap.delete(t.getId()),t._setDataSource(null),this.shapes.splice(e,1),this._updateShapesMap(e),this._invokeEvent("dataremoved",[t])},t.prototype._updateShapesMap=function(e){for(var t=e;ti[0]&&c[1]=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hh=function(e){function t(t,n){return n=e.call(this,n)||this,t&&n.setOptions(t),n}return ch(t,e),t.prototype.getOptions=function(){return Du(this.options,lh._cloneCustomizer)},t.prototype.setOptions=function(e){if(e=(new lh).merge(this.options,Du(e,lh._cloneCustomizer)),this.map){if(!Hl(e.bounds,this.options.bounds)||e.isTMS!==this.options.isTMS||e.maxSourceZoom!==this.options.maxSourceZoom||e.minSourceZoom!==this.options.minSourceZoom||!Hl(e.subdomains,this.options.subdomains)||e.tileSize!==this.options.tileSize||e.tileUrl!==this.options.tileUrl)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("raster-contrast",e.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",e.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",e.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",e.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",e.saturation,this.options.saturation)}this.options=e},t.prototype._setOptionsNoUpdate=function(e){this.options=(new lh).merge(this.options,Du(e,lh._cloneCustomizer))},t.prototype._buildLayers=function(){return[uh(uh({id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-max":this.options.maxBrightness,"raster-brightness-min":this.options.minBrightness,"raster-opacity":this.options.opacity,"raster-saturation":this.options.saturation}},this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},t.prototype._getLayerIds=function(){return[this.id]},t.prototype._buildSource=function(){var e,t;if(this.options.tileUrl){if(-1===this.options.tileUrl.indexOf("{"))return{type:"raster",url:this.options.tileUrl};if(-1!==this.options.tileUrl.indexOf("{subdomain}")){if(!(this.options.subdomains&&0e},t}(hd),yh=Object.freeze({__proto__:null,BubbleLayer:xd,HeatMapLayer:kd,ImageLayer:Ld,Layer:hd,LineLayer:Bd,PolygonExtrusionLayer:Hd,PolygonLayer:Yd,SymbolLayer:rh,TileLayer:hh,WebGLLayer:gh}),vh=function(){function e(){}return e.convertHtmlString=function(e){var t;return"string"==typeof e?((t=document.createElement("div")).innerHTML=e,t):e},e.parseWithFilter=function(e,t,n,r){var i=this;if(void 0===t&&(t=function(e){return!0}),void 0===n&&(n=function(e){return e}),void 0===r&&(r=function(){return document.createElement("div")}),"string"==typeof e){if(0==(a=(new DOMParser).parseFromString(e,"text/html").body).children.length)return n(a.innerHTML);var o,a=1==a.children.length&&1==a.childNodes.length?a.children[0]:(o=r(),Array.from(a.childNodes).map((function(e){return o.append(e)})),o)}else a=e;return Array.from(a.children).forEach((function(e){return i.parseWithFilter(e,t,n)})),t(a)?n(a):(a.parentNode&&a.parentNode.removeChild(a),null)},e}(),_h=Fn,bh=Da;function wh(e){return _h(e)&&1===e.nodeType&&!bh(e)}var xh=i(wh),Sh=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ch=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.anchor="none",t.draggable=!1,t.closeButton=!0,t.content=document.createElement("span"),t.fillColor="#FFFFFF",t.pixelOffset=new nc(0,0),t.position=new ru(0,0),t.showPointer=!0,t}return Sh(t,e),t._cloneCustomizer=function(e){if(xh(e))return e},t}(F),Eh=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kh=window&&window.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0e.getCanvas().offsetHeight-o&&a.push("bottom"),ne.getCanvas().offsetWidth-i/2&&a.push("right"),0{text}'),t.pixelOffset=new nc(0,0),t.position=new ru(0,0),t.popup=void 0,t.secondaryColor="white",t.text=void 0,t.visible=!0,t}return Th(t,e),t._cloneCustomizer=function(e){if(e instanceof Ih||xh(e))return e},t}(F),Ph=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mh=function(e){function t(t){var n=e.call(this)||this;return n._onDrag=function(){var e=n.marker.getLngLat().wrap();n.options.position=new ru(e.lng,e.lat),n._invokeEvent("drag",{type:"drag",target:n})},n._onDragStart=function(){n._invokeEvent("dragstart",{type:"dragstart",target:n})},n._onDragEnd=function(){n._invokeEvent("dragend",{type:"dragend",target:n})},n._bubbleElementEvent=function(e){n._invokeEvent(e.type,{type:e.type,target:n})},n._onEleDragStart=function(e){e.preventDefault()},n.options=(new Ah).merge(Du(t,Ah._cloneCustomizer)),n._buildMarker(n.options),n}return Ph(t,e),t.prototype.getOptions=function(){return Du(this.options,Ah._cloneCustomizer)},t.prototype.getElement=function(){return this.marker.getElement()},t.prototype.setOptions=function(e){e=(new Ah).merge(this.options,Du(e,Ah._cloneCustomizer)),Hl(e.htmlContent,this.options.htmlContent)&&e.anchor===this.options.anchor?("string"!=typeof e.htmlContent||e.color===this.options.color&&e.text===this.options.text&&e.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(e)||""),e.draggable!==this.options.draggable&&(this._setDraggable(e.draggable),this.marker.setDraggable(e.draggable)),Hl(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset),Hl(e.position,this.options.position)||this.marker.setLngLat(e.position),e.visible!==this.options.visible&&(e.visible?this.element.classList.remove(t.hiddenClass):this.element.classList.add(t.hiddenClass))):(this.marker.remove(),this._buildMarker(e),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=e},t.prototype.togglePopup=function(){if(this.options.popup)if(this.options.popup.isOpen())this.options.popup.close();else{if(!this.map)throw new Error("The marker must be added to a map before calling togglePopup().");this.options.popup.setOptions({position:this.options.position}),this.options.popup.open(this.map)}},t.prototype._addToMap=function(e,t){this.map&&this.map!==e&&this._removeFromMap(),t&&(this.options.position=_a(t),this.marker.setLngLat(this.options.position)),this.map!==e&&(this.map=e,this.marker.addTo(e._getMap()),this._getCollectionContainer().appendChild(this.element))},t.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},t.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},t.prototype._buildMarker=function(e){var n;"string"==typeof e.htmlContent?(n=this._getSubbedHtmlString(e)||"",this.element=vh.convertHtmlString(n)):this.element=e.htmlContent,this.element.classList.add(t.containerClass),e.draggable&&this._setDraggable(!0),e.visible||this.element.classList.add(t.hiddenClass),this.marker=new c.Marker({element:this.element,offset:e.pixelOffset,draggable:e.draggable,anchor:e.anchor}).setLngLat(e.position),this.marker.on("drag",this._onDrag),this.marker.on("dragstart",this._onDragStart),this.marker.on("dragend",this._onDragEnd),this.element.addEventListener("click",this._bubbleElementEvent),this.element.addEventListener("dblclick",this._bubbleElementEvent),this.element.addEventListener("contextmenu",this._bubbleElementEvent),this.element.addEventListener("keydown",this._bubbleElementEvent),this.element.addEventListener("keypress",this._bubbleElementEvent),this.element.addEventListener("keyup",this._bubbleElementEvent),this.element.addEventListener("mousedown",this._bubbleElementEvent),this.element.addEventListener("mouseenter",this._bubbleElementEvent),this.element.addEventListener("mouseleave",this._bubbleElementEvent),this.element.addEventListener("mousemove",this._bubbleElementEvent),this.element.addEventListener("mouseout",this._bubbleElementEvent),this.element.addEventListener("mouseover",this._bubbleElementEvent),this.element.addEventListener("mouseup",this._bubbleElementEvent)},t.prototype._getSubbedHtmlString=function(e){return"string"==typeof e.htmlContent?e.htmlContent.replace(/{color}/gi,e.color||"").replace(/{secondaryColor}/gi,e.secondaryColor||"").replace(/{text}/gi,e.text||""):null},t.prototype._getCollectionContainer=function(){var e=this.map.getCanvasContainer().querySelector(".".concat(t.collectionContainerClass));return e||((e=document.createElement("div")).classList.add(t.collectionContainerClass),this.map.getCanvasContainer().appendChild(e)),e},t.prototype._setDraggable=function(e){e?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},t.collectionContainerClass="marker-collection-container",t.hiddenClass="hidden-accessible-element",t.containerClass="marker-container",t}(X),Oh=Rh;function Rh(e){return!function(e){return"undefined"!=typeof window&&"undefined"!=typeof document?Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,n=new Blob([""],{type:"text/javascript"});n=URL.createObjectURL(n);try{t=new Worker(n),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas"),t=(e.width=e.height=1,e.getContext("2d"));return!!t&&(t=t.getImageData(0,0,1,1))&&t.width===e.width}()?function(e){return void 0===Lh[e]&&(Lh[e]=function(e){var t;e=function(e){var t=document.createElement("canvas"),n=Object.create(Rh.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=e,t.getContext("webgl",n)||t.getContext("experimental-webgl",n)}(e);if(!e)return!1;try{t=e.createShader(e.VERTEX_SHADER)}catch(e){return!1}return!(!t||e.isContextLost())&&(e.shaderSource(t,"void main() {}"),e.compileShader(t),!0===e.getShaderParameter(t,e.COMPILE_STATUS))}(e)),Lh[e]}(e&&e.failIfMajorPerformanceCaveat)?document.documentMode?"insufficient ECMAScript 6 support":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":"not a browser"}(e)}var Lh={};Rh.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};var Nh,Dh,Fh=function(){function e(){}return e.parse=function(e){var t=(e=e.toLowerCase()).lastIndexOf("-");return-1!==t?{code:e,language:e.substring(0,t),region:e.substring(t+1)}:{code:e,language:e}},e}(),zh={localizationsPath:"locs/mapcontrol/2019-3-12",sensitiveUserRegions:["il","kr","pk","in","cn","ar","bh","eg","jo","sa","kw","om","qa","ma","ae"],locales:{defaultLanguage:{defaultRegion:{code:"NGT",strings:"en/resource.json"},latn:{code:"NGT-Latn",strings:"en/resource.json"}},ar:{defaultRegion:{code:"ar",strings:"ar-sa/resource.json"}},bg:{defaultRegion:{code:"bg-BG",strings:"bg-bg/resource.json"}},cs:{defaultRegion:{code:"cs-CZ",strings:"cs-cz/resource.json"}},da:{defaultRegion:{code:"da-DK",strings:"da-dk/resource.json"}},de:{defaultRegion:{code:"de-DE",strings:"de-de/resource.json"}},el:{defaultRegion:{code:"el-GR",strings:"el-gr/resource.json"}},en:{defaultRegion:{code:"en",strings:"en/resource.json"},us:{code:"en-US",strings:"en/resource.json"},au:{code:"en-AU",strings:"en/resource.json"},gb:{code:"en-GB",strings:"en/resource.json"},nz:{code:"en-NZ",strings:"en/resource.json"}},es:{defaultRegion:{code:"es-ES",strings:"es-es/resource.json"},mx:{code:"es-MX",strings:"es-mx/resource.json"}},fi:{defaultRegion:{code:"fi-FI",strings:"fi-fi/resource.json"}},fr:{defaultRegion:{code:"fr-FR",strings:"fr-fr/resource.json"}},hu:{defaultRegion:{code:"hu-HU",strings:"hu-hu/resource.json"}},id:{defaultRegion:{code:"id-ID",strings:"id-id/resource.json"}},it:{defaultRegion:{code:"it-IT",strings:"it-it/resource.json"}},ko:{defaultRegion:{code:"ko-KR",strings:"ko-kr/resource.json"}},lt:{defaultRegion:{code:"lt-LT",strings:"lt-lt/resource.json"}},ms:{defaultRegion:{code:"ms-MY",strings:"ms-my/resource.json"}},nb:{defaultRegion:{code:"nb-NO",strings:"nb-no/resource.json"}},nl:{defaultRegion:{code:"nl-NL",strings:"nl-nl/resource.json"}},pl:{defaultRegion:{code:"pl-PL",strings:"pl-pl/resource.json"}},pt:{defaultRegion:{code:"pt-PT",strings:"pt-pt/resource.json"},br:{code:"pt-BR",strings:"pt-br/resource.json"}},ru:{defaultRegion:{code:"ru-RU",strings:"ru-ru/resource.json"}},sk:{defaultRegion:{code:"sk-SK",strings:"sk-sk/resource.json"}},sl:{defaultRegion:{code:"sl-SL",strings:"sl-sl/resource.json"}},sv:{defaultRegion:{code:"sv-SE",strings:"sv-se/resource.json"}},th:{defaultRegion:{code:"th-TH",strings:"th-th/resource.json"}},tr:{defaultRegion:{code:"tr-TR",strings:"tr-tr/resource.json"}},zh:{defaultRegion:{code:"zh",strings:"en/resource.json"}},"zh-hans":{defaultRegion:{code:"zh-Hans",strings:"zh-cn/resource.json"},cn:{code:"zh-Hans-CN",strings:"zh-cn/resource.json"}},"zh-hant":{defaultRegion:{code:"zh-Hant",strings:"en/resource.json"},tw:{code:"zh-Hant-TW",strings:"zh-tw/resource.json"}}}},Bh=function(){this.Unknown="Unknown",this.Accident="Accident",this.Fog="Fog",this.Danger="Danger",this.Rain="Rain",this.Ice="Ice",this.Jam="Jam",this.LaneClosed="Lane Closed",this.RoadClosed="Road Closed",this.RoadWorks="Road Works",this.Wind="Wind",this.Flood="Flood",this.Detour="Detour"},jh=function(){function e(){}return e.getCode=function(e){var t=Fh.parse(e);return-1===zh.sensitiveUserRegions.indexOf(t.region)?this.getLocaleData(t).code:e},e.getStrings=function(e){return e=this.getLocaleData(e),zh.locales.defaultLanguage.defaultRegion.code===e.code?new Promise((function(e){e(new Bh)})):new U({domain:d,path:"".concat(zh.localizationsPath,"/").concat(e.strings)}).get().then((function(e){return e}),(function(){return new Bh}))},e.getLocaleData=function(e){if("string"==typeof e&&(e=Fh.parse(e)),zh.locales[e.code])return zh.locales[e.code].defaultRegion;var t;if(zh.locales[e.language])t=zh.locales[e.language];else{if(-1!==e.language.indexOf("-"))return this.getLocaleData(e.language);t=zh.locales.defaultLanguage}return e.region&&t[e.region]?t[e.region]:t.defaultRegion},e}(),Uh=function(){function e(){}return e.getEdgeOrIEVersion=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");return 0{text}',"marker-thick":'{text}',"marker-circle":'{text}',pin:'{text}',"pin-round":'{text}',"marker-flat":'{text}',"marker-arrow":'{text}',"marker-ball-pin":'{text}',"marker-square":'{text}',"marker-square-cluster":'+{text}',"marker-square-rounded":'{text}',"marker-square-rounded-cluster":'+{text}',flag:'{text}',"flag-triangle":'{text}',"rounded-square":'{text}',"rounded-square-thick":'{text}',triangle:'{text}',"triangle-thick":'{text}',hexagon:'{text}',"hexagon-thick":'{text}',"hexagon-rounded":'{text}',"hexagon-rounded-thick":'{text}',"triangle-arrow-up":'{text}',"triangle-arrow-left":'{text}',"arrow-up":'{text}',"arrow-up-thin":'{text}',car:'{text}',checker:'',"checker-rotated":'',"zig-zag":'',"zig-zag-vertical":'',"circles-spaced":'',circles:'',"diagonal-lines-up":'',"diagonal-lines-down":'',"diagonal-stripes-up":'',"diagonal-stripes-down":'',"grid-lines":'',"rotated-grid-lines":'',"rotated-grid-stripes":'',"x-fill":'',dots:''},$p=function(){function e(){}return e.getHighContrastMode=function(){return matchMedia("(-ms-high-contrast: white-on-black)").matches?"dark":matchMedia("(-ms-high-contrast: black-on-white)").matches?"light":matchMedia("(-ms-high-contrast: active)").matches?"dark":matchMedia("(inverted-colors: inverted)").matches?"invert":null},e}(),ef=void 0,tf=null,nf="boolean",rf="function",of="number",af="object",sf="prototype",lf="__proto__",cf="string",uf="undefined",df="constructor",hf="Symbol",pf="indexOf",ff="length",mf="done",gf="value",yf="name",vf="slice",_f="call",bf=Object,wf=bf[sf],xf=String,Sf=xf[sf],Cf=Math,Ef=Array,kf=Ef[sf];function If(e,t){try{t=e()}catch(e){}return t}var Tf=[cf,of,nf,uf,"symbol","bigint"];function Af(e){return function(t){return typeof t===e}}function Pf(e){var t="[object "+e+"]";return function(e){return!(!e||Mf(e)!==t)}}function Mf(e){return wf.toString[_f](e)}function Of(e){return typeof e===uf||e===uf}function Rf(e){return e===tf||Of(e)}function Lf(e){return!!e||e!==ef}var Nf=Af(cf),Df=Af(rf);function Ff(e){return!(!e&&Rf(e)||!e||typeof e!==af)}var zf=Ef.isArray,Bf=Pf("Date"),jf=Af(of),Uf=Af(nf),qf=Pf("Error");function Vf(e){return!!(e&&e.then&&Df(e.then))}function Hf(e){return!(!e||If((function(){return!(e&&0+e)}),!e))}var Gf=bf.getOwnPropertyDescriptor;function Wf(e,t){return e&&wf.hasOwnProperty[_f](e,t)}var Kf=bf.hasOwn||function(e,t){return Wf(e,t)||!!Gf(e,t)};function Yf(e,t,n){if(e&&Ff(e))for(var r in e)if(Kf(e,r)&&-1===t[_f](n||e,r,e[r]))break}function Zf(e,t,n,r){var i={};return Yf(e,(function(e,r){i[e]=t?r:e,i[r]=n?r:e})),r(i)}function Xf(e){throw new Error(e)}function Jf(e){throw new TypeError(e)}var Qf=bf.freeze;var $f=bf.assign;function em(e){return Ff(e)&&e!==tf||Jf("objKeys called on non-object"),bf.keys(e)}function tm(e){return Qf&&Yf(e,(function(e,t){(zf(t)||Ff(t))&&Qf(t)})),nm(e)}var nm=Qf||function(e){return e},rm=bf.getPrototypeOf||function(e){return e[lf]||tf};var im,om,am=function(e){return Zf(e,0,0,tm)}({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),sm=xf,lm="__tsUtils$gblCfg";function cm(){var e;return(e=(e=(e=typeof globalThis!==uf?globalThis:e)||typeof self===uf?e:self)||typeof window===uf?e:window)||typeof n.g===uf?e:n.g}function um(){var e;return im||(e=cm()||{},im=e[lm]=e[lm]||{}),im}function dm(e,t){var n="";if(qf(e))n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'";else try{n=JSON.stringify(e,tf,t?jf(t)?t:4:ef)}catch(e){n=" - "+dm(e,t)}return Mf(e)+": "+n}function hm(e,t){Jf("'"+sm(e)+"' not defined for "+dm(t))}function pm(e,t){om=om||kf[vf];var n=t&&t[e];return function(t){var r=t&&t[e]||n;if(r)return r.apply(t,om[_f](arguments,1));hm(e,t)}}function fm(e,t,n){om=om||kf[vf];var r=t&&t[e];return function(t){var i,o=t&&t[e]||r;if(o||n)return i=arguments,(o||n).apply(t,o?om[_f](i,1):i);hm(e,t)}}var mm=Cf.max,gm=pm(vf,Sf),ym=pm("substring",Sf),vm=fm("substr",Sf,(function(e,t,n){return Rf(e)&&Jf("'polyStrSubstr called with invalid "+dm(e)),n<0?"":((t=t||0)<0&&(t=mm(t+e[ff],0)),Of(n)?gm(e,t):gm(e,t,t+n))}));function _m(e,t){return ym(e,0,t)}var bm,wm,xm="_urid";function Sm(e){var t={description:sm(e),toString:function(){return hf+"("+e+")"},_polyfill:!0};return t}function Cm(e){var t,n,r=function(){var e;return bm||(e=um(),bm=e.gblSym=e.gblSym||{k:{},s:{}}),bm}();return Kf(r.k,e)||(t=Sm(e),n=em(r.s).length,t[xm]=function(){return n+"_"+t.toString()},r.k[e]=t,r.s[t[xm]()]=sm(e)),r.k[e]}var Em={e:"enumerable",c:"configurable",v:gf,w:"writable",g:"get",s:"set"};var km,Im=bf.defineProperty;function Tm(e,t,n){return Im(e,t,function(e){var t,n={};return n[Em.c]=!0,n[Em.e]=!0,e.l&&(n.get=function(){return e.l.v},t=Gf(e.l,"v"))&&t.set&&(n.set=function(t){e.l.v=t}),Yf(e,(function(e,t){n[Em[e]]=Of(t)?n[Em[e]]:t})),n}(n))}var Am=function(){km=um(),Am=tf};function Pm(e){var t={};return Am&&Am(),t.b=km.lzy,Im(t,"v",{configurable:!0,get:function(){var n=e();return km.lzy||(Im(t,"v",{value:n}),t.b&&delete t.b),km.lzy&&t.b!==km.lzy&&(t.b=km.lzy),n}}),t}function Mm(e,t){return Pm((function(){return If(e,t)}))}var Om,Rm,Lm,Nm,Dm,Fm,zm,Bm,jm,Um,qm="window";function Vm(e){return Mm((function(){return Gm(e)||ef}),ef)}function Hm(e){return(Om=!Om||!1===e||km&&km.lzy&&!Om.b?Mm(cm,tf):Om).v}function Gm(e,t){return(t=Om&&!1!==t?Om.v:Hm(t))&&t[e]?t[e]:e===qm&&Rm?Rm.v:tf}function Wm(){return!!Km()}function Km(){return(Lm=!Lm||km&&km.lzy&&!Lm.b?Vm("document"):Lm).v}function Ym(){return!!Zm()}function Zm(){return(Rm=!Rm||km&&km.lzy&&!Rm.b?Vm(qm):Rm).v}function Xm(){return(Nm=!Nm||km&&km.lzy&&!Nm.b?Vm("navigator"):Nm).v}function Jm(){return(Dm=!Dm||km&&km.lzy&&!Dm.b?Vm("history"):Dm).v}function Qm(){return(zm=zm||Mm((function(){return!(!process||!(process.versions||{}).node)}),!1)).v}function $m(){return(Fm=Fm||Mm((function(){return!!(self&&self instanceof WorkerGlobalScope)}),!1)).v}function eg(){return!!tg()}function tg(){var e=!Bm||km&&km.lzy&&!Bm.b;return e&&(Bm=Vm(hf)),jm&&!e||(jm=function(e){return Mm((function(){return Bm.v?Bm.v[e]:ef}),ef)}("for")),Bm.v}function ng(e,t){var n=am[e];return Bm&&(!km.lzy||Bm.b)||tg(),Bm.v?Bm.v[n||e]:t?ef:function(e){var t;return wm=wm||{},(e=am[e])?wm[e]=wm[e]||Sm(hf+"."+e):t}(e)}function rg(e,t){return Bm&&(!km.lzy||Bm.b)||tg(),Bm.v?Bm.v(e):t?tf:Sm(e)}function ig(e){return jm&&(!km.lzy||Bm.b)||tg(),(jm.v||Cm)(e)}function og(e){return!!e&&Df(e.next)}function ag(e){return!function(e){return e===tf||!Lf(e)}(e)&&Df(e[ng(3)])}var sg=function(e){return om=om||kf[vf],function(t){return t[e].apply(t,om[_f](arguments,1))}}("apply");function lg(e,t){return!Of(t)&&e&&(zf(t)?sg(e.push,e,t):og(t)||ag(t)?function(e,t,n){if(e&&(og(e)||(e=e[(Um=Um||Pm((function(){return ng(3)}))).v]?e[Um.v]():null),og(e))){var r=void 0,i=void 0;try{for(var o=0;!(i=e.next())[mf]&&-1!==t[_f](n||e,i[gf],o,e);)o++}catch(t){r={e:t},e.throw&&(i=null,e.throw(r))}finally{try{i&&!i[mf]&&e.return&&e.return(i)}finally{if(r)throw r.e}}}}(t,(function(t){e.push(t)})):e.push(t)),e}function cg(e,t,n){if(e)for(var r=e[ff]>>>0,i=0;i>>=0),pb=ub+e&cb,fb=db-e&cb,hb=!0}((Math.random()*lb^e)+e)}catch(e){}}function gb(e){var t=0,n=Gm("crypto")||Gm("msCrypto");return 0===(t=n&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&cb:t)&&nb()&&(hb||mb(),t=function(e){var t=((fb=36969*(65535&fb)+(fb>>16)&cb)<<16)+(65535&(pb=18e3*(65535&pb)+(pb>>16)&cb))>>>0&cb|0;return e||(t>>>=0),t}()&cb),0===t&&(t=Math.floor(lb*Math.random()|0)),e||(t>>>=0),t}function yb(e){void 0===e&&(e=22);for(var t=gb()>>>0,n=0,r=d_;r[ty]>>=6,5===n&&(t=(gb()<<2&4294967295|3&t)>>>0,n=0);return r}var vb="3.0.7",_b="."+yb(6),bb=0;function wb(e){return 1===e[Hy]||9===e[Hy]||!+e[Hy]}function xb(e,t){return O_(e+bb+++((t=void 0!==t&&t)?"."+vb:d_)+_b)}function Sb(e){var t={id:xb("_aiData-"+(e||d_)+"."+vb),accept:function(e){return wb(e)},get:function(e,n,r,i){var o=e[t.id];return o?o[O_(n)]:(i&&((o=function(e,t){var n=t[e.id];if(!n){n={};try{wb(t)&&Tm(t,e.id,{e:!1,v:n})}catch(e){}}return n}(t,e))[O_(n)]=r),r)},kill:function(e,t){if(e&&e[t])try{delete e[t]}catch(e){}}};return t}function Cb(e){return e&&Ff(e)&&(e.isVal||e.fb||Kf(e,"v")||Kf(e,"mrg")||Kf(e,"ref")||e.set)}function Eb(e,t,n){var r,i=n.dfVal||Lf;if(t&&n.fb){var o=n.fb;zf(o)||(o=[o]);for(var a=0;a ").concat(dm(e))})),new Xg(n,t||[])}("Watcher error(s): ",t)}}return(n={prop:n,ro:r,rf:i})[ey]=o,n[hy]=e,n.add=function(e){if(e&&0>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+(3&gb())|0];return vm(n,0,8)+vm(n,9,4)+"4"+vm(n,13,3)+i+vm(n,16,3)+vm(n,19,12)}var tx="00",nx="00000000000000000000000000000000",rx="0000000000000000";function ix(e,t,n){return!(!e||e[ty]!==t||e===n||!e.match(/^[\da-f]*$/i))}function ox(e,t,n){return ix(e,t)?e:n}function ax(e,t,n,r){var i={};return i[Py]=ix(r,2,"ff")?r:tx,i[$y]=sx(e)?e:ex(),i[ev]=lx(t)?t:_m(ex(),16),i.traceFlags=0<=n&&n<=255?n:1,i}function sx(e){return ix(e,32,nx)}function lx(e){return ix(e,16,rx)}function cx(e){var t,n;return e?(ix(t=function(e){for(var t=(e=isNaN(e)||e<0||255n)&&(r=ym(t,0,n),gw(e,2,61,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0)),r||t}function pC(e,t){return yC(e,t,2048,66)}function fC(e,t){var n;return t&&32768n&&(i=ym(t,0,n),gw(e,2,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t}function vC(e){return vm(e="00"+e,e[PS]-3)}var _C=Km()||{},bC=0,wC=[null,null,null,null,null];function xC(e){var t=bC,n=wC,r=n[t];return _C.createElement?n[t]||(r=n[t]=_C.createElement("a")):r={host:SC(e,!0)},r.href=e,++t>=n[PS]&&(t=0),bC=t,r}function SC(e,t){return(e=CC(e,t)||"")&&null!=(t=e.match(/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i))&&3>>0:0}(1e6)<=t.limit.samplingRate}catch(e){}return!1}(e))return;var s=p(e),l=b(e),c=m(s,n,l),d=!1,h=0,f=w(e);try{c&&!f?(h=Math.min(s.limit.maxSendNumber,l[FS]+1),d=!(l[FS]=0),a[e]=!0,l[zS]=new Date):(a[e]=c,l[FS]+=1);var y=g(e);v(r,y,l);for(var _=0;_",i[rC]=Ig(r),i[iC]="",i[lC]=0,(n=r.match(e.regex))&&5<=n[PS]&&(i[sC]=Ig(n[2])||i[sC],i[iC]=Ig(n[4]),i[lC]=parseInt(n[5])||0)):(i[aC]=t[aC],i[sC]=t[sC],i[rC]=t[rC],i[iC]=t[iC],i[lC]=t[lC],i[JS]=0),i.sizeInBytes+=i.method[PS],i.sizeInBytes+=i.fileName[PS],i.sizeInBytes+=i.assembly[PS],i[JS]+=e.baseSize,i.sizeInBytes+=i.level.toString()[PS],i.sizeInBytes+=i.line.toString()[PS]}return e.CreateFromInterface=function(t){return new e(t,null)},e.prototype.toInterface=function(){return{level:this[aC],method:this[sC],assembly:this[rC],fileName:this[iC],line:this[lC]}},e.regex=/^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}(),pE=function(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0},fE=function(){function e(e,t,n,r,i,o,a,s,l){this.aiDataContract={ver:1,metrics:1,properties:0},this.ver=2;var c=new pE;c[FS]=0=n[TI]?i||(gw(t,2,105,"Maximum in-memory buffer size reached: "+e[II](),!0),i=!0):r[AI](o)},e[II]=function(){return r[yI]},e.size=function(){for(var e=r[yI],t=0;tt[BI]&&(i[yI]=t[BI]),h(t[zI],[]),h(t[FI],i),e[kI]=function(i){e[II]()>=t[BI]?o||(gw(n,2,67,"Maximum buffer size reached: "+e[II](),!0),o=!0):(r[kI](i),h(t.BUFFER_KEY,e[EI]()))},e[MI]=function(){r[MI](),h(t.BUFFER_KEY,e[EI]()),h(t[zI],[]),o=!1},e[LI]=function(r){h(t[FI],e._set(u(r,e[EI]())));var i=d(t[zI]);i instanceof Array&&r instanceof Array&&((i=i.concat(r))[yI]>t[BI]&&(gw(n,1,67,"Sent buffer reached its maximum size: "+i[yI],!0),i[yI]=t[BI]),h(t[zI],i))},e[NI]=function(e){e=u(e,d(t[zI])),h(t[zI],e)},e[RI]=function(r,i,o){o=!!o;var a=e[EI]().slice(0),s=d(t[zI]).slice(0),l=(r=r||n,i=i||{},e[MI](),new(o?t:IT)(r,i));return cg(a,(function(e){l[kI](e)})),o&&l[LI](s),l}})),i}return hv(t,e),t.BUFFER_KEY="AI_buffer",t.SENT_BUFFER_KEY="AI_sentBuffer",t.MAX_BUFFER_SIZE=2e3,t}(kT),AT=function(){function e(t){Gv(e,this,(function(e){function n(e,o){var a="__aiCircularRefCheck",s={};if(e)if(e[a])gw(t,2,50,"Circular reference detected while serializing object",{name:o},!0);else if(e.aiDataContract)e[a]=!0,Yf(e.aiDataContract,(function(i,a){var l=Df(a)?1&a():1&a,c=Df(a)?4&a():4&a,u=(a=2&a,void 0!==e[i]),d=Ff(e[i])&&null!==e[i];!l||u||a?c||(l=void 0)!==(l=d?(a?r:n)(e[i],i):e[i])&&(s[i]=l):gw(t,1,24,"Missing required field specification. The field is required but not present on source",{field:i,name:o})})),delete e[a];else if("measurements"===o)s=i(e,"number",o);else if("properties"===o)s=i(e,"string",o);else if("tags"===o)s=i(e,"string",o);else if(zf(e))s=r(e,o);else{gw(t,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:o},!0);try{tb()[vI](e),s=e}catch(a){gw(t,1,48,a&&Df(a[xI])?a[xI]():"Error serializing object",null,!0)}}else gw(t,1,48,"cannot serialize object because it is null or undefined",{name:o},!0);return s}function r(e,r){if(e)if(zf(e))for(var i=[],o=0;of&&(u&&!u[CI]()||e[UI](!0,null,10))}function U(t,r,i,o,a,s){var l=null;e._appId||(l=X(s))&&l.appId&&(e._appId=l.appId),(t<200||300<=t)&&0!==t?(301!==t&&307!==t&&308!==t||q(i))&&!b&&ee(t)?(J(r),gw(e[qI](),2,40,". Response code "+t+". Will retry to send "+r[yI]+" items.")):e[iT](r,a):u&&!u[CI]()?b||(J(r,10),gw(e[qI](),2,40,". Offline - Response Code: ".concat(t,". Offline status: ").concat(!u.isOnline(),". Will retry to send ").concat(r.length," items."))):(q(i),206===t?(l=l||X(s))&&!b?e[oT](r,l):e[iT](r,a):(n=0,e[aT](r,o)))}function q(e){return!(10<=s||Rf(e)||""===e||e===h)&&(h=e,++s,1)}function V(e,t,n,r){try{e(t,n,r)}catch(e){}}function H(e,t){c?c(e,!1):W(z(e))}function G(t){var n=Xm(),r=h,i=e[XI][OI](t);i=new Blob([i],{type:"text/plain;charset=UTF-8"});return(n=n.sendBeacon(r,i))&&e._onSuccess(t,t[yI]),n}function W(t,n,r){var i=t&&t[lT];if(zf(i)&&0=n[sT]&&n.itemsReceived-n.itemsAccepted===n.errors[yI])return n}}catch(n){gw(e[qI](),1,43,"Cannot parse the response. "+N_(n),{response:t})}return null}function J(t,i){if(void 0===i&&(i=1),t&&0!==t[yI]){var o=e[XI];o[NI](t),n++;for(var a,s=0,l=t;si[sT]&&!b?e[oT](r,i):e[iT](r,re(t)):(n=0,e[aT](r,0))}})),O}return hv(t,e),t.constructEnvelope=function(e,t,n,r){return e=t===e.iKey||Rf(t)?e:uv(uv({},e),{iKey:t}),(DT[e.baseType]||xT)(n,e,r)},t}(Tx),zT="duration",BT="properties",jT="requestUrl",UT="inst",qT="length",VT="traceID",HT="spanID",GT="traceFlags",WT="context",KT="aborted",YT="traceId",ZT="spanId",XT="_addHook",JT="core",QT="includeCorrelationHeaders",$T="getAbsoluteUrl",eA="headers",tA="requestHeaders",nA="setRequestHeader",rA="trackDependencyDataInternal",iA="startTime",oA="toLowerCase",aA="enableRequestHeaderTracking",sA="enableAjaxErrorStatusText",lA="enableAjaxPerfTracking",cA="maxAjaxCallsPerView",uA="excludeRequestFromAutoTrackingPatterns",dA="addRequestContext",hA="disableAjaxTracking",pA="ajaxPerfLookupDelay",fA="disableFetchTracking",mA="enableResponseHeaderTracking",gA="status",yA="statusText",vA="headerMap",_A="openDone",bA="sendDone",wA="requestSentTime",xA="abortDone",SA="getTraceId",CA="getTraceFlags",EA="method",kA="errorStatusText",IA="stateChangeAttached",TA="responseText",AA="responseFinishedTime",PA="CreateTrackItem",MA="response",OA="getAllResponseHeaders",RA="getPartAProps",LA="perfMark",NA="name",DA="perfTiming",FA="exception",zA="ajaxDiagnosticsMessage",BA="correlationContext",jA="ajaxTotalDuration",UA="eventTraceCtx";function qA(e,t,n){var r=0;t=e[t],e=e[n];return t&&e?PC(t,e):r}function VA(e,t,n,r,i){var o=0;return(n=qA(n,r,i))?HA(e,t,mE(n)):o}function HA(e,t,n){var r=0;return e&&t&&n&&((e.ajaxPerf=e.ajaxPerf||{})[t]=n,r=1),r}var GA,WA=function(){this[_A]=!1,this.setRequestHeaderDone=!1,this[bA]=!1,this[xA]=!1,this[IA]=!1},KA=function(){function e(t,n,r,i){var o=this,a=r;o[LA]=null,o.completed=!1,o.requestHeadersSize=null,o[tA]=null,o.responseReceivingDuration=null,o.callbackDuration=null,o[jA]=null,o[KT]=0,o.pageUrl=null,o[jT]=null,o.requestSize=0,o[EA]=null,o[gA]=null,o[wA]=null,o.responseStartedTime=null,o[AA]=null,o.callbackFinishedTime=null,o.endTime=null,o.xhrMonitoringState=new WA,o.clientFailure=0,o[VT]=t,o[HT]=n,o[GT]=null==i?void 0:i.getTraceFlags(),o[UA]=i?((r={})[YT]=i[SA](),r[ZT]=i.getSpanId(),r[GT]=i[CA](),r):null,Gv(e,o,(function(e){e.getAbsoluteUrl=function(){return e[jT]?function(e){var t;return(e=xC(e))?e.href:t}(e[jT]):null},e.getPathName=function(){return e[jT]?pC(a,function(e,t){return e?e.toUpperCase()+" "+t:t}(e[EA],e[jT])):null},e[PA]=function(t,n,r){var i;return e.ajaxTotalDuration=Math.round(1e3*PC(e.requestSentTime,e.responseFinishedTime))/1e3,e[jA]<0?null:((i={id:"|"+e[VT]+"."+e[HT],target:e[$T]()})[NA]=e.getPathName(),i.type=t,i[iA]=null,i.duration=e[jA],i.success=200<=+e[gA]&&+e[gA]<400,i.responseCode=+e[gA],i[BT]={HttpMethod:e[EA]},i=(t=i)[BT],e[KT]&&(i[KT]=!0),e[wA]&&(t[iA]=new Date,t[iA].setTime(e[wA])),function(e,t){var n,r=e[DA],i=t[BT]||{},o=0,a="domainLookup",s="connect",l="request",c="response",u=s+"End",d=l+(d="Start"),h=c+"End",p="transferSize",f="encodedBodySize",m="decodedBodySize",g="serverTiming";r?(o=(o=(o=(o=(o=(o=(o|=VA(i,"End",r,"redirectStart","End"))|VA(i,a,r,"domainLookupStart","domainLookupEnd"))|VA(i,s,r,"connectStart",u))|VA(i,l,r,d,"requestEnd"))|VA(i,c,r,"responseStart",h))|VA(i,"networkConnect",r,"startTime",u))|VA(i,"sentRequest",r,d,h),a=(a=r[zT])||qA(r,"startTime",h)||0,o=(o|=HA(i,zT,a))|HA(i,"perfTotal",a),(s=r[g])&&(n={},cg(s,(function(e,t){t=O_(e.name||""+t);var r=n[t]||{};Yf(e,(function(e,t){!("name"!==e&&Nf(t)||jf(t))||!(t=r[e]?r[e]+";"+t:t)&&Nf(t)||(r[e]=t)})),n[t]=r})),o|=HA(i,g,n)),o=(o=(o|=HA(i,p,r[p]))|HA(i,f,r[f]))|HA(i,m,r[m])):e[LA]&&(o|=HA(i,"missing",e.perfAttempts)),o&&(t[BT]=i)}(e,t),n&&0=i[s].minZoom&&n<=i[s].maxZoom&&(o=Tc(i[s].position,t))<=i[s].radius&&o<=a&&(a=o,r=i[s]);return r},e.prototype._preloadCache=function(e){if(!this._preloadedCache.has(e)){this._preloadedCache.add(e);var t={source:[],labelType:"water",minZoom:0,radius:395e4,polygonSources:[]},n=e,r=n.indexOf("-");switch(n=-1!==r?n.substr(0,r):n){case"fr":this.cache("Oc\xe9an Pacifique",t,[-170,32],e),this.cache("Oc\xe9an Pacifique",t,[-138,-27],e),this.cache("Oc\xe9an Atlantique",t,[-40,32],e),this.cache("Oc\xe9an Atlantique",t,[-17,-29],e);break;case"es":this.cache("Oc\xe9an Pacifique",t,[-170,32],e),this.cache("Oc\xe9an Pacifique",t,[-138,-27],e),this.cache("Oc\xe9ano Atl\xe1ntico",t,[-40,32],e),this.cache("Oc\xe9ano Atl\xe1ntico",t,[-17,-29],e);break;case"pt":this.cache("Oceano Pac\xedfico",t,[-170,32],e),this.cache("Oceano Pac\xedfico",t,[-138,-27],e),this.cache("Oceano Atl\xe2ntico",t,[-40,32],e),this.cache("Oceano Atl\xe2ntico",t,[-17,-29],e);break;case"ja":this.cache("\u592a\u5e73\u6d0b",t,[-170,32],e),this.cache("\u592a\u5e73\u6d0b",t,[-138,-27],e);break;case"en":this.cache("Pacific Ocean",t,[-170,32],e),this.cache("Pacific Ocean",t,[-138,-27],e),this.cache("Atlantic Ocean",t,[-40,32],e),this.cache("Atlantic Ocean",t,[-17,-29],e),this.cache("Indian Ocean",t,[77,-26],e)}}},e}(),aO=window&&window.__awaiter||function(e,t,n,r){return new(n=n||Promise)((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},sO=window&&window.__generator||function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a={next:s(0),throw:s(1),return:s(2)};return"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var c=[s,l];if(n)throw new TypeError("Generator is already executing.");for(;o=a&&c[a=0]?0:o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,(c=i?[2&c[0],i.value]:c)[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]=r._headUpdateLimit?r._rotateTimeout=setTimeout(r._updateHeading,re.RotationDuration+25):r._rotateTimeout=setTimeout(r._updateHeading,r._headUpdateLimit-(Date.now()-r._lastHeadingTime)))},this._onMove=function(){r._moveTimeout&&(clearTimeout(r._moveTimeout),delete r._moveTimeout),r._controlTimeout&&(clearTimeout(r._controlTimeout),delete r._controlTimeout)},this._onMoveEnd=function(e){e.fromControl?r._controlTimeout=setTimeout(r._updateCam,r._controlEventDelay):r._updateCam()},this._onStyleData=function(){setTimeout(r._updateStyle)},this._onPointerDown=function(e){r._lastPointerPos=r._getEventPos(e),r._pointerTimeout=setTimeout((function(){return aO(r,void 0,void 0,(function(){var e,t,n;return sO(this,(function(r){switch(r.label){case 0:return t=this._map.getStyle(),e=t.language.toLowerCase(),t=t.style.toLowerCase(),(n=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(n,e,t)];case 1:return n=r.sent(),this._descCallback(n),this._onPointerUp(),[2]}}))}))}),r._pointerUpdateDelay),r._map.getCanvas().addEventListener("mousemove",r._onPointerMove),r._map.getCanvas().addEventListener("touchmove",r._onPointerMove),r._map.getCanvas().addEventListener("mouseup",r._onPointerUp),r._map.getCanvas().addEventListener("touchend",r._onPointerUp)},this._onPointerMove=function(e){e=r._getEventPos(e);var t=r._lastPointerPos[0]-e[0];e=r._lastPointerPos[1]-e[1];Math.sqrt(t*t+e*e)>r._moveThreshold&&r._onPointerUp()},this._onPointerUp=function(){clearTimeout(r._pointerTimeout),delete r._pointerTimeout,r._map.getCanvas().removeEventListener("mousemove",r._onPointerMove),r._map.getCanvas().removeEventListener("touchmove",r._onPointerMove),r._map.getCanvas().removeEventListener("mouseup",r._onPointerUp),r._map.getCanvas().removeEventListener("touchend",r._onPointerUp)},this._updateHeading=function(){var e,t=r._map.getCamera();r._lastHead&&!r._checkHeadingThreshold(t.bearing,r._lastHead)||(e=r._getHeadingDesc(t),r._lastHead=t.bearing,r._descCallback("

Map heading ".concat(e,".

")),r._lastHeadingTime=Date.now()),delete r._rotateTimeout},this._updateStyle=function(){return aO(r,void 0,void 0,(function(){var t,n,r,i;return sO(this,(function(o){switch(o.label){case 0:return t=this._map.getCamera(),r=this._map.getStyle(),n=r.language.toLowerCase(),r=r.style.toLowerCase(),this._lastLang===n?[3,2]:(e._labelCache._preloadCache(n),[4,this._getLocDesc(t,n,r)]);case 1:return i=o.sent(),[3,4];case 2:return this._lastStyle===r||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(t,n,r)];case 3:i=o.sent(),o.label=4;case 4:return this._lastLang=n,this._lastStyle=r,i&&this._descCallback(i),[2]}}))}))},this._updateCam=function(e){void 0===e&&(e=!1);var t,n,i,o=r._map.getCamera();(!r._lastCam||0Map ".concat(this._actionQueue.join(", then "),".

").concat(e)),this._actionQueue=[]):this._descCallback(e),[2]}}))}))}),e?0:r._camUpdateDelay))},this._map=t,this._restFallback=t.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=n,this._reverseSearch=new iO(t),e._labelCache||(e._labelCache=new oO),this._lastLang=this._map.getStyle().language.toLowerCase(),e._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",(function(){var t;r._disposed||(r._updateCam(!0),r._baseVectorTileSourceId=e._baseVectorTileSourceIds.find((function(e){return r._map.sources.getById(e)})),"bing-mvt"===r._baseVectorTileSourceId&&(r._labelConfig=e._labelConfigBing,r._roadLayers=e._roadLayersBing),r._polygonStyleLayer=r._labelConfig.reduce((function(e,t){return t.polygonSources&&e.push.apply(e,cO([],lO(t.polygonSources),!1)),e}),[]),(t=r._map._getMap()).on("move",r._onMove),t.on("moveend",r._onMoveEnd),t.on("styledata",r._onStyleData),t.on("rotate",r._onRotate),(t=r._map.getCanvas()).addEventListener("mousedown",r._onPointerDown),t.addEventListener("touchstart",r._onPointerDown))})),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}return e.prototype.dispose=function(){var e;this._disposed=!0,(e=((e=this._map._getMap()).off("move",this._onMove),e.off("moveend",this._onMoveEnd),e.off("styledata",this._onStyleData),e.off("rotate",this._onRotate),this._map.getCanvas())).removeEventListener("mousedown",this._onPointerDown),e.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},e.prototype._getEventPos=function(e){var t,n;return"touches"in e?(t=e.touches[0],n=e.target.getBoundingClientRect(),[t.pageX-n.left,t.pageY-n.top]):[e.offsetX,e.offsetY]},e.prototype._checkThresholds=function(e,t){return this._checkZoomThreshold(e.zoom,t.zoom)||this._checkPitchThreshold(e.pitch,t.pitch)||this._checkLocThreshold(e.center,t.center)||this._checkHeadingThreshold(e.bearing,t.bearing)},e.prototype._checkZoomThreshold=function(e,t){return this._round(e)!==this._round(t)},e.prototype._checkPitchThreshold=function(e,t){return Math.abs(e-t)>=this._pitchThreshold},e.prototype._checkLocThreshold=function(e,t){return e=(t=lO(this._map.positionsToPixels([t,e]),2))[0],t=t[1],nc.getDistance(e,t)>=this._moveThreshold},e.prototype._checkHeadingThreshold=function(e,t){return e<0&&(e+=360),t<0&&(t+=360),(e=180<(e=Math.abs(e-t))?360-e:e)>=this._headingThreshold},e.prototype._getLocDesc=function(t,n,r){return aO(this,void 0,void 0,(function(){var i,o,a,s,l,c,u,d,h,p=this;return sO(this,(function(f){switch(f.label){case 0:return"blank"===r?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise((function(e){return p._map._getMap().once("idle",e)}))];case 1:f.sent(),f.label=2;case 2:for(i={},o=this._map.positionsToPixels([t.center])[0],nO.tryCatch(this._map,(function(){var e=p._map._getMap();a=e.queryRenderedFeatures(o,{layers:p._polygonStyleLayer.filter((function(t){return e.getLayer(t)})),filter:["==",["geometry-type"],"Polygon"]})}),(function(){})),s=null,a&&0=d.minZoom?d.polygonSources?s&&-1!==d.polygonSources.indexOf(s.layer["source-layer"])?(l=d.labelType,this._getClosestLabel(d,t,n,i,!1)):this._getClosestLabel(d,t,n,i,!0):this._getClosestLabel(d,t,n,i,!1):this._getClosestLabel(d,t,n,i,!0);return 8<=t.zoom&&this._processRoads(i,t,n),this._labelCache.forEach((function(n){!i[n]&&(h=null,h="water"!==n&&"majorPoi"!==n||n===l?e._labelCache.getNearestLabel(n,t.center,t.zoom):h)&&(i[n]=h.name)})),[2,this._processLocInfo(t,l,i,!0,this._restFallback)];case 3:return[2,this._processLocInfo(t,null,null,!1,!1)]}}))}))},e.prototype._getHeadingDesc=function(e){var t=e.bearing;switch(t<0&&(t+=360),t=this._round(t,this._headingThreshold)){case 0:case 360:return"north";case 45:return"north east";case 90:return"east";case 135:return"south east";case 180:return"south";case 225:return"south west";case 270:return"west";case 315:return"north west";default:return"".concat(t," degrees")}},e.prototype._getClosestLabel=function(t,n,r,i,o){for(var a=t.radius,s=0,l=t.source.length;s=e.maxZoom&&r.push("Zoom In button disabled, maximum zoom level reached"),n=uu.getSouth(e.bounds)<=-85.0511&&uu.getNorth(e.bounds)>=uc,(e.zoom<=e.minZoom||n)&&r.push("Zoom Out button disabled, minimum zoom level reached"),t.push(r.join(" "))),this._checkPitchThreshold(e.pitch,this._lastCam.pitch)&&(n=this._round(e.pitch,this._pitchThreshold),t.push("pitched to ".concat(n," degrees")),60!==e.pitch&&0!==e.pitch||(r=60===e.pitch?"maximum":"minimum",t.push("reached ".concat(r," of ").concat(e.pitch," degrees")))),this._checkHeadingThreshold(this._lastCam.bearing,e.bearing)&&t.push("rotated to ".concat(this._getHeadingDesc(e))),t.join(" and "))||null},e.prototype._getCanonicalZoom=function(e){return(e=this._round(e))<2?"world":e<5?"country":e<11?"state province":e<15?"city":"street"},e.prototype._processLocInfo=function(e,t,n,r,i){var o=this;return new Promise((function(a,s){var l=[];if(r){var c=[];if(n&&(t&&("water"===t&&n.water?c.push(n.water):"majorPoi"===t&&n.majorPoi&&c.push(n.majorPoi)),0===c.length)&&(n.majorPoi&&8<=e.zoom?c.push(n.majorPoi):(n.poi&&14<=e.zoom?c.push(n.poi):n.road&&15<=e.zoom&&(n.secondRoad?c.push(n.road+" & "+n.secondRoad):c.push(n.road)),n.neighbourhood&&12<=e.zoom&&c.push(n.neighbourhood),n.city&&6<=e.zoom&&c.push(n.city)),n.state&&4<=e.zoom&&c.push(n.state),0===c.length?n.water?c.push(n.water):n.country&&c.push(n.country):1===c.length&&n.state&&4<=e.zoom&&n.country&&c.push(n.country)),0Location: ",c.join(", "),".

");else if(i&&"water"!==t)return void o._reverseGeocodeDescription(e).then((function(e){a(e)}),(function(){s("

Location: unknown

")}))}o._returnDetailedDescriptions&&(l.push("

Zoom: ",Ec(e.zoom,2),".

"),l.push("

Latitude: ",Ec(e.center[1],5),".

"),l.push("

Longitude: ",Ec(e.center[0],5),".

")),a(l.join(""))}))},e.prototype._reverseGeocodeDescription=function(t){var n=this;return new Promise((function(r){var i=n._map.getStyle();n._reverseSearch.request({position:t.center,style:i}).then((function(o){var a,s={};o&&o.features&&0Map style: ".concat(t.map.getStyle().style,".

")},this.updateMapState=function(e){t.atlasMapLiveStateInfo.innerHTML=e},this.map=e},hO=function(e){var t=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!t.map._isReady())throw new Error("Traffic flow could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before enabling traffic flow.");t.listenerEnabled||(t.map.events.add("styledata",t.addToMap),t.listenerEnabled=!0);var e,n=t.map.getTraffic();"none"!==n.flow&&(e=t.map.layers.getLayerById("traffic_".concat(n.flow)))&&(t.lastFlowMode=n.flow,e._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var e;t.map.getTraffic(),"none"!=t.lastFlowMode&&((e=t.map.layers.getLayerById("traffic_".concat(t.lastFlowMode)))&&e._updateLayoutProperty("visibility","none","visible"),t.lastFlowMode="none"),t.listenerEnabled&&(t.map.events.remove("styledata",t.addToMap),t.listenerEnabled=!1)},this.map=e},pO=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fO=function(e){function t(n,r,i){var o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=null!=(o=n.icon_category_12)?o:n.icon_category_11)?o:n.icon_category_10)?o:n.icon_category_9)?o:n.icon_category_8)?o:n.icon_category_7)?o:n.icon_category_6)?o:n.icon_category_5)?o:n.icon_category_4)?o:n.icon_category_3)?o:n.icon_category_2)?o:n.icon_category_1)?o:n.icon_category_0)?o:n.icon_category,a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=null!=(a=n.description_12)?a:n.description_11)?a:n.description_10)?a:n.description_9)?a:n.description_8)?a:n.description_7)?a:n.description_6)?a:n.description_5)?a:n.description_4)?a:n.description_3)?a:n.description_2)?a:n.description_1)?a:n.description_0)?a:n.description;o={icon:"".concat(t.getSeverityColorName(n.magnitude),"-").concat(t.getIncidentTypeIconName(o)),incidentType:t.getIncidentTypeName(o,i),description:a,delay:n.delay,color:t.getSeverityColorHexCode(n.magnitude),id:n.id};return e.call(this,r,o)||this}return pO(t,e),t.getIncidentTypeName=function(e,t){switch(e){case 0:default:return t.Unknown;case 1:return t.Accident;case 2:return t.Fog;case 3:return t.Danger;case 4:return t.Rain;case 5:return t.Ice;case 6:return t.Jam;case 7:return t.LaneClosed;case 8:return t.RoadClosed;case 9:return t.RoadWorks;case 10:return t.Wind;case 11:return t.Flood;case 12:return t.Detour}},t.getIncidentTypeIconName=function(e){switch(e){case 0:default:return"unknown";case 1:return"accident";case 2:return"fog";case 3:return"danger";case 4:return"rain";case 5:return"ice";case 6:return"jam";case 7:return"lane-closed";case 8:return"road-closed";case 9:return"road-work";case 10:return"wind";case 11:return"flood";case 12:return"detour"}},t.getSeverityColorName=function(e){switch(e){case 0:default:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red"}},t.getSeverityColorHexCode=function(e){switch(e){case 0:default:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E"}},t}(ec),mO=(function(e){e.DELAY="delay",e.LENGTH="length",e.FROM="from",e.TO="to"}(XM=XM||{}),function(){function e(){}return e.build=function(e,t){void 0===t&&(t="en-US");var n,r,i,o=((i=((r=document.createElement("div")).classList.add("incident-popup-title"),r.classList.add("font-segoeui-b"),r.innerText=e.properties.incidentType,r.setAttribute("aria-label","Incident Type ".concat(e.properties.incidentType)),document.createElement("div"))).classList.add("incident-popup-subtitle"),i.classList.add("font-segoeui-b"),i.setAttribute("aria-label","Incident Description ".concat(e.properties.description)),i.innerText=e.properties.description,document.createElement("div"));return(i=((r=(o.classList.add("incident-popup-header"),o.style.backgroundColor=e.properties.color,o.appendChild(r),o.appendChild(i),document.createElement("div"))).classList.add("incident-popup-body"),e.properties.delay&&(i="".concat(Math.floor(e.properties.delay/60)," min"),i=this.createInfoSection(i,XM.DELAY),r.appendChild(i)),e.properties.length&&(i=new Intl.NumberFormat([t,"en-US"],{maximumFractionDigits:2}),n=void 0,n="en-US"===t?(t=kc(e.properties.length,"meters","miles"),"".concat(i.format(t)," miles")):(t=kc(e.properties.length,"meters","kilometers"),"".concat(i.format(t)," km")),i=this.createInfoSection(n,XM.LENGTH),r.appendChild(i)),e.properties.from&&(t=this.createInfoSection(e.properties.from,XM.FROM),r.appendChild(t)),e.properties.to&&(n=this.createInfoSection(e.properties.to,XM.TO),r.appendChild(n)),document.createElement("div"))).classList.add("incident-popup-content"),i.appendChild(o),i.appendChild(r),new Ih({content:i,position:e.geometry.coordinates})},e.createInfoSection=function(e,t){var n=document.createElement("div"),r=(n.classList.add("incident-popup-info"),document.createElement("div")),i=(r.classList.add("icon"),r.classList.add(t),document.createElement("span"));return i.classList.add("message"),i.classList.add("font-segoeui"),i.setAttribute("aria-label","Incident ".concat(t," ").concat(e)),i.innerText=e,n.appendChild(r),n.appendChild(i),n},e}()),gO=window&&window.__awaiter||function(e,t,n,r){return new(n=n||Promise)((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},yO=window&&window.__generator||function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a={next:s(0),throw:s(1),return:s(2)};return"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var c=[s,l];if(n)throw new TypeError("Generator is already executing.");for(;o=a&&c[a=0]?0:o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,(c=i?[2&c[0],i.value]:c)[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]t?1:e0))break;if(null===t.right)break;if(n(e,t.right.key)>0){l=t.right;if(t.right=l.left,l.left=t,null===(t=l).right)break}o.right=t,o=t,t=t.right}}return o.right=t.left,a.left=t.right,t.left=i.right,t.right=i.left,t}function a(e,t,n,i){var a=new r(e,t);if(null===n)return a.left=a.right=null,a;var s=i(e,(n=o(e,n,i)).key);return s<0?(a.left=n.left,a.right=n,n.left=null):s>=0&&(a.right=n.right,a.left=n,n.right=null),a}function s(e,t,n){var r=null,i=null;if(t){var a=n((t=o(e,t,n)).key,e);0===a?(r=t.left,i=t.right):a<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function l(e,t,n,r,i){if(e){r(t+(n?"\u2514\u2500\u2500 ":"\u251c\u2500\u2500 ")+i(e)+"\n");var o=t+(n?" ":"\u2502 ");e.left&&l(e.left,o,!1,r,i),e.right&&l(e.right,o,!0,r,i)}}var c=function(){function e(e){void 0===e&&(e=i),this._root=null,this._size=0,this._comparator=e}return e.prototype.insert=function(e,t){return this._size++,this._root=a(e,t,this._root,this._comparator)},e.prototype.add=function(e,t){var n=new r(e,t);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,a=o(e,this._root,i),s=i(e,a.key);return 0===s?this._root=a:(s<0?(n.left=a.left,n.right=a,a.left=null):s>0&&(n.right=a.right,n.left=a,a.right=null),this._size++,this._root=n),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,n){var r;return null===t?null:0===n(e,(t=o(e,t,n)).key)?(null===t.left?r=t.right:(r=o(e,t.left,n)).right=t.right,this._size--,r):t},e.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=o(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},e.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},e.prototype.find=function(e){return this._root&&(this._root=o(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},e.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),e.call(t,n),n=n.right):i=!0;return this},e.prototype.range=function(e,t,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,t)>0)break;if(o(a.key,e)>=0&&n.call(r,a))return this;a=a.right}return this},e.prototype.keys=function(){var e=[];return this.forEach((function(t){var n=t.key;return e.push(n)})),e},e.prototype.values=function(){var e=[];return this.forEach((function(t){var n=t.data;return e.push(n)})),e},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},e.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},e.prototype.at=function(e){for(var t=this._root,n=!1,r=0,i=[];!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},e.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?(n=t,t=t.left):t=t.right}return n},e.prototype.prev=function(e){var t=this._root,n=null;if(null!==e.left){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?t=t.left:(n=t,t=t.right)}return n},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return function(e){var t=e,n=[],i=!1,o=new r(null,null),a=o;for(;!i;)t?(n.push(t),t=t.left):n.length>0?t=(t=a=a.next=n.pop()).right:i=!0;return a.next=null,o.next}(this._root)},e.prototype.load=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1);var i=e.length,o=this._comparator;if(n&&h(e,t,0,i-1,o),null===this._root)this._root=u(e,t,0,i),this._size=i;else{var a=function(e,t,n){var i=new r(null,null),o=i,a=e,s=t;for(;null!==a&&null!==s;)n(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;null!==a?o.next=a:null!==s&&(o.next=s);return i.next}(this.toList(),function(e,t){for(var n=new r(null,null),i=n,o=0;o0){var a=n+Math.floor(o/2),s=e[a],l=t[a],c=new r(s,l);return c.left=u(e,t,n,a),c.right=u(e,t,a+1,i),c}return null}function d(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2),o=d(e,t,i),a=e.head;return a.left=o,e.head=e.head.next,a.right=d(e,i+1,n),a}return null}function h(e,t,n,r,i){if(!(n>=r)){for(var o=e[n+r>>1],a=n-1,s=r+1;;){do{a++}while(i(e[a],o)<0);do{s--}while(i(e[s],o)>0);if(a>=s)break;var l=e[a];e[a]=e[s],e[s]=l,l=t[a],t[a]=t[s],t[s]=l}h(e,t,n,s,i),h(e,t,s+1,r,i)}}var p=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},f=function(e,t){if(t.ur.xt.x?1:e.yt.y?1:0}}]),n(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var t=e.point.events,n=0,r=t.length;n=0&&l>=0?ac?-1:0:o<0&&l<0?ac?1:0:lo?1:0}}}]),t}(),P=0,M=function(){function t(n,r,i,o){e(this,t),this.id=++P,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(t,null,[{key:"compare",value:function(e,t){var n=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,o=t.rightSE.point.x;if(oa&&s>l)return-1;var u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return-1;var d=t.comparePoint(e.rightSE.point);return 0!==d?d:-1}if(n>r){if(as&&a>c)return 1;var h=t.comparePoint(e.leftSE.point);if(0!==h)return h;var p=e.comparePoint(t.rightSE.point);return p<0?1:p>0?-1:1}if(as)return 1;if(io){var m=e.comparePoint(t.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(i!==o){var g=l-a,y=i-n,v=c-s,_=o-r;if(g>y&&v<_)return 1;if(g_)return-1}return i>o?1:ic?1:e.idt.id?1:0}}]),n(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x0&&s.swapEvents(),A.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var t=0,n=this.windings.length;t0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,l=r.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,a=-1}return new t(new A(i,!0),new A(o,!1),[r],[a])}}]),t}(),O=function(){function t(n,r,i){if(e(this,t),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!==typeof n[0][0]||"number"!==typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=b.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,l=n.length;sthis.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),a=c)}o.x===a.x&&o.y===a.y||this.segments.push(M.fromRing(a,o,this))}return n(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,n=this.segments.length;tthis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return n(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,n=this.interiorRings.length;tthis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return n(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,n=this.polys.length;t0&&(e=r)}for(var i=e.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),t}(),D=function(){function t(n){e(this,t),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return n(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(var t=0,n=this.interiorRings.length;t1&&void 0!==arguments[1]?arguments[1]:M.compare;e(this,t),this.queue=n,this.tree=new c(r),this.segments=[]}return n(t,[{key:"process",value:function(e){var t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;var r=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!r)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(e.isLeft){var l=null;if(a){var c=a.getIntersection(t);if(null!==c&&(t.isAnEndpoint(c)||(l=c),!a.isAnEndpoint(c)))for(var u=this._splitSafely(a,c),d=0,h=u.length;d0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&s){var x=a.getIntersection(s);if(null!==x){if(!a.isAnEndpoint(x))for(var S=this._splitSafely(a,x),C=0,E=S.length;CB)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var x=new z(m),S=m.size,C=m.pop();C;){var E=C.key;if(m.size===S){var k=E.segment;throw new Error("Unable to pop() ".concat(E.isLeft?"left":"right"," SweepEvent ")+"[".concat(E.point.x,", ").concat(E.point.y,"] from segment #").concat(k.id," ")+"[".concat(k.leftSE.point.x,", ").concat(k.leftSE.point.y,"] -> ")+"[".concat(k.rightSE.point.x,", ").concat(k.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(m.size>B)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(x.segments.length>j)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var I=x.process(E),T=0,P=I.length;T1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r=this.minZoom,n=!this.maxZoom||!e.zoom||e.zoom<=this.maxZoom,r=!0;return this.geometry&&e.bounds&&(r=null!==AO({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[uu.getNorthWest(e.bounds),uu.getNorthEast(e.bounds),uu.getSouthEast(e.bounds),uu.getSouthWest(e.bounds),uu.getNorthWest(e.bounds)]]},properties:{}})),t&&n&&r},e.prototype.apply=function(e,t){var n=this,r=(void 0===t&&(t=null),this.satisfied(e.getCamera())),i=this.dynamic&&this.tilesetId,o=this.hidesElement;t=t&&["dragend","zoomend","pitchend"].includes(t.type);return r||o?r&&(o||i)&&(r&&o&&this.element.style.removeProperty("display"),i)&&(t?e.events.addOnce("idle",(function(t){return n.fetchAndApplyDynamicAttribution(e)})):this.fetchAndApplyDynamicAttribution(e)):this.element.style.display="none",r===o},e.prototype.fetchAndApplyDynamicAttribution=function(t){var n,r,i,o=this,a=t.getCamera();this.lastFetchState&&uu.containsBoundingBox(this.lastFetchState.bounds,a.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(a.zoom)||(n=zc(a.center,uu.getSouthWest(a.bounds),e.viewportBufferExpansionRatio),i=((r=zc(a.center,uu.getNorthEast(a.bounds),e.viewportBufferExpansionRatio))[0]i[0]&&l[1]i[0]&&l[1]=t.length&&e.lastIndexOf(t)===e.length-t.length},e.queryStringToObject=function(e){function t(e){return decodeURIComponent(e.replace(/\+/g," "))}var n={};return(e=e.split("&")).forEach((function(e){var r;e.trim()&&(r=(e=e.split(/=(.+)/g,2))[0],e=e[1],r)&&e&&(n[t(r)]=t(e))})),n},e.trimArrayEntries=function(e){return e.map((function(e){return e.trim()}))},e.removeEmptyStringsFromArray=function(t){return t.filter((function(t){return!e.isEmpty(t)}))},e.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},e.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},e}(),NL=(function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(xR=xR||{}),function(){function e(t,n,r){this.level=xR.Info,t=t||e.createDefaultLoggerOptions(),this.localCallback=t.loggerCallback||function(){},this.piiLoggingEnabled=t.piiLoggingEnabled||!1,this.level="number"==typeof t.logLevel?t.logLevel:xR.Info,this.correlationId=t.correlationId||ER.EMPTY_STRING,this.packageName=n||ER.EMPTY_STRING,this.packageVersion=r||ER.EMPTY_STRING}return e.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:xR.Info}},e.prototype.clone=function(t,n,r){return new e({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},t,n)},e.prototype.logMessage=function(e,t){var n;t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii||(n=(new Date).toUTCString(),n=(LL.isEmpty(t.correlationId)?LL.isEmpty(this.correlationId)?"["+n+"]":"["+n+"] : ["+this.correlationId+"]":"["+n+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+xR[t.logLevel]+" - "+e,this.executeCallback(t.logLevel,n,t.containsPii||!1))},e.prototype.executeCallback=function(e,t,n){this.localCallback&&this.localCallback(e,t,n)},e.prototype.error=function(e,t){this.logMessage(e,{logLevel:xR.Error,containsPii:!1,correlationId:t||ER.EMPTY_STRING})},e.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:xR.Error,containsPii:!0,correlationId:t||ER.EMPTY_STRING})},e.prototype.warning=function(e,t){this.logMessage(e,{logLevel:xR.Warning,containsPii:!1,correlationId:t||ER.EMPTY_STRING})},e.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:xR.Warning,containsPii:!0,correlationId:t||ER.EMPTY_STRING})},e.prototype.info=function(e,t){this.logMessage(e,{logLevel:xR.Info,containsPii:!1,correlationId:t||ER.EMPTY_STRING})},e.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:xR.Info,containsPii:!0,correlationId:t||ER.EMPTY_STRING})},e.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:xR.Verbose,containsPii:!1,correlationId:t||ER.EMPTY_STRING})},e.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:xR.Verbose,containsPii:!0,correlationId:t||ER.EMPTY_STRING})},e.prototype.trace=function(e,t){this.logMessage(e,{logLevel:xR.Trace,containsPii:!1,correlationId:t||ER.EMPTY_STRING})},e.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:xR.Trace,containsPii:!0,correlationId:t||ER.EMPTY_STRING})},e.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},e}()),DL="@azure/msal-common",FL="13.3.1",zL=(function(e){e[e.None=0]="None",e.AzurePublic="https://login.microsoftonline.com",e.AzurePpe="https://login.windows-ppe.net",e.AzureChina="https://login.chinacloudapi.cn",e.AzureGermany="https://login.microsoftonline.de",e.AzureUsGovernment="https://login.microsoftonline.us"}(SR=SR||{}),{redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"},authorityMismatch:{code:"authority_mismatch",desc:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."}}),BL=function(e){function t(n,r){return(n=e.call(this,n,r)||this).name="ClientConfigurationError",Object.setPrototypeOf(n,t.prototype),n}return JO(t,e),t.createRedirectUriEmptyError=function(){return new t(zL.redirectUriNotSet.code,zL.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(zL.postLogoutUriNotSet.code,zL.postLogoutUriNotSet.desc)},t.createClaimsRequestParsingError=function(e){return new t(zL.claimsRequestParsingError.code,zL.claimsRequestParsingError.desc+" Given value: "+e)},t.createInsecureAuthorityUriError=function(e){return new t(zL.authorityUriInsecure.code,zL.authorityUriInsecure.desc+" Given URI: "+e)},t.createUrlParseError=function(e){return new t(zL.urlParseError.code,zL.urlParseError.desc+" Given Error: "+e)},t.createUrlEmptyError=function(){return new t(zL.urlEmptyError.code,zL.urlEmptyError.desc)},t.createEmptyScopesArrayError=function(){return new t(zL.emptyScopesError.code,""+zL.emptyScopesError.desc)},t.createClientIdSingleScopeError=function(e){return new t(zL.clientIdSingleScopeError.code,zL.clientIdSingleScopeError.desc+" Given Scopes: "+e)},t.createInvalidPromptError=function(e){return new t(zL.invalidPrompt.code,zL.invalidPrompt.desc+" Given value: "+e)},t.createInvalidClaimsRequestError=function(){return new t(zL.invalidClaimsRequest.code,zL.invalidClaimsRequest.desc)},t.createEmptyLogoutRequestError=function(){return new t(zL.logoutRequestEmptyError.code,zL.logoutRequestEmptyError.desc)},t.createEmptyTokenRequestError=function(){return new t(zL.tokenRequestEmptyError.code,zL.tokenRequestEmptyError.desc)},t.createInvalidCodeChallengeMethodError=function(){return new t(zL.invalidCodeChallengeMethod.code,zL.invalidCodeChallengeMethod.desc)},t.createInvalidCodeChallengeParamsError=function(){return new t(zL.invalidCodeChallengeParams.code,zL.invalidCodeChallengeParams.desc)},t.createInvalidCloudDiscoveryMetadataError=function(){return new t(zL.invalidCloudDiscoveryMetadata.code,zL.invalidCloudDiscoveryMetadata.desc)},t.createInvalidAuthorityMetadataError=function(){return new t(zL.invalidAuthorityMetadata.code,zL.invalidAuthorityMetadata.desc)},t.createUntrustedAuthorityError=function(){return new t(zL.untrustedAuthority.code,zL.untrustedAuthority.desc)},t.createInvalidAzureCloudInstanceError=function(){return new t(zL.invalidAzureCloudInstance.code,zL.invalidAzureCloudInstance.desc)},t.createMissingSshJwkError=function(){return new t(zL.missingSshJwk.code,zL.missingSshJwk.desc)},t.createMissingSshKidError=function(){return new t(zL.missingSshKid.code,zL.missingSshKid.desc)},t.createMissingNonceAuthenticationHeadersError=function(){return new t(zL.missingNonceAuthenticationHeader.code,zL.missingNonceAuthenticationHeader.desc)},t.createInvalidAuthenticationHeaderError=function(e,n){return new t(zL.invalidAuthenticationHeader.code,zL.invalidAuthenticationHeader.desc+". Invalid header: "+e+". Details: "+n)},t.createAuthorityMismatchError=function(){return new t(zL.authorityMismatch.code,zL.authorityMismatch.desc)},t}(RL),jL=function(){function e(e){var t=this;e=(e=e?LL.trimArrayEntries(tR(e)):[])?LL.removeEmptyStringsFromArray(e):[];this.validateInputScopes(e),this.scopes=new Set,e.forEach((function(e){return t.scopes.add(e)}))}return e.fromString=function(t){return new e((t||ER.EMPTY_STRING).split(" "))},e.createSearchScopes=function(t){return(t=new e(t)).containsOnlyOIDCScopes()?t.removeScope(ER.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t},e.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw BL.createEmptyScopesArrayError()},e.prototype.containsScope=function(t){var n=new e(this.printScopesLowerCase().split(" "));return!LL.isEmpty(t)&&n.scopes.has(t.toLowerCase())},e.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&this.scopes.size>=e.scopes.size&&e.asArray().every((function(e){return t.containsScope(e)}))},e.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return IR.forEach((function(n){e.containsScope(n)&&(t+=1)})),this.scopes.size===t},e.prototype.appendScope=function(e){LL.isEmpty(e)||this.scopes.add(e.trim())},e.prototype.appendScopes=function(e){var t=this;try{e.forEach((function(e){return t.appendScope(e)}))}catch(e){throw RL.createAppendScopeSetError(e)}},e.prototype.removeScope=function(e){if(LL.isEmpty(e))throw RL.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},e.prototype.removeOIDCScopes=function(){var e=this;IR.forEach((function(t){e.scopes.delete(t)}))},e.prototype.unionScopeSets=function(e){var t;if(e)return t=new Set,e.scopes.forEach((function(e){return t.add(e.toLowerCase())})),this.scopes.forEach((function(e){return t.add(e.toLowerCase())})),t;throw RL.createEmptyInputScopeSetError()},e.prototype.intersectingScopeSets=function(e){if(!e)throw RL.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),n=(e=e.getScopeCount(),this.getScopeCount());return t.sizee+t)throw RL.createMaxAgeTranspiredError()},e}(),GL=function(){function e(e,t,n){this.clientId=e,this.cryptoImpl=t,this.commonLogger=n.clone(DL,FL)}return e.prototype.getAllAccounts=function(){var e=this,t=this.getAccountKeys();return t.length<1||(t=t.reduce((function(t,n){return(n=e.getAccount(n))&&t.push(n),t}),[])).length<1?[]:t.map((function(t){return e.getAccountInfoFromEntity(t)}))},e.prototype.getAccountInfoFilteredBy=function(e){return 0<(e=this.getAccountsFilteredBy(e)).length?this.getAccountInfoFromEntity(e[0]):null},e.prototype.getAccountInfoFromEntity=function(e){e=e.getAccountInfo();var t=this.getIdToken(e);return t&&(e.idToken=t.secret,e.idTokenClaims=new HL(t.secret,this.cryptoImpl).claims),e},e.prototype.saveCacheRecord=function(e){return $O(this,void 0,void 0,(function(){return eR(this,(function(t){switch(t.label){case 0:if(e)return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];throw RL.createNullOrUndefinedCacheRecord();case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}}))}))},e.prototype.saveAccessToken=function(e){return $O(this,void 0,void 0,(function(){var t,n,r,i,o=this;return eR(this,(function(a){switch(a.label){case 0:return t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},n=this.getTokenKeys(),r=jL.fromString(e.target),i=[],n.accessToken.forEach((function(e){var n;o.accessTokenKeyMatchesFilter(e,t,!1)&&(n=o.getAccessTokenCredential(e))&&o.credentialMatchesFilter(n,t)&&jL.fromString(n.target).intersectingScopeSets(r)&&i.push(o.removeAccessToken(e))})),[4,Promise.all(i)];case 1:return a.sent(),this.setAccessTokenCredential(e),[2]}}))}))},e.prototype.getAccountsFilteredBy=function(e){var t=this,n=this.getAccountKeys(),r=[];return n.forEach((function(n){!t.isAccountKey(n,e.homeAccountId,e.realm)||!(n=t.getAccount(n))||e.homeAccountId&&!t.matchHomeAccountId(n,e.homeAccountId)||e.localAccountId&&!t.matchLocalAccountId(n,e.localAccountId)||e.username&&!t.matchUsername(n,e.username)||e.environment&&!t.matchEnvironment(n,e.environment)||e.realm&&!t.matchRealm(n,e.realm)||e.nativeAccountId&&!t.matchNativeAccountId(n,e.nativeAccountId)||r.push(n)})),r},e.prototype.isAccountKey=function(e,t,n){return!(e.split(dR.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||n&&!e.toLowerCase().includes(n.toLowerCase()))},e.prototype.isCredentialKey=function(e){if(e.split(dR.CACHE_KEY_SEPARATOR).length<6)return!1;if(-1===(e=e.toLowerCase()).indexOf(hR.ID_TOKEN.toLowerCase())&&-1===e.indexOf(hR.ACCESS_TOKEN.toLowerCase())&&-1===e.indexOf(hR.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===e.indexOf(hR.REFRESH_TOKEN.toLowerCase()))return!1;if(-1e.nowSeconds()},e.delay=function(e,t){return new Promise((function(n){return setTimeout((function(){return n(t)}),e)}))},e}(),mN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return JO(t,e),t.createAccessTokenEntity=function(e,n,r,i,o,a,s,l,c,u,d,h,p,f,m){var g,y=new t;y.homeAccountId=e,y.credentialType=hR.ACCESS_TOKEN,y.secret=r,e=fN.nowSeconds();if(y.cachedAt=e.toString(),y.expiresOn=s.toString(),y.extendedExpiresOn=l.toString(),u&&(y.refreshOn=u.toString()),y.environment=n,y.clientId=i,y.realm=o,y.target=a,y.userAssertionHash=h,y.tokenType=LL.isEmpty(d)?mR.BEARER:d,f&&(y.requestedClaims=f,y.requestedClaimsHash=m),(null==(e=y.tokenType)?void 0:e.toLowerCase())!==mR.BEARER.toLowerCase())switch(y.credentialType=hR.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case mR.POP:var v=HL.extractTokenClaims(r,c);if(null==(g=null==v?void 0:v.cnf)||!g.kid)throw RL.createTokenClaimsRequiredError();y.keyId=v.cnf.kid;break;case mR.SSH:y.keyId=p}return y},t.isAccessTokenEntity=function(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===hR.ACCESS_TOKEN||e.credentialType===hR.ACCESS_TOKEN_WITH_AUTH_SCHEME)},t}(hN),gN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return JO(t,e),t.createRefreshTokenEntity=function(e,n,r,i,o,a){var s=new t;return s.clientId=i,s.credentialType=hR.REFRESH_TOKEN,s.environment=n,s.homeAccountId=e,s.secret=r,s.userAssertionHash=a,o&&(s.familyId=o),s},t.isRefreshTokenEntity=function(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===hR.REFRESH_TOKEN},t}(hN),yN=["interaction_required","consent_required","login_required"],vN=["message_only","additional_action","basic_action","user_password_expired","consent_required"],_N={code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},bN={code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."},wN=function(e){function t(n,r,i,o,a,s,l){return n=e.call(this,n,r,i)||this,Object.setPrototypeOf(n,t.prototype),n.timestamp=o||ER.EMPTY_STRING,n.traceId=a||ER.EMPTY_STRING,n.correlationId=s||ER.EMPTY_STRING,n.claims=l||ER.EMPTY_STRING,n.name="InteractionRequiredAuthError",n}return JO(t,e),t.isInteractionRequiredError=function(e,t,n){e=!!e&&-1=LR.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),LL.isEmpty(e.subError)?LL.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(LR.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},e.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},e.prototype.getLastRequests=function(){var e=new eD;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},e.prototype.clearTelemetryCache=function(){var t,n=this.getLastRequests(),r=e.maxErrorsToSend(n);r===n.errors.length?this.cacheManager.removeItem(this.telemetryCacheKey):((t=new eD).failedRequests=n.failedRequests.slice(2*r),t.errors=n.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t))},e.maxErrorsToSend=function(e){for(var t=0,n=0,r=e.errors.length,i=0;i "+e)},t.createBlockReloadInHiddenIframeError=function(){return new t(ID.code,ID.desc)},t.createBlockAcquireTokenInPopupsError=function(){return new t(TD.code,TD.desc)},t.createIframeClosedPrematurelyError=function(){return new t(AD.code,AD.desc)},t.createSilentLogoutUnsupportedError=function(){return new t(PD.code,PD.desc)},t.createNoAccountError=function(){return new t(MD.code,MD.desc)},t.createSilentPromptValueError=function(e){return new t(OD.code,OD.desc+" Given value: "+e)},t.createUnableToParseTokenRequestCacheError=function(){return new t(LD.code,LD.desc)},t.createNoTokenRequestCacheError=function(){return new t(RD.code,RD.desc)},t.createAuthRequestNotSetError=function(){return new t(DD.code,DD.desc)},t.createNoCachedAuthorityError=function(){return new t(ND.code,ND.desc)},t.createInvalidCacheTypeError=function(){return new t(FD.code,""+FD.desc)},t.createNonBrowserEnvironmentError=function(){return new t(zD.code,zD.desc)},t.createDatabaseNotOpenError=function(){return new t(BD.code,BD.desc)},t.createNoNetworkConnectivityError=function(){return new t(jD.code,jD.desc)},t.createPostRequestFailedError=function(e,n){return new t(UD.code,UD.desc+" | Network client threw: "+e+" | Attempted to reach: "+n.split("?")[0])},t.createGetRequestFailedError=function(e,n){return new t(qD.code,qD.desc+" | Network client threw: "+e+" | Attempted to reach: "+n.split("?")[0])},t.createFailedToParseNetworkResponseError=function(e){return new t(VD.code,VD.desc+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToLoadTokenError=function(e){return new t(HD.code,HD.desc+" | "+e)},t.createSigningKeyNotFoundInStorageError=function(e){return new t(GD.code,GD.desc+" | No match found for KeyId: "+e)},t.createAuthCodeRequiredError=function(){return new t(WD.code,WD.desc)},t.createAuthCodeOrNativeAccountIdRequiredError=function(){return new t(KD.code,KD.desc)},t.createSpaCodeAndNativeAccountIdPresentError=function(){return new t(YD.code,YD.desc)},t.createDatabaseUnavailableError=function(){return new t(ZD.code,ZD.desc)},t.createUnableToAcquireTokenFromNativePlatformError=function(){return new t(XD.code,XD.desc)},t.createNativeHandshakeTimeoutError=function(){return new t(JD.code,JD.desc)},t.createNativeExtensionNotInstalledError=function(){return new t(QD.code,QD.desc)},t.createNativeConnectionNotEstablishedError=function(){return new t($D.code,$D.desc)},t.createNativeBrokerCalledBeforeInitialize=function(){return new t(eF.code,eF.desc)},t.createNativePromptParameterNotSupportedError=function(){return new t(tF.code,tF.desc)},t}(BR),rF="invalid_grant",iF=483,oF=600,aF="msal",sF=30,lF="msal.js.browser",cF="53ee284d-920a-4b59-9d30-a60315b26836",uF="ppnbnpeolgkicgegkbkbjmhlideopiji",dF="MATS",hF=(function(e){e.HandshakeRequest="Handshake",e.HandshakeResponse="HandshakeResponse",e.GetToken="GetToken",e.Response="Response"}(zN=zN||{}),function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage",e.MemoryStorage="memoryStorage"}(BN=BN||{}),function(e){e.GET="GET",e.POST="POST"}(jN=jN||{}),function(e){e.AUTHORITY="authority",e.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",e.SESSION_STATE="session.state",e.REQUEST_STATE="request.state",e.NONCE_IDTOKEN="nonce.id_token",e.ORIGIN_URI="request.origin",e.RENEW_STATUS="token.renew.status",e.URL_HASH="urlHash",e.REQUEST_PARAMS="request.params",e.SCOPES="scopes",e.INTERACTION_STATUS_KEY="interaction.status",e.CCS_CREDENTIAL="ccs.credential",e.CORRELATION_ID="request.correlationId",e.NATIVE_REQUEST="request.native",e.REDIRECT_CONTEXT="request.redirect.context"}(UN=UN||{}),function(e){e.ACCOUNT_KEYS="msal.account.keys",e.TOKEN_KEYS="msal.token.keys"}(qN=qN||{}),function(e){e.WRAPPER_SKU="wrapper.sku",e.WRAPPER_VER="wrapper.version"}(VN=VN||{}),function(e){e[e.acquireTokenRedirect=861]="acquireTokenRedirect",e[e.acquireTokenPopup=862]="acquireTokenPopup",e[e.ssoSilent=863]="ssoSilent",e[e.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",e[e.handleRedirectPromise=865]="handleRedirectPromise",e[e.acquireTokenByCode=866]="acquireTokenByCode",e[e.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",e[e.logout=961]="logout",e[e.logoutPopup=962]="logoutPopup"}(HN=HN||{}),function(e){e.Redirect="redirect",e.Popup="popup",e.Silent="silent",e.None="none"}(GN=GN||{}),function(e){e.Startup="startup",e.Login="login",e.Logout="logout",e.AcquireToken="acquireToken",e.SsoSilent="ssoSilent",e.HandleRedirect="handleRedirect",e.None="none"}(WN=WN||{}),{scopes:kR}),pF="jwk",fF=(function(e){e.React="@azure/msal-react",e.Angular="@azure/msal-angular"}(KN=KN||{}),"msal.db"),mF=fF+".keys",gF=(function(e){e[e.Default=0]="Default",e[e.AccessToken=1]="AccessToken",e[e.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",e[e.RefreshToken=3]="RefreshToken",e[e.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",e[e.Skip=5]="Skip"}(YN=YN||{}),{redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."}}),yF=function(e){function t(n,r){return(n=e.call(this,n,r)||this).name="BrowserConfigurationAuthError",Object.setPrototypeOf(n,t.prototype),n}return VO(t,e),t.createRedirectUriEmptyError=function(){return new t(gF.redirectUriNotSet.code,gF.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(gF.postLogoutUriNotSet.code,gF.postLogoutUriNotSet.desc)},t.createStorageNotSupportedError=function(e){return new t(gF.storageNotSupportedError.code,gF.storageNotSupportedError.desc+" Given Location: "+e)},t.createRedirectCallbacksNotSetError=function(){return new t(gF.noRedirectCallbacksSet.code,gF.noRedirectCallbacksSet.desc)},t.createStubPcaInstanceCalledError=function(){return new t(gF.stubPcaInstanceCalled.code,gF.stubPcaInstanceCalled.desc)},t.createInMemoryRedirectUnavailableError=function(){return new t(gF.inMemRedirectUnavailable.code,gF.inMemRedirectUnavailable.desc)},t.createEntropyNotProvided=function(){return new t(gF.entropyNotProvided.code,gF.entropyNotProvided.desc)},t}(BR),vF=function(){function e(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return e.prototype.validateWindowStorage=function(e){if(e!==BN.LocalStorage&&e!==BN.SessionStorage)throw yF.createStorageNotSupportedError(e);if(!window[e])throw yF.createStorageNotSupportedError(e)},e.prototype.getItem=function(e){return this.windowStorage.getItem(e)},e.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},e.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},e.prototype.getKeys=function(){return Object.keys(this.windowStorage)},e.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},e}(),_F=function(){function e(){this.cache=new Map}return e.prototype.getItem=function(e){return this.cache.get(e)||null},e.prototype.setItem=function(e,t){this.cache.set(e,t)},e.prototype.removeItem=function(e){this.cache.delete(e)},e.prototype.getKeys=function(){var e=[];return this.cache.forEach((function(t,n){e.push(n)})),e},e.prototype.containsKey=function(e){return this.cache.has(e)},e.prototype.clear=function(){this.cache.clear()},e}(),bF=function(){function e(){}return e.extractBrowserRequestState=function(e,t){if(LL.isEmpty(t))return null;try{return SN.parseRequestState(e,t).libraryState.meta}catch(e){throw RL.createInvalidStateError(t,e)}},e.parseServerResponseFromHash=function(e){return e?(e=new CN(e),CN.getDeserializedHash(e.getHash())):{}},e}(),wF=function(e){function t(t,n,r,i){return(t=e.call(this,t,r,i)||this).COOKIE_LIFE_MULTIPLIER=864e5,t.cacheConfig=n,t.logger=i,t.internalStorage=new _F,t.browserStorage=t.setupBrowserStorage(t.cacheConfig.cacheLocation),t.temporaryCacheStorage=t.setupTemporaryCacheStorage(t.cacheConfig.temporaryCacheLocation,t.cacheConfig.cacheLocation),n.cacheMigrationEnabled&&(t.migrateCacheEntries(),t.createKeyMaps()),t}return VO(t,e),t.prototype.setupBrowserStorage=function(e){switch(e){case BN.LocalStorage:case BN.SessionStorage:try{return new vF(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=BN.MemoryStorage,new _F},t.prototype.setupTemporaryCacheStorage=function(e,t){switch(t){case BN.LocalStorage:case BN.SessionStorage:try{return new vF(e||BN.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case BN.MemoryStorage:default:return this.internalStorage}},t.prototype.migrateCacheEntries=function(){var e=this,t=ER.CACHE_PREFIX+"."+rR.ID_TOKEN,n=ER.CACHE_PREFIX+"."+rR.CLIENT_INFO,r=ER.CACHE_PREFIX+"."+rR.ERROR,i=ER.CACHE_PREFIX+"."+rR.ERROR_DESC,o=[this.browserStorage.getItem(t),this.browserStorage.getItem(n),this.browserStorage.getItem(r),this.browserStorage.getItem(i)];[rR.ID_TOKEN,rR.CLIENT_INFO,rR.ERROR,rR.ERROR_DESC].forEach((function(t,n){return e.migrateCacheEntry(t,o[n])}))},t.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},t.prototype.createKeyMaps=function(){var e=this,t=(this.logger.trace("BrowserCacheManager - createKeyMaps called."),this.getItem(qN.ACCOUNT_KEYS)),n=this.getItem(qN.TOKEN_KEYS+"."+this.clientId);t&&n?this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration."):this.browserStorage.getKeys().forEach((function(t){var n;if(e.isCredentialKey(t)&&(n=e.getItem(t))){var r,i,o=e.validateAndParseJson(n);if(o&&o.hasOwnProperty("credentialType"))switch(o.credentialType){case hR.ID_TOKEN:if(pN.isIdTokenEntity(o))return e.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: "+t+" found, saving key to token key map"),i=GL.toObject(new pN,o),i=e.updateCredentialCacheKey(t,i),void e.addTokenKey(i,hR.ID_TOKEN);e.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),e.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: "+t);break;case hR.ACCESS_TOKEN:case hR.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(mN.isAccessTokenEntity(o))return e.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: "+t+" found, saving key to token key map"),r=GL.toObject(new mN,o),i=e.updateCredentialCacheKey(t,r),void e.addTokenKey(i,hR.ACCESS_TOKEN);e.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),e.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: "+t);break;case hR.REFRESH_TOKEN:if(gN.isRefreshTokenEntity(o))return e.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: "+t+" found, saving key to token key map"),r=GL.toObject(new gN,o),i=e.updateCredentialCacheKey(t,r),void e.addTokenKey(i,hR.REFRESH_TOKEN);e.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),e.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: "+t)}}e.isAccountKey(t)&&(n=e.getItem(t))&&(n=e.validateAndParseJson(n))&&VL.isAccountEntity(n)&&(e.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: "+t+" found, saving key to account key map"),e.addAccountKeyToMap(t))}))},t.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},t.prototype.getItem=function(e){return this.browserStorage.getItem(e)},t.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},t.prototype.getAccount=function(e){this.logger.trace("BrowserCacheManager.getAccount called");var t=this.getItem(e);return(t=t&&this.validateAndParseJson(t))&&VL.isAccountEntity(t)?GL.toObject(new VL,t):(this.removeAccountKeyFromMap(e),null)},t.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)},t.prototype.getAccountKeys=function(){this.logger.trace("BrowserCacheManager.getAccountKeys called");var e=this.getItem(qN.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])},t.prototype.addAccountKeyToMap=function(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: "+e);var t=this.getAccountKeys();-1===t.indexOf(e)?(t.push(e),this.setItem(qN.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")},t.prototype.removeAccountKeyFromMap=function(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: "+e);var t=this.getAccountKeys();-1<(e=t.indexOf(e))?(t.splice(e,1),this.setItem(qN.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")},t.prototype.removeAccount=function(t){return WO(this,void 0,void 0,(function(){return KO(this,(function(n){return e.prototype.removeAccount.call(this,t),this.removeAccountKeyFromMap(t),[2]}))}))},t.prototype.removeIdToken=function(t){e.prototype.removeIdToken.call(this,t),this.removeTokenKey(t,hR.ID_TOKEN)},t.prototype.removeAccessToken=function(t){return WO(this,void 0,void 0,(function(){return KO(this,(function(n){return e.prototype.removeAccessToken.call(this,t),this.removeTokenKey(t,hR.ACCESS_TOKEN),[2]}))}))},t.prototype.removeRefreshToken=function(t){e.prototype.removeRefreshToken.call(this,t),this.removeTokenKey(t,hR.REFRESH_TOKEN)},t.prototype.getTokenKeys=function(){this.logger.trace("BrowserCacheManager.getTokenKeys called");var e=this.getItem(qN.TOKEN_KEYS+"."+this.clientId);if(e){if((e=this.validateAndParseJson(e))&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("accessToken")&&e.hasOwnProperty("refreshToken"))return e;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}},t.prototype.addTokenKey=function(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");var n=this.getTokenKeys();switch(t){case hR.ID_TOKEN:-1===n.idToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),n.idToken.push(e));break;case hR.ACCESS_TOKEN:-1===n.accessToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),n.accessToken.push(e));break;case hR.REFRESH_TOKEN:-1===n.refreshToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),n.refreshToken.push(e));break;default:this.logger.error("BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: "+t),RL.createUnexpectedCredentialTypeError()}this.setItem(qN.TOKEN_KEYS+"."+this.clientId,JSON.stringify(n))},t.prototype.removeTokenKey=function(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");var n=this.getTokenKeys();switch(t){case hR.ID_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: "+e+" from map");var r=n.idToken.indexOf(e);-1o)n.removeHiddenIframe(e),clearInterval(a),i(nF.createMonitorIframeTimeoutError());else{var t=ER.EMPTY_STRING,s=e.contentWindow;try{t=s?s.location.href:ER.EMPTY_STRING}catch(t){}LL.isEmpty(t)||(t=s?s.location.hash:ER.EMPTY_STRING,CN.hashContainsKnownProperties(t)&&(n.removeHiddenIframe(e),clearInterval(a),r(t)))}}),n.pollIntervalMilliseconds)}))},t.prototype.loadFrame=function(e){var t=this;return this.performanceClient.addQueueMeasurement(rN.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise((function(n,r){var i=t.createHiddenIframe();setTimeout((function(){i?(i.src=e,n(i)):r("Unable to load iframe")}),t.navigateFrameWait)}))},t.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},t.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},t.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},t}(AF),qF=function(e){function t(t,n,r,i,o,a,s,l,c,u,d){return(t=e.call(this,t,n,r,i,o,a,l,u,d)||this).apiId=s,t.nativeStorage=c,t}return VO(t,e),t.prototype.acquireToken=function(e){return WO(this,void 0,void 0,(function(){var t,n,r,i;return KO(this,(function(o){switch(o.label){case 0:if(this.performanceClient.addQueueMeasurement(rN.SilentIframeClientAcquireToken,e.correlationId),this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(rN.SilentIframeClientAcquireToken,e.correlationId),LL.isEmpty(e.loginHint)&&LL.isEmpty(e.sid)&&(!e.account||LL.isEmpty(e.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),e.prompt&&e.prompt!==TR.NONE&&e.prompt!==TR.NO_SESSION)throw t.endMeasurement({success:!1}),nF.createSilentPromptValueError(e.prompt);return this.performanceClient.setPreQueueTime(rN.StandardInteractionClientInitializeAuthorizationRequest,e.correlationId),[4,this.initializeAuthorizationRequest(HO(HO({},e),{prompt:e.prompt||TR.NONE}),GN.Silent)];case 1:n=o.sent(),this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||ER.EMPTY_STRING,n.account||null),r=this.initializeServerTelemetryManager(this.apiId),o.label=2;case 2:return o.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime(rN.StandardInteractionClientCreateAuthCodeClient,e.correlationId),[4,this.createAuthCodeClient(r,n.authority,n.azureCloudOptions)];case 3:return i=o.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime(rN.SilentIframeClientTokenHelper,e.correlationId),[4,this.silentTokenHelper(i,n).then((function(e){return t.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e}))];case 4:return[2,o.sent()];case 5:throw(i=o.sent())instanceof BR&&i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i),this.browserStorage.cleanRequestByState(n.state),t.endMeasurement({errorCode:i instanceof BR&&i.errorCode||void 0,subErrorCode:i instanceof BR&&i.subError||void 0,success:!1}),i;case 6:return[2]}}))}))},t.prototype.logout=function(){return Promise.reject(nF.createSilentLogoutUnsupportedError())},t.prototype.silentTokenHelper=function(e,t){return WO(this,void 0,void 0,(function(){var n,r,i,o,a,s,l,c=this;return KO(this,(function(u){switch(u.label){case 0:return this.performanceClient.addQueueMeasurement(rN.SilentIframeClientTokenHelper,t.correlationId),this.performanceClient.setPreQueueTime(rN.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(t)];case 1:return n=u.sent(),this.performanceClient.setPreQueueTime(rN.GetAuthCodeUrl,t.correlationId),[4,e.getAuthCodeUrl(HO(HO({},t),{nativeBroker:NF.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 2:return i=u.sent(),r=new UF(e,this.browserStorage,n,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime(rN.SilentHandlerInitiateAuthRequest,t.correlationId),[4,r.initiateAuthRequest(i)];case 3:return i=u.sent(),this.performanceClient.setPreQueueTime(rN.SilentHandlerMonitorIframeForHash,t.correlationId),[4,r.monitorIframeForHash(i,this.config.system.iframeHashTimeout)];case 4:if(o=u.sent(),s=CN.getDeserializedHash(o),a=this.validateAndExtractStateFromHash(s,GN.Silent,n.correlationId),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),this.nativeMessageHandler)return s=new LF(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,s.accountId,this.browserStorage,this.correlationId),l=SN.parseRequestState(this.browserCrypto,a).userRequestState,[2,s.acquireToken(HO(HO({},t),{state:l,prompt:t.prompt||TR.NONE})).finally((function(){c.browserStorage.cleanRequestByState(a)}))];throw nF.createNativeConnectionNotEstablishedError()}return this.performanceClient.setPreQueueTime(rN.HandleCodeResponseFromHash,t.correlationId),[2,r.handleCodeResponseFromHash(o,a,e.authority,this.networkClient)]}}))}))},t}(TF),VF=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return VO(t,e),t.prototype.acquireToken=function(e){return WO(this,void 0,void 0,(function(){var t,n,r,i,o,a=this;return KO(this,(function(s){switch(s.label){case 0:return this.performanceClient.addQueueMeasurement(rN.SilentRefreshClientAcquireToken,e.correlationId),this.performanceClient.setPreQueueTime(rN.InitializeBaseRequest,e.correlationId),n=[HO({},e)],[4,this.initializeBaseRequest(e,e.account)];case 1:return t=HO.apply(void 0,n.concat([s.sent()])),r=this.performanceClient.startMeasurement(rN.SilentRefreshClientAcquireToken,t.correlationId),i=this.initializeServerTelemetryManager(HN.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(i,t.authority,t.azureCloudOptions)];case 2:return o=s.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime(rN.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),[2,o.acquireTokenByRefreshToken(t).then((function(e){return r.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e})).catch((function(e){throw e instanceof BR&&e.setCorrelationId(a.correlationId),i.cacheFailedRequest(e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}))]}}))}))},t.prototype.logout=function(){return Promise.reject(nF.createSilentLogoutUnsupportedError())},t.prototype.createRefreshTokenClient=function(e,t,n){return WO(this,void 0,void 0,(function(){var r;return KO(this,(function(i){switch(i.label){case 0:return this.performanceClient.setPreQueueTime(rN.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(e,t,n)];case 1:return r=i.sent(),[2,new MN(r,this.performanceClient)]}}))}))},t}(TF),HF=function(){function e(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return e.prototype.addEventCallback=function(e){var t;return"undefined"!=typeof window?(t=this.browserCrypto.createNewGuid(),this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t):null},e.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},e.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},e.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},e.prototype.emitEvent=function(e,t,n,r){var i,o=this;"undefined"!=typeof window&&(i={eventType:e,interactionType:t||null,payload:n||null,error:r||null,timestamp:Date.now()},this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach((function(t,n){o.logger.verbose("Emitting event to callback "+n+": "+e),t.apply(null,[i])})))},e.prototype.handleAccountCacheChange=function(e){try{var t,n,r=e.newValue||e.oldValue;r&&"object"==typeof(t=JSON.parse(r))&&VL.isAccountEntity(t)&&(n=GL.toObject(new VL,t).getAccountInfo(),!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(ZN.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(ZN.ACCOUNT_REMOVED,void 0,n)))}catch(e){}},e}(),GF=function(){function e(){}return e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e}(),WF=function(){function e(e){this.cryptoObj=e}return e.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,GF.decimalToHex(e[0])+GF.decimalToHex(e[1])+GF.decimalToHex(e[2])+GF.decimalToHex(e[3])+"-"+GF.decimalToHex(e[4])+GF.decimalToHex(e[5])+"-"+GF.decimalToHex(e[6])+GF.decimalToHex(e[7])+"-"+GF.decimalToHex(e[8])+GF.decimalToHex(e[9])+"-"+GF.decimalToHex(e[10])+GF.decimalToHex(e[11])+GF.decimalToHex(e[12])+GF.decimalToHex(e[13])+GF.decimalToHex(e[14])+GF.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",r=0,i=ER.EMPTY_STRING,o=0;o<36;o++)"-"!==t[o]&&"4"!==t[o]&&(r=16*Math.random()|0),i+="x"===t[o]?n[r]:"y"===t[o]?n[r=3&r|8]:t[o];return i}},e.prototype.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e}(),KF=function(){function e(){}return e.stringToUtf8Arr=function(e){for(var t,n=0,r=e.length,i=0;i>>6):(t<65536?o[a++]=224+(t>>>12):(t<2097152?o[a++]=240+(t>>>18):(t<67108864?o[a++]=248+(t>>>24):(o[a++]=252+(t>>>30),o[a++]=128+(t>>>24&63)),o[a++]=128+(t>>>18&63)),o[a++]=128+(t>>>12&63)),o[a++]=128+(t>>>6&63)),o[a++]=128+(63&t));return o},e.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r>>(t=a%3)&24),2!=t&&e.length-a!=1||(r+=String.fromCharCode(this.uint6ToB64(o>>>18&63),this.uint6ToB64(o>>>12&63),this.uint6ToB64(o>>>6&63),this.uint6ToB64(63&o)),o=0);return 0==n?r:r.substring(0,r.length-n)+(1==n?"=":"==")},e.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e}(),ZF=function(){function e(){}return e.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}return e=this.base64DecToArr(t),KF.utf8ArrToString(e)},e.prototype.base64DecToArr=function(e,t){for(var n,r=e.replace(/[^A-Za-z0-9\+\/]/g,ER.EMPTY_STRING),i=r.length,o=t?Math.ceil((3*i+1>>>2)/t)*t:3*i+1>>>2,a=new Uint8Array(o),s=void 0,l=0,c=0,u=0;u>>(16>>>s&24)&255;l=0}return a},e.prototype.b64ToUint6=function(e){return 64>(-2*i&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function gz(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(mz(t).replace(/(.)/g,(function(e,t){return"%"+((t=t.charCodeAt(0).toString(16).toUpperCase()).length<2?"0"+t:t)})))}catch(e){return mz(t)}}function yz(e){this.message=e}function vz(e,t){if("string"!=typeof e)throw new yz("Invalid token specified");t=!0===(t=t||{}).header?0:1;try{return JSON.parse(gz(e.split(".")[t]))}catch(e){throw new yz("Invalid token specified: "+e.message)}}yz.prototype=new Error,yz.prototype.name="InvalidTokenError";var _z=function(){function e(t){var n=this,r=(this.fallbackStorage={},this._triggerTokenFetch=function(t){return void 0===t&&(t=!1),new Promise((function(r,i){"function"!=typeof n.options.getToken?i(new Error("Token cannot be ".concat(t?"fetched":"renewed"," because getToken was not set or is not a function."))):n.options.getToken((function(t){try{var o=n._getTokenExpiry(t)-e.constants.tokenRefreshClockSkew;n._storeToken(t),n._setTimeoutTokenFetch(o),r()}catch(t){i(new Error("Invalid token returned by getToken function"))}}),(function(e){i(e)}),n.map)}))},this._setTimeoutTokenFetch=function(e){clearTimeout(n.tokenTimeOutHandle),n.tokenTimeOutHandle=setTimeout(n._triggerTokenFetch,Math.min(1e3*e,2147483647))},t.getServiceOptions());this.options=r.authOptions,this.sessionId=r.sessionId,this.map=t}return e.prototype.initialize=function(){var t=this;return this.initPromise||(this.initPromise=new Promise((function(n,r){if(t.options.authType===Nh.subscriptionKey)n();else if(t.options.authType===Nh.aad)t.options.authContext=t.options.authContext||e.getDefaultAuthContext(t.options),t.options.authContext.handleRedirectPromise().then((function(){setTimeout((function(){return t._loginAndAcquireTokenForAAD(n,r)}))})).catch((function(e){r(new Error("Error logging in the AAD users: "+e))}));else if(t.options.authType===Nh.anonymous)n(t._triggerTokenFetch(!0));else if(t.options.authType===Nh.sas){if(t.options.sasToken){var i=-1;try{i=t._getTokenExpiry(t.options.sasToken)}catch(n){return void r(new Error("An invalid sasToken was provided."))}if(i>e.constants.tokenRefreshClockSkew)return t._storeToken(t.options.sasToken),t._setTimeoutTokenFetch(i-e.constants.tokenRefreshClockSkew),void n()}n(t._triggerTokenFetch())}else r(new Error("An invalid authentication type was specified."))}))),this.initPromise},e.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},e.getDefaultAuthContext=function(e){if(!e.aadAppId)throw new Error("No AAD app ID was specified.");if(e.aadTenant)return this.defaultAuthContext||(this.defaultAuthContext=new pz({auth:{authority:"".concat(e.aadInstance||m).concat(e.aadTenant),clientId:e.aadAppId},cache:{cacheLocation:this.constants.preferredCacheLocation}})),this.defaultAuthContext;throw new Error("No AAD tenant was specified.")},e.prototype._loginAndAcquireTokenForAAD=function(e,t){var n=(null==(n=this.options.authContext)?void 0:n.getAllAccounts())||[];0===n.length?(this.options.authContext.loginRedirect(),e()):(this.options.authContext.setActiveAccount(n[0]),this._acquireTokenForAAD(e,t))},e.prototype._acquireTokenForAAD=function(t,n){var r=this,i={scopes:[L]};this.options.authContext.acquireTokenSilent(i).then((function(n){r._saveItem(e.constants.storage.tokenKey,n.accessToken);var i={map:r.map,type:e.constants.events.tokenAcquired};r.map.events.invoke(e.constants.events.tokenAcquired,i),clearTimeout(r.tokenTimeOutHandle),i=new Date(n.expiresOn).getTime()-Date.now();r.tokenTimeOutHandle=setTimeout((function(){return r._acquireTokenForAAD()}),i),null!=t&&t()})).catch((function(e){if(e instanceof wN)return r.options.authContext.acquireTokenRedirect(i),null==t?void 0:t();null!=n&&n(e)}))},e.prototype.getAuthType=function(){return this.options.authType},e.prototype.getClientId=function(){return this.options.clientId},e.prototype.getToken=function(){if(this.options.authType===Nh.aad)return this._getItem(e.constants.storage.tokenKey);if(this.options.authType!==Nh.anonymous&&this.options.authType!==Nh.sas)return this.options.authType===Nh.subscriptionKey?this.options.subscriptionKey:void 0;var t=this._getItem(e.constants.storage.tokenKey);if(t){var n=this._getTokenExpiry(t);if(n<300&&0=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wz=function(){function e(e){for(var t in this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),o){var n;o.hasOwnProperty(t)&&((n=document.createElement("div")).classList.add(o[t]),n.classList.add("subcontrol-container"),this.controlContainer.appendChild(n))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}return e.prototype.add=function(e,t){var n,r;if(Array.isArray(e))try{for(var i=bz(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._add(a,t)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}else this._add(e,t)},e.prototype.getControls=function(){return Array.from(this.controls)},e.prototype.remove=function(e){var t,n;if(Array.isArray(e))try{for(var r=bz(e),i=r.next();!i.done;i=r.next()){var o=i.value;this._remove(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}else this._remove(e)},e.prototype._add=function(e,t){this.controls.add(e);var n=(new K).merge(t);e=e.onAdd(this.map,t);if(!(0<(t=this.controlContainer.getElementsByClassName(n.position)).length))throw new Error("Control position ".concat(n.position," does not exist."));t.item(0).appendChild(e)},e.prototype._remove=function(e){e.onRemove(),this.controls.delete(e)},e}(),xz=window&&window.__assign||function(){return(xz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ez=window&&window.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Az=function(){function e(e){this.markers=new Set,this.map=e}return e.prototype.add=function(e,t){var n,r;if(Array.isArray(e))try{for(var i=Tz(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._addMarker(a,t)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}else this._addMarker(e,t)},e.prototype._addMarker=function(e,t){e._addToMap(this.map,t),this.markers.add(e)},e.prototype.getMarkers=function(){return Array.from(this.markers)},e.prototype.remove=function(e){var t,n;if(Array.isArray(e))try{for(var r=Tz(e),i=r.next();!i.done;i=r.next()){var o=i.value;this._removeMarker(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}else this._removeMarker(e)},e.prototype._removeMarker=function(e){var t=this;e instanceof Mh?(e._removeFromMap(),this.markers.delete(e)):this.markers.forEach((function(n){n._getId()===e&&(n._removeFromMap(),t.markers.delete(n))}))},e.prototype.clear=function(){var e=this;this.markers.forEach((function(t){t._removeFromMap(),e.markers.delete(t)}))},e}(),Pz=function(){function e(e){this.userImages=new Z,this.imageLoadTimeout=5e3,this.map=e}return e.prototype.add=function(e,t,n){var r=this;return new Promise((function(i,o){var a,s,l;r.userImages.has(e)?i():t instanceof HTMLImageElement||t instanceof ImageData?(r.map._getMap().addImage(e,t,n),r.userImages.set(e,{image:t,meta:n}),i()):"string"==typeof t&&(void 0,s=/=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rz=function(e){function t(t,n){return(n=e.call(this,n)||this).layers=t,n}return Mz(t,e),t.prototype._buildLayers=function(){return this.layers},t.prototype._getLayerIds=function(){return this.layers.map((function(e){return e.id}))},t.prototype._getSourceIds=function(){var e,t,n=new Set;try{for(var r=Oz(this.layers),i=r.next();!i.done;i=r.next()){var o=i.value;"source"in o&&"string"==typeof o.source?n.add(o.source):"source"in o&&o.source&&n.add(o.id)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},t.prototype._updateLayoutProperty=function(e,t,n,r){var i;Hl(t,n)||(i=this.map._getMap(),this.layers.forEach((function(n){i.getLayer(n.id)?i.setLayoutProperty(n.id,e,r||t):console.warn("Could not update layout property ".concat(e," for layer ").concat(n.id," to ").concat(r||t))})))},t}(hd),Lz=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nz=window&&window.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bz=function(){function e(e){var t=this;this._onDrag=function(e){var n,r;"mousemove"===e.type?(n=e.clientX,r=e.clientY):"touchmove"===e.type&&(n=e.touches[0].clientX,r=e.touches[0].clientY),t.draggedPopups.forEach((function(e){e._dragToPixel([n,r])}))},this._onUp=function(){t.map.getMapContainer().removeEventListener("mousemove",t._onDrag),t.map.getMapContainer().removeEventListener("touchmove",t._onDrag),t.map.getMapContainer().removeEventListener("mouseup",t._onUp),t.map.getMapContainer().removeEventListener("touchend",t._onUp),t.draggedPopups.forEach((function(e){t.draggedPopups.delete(e),e._onUp()}))},this.map=e,this.popups=new Set,this.draggedPopups=new Set}return e.prototype.add=function(e){var t,n;e=Array.isArray(e)?e:[e];try{for(var r=zz(e),i=r.next();!i.done;i=r.next()){var o=i.value;this.popups.has(o)||(this.popups.add(o),o.attach(this.map))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.clear=function(){var e=this;this.popups.forEach((function(t){e.popups.delete(t),t.remove()}))},e.prototype.remove=function(e){var t,n;e=Array.isArray(e)?e:[e];try{for(var r=zz(e),i=r.next();!i.done;i=r.next()){var o=i.value;this.popups.has(o)&&(this.popups.delete(o),o.remove())}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.getPopups=function(){return Array.from(this.popups)},e.prototype._getCollectionDiv=function(){var t=this.map.getMapContainer().querySelector(".".concat(e.Css.collection));return t||((t=document.createElement("div")).classList.add(e.Css.collection),t.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(t)),t},e.prototype._addDraggedPopup=function(e){0===this.draggedPopups.size&&(this.map.getMapContainer().addEventListener("mousemove",this._onDrag),this.map.getMapContainer().addEventListener("touchmove",this._onDrag),this.map.getMapContainer().addEventListener("mouseup",this._onUp),this.map.getMapContainer().addEventListener("touchend",this._onUp)),this.draggedPopups.add(e)},e.Css={collection:"popup-collection-container"},e}(),jz=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Uz=function(){function e(e){this.map=e,this.sources=new Z}return e.prototype.add=function(e,t){var n,r;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var i=jz(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._addSource(a,t)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}else this._addSource(e,t)},e.prototype.getRenderedShapes=function(e,t,n){return e="string"==typeof e?e:e.getId(),n=this.map._getMap().querySourceFeatures(e,{sourceLayer:n,filter:t}),this.map.sources._mapFeaturesToShapes(n,!0,this.sources.get(e))},e.prototype.getFeatureState=function(e,t,n){return e="string"==typeof e?e:e instanceof su?e.getId():e.id,t="string"==typeof t?t:t.getId(),this.map._getMap().getFeatureState({id:e,source:t,sourceLayer:n})},e.prototype.removeFeatureState=function(e,t,n,r){e="string"==typeof e?e:e instanceof su?e.getId():e.id,t="string"==typeof t?t:t.getId(),this.map._getMap().removeFeatureState({id:e,source:t,sourceLayer:n},r)},e.prototype.setFeatureState=function(e,t,n,r){e="string"==typeof e?e:e instanceof su?e.getId():e.id,t="string"==typeof t?t:t.getId(),this.map._getMap().setFeatureState({id:e,source:t,sourceLayer:r},n)},e.prototype._buildSources=function(){var e={};return this.sources.forEach((function(t){e[t.getId()]=t._buildSource()})),e},e.prototype.clear=function(){var e=this;this.sources.forEach((function(t){e.remove(t)}))},e.prototype.getById=function(e){return this.sources.get(e)},e.prototype.getSources=function(){return Array.from(this.sources.values())},e.prototype.isSourceLoaded=function(e){return e=e instanceof Uu?e.getId():e,this.map._getMap().isSourceLoaded(e)},e.prototype.remove=function(e,t){var n,r;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var i=jz(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._removeSource(a,t)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}else this._removeSource(e,t)},e.prototype.setSourceState=function(e,t){void 0===t&&(t=!0),this.sources.set(e.getId(),e),e._setMap(this.map,t)},e.prototype.unsetSourceState=function(e){this.sources.has(e)&&(this.sources.get(e)._setMap(null),this.sources.delete(e))},e.prototype._removeSource=function(e,t){if(e=e instanceof Uu?e.getId():e,!this.sources.has(e))throw new Error("'".concat(e,"' is not added to the map"));if(this.map._getMap().getSource(e)&&t&&this.map._getMap().removeSource(e),this.map._getMap().getSource(e)&&t)throw new Error("One or more layers have a dependency on the source '".concat(e,"'"));this.unsetSourceState(e)},e.prototype._addSource=function(e,t){if(this.sources.has(e.getId())){if(t)throw new Error("'".concat(e.getId(),"' is already added to the map"));this.unsetSourceState(e.getId())}if(t){if(!this.map._isReady())throw new Error("The source '".concat(e.getId(),"' could not be added to the map because ")+"the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a source to it.");this.map._getMap().addSource(e.getId(),e._buildSource())}this.setSourceState(e)},e.prototype._mapFeaturesToShapes=function(e,t,n){var r,i,o=[];try{for(var a=jz(e),s=a.next();!s.done;s=a.next()){var l=s.value;if((n||"string"==typeof l.source)&&"string"==typeof l.properties[su._shapeIdPropName]){var c=n||this.sources.get(l.source);if(c instanceof Hu){var u=c.getShapeById(l.properties[su._shapeIdPropName]);if(u instanceof su){o.push(u);continue}}}t||o.push(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o},e.prototype._syncSources=function(e){var t=this;e?(Object.keys(e).map((function(t){var n,r=e[t];switch(r.type){case"vector":case"raster":case"raster-dem":n=new ah(t,{name:t,tiles:r.tiles,type:r.type,url:r.url,tileSize:"tileSize"in r?r.tileSize:void 0});break;case"canvas":n=new Xu(t,r);break;case"geojson":var i=new Hu(t,{maxZoom:r.maxzoom,cluster:r.cluster,clusterRadius:r.clusterRadius,tolerance:r.tolerance,lineMetrics:r.lineMetrics,clusterProperties:r.clusterProperties,buffer:r.buffer,clusterMinPoints:r.clusterMinPoints,generateId:r.generateId,promoteId:r.promoteId,filter:r.filter});"string"!=typeof r.data&&void 0!==r.data&&i._addNoUpdate(r.data),n=i;break;case"image":n=new ed(t,r);break;case"video":n=new nd(t,r);break;default:n=new Qu(t,r)}return n})).forEach((function(e){var n=t.sources.get(e.getId()),r=n&&e._isDeepEqual(n);!r&&n&&t.unsetSourceState(n.getId()),t.setSourceState(e,!r)})),Array.from(this.sources.keys()).filter((function(t){return!(t in e)})).forEach((function(e){return t.unsetSourceState(e)}))):console.warn("syncSources called with no style sources which is unexpected.")},e}(),qz=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vz=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.duration=1e3,t.type="jump",t}return qz(t,e),t}(F),Hz=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gz=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.bottom=0,t.left=0,t.right=0,t.top=0,t}return Hz(t,e),t}(F),Wz=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kz=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Yz=window&&window.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mB=window&&window.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wB=window&&window.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0i[0]&&c[1]=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},LB=function(){function e(e,t){var n=this;this.definitions=function(){return n.initPromise||n.initStyleset()},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(e,t){var r,i,o,a,s=t.filter((function(t){return t in e}));0!==s.length&&(r=n.map._getMap(),i=r.getZoom(),o=n.map.getStyle().style,n._progressiveLoadingState.pendingVisibilityChange&&(n.map.events.remove("load",n._progressiveLoadingState.pendingVisibilityChange),n._progressiveLoadingState.pendingVisibilityChange=null),n._progressiveLoadingState.mapStyle=o,(a=Object.entries(e).reduce((function(e,t){var n=(t=MB(t,2))[0],r=(t=t[1],s.includes(n));return OB(OB([],MB(e),!1),MB(t.filter((function(e){if("custom"===e.type)return!1;if(r)if("number"==typeof e.maxzoom&&"number"==typeof e.minzoom){if(i<=e.maxzoom&&i>=e.minzoom)return!1}else if("number"==typeof e.minzoom){if(i>=e.minzoom)return!1}else{if("number"!=typeof e.maxzoom)return!1;if(i<=e.maxzoom)return!1}return"none"!==(null==(e=e.layout)?void 0:e.visibility)}))),!1)}),[])).forEach((function(e){e.layout=e.layout||{},e.layout.visibility="none"})),n._progressiveLoadingState.pendingVisibilityChange=function(){n._progressiveLoadingState.pendingVisibilityChange=null;var e=n.map.getStyle().style;o===e&&(a.forEach((function(e){e.layout.visibility="visible",r.setLayoutProperty(e.id,"visibility","visible")})),null!=(e=n.map.copyrightDelegate))&&e.reloadAttribution()},n.map.events.addOnce("load",n._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(e){n.map.events.invoke("stylechanged",{style:e.name,map:n.map,type:"stylechanged"})},this._lookUp=function(e){var t,r,i=(a=n.definitions()).errorIfRejected(),o=a.resultIfResolved();if(i||!o)return null;var a=o.configurations,s=void 0;try{for(var l=RB(a),c=l.next();!c.done;c=l.next()){var u=c.value;if(u.name===e.style)return u;u.name===o.defaultConfiguration&&(s=s||u)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s||a[0]},this._lookUpAsync=function(e){return AB(n,void 0,void 0,(function(){var t;return PB(this,(function(n){switch(n.label){case 0:return[4,this.definitions()];case 1:return[2,(t=n.sent()).configurations.find((function(n){return n.name===(e.style||t.defaultConfiguration)}))||t.configurations.find((function(e){return e.name===t.defaultConfiguration}))||t.configurations[0]]}}))}))},this.map=e,this.serviceOptions=t}return e.prototype.updateIndoorState=function(e,t){var n,r,i=this,o=this.map.styles.getMapConfiguration();o?(this.preservedPreindoorMapConfiguration=o,n=this.map.getStyle().style?"".concat(this.map.getStyle().style,"_indoor").concat("dark"===e?"_dark":"","_tileset_").concat(t):void 0,this.map.styles.setMapConfiguration("defaultIndoor_".concat(t),"microsoft-maps:default"===o?n:void 0)):(r=(null==(o=this.indoorState)?void 0:o.tilesetId)!==t,this.indoorState={tilesetId:t,theme:e},this.initStyleset(),this.definitions().then((function(e){var t=(i.map.getStyle().style||e.defaultConfiguration).replace("_indoor_dark","").replace("_indoor",""),n="".concat(t,"_indoor");t=e.configurations.find((function(e){return e.name.startsWith(n)}));t&&i.map.setStyle({style:t.name},!r)})))},e.prototype.unsetIndoorState=function(){var e=this,t=this.preservedPreindoorMapConfiguration;t?this.map.styles.setMapConfiguration(t):(this.indoorState=void 0,this.initStyleset(),this.definitions().then((function(t){var n=e.map.getStyle().style;n.includes("_indoor")&&n.split("_indoor")[0]?e.map.setStyle({style:n.split("_indoor")[0]}):e.map.setStyle({style:void 0})})))},e.prototype.initStyleset=function(){var e,t=this;return e=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new kB(e.then((function(){return t._request(t.serviceOptions.domain,"".concat(T,"/mapconfigurations/metadata/").concat(t.serviceOptions.mapConfiguration),"StyleDefinitions").then((function(e){return TB(TB({},e),{defaultConfiguration:e.defaultConfiguration||e.defaultStyle,configurations:e.configurations||e.styles})}))})))):kB.resolve(this.serviceOptions.mapConfiguration):(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new kB(e.then((function(){return t._request(t.serviceOptions.staticAssetsDomain,"".concat(I,"/").concat(T),"StyleDefinitions",{version:t.serviceOptions.styleDefinitionsVersion,mcv:q.replace(/\./g,"")}).then((function(e){return{version:isNaN(e.version)?0:parseFloat(e.version),defaultConfiguration:e.defaultStyle,configurations:e.styles.filter((function(e){return t.indoorState?"auto"===t.indoorState.theme?e.name.endsWith("dark"===e.theme?"_indoor_dark":"_indoor"):e.name.endsWith("dark"===t.indoorState.theme?"_indoor_dark":"_indoor"):!e.name.includes("indoor")})).map((function(n){return{copyright:n.copyright.join(" "),name:n.name,displayName:function(e){return(e=t.indoorState&&e.includes("_indoor")?e.split("_indoor")[0]:e)in IB?IB[e]:e}(n.name),theme:n.theme,thumbnail:new U({domain:t.serviceOptions.staticAssetsDomain,path:n.thumbnail,protocol:"https"}).toString(),url:new U({domain:t.serviceOptions.staticAssetsDomain,path:"".concat(I,"/").concat(T,"/").concat(n.name),queryParams:{styleVersion:void 0!==e.version&&null!==e.version?e.version:t.serviceOptions.styleDefinitionsVersion,mcv:q.replace(/\./g,"")},protocol:"https"}).toString()}}))}}))})))),this.initPromise&&this.initPromise.switchWith(e),this.initPromise=e,this.initPromise.then((function(e){return t.map._invokeEvent("mapconfigurationchanged",e)})),this.initPromise},e.prototype.getStyle=function(e){if(!(e=this._lookUp(e)))throw Error("Style definition is not available.");if(e.url)return e.url;if(e.style)return e.style;throw Error("Style definition neither contains URL nor style object.")},e.prototype.deriveNewStyleAndLayerGroups=function(e,t){for(var n,r,i=this.map.getStyle(),o=this.map.getTraffic(),a={},s=0;s=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},FB=function(){function e(e){this.map=e,this.indicators=new Set}return e.prototype.add=function(e){var t,n;e=Array.isArray(e)?e:[e];try{for(var r=DB(e),i=r.next();!i.done;i=r.next()){var o=i.value;this.indicators.has(o)||(this.indicators.add(o),o.attach(this.map))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.clear=function(){var e=this;this.indicators.forEach((function(t){e.indicators.delete(t),t.remove()}))},e.prototype.remove=function(e){var t,n;e=Array.isArray(e)?e:[e];try{for(var r=DB(e),i=r.next();!i.done;i=r.next()){var o=i.value;this.indicators.has(o)&&(this.indicators.delete(o),o.remove())}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.getIndicators=function(){return Array.from(this.indicators)},e.prototype._getCollectionDiv=function(){var t=this.map.getMapContainer().querySelector(".".concat(e.Css.collection));return t||((t=document.createElement("div")).setAttribute("aria-label","map data"),t.setAttribute("role","listbox"),t.classList.add(e.Css.collection),this.map.getMapContainer().appendChild(t)),t},e.Css={collection:"accessible-indicator-collection-container"},e}(),zB=window&&window.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),BB=window&&window.__assign||function(){return(BB=Object.assign||function(e){for(var t,n=1,r=arguments.length;ni[0]&&c[1]=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},GB=function(e){function t(n,r){var i,a,s=e.call(this)||this,l=(s.removed=!1,s.loaded=!1,s.ready=!1,s._windowResizeCallback=function(){return s.resize()},!0);s._updateGlobalDefaults(r),s.serviceOptions=(new CB).merge(r),s.styleOptions=(new yB).merge(r),s.trafficOptions=new Ks,s.styles=new LB(s,s.serviceOptions),s.insights=new JM(s.serviceOptions),s.serviceOptions.authOptions.subscriptionKey&&(s.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(s.serviceOptions.authOptions.subscriptionKey)),i=s.serviceOptions.authOptions.clientId||(s.serviceOptions.authOptions.subscriptionKey?s.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),s.insights&&s.insights.setAuthenticatedUserContext(s.serviceOptions.sessionId,i),arguments[2]&&NB()?(a=arguments[2],s.ready=!0,s.loaded=!0):(i={antialias:s.styleOptions.antialias,attributionControl:!1,container:n,fadeDuration:s.serviceOptions.fadeDuration,localIdeographFontFamily:s.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:s.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:s.serviceOptions.refreshExpiredTiles,renderWorldCopies:s.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(e,t){var n={url:e};return"Tile"===t||"Source"===t?(e.includes(w)&&s.insights&&s.insights.trackEvent({name:"TileLoad"}),s._substituteDomainLanguageViewAndSignInRequest(e,n)):"Style"!==t&&"SpriteJSON"!==t&&"SpriteImage"!==t&&"Glyphs"!==t||s.styles._transformStyleRequest(e,n),s.serviceOptions.transformRequest&&zs(n,s.serviceOptions.transformRequest(n.url,t)),n}},a=new c.Map(i));try{s.map=a,s.authentication=new _z(s),s.controls=new wz(s),s.events=new Iz(s),s.imageSprite=new Pz(s),s.layers=new Fz(s),s.markers=new Az(s),s.sources=new Uz(s),s.popups=new Bz(s),s.indicators=new FB(s),s.map.getContainer().classList.add(t.Css.container),s.map.getCanvasContainer().classList.add(t.Css.canvasContainer),s.map.getCanvas().classList.add(t.Css.canvas),s._detectHighContrast(),s.copyrightControl=new tO({showFeedbackLink:s.styleOptions.showFeedbackLink,showLogo:s.styleOptions.showLogo,customAttribution:s.styleOptions.customAttribution}),s.controls.add(s.copyrightControl,{position:o.NonFixed});var u=s.authentication?s.authentication.initialize():Promise.resolve();if(s.removed)return s;var d=function(){s.loaded=!0,s.map.off("load",d)},h=(s.map.on("load",d),function(){s.ready=!0,s.map.off("styledata",h),s.events.invoke("ready",{map:s,type:"ready"})});s.map.on("styledata",h),s._setAutoResize(s.styleOptions.autoResize),s.map.showTileBoundaries=s.styleOptions.showTileBoundaries,s.localizedStringsPromise=jh.getStrings(s.styleOptions.language),u.then((function(){return s.styles.definitions()})).then((function(e){if(!s.removed){if(s.authentication&&!s.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");s.serviceOptions["enable-accessibility"]&&s.accessibleMapDelegate.addToMap(),s._setStyleComponents(s.styleOptions),s.copyrightDelegate&&s.copyrightDelegate.addToMap()}})).catch((function(e){e=e instanceof Error?e:new Error(e),s.insights.trackException({error:e}),e={map:s,type:"error",error:e},s.events.invoke("error",e)})),s.setCamera(BB(BB({minZoom:1},r),{type:"jump",duration:0})),s.incidentDelegate=new vO(s),s.flowDelegate=new hO(s),s.accessibleMapDelegate=new dO(s),s.userInteractionDelegate=new SO(s,r),s.userInteractionDelegate.addToMap(),s.copyrightDelegate=new UO(s,s.copyrightControl,s.styleOptions)}catch(n){throw l=!1,s.insights.trackException({error:n instanceof Error?n:new Error(n)}),n}finally{s.insights.trackEvent({name:"MapLoad"},{success:l,supported:Oh(),supportedWithPerformance:Oh({failIfMajorPerformanceCaveat:!0})}),s.insights.flush()}return s}return zB(t,e),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.removed},enumerable:!1,configurable:!0}),t.prototype.getCanvas=function(){return this.map.getCanvas()},t.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},t.prototype.getMapContainer=function(){return this.map.getContainer()},t.prototype.getServiceOptions=function(){return Du(this.serviceOptions,CB._cloneCustomizer)},t.prototype.setServiceOptions=function(e){this.serviceOptions=(new CB).merge(this.serviceOptions,e),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap(),e=this.styles.serviceOptions.mapConfiguration!==this.serviceOptions.mapConfiguration||this.styles.serviceOptions.staticAssetsDomain!==this.serviceOptions.staticAssetsDomain||this.styles.serviceOptions.styleDefinitionsVersion!==this.serviceOptions.styleDefinitionsVersion||this.styles.serviceOptions.domain!==this.serviceOptions.domain||this.styles.serviceOptions.styleAPIVersion!==this.serviceOptions.styleAPIVersion,this.styles.serviceOptions=this.serviceOptions,e&&(this.styles.initPromise=null,this.setStyle({}))},t.prototype.addRequestTransformer=function(e){this.serviceOptions.addTransformer(e)},t.prototype.removeRequestTransformer=function(e){this.serviceOptions.removeTransformer(e)},t.prototype.setCamera=function(e,t){if(void 0===t&&(t=!1),"padding"in e||"offset"in e||"bounds"in e){var n,r=(new Xz).merge({maxZoom:this.getCamera().maxZoom},e),i=this._generateSafeBounds(r.bounds),o={padding:r.padding,offset:r.offset,maxZoom:r.maxZoom};if(!(n=this.map.cameraForBounds(i,o)))throw a={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:null==(a=null==(a=this.map)?void 0:a.getContainer())?void 0:a.clientWidth,containerHeight:null==a?void 0:a.clientHeight,safeBounds:i,cameraForBoundsOptions:o},new Error(JSON.stringify(a));"pitch"in e&&(n.pitch=e.pitch),"bearing"in e&&(n.bearing=e.bearing),"minPitch"in e&&this.map.setMinPitch(e.minPitch),"maxPitch"in e&&this.map.setMaxPitch(e.maxPitch),this.map.setMaxZoom(r.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),i=this._generateSafeBounds(r.maxBounds)}else(o=(new Qz).merge(this.getCamera(),e)).centerOffset&&2<=o.centerOffset.length&&(a=o.centerOffset,(r=Vc([o.center],o.zoom))[0][0]+=a[0],r[0][1]+=a[1],o.center=qc(r,o.zoom)[0]),n={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,around:void 0},this.map.setMinZoom(o.minZoom),this.map.setMaxZoom(o.maxZoom),o.minPitch&&this.map.setMinPitch(o.minPitch),o.maxPitch&&this.map.setMaxPitch(o.maxPitch),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),i=this._generateSafeBounds(o.maxBounds);i?this.map.setMaxBounds(i):this.map.setMaxBounds(null);var a=(new Vz).merge(e);r={duration:a.duration,easing:function(e){return e},offset:[0,0],animate:!0},o={fromControl:t};"jump"===a.type?this.map.jumpTo(n,o):"ease"===a.type?this.map.easeTo(BB(BB({},n),r),o):"fly"===a.type&&this.map.flyTo(BB(BB({},n),r),o)},t.prototype.setCameraBounds=function(e){this.setCamera(e)},t.prototype.getCamera=function(){var e=this.map.getBounds().getSouthWest().toArray(),t=this.map.getBounds().getNorthEast().toArray();return{zoom:this.map.getZoom(),center:this.map.getCenter().toArray(),bearing:this.map.getBearing(),pitch:this.map.getPitch(),bounds:new uu(e,t),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},t.prototype.setStyle=function(e,t){void 0===t&&(t=!0),delete e.preserveDrawingBuffer,(e=(new yB).merge(this.styleOptions,e)).autoResize!==this.styleOptions.autoResize&&this._setAutoResize(e.autoResize),e.language!==this.styleOptions.language&&(this.localizedStringsPromise=jh.getStrings(e.language)),e.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(e.renderWorldCopies),e.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:e.showFeedbackLink}),e.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:e.customAttribution}),e.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:e.showLogo}),e.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=e.showTileBoundaries),e.showBuildingModels&&console.warn("showBuildingModels is deprecated."),t=t&&this.styleOptions.language===e.language&&this.styleOptions.view===e.view,this.styleOptions=e,this._setStyleComponents(e,t)},t.prototype.getStyle=function(){return _a(this.styleOptions)},t.prototype.addIcon=function(e,t){this.imageSprite.add(e,t)},t.prototype.addPins=function(e,t){t=(new aB).merge(t);var n=this.layers.getLayerById(t.name),r=!1;if(n||(r=!0,n=new rh("".concat(t.name,"-source"),t.name,{source:"".concat(t.name,"-source"),minZoom:t.minZoom,maxZoom:t.maxZoom,iconOptions:{anchor:"center",size:t.iconSize,image:["case",["has","icon"],["get","icon"],t.icon],ignorePlacement:!t.cluster,opacity:t.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],t.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[t.textFont]]],size:["case",["has","point_count"],20,t.fontSize],ignorePlacement:!t.cluster,opacity:t.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[t.textOffset[0]/16,t.textOffset[1]/16]]],color:t.fontColor}})),!(n instanceof rh))throw new Error("A layer with name '".concat(t.name,"' already exists but it is not a SymbolLayer.")+"A SymbolLayer should be used for rendering pins.");var i=n.getSource(),o=("string"==typeof i?(a=i,i=this.sources.getById(a)):a=i.getId(),!1);if(i||(o=!0,i=new Hu(a,{cluster:t.cluster})),!(i instanceof Hu))throw new Error("The source with name '".concat(a,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");o&&this.sources.add(i),r&&this.layers.add(n,t.before);var a=new du(e);t.overwrite?i.setShapes(a):i.add(a)},t.prototype.addCircles=function(e,t){t=(new nB).merge(t);var n=this.layers.getLayerById(t.name),r=!1;if(n||(r=!0,n=new xd("".concat(t.name,"-source"),t.name,{source:"".concat(t.name,"-source"),minZoom:t.minZoom,maxZoom:t.maxZoom,opacity:t.opacity,radius:["case",["has","radius"],["get","radius"],t.radius],color:["case",["has","color"],["get","color"],t.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],t.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],t.outlineWidth]})),!(n instanceof xd))throw new Error("A layer with name '".concat(t.name,"' already exists but it is not a BubbleLayer.")+"A BubbleLayer should be used for rendering circles.");var i=n.getSource(),o=("string"==typeof i?(a=i,i=this.sources.getById(a)):a=i.getId(),!1);if(i||(o=!0,i=new Hu(a)),!(i instanceof Hu))throw new Error("The source with name '".concat(a,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");o&&this.sources.add(i),r&&this.layers.add(n,t.before);var a=new du(e);t.overwrite?i.setShapes(a):i.add(a)},t.prototype.addLinestrings=function(e,t){t=(new iB).merge(t);var n=this.layers.getLayerById(t.name),r=!1;if(n||(r=!0,n=new Bd("".concat(t.name,"-source"),t.name,{source:"".concat(t.name,"-source"),minZoom:t.minZoom,maxZoom:t.maxZoom,lineCap:t.cap,lineJoin:t.join,strokeOpacity:t.opacity,strokeColor:["case",["has","color"],["get","color"],t.color],strokeWidth:["case",["has","width"],["get","width"],t.width]})),!(n instanceof Bd))throw new Error("A layer with name '".concat(t.name,"' already exists but it is not a LineLayer.")+"A LineLayer should be used for rendering linestrings.");var i=n.getSource(),o=("string"==typeof i?(a=i,i=this.sources.getById(a)):a=i.getId(),!1);if(i||(o=!0,i=new Hu(a)),!(i instanceof Hu))throw new Error("The source with name '".concat(a,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");o&&this.sources.add(i),r&&this.layers.add(n,t.before);var a=new du(e);t.overwrite?i.setShapes(a):i.add(a)},t.prototype.addPolygons=function(e,t){t=(new lB).merge(t);var n=this.layers.getLayerById(t.name),r=!1;if(n||(r=!0,n=new Yd("".concat(t.name,"-source"),t.name,{source:"".concat(t.name,"-source"),minZoom:t.minZoom,maxZoom:t.maxZoom,fillOpacity:t.opacity,fillColor:["case",["has","color"],["get","color"],t.color]})),!(n instanceof Yd))throw new Error("A layer with name '".concat(t.name,"' already exists but it is not a PolygonLayer.")+"A PolygonLayer should be used for rendering linestrings.");var i=n.getSource(),o=("string"==typeof i?(a=i,i=this.sources.getById(a)):a=i.getId(),!1);if(i||(o=!0,i=new Hu(a)),!(i instanceof Hu))throw new Error("The source with name '".concat(a,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");o&&this.sources.add(i),r&&this.layers.add(n,t.before);var a=new du(e);t.overwrite?i.setShapes(a):i.add(a)},t.prototype.addRaster=function(e,t){t=(new uB).merge(t);var n,r=this.layers.getLayerById(t.name);if(!((r=r||new hh({maxZoom:t.maxZoom,minZoom:t.minZoom,opacity:t.opacity,tileSize:256,tileUrl:"{subdomain}"},t.name))instanceof hh))throw new Error("A layer with name '".concat(t.name,"' already exists but it is not a TileLayer.")+"A TileLayer should be used for rendering raster images.");if("{subdomain}"!==r.getOptions().tileUrl)throw new Error("A TileLayer with name '".concat(t.name,"' already exists but was configured ")+"for a single tile url [default for new TileLayer(...)].");(n=!t.overwrite&&r.getOptions().subdomains||[]).push.apply(n,VB([],qB(e),!1)),r._setOptionsNoUpdate({subdomains:n}),this.layers.add(r,t.before)},t.prototype.getLayers=function(){return this.layers.getLayers().map((function(e){return e.getId()}))},t.prototype.removeLayers=function(e){var t,n;try{for(var r=HB(e),i=r.next();!i.done;i=r.next()){var o,a=i.value;this.layers.getLayerById(a)&&(this.layers.remove(a),o="".concat(a,"-source"),this.sources.getById(o))&&this.sources.remove(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},t.prototype.addHtml=function(e,t){e.id||(e.id="marker_".concat($l()));var n=new Mh({htmlContent:e});return this.markers.add(n,t),e.id},t.prototype.removeHtml=function(e){this.markers.remove(e)},t.prototype.addEventListener=function(e,t,n){this.events._addLegacy(e,t,n)},t.prototype.removeEventListener=function(e,t,n){this.events._removeLegacy(e,t,n)},t.prototype.setUserInteraction=function(e){this.userInteractionDelegate.setOptions(e)},t.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},t.prototype.addControl=function(e,t){this.controls.add(e,t)},t.prototype.removeControl=function(e){this.controls.remove(e)},t.prototype.setTraffic=function(e){var t=this.trafficOptions.incidents,n=this.trafficOptions.flow;if(this.trafficOptions=(new Ks).merge(this.trafficOptions,e),this.controls.getControls().filter((function(e){return e instanceof Js})).forEach((function(e){return e.updateButtonState()})),this.incidentDelegate&&(this.trafficOptions.incidents?t||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow){["absolute","relative-delay"].includes(this.trafficOptions.flow)&&console.warn("The 'absolute' and 'relative-delay' flow options are deprecated. Please use 'relative' instead.");try{this.trafficOptions.flow!==n&&this.flowDelegate.addToMap()}catch(e){throw this.trafficOptions.flow=n,e}}else this.flowDelegate.removeFromMap()},t.prototype.getTraffic=function(){return _a(this.trafficOptions)},t.prototype.remove=function(){this.dispose()},t.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear(),this.indicators.clear()},t.prototype.dispose=function(){var e;for(this.clear(),this.map.remove(),null!=(e=this.authentication)&&e.dispose(),this.removed=!0,window.removeEventListener("resize",this._windowResizeCallback);this.getMapContainer().firstChild;){var t=this.getMapContainer().firstChild;this.getMapContainer().removeChild(t)}},t.prototype.resize=function(e,t,n){"number"!=typeof e&&"string"!=typeof e||"number"!=typeof t&&"string"!=typeof t?n=e:(this.getMapContainer().style.height="number"==typeof e?"".concat(e,"px"):e,this.getMapContainer().style.width="number"==typeof t?"".concat(t,"px"):t),e=this.getMapContainer().style.overflow,this.getMapContainer().style.overflow="hidden",this.map.resize(n),this.getMapContainer().style.overflow=e},t.prototype.pixelsToPositions=function(e){var t,n,r=[];try{for(var i=HB(e),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.map.unproject(a);r.push(new ru(s.lng,s.lat))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},t.prototype.positionsToPixels=function(e){var t,n,r=[];try{for(var i=HB(e),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.map.project(a);r.push(new nc(s.x,s.y))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},t.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},t.prototype.stop=function(){this.map.stop()},t.prototype.triggerRepaint=function(){this.map.triggerRepaint()},t.prototype.enableElevation=function(e,t){this.map.setTerrain("string"==typeof e?{source:e,exaggeration:t}:{source:e.getId(),exaggeration:t})},t.prototype.disableElevation=function(){this.map.setTerrain(null)},t.prototype._getMap=function(){return this.map},t.prototype._rebuildStyle=function(e){return void 0===e&&(e=!0),jB(this,void 0,void 0,(function(){return UB(this,(function(t){return this.styles.setStyle(this.styleOptions,e),this.imageSprite._restoreImages(),[2]}))}))},t.prototype._isLoaded=function(){return this.loaded},t.prototype._isReady=function(){return this.ready},t.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},t.prototype._sendRequest=function(e,t,n){var r;return(r="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(e,t):r)?fetch(r.url||e,{credentials:r.credentials,headers:BB(BB({},n),r.headers),method:"GET",mode:"cors"}):fetch(e,{headers:n,method:"GET",mode:"cors"})},t.prototype._substituteDomainLanguageViewAndSignInRequest=function(e,t){var n;(e.includes(w)||e.includes(b))&&(n=new RegExp("[^{]".concat(w,"[^}]")),e.match(n)&&(t.url=t.url.replace(w,b)),U.protoRegEx.test(this.serviceOptions.domain)?(n=t.url.indexOf(b),t.url=this.serviceOptions.domain+t.url.substring(n+b.length)):t.url=t.url.replace(b,this.serviceOptions.domain)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!=(n=this.authentication)&&n.signRequest(t),e.includes(C)&&(t.url=t.url.replace(C,this.styleOptions.language)),e.includes(x)&&(t.url=this.styleOptions.view?t.url.replace(x,this.styleOptions.view):t.url.replace(x,"").replace("&".concat(S,"="),""))},t.prototype._setAutoResize=function(e){e?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},t.prototype._setStyleComponents=function(e,t){var n=this;void 0===t&&(t=!0),this.removed||this.styles.definitions().then((function(r){var i,o,a=!0;if(n.styleOptions.style)try{for(var s=HB(r.configurations),l=s.next();!l.done;l=s.next()){var c=l.value;if(n.styleOptions.style===c.name){a=!1;break}}}catch(r){i={error:r}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}a&&(n.styleOptions.style=r.defaultConfiguration),n.styleOptions=e,n._rebuildStyle(t)}))},t.prototype._updateGlobalDefaults=function(e){e&&(e.authOptions&&!Up()&&Cp(e.authOptions),e.domain&&!qp()&&Ep(e.domain),e.styleDefinitionsPath&&!Vp()&&kp(e.styleDefinitionsPath),e.workerCount&&!Gp()&&Ap(e.workerCount),e.maxParallelImageRequests&&!Wp()&&Pp(e.maxParallelImageRequests),!e.subscriptionKey&&!e["subscription-key"]||Up()||Rp(e.subscriptionKey||e["subscription-key"]),!e.sessionId&&!e["session-id"]||Yp()||Op(e.sessionId||e["session-id"]),e.language&&!Kp()&&Mp(e.language),!e.userRegion&&!e.view||Zp()||Lp(e.userRegion||e.view))},t.prototype._generateSafeBounds=function(e){if(e){var t=uu.getSouth(e),n=uu.getWest(e),r=uu.getNorth(e),i=uu.getEast(e);if(!(isFinite(t)&&isFinite(n)&&isFinite(r)&&isFinite(i)))throw new Error("The bounds specified are invalid: [".concat(e,"]"));for(;i)/)),c=Math.max.apply(Math,KB([],WB(l.map((function(e){return e.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length}))),!1))-1,u=Math.ceil(3.5*c);u/g,"").length/o)*u)),r.width=a+"px",r.height=i||280'+'')+"")+'
').concat(t,"
");return void 0===r.srcdoc?r.src="data:text/html;charset=utf-8,"+encodeURI(o):r.srcdoc=o,r},e._appendChild=function(e,t,n){t&&(n&&(t.className=(t.className?t.className+" ":"")+n),e.appendChild(t))},e._generateContent=function(e,t,n){return t?Array.isArray(t)?this._generatePropertyInfoTable(e,t,n):this._applyStringTemplate(e,t,n):(t=this._generateDynamicTableHtml(e,null,n))?((e=document.createElement("div")).innerHTML=t,e):null},e._applyStringTemplate=function(e,t,n){if(t){for(var r,i,o=t,a=this._placeholderRx.exec(t);a;)2<=a.length&&(r=this._getPropertyValue(e,a[1],n),o=o.replace(a[0],r)),a=this._placeholderRx.exec(t);if(o)return(o=o.trim()).includes("<")&&(o=o.replace(/[\r\n]+/g,"
")),(i=document.createElement("div")).innerHTML=o,i}return null},e._getPropertyValue=function(e,t,n,r){var i=n.parsePropertyPaths?t.split("/"):[t],o=i.length;if(0'),e.title?u.push(e.title):l&&l.label?u.push(l.label):u.push(e.href),u.push("","
")})),u.pop(),u.join("")}if(null!=s){var h=void 0;for(h=1;h\s]/g.test(e)&&(n.detectHyperlinks||r&&r.hyperlinkFormat)){e=e.trim(),t=this._isUrlRx.test(e)||r&&r.hyperlinkFormat;var p,f=this._isImageUrlRx.test(e)&&(t||e.startsWith("data:image")),m=this._emailRx.test(e);if(t||f||m)return t=void 0,p=void(r&&r.hyperlinkFormat?t=r.hyperlinkFormat:n&&n.hyperlinkFormat&&(t=n.hyperlinkFormat)),p=t&&t.target?' target="'.concat(t.target,'"'):' target="_blank"',r="".concat(t&&t.label?t.label:e),t&&t.scheme?e=t.scheme+e:m&&(e="mailto:"+e),n=t&&t.label?' alt="'.concat(t.label,'"'):"",(t&&t.isImage||f)&&(r='')),'").concat(r,"")}return e.toString()}}}return""},e._generatePropertyInfoTable=function(e,t,n){var r,i;return e&&t&&0')),t.forEach((function(t){var o=i._getPropertyValue(e,t.propertyPath,n,t);t.hideLabel?r.push('',o,""):(t=t.label||t.propertyPath.split("/")[0],r.push("",t,"",o,""))})),r.push(""),(t=document.createElement("div")).innerHTML=r.join(""),t):null},e._generateDynamicTableHtml=function(e,t,n){var r,i,o,a,s=this;return e&&((r=[]).push('')),o=t&&0"),a++)})),0!==a)?(r.push("
",t,"",i._getPropertyValue(e,o+t,n),"
"),r.join("")):null},e._ignoreProperty=function(e,t){switch(e){case"title":case"name":case"base":case"popupTemplate":case"anchor":case"icon":case"image":case"imageUrl":case"rotation":case"color":case"size":case"offset":case"strokeColor":case"strokeWidth":case"strokeOpacity":case"subType":case"fillColor":case"fillOpacity":case"visibility":case"visible":return!0;default:if(0===e.indexOf("_")||null==t||""===t)return!0}return!1},e._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,e._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,e._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,e._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,e._cssUrl=new U({domain:d,path:"sdk/javascript/mapcontrol/".concat(V.getEndpointVersion(),"/atlas.min.css")}).toString(),e.Css={template:"azure-maps-control-popup-template",title:"azure-maps-control-popup-template-title",content:"azure-maps-control-popup-template-content",item:"azure-maps-control-popup-template-content-item",table:"azure-maps-control-popup-template-table"},e}(),ZB=new U({domain:d,path:"sdk/javascript/mapcontrol/".concat(V.getEndpointVersion(),"/mapbox-gl-rtl-text.min.js")}),XB=(c.setRTLTextPlugin(ZB.toString(),(function(e){e&&console.warn(e)}),!0),Object.freeze({__proto__:null,get AuthenticationType(){return Nh},get ControlPosition(){return o},get ControlStyle(){return a},HtmlMarker:Mh,Map:GB,Pixel:nc,Popup:Ih,PopupTemplate:YB,Shape:su,_getAssetDomain:Xp,_getDomain:Jp,_hasMaxParallelImageRequests:Wp,_hasSetAuthenticationOptions:Up,_hasSetDomain:qp,_hasSetLanguage:Kp,_hasSetSessionId:Yp,_hasSetStyleDefinitionsPath:Vp,_hasSetStyleDefinitionsVersion:Hp,_hasSetView:Zp,_hasWorkerCount:Gp,addImageTemplate:Dp,clearPrewarmedResources:jp,control:Ru,data:_u,getAllImageTemplateNames:zp,getAuthenticationOptions:cp,getDomain:dp,getImageTemplate:Fp,getLanguage:yp,getMaxParallelImageRequests:gp,getSessionId:vp,getStaticAssetsDomain:up,getStyleAPIVersion:fp,getStyleDefinitionsPath:hp,getStyleDefinitionsVersion:pp,getSubscriptionKey:_p,getUserRegion:bp,getVersion:xp,getView:wp,getWorkerCount:mp,internal:J,isSupported:Sp,layer:yh,math:Tu,prewarm:Bp,setAuthenticationOptions:Cp,setDomain:Ep,setLanguage:Mp,setMaxParallelImageRequests:Pp,setSessionId:Op,setStyleAPIVersion:Tp,setStyleDefinitionsPath:kp,setStyleDefinitionsVersion:Ip,setSubscriptionKey:Rp,setUserRegion:Lp,setView:Np,setWorkerCount:Ap,source:ud}))},1192:(e,t,n)=>{"use strict";var r=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){var r;"default"!==n&&(r=Object.getOwnPropertyDescriptor(e,n),Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}}))})),t.default=e,Object.freeze(t)}(n(7572)),i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&(c(e,t),setTimeout((function(){u(e,t)}),n))}function a(e){return Math.max(Math.min(e,100),0)}function s(e){return Array.isArray(e)?e:[e]}function l(e){var t=(e=String(e)).split(".");return t.length>1?t[1].length:0}function c(e,t){e.classList&&!/\s/.test(t)?e.classList.add(t):e.className+=" "+t}function u(e,t){e.classList&&!/\s/.test(t)?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function d(e){var t=void 0!==window.pageXOffset,n="CSS1Compat"===(e.compatMode||"");return{x:t?window.pageXOffset:n?e.documentElement.scrollLeft:e.body.scrollLeft,y:t?window.pageYOffset:n?e.documentElement.scrollTop:e.body.scrollTop}}function h(e,t){return 100/(t-e)}function p(e,t,n){return 100*t/(e[n+1]-e[n])}function f(e,t){for(var n=1;e>=t[n];)n+=1;return n}function m(e,t,n){if(n>=e.slice(-1)[0])return 100;var r=f(n,e),i=e[r-1],o=e[r],a=t[r-1],s=t[r];return a+function(e,t){return p(e,e[0]<0?t+Math.abs(e[0]):t-e[0],0)}([i,o],n)/h(a,s)}function g(e,t,n,r){if(100===r)return r;var i=f(r,e),o=e[i-1],a=e[i];return n?r-o>(a-o)/2?a:o:t[i-1]?e[i-1]+function(e,t){return Math.round(e/t)*t}(r-e[i-1],t[i-1]):r}function y(t,n,r){var o;if("number"===typeof n&&(n=[n]),!Array.isArray(n))throw new Error("noUiSlider ("+e+"): 'range' contains invalid value.");if(!i(o="min"===t?0:"max"===t?100:parseFloat(t))||!i(n[0]))throw new Error("noUiSlider ("+e+"): 'range' value isn't numeric.");r.xPct.push(o),r.xVal.push(n[0]),o?r.xSteps.push(!isNaN(n[1])&&n[1]):isNaN(n[1])||(r.xSteps[0]=n[1]),r.xHighestCompleteStep.push(0)}function v(e,t,n){if(t)if(n.xVal[e]!==n.xVal[e+1]){n.xSteps[e]=p([n.xVal[e],n.xVal[e+1]],t,0)/h(n.xPct[e],n.xPct[e+1]);var r=(n.xVal[e+1]-n.xVal[e])/n.xNumSteps[e],i=Math.ceil(Number(r.toFixed(3))-1),o=n.xVal[e]+n.xNumSteps[e]*i;n.xHighestCompleteStep[e]=o}else n.xSteps[e]=n.xHighestCompleteStep[e]=n.xVal[e]}function _(e,t,n){var r;this.xPct=[],this.xVal=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=t;var i=[];for(r in e)e.hasOwnProperty(r)&&i.push([e[r],r]);for(i.length&&"object"===typeof i[0][0]?i.sort((function(e,t){return e[0][0]-t[0][0]})):i.sort((function(e,t){return e[0]-t[0]})),r=0;rthis.xPct[i+1];)i++;else e===this.xPct[this.xPct.length-1]&&(i=this.xPct.length-2);n||e!==this.xPct[i+1]||i++;var o=1,a=t[i],s=0,l=0,c=0,u=0;for(r=n?(e-this.xPct[i])/(this.xPct[i+1]-this.xPct[i]):(this.xPct[i+1]-e)/(this.xPct[i+1]-this.xPct[i]);a>0;)s=this.xPct[i+1+u]-this.xPct[i+u],t[i+u]*o+100-100*r>100?(l=s*r,o=(a-100*r)/t[i+u],r=1):(l=t[i+u]*s/100*o,o=0),n?(c-=l,this.xPct.length+u>=1&&u--):(c+=l,this.xPct.length-u>=1&&u++),a=t[i+u]*o;return e+c},_.prototype.toStepping=function(e){return e=m(this.xVal,this.xPct,e)},_.prototype.fromStepping=function(e){return function(e,t,n){if(n>=100)return e.slice(-1)[0];var r=f(n,t),i=e[r-1],o=e[r],a=t[r-1];return function(e,t){return t*(e[1]-e[0])/100+e[0]}([i,o],(n-a)*h(a,t[r]))}(this.xVal,this.xPct,e)},_.prototype.getStep=function(e){return e=g(this.xPct,this.xSteps,this.snap,e)},_.prototype.getDefaultStep=function(e,t,n){var r=f(e,this.xPct);return(100===e||t&&e===this.xPct[r-1])&&(r=Math.max(r-1,1)),(this.xVal[r]-this.xVal[r-1])/n},_.prototype.getNearbySteps=function(e){var t=f(e,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},_.prototype.countStepDecimals=function(){var e=this.xNumSteps.map(l);return Math.max.apply(null,e)},_.prototype.convert=function(e){return this.getStep(this.toStepping(e))};var b={to:function(e){return void 0!==e&&e.toFixed(2)},from:Number},w={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},x=".__tooltips",S=".__aria";function C(t){if(function(e){return"object"===typeof e&&"function"===typeof e.to&&"function"===typeof e.from}(t))return!0;throw new Error("noUiSlider ("+e+"): 'format' requires 'to' and 'from' methods.")}function E(t,n){if(!i(n))throw new Error("noUiSlider ("+e+"): 'step' is not numeric.");t.singleStep=n}function k(t,n){if(!i(n))throw new Error("noUiSlider ("+e+"): 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=n}function I(t,n){if(!i(n))throw new Error("noUiSlider ("+e+"): 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=n}function T(t,n){if("object"!==typeof n||Array.isArray(n))throw new Error("noUiSlider ("+e+"): 'range' is not an object.");if(void 0===n.min||void 0===n.max)throw new Error("noUiSlider ("+e+"): Missing 'min' or 'max' in 'range'.");if(n.min===n.max)throw new Error("noUiSlider ("+e+"): 'range' 'min' and 'max' cannot be equal.");t.spectrum=new _(n,t.snap,t.singleStep)}function A(t,n){if(n=s(n),!Array.isArray(n)||!n.length)throw new Error("noUiSlider ("+e+"): 'start' option is incorrect.");t.handles=n.length,t.start=n}function P(t,n){if(t.snap=n,"boolean"!==typeof n)throw new Error("noUiSlider ("+e+"): 'snap' option must be a boolean.")}function M(t,n){if(t.animate=n,"boolean"!==typeof n)throw new Error("noUiSlider ("+e+"): 'animate' option must be a boolean.")}function O(t,n){if(t.animationDuration=n,"number"!==typeof n)throw new Error("noUiSlider ("+e+"): 'animationDuration' option must be a number.")}function R(t,n){var r,i=[!1];if("lower"===n?n=[!0,!1]:"upper"===n&&(n=[!1,!0]),!0===n||!1===n){for(r=1;r1)throw new Error("noUiSlider ("+e+"): 'padding' option must not exceed 100% of the range.")}}function z(t,n){switch(n){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider ("+e+"): 'direction' option was not recognized.")}}function B(t,n){if("string"!==typeof n)throw new Error("noUiSlider ("+e+"): 'behaviour' must be a string containing options.");var r=n.indexOf("tap")>=0,i=n.indexOf("drag")>=0,o=n.indexOf("fixed")>=0,a=n.indexOf("snap")>=0,s=n.indexOf("hover")>=0,l=n.indexOf("unconstrained")>=0;if(o){if(2!==t.handles)throw new Error("noUiSlider ("+e+"): 'fixed' behaviour must be used with 2 handles");N(t,t.start[1]-t.start[0])}if(l&&(t.margin||t.limit))throw new Error("noUiSlider ("+e+"): 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||a,drag:i,fixed:o,snap:a,hover:s,unconstrained:l}}function j(t,n){if(!1!==n)if(!0===n){t.tooltips=[];for(var r=0;r0&&((a=L(r,!1)).className=u(o,l.cssClasses.value),a.setAttribute("data-value",i),a.style[l.style]=e+"%",a.innerHTML=n.to(i))}}(i,e[i][0],e[i][1])})),r}function V(){g&&(t(g),g=null)}function H(t){V();var n=t.mode,r=t.density||1,i=t.filter||!1,o=function(t,n,r){if("range"===t||"steps"===t)return C.xVal;if("count"===t){if(n<2)throw new Error("noUiSlider ("+e+"): 'values' (>= 2) required for mode 'count'.");var i=n-1,o=100/i;for(n=[];i--;)n[i]=i*o;n.push(100),t="positions"}return"positions"===t?n.map((function(e){return C.fromStepping(r?C.getStep(e):e)})):"values"===t?r?n.map((function(e){return C.fromStepping(C.getStep(C.toStepping(e)))})):n:void 0}(n,t.values||!1,t.stepped||!1),a=function(e,t,n){function r(e,t){return(e+t).toFixed(7)/1}var i={},o=C.xVal[0],a=C.xVal[C.xVal.length-1],s=!1,l=!1,c=0;return n=function(e){return e.filter((function(e){return!this[e]&&(this[e]=!0)}),{})}(n.slice().sort((function(e,t){return e-t}))),n[0]!==o&&(n.unshift(o),s=!0),n[n.length-1]!==a&&(n.push(a),l=!0),n.forEach((function(o,a){var u,d,h,p,f,m,g,y,v,_,b=o,w=n[a+1],x="steps"===t;if(x&&(u=C.xNumSteps[a]),u||(u=w-b),!1!==b)for(void 0===w&&(w=b),u=Math.max(u,1e-7),d=b;d<=w;d=r(d,u)){for(y=(f=(p=C.toStepping(d))-c)/e,_=f/(v=Math.round(y)),h=1;h<=v;h+=1)i[(m=c+h*_).toFixed(5)]=[C.fromStepping(m),0];g=n.indexOf(d)>-1?1:x?2:0,!a&&s&&d!==w&&(g=0),d===w&&l||(i[p.toFixed(5)]=[d,g]),c=p}})),i}(r,n,o),s=t.format||{to:Math.round};return g=w.appendChild(q(a,i,s))}function G(){var e=p.getBoundingClientRect(),t="offset"+["Width","Height"][l.ort];return 0===l.ort?e.width||p[t]:e.height||p[t]}function W(e,t,n,r){var i=function(i){return i=function(e,t,n){var r,i,o=0===e.type.indexOf("touch"),a=0===e.type.indexOf("mouse"),s=0===e.type.indexOf("pointer");0===e.type.indexOf("MSPointer")&&(s=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(o){var l=function(e){return e.target===n||n.contains(e.target)||e.target.shadowRoot&&e.target.shadowRoot.contains(n)};if("touchstart"===e.type){var c=Array.prototype.filter.call(e.touches,l);if(c.length>1)return!1;r=c[0].pageX,i=c[0].pageY}else{var u=Array.prototype.find.call(e.changedTouches,l);if(!u)return!1;r=u.pageX,i=u.pageY}}t=t||d(P),(a||s)&&(r=e.clientX+t.x,i=e.clientY+t.y);return e.pageOffset=t,e.points=[r,i],e.cursor=a||s,e}(i,r.pageOffset,r.target||t),!!i&&(!(z()&&!r.doNotReject)&&(!(function(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}(w,l.cssClasses.tap)&&!r.doNotReject)&&(!(e===_.start&&void 0!==i.buttons&&i.buttons>1)&&((!r.hover||!i.buttons)&&(b||i.preventDefault(),i.calcPoint=i.points[l.ort],void n(i,r))))))},o=[];return e.split(" ").forEach((function(e){t.addEventListener(e,i,!!b&&{passive:!0}),o.push([e,i])})),o}function Y(e){var t=e-function(e,t){var n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.documentElement,o=d(r);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0),t?n.top+o.y-i.clientTop:n.left+o.x-i.clientLeft}(p,l.ort),n=100*t/G();return n=a(n),l.dir?100-n:n}function Z(e,t){"mouseout"===e.type&&"HTML"===e.target.nodeName&&null===e.relatedTarget&&J(e,t)}function X(e,t){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===e.buttons&&0!==t.buttonsProperty)return J(e,t);var n=(l.dir?-1:1)*(e.calcPoint-t.startCalcPoint);ae(n>0,100*n/t.baseSize,t.locations,t.handleNumbers)}function J(e,t){t.handle&&(u(t.handle,l.cssClasses.active),T-=1),t.listeners.forEach((function(e){M.removeEventListener(e[0],e[1])})),0===T&&(u(w,l.cssClasses.drag),le(),e.cursor&&(O.style.cursor="",O.removeEventListener("selectstart",r))),t.handleNumbers.forEach((function(e){re("change",e),re("set",e),re("end",e)}))}function Q(e,t){if(t.handleNumbers.some(B))return!1;var n;1===t.handleNumbers.length&&(n=f[t.handleNumbers[0]].children[0],T+=1,c(n,l.cssClasses.active));e.stopPropagation();var i=[],o=W(_.move,M,X,{target:e.target,handle:n,listeners:i,startCalcPoint:e.calcPoint,baseSize:G(),pageOffset:e.pageOffset,handleNumbers:t.handleNumbers,buttonsProperty:e.buttons,locations:k.slice()}),a=W(_.end,M,J,{target:e.target,handle:n,listeners:i,doNotReject:!0,handleNumbers:t.handleNumbers}),s=W("mouseout",M,Z,{target:e.target,handle:n,listeners:i,doNotReject:!0,handleNumbers:t.handleNumbers});i.push.apply(i,o.concat(a,s)),e.cursor&&(O.style.cursor=getComputedStyle(e.target).cursor,f.length>1&&c(w,l.cssClasses.drag),O.addEventListener("selectstart",r,!1)),t.handleNumbers.forEach((function(e){re("start",e)}))}function $(e){e.stopPropagation();var t=Y(e.calcPoint),n=function(e){var t=100,n=!1;return f.forEach((function(r,i){if(!B(i)){var o=k[i],a=Math.abs(o-e);(ao||100===a&&100===t)&&(n=i,t=a)}})),n}(t);if(!1===n)return!1;l.events.snap||o(w,l.cssClasses.tap,l.animationDuration),ce(n,t,!0,!0),le(),re("slide",n,!0),re("update",n,!0),re("change",n,!0),re("set",n,!0),l.events.snap&&Q(e,{handleNumbers:[n]})}function ee(e){var t=Y(e.calcPoint),n=C.getStep(t),r=C.fromStepping(n);Object.keys(A).forEach((function(e){"hover"===e.split(".")[0]&&A[e].forEach((function(e){e.call(v,r)}))}))}function te(e,t){A[e]=A[e]||[],A[e].push(t),"update"===e.split(".")[0]&&f.forEach((function(e,t){re("update",t)}))}function ne(e){var t=e&&e.split(".")[0],n=t?e.substring(t.length):e;Object.keys(A).forEach((function(e){var r=e.split(".")[0],i=e.substring(r.length);t&&t!==r||n&&n!==i||function(e){return e===S||e===x}(i)&&n!==i||delete A[e]}))}function re(e,t,n){Object.keys(A).forEach((function(r){var i=r.split(".")[0];e===i&&A[r].forEach((function(e){e.call(v,E.map(l.format.to),t,E.slice(),n||!1,k.slice(),v)}))}))}function ie(e,t,n,r,i,o){var s;return f.length>1&&!l.events.unconstrained&&(r&&t>0&&(s=C.getAbsoluteDistance(e[t-1],l.margin,0),n=Math.max(n,s)),i&&t1&&l.limit&&(r&&t>0&&(s=C.getAbsoluteDistance(e[t-1],l.limit,0),n=Math.min(n,s)),i&&t1?r.forEach((function(e,n){var r=ie(i,e,i[e]+t,o[n],a[n],!1);!1===r?t=0:(t=r-i[e],i[e]=r)})):o=a=[!0];var s=!1;r.forEach((function(e,r){s=ce(e,n[e]+t,o[r],a[r])||s})),s&&r.forEach((function(e){re("update",e),re("slide",e)}))}function se(e,t){return l.dir?100-e-t:e}function le(){I.forEach((function(e){var t=k[e]>50?-1:1,n=3+(f.length+t*e);f[e].style.zIndex=n}))}function ce(e,t,n,r,i){return i||(t=ie(k,e,t,n,r,!1)),!1!==t&&(function(e,t){k[e]=t,E[e]=C.fromStepping(t);var n="translate("+oe(10*(se(t,0)-R)+"%","0")+")";f[e].style[l.transformRule]=n,ue(e),ue(e+1)}(e,t),!0)}function ue(e){if(m[e]){var t=0,n=100;0!==e&&(t=k[e-1]),e!==m.length-1&&(n=k[e]);var r=n-t,i="translate("+oe(se(t,r)+"%","0")+")",o="scale("+oe(r/100,"1")+")";m[e].style[l.transformRule]=i+" "+o}}function de(e,t){return null===e||!1===e||void 0===e?k[t]:("number"===typeof e&&(e=String(e)),e=l.format.from(e),!1===(e=C.toStepping(e))||isNaN(e)?k[t]:e)}function he(e,t,n){var r=s(e),i=void 0===k[0];t=void 0===t||!!t,l.animate&&!i&&o(w,l.cssClasses.tap,l.animationDuration),I.forEach((function(e){ce(e,de(r[e],e),!0,!1,n)}));for(var a=1===I.length?0:1;an.stepAfter.startValue&&(i=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===t?i=null:0===t&&(o=null);var a=C.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(a))),null!==o&&!1!==o&&(o=Number(o.toFixed(a))),[o,i]}return p=function(e){return c(e,l.cssClasses.target),0===l.dir?c(e,l.cssClasses.ltr):c(e,l.cssClasses.rtl),0===l.ort?c(e,l.cssClasses.horizontal):c(e,l.cssClasses.vertical),c(e,"rtl"===getComputedStyle(e).direction?l.cssClasses.textDirectionRtl:l.cssClasses.textDirectionLtr),L(e,l.cssClasses.base)}(w),function(e,t){var n=L(t,l.cssClasses.connects);f=[],(m=[]).push(D(n,e[0]));for(var r=0;r=0&&t=t.MIN_SLIDER_LEVELS_COUNT?t.constructSlider(a):t.constructButtons(a),t.prevLevelsSet=s,t.prevLevelControlFacilityId=r,t.uiLevelOrdinal=i,null!=(o=t.map._getMap().getSource(o))&&o.hasOwnProperty("minzoom")&&o.minzoom&&(t.minZoomLevel=o.minzoom))},this.constructSlider=function(e){(g=document.createElement("div")).classList.add("slider-container",t.options.style),t.levelControlContainer.appendChild(g),t.sliderDiv=document.createElement("div");var n=document.createElement("button"),r=document.createElement("button");t.sliderDiv.id="slider",r.id="slider-down-button",n.id="slider-up-button",r.classList.add("azure-maps-control-button","button-override"),n.classList.add("azure-maps-control-button","button-override"),n.innerHTML='',r.innerHTML='',g.appendChild(n),g.appendChild(t.sliderDiv),g.appendChild(r);for(var i=e.length,o={max:[e[e.length-1]],min:[e[0]]},a={},l={},u=c(100/(i-1),2),d=u,h=0;h=t.minZoomLevel?t.levelControlContainer.classList.remove("hidden-level-control"):t.levelControlContainer.classList.add("hidden-level-control")},this.setInUse=function(e){return function(){e?t.levelControlContainer.classList.add("in-use"):t.levelControlContainer.classList.remove("in-use")}},this.options=(new g).merge(e)}return e.prototype.onRemove=function(){this.map.events.remove("click",this.onMapClick),this.map.events.remove("dblclick",this.onMapDoubleClick),this.map.events.remove("moveend",this.generateLevelControl),this.map.events.remove("zoom",this.onMapZoom),this.map.events.remove("load",this.onMapLoad),this.map.events.remove("facilitychanged",this.indoorManager,this.onFacilityChange),this.map=void 0,this.sliderDiv&&this.sliderDiv.noUiSlider&&this.sliderDiv.noUiSlider.off("update"),this.levelControlContainer.remove()},e.prototype.constructButtons=function(e){var t=this,n=(o=this.indoorManager.getCurrentFacilityDetails())[0],r=o[1],i=document.createElement("div"),o=e.length;i.classList.add("buttons-container",this.options.style),this.levelControlContainer.appendChild(i);for(var a=this,s=o-1;0<=s;s--)!function(r){var o=document.createElement("button");r="ordinal"===a.options.levelLabel?e[r].toString():a.indoorManager._getLevelName(n,e[r]-1);o.classList.add("azure-maps-control-button","button-override"),o.setAttribute("title","Level Number "+r),o.setAttribute("alt","Level Number "+r),o.setAttribute("type","button"),o.setAttribute("id",r),"name"===a.options.levelLabel&&(o.style.setProperty("text-overflow","ellipsis"),o.style.setProperty("overflow","hidden"),o.style.setProperty("white-space","nowrap")),o.dataset.currentLevelNumber=r,o.innerHTML=r,o.addEventListener("click",(function(e){for(var r=0,a=Array.from(i.children);ri[0]&&s[1]i?e[2]:i,e[3]>t?e[3]:t]}),e[0])})).then((function(t){t&&n.map.setCamera(D({bounds:t},e))}))):console.warn("Tileset ".concat(t," is not a Creator tileset, no action performed")):console.warn("No Creator tilesets found in style while is unexpected")):console.warn("map is null while trying to focus camera which is unexpected")}void 0===e&&(e={}),this.isReady?r():this._addEventListener("indoorready",(function(e){return r()}),!0)},t}(r.internal.EventEmitter),j=Object.freeze({__proto__:null,IndoorManager:B}),U=o.merge("atlas.control",_),q=o.merge("atlas.indoor",j);t.$=U,t.Z=q},4037:(e,t,n)=>{"use strict";var r=n(2506),i=n(9722),o=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&o(e,".prototype.")>-1?i(n):n}},9722:(e,t,n)=>{"use strict";var r=n(3350),i=n(2506),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||r.call(a,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(h){c=null}e.exports=function(e){var t=s(r,a,arguments);if(l&&c){var n=l(t,"length");n.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var d=function(){return s(r,o,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d},4161:(e,t,n)=>{"use strict";var r=n(2110),i=n(4613),o=n(5021),a=n(4460).orient2d;function s(e,t,n){t=Math.max(0,void 0===t?2:t),n=n||0;var i=function(e){for(var t=e[0],n=e[0],r=e[0],i=e[0],a=0;ar[0]&&(r=s),s[1]i[1]&&(i=s)}var l=[t,n,r,i],c=l.slice();for(a=0;a=2&&p(t[t.length-2],t[t.length-1],e[n])<=0;)t.pop();t.push(e[n])}for(var r=[],i=e.length-1;i>=0;i--){for(;r.length>=2&&p(r[r.length-2],r[r.length-1],e[i])<=0;)r.pop();r.push(e[i])}return r.pop(),t.pop(),t.concat(r)}(c)}(e),a=new r(16);a.toBBox=function(e){return{minX:e[0],minY:e[1],maxX:e[0],maxY:e[1]}},a.compareMinX=function(e,t){return e[0]-t[0]},a.compareMinY=function(e,t){return e[1]-t[1]},a.load(e);for(var s,c=[],u=0;ua||l.push({node:f,dist:m})}for(;l.length&&!l.peek().node.children;){var g=l.pop(),v=g.node,_=y(v,t,n),b=y(v,r,o);if(g.dist<_&&g.dist=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function h(e,t,n){for(var r,i,o,a,s=Math.min(e[0],t[0]),l=Math.min(e[1],t[1]),c=Math.max(e[0],t[0]),u=Math.max(e[1],t[1]),d=n.search({minX:s,minY:l,maxX:c,maxY:u}),h=0;h0!==p(r,i,a)>0&&p(o,a,r)>0!==p(o,a,i)>0)return!1;return!0}function p(e,t,n){return a(e[0],e[1],t[0],t[1],n[0],n[1])}function f(e){var t=e.p,n=e.next.p;return e.minX=Math.min(t[0],n[0]),e.minY=Math.min(t[1],n[1]),e.maxX=Math.max(t[0],n[0]),e.maxY=Math.max(t[1],n[1]),e}function m(e,t){var n={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(n.next=t.next,n.prev=t,t.next.prev=n,t.next=n):(n.prev=n,n.next=n),n}function g(e,t){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function y(e,t,n){var r=t[0],i=t[1],o=n[0]-r,a=n[1]-i;if(0!==o||0!==a){var s=((e[0]-r)*o+(e[1]-i)*a)/(o*o+a*a);s>1?(r=n[0],i=n[1]):s>0&&(r+=o*s,i+=a*s)}return(o=e[0]-r)*o+(a=e[1]-i)*a}function v(e,t,n,r,i,o,a,s){var l,c,u,d,h=n-e,p=r-t,f=a-i,m=s-o,g=e-i,y=t-o,v=h*h+p*p,_=h*f+p*m,b=f*f+m*m,w=h*g+p*y,x=f*g+m*y,S=v*b-_*_,C=S,E=S;0===S?(c=0,C=1,d=x,E=b):(d=v*x-_*w,(c=_*x-b*w)<0?(c=0,d=x,E=b):c>C&&(c=C,d=x+_,E=b)),d<0?(d=0,-w<0?c=0:-w>v?c=C:(c=-w,C=v)):d>E&&(d=E,-w+_<0?c=0:-w+_>v?c=C:(c=-w+_,C=v));var k=(1-(u=0===d?0:d/E))*i+u*a-((1-(l=0===c?0:c/C))*e+l*n),I=(1-u)*o+u*s-((1-l)*t+l*r);return k*k+I*I}function _(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}i.default&&(i=i.default),e.exports=s,e.exports.default=s},2110:function(e){e.exports=function(){"use strict";function e(e,r,i,o,a){!function e(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/s+d)),Math.min(o,Math.floor(r+(s-l)*u/s+d)),a)}var h=n[r],p=i,f=o;for(t(n,i,r),a(n[o],h)>0&&t(n,i,o);p0;)f--}0===a(n[i],h)?t(n,i,f):t(n,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}(e,r,i||0,o||e.length-1,a||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function f(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;e(t,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!p(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=f(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(e,t){this.data=f([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,s,l,c,d,h=1/0,p=1/0,f=t;f<=n-t;f++){var m=a(e,0,f,this.toBBox),g=a(e,f,n,this.toBBox),y=(i=m,o=g,s=void 0,l=void 0,c=void 0,d=void 0,s=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),c=Math.min(i.maxX,o.maxX),d=Math.min(i.maxY,o.maxY),Math.max(0,c-s)*Math.max(0,d-l)),v=u(m)+u(g);y=t;p--){var f=e.children[p];s(l,e.leaf?i(f):f),c+=d(l)}return c},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)s(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}()},4058:(e,t,n)=>{var r=n(4892),i=n(5450),o=n(3454),a=n(1146),s=n(3535),l=n(2833),c=Date.prototype.getTime;function u(e,t,n){var p=n||{};return!!(p.strict?o(e,t):e===t)||(!e||!t||"object"!==typeof e&&"object"!==typeof t?p.strict?o(e,t):e==t:function(e,t,n){var o,p;if(typeof e!==typeof t)return!1;if(d(e)||d(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e)!==i(t))return!1;var f=a(e),m=a(t);if(f!==m)return!1;if(f||m)return e.source===t.source&&s(e)===s(t);if(l(e)&&l(t))return c.call(e)===c.call(t);var g=h(e),y=h(t);if(g!==y)return!1;if(g||y){if(e.length!==t.length)return!1;for(o=0;o=0;o--)if(v[o]!=_[o])return!1;for(o=v.length-1;o>=0;o--)if(!u(e[p=v[o]],t[p],n))return!1;return!0}(e,t,p))}function d(e){return null===e||void 0===e}function h(e){return!(!e||"object"!==typeof e||"number"!==typeof e.length)&&("function"===typeof e.copy&&"function"===typeof e.slice&&!(e.length>0&&"number"!==typeof e[0]))}e.exports=u},9396:(e,t,n)=>{"use strict";var r=n(4892),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,l=n(4510)(),c=s&&l,u=function(e,t,n,r){var i;(!(t in e)||"function"===typeof(i=r)&&"[object Function]"===o.call(i)&&r())&&(c?s(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},d=function(e,t){var n=arguments.length>2?arguments[2]:{},o=r(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{function t(e,t,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(e,t,n,r)}t.prototype.run=function(e,t,n,r){this._init(e,t,n,r);for(var i=0;i=this.minPts&&(t=this._mergeArrays(t,i))}1!==this._assigned[r]&&this._addToCluster(r,e)}},t.prototype._addToCluster=function(e,t){this.clusters[t].push(e),this._assigned[e]=1},t.prototype._regionQuery=function(e){for(var t=[],n=0;n{function t(e,t,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,t,n)}t.prototype.init=function(e,t,n){this.assignments=[],this.centroids=[],"undefined"!==typeof e&&(this.dataset=e),"undefined"!==typeof t&&(this.k=t),"undefined"!==typeof n&&(this.distance=n)},t.prototype.run=function(e,t){this.init(e,t);for(var n=this.dataset.length,r=0;r0){for(l=0;l=0);return e},t.prototype.assign=function(){for(var e,t=!1,n=this.dataset.length,r=0;r{if(e.exports)var r=n(5047);function i(e,t,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(e,t,n,r)}i.prototype.run=function(e,t,n,i){this._init(e,t,n,i);for(var o=0,a=this.dataset.length;o=this.minPts)return n}},i.prototype._regionQuery=function(e,t){t=t||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r{function t(e,t,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,t,n)}t.prototype.insert=function(e,t){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?t>i&&(n=r):t{e.exports&&(e.exports={DBSCAN:n(7861),KMEANS:n(2601),OPTICS:n(3163),PriorityQueue:n(5047)})},7089:e=>{"use strict";function t(e,t,r){r=r||2;var o,a,s,l,d,h,f,m=t&&t.length,g=m?t[0]*r:e.length,y=n(e,0,g,r,!0),v=[];if(!y||y.next===y.prev)return v;if(m&&(y=function(e,t,r,i){var o,a,s,l=[];for(o=0,a=t.length;o80*r){o=s=e[0],a=l=e[1];for(var _=r;_s&&(s=d),h>l&&(l=h);f=0!==(f=Math.max(s-o,l-a))?32767/f:0}return i(y,v,r,o,a,f,0),v}function n(e,t,n,r,i){var o,a;if(i===k(e,t,n,r)>0)for(o=t;o=t;o-=r)a=S(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(C(a),a=a.next),a}function r(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!y(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(C(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function i(e,t,n,c,u,d,p){if(e){!p&&d&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=h(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,c,u,d);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?a(e,c,u,d):o(e))t.push(f.i/n|0),t.push(e.i/n|0),t.push(m.i/n|0),C(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?i(e=s(r(e),t,n),t,n,c,u,d,2):2===p&&l(e,t,n,c,u,d):i(r(e),t,n,c,u,d,1);break}}}function o(e){var t=e.prev,n=e,r=e.next;if(g(t,n,r)>=0)return!1;for(var i=t.x,o=n.x,a=r.x,s=t.y,l=n.y,c=r.y,u=io?i>a?i:a:o>a?o:a,p=s>l?s>c?s:c:l>c?l:c,m=r.next;m!==t;){if(m.x>=u&&m.x<=h&&m.y>=d&&m.y<=p&&f(i,s,o,l,a,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a(e,t,n,r){var i=e.prev,o=e,a=e.next;if(g(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,c=a.x,u=i.y,d=o.y,p=a.y,m=sl?s>c?s:c:l>c?l:c,_=u>d?u>p?u:p:d>p?d:p,b=h(m,y,t,n,r),w=h(v,_,t,n,r),x=e.prevZ,S=e.nextZ;x&&x.z>=b&&S&&S.z<=w;){if(x.x>=m&&x.x<=v&&x.y>=y&&x.y<=_&&x!==i&&x!==a&&f(s,u,l,d,c,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,S.x>=m&&S.x<=v&&S.y>=y&&S.y<=_&&S!==i&&S!==a&&f(s,u,l,d,c,p,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;x&&x.z>=b;){if(x.x>=m&&x.x<=v&&x.y>=y&&x.y<=_&&x!==i&&x!==a&&f(s,u,l,d,c,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;S&&S.z<=w;){if(S.x>=m&&S.x<=v&&S.y>=y&&S.y<=_&&S!==i&&S!==a&&f(s,u,l,d,c,p,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function s(e,t,n){var i=e;do{var o=i.prev,a=i.next.next;!y(o,a)&&v(o,i,i.next,a)&&w(o,a)&&w(a,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(a.i/n|0),C(i),C(i.next),i=e=a),i=i.next}while(i!==e);return r(i)}function l(e,t,n,o,a,s){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=x(l,c);return l=r(l,l.next),u=r(u,u.next),i(l,t,n,o,a,s,0),void i(u,t,n,o,a,s,0)}c=c.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function u(e,t){var n=function(e,t){var n,r=t,i=e.x,o=e.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<=i&&s>a&&(a=s,n=r.x=r.x&&r.x>=u&&i!==r.x&&f(on.x||r.x===n.x&&d(n,r)))&&(n=r,p=l)),r=r.next}while(r!==c);return n}(e,t);if(!n)return t;var i=x(n,e);return r(i,i.next),r(n,n.next)}function d(e,t){return g(e.prev,e,t.prev)<0&&g(t.next,e,e.next)<0}function h(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,n=e;do{(t.x=(e-a)*(o-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&v(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(g(e.prev,e,t.prev)||g(e,t.prev,t))||y(e,t)&&g(e.prev,e,e.next)>0&&g(t.prev,t,t.next)>0)}function g(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,n,r){var i=b(g(e,t,n)),o=b(g(e,t,r)),a=b(g(n,r,e)),s=b(g(n,r,t));return i!==o&&a!==s||(!(0!==i||!_(e,n,t))||(!(0!==o||!_(e,r,t))||(!(0!==a||!_(n,e,r))||!(0!==s||!_(n,t,r)))))}function _(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function b(e){return e>0?1:e<0?-1:0}function w(e,t){return g(e.prev,e,e.next)<0?g(e,t,e.next)>=0&&g(e,e.prev,t)>=0:g(e,t,e.prev)<0||g(e,e.next,t)<0}function x(e,t){var n=new E(e.i,e.x,e.y),r=new E(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function S(e,t,n,r){var i=new E(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function C(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function E(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k(e,t,n,r){for(var i=0,o=t,a=n-r;o0&&(r+=e[i-1].length,n.holes.push(r))}return n}},4802:function(e,t,n){var r,i,o;i=[],void 0===(o="function"===typeof(r=function(){"use strict";function t(e,t){return"undefined"==typeof t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function i(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,n){var s=a.URL||a.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?o(l):i(l.href)?r(e,t,n):o(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){o(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,a){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,a),n);else if(i(e))r(e,n,a);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){o(s)}))}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var o="application/octet-stream"===e.type,l=/constructor/i.test(a.HTMLElement)||a.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&l||s)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,h=d.createObjectURL(e);i?i.location=h:location.href=h,i=null,setTimeout((function(){d.revokeObjectURL(h)}),4e4)}});a.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,i):r)||(e.exports=o)},222:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!==typeof o||r.call(o)!==i)throw new TypeError(t+o);for(var a,s=n.call(arguments,1),l=function(){if(this instanceof a){var t=o.apply(this,s.concat(n.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(n.call(arguments)))},c=Math.max(0,o.length-s.length),u=[],d=0;d{"use strict";var r=n(222);e.exports=Function.prototype.bind||r},4583:e=>{"use strict";var t=function(){return"string"===typeof function(){}.name},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch(i){n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var e=n((function(){}),"name");return!!e&&!!e.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"===typeof r&&""!==function(){}.bind().name},e.exports=t},4042:(e,t,n)=>{var r=n(4058),i=function(e){this.precision=e&&e.precision?e.precision:17,this.direction=!(!e||!e.direction)&&e.direction,this.pseudoNode=!(!e||!e.pseudoNode)&&e.pseudoNode,this.objectComparator=e&&e.objectComparator?e.objectComparator:s};function o(e){return e.coordinates.map((function(t){return{type:e.type.replace("Multi",""),coordinates:t}}))}function a(e,t){return e.hasOwnProperty("coordinates")?e.coordinates.length===t.coordinates.length:e.length===t.length}function s(e,t){return r(e,t,{strict:!0})}i.prototype.compare=function(e,t){if(e.type!==t.type||!a(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(e,t);case"Feature":return this.compareFeature(e,t);default:if(0===e.type.indexOf("Multi")){var n=this,r=o(e),i=o(t);return r.every((function(e){return this.some((function(t){return n.compare(e,t)}))}),i)}}return!1},i.prototype.compareCoord=function(e,t){if(e.length!==t.length)return!1;for(var n=0;n=0&&(n=[].concat(e.slice(r,e.length),e.slice(1,r+1))),n},i.prototype.comparePath=function(e,t){var n=this;return e.every((function(e,t){return n.compareCoord(e,this[t])}),t)},i.prototype.comparePolygon=function(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){var n=e.coordinates.slice(1,e.coordinates.length),r=t.coordinates.slice(1,t.coordinates.length),i=this;return n.every((function(e){return this.some((function(t){return i.compareLine(e,t,1,!0)}))}),r)}return!1},i.prototype.compareFeature=function(e,t){return!(e.id!==t.id||!this.objectComparator(e.properties,t.properties)||!this.compareBBox(e,t))&&this.compare(e.geometry,t.geometry)},i.prototype.compareBBox=function(e,t){return!!(!e.bbox&&!t.bbox||e.bbox&&t.bbox&&this.compareCoord(e.bbox,t.bbox))},i.prototype.removePseudo=function(e){return e},e.exports=i},9234:(e,t,n)=>{var r=n(2968),i=n(7872),o=n(2538),a=n(2127).Z,s=o.featureEach,l=(o.coordEach,i.polygon,i.featureCollection);function c(e){var t=new r(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:a(e),r.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach((function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:a(e),t.push(e)})):s(e,(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:a(e),t.push(e)})),r.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:a(e),r.prototype.remove.call(this,e,t)},t.clear=function(){return r.prototype.clear.call(this)},t.search=function(e){var t=r.prototype.search.call(this,this.toBBox(e));return l(t)},t.collides=function(e){return r.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=r.prototype.all.call(this);return l(e)},t.toJSON=function(){return r.prototype.toJSON.call(this)},t.fromJSON=function(e){return r.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=a(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=a(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}e.exports=c,e.exports.default=c},2968:function(e){e.exports=function(){"use strict";function e(e,r,i,o,a){!function e(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/s+d)),Math.min(o,Math.floor(r+(s-l)*u/s+d)),a)}var h=n[r],p=i,f=o;for(t(n,i,r),a(n[o],h)>0&&t(n,i,o);p0;)f--}0===a(n[i],h)?t(n,i,f):t(n,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}(e,r,i||0,o||e.length-1,a||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function f(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;e(t,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!p(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=f(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(e,t){this.data=f([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,s,l,c,d,h=1/0,p=1/0,f=t;f<=n-t;f++){var m=a(e,0,f,this.toBBox),g=a(e,f,n,this.toBBox),y=(i=m,o=g,s=void 0,l=void 0,c=void 0,d=void 0,s=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),c=Math.min(i.maxX,o.maxX),d=Math.min(i.maxY,o.maxY),Math.max(0,c-s)*Math.max(0,d-l)),v=u(m)+u(g);y=t;p--){var f=e.children[p];s(l,e.leaf?i(f):f),c+=d(l)}return c},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)s(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}()},2506:(e,t,n)=>{"use strict";var r,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(t){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(P){l=null}var c=function(){throw new a},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(t){return c}}}():c,d=n(697)(),h=Object.getPrototypeOf||function(e){return e.__proto__},p={},f="undefined"===typeof Uint8Array?r:h(Uint8Array),m={"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":d?h([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d?h(h([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&d?h((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&d?h((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?h(""[Symbol.iterator]()):r,"%Symbol%":d?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":f,"%TypeError%":a,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};try{null.error}catch(P){var g=h(h(P));m["%Error.prototype%"]=g}var y=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(n=h(i.prototype))}return m[t]=n,n},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=n(3350),b=n(8316),w=_.call(Function.call,Array.prototype.concat),x=_.call(Function.apply,Array.prototype.splice),S=_.call(Function.call,String.prototype.replace),C=_.call(Function.call,String.prototype.slice),E=_.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,T=function(e){var t=C(e,0,1),n=C(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return S(e,k,(function(e,t,n,i){r[r.length]=n?S(i,I,"$1"):t||e})),r},A=function(e,t){var n,r=e;if(b(v,r)&&(r="%"+(n=v[r])[0]+"%"),b(m,r)){var o=m[r];if(o===p&&(o=y(r)),"undefined"===typeof o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===E(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=T(e),r=n.length>0?n[0]:"",o=A("%"+r+"%",t),s=o.name,c=o.value,u=!1,d=o.alias;d&&(r=d[0],x(n,w([0,1],d)));for(var h=1,p=!0;h=n.length){var v=l(c,f);c=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[f]}else p=b(c,f),c=c[f];p&&!u&&(m[s]=c)}}return c}},6866:(e,t)=>{"use strict";var n=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var n=t.toString();return t&&(t instanceof e||e.validator.test(n))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(e){for(var t="",n=0;n{"use strict";var r=n(2506)("%Object.defineProperty%",!0),i=function(){if(r)try{return r({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},697:(e,t,n)=>{"use strict";var r="undefined"!==typeof Symbol&&Symbol,i=n(3297);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},3297:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4707:(e,t,n)=>{"use strict";var r=n(3297);e.exports=function(){return r()&&!!Symbol.toStringTag}},8316:(e,t,n)=>{"use strict";var r=n(3350);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},5450:(e,t,n)=>{"use strict";var r=n(4707)(),i=n(4037)("Object.prototype.toString"),o=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},2833:(e,t,n)=>{"use strict";var r=Date.prototype.getDay,i=Object.prototype.toString,o=n(4707)();e.exports=function(e){return"object"===typeof e&&null!==e&&(o?function(e){try{return r.call(e),!0}catch(t){return!1}}(e):"[object Date]"===i.call(e))}},1146:(e,t,n)=>{"use strict";var r,i,o,a,s=n(4037),l=n(4707)();if(l){r=s("Object.prototype.hasOwnProperty"),i=s("RegExp.prototype.exec"),o={};var c=function(){throw o};a={toString:c,valueOf:c},"symbol"===typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var u=s("Object.prototype.toString"),d=Object.getOwnPropertyDescriptor;e.exports=l?function(e){if(!e||"object"!==typeof e)return!1;var t=d(e,"lastIndex");if(!(t&&r(t,"value")))return!1;try{i(e,a)}catch(n){return n===o}}:function(e){return!(!e||"object"!==typeof e&&"function"!==typeof e)&&"[object RegExp]"===u(e)}},1725:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),c=1;c{"use strict";var t=function(e){return e!==e};e.exports=function(e,n){return 0===e&&0===n?1/e===1/n:e===n||!(!t(e)||!t(n))}},3454:(e,t,n)=>{"use strict";var r=n(9396),i=n(9722),o=n(2592),a=n(3355),s=n(3118),l=i(a(),Object);r(l,{getPolyfill:a,implementation:o,shim:s}),e.exports=l},3355:(e,t,n)=>{"use strict";var r=n(2592);e.exports=function(){return"function"===typeof Object.is?Object.is:r}},3118:(e,t,n)=>{"use strict";var r=n(3355),i=n(9396);e.exports=function(){var e=r();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},1949:(e,t,n)=>{"use strict";var r;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=n(7635),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{d(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(e){var t=null!==e&&"object"===typeof e,n="[object Function]"===o.call(e),r=a(e),s=t&&"[object String]"===o.call(e),h=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var f=c&&n;if(s&&e.length>0&&!i.call(e,0))for(var m=0;m0)for(var g=0;g{"use strict";var r=Array.prototype.slice,i=n(7635),o=Object.keys,a=o?function(e){return o(e)}:n(1949),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(r.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},7635:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},5164:e=>{e.exports=function(e,t,n,r){var i=e[0],o=e[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=t.length);for(var s=(r-n)/2,l=0,c=s-1;lo!==p>o&&i<(h-u)*(o-d)/(p-d)+u&&(a=!a)}return a}},5021:(e,t,n)=>{var r=n(5164),i=n(1850);e.exports=function(e,t,n,o){return t.length>0&&Array.isArray(t[0])?i(e,t,n,o):r(e,t,n,o)},e.exports.nested=i,e.exports.flat=r},1850:e=>{e.exports=function(e,t,n,r){var i=e[0],o=e[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=t.length);for(var s=r-n,l=0,c=s-1;lo!==p>o&&i<(h-u)*(o-d)/(p-d)+u&&(a=!a)}return a}},9056:function(e){e.exports=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;nt?1:e0))break;if(null===t.right)break;if(n(e,t.right.key)>0&&(l=t.right,t.right=l.left,l.left=t,null===(t=l).right))break;o.right=t,o=t,t=t.right}}return o.right=t.left,a.left=t.right,t.left=i.right,t.right=i.left,t}function a(e,t,n,i){var a=new r(e,t);if(null===n)return a.left=a.right=null,a;var s=i(e,(n=o(e,n,i)).key);return s<0?(a.left=n.left,a.right=n,n.left=null):s>=0&&(a.right=n.right,a.left=n,n.right=null),a}function s(e,t,n){var r=null,i=null;if(t){var a=n((t=o(e,t,n)).key,e);0===a?(r=t.left,i=t.right):a<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function l(e,t,n){return null===t?e:(null===e||((t=o(e.key,t,n)).left=e),t)}function c(e,t,n,r,i){if(e){r(t+(n?"\u2514\u2500\u2500 ":"\u251c\u2500\u2500 ")+i(e)+"\n");var o=t+(n?" ":"\u2502 ");e.left&&c(e.left,o,!1,r,i),e.right&&c(e.right,o,!0,r,i)}}var u=function(){function e(e){void 0===e&&(e=i),this._root=null,this._size=0,this._comparator=e}return e.prototype.insert=function(e,t){return this._size++,this._root=a(e,t,this._root,this._comparator)},e.prototype.add=function(e,t){var n=new r(e,t);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,a=o(e,this._root,i),s=i(e,a.key);return 0===s?this._root=a:(s<0?(n.left=a.left,n.right=a,a.left=null):s>0&&(n.right=a.right,n.left=a,a.right=null),this._size++,this._root=n),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,n){var r;return null===t?null:0===n(e,(t=o(e,t,n)).key)?(null===t.left?r=t.right:(r=o(e,t.left,n)).right=t.right,this._size--,r):t},e.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=o(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},e.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},e.prototype.find=function(e){return this._root&&(this._root=o(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},e.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),e.call(t,n),n=n.right):i=!0;return this},e.prototype.range=function(e,t,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,t)>0)break;if(o(a.key,e)>=0&&n.call(r,a))return this;a=a.right}return this},e.prototype.keys=function(){var e=[];return this.forEach((function(t){var n=t.key;return e.push(n)})),e},e.prototype.values=function(){var e=[];return this.forEach((function(t){var n=t.data;return e.push(n)})),e},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},e.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},e.prototype.at=function(e){for(var t=this._root,n=!1,r=0,i=[];!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},e.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?(n=t,t=t.left):t=t.right}return n},e.prototype.prev=function(e){var t=this._root,n=null;if(null!==e.left){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?t=t.left:(n=t,t=t.right)}return n},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return p(this._root)},e.prototype.load=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1);var r=e.length,i=this._comparator;if(n&&g(e,t,0,r-1,i),null===this._root)this._root=d(e,t,0,r),this._size=r;else{var o=m(this.toList(),h(e,t),i);r=this._size+r,this._root=f({head:o},0,r)}return this},e.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return c(this._root,"",!0,(function(e){return t.push(e)}),e),t.join("")},e.prototype.update=function(e,t,n){var r=this._comparator,i=s(e,this._root,r),o=i.left,c=i.right;r(e,t)<0?c=a(t,n,c,r):o=a(t,n,o,r),this._root=l(o,c,r)},e.prototype.split=function(e){return s(e,this._root,this._comparator)},e}();function d(e,t,n,i){var o=i-n;if(o>0){var a=n+Math.floor(o/2),s=e[a],l=t[a],c=new r(s,l);return c.left=d(e,t,n,a),c.right=d(e,t,a+1,i),c}return null}function h(e,t){for(var n=new r(null,null),i=n,o=0;o0?t=(t=a=a.next=n.pop()).right:i=!0;return a.next=null,o.next}function f(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2),o=f(e,t,i),a=e.head;return a.left=o,e.head=e.head.next,a.right=f(e,i+1,n),a}return null}function m(e,t,n){for(var i=new r(null,null),o=i,a=e,s=t;null!==a&&null!==s;)n(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),i.next}function g(e,t,n,r,i){if(!(n>=r)){for(var o=e[n+r>>1],a=n-1,s=r+1;;){do{a++}while(i(e[a],o)<0);do{s--}while(i(e[s],o)>0);if(a>=s)break;var l=e[a];e[a]=e[s],e[s]=l,l=t[a],t[a]=t[s],t[s]=l}g(e,t,n,s,i),g(e,t,s+1,r,i)}}var y=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},v=function(e,t){if(t.ur.xt.x?1:e.yt.y?1:0}}]),n(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var t=e.point.events,n=0,r=t.length;n=0&&l>=0?ac?-1:0:o<0&&l<0?ac?1:0:lo?1:0}}}]),t}(),N=0,D=function(){function t(n,r,i,o){e(this,t),this.id=++N,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(t,null,[{key:"compare",value:function(e,t){var n=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,o=t.rightSE.point.x;if(oa&&s>l)return-1;var u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return-1;var d=t.comparePoint(e.rightSE.point);return 0!==d?d:-1}if(n>r){if(as&&a>c)return 1;var h=t.comparePoint(e.leftSE.point);if(0!==h)return h;var p=e.comparePoint(t.rightSE.point);return p<0?1:p>0?-1:1}if(as)return 1;if(io){var m=e.comparePoint(t.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(i!==o){var g=l-a,y=i-n,v=c-s,_=o-r;if(g>y&&v<_)return 1;if(g_)return-1}return i>o?1:ic?1:e.idt.id?1:0}}]),n(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x0&&s.swapEvents(),L.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var t=0,n=this.windings.length;t0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,l=r.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,a=-1}return new t(new L(i,!0),new L(o,!1),[r],[a])}}]),t}(),F=function(){function t(n,r,i){if(e(this,t),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!==typeof n[0][0]||"number"!==typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=C.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,l=n.length;sthis.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),a=c)}o.x===a.x&&o.y===a.y||this.segments.push(D.fromRing(a,o,this))}return n(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,n=this.segments.length;tthis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return n(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,n=this.interiorRings.length;tthis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return n(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,n=this.polys.length;t0&&(e=r)}for(var i=e.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),t}(),U=function(){function t(n){e(this,t),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return n(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(var t=0,n=this.interiorRings.length;t1&&void 0!==arguments[1]?arguments[1]:D.compare;e(this,t),this.queue=n,this.tree=new u(r),this.segments=[]}return n(t,[{key:"process",value:function(e){var t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;var r=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!r)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(e.isLeft){var l=null;if(a){var c=a.getIntersection(t);if(null!==c&&(t.isAnEndpoint(c)||(l=c),!a.isAnEndpoint(c)))for(var u=this._splitSafely(a,c),d=0,h=u.length;d0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&s){var x=a.getIntersection(s);if(null!==x){if(!a.isAnEndpoint(x))for(var S=this._splitSafely(a,x),C=0,E=S.length;CH)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new V(f),x=f.size,S=f.pop();S;){var E=S.key;if(f.size===x){var k=E.segment;throw new Error("Unable to pop() ".concat(E.isLeft?"left":"right"," SweepEvent ")+"[".concat(E.point.x,", ").concat(E.point.y,"] from segment #").concat(k.id," ")+"[".concat(k.leftSE.point.x,", ").concat(k.leftSE.point.y,"] -> ")+"[".concat(k.rightSE.point.x,", ").concat(k.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>H)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>G)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var I=w.process(E),T=0,A=I.length;T1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;ri;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-l*u/s+d)),Math.min(o,Math.floor(r+(s-l)*u/s+d)),a)}var h=e[r],p=i,f=o;for(n(e,i,r),a(e[o],h)>0&&n(e,i,o);p0;)f--}0===a(e[i],h)?n(e,i,f):n(e,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t){return et?1:0}return e}()},1977:(e,t,n)=>{"use strict";e.exports=i,e.exports.default=i;var r=n(2441);function i(e,t){if(!(this instanceof i))return new i(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function o(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function g(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,n,i,o){for(var a,s=[t,n];s.length;)(n=s.pop())-(t=s.pop())<=i||(a=t+Math.ceil((n-t)/i/2)*i,r(e,a,t,n,o),s.push(t,a,a,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,n=[],r=this.toBBox;if(!m(e,t))return n;for(var i,o,a,s,l=[];t;){for(i=0,o=t.children.length;i=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(i,o,t)},_split:function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=g(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(e,t){this.data=g([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,n){var r,i,o,a,l,c,u,h;for(c=u=1/0,r=t;r<=n-t;r++)a=p(i=s(e,0,r,this.toBBox),o=s(e,r,n,this.toBBox)),l=d(i)+d(o),a=t;i--)o=e.children[i],l(u,e.leaf?a(o):o),d+=h(u);return d},_adjustParentBBoxes:function(e,t,n){for(var r=n;r>=0;r--)l(t[r],e)},_condense:function(e){for(var t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children).splice(t.indexOf(e[n]),1):this.clear():a(e[n],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},4424:(e,t,n)=>{"use strict";var r=n(1725),i=n(2791);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nT;T++)I[T]=T+1;I[15]=0;var A=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,P=Object.prototype.hasOwnProperty,M={},O={};function R(e){return!!P.call(O,e)||!P.call(M,e)&&(A.test(e)?O[e]=!0:(M[e]=!0,!1))}function L(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){N[e]=new L(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];N[t]=new L(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){N[e]=new L(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){N[e]=new L(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){N[e]=new L(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){N[e]=new L(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){N[e]=new L(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){N[e]=new L(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){N[e]=new L(e,5,!1,e.toLowerCase(),null,!1,!1)}));var D=/[\-:]([a-z])/g;function F(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(D,F);N[t]=new L(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(D,F);N[t]=new L(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(D,F);N[t]=new L(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){N[e]=new L(e,1,!1,e.toLowerCase(),null,!1,!1)})),N.xlinkHref=new L("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){N[e]=new L(e,1,!1,e.toLowerCase(),null,!0,!0)}));var z=/["'&<>]/;function B(e){if("boolean"===typeof e||"number"===typeof e)return""+e;e=""+e;var t=z.exec(e);if(t){var n,r="",i=0;for(n=t.index;nt}return!1}(e,t,r,!1)?"":null!==r?(e=r.attributeName,3===(n=r.type)||4===n&&!0===t?e+'=""':(r.sanitizeURL&&(t=""+t),e+'="'+B(t)+'"')):R(e)?e+'="'+B(t)+'"':""}var U="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},q=null,V=null,H=null,G=!1,W=!1,K=null,Y=0;function Z(){if(null===q)throw Error(o(321));return q}function X(){if(0Y))throw Error(o(301));if(e===q)if(W=!0,e={action:n,next:null},null===K&&(K=new Map),void 0===(n=K.get(t)))K.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function ie(){}var oe=null,ae={readContext:function(e){var t=oe.threadID;return k(e,t),e[t]},useContext:function(e){Z();var t=oe.threadID;return k(e,t),e[t]},useMemo:ne,useReducer:te,useRef:function(e){q=Z();var t=(H=J()).memoizedState;return null===t?(e={current:e},H.memoizedState=e):t},useState:function(e){return te(ee,e)},useLayoutEffect:function(){},useCallback:function(e,t){return ne((function(){return e}),t)},useImperativeHandle:ie,useEffect:ie,useDebugValue:ie,useDeferredValue:function(e){return Z(),e},useTransition:function(){return Z(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(oe.identifierPrefix||"")+"R:"+(oe.uniqueID++).toString(36)},useMutableSource:function(e,t){return Z(),t(e._source)}},se="http://www.w3.org/1999/xhtml";function le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var ce={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ue=r({menuitem:!0},ce),de={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];Object.keys(de).forEach((function(e){he.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),de[t]=de[e]}))}));var pe=/([A-Z])/g,fe=/^ms-/,me=i.Children.toArray,ge=C.ReactCurrentDispatcher,ye={listing:!0,pre:!0,textarea:!0},ve=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,_e={},be={};var we=Object.prototype.hasOwnProperty,xe={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Se(e,t){if(void 0===e)throw Error(o(152,S(t)||"Component"))}function Ce(e,t,n){function a(i,a){var s=a.prototype&&a.prototype.isReactComponent,l=function(e,t,n,r){if(r&&"object"===typeof(r=e.contextType)&&null!==r)return k(r,n),r[n];if(e=e.contextTypes){for(var i in n={},e)n[i]=t[i];t=n}else t=E;return t}(a,t,n,s),c=[],u=!1,d={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===c)return null},enqueueReplaceState:function(e,t){u=!0,c=[t]},enqueueSetState:function(e,t){if(null===c)return null;c.push(t)}};if(s){if(s=new a(i.props,l,d),"function"===typeof a.getDerivedStateFromProps){var h=a.getDerivedStateFromProps.call(null,i.props,s.state);null!=h&&(s.state=r({},s.state,h))}}else if(q={},s=a(i.props,l,d),null==(s=Q(a,i.props,s,l))||null==s.render)return void Se(e=s,a);if(s.props=i.props,s.context=l,s.updater=d,void 0===(d=s.state)&&(s.state=d=null),"function"===typeof s.UNSAFE_componentWillMount||"function"===typeof s.componentWillMount)if("function"===typeof s.componentWillMount&&"function"!==typeof a.getDerivedStateFromProps&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&"function"!==typeof a.getDerivedStateFromProps&&s.UNSAFE_componentWillMount(),c.length){d=c;var p=u;if(c=null,u=!1,p&&1===d.length)s.state=d[0];else{h=p?d[0]:s.state;var f=!0;for(p=p?1:0;p=l))throw Error(o(304));var c=new Uint16Array(l);for(c.set(a),(I=c)[0]=r+1,a=r;a=s.children.length){var l=s.footer;if(""!==l&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===s.type)this.currentSelectValue=null;else if(null!=s.type&&null!=s.type.type&&s.type.type.$$typeof===u)this.popProvider(s.type);else if(s.type===p){this.suspenseDepth--;var c=r.pop();if(i){i=!1;var d=s.fallbackFrame;if(!d)throw Error(o(303));this.stack.push(d),r[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}r[this.suspenseDepth]+=c}r[this.suspenseDepth]+=l}else{var h=s.children[s.childIndex++],f="";try{f+=this.render(h,s.context,s.domNamespace)}catch(m){if(null!=m&&"function"===typeof m.then)throw Error(o(294));throw m}r.length<=this.suspenseDepth&&r.push(""),r[this.suspenseDepth]+=f}}return r[0]}finally{ge.current=n,oe=t,$()}},t.render=function(e,t,n){if("string"===typeof e||"number"===typeof e)return""===(n=""+e)?"":this.makeStaticMarkup?B(n):this.previousWasTextNode?"\x3c!-- --\x3e"+B(n):(this.previousWasTextNode=!0,B(n));if(e=(t=Ce(e,t,this.threadID)).child,t=t.context,null===e||!1===e)return"";if(!i.isValidElement(e)){if(null!=e&&null!=e.$$typeof){if((n=e.$$typeof)===a)throw Error(o(257));throw Error(o(258,n.toString()))}return e=me(e),this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),""}var y=e.type;if("string"===typeof y)return this.renderDOM(e,t,n);switch(y){case w:case b:case l:case c:case f:case s:return e=me(e.props.children),this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),"";case p:throw Error(o(294));case _:throw Error(o(343))}if("object"===typeof y&&null!==y)switch(y.$$typeof){case h:q={};var x=y.render(e.props,e.ref);return x=Q(y.render,e.props,x,e.ref),x=me(x),this.stack.push({type:null,domNamespace:n,children:x,childIndex:0,context:t,footer:""}),"";case m:return e=[i.createElement(y.type,r({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),"";case u:return n={type:e,domNamespace:n,children:y=me(e.props.children),childIndex:0,context:t,footer:""},this.pushProvider(e),this.stack.push(n),"";case d:y=e.type,x=e.props;var S=this.threadID;return k(y,S),y=me(x.children(y[S])),this.stack.push({type:e,domNamespace:n,children:y,childIndex:0,context:t,footer:""}),"";case v:throw Error(o(338));case g:return y=(x=(y=e.type)._init)(y._payload),e=[i.createElement(y,r({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),""}throw Error(o(130,null==y?y:typeof y,""))},t.renderDOM=function(e,t,n){var a=e.type.toLowerCase();if(n===se&&le(a),!_e.hasOwnProperty(a)){if(!ve.test(a))throw Error(o(65,a));_e[a]=!0}var s=e.props;if("input"===a)s=r({type:void 0},s,{defaultChecked:void 0,defaultValue:void 0,value:null!=s.value?s.value:s.defaultValue,checked:null!=s.checked?s.checked:s.defaultChecked});else if("textarea"===a){var l=s.value;if(null==l){l=s.defaultValue;var c=s.children;if(null!=c){if(null!=l)throw Error(o(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(o(93));c=c[0]}l=""+c}null==l&&(l="")}s=r({},s,{value:void 0,children:""+l})}else if("select"===a)this.currentSelectValue=null!=s.value?s.value:s.defaultValue,s=r({},s,{value:void 0});else if("option"===a){c=this.currentSelectValue;var u=function(e){if(void 0===e||null===e)return e;var t="";return i.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(s.children);if(null!=c){var d=null!=s.value?s.value+"":u;if(l=!1,Array.isArray(c)){for(var h=0;h":(w+=">",l="");e:{if(null!=(c=s.dangerouslySetInnerHTML)){if(null!=c.__html){c=c.__html;break e}}else if("string"===typeof(c=s.children)||"number"===typeof c){c=B(c);break e}c=null}return null!=c?(s=[],ye.hasOwnProperty(a)&&"\n"===c.charAt(0)&&(w+="\n"),w+=c):s=me(s.children),e=e.type,n=null==n||"http://www.w3.org/1999/xhtml"===n?le(e):"http://www.w3.org/2000/svg"===n&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":n,this.stack.push({domNamespace:n,type:a,children:s,childIndex:0,context:t,footer:l}),this.previousWasTextNode=!1,w},e}();t.renderToStaticMarkup=function(e,t){e=new Ee(e,!0,t);try{return e.read(1/0)}finally{e.destroy()}}},4463:(e,t,n)=>{"use strict";var r=n(2791),i=n(1725),o=n(5296);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n