!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ol/style/Circle.js"),require("ol/style/Fill.js"),require("ol/style/Icon.js"),require("ol/render/Feature.js"),require("ol/style/Stroke.js"),require("ol/style/Style.js"),require("ol/style/Text.js"),require("ol/render/canvas.js"),require("ol/format/GeoJSON.js"),require("ol/format/MVT.js"),require("ol/Map.js"),require("ol/tilegrid/TileGrid.js"),require("ol/source/TileJSON.js"),require("ol/layer/Tile.js"),require("ol/layer/Vector.js"),require("ol/source/Vector.js"),require("ol/layer/VectorTile.js"),require("ol/source/VectorTile.js"),require("ol/View.js"),require("ol/tilegrid.js"),require("ol/proj.js")):"function"==typeof define&&define.amd?define(["exports","ol/style/Circle.js","ol/style/Fill.js","ol/style/Icon.js","ol/render/Feature.js","ol/style/Stroke.js","ol/style/Style.js","ol/style/Text.js","ol/render/canvas.js","ol/format/GeoJSON.js","ol/format/MVT.js","ol/Map.js","ol/tilegrid/TileGrid.js","ol/source/TileJSON.js","ol/layer/Tile.js","ol/layer/Vector.js","ol/source/Vector.js","ol/layer/VectorTile.js","ol/source/VectorTile.js","ol/View.js","ol/tilegrid.js","ol/proj.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).olms={},e.ol.style.Circle,e.ol.style.Fill,e.ol.style.Icon,e.ol.render.Feature,e.ol.style.Stroke,e.ol.style.Style,e.ol.style.Text,e.ol.render.canvas,e.ol.format.GeoJSON,e.ol.format.MVT,e.ol.Map,e.ol.tilegrid.TileGrid,e.ol.source.TileJSON,e.ol.layer.Tile,e.ol.layer.Vector,e.ol.source.Vector,e.ol.layer.VectorTile,e.ol.source.VectorTile,e.ol.View,e.ol.tilegrid,e.ol.proj)}(this,(function(e,t,r,n,a,i,o,s,u,l,p,f,c,d,y,m,h,v,g,b,x,w){"use strict";function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var z,S=k(t),q=k(r),M=k(n),T=k(a),j=k(i),_=k(o),C=k(s),A=k(l),E=k(p),I=k(f),F=k(c),D=k(d),O=k(y),P=k(m),N=k(h),L=k(v),R=k(g),U=k(b),V={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function G(e){return(e=Math.round(e))<0?0:e>255?255:e}function J(e){return e<0?0:e>1?1:e}function W(e){return"%"===e[e.length-1]?G(parseFloat(e)/100*255):G(parseInt(e))}function Z(e){return"%"===e[e.length-1]?J(parseFloat(e)/100):J(parseFloat(e))}function $(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{z={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in V)return V[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),a=r.indexOf(")");if(-1!==n&&a+1===r.length){var i=r.substr(0,n),o=r.substr(n+1,a-(n+1)).split(","),s=1;switch(i){case"rgba":if(4!==o.length)return null;s=Z(o.pop());case"rgb":return 3!==o.length?null:[W(o[0]),W(o[1]),W(o[2]),s];case"hsla":if(4!==o.length)return null;s=Z(o.pop());case"hsl":if(3!==o.length)return null;var u=(parseFloat(o[0])%360+360)%360/360,l=Z(o[1]),p=Z(o[2]),f=p<=.5?p*(l+1):p+l-p*l,c=2*p-f;return[G(255*$(c,f,u+1/3)),G(255*$(c,f,u)),G(255*$(c,f,u-1/3)),s];default:return null}}return null}}catch(e){}var X=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};function B(e){return"object"==typeof e?["literal",e]:e}function H(e,t){var r=e.stops;if(!r)return function(e,t){var r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];var n=["color"===t.type?"to-color":t.type,r,B(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}(e,t);var n=r&&"object"==typeof r[0][0],a=n||void 0!==e.property,i=n||!a;return r=r.map((function(e){return!a&&t.tokens&&"string"==typeof e[1]?[e[0],ne(e[1])]:[e[0],B(e[1])]})),n?function(e,t,r){for(var n={},a={},i=[],o=0;o3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function re(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function ne(e){for(var t=["concat"],r=/{([^{}]+)}/g,n=0,a=r.exec(e);null!==a;a=r.exec(e)){var i=e.slice(n,r.lastIndex-a[0].length);n=r.lastIndex,i.length>0&&t.push(i),t.push(["get",a[1]])}if(1===t.length)return e;if(n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var ge=[oe,se,ue,le,pe,ye,fe,he(ce),me];function be(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!be(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(var r=0,n=ge;r=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Te(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof X)return!0;if(e instanceof ke)return!0;if(e instanceof Se)return!0;if(e instanceof qe)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!=typeof s||!(s in Ee)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=Ee[s],n++}else i=ce;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=he(i,o)}else r=Ee[a];for(var u=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var Fe=function(e){this.type=ye,this.sections=e};Fe.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");for(var n=[],a=!1,i=1;i<=e.length-1;++i){var o=e[i];if(a&&"object"==typeof o&&!Array.isArray(o)){a=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,se)))return null;var u=null;if(o["text-font"]&&!(u=t.parse(o["text-font"],1,he(ue))))return null;var l=null;if(o["text-color"]&&!(l=t.parse(o["text-color"],1,pe)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l}else{var f=t.parse(e[i],1,ce);if(!f)return null;var c=f.type.kind;if("string"!==c&&"value"!==c&&"null"!==c&&"resolvedImage"!==c)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new Fe(n)},Fe.prototype.evaluate=function(e){return new Se(this.sections.map((function(t){var r=t.content.evaluate(e);return je(r)===me?new ze("",r,null,null,null):new ze(_e(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},Fe.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},De.prototype.eachChild=function(e){e(this.input)},De.prototype.outputDefined=function(){return!1},De.prototype.serialize=function(){return["image",this.input.serialize()]};var Oe={"to-boolean":le,"to-color":pe,"to-number":se,"to-string":ue},Pe=function(e,t){this.type=e,this.args=t};Pe.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=Oe[r],a=[],i=1;i4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Me(t[0],t[1],t[2],t[3])))return new X(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ae(r||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,u=this.args;s=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function We(e,t){var r,n=(180+e[0])/360,a=(r=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,t.z);return[Math.round(n*i*Ve),Math.round(a*i*Ve)]}function Ze(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function $e(e,t){for(var r,n,a,i,o,s,u,l=!1,p=0,f=t.length;p0&&f<0||p<0&&f>0}function He(e,t,r){for(var n=0,a=r;nr[2]){var a=.5*n,i=e[0]-r[0]>a?-n:r[0]-e[0]>a?n:0;0===i&&(i=e[0]-r[2]>a?-n:r[2]-e[0]>a?n:0),e[0]+=i}Ge(t,e)}function rt(e,t,r,n){var a=Math.pow(2,n.z)*Ve,i=[n.x*Ve,n.y*Ve],o=[];if(!e)return o;for(var s=0,u=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!st(e,t)&&(r=!1)})),r}at.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(Te(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new Ae("Input is not a number.");o=s-1}return 0}lt.prototype.parse=function(e,t,r,n,a){return void 0===a&&(a={}),t?this.concat(t,r,n)._parse(e,a):this._parse(e,a)},lt.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new Ie(t,[e]):"coerce"===r?new Pe(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 n=e[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(e,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,t.typeAnnotation||"coerce");else i=r(i,o,t.typeAnnotation||"assert")}if(!(i instanceof Ce)&&"resolvedImage"!==i.type.kind&&pt(i)){var u=new Le;try{i=new Ce(i.type,i.evaluate(u))}catch(e){return this.error(e.message),null}}return i}return this.error('Unknown expression "'+n+'". 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 "+typeof e+" instead.")},lt.prototype.concat=function(e,t,r){var n="number"==typeof e?this.path.concat(e):this.path,a=r?this.scope.concat(r):this.scope;return new lt(this.registry,n,t||null,a,this.errors)},lt.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new ae(n,e))},lt.prototype.checkSubtype=function(e,t){var r=be(e,t);return r&&this.error(r),r};var ct=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,a=r;n=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=t.parse(s,l,a);if(!p)return null;a=a||p.type,n.push([o,p])}return new ct(a,r,n)},ct.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var a=t.length;return n>=t[a-1]?r[a-1].evaluate(e):r[ft(t,n)].evaluate(e)},ct.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var dt=yt;function yt(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}function mt(e,t,r){return e*(1-r)+t*r}yt.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},yt.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},yt.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},yt.prototype.solveCurveX=function(e,t){var r,n,a,i,o;for(void 0===t&&(t=1e-6),a=e,o=0;o<8;o++){if(i=this.sampleCurveX(a)-e,Math.abs(i)(n=1))return n;for(;ri?r=a:n=a,a=.5*(n-r)+r}return a},yt.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var ht=Object.freeze({__proto__:null,number:mt,color:function(e,t,r){return new X(mt(e.r,t.r,r),mt(e.g,t.g,r),mt(e.b,t.b,r),mt(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return mt(e,t[n],r)}))}}),vt=.95047,gt=1.08883,bt=4/29,xt=6/29,wt=3*xt*xt,kt=Math.PI/180,zt=180/Math.PI;function St(e){return e>.008856451679035631?Math.pow(e,1/3):e/wt+bt}function qt(e){return e>xt?e*e*e:wt*(e-bt)}function Mt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Tt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function jt(e){var t=Tt(e.r),r=Tt(e.g),n=Tt(e.b),a=St((.4124564*t+.3575761*r+.1804375*n)/vt),i=St((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-St((.0193339*t+.119192*r+.9503041*n)/gt)),alpha:e.a}}function _t(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*qt(t),r=vt*qt(r),n=gt*qt(n),new X(Mt(3.2404542*r-1.5371385*t-.4985314*n),Mt(-.969266*r+1.8760108*t+.041556*n),Mt(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function Ct(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var At={forward:jt,reverse:_t,interpolate:function(e,t,r){return{l:mt(e.l,t.l,r),a:mt(e.a,t.a,r),b:mt(e.b,t.b,r),alpha:mt(e.alpha,t.alpha,r)}}},Et={forward:function(e){var t=jt(e),r=t.l,n=t.a,a=t.b,i=Math.atan2(a,n)*zt;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:e.a}},reverse:function(e){var t=e.h*kt,r=e.c;return _t({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Ct(e.h,t.h,r),c:mt(e.c,t.c,r),l:mt(e.l,t.l,r),alpha:mt(e.alpha,t.alpha,r)}}},It=function(e,t,r,n,a){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(a=t.parse(a,2,se)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=pe:t.expectedType&&"value"!==t.expectedType.kind&&(l=t.expectedType);for(var p=0;p=f)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=t.parse(c,y,l);if(!m)return null;l=l||m.type,u.push([f,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new It(l,r,n,a,u):t.error("Type "+ve(l)+" is not interpolatable.")},It.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var a=t.length;if(n>=t[a-1])return r[a-1].evaluate(e);var i=ft(t,n),o=t[i],s=t[i+1],u=It.interpolationFactor(this.interpolation,n,o,s),l=r[i].evaluate(e),p=r[i+1].evaluate(e);return"interpolate"===this.operator?ht[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?Et.reverse(Et.interpolate(Et.forward(l),Et.forward(p),u)):At.reverse(At.interpolate(At.forward(l),At.forward(p),u))},It.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new Ae("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Ae("Array index must be an integer, but found "+t+" instead.");return r[t]},Pt.prototype.eachChild=function(e){e(this.index),e(this.input)},Pt.prototype.outputDefined=function(){return!1},Pt.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Nt=function(e,t){this.type=le,this.needle=e,this.haystack=t};Nt.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ce),n=t.parse(e[2],2,ce);return r&&n?xe(r.type,[le,ue,se,oe,ce])?new Nt(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+ve(r.type)+" instead"):null},Nt.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!we(t,["boolean","string","number","null"]))throw new Ae("Expected first argument to be of type boolean, string, number or null, but found "+ve(je(t))+" instead.");if(!we(r,["string","array"]))throw new Ae("Expected second argument to be of type array or string, but found "+ve(je(r))+" instead.");return r.indexOf(t)>=0},Nt.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Nt.prototype.outputDefined=function(){return!0},Nt.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Lt=function(e,t,r){this.type=se,this.needle=e,this.haystack=t,this.fromIndex=r};Lt.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ce),n=t.parse(e[2],2,ce);if(!r||!n)return null;if(!xe(r.type,[le,ue,se,oe,ce]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+ve(r.type)+" instead");if(4===e.length){var a=t.parse(e[3],3,se);return a?new Lt(r,n,a):null}return new Lt(r,n)},Lt.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!we(t,["boolean","string","number","null"]))throw new Ae("Expected first argument to be of type boolean, string, number or null, but found "+ve(je(t))+" instead.");if(!we(r,["string","array"]))throw new Ae("Expected second argument to be of type array or string, but found "+ve(je(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},Lt.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Lt.prototype.outputDefined=function(){return!1},Lt.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Rt=function(e,t,r,n,a,i){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};Rt.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var a={},i=[],o=2;oNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,je(c)))return null}else r=je(c);if(void 0!==a[String(c)])return l.error("Branch labels must be unique.");a[String(c)]=i.length}var d=t.parse(u,o,n);if(!d)return null;n=n||d.type,i.push(d)}var y=t.parse(e[1],1,ce);if(!y)return null;var m=t.parse(e[e.length-1],e.length-1,n);return m?"value"!==y.type.kind&&t.concat(1).checkSubtype(r,y.type)?null:new Rt(r,n,y,a,i,m):null},Rt.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(je(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Rt.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Rt.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},Rt.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ce),n=t.parse(e[2],2,se);if(!r||!n)return null;if(!xe(r.type,[he(ce),ue,ce]))return t.error("Expected first argument to be of type array or string, but found "+ve(r.type)+" instead");if(4===e.length){var a=t.parse(e[3],3,se);return a?new Vt(r.type,r,n,a):null}return new Vt(r.type,r,n)},Vt.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!we(t,["string","array"]))throw new Ae("Expected first argument to be of type array or string, but found "+ve(je(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Vt.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Vt.prototype.outputDefined=function(){return!1},Vt.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Zt=Wt("==",(function(e,t,r){return t===r}),Jt),$t=Wt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Jt(0,t,r,n)})),Xt=Wt("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Ht=Wt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Yt=Wt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),Kt=function(e,t,r,n,a){this.type=ue,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};Kt.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,se);if(!r)return null;var n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=t.parse(n.locale,1,ue)))return null;var i=null;if(n.currency&&!(i=t.parse(n.currency,1,ue)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,se)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,se))?null:new Kt(r,a,i,o,s)},Kt.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Kt.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Kt.prototype.outputDefined=function(){return!1},Kt.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Qt=function(e){this.type=se,this.input=e};Qt.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+ve(r.type)+" instead."):new Qt(r):null},Qt.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Ae("Expected value to be of type string or array, but found "+ve(je(t))+" instead.")},Qt.prototype.eachChild=function(e){e(this.input)},Qt.prototype.outputDefined=function(){return!1},Qt.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var er={"==":Zt,"!=":$t,">":Bt,"<":Xt,">=":Yt,"<=":Ht,array:Ie,at:Pt,boolean:Ie,case:Ut,coalesce:Dt,collator:Ue,format:Fe,image:De,in:Nt,"index-of":Lt,interpolate:It,"interpolate-hcl":It,"interpolate-lab":It,length:Qt,let:Ot,literal:Ce,match:Rt,number:Ie,"number-format":Kt,object:Ie,slice:Vt,step:ct,string:Ie,"to-boolean":Pe,"to-color":Pe,"to-number":Pe,"to-string":Pe,var:ut,within:at};function tr(e,t){var r=t[0],n=t[1],a=t[2],i=t[3];r=r.evaluate(e),n=n.evaluate(e),a=a.evaluate(e);var o=i?i.evaluate(e):1,s=Me(r,n,a,o);if(s)throw new Ae(s);return new X(r/255*o,n/255*o,a/255*o,o)}function rr(e,t){return e in t}function nr(e,t){var r=t[e];return void 0===r?null:r}function ar(e){return{type:e}}function ir(e){return{result:"success",value:e}}function or(e){return{result:"error",value:e}}function sr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}Re.register(er,{error:[{kind:"error"},[ue],function(e,t){var r=t[0];throw new Ae(r.evaluate(e))}],typeof:[ue,[ce],function(e,t){return ve(je(t[0].evaluate(e)))}],"to-rgba":[he(se,4),[pe],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[pe,[se,se,se],tr],rgba:[pe,[se,se,se,se],tr],has:{type:le,overloads:[[[ue],function(e,t){return rr(t[0].evaluate(e),e.properties())}],[[ue,fe],function(e,t){var r=t[0],n=t[1];return rr(r.evaluate(e),n.evaluate(e))}]]},get:{type:ce,overloads:[[[ue],function(e,t){return nr(t[0].evaluate(e),e.properties())}],[[ue,fe],function(e,t){var r=t[0],n=t[1];return nr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[ce,[ue],function(e,t){return nr(t[0].evaluate(e),e.featureState||{})}],properties:[fe,[],function(e){return e.properties()}],"geometry-type":[ue,[],function(e){return e.geometryType()}],id:[ce,[],function(e){return e.id()}],zoom:[se,[],function(e){return e.globals.zoom}],pitch:[se,[],function(e){return e.globals.pitch||0}],"distance-from-center":[se,[],function(e){return e.distanceFromCenter()}],"heatmap-density":[se,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[se,[],function(e){return e.globals.lineProgress||0}],"sky-radial-progress":[se,[],function(e){return e.globals.skyRadialProgress||0}],accumulated:[ce,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[se,ar(se),function(e,t){for(var r=0,n=0,a=t;n":[le,[ue,ce],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[le,[ce],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[le,[ue,ce],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[le,[ce],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[le,[ue,ce],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[le,[ce],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[le,[ce],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[le,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[le,[he(ue)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[le,[he(ce)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[le,[ue,he(ce)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[le,[ue,he(ce)],function(e,t){var r=t[0],n=t[1];return function(e,t,r,n){for(;r<=n;){var a=r+n>>1;if(t[a]===e)return!0;t[a]>e?n=a-1:r=a+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:le,overloads:[[[le,le],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[ar(le),function(e,t){for(var r=0,n=t;r-1}(t))return or([new ae("","zoom expressions not supported")]);var i=dr(r);if(!i&&!a)return or([new ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(i instanceof ae)return or([i]);if(i instanceof It&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return or([new ae("",'"interpolate" expressions cannot be used with this property')]);if(!i)return ir(new pr(n?"constant":"source",e.value));var o=i instanceof It?i.interpolation:void 0;return ir(new fr(n?"camera":"composite",e.value,i.labels,o))}function dr(e){var t=null;if(e instanceof Ot)t=dr(e.result);else if(e instanceof Dt)for(var r=0,n=e.args;r":{},">=":{},"<":{},"<=":{},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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,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},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},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}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["source"]}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],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","feature"]},"property-type":"cross-faded-data-driven"},"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-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},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"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-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"}}};function hr(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t",">=","<","<=","to-boolean"]);function kr(e,t){return et?1:0}function zr(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===r||"<="===r||">="===r?qr(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(Sr))):"all"===r?["all"].concat(e.slice(1).map(Sr)):"none"===r?["all"].concat(e.slice(1).map(Sr).map(jr)):"in"===r?Mr(e[1],e.slice(2)):"!in"===r?jr(Mr(e[1],e.slice(2))):"has"===r?Tr(e[1]):"!has"===r?jr(Tr(e[1])):"within"!==r||e}function qr(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Mr(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 t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(kr)]]:["filter-in-small",e,["literal",t]]}}function Tr(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function jr(e){return["!",e]}var _r=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Cr(e,t){var r={};for(var n in e)"ref"!==n&&(r[n]=e[n]);return _r.forEach((function(e){e in t&&(r[e]=t[e])})),r}var Ar={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},Er=" ",Ir=/(italic|oblique)$/i,Fr={},Dr=function(e,t,r){var n=Fr[e];if(!n){Array.isArray(e)||(e=[e]);for(var a=400,i="normal",o=[],s=0,u=e.length;s1?l[l.length-2].toLowerCase():"";if(p==f||p==f.replace("-","")||c+"-"+p==f){a=Ar[f],l.pop(),c&&f.startsWith(c)&&l.pop();break}}"number"==typeof p&&(a=p);var d=l.join(Er).replace("Klokantech Noto Sans","Noto Sans");-1!==d.indexOf(Er)&&(d='"'+d+'"'),o.push(d)}n=Fr[e]=[i,a,o]}return n[0]+Er+n[1]+Er+t+"px"+(r?"/"+r:"")+Er+n[2]},Or="https://api.mapbox.com";function Pr(e){var t="mapbox://";return 0!==e.indexOf(t)?"":e.slice(t.length)}function Nr(e,t){var r=Pr(e);if(!r)return decodeURI(new URL(e,location.href).href);var n="styles/";if(0!==r.indexOf(n))throw new Error("unexpected style url: "+e);var a=r.slice(n.length);return Or+"/styles/v1/"+a+"?&access_token="+t}function Lr(e,t,r,n){var a=new URL(e,n),i=Pr(e);return i?"https://{a-d}.tiles.mapbox.com/v4/"+i+"/{z}/{x}/{y}.vector.pbf?access_token="+t:t?(a.searchParams.set(r,t),decodeURI(a.href)):decodeURI(a.href)}function Rr(e){return e*Math.PI/180}var Ur=function(){for(var e=[],t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Vr(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);var r=document.createElement("canvas");return r.width=e,r.height=t,r}function Gr(e,t){for(var r=0,n=t.length;r=.05){for(var r="",n=e.split("\n"),a=Hr.slice(0,Math.round(t/.1)),i=0,o=n.length;i0&&(r+="\n"),r+=n[i].split("").join(a);return r}return e}function Kr(){return Br||(Br=Vr(1,1).getContext("2d")),Br}function Qr(e,t){return Kr().measureText(e).width+(e.length-1)*t}var en={};function tn(e,t,r,n){if(-1!==e.indexOf("\n")){for(var a=e.split("\n"),i=[],o=0,s=a.length;o1){var f=Kr();f.font=t;for(var c=f.measureText("M").width*r,d="",y=[],m=0,h=p.length;m1;++b){var w=y[b];if(Qr(w,n)<.35*c){var k=b>0?Qr(y[b-1],n):1/0,z=b.7*c&&Qr(T,n)<.6*c){var j=M.split(" "),_=j.pop();Qr(_,n)<.2*c&&(y[S]=j.join(" "),y[S+1]=_+" "+T),q-=1}}l=y.join("\n")}else l=e;l=Yr(l,n),en[u]=l}return l}var rn,nn=/font-family: ?([^;]*);/,an=/("|')/g;function on(e){if(!rn){rn={};for(var t=document.styleSheets,r=0,n=t.length;r0&&"string"==typeof u[0]&&u[0]in er);if(!c&&sr(p)&&(p=H(p,f),c=!0),c){var d=function(e,t){var r=cr(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}(p,f);l[r]=d.evaluate.bind(d)}else"color"==f.type&&(p=X.parse(p)),l[r]=function(){return p}}return yn.zoom=n,l[r](yn,a,o)}function hn(e,t,r,n){return mn(e,"layout","icon-allow-overlap",t,r,n)?mn(e,"layout","icon-ignore-placement",t,r,n)?"none":"obstacle":"declutter"}function vn(e,t,r,n,a){return a||console.warn("No filterCache provided to evaluateFilter()"),e in a||(a[e]=vr(t).filter),yn.zoom=n,a[e](yn,r)}var gn=!1;function bn(e,t){if(e){if(!gn&&(0===e.a||0===t))return;var r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}var xn=/\{[^{}}]*\}/g;function wn(e,t){return e.replace(xn,(function(e){return t[e.slice(1,-1)]||""}))}var kn=!1;function zn(e,t,r,n,a,i,o){if(void 0===n&&(n=Ur),void 0===a&&(a=void 0),void 0===i&&(i=void 0),void 0===o&&(o=void 0),"string"==typeof t&&(t=JSON.parse(t)),8!=t.version)throw new Error("glStyle version 8 required.");var s,u;if(i)if("undefined"!=typeof Image){var l=new Image;l.crossOrigin="anonymous",l.onload=function(){s=l,u=[l.width,l.height],e.changed(),l.onload=null},l.src=i}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:i}),p.addEventListener("message",(function(e){"imageLoaded"===e.data.action&&e.data.src===i&&(s=e.data.image,u=[s.width,s.height])}))}for(var f,c=function(e){e=e.slice();for(var t=Object.create(null),r=0;r=A.maxzoom)){var N=A.filter;if(!N||vn(E,N,y,p,g)){f=A;var L=void 0,R=void 0,U=void 0,V=void 0,G=void 0,J=void 0,W=z.index;if(3==c&&("fill"==A.type||"fill-extrusion"==A.type))if(R=mn(A,"paint",A.type+"-opacity",p,y,v,b),A.type+"-pattern"in P){var Z=mn(A,"paint",A.type+"-pattern",p,y,v,b);if(Z){var $="string"==typeof Z?wn(Z,i):Z.toString();if(s&&a&&a[$]){++x,(J=O[x])&&J.getFill()&&!J.getStroke()&&!J.getText()||(J=new _.default({fill:new q.default}),O[x]=J),U=J.getFill(),J.setZIndex(W);var X=$+"."+R,B=h[X];if(!B){var H=a[$],Y=Vr(H.width,H.height),K=Y.getContext("2d");K.globalAlpha=R,K.drawImage(s,H.x,H.y,H.width,H.height,0,0,H.width,H.height),B=K.createPattern(Y,"repeat"),h[X]=B}U.setColor(B)}}}else L=bn(mn(A,"paint",A.type+"-color",p,y,v,b),R),A.type+"-outline-color"in P&&(G=bn(mn(A,"paint",A.type+"-outline-color",p,y,v,b),R)),G||(G=L),(L||G)&&(++x,(!(J=O[x])||L&&!J.getFill()||!L&&J.getFill()||G&&!J.getStroke()||!G&&J.getStroke()||J.getText())&&(J=new _.default({fill:L?new q.default:void 0,stroke:G?new j.default:void 0}),O[x]=J),L&&(U=J.getFill()).setColor(L),G&&((V=J.getStroke()).setColor(G),V.setWidth(.5)),J.setZIndex(W));if(1!=c&&"line"==A.type){L=!("line-pattern"in P)&&"line-color"in P?bn(mn(A,"paint","line-color",p,y,v,b),mn(A,"paint","line-opacity",p,y,v,b)):void 0;var Q=mn(A,"paint","line-width",p,y,v,b);L&&Q>0&&(++x,(J=O[x])&&J.getStroke()&&!J.getFill()&&!J.getText()||(J=new _.default({stroke:new j.default}),O[x]=J),(V=J.getStroke()).setLineCap(mn(A,"layout","line-cap",p,y,v,b)),V.setLineJoin(mn(A,"layout","line-join",p,y,v,b)),V.setMiterLimit(mn(A,"layout","line-miter-limit",p,y,v,b)),V.setColor(L),V.setWidth(Q),V.setLineDash(P["line-dasharray"]?mn(A,"paint","line-dasharray",p,y,v,b).map((function(e){return e*Q})):null),J.setZIndex(W))}var ee=!1,te=null,re=0,ne=void 0,ae=void 0,ie=void 0;if((1==c||2==c)&&"icon-image"in I){var oe=mn(A,"layout","icon-image",p,y,v,b);if(oe){ne="string"==typeof oe?wn(oe,i):oe.toString();var se=void 0;if(s&&a&&a[ne]){var ue=mn(A,"layout","icon-rotation-alignment",p,y,v,b);if(2==c){var le=t.getGeometry();if(le.getFlatMidpoint||le.getFlatMidpoints){var pe=le.getExtent();if(Math.sqrt(Math.max(Math.pow((pe[2]-pe[0])/r,2),Math.pow((pe[3]-pe[1])/r,2)))>150){var fe="MultiLineString"===le.getType()?le.getFlatMidpoints():le.getFlatMidpoint();if(pn||(ln=[NaN,NaN],pn=new T.default("Point",ln,[],{},null)),se=pn,ln[0]=fe[0],ln[1]=fe[1],"line"===mn(A,"layout","symbol-placement",p,y,v,b)&&"map"===ue)for(var ce=le.getStride(),de=le.getFlatCoordinates(),ye=0,me=de.length-ce;ye=xe&&fe[0]<=ke&&fe[1]>=we&&fe[1]<=ze){re=Math.atan2(ve-be,ge-he);break}}}}}if(2!==c||se){var Se=mn(A,"layout","icon-size",p,y,v,b),qe=void 0!==P["icon-color"]?mn(A,"paint","icon-color",p,y,v,b):null;if(!qe||0!==qe.a){var Me=ne+"."+Se;if(null!==qe&&(Me+="."+qe),!(ae=m[Me])){var Te=a[ne],je=hn(A,p,y,v),_e=void 0;"icon-offset"in I&&((_e=mn(A,"layout","icon-offset",p,y,v,b))[1]*=-1),ae=new M.default({color:qe?[255*qe.r,255*qe.g,255*qe.b,qe.a]:void 0,img:s,imgSize:u,size:[Te.width,Te.height],offset:[Te.x,Te.y],rotateWithView:"map"===ue,scale:Se/Te.pixelRatio,displacement:_e,declutterMode:je}),m[Me]=ae}}ae&&(++x,(J=O[x])&&J.getImage()&&!J.getFill()&&!J.getStroke()||(J=new _.default,O[x]=J),J.setGeometry(se),ae.setRotation(re+Rr(mn(A,"layout","icon-rotate",p,y,v,b))),ae.setOpacity(mn(A,"paint","icon-opacity",p,y,v,b)),ae.setAnchor(cn[mn(A,"layout","icon-anchor",p,y,v,b)]),J.setImage(ae),te=J.getText(),J.setText(void 0),J.setZIndex(W),ee=!0,ie=!1)}else ie=!0}}}if(1==c&&"circle"===A.type){++x,(J=O[x])&&J.getImage()&&!J.getFill()&&!J.getStroke()||(J=new _.default,O[x]=J);var Ce="circle-radius"in P?mn(A,"paint","circle-radius",p,y,v,b):5,Ae=bn(mn(A,"paint","circle-stroke-color",p,y,v,b),mn(A,"paint","circle-stroke-opacity",p,y,v,b)),Ee=bn(mn(A,"paint","circle-color",p,y,v,b),mn(A,"paint","circle-opacity",p,y,v,b)),Ie=mn(A,"paint","circle-stroke-width",p,y,v,b),Fe=Ce+"."+Ae+"."+Ee+"."+Ie;(ae=m[Fe])||(ae=new S.default({radius:Ce,stroke:Ae&&Ie>0?new j.default({width:Ie,color:Ae}):void 0,fill:Ee?new q.default({color:Ee}):void 0,declutterMode:"none"}),m[Fe]=ae),J.setImage(ae),te=J.getText(),J.setText(void 0),J.setGeometry(void 0),J.setZIndex(W),ee=!0}var De=void 0,Oe=void 0,Pe=void 0,Ne=void 0,Le=void 0,Re=void 0;if("text-field"in I){Ne=Math.round(mn(A,"layout","text-size",p,y,v,b));var Ue=mn(A,"layout","text-font",p,y,v,b);Pe=mn(A,"layout","text-line-height",p,y,v,b),(Oe=Dr(o?o(Ue):Ue,Ne,Pe)).includes("sans-serif")||(Oe+=",sans-serif"),Le=mn(A,"layout","text-letter-spacing",p,y,v,b),Re=mn(A,"layout","text-max-width",p,y,v,b);var Ve=mn(A,"layout","text-field",p,y,v,b);De="object"==typeof Ve&&Ve.sections?1===Ve.sections.length?Ve.toString():Ve.sections.reduce((function(e,t,r){var n=t.fontStack?t.fontStack.split(","):Ue,a=Dr(o?o(n):n,Ne*(t.scale||1),Pe),i=t.text;if("\n"===i)return e.push("\n",""),e;if(2!=c){for(var s=0,u=(i=tn(i,a,Re,Le).split("\n")).length;s0&&e.push("\n",""),e.push(i[s],a);return e}e.push(Yr(i,Le),a)}),[]):wn(Ve,i).trim(),R=mn(A,"paint","text-opacity",p,y,v,b)}if(De&&R&&!ie){ee||(++x,(J=O[x])&&J.getText()&&!J.getFill()&&!J.getStroke()||(J=new _.default,O[x]=J),J.setImage(void 0),J.setGeometry(void 0)),J.getText()||J.setText(te||new C.default({padding:[2,2,2,2]})),te=J.getText();var Ge=I["text-transform"];"uppercase"==Ge?De=Array.isArray(De)?De.map((function(e,t){return t%2?e:e.toUpperCase()})):De.toUpperCase():"lowercase"==Ge&&(De=Array.isArray(De)?De.map((function(e,t){return t%2?e:e.toLowerCase()})):De.toLowerCase());var Je=Array.isArray(De)?De:2==c?Yr(De,Le):tn(De,Oe,Re,Le);te.setText(Je),te.setFont(Oe),te.setRotation(Rr(mn(A,"layout","text-rotate",p,y,v,b)));var We=mn(A,"layout","text-anchor",p,y,v,b),Ze=ee||1==c?"point":mn(A,"layout","symbol-placement",p,y,v,b);te.setPlacement(Ze),te.setOverflow("point"===Ze);var $e=mn(A,"paint","text-halo-width",p,y,v,b),Xe=mn(A,"layout","text-offset",p,y,v,b),Be=mn(A,"paint","text-translate",p,y,v,b),He=0,Ye=0;if("point"==Ze){var Ke="center";-1!==We.indexOf("left")?(Ke="left",Ye=$e):-1!==We.indexOf("right")&&(Ke="right",Ye=-$e),te.setTextAlign(Ke);var Qe=mn(A,"layout","text-rotation-alignment",p,y,v,b);te.setRotateWithView("map"==Qe)}else te.setMaxAngle(Rr(mn(A,"layout","text-max-angle",p,y,v,b))*De.length/Je.length),te.setTextAlign(),te.setRotateWithView(!1);var et="middle";0==We.indexOf("bottom")?(et="bottom",He=-$e-.5*(Pe-1)*Ne):0==We.indexOf("top")&&(et="top",He=$e+.5*(Pe-1)*Ne),te.setTextBaseline(et);var tt=mn(A,"layout","text-justify",p,y,v,b);te.setJustify("auto"===tt?void 0:tt),te.setOffsetX(Xe[0]*Ne+Ye+Be[0]),te.setOffsetY(Xe[1]*Ne+He+Be[1]),D.setColor(bn(mn(A,"paint","text-color",p,y,v,b),R)),te.setFill(D);var rt=bn(mn(A,"paint","text-halo-color",p,y,v,b),R);if(rt){F.setColor(rt),$e*=2;var nt=.5*Ne;F.setWidth($e<=nt?$e:nt),te.setStroke(F)}else te.setStroke(void 0);var at=mn(A,"layout","text-padding",p,y,v,b),it=te.getPadding();at!==it[0]&&(it[0]=at,it[1]=at,it[2]=at,it[3]=at),J.setZIndex(W)}}}}return x>-1?(O.length=x+1,kn&&("function"==typeof t.set?t.set("mapbox-layer",f):t.getProperties()["mapbox-layer"]=f),O):void 0}};return e.setStyle(P),e.set("mapbox-source",f),e.set("mapbox-layers",y),e.set("mapbox-featurestate",{}),P}function Sn(e,t){t.accessToken||(t=Object.assign({},t),new URL(e).searchParams.forEach((function(e,r){t.accessToken=e,t.accessTokenParam=r})));return t}function qn(e,t,r,n,a){var i,o,s;return void 0===r&&(r=""),void 0===n&&(n={}),void 0===a&&(a=void 0),"string"==typeof n?(i=n,s={}):(i=n.styleUrl,s=n),a||(a=s.resolutions),i||"string"!=typeof t||t.trim().startsWith("{")||(i=t),i&&(i=i.startsWith("data:")?location.href:Nr(i,s.accessToken),s=Sn(i,s)),new Promise((function(n,u){Zr(t,s).then((function(t){if(8!=t.version)return u(new Error("glStyle version 8 required."));if(!(e instanceof P.default||e instanceof L.default))return u(new Error("Can only apply to VectorLayer or VectorTileLayer"));var l,p,f,c=e instanceof L.default?"vector":"geojson";if(r?o=Array.isArray(r)?t.layers.find((function(e){return e.id===r[0]})).source:r:(o=Object.keys(t.sources).find((function(e){return t.sources[e].type===c})),r=o),!o)return u(new Error("No "+c+" source found in the glStyle."));function d(){if(e instanceof L.default)return An(t.sources[o],i,s).then((function(t){var r=e.getSource();if(r?t!==r&&(r.setTileUrlFunction(t.getTileUrlFunction()),r.format_||(r.format_=t.format_),r.getAttributions()||r.setAttributions(t.getAttributions()),r.getTileLoadFunction()===g.defaultLoadFunction&&r.setTileLoadFunction(t.getTileLoadFunction()),w.equivalent(r.getProjection(),t.getProjection())&&(r.tileGrid=t.getTileGrid())):e.setSource(t),!isFinite(e.getMaxResolution())&&!isFinite(e.getMinZoom())){var n=e.getSource().getTileGrid();e.setMaxResolution(n.getResolution(n.getMinZoom()))}}));var r=t.sources[o],n=e.getSource();n&&n.get("mapbox-source")===r||(n=Dn(r,i,s));var a=e.getSource();return a?n!==a&&(a.getAttributions()||a.setAttributions(n.getAttributions()),a.format_||(a.format_=n.getFormat()),a.url_=n.getUrl()):e.setSource(n),Promise.resolve()}function y(){f||t.sprite&&!l?f?(e.setStyle(f),d().then(n).catch(u)):u(new Error("Something went wrong trying to apply style.")):(f=zn(e,t,r,a,l,p,un),e.getStyle()?d().then(n).catch(u):u(new Error("Nothing to show for source ["+o+"]")))}if(t.sprite){var m=new URL(function(e,t,r){var n=Pr(e);if(!n)return decodeURI(new URL(e,r).href);var a="sprites/";if(0!==n.indexOf(a))throw new Error("unexpected sprites url: "+e);var i=n.slice(a.length);return Or+"/styles/v1/"+i+"/sprite?access_token="+t}(t.sprite,s.accessToken,i||location.href)),h=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",v=m.origin+m.pathname+h+".json"+m.search;new Promise((function(e,t){Wr("Sprite",v,s).then(e).catch((function(r){Wr("Sprite",v=m.origin+m.pathname+".json"+m.search,s).then(e).catch(t)}))})).then((function(e){if(void 0===e&&u(new Error("No sprites found.")),l=e,p=m.origin+m.pathname+h+".png"+m.search,s.transformRequest){var t=s.transformRequest(p,"SpriteImage");t instanceof Request&&(p=encodeURI(t.url))}y()})).catch((function(e){u(new Error("Sprites cannot be loaded: "+v+": "+e.message))}))}else y()})).catch(u)}))}var Mn={};function Tn(e,t,r){var n={id:t.id,type:t.type},a={};var i=0,o=!1;function s(e){if(e.frameState.time!==i&&(i=e.frameState.time,o=!1),!o){if(!(e.context instanceof CanvasRenderingContext2D))throw new Error("Cannot apply background to WebGL context");var s=function(e){var i=t.layout||{},o=t.paint||{};n.paint=o;var s,u,l=Gr(e,r.resolutions||Ur);return void 0!==o["background-color"]&&(s=mn(n,"paint","background-color",l,Mn,a)),void 0!==o["background-opacity"]&&(u=mn(n,"paint","background-opacity",l,Mn,a)),"none"==i.visibility?void 0:bn(s,u)}(e.frameState.viewState.resolution);if(s){var u=e.context,l=u.globalAlpha;u.globalAlpha=1,u.fillStyle=s,u.fillRect(0,0,e.context.canvas.width,e.context.canvas.height),u.globalAlpha=l}o=!0}}if("function"==typeof e.getLayers){var u=e.getLayers();u.forEach((function(e){e.on("prerender",s)})),u.on("add",(function(e){e.element.on("prerender",s)})),u.on("remove",(function(e){e.element.un("prerender",s)}))}else e.on("prerender",s)}function jn(e,t,r){t.layers.some((function(t){if("background"===t.type)return Tn(e,t,r),!0}))}function _n(e,t){var r;return e.some((function(e){if(e.id==t)return r=e.source,!0})),r}function Cn(e){var t=e.bounds;if(t){var r=w.fromLonLat([t[0],t[1]]),n=w.fromLonLat([t[2],t[3]]);return[r[0],r[1],n[0],n[1]]}}function An(e,t,r){return new Promise((function(n,a){Xr(e,t,r).then((function(e){var t=new D.default({tileJSON:e}),r=t.getTileJSON(),a=t.getTileGrid(),i=Cn(r),o=r.minzoom||0,s=r.maxzoom||22,u={attributions:t.getAttributions(),format:new E.default,tileGrid:new F.default({origin:a.getOrigin(0),extent:i||a.getExtent(),minZoom:o,resolutions:Ur.slice(0,s+1),tileSize:512})};Array.isArray(r.tiles)?u.urls=r.tiles:u.url=r.tiles,e.olSourceOptions&&Object.assign(u,e.olSourceOptions),n(new R.default(u))})).catch(a)}))}function En(e,t,r){var n=new L.default({declutter:!0,visible:!1});return An(e,t,r).then((function(t){t.set("mapbox-source",e),n.setSource(t)})).catch((function(e){n.setSource(void 0)})),n}function In(e,t,r){var n=new O.default;return Xr(e,t,r).then((function(t){var r=new D.default({transition:0,crossOrigin:"anonymous",tileJSON:t}),a=Cn(t),i=r.getTileGrid(),o=e.tileSize||t.tileSize||512,s=t.minzoom||0,u=t.maxzoom||22;r.tileGrid=new F.default({origin:i.getOrigin(0),extent:a||i.getExtent(),minZoom:s,resolutions:x.createXYZ({maxZoom:u,tileSize:o}).getResolutions(),tileSize:o});var l=r.getTileUrlFunction();r.setTileUrlFunction((function(e,t,n){var a=l(e,t,n);if(-1!=a.indexOf("{bbox-epsg-3857}")){var i=r.getTileGrid().getTileCoordExtent(e);a=a.replace("{bbox-epsg-3857}",i.toString())}return a})),r.set("mapbox-source",e),n.setSource(r)})).catch((function(e){n.setSource(void 0)})),n}var Fn=new A.default;function Dn(e,t,r){var n=e.data,a={};if("string"==typeof n){var i=Lr(n,r.accessToken,r.accessTokenParam||"access_token",t||location.href);if(r.transformRequest){var o=r.transformRequest(i,"GeoJSON");o instanceof Request&&(i=encodeURI(o.url))}a.url=i}else a.features=Fn.readFeatures(n,{featureProjection:w.getUserProjection()||"EPSG:3857"});var s=new N.default(Object.assign({attributions:e.attribution,format:Fn},a));return s.set("mapbox-source",e),s}function On(e,t,r){return new P.default({declutter:!0,source:Dn(e,t,r),visible:!1})}function Pn(e,t,r){var n=null;return function(a){a.frameState.viewState.zoom!==n&&(n=a.frameState.viewState.zoom,function(e,t,r,n){var a=mn(e,"paint","raster-opacity",r,Mn,n);t.setOpacity(a)}(e,t,n,r))}}function Nn(e,t,r,n){var a=[],i=null;t instanceof I.default&&((i=t.getView()).isDef()||i.getRotation()||i.getResolutions()||(i=new U.default(Object.assign(i.getProperties(),{maxResolution:Ur[0]})),t.setView(i)),"center"in e&&!i.getCenter()&&i.setCenter(w.fromLonLat(e.center)),"zoom"in e&&void 0===i.getZoom()&&i.setResolution(Ur[0]/Math.pow(2,e.zoom)),i.getCenter()&&void 0!==i.getZoom()||i.fit(i.getProjection().getExtent(),{nearest:!0,size:t.getSize()}));for(var o,s,u,l,p,f=e.layers,c=[],d=0,y=f.length;d0||f>0)&&e.setMaxResolution(Math.min(Ur[o],p.getResolution(f))+1e-9),s<24&&e.setMinResolution(Ur[s]+1e-9)}}a instanceof N.default||a instanceof R.default?qn(e,r,t,Object.assign({styleUrl:n},i)).then((function(){e.setVisible(!0),u()})).catch(l):u()}else l(new Error("Error accessing data for source "+e.get("mapbox-source")))};e.set("mapbox-layers",t);var f=a.getLayers();-1===f.getArray().indexOf(e)&&f.push(e),e.getSource()?p():e.once("change:source",p)}))}function Un(e,t){for(var r=[],n=e.getAllLayers(),a=0,i=n.length;a