!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/tileurlfunction.js"),require("ol/format/GeoJSON.js"),require("ol/layer/Image.js"),require("ol/layer/Layer.js"),require("ol/layer/Group.js"),require("ol/format/MVT.js"),require("ol/Map.js"),require("ol/source/Raster.js"),require("ol/source/Source.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/proj.js"),require("ol/loadingstrategy.js"),require("ol/tilegrid.js"),require("ol/extent.js"),require("ol/util.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/tileurlfunction.js","ol/format/GeoJSON.js","ol/layer/Image.js","ol/layer/Layer.js","ol/layer/Group.js","ol/format/MVT.js","ol/Map.js","ol/source/Raster.js","ol/source/Source.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/proj.js","ol/loadingstrategy.js","ol/tilegrid.js","ol/extent.js","ol/util.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.tileurlfunction,e.ol.format.GeoJSON,e.ol.layer.Image,e.ol.layer.Layer,e.ol.layer.Group,e.ol.format.MVT,e.ol.Map,e.ol.source.Raster,e.ol.source.Source,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.proj,e.ol.loadingstrategy,e.ol.tilegrid,e.ol.extent,e.ol.util)}(this,(function(e,t,r,n,a,i,o,s,u,l,p,f,c,d,y,m,h,v,g,b,x,w,z,k,M,S,j,q,T,_,E){"use strict";function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=C(t),I=C(r),F=C(n),P=C(a),D=C(i),O=C(o),L=C(s),R=C(p),N=C(f),U=C(c),V=C(d),G=C(y),J=C(m),W=C(h),Z=C(v),$=C(g),B=C(b),X=C(x),H=C(w),Y=C(z),K=C(k),Q=C(M),ee=C(S);function te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re,ne={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 ae(e){return(e=Math.round(e))<0?0:e>255?255:e}function ie(e){return e<0?0:e>1?1:e}function oe(e){return"%"===e[e.length-1]?ae(parseFloat(e)/100*255):ae(parseInt(e))}function se(e){return"%"===e[e.length-1]?ie(parseFloat(e)/100):ie(parseFloat(e))}function ue(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{re={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in ne)return ne[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=se(o.pop());case"rgb":return 3!==o.length?null:[oe(o[0]),oe(o[1]),oe(o[2]),s];case"hsla":if(4!==o.length)return null;s=se(o.pop());case"hsl":if(3!==o.length)return null;var u=(parseFloat(o[0])%360+360)%360/360,l=se(o[1]),p=se(o[2]),f=p<=.5?p*(l+1):p+l-p*l,c=2*p-f;return[ae(255*ue(c,f,u+1/3)),ae(255*ue(c,f,u)),ae(255*ue(c,f,u-1/3)),s];default:return null}}return null}}catch(e){}var le=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};le.parse=function(e){if(e){if(e instanceof le)return e;if("string"==typeof e){var t=re(e);if(t)return new le(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},le.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],a=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+a+")"},le.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,a=e.a;return 0===a?[0,0,0,0]:[255*t/a,255*r/a,255*n/a,a]},le.prototype.toArray01=function(){var e=this,t=e.r,r=e.g,n=e.b,a=e.a;return 0===a?[0,0,0,0]:[t/a,r/a,n/a,a]},le.prototype.toArray01PremultipliedAlpha=function(){var e=this;return[e.r,e.g,e.b,e.a]},le.black=new le(0,0,0,1),le.white=new le(1,1,1,1),le.transparent=new le(0,0,0,0),le.red=new le(1,0,0,1),le.blue=new le(0,0,1,1);var pe=le;function fe(e){return"object"==typeof e?["literal",e]:e}function ce(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,fe(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],be(e[1])]:[e[0],fe(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 ge(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function be(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 Pe=[ke,Me,Se,je,qe,Ce,Te,Ie(_e),Ae];function De(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!De(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=Pe;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 $e(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 pe)return!0;if(e instanceof Ne)return!0;if(e instanceof Ge)return!0;if(e instanceof We)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!=typeof s||!(s in et)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=et[s],n++}else i=_e;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=Ie(i,o)}else r=et[a];for(var u=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var rt=tt,nt=function(e){this.type=Ce,this.sections=e};nt.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,Me)))return null;var u=null;if(o["text-font"]&&!(u=t.parse(o["text-font"],1,Ie(Se))))return null;var l=null;if(o["text-color"]&&!(l=t.parse(o["text-color"],1,qe)))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,_e);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 nt(n)},nt.prototype.evaluate=function(e){return new Ge(this.sections.map((function(t){var r=t.content.evaluate(e);return Be(r)===Ae?new Ue("",r,null,null,null):new Ue(Xe(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},nt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},it.prototype.eachChild=function(e){e(this.input)},it.prototype.outputDefined=function(){return!1},it.prototype.serialize=function(){return["image",this.input.serialize()]};var ot=it,st={"to-boolean":je,"to-color":qe,"to-number":Me,"to-string":Se},ut=function(e,t){this.type=e,this.args=t};ut.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=st[r],a=[],i=1;i4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Ze(t[0],t[1],t[2],t[3])))return new pe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Qe(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 xt(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*vt),Math.round(a*i*vt)]}function wt(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 zt(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 St(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}gt(t,e)}function Ct(e,t,r,n){var a=Math.pow(2,n.z)*vt,i=[n.x*vt,n.y*vt],o=[];if(!e)return o;for(var s=0,u=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Ot(e,t)&&(r=!1)})),r}var Lt=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};Lt.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new Lt(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Lt.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},Lt.prototype.eachChild=function(){},Lt.prototype.outputDefined=function(){return!1},Lt.prototype.serialize=function(){return["var",this.name]};var Rt=Lt,Nt=function(e,t,r,n,a){void 0===t&&(t=[]),void 0===n&&(n=new ze),void 0===a&&(a=[]),this.registry=e,this.path=t,this.key=t.map((function(e){return"["+e+"]"})).join(""),this.scope=n,this.errors=a,this.expectedType=r};Nt.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)},Nt.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new rt(t,[e]):"coerce"===r?new lt(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 Ye)&&"resolvedImage"!==i.type.kind&&Vt(i)){var u=new ct;try{i=new Ye(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.")},Nt.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 Nt(this.registry,n,t||null,a,this.errors)},Nt.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 xe(n,e))},Nt.prototype.checkSubtype=function(e,t){var r=De(e,t);return r&&this.error(r),r};var Ut=Nt;function Vt(e){if(e instanceof Rt)return Vt(e.boundExpression);if(e instanceof yt&&"error"===e.name)return!1;if(e instanceof ht)return!1;if(e instanceof Ft)return!1;var t=e instanceof lt||e instanceof rt,r=!0;return e.eachChild((function(e){r=t?r&&Vt(e):r&&e instanceof Ye})),!!r&&(Pt(e)&&Ot(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Gt(e,t){for(var r,n,a=e.length-1,i=0,o=a,s=0;i<=o;)if(r=e[s=Math.floor((i+o)/2)],n=e[s+1],r<=t){if(s===a||tt))throw new Qe("Input is not a number.");o=s-1}return 0}var Jt=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 Jt(a,r,n)},Jt.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[Gt(t,n)].evaluate(e)},Jt.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 Wt=Jt,Zt=$t;function $t(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}$t.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},$t.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},$t.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},$t.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},$t.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var Bt=te(Zt);function Xt(e,t,r){return e*(1-r)+t*r}var Ht=Object.freeze({__proto__:null,number:Xt,color:function(e,t,r){return new pe(Xt(e.r,t.r,r),Xt(e.g,t.g,r),Xt(e.b,t.b,r),Xt(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return Xt(e,t[n],r)}))}}),Yt=.95047,Kt=1,Qt=1.08883,er=4/29,tr=6/29,rr=3*tr*tr,nr=tr*tr*tr,ar=Math.PI/180,ir=180/Math.PI;function or(e){return e>nr?Math.pow(e,1/3):e/rr+er}function sr(e){return e>tr?e*e*e:rr*(e-er)}function ur(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function lr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function pr(e){var t=lr(e.r),r=lr(e.g),n=lr(e.b),a=or((.4124564*t+.3575761*r+.1804375*n)/Yt),i=or((.2126729*t+.7151522*r+.072175*n)/Kt);return{l:116*i-16,a:500*(a-i),b:200*(i-or((.0193339*t+.119192*r+.9503041*n)/Qt)),alpha:e.a}}function fr(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=Kt*sr(t),r=Yt*sr(r),n=Qt*sr(n),new pe(ur(3.2404542*r-1.5371385*t-.4985314*n),ur(-.969266*r+1.8760108*t+.041556*n),ur(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function cr(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var dr={forward:pr,reverse:fr,interpolate:function(e,t,r){return{l:Xt(e.l,t.l,r),a:Xt(e.a,t.a,r),b:Xt(e.b,t.b,r),alpha:Xt(e.alpha,t.alpha,r)}}},yr={forward:function(e){var t=pr(e),r=t.l,n=t.a,a=t.b,i=Math.atan2(a,n)*ir;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*ar,r=e.c;return fr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:cr(e.h,t.h,r),c:Xt(e.c,t.c,r),l:Xt(e.l,t.l,r),alpha:Xt(e.alpha,t.alpha,r)}}},mr=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,Me)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=qe: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 mr(l,r,n,a,u):t.error("Type "+Fe(l)+" is not interpolatable.")},mr.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=Gt(t,n),o=t[i],s=t[i+1],u=mr.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?yr.reverse(yr.interpolate(yr.forward(l),yr.forward(p),u)):dr.reverse(dr.interpolate(dr.forward(l),dr.forward(p),u))},mr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new Qe("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Qe("Array index must be an integer, but found "+t+" instead.");return r[t]},zr.prototype.eachChild=function(e){e(this.index),e(this.input)},zr.prototype.outputDefined=function(){return!1},zr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var kr=zr,Mr=function(e,t){this.type=je,this.needle=e,this.haystack=t};Mr.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,_e),n=t.parse(e[2],2,_e);return r&&n?Oe(r.type,[je,Se,Me,ke,_e])?new Mr(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Fe(r.type)+" instead"):null},Mr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!Le(t,["boolean","string","number","null"]))throw new Qe("Expected first argument to be of type boolean, string, number or null, but found "+Fe(Be(t))+" instead.");if(!Le(r,["string","array"]))throw new Qe("Expected second argument to be of type array or string, but found "+Fe(Be(r))+" instead.");return r.indexOf(t)>=0},Mr.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Mr.prototype.outputDefined=function(){return!0},Mr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Sr=Mr,jr=function(e,t,r){this.type=Me,this.needle=e,this.haystack=t,this.fromIndex=r};jr.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,_e),n=t.parse(e[2],2,_e);if(!r||!n)return null;if(!Oe(r.type,[je,Se,Me,ke,_e]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Fe(r.type)+" instead");if(4===e.length){var a=t.parse(e[3],3,Me);return a?new jr(r,n,a):null}return new jr(r,n)},jr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Le(t,["boolean","string","number","null"]))throw new Qe("Expected first argument to be of type boolean, string, number or null, but found "+Fe(Be(t))+" instead.");if(!Le(r,["string","array"]))throw new Qe("Expected second argument to be of type array or string, but found "+Fe(Be(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},jr.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},jr.prototype.outputDefined=function(){return!1},jr.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 qr=jr,Tr=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};Tr.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,Be(c)))return null}else r=Be(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,_e);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 Tr(r,n,y,a,i,m):null},Tr.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Be(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Tr.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Tr.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},Tr.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,_e),n=t.parse(e[2],2,Me);if(!r||!n)return null;if(!Oe(r.type,[Ie(_e),Se,_e]))return t.error("Expected first argument to be of type array or string, but found "+Fe(r.type)+" instead");if(4===e.length){var a=t.parse(e[3],3,Me);return a?new Ar(r.type,r,n,a):null}return new Ar(r.type,r,n)},Ar.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Le(t,["string","array"]))throw new Qe("Expected first argument to be of type array or string, but found "+Fe(Be(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Ar.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Ar.prototype.outputDefined=function(){return!1},Ar.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 Ir=Ar;function Fr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Pr(e,t,r,n){return 0===n.compare(t,r)}function Dr(e,t,r){var n="=="!==e&&"!="!==e;return function(){function a(e,t,r){this.type=je,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return a.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],i=t.parse(e[1],1,_e);if(!i)return null;if(!Fr(r,i.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Fe(i.type)+"'.");var o=t.parse(e[2],2,_e);if(!o)return null;if(!Fr(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Fe(o.type)+"'.");if(i.type.kind!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+Fe(i.type)+"' and '"+Fe(o.type)+"'.");n&&("value"===i.type.kind&&"value"!==o.type.kind?i=new rt(o.type,[i]):"value"!==i.type.kind&&"value"===o.type.kind&&(o=new rt(i.type,[o])));var s=null;if(4===e.length){if("string"!==i.type.kind&&"string"!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Ee)))return null}return new a(i,o,s)},a.prototype.evaluate=function(a){var i=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){var s=Be(i),u=Be(o);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new Qe('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=Be(i),p=Be(o);if("string"!==l.kind||"string"!==p.kind)return t(a,i,o)}return this.collator?r(a,i,o,this.collator.evaluate(a)):t(a,i,o)},a.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},a.prototype.outputDefined=function(){return!0},a.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},a}()}var Or=Dr("==",(function(e,t,r){return t===r}),Pr),Lr=Dr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Pr(0,t,r,n)})),Rr=Dr("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Ur=Dr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Vr=Dr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),Gr=function(e,t,r,n,a,i){this.type=Se,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=i};Gr.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Me);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,Se)))return null;var i=null;if(n.currency&&!(i=t.parse(n.currency,1,Se)))return null;var o=null;if(n.unit&&!(o=t.parse(n.unit,1,Se)))return null;var s=null;if(n["min-fraction-digits"]&&!(s=t.parse(n["min-fraction-digits"],1,Me)))return null;var u=null;return n["max-fraction-digits"]&&!(u=t.parse(n["max-fraction-digits"],1,Me))?null:new Gr(r,a,i,o,s,u)},Gr.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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))},Gr.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Gr.prototype.outputDefined=function(){return!1},Gr.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.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 Jr=Gr,Wr=function(e){this.type=Me,this.input=e};Wr.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 "+Fe(r.type)+" instead."):new Wr(r):null},Wr.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 Qe("Expected value to be of type string or array, but found "+Fe(Be(t))+" instead.")},Wr.prototype.eachChild=function(e){e(this.input)},Wr.prototype.outputDefined=function(){return!1},Wr.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Zr={"==":Or,"!=":Lr,">":Nr,"<":Rr,">=":Vr,"<=":Ur,array:rt,at:kr,boolean:rt,case:Cr,coalesce:br,collator:ht,format:at,image:ot,in:Sr,"index-of":qr,interpolate:vr,"interpolate-hcl":vr,"interpolate-lab":vr,length:Wr,let:wr,literal:Ye,match:_r,number:rt,"number-format":Jr,object:rt,slice:Ir,step:Wt,string:rt,"to-boolean":lt,"to-color":lt,"to-number":lt,"to-string":lt,var:Rt,within:Ft};function $r(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=Ze(r,n,a,o);if(s)throw new Qe(s);return new pe(r/255*o,n/255*o,a/255*o,o)}function Br(e,t){return e in t}function Xr(e,t){var r=t[e];return void 0===r?null:r}function Hr(e){return{type:e}}yt.register(Zr,{error:[{kind:"error"},[Se],function(e,t){var r=t[0];throw new Qe(r.evaluate(e))}],typeof:[Se,[_e],function(e,t){return Fe(Be(t[0].evaluate(e)))}],"to-rgba":[Ie(Me,4),[qe],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[qe,[Me,Me,Me],$r],rgba:[qe,[Me,Me,Me,Me],$r],has:{type:je,overloads:[[[Se],function(e,t){return Br(t[0].evaluate(e),e.properties())}],[[Se,Te],function(e,t){var r=t[0],n=t[1];return Br(r.evaluate(e),n.evaluate(e))}]]},get:{type:_e,overloads:[[[Se],function(e,t){return Xr(t[0].evaluate(e),e.properties())}],[[Se,Te],function(e,t){var r=t[0],n=t[1];return Xr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[_e,[Se],function(e,t){return Xr(t[0].evaluate(e),e.featureState||{})}],properties:[Te,[],function(e){return e.properties()}],"geometry-type":[Se,[],function(e){return e.geometryType()}],id:[_e,[],function(e){return e.id()}],zoom:[Me,[],function(e){return e.globals.zoom}],pitch:[Me,[],function(e){return e.globals.pitch||0}],"distance-from-center":[Me,[],function(e){return e.distanceFromCenter()}],"heatmap-density":[Me,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Me,[],function(e){return e.globals.lineProgress||0}],"sky-radial-progress":[Me,[],function(e){return e.globals.skyRadialProgress||0}],accumulated:[_e,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[Me,Hr(Me),function(e,t){for(var r=0,n=0,a=t;n":[je,[Se,_e],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->":[je,[_e],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[je,[Se,_e],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-<=":[je,[_e],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[je,[Se,_e],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->=":[je,[_e],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[je,[_e],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[je,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[je,[Ie(Se)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[je,[Ie(_e)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[je,[Se,Ie(_e)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[je,[Se,Ie(_e)],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:je,overloads:[[[je,je],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Hr(je),function(e,t){for(var r=0,n=t;r-1}(t))return Qr([new xe("","zoom expressions not supported")]);var i=sn(r);if(!i&&!a)return Qr([new xe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(i instanceof xe)return Qr([i]);if(i instanceof vr&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return Qr([new xe("",'"interpolate" expressions cannot be used with this property')]);if(!i)return Kr(new nn(n?"constant":"source",e.value));var o=i instanceof vr?i.interpolation:void 0;return Kr(new an(n?"camera":"composite",e.value,i.labels,o))}function sn(e){var t=null;if(e instanceof wr)t=sn(e.result);else if(e instanceof br)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:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"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:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"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"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["fill-extrusion-edge-radius"]}},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:!1,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"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:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function pn(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 hn(e,t){return et?1:0}function vn(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===r||"<="===r||">="===r?bn(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(gn))):"all"===r?["all"].concat(e.slice(1).map(gn)):"none"===r?["all"].concat(e.slice(1).map(gn).map(zn)):"in"===r?xn(e[1],e.slice(2)):"!in"===r?zn(xn(e[1],e.slice(2))):"has"===r?wn(e[1]):"!has"===r?zn(wn(e[1])):"within"!==r||e}function bn(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 xn(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(hn)]]:["filter-in-small",e,["literal",t]]}}function wn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function zn(e){return["!",e]}var kn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Mn(e,t){var r={};for(var n in e)"ref"!==n&&(r[n]=e[n]);return kn.forEach((function(e){e in t&&(r[e]=t[e])})),r}function Sn(e){e=e.slice();for(var t=Object.create(null),r=0;r1?l[l.length-2].toLowerCase():"";if(p==f||p==f.replace("-","")||c+"-"+p==f){a=jn[f],l.pop(),c&&f.startsWith(c)&&l.pop();break}}"number"==typeof p&&(a=p);var d=l.join(qn).replace("Klokantech Noto Sans","Noto Sans");-1!==d.indexOf(qn)&&(d='"'+d+'"'),o.push(d)}n=_n[e]=[i,a,o]}return n[0]+qn+n[1]+qn+t+"px"+(r?"/"+r:"")+qn+n[2]}));function Cn(e,t){var r,n,a,i,o,s,u,l,p,f,c,d,y,m,h,v,g,b,x,w,z=e[0],k=z.width,M=z.height,S=z.data,j=new Uint8ClampedArray(S.length),q=2*t.resolution,T=k-1,_=M-1,E=[0,0,0,0],C=2*Math.PI,A=Math.PI/2,I=Math.PI*t.sunEl/180,F=Math.PI*t.sunAz/180,P=Math.cos(I),D=Math.sin(I),O=t.highlightColor,L=t.shadowColor,R=t.accentColor,N=t.encoding;function U(e,t){return void 0===t&&(t="mapbox"),"mapbox"===t?.1*(256*e[0]*256+256*e[1]+e[2])-1e4:"terrarium"===t?256*e[0]+e[1]+e[2]/256-32768:void 0}for(n=0;n<=_;++n)for(i=0===n?0:n-1,o=n===_?_:n+1,r=0;r<=T;++r)a=r===T?T:r+1,s=4*(n*k+(0===r?0:r-1)),E[0]=S[s],E[1]=S[s+1],E[2]=S[s+2],E[3]=S[s+3],u=t.vert*U(E,N),s=4*(n*k+a),E[0]=S[s],E[1]=S[s+1],E[2]=S[s+2],E[3]=S[s+3],l=(t.vert*U(E,N)-u)/q,s=4*(i*k+r),E[0]=S[s],E[1]=S[s+1],E[2]=S[s+2],E[3]=S[s+3],u=t.vert*U(E,N),s=4*(o*k+r),E[0]=S[s],E[1]=S[s+1],E[2]=S[s+2],E[3]=S[s+3],p=(t.vert*U(E,N)-u)/q,c=(c=Math.atan2(p,-l))<0?A-c:c>A?C-c+A:A-c,f=Math.atan(Math.sqrt(l*l+p*p)),w=D*Math.cos(f)+P*Math.sin(f)*Math.cos(F-c),d=Math.cos(f),y=255*w,g=Math.min(Math.max(2*t.sunEl,0),1),b=1.875-1.75*t.opacity,x=.5!==t.opacity?A*((Math.pow(b,f)-1)/(Math.pow(b,A)-1)):f,h={r:(1-d)*R.r*g*255,g:(1-d)*R.g*g*255,b:(1-d)*R.b*g*255,a:(1-d)*R.a*g*255},m=Math.abs(((c+F)/Math.PI+.5)%2-1),v={r:(O.r*(1-m)+L.r*m)*y,g:(O.g*(1-m)+L.g*m)*y,b:(O.b*(1-m)+L.b*m)*y,a:(O.a*(1-m)+L.a*m)*y},j[s=4*(n*k+r)]=h.r*(1-m)+v.r,j[s+1]=h.g*(1-m)+v.g,j[s+2]=h.b*(1-m)+v.b,j[s+3]=S[s+3]*t.opacity*g*Math.sin(x);return new ImageData(j,k,M)}var An="https://api.mapbox.com";function In(e){var t="mapbox://";return 0!==e.indexOf(t)?"":e.slice(t.length)}function Fn(e,t){var r=In(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 An+"/styles/v1/"+a+"?&access_token="+t}function Pn(e,t,r,n){var a=new URL(e,n),i=In(e);return i?"mapbox.satellite"===i?"https://api.mapbox.com/v4/"+i+"/{z}/{x}/{y}"+(window.devicePixelRatio>=1.5?"@2x":"")+".webp?access_token="+t:"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 Dn(e,t){return void 0===t&&(t=512),e.getExtent()?T.createXYZ({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():sa}function On(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 Ln(e,t,r,n,a){var i,o,s,u;void 0===r&&(r=""),void 0===n&&(n={}),void 0===a&&(a=void 0);var l=!0;return"string"==typeof r||Array.isArray(r)?u=r:(u=(s=r).source||s.layers,n=s),"string"==typeof n?(i=n,s={}):(i=n.styleUrl,s=n),!1===s.updateSource&&(l=!1),a||(a=s.resolutions),i||"string"!=typeof t||t.trim().startsWith("{")||(i=t),i&&(i=i.startsWith("data:")?location.href:Fn(i,s.accessToken),s=On(i,s)),new Promise((function(r,n){ca(t,s).then((function(t){if(8!=t.version)return n(new Error("glStyle version 8 required."));if(!(e instanceof H.default||e instanceof K.default))return n(new Error("Can only apply to VectorLayer or VectorTileLayer"));var p,f,c,d=e instanceof K.default?"vector":"geojson";if(u?o=Array.isArray(u)?t.layers.find((function(e){return e.id===u[0]})).source:u:(o=Object.keys(t.sources).find((function(e){return t.sources[e].type===d})),u=o),!o)return n(new Error("No "+d+" source found in the glStyle."));function y(){if(!l)return Promise.resolve();if(e instanceof K.default)return Jn(t.sources[o],i,s).then((function(t){var r=e.getSource();if(r?t!==r&&(r.setTileUrlFunction(t.getTileUrlFunction()),"function"==typeof r.setUrls&&"function"==typeof t.getUrls&&r.setUrls(t.getUrls()),r.format_||(r.format_=t.format_),r.getAttributions()||r.setAttributions(t.getAttributions()),r.getTileLoadFunction()===M.defaultLoadFunction&&r.setTileLoadFunction(t.getTileLoadFunction()),j.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=$n(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 m(){if(c||t.sprite&&!p)c?(e.setStyle(c),y().then(r).catch(n)):n(new Error("Something went wrong trying to apply style."));else{if(s.projection&&!a){var i=j.get(s.projection).getUnits();"m"!==i&&(a=sa.map((function(e){return e/j.METERS_PER_UNIT[i]})))}c=Ha(e,t,u,a,p,f,Ia,s.getImage),e.getStyle()?y().then(r).catch(n):n(new Error("Nothing to show for source ["+o+"]"))}}if(t.sprite){var h=new URL(function(e,t,r){var n=In(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 An+"/styles/v1/"+i+"/sprite?access_token="+t}(t.sprite,s.accessToken,i||location.href)),v=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",g=h.origin+h.pathname+v+".json"+h.search;new Promise((function(e,t){fa("Sprite",g,s).then(e).catch((function(r){fa("Sprite",g=h.origin+h.pathname+".json"+h.search,s).then(e).catch(t)}))})).then((function(e){if(void 0===e&&n(new Error("No sprites found.")),p=e,f=h.origin+h.pathname+v+".png"+h.search,s.transformRequest){var t=s.transformRequest(f,"SpriteImage");t instanceof Request&&(f=encodeURI(t.url))}m()})).catch((function(e){n(new Error("Sprites cannot be loaded: "+g+": "+e.message))}))}else m()})).catch(n)}))}var Rn={};function Nn(e,t){var r;return e.some((function(e){if(e.id==t)return r=e.source,!0})),r}function Un(e,t,r){var n=new B.default({tileJSON:t,tileSize:e.tileSize||t.tileSize||512}),a=n.getTileJSON(),i=n.getTileGrid(),o=j.get(r.projection||"EPSG:3857"),s=function(e,t){var r=e.bounds;if(r){var n=j.fromLonLat([r[0],r[1]],t),a=j.fromLonLat([r[2],r[3]],t);return[n[0],n[1],a[0],a[1]]}return j.get(t).getExtent()}(a,o),u=o.getExtent(),l=a.minzoom||0,p=a.maxzoom||22,f={attributions:n.getAttributions(),projection:o,tileGrid:new $.default({origin:u?_.getTopLeft(u):i.getOrigin(0),extent:s||i.getExtent(),minZoom:l,resolutions:Dn(o,t.tileSize).slice(0,p+1),tileSize:i.getTileSize(0)})};return Array.isArray(a.tiles)?f.urls=a.tiles:f.url=a.tiles,f}function Vn(e,t,r,n){var a={id:e.id,type:e.type},i=e.layout||{},o=e.paint||{};a.paint=o;var s,u,l=la(t,r.resolutions||sa);return void 0!==o["background-color"]&&(s=Ua(a,"paint","background-color",l,Rn,n)),void 0!==o["background-opacity"]&&(u=Ua(a,"paint","background-opacity",l,Rn,n)),"none"==i.visibility?void 0:Wa(s,u)}function Gn(e,t,r){var n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new U.default({source:new Z.default({}),render:function(a){var i=Vn(e,a.viewState.resolution,t,r);return n.style.backgroundColor=i,n}})}function Jn(e,t,r){return new Promise((function(n,a){ma(e,t,r).then((function(t){var a=Un(e,t,r);a.format=new G.default,n(new Q.default(a))})).catch(a)}))}function Wn(e){return"{bbox-"+(e?e.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")+"}"}function Zn(e,t,r){var n=new X.default;return ma(e,t,r).then((function(t){var a=new B.default({interpolate:void 0===r.interpolate||r.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:t});a.tileGrid=Un(e,t,r).tileGrid,r.projection&&(a.projection=j.get(r.projection));var i=a.getTileUrlFunction();a.setTileUrlFunction((function(e,t,r){var n=Wn(r),o=i(e,t,r);if(-1!=o.indexOf(n)){var s=a.getTileGrid().getTileCoordExtent(e);o=o.replace(n,s.toString())}return o})),a.set("mapbox-source",e),n.setSource(a)})).catch((function(e){n.setSource(void 0)})),n}function $n(e,t,r){var n=r.projection?new R.default({dataProjection:r.projection}):new R.default,a=e.data,i={};if("string"==typeof a){var o=Pn(a,r.accessToken,r.accessTokenParam||"access_token",t||location.href);if(r.transformRequest){var s=r.transformRequest(o,"GeoJSON");s instanceof Request&&(o=decodeURI(s.url))}if(/\{bbox-[0-9a-z-]+\}/.test(o)){var u=new Y.default({attributions:e.attribution,format:n,url:function(e,t,r){var n=Wn(r);return o.replace(n,""+e.join(","))},strategy:q.bbox});return u.set("mapbox-source",e),u}return new Y.default({attributions:e.attribution,format:n,url:o})}i.features=n.readFeatures(a,{featureProjection:j.getUserProjection()||"EPSG:3857"});var l=new Y.default(Object.assign({attributions:e.attribution,format:n},i));return l.set("mapbox-source",e),l}function Bn(e,t,r){var n=null;return function(a){e.paint&&"raster-opacity"in e.paint&&a.frameState.viewState.zoom!==n&&(n=a.frameState.viewState.zoom,delete r[e.id],function(e,t,r,n){var a=Ua(e,"paint","raster-opacity",r,Rn,n);t.setOpacity(a)}(e,t,n,r))}}function Xn(e,t,r,n){var a,i=aa(e),o=e.layers,s=r.type,u=r.source||Nn(o,r.ref),l=e.sources[u];if("background"==s)a=Gn(r,n,i);else if("vector"==l.type)a=function(e,t,r){var n=new K.default({declutter:!0,visible:!1});return Jn(e,t,r).then((function(t){t.set("mapbox-source",e),n.setSource(t)})).catch((function(e){n.setSource(void 0)})),n}(l,t,n);else if("raster"==l.type)(a=Zn(l,t,n)).setVisible(!r.layout||"none"!==r.layout.visibility),a.on("prerender",Bn(r,a,i));else if("geojson"==l.type)a=function(e,t,r){return new H.default({declutter:!0,source:$n(e,t,r),visible:!1})}(l,t,n);else if("raster-dem"==l.type&&"hillshade"==r.type){var p=function(e,t,r){var n=Zn(e,t,r);return new N.default({source:new W.default({operationType:"image",operation:Cn,sources:[n]})})}(l,t,n);a=p,p.getSource().on("beforeoperations",(function(e){var t=e.data;t.resolution=e.resolution;var a=la(e.resolution,n.resolutions||sa);t.encoding=l.encoding,t.vert=5*Ua(r,"paint","hillshade-exaggeration",a,Rn,i),t.sunAz=Ua(r,"paint","hillshade-illumination-direction",a,Rn,i),t.sunEl=35,t.opacity=.3,t.highlightColor=Ua(r,"paint","hillshade-highlight-color",a,Rn,i),t.shadowColor=Ua(r,"paint","hillshade-shadow-color",a,Rn,i),t.accentColor=Ua(r,"paint","hillshade-accent-color",a,Rn,i)})),a.setVisible(!r.layout||"none"!==r.layout.visibility)}var f=u;return a&&a.set("mapbox-source",f),a}function Hn(e,t,r,n){var a=[],i=null;if(t instanceof J.default){if(!(i=t.getView()).isDef()&&!i.getRotation()&&!i.getResolutions()){var o=n.projection?j.get(n.projection):i.getProjection();i=new ee.default(Object.assign(i.getProperties(),{maxResolution:sa[0]/j.METERS_PER_UNIT[o.getUnits()],projection:n.projection||i.getProjection()})),t.setView(i)}"center"in e&&!i.getCenter()&&i.setCenter(j.fromLonLat(e.center,i.getProjection())),"zoom"in e&&void 0===i.getZoom()&&i.setResolution(sa[0]/j.METERS_PER_UNIT[i.getProjection().getUnits()]/Math.pow(2,e.zoom)),i.getCenter()&&void 0!==i.getZoom()||i.fit(i.getProjection().getExtent(),{nearest:!0,size:t.getSize()})}t.set("mapbox-style",e),t.set("mapbox-metadata",{styleUrl:r,options:n});for(var s,u,l,p=e.layers,f=[],c=0,d=p.length;c0||c>0)&&e.setMaxResolution(Math.min(sa[o],f.getResolution(c))+1e-9),s<24&&e.setMinResolution(sa[s]+1e-9)}}else o>0&&e.setMaxResolution(sa[o]+1e-9);p instanceof Y.default||p instanceof Q.default?Ln(e,r,t,Object.assign({styleUrl:n},i)).then((function(){!function(e,t){function r(){var r=t.get("mapbox-style");if(r){var n=Sn(r.layers),a=e.get("mapbox-layers"),i=n.filter((function(e){return a.includes(e.id)})).some((function(e){return!e.layout||!e.layout.visibility||"visible"===e.layout.visibility}));e.get("visible")!==i&&e.setVisible(i)}}e.on("change",r),r()}(e,a),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)}))}var Qn={},ea={},ta=0;function ra(e){return e.id||(e.id=ta++),e.id}function na(e,t){return ra(e)+"."+E.getUid(t)}function aa(e){var t=Qn[e.id];return t||(t={},Qn[ra(e)]=t),t}function ia(e){var t=ea[e.id];return t||(t={},ea[ra(e)]=t),t}function oa(e){return e*Math.PI/180}var sa=function(){for(var e=[],t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function ua(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 la(e,t){for(var r=0,n=t.length;r0&&o.arc(l,f,r*t.pixelRatio,0,2*Math.PI)}return o.fill(),a}function va(e,t,r){var n=document.createElement("canvas");n.width=t.width,n.height=t.height;var a=n.getContext("2d");a.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);for(var i,o,s,u,l=a.getImageData(0,0,t.width,t.height),p=l.data,f=0,c=l.width;f0?(p[m+0]=Math.round(255*r.r*v),p[m+1]=Math.round(255*r.g*v),p[m+2]=Math.round(255*r.b*v),p[m+3]=Math.round(255*v)):p[m+3]=0}return a.putImageData(l,0,0),n}function ga(e,t){for(var r=e.getLayers().getArray(),n=0,a=r.length;n=.05){for(var r="",n=e.split("\n"),a=za.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 Ma(){return wa||(wa=ua(1,1).getContext("2d")),wa}function Sa(e,t){return Ma().measureText(e).width+(e.length-1)*t}var ja={};function qa(e,t,r,n){if(-1!==e.indexOf("\n")){for(var a=e.split("\n"),i=[],o=0,s=a.length;o1){var f=Ma();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(Sa(w,n)<.35*c){var z=b>0?Sa(y[b-1],n):1/0,k=b.7*c&&Sa(q,n)<.6*c){var T=j.split(" "),_=T.pop();Sa(_,n)<.2*c&&(y[M]=T.join(" "),y[M+1]=_+" "+q),S-=1}}l=y.join("\n")}else l=e;l=ka(l,n),ja[u]=l}return l}var Ta,_a=/font-family: ?([^;]*);/,Ea=/("|')/g;function Ca(e){if(!Ta){Ta={};for(var t=document.styleSheets,r=0,n=t.length;r0&&"string"==typeof u[0]&&u[0]in Yr);if(!c&&en(p)&&(p=ce(p,f),c=!0),c){var d=La(p,f);l[r]=d.evaluate.bind(d)}else"color"==f.type&&(p=pe.parse(p)),l[r]=function(){return p}}return Na.zoom=n,l[r](Na,a,o)}function Va(e,t,r,n){return Ua(e,"layout","icon-allow-overlap",t,r,n)?Ua(e,"layout","icon-ignore-placement",t,r,n)?"none":"obstacle":"declutter"}function Ga(e,t,r,n,a){return a||console.warn("No filterCache provided to evaluateFilter()"),e in a||(a[e]=fn(t).filter),Na.zoom=n,a[e](Na,r)}var Ja=!1;function Wa(e,t){if(e){if(!Ja&&(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 Za=/\{[^{}}]*\}/g;function $a(e,t){return e.replace(Za,(function(e){return t[e.slice(1,-1)]||""}))}var Ba=!1;var Xa={};function Ha(e,t,r,n,a,i,o,s){if(void 0===n&&(n=sa),void 0===a&&(a=void 0),void 0===i&&(i=void 0),void 0===o&&(o=void 0),void 0===s&&(s=void 0),"string"==typeof t&&(t=JSON.parse(t)),8!=t.version)throw new Error("glStyle version 8 required.");var u,l,p;if(Xa[na(t,e)]=Array.from(arguments),i)if("undefined"!=typeof Image){var f=new Image;f.crossOrigin="anonymous",f.onload=function(){u=f,l=[f.width,f.height],e.changed(),f.onload=null},f.src=i}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var c=self;c.postMessage({action:"loadImage",src:i}),c.addEventListener("message",(function(e){"imageLoaded"===e.data.action&&e.data.src===i&&(u=e.data.image,l=[u.width,u.height])}))}for(var d,y=Sn(t.layers),m={},h=[],v={},g={},b=aa(t),x=ia(t),w=0,z=y.length;w=T.maxzoom)){var V=T.filter;if(!V||Ga(R,V,z,y,x)){h=T;var G=void 0,J=void 0,W=void 0,Z=void 0,$=void 0,B=void 0,X=q.index;if(3==w&&("fill"==T.type||"fill-extrusion"==T.type))if(J=Ua(T,"paint",T.type+"-opacity",y,z,b,k),T.type+"-pattern"in U){var H=Ua(T,"paint",T.type+"-pattern",y,z,b,k);if(H){var Y="string"==typeof H?$a(H,c):H.toString();if(u&&a&&a[Y]){++M,(B=C[M])&&B.getFill()&&!B.getStroke()&&!B.getText()||(B=new O.default({fill:new I.default}),C[M]=B),W=B.getFill(),B.setZIndex(X);var K=Y+"."+J,Q=g[K];if(!Q){var ee=a[Y],te=ua(ee.width,ee.height),re=te.getContext("2d");re.globalAlpha=J,re.drawImage(u,ee.x,ee.y,ee.width,ee.height,0,0,ee.width,ee.height),Q=re.createPattern(te,"repeat"),g[K]=Q}W.setColor(Q)}}}else G=Wa(Ua(T,"paint",T.type+"-color",y,z,b,k),J),T.type+"-outline-color"in U&&($=Wa(Ua(T,"paint",T.type+"-outline-color",y,z,b,k),J)),$||($=G),(G||$)&&(++M,(!(B=C[M])||G&&!B.getFill()||!G&&B.getFill()||$&&!B.getStroke()||!$&&B.getStroke()||B.getText())&&(B=new O.default({fill:G?new I.default:void 0,stroke:$?new D.default:void 0}),C[M]=B),G&&(W=B.getFill()).setColor(G),$&&((Z=B.getStroke()).setColor($),Z.setWidth(.5)),B.setZIndex(X));if(1!=w&&"line"==T.type){G=!("line-pattern"in U)&&"line-color"in U?Wa(Ua(T,"paint","line-color",y,z,b,k),Ua(T,"paint","line-opacity",y,z,b,k)):void 0;var ne=Ua(T,"paint","line-width",y,z,b,k);G&&ne>0&&(++M,(B=C[M])&&B.getStroke()&&!B.getFill()&&!B.getText()||(B=new O.default({stroke:new D.default}),C[M]=B),(Z=B.getStroke()).setLineCap(Ua(T,"layout","line-cap",y,z,b,k)),Z.setLineJoin(Ua(T,"layout","line-join",y,z,b,k)),Z.setMiterLimit(Ua(T,"layout","line-miter-limit",y,z,b,k)),Z.setColor(G),Z.setWidth(ne),Z.setLineDash(U["line-dasharray"]?Ua(T,"paint","line-dasharray",y,z,b,k).map((function(e){return e*ne})):null),B.setZIndex(X))}var ae=!1,ie=null,oe=0,se=void 0,ue=void 0,le=void 0;if((1==w||2==w)&&"icon-image"in N){var pe=Ua(T,"layout","icon-image",y,z,b,k);if(pe){se="string"==typeof pe?$a(pe,c):pe.toString();var fe=void 0,ce=s?s(e,se):void 0;if(u&&a&&a[se]||ce){var de=Ua(T,"layout","icon-rotation-alignment",y,z,b,k);if(2==w){var ye=r.getGeometry();if(ye.getFlatMidpoint||ye.getFlatMidpoints){var me=ye.getExtent();if(Math.sqrt(Math.max(Math.pow((me[2]-me[0])/i,2),Math.pow((me[3]-me[1])/i,2)))>150){var he="MultiLineString"===ye.getType()?ye.getFlatMidpoints():ye.getFlatMidpoint();if(Pa||(Fa=[NaN,NaN],Pa=new P.default("Point",Fa,[],{},null)),fe=Pa,Fa[0]=he[0],Fa[1]=he[1],"line"===Ua(T,"layout","symbol-placement",y,z,b,k)&&"map"===de)for(var ve=ye.getStride(),ge=ye.getFlatCoordinates(),be=0,xe=ge.length-ve;be=Se&&he[0]<=qe&&he[1]>=je&&he[1]<=Te){oe=Math.atan2(ze-Me,ke-we);break}}}}}if(2!==w||fe){var _e=Ua(T,"layout","icon-size",y,z,b,k),Ee=void 0!==U["icon-color"]?Ua(T,"paint","icon-color",y,z,b,k):null;if(!Ee||0!==Ee.a){var Ce=Ua(T,"paint","icon-halo-color",y,z,b,k),Ae=Ua(T,"paint","icon-halo-width",y,z,b,k),Ie=se+"."+_e+"."+Ae+"."+Ce;if(null!==Ee&&(Ie+="."+Ee),!(ue=v[Ie])){var Fe=Va(T,y,z,b),Pe=void 0;"icon-offset"in N&&((Pe=Ua(T,"layout","icon-offset",y,z,b,k).slice(0))[1]*=-1);var De=Ee?[255*Ee.r,255*Ee.g,255*Ee.b,Ee.a]:void 0;if(ce){var Oe={color:De,rotateWithView:"map"===de,displacement:Pe,declutterMode:Fe};"string"==typeof ce?Oe.src=ce:(Oe.img=ce,Oe.imgSize=[ce.width,ce.height]),ue=new F.default(Oe)}else{var Le=a[se],Re=void 0,Ne=void 0,Ue=void 0,Ve=void 0;Ae?(Le.sdf?(Re=ha(va(u,Le,Ee),{x:0,y:0,width:Le.width,height:Le.height,pixelRatio:Le.pixelRatio},Ae,Ce),De=void 0):Re=ha(u,Le,Ae,Ce),Ne=[Re.width,Re.height]):(Le.sdf?(p||(p=va(u,{x:0,y:0,width:l[0],height:l[1]},{r:1,g:1,b:1,a:1})),Re=p):Re=u,Ne=l,Ue=[Le.width,Le.height],Ve=[Le.x,Le.y]),ue=new F.default({color:De,img:Re,imgSize:Ne,size:Ue,offset:Ve,rotateWithView:"map"===de,scale:_e/Le.pixelRatio,displacement:Pe,declutterMode:Fe})}v[Ie]=ue}}ue&&(++M,(B=C[M])&&B.getImage()&&!B.getFill()&&!B.getStroke()||(B=new O.default,C[M]=B),B.setGeometry(fe),ue.setRotation(oe+oa(Ua(T,"layout","icon-rotate",y,z,b,k))),ue.setOpacity(Ua(T,"paint","icon-opacity",y,z,b,k)),ue.setAnchor(Oa[Ua(T,"layout","icon-anchor",y,z,b,k)]),B.setImage(ue),ie=B.getText(),B.setText(void 0),B.setZIndex(X),ae=!0,le=!1)}else le=!0}}}if(1==w&&"circle"===T.type){++M,(B=C[M])&&B.getImage()&&!B.getFill()&&!B.getStroke()||(B=new O.default,C[M]=B);var Ge="circle-radius"in U?Ua(T,"paint","circle-radius",y,z,b,k):5,Je=Wa(Ua(T,"paint","circle-stroke-color",y,z,b,k),Ua(T,"paint","circle-stroke-opacity",y,z,b,k)),We=Wa(Ua(T,"paint","circle-color",y,z,b,k),Ua(T,"paint","circle-opacity",y,z,b,k)),Ze=Ua(T,"paint","circle-stroke-width",y,z,b,k),$e=Ge+"."+Je+"."+We+"."+Ze;(ue=v[$e])||(ue=new A.default({radius:Ge,stroke:Je&&Ze>0?new D.default({width:Ze,color:Je}):void 0,fill:We?new I.default({color:We}):void 0,declutterMode:"none"}),v[$e]=ue),B.setImage(ue),ie=B.getText(),B.setText(void 0),B.setGeometry(void 0),B.setZIndex(X),ae=!0}var Be=void 0,Xe=void 0,He=void 0,Ye=void 0,Ke=void 0,Qe=void 0;if("text-field"in N){Ye=Math.round(Ua(T,"layout","text-size",y,z,b,k));var et=Ua(T,"layout","text-font",y,z,b,k);He=Ua(T,"layout","text-line-height",y,z,b,k),(Xe=En(o?o(et,t.metadata?t.metadata["ol:webfonts"]:void 0):et,Ye,He)).includes("sans-serif")||(Xe+=",sans-serif"),Ke=Ua(T,"layout","text-letter-spacing",y,z,b,k),Qe=Ua(T,"layout","text-max-width",y,z,b,k);var tt=Ua(T,"layout","text-field",y,z,b,k);Be="object"==typeof tt&&tt.sections?1===tt.sections.length?tt.toString():tt.sections.reduce((function(e,t,r){var n=t.fontStack?t.fontStack.split(","):et,a=En(o?o(n):n,Ye*(t.scale||1),He),i=t.text;if("\n"===i)return e.push("\n",""),e;if(2!=w){for(var s=0,u=(i=qa(i,a,Qe,Ke).split("\n")).length;s0&&e.push("\n",""),e.push(i[s],a);return e}e.push(ka(i,Ke),a)}),[]):$a(tt,c).trim(),J=Ua(T,"paint","text-opacity",y,z,b,k)}if(Be&&J&&!le){ae||(++M,(B=C[M])&&B.getText()&&!B.getFill()&&!B.getStroke()||(B=new O.default,C[M]=B),B.setImage(void 0),B.setGeometry(void 0)),B.getText()||B.setText(ie||new L.default({padding:[2,2,2,2]})),ie=B.getText();var rt=N["text-transform"];"uppercase"==rt?Be=Array.isArray(Be)?Be.map((function(e,t){return t%2?e:e.toUpperCase()})):Be.toUpperCase():"lowercase"==rt&&(Be=Array.isArray(Be)?Be.map((function(e,t){return t%2?e:e.toLowerCase()})):Be.toLowerCase());var nt=Array.isArray(Be)?Be:2==w?ka(Be,Ke):qa(Be,Xe,Qe,Ke);ie.setText(nt),ie.setFont(Xe),ie.setRotation(oa(Ua(T,"layout","text-rotate",y,z,b,k)));var at=Ua(T,"layout","text-anchor",y,z,b,k),it=ae||1==w?"point":Ua(T,"layout","symbol-placement",y,z,b,k),ot=void 0;if("line-center"===it?(ie.setPlacement("line"),ot="center"):ie.setPlacement(it),"line"===it&&"function"==typeof ie.setRepeat){var st=Ua(T,"layout","symbol-spacing",y,z,b,k);ie.setRepeat(2*st)}ie.setOverflow("point"===it);var ut=Ua(T,"paint","text-halo-width",y,z,b,k),lt=Ua(T,"layout","text-offset",y,z,b,k),pt=Ua(T,"paint","text-translate",y,z,b,k),ft=0,ct=0;if("point"==it){ot="center",-1!==at.indexOf("left")?(ot="left",ct=ut):-1!==at.indexOf("right")&&(ot="right",ct=-ut);var dt=Ua(T,"layout","text-rotation-alignment",y,z,b,k);ie.setRotateWithView("map"==dt)}else ie.setMaxAngle(oa(Ua(T,"layout","text-max-angle",y,z,b,k))*Be.length/nt.length),ie.setRotateWithView(!1);ie.setTextAlign(ot);var yt="middle";0==at.indexOf("bottom")?(yt="bottom",ft=-ut-.5*(He-1)*Ye):0==at.indexOf("top")&&(yt="top",ft=ut+.5*(He-1)*Ye),ie.setTextBaseline(yt);var mt=Ua(T,"layout","text-justify",y,z,b,k);ie.setJustify("auto"===mt?void 0:mt),ie.setOffsetX(lt[0]*Ye+ct+pt[0]),ie.setOffsetY(lt[1]*Ye+ft+pt[1]),E.setColor(Wa(Ua(T,"paint","text-color",y,z,b,k),J)),ie.setFill(E);var ht=Wa(Ua(T,"paint","text-halo-color",y,z,b,k),J);if(ht){_.setColor(ht),ut*=2;var vt=.5*Ye;_.setWidth(ut<=vt?ut:vt),ie.setStroke(_)}else ie.setStroke(void 0);var gt=Ua(T,"layout","text-padding",y,z,b,k),bt=ie.getPadding();gt!==bt[0]&&(bt[0]=gt,bt[1]=gt,bt[2]=gt,bt[3]=gt),B.setZIndex(X)}}}}}return M>-1?(C.length=M+1,Ba&&("set"in r?r.set("mapbox-layer",h):r.getProperties()["mapbox-layer"]=h),C):void 0}};return e.setStyle(R),e.set("mapbox-source",d),e.set("mapbox-layers",h),e.set("mapbox-featurestate",e.get("mapbox-featurestate")||{}),R}e.addMapboxLayer=function(e,t,r){var n,a,i=e.get("mapbox-style"),o=i.layers,s=-1;if(void 0!==r){var u=xa(e,r);if(void 0===u)throw new Error('Layer with id "'+r+'" not found.');n=o.indexOf(u)}else n=o.length;if(n>0&&o[n-1].source===t.source?(s=n-1,a=-1):n