|
|
var mapboxgl=function(){"use strict";var t=e;function e(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},e.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=n;function n(t,e){this.x=t,this.y=e}function i(t,e,r){return Math.min(r,Math.max(e,t))}function o(t){var e=[];for(var r in t)e.push(t[r]);return e}function a(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}function s(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function u(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function l(t,e){return-1!==t.indexOf(e,t.length-e.length)}function p(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function c(t){return Array.isArray(t)?t.map(c):"object"==typeof t&&t?p(t,c):t}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var h={};function f(t){h[t]||("undefined"!=typeof console&&console.warn(t),h[t]=!0)}function y(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function d(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r<n;i=r++)o=t[r],e+=((a=t[i]).x-o.x)*(o.y+a.y);return e}function m(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}function v(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var g=b,x=3;function b(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var a=i[x+o],s=i[x+o+1];n.push(a===s?null:i.subarray(a,s))}var u=i[x+n.length],l=i[x+n.length+1];this.keys=i.subarray(u,l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var p=0;p<this.d*this.d;p++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}function _(t,e){return t(e={exports:{}},e.exports),e.exports}b.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},b.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},b.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},b.prototype.query=function(t,e,r,n,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},b.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,p=this.bboxes,c=0;c<u.length;c++){var h=u[c];if(void 0===a[h]){var f=4*h;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},b.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,o,a,s))return}},b.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},b.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},b.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=x+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[x+a]=o,i.set(s,o),o+=s.length}return i[x+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[x+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var w=_((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),l=i.indexOf(")");if(-1!==u&&l+1===i.length){var p=i.substr(0,u),c=i.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=a(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),h];case"hsla":if(4!==c.length)return null;h=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=a(c[1]),d=a(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*s(v,m,f+1/3)),n(255*s(v,m,f)),n(255*s(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,k=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function S(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}k.parse=function(t){if(t){if(t instanceof k)return t;if("string"==typeof t){var e=w(t);if(e)return new k(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},k.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},k.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},k.black=new k(0,0,0,1),k.white=new k(1,1,1,1),k.transparent=new k(0,0,0,0),k.red=new k(1,0,0,1);var A=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),z=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],o=i[0],a=i[1];this.bindings[o]=a}};z.prototype.concat=function(t){return new z(this,t)},z.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},z.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var I={kind:"null"},M={kind:"number"},P={kind:"string"},C={kind:"boolean"},B={kind:"color"},V={kind:"object"},T={kind:"value"},E={kind:"collator"},F={kind:"formatted"};function O(t,e){return{kind:"array",itemType:t,N:e}}function L(t){if("array"===t.kind){var e=L(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var D=[I,M,P,C,B,F,V,O(T)];function j(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!j(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=D;r<n.length;r+=1){if(!j(n[r],e))return null}}return"Expected "+L(t)+" but found "+L(e)+" instead."}var q=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};q.prototype.compare=function(t,e){return this.collator.compare(t,e)},q.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var U=function(t,e,r,n){this.text=t,this.scale=e,this.fontStack=r,this.textColor=n},R=function(t){this.sections=t};function N(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Z(t){if(null===t)return I;if("string"==typeof t)return P;if("boolean"==typeof t)return C;if("number"==typeof t)return M;if(t instanceof k)return B;if(t instanceof q)return E;if(t instanceof R)return F;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=Z(i[n]);if(e){if(e===o)continue;e=T;break}e=o}return O(e||T,r)}return V}function J(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof k||t instanceof R?t.toString():JSON.stringify(t)}R.fromString=function(t){return new R([new U(t,null,null,null)])},R.prototype.toString=function(){return this.sections.map((function(t){return t.text})).join("")},R.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}return t};var K=function(t,e){this.type=t,this.value=e};K.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof k)return!0;if(e instanceof q)return!0;if(e instanceof R)return!0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1){if(!t(n[r]))return!1}return!0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],n=Z(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new K(n,r)},K.prototype.evaluate=function(){return this.value},K.prototype.eachChild=function(){},K.prototype.possibleOutputs=function(){return[this.value]},K.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof k?["rgba"].concat(this.value.toArray()):this.value instanceof R?this.value.serialize():this.value};var G=function(t){this.name="ExpressionEvaluationError",this.message=t};G.prototype.toJSON=function(){return this.message};var X={string:P,number:M,boolean:C,object:V},Y=function(t,e){this.type=t,this.args=e};Y.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in X)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=X[s],n++}else o=T;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=O(o,a)}else r=X[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,T);if(!l)return null;u.push(l)}return new Y(r,u)},Y.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!j(this.type,Z(r)))return r;if(e===this.args.length-1)throw new G("Expected value to be of type "+L(this.type)+", but found "+L(Z(r))+" instead.")}return null},Y.prototype.eachChild=function(t){this.args.forEach(t)},Y.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Y.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var H=function(t){this.type=F,this.sections=t};H.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],n=1;n<t.length-1;n+=2){var i=e.parse(t[n],1,T);if(!i)return null;var o=i.type.kind;if("string"!==o&&"value"!==o&&"null"!==o)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var a=t[n+1];if("object"!=typeof a||Array.isArray(a))return e.error("Format options argument must be an object.");var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,M)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,O(P))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,B)))return null;r.push({text:i,scale:s,font:u,textColor:l})}return new H(r)},H.prototype.evaluate=function(t){return new R(this.sections.map((function(e){return new U(J(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},H.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.text),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},H.prototype.possibleOutputs=function(){return[void 0]},H.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var W={"to-boolean":C,"to-color":B,"to-number":M,"to-string":P},$=function(t,e){this.type=t,this.args=e};$.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=W[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,T);if(!a)return null;i.push(a)}return new $(n,i)},$.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof k)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":N(e[0],e[1],e[2],e[3])))return new k(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new G(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new G("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?R.fromString(J(this.args[0].evaluate(t))):J(this.args[0].evaluate(t))},$.prototype.eachChild=function(t){this.args.forEach(t)},$.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},$.prototype.serialize=function(){if("formatted"===this.type.kind)return new H([{text:this.args[0],scale:null,font:null,textColor:null}]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Q=["Unknown","Point","LineString","Polygon"],tt=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={}};tt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},tt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Q[this.feature.type]:this.feature.type:null},tt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},tt.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=k.parse(t)),e};var et=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};et.prototype.evaluate=function(t){return this._evaluate(t,this.args)},et.prototype.eachChild=function(t){this.args.forEach(t)},et.prototype.possibleOutputs=function(){return[void 0]},et.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},et.parse=function(t,e){var r,n=t[0],i=et.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var c=p[l],h=c[0],f=c[1];u=new st(e.registry,e.path,null,e.scope);for(var y=[],d=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(h)?h[m-1]:h.type,x=u.parse(v,1+y.length,g);if(!x){d=!0;break}y.push(x)}if(!d)if(Array.isArray(h)&&h.length!==y.length)u.error("Expected "+h.length+" arguments, but found "+y.length+" instead.");else{for(var b=0;b<y.length;b++){var _=Array.isArray(h)?h[b]:h.type,w=y[b];u.concat(b+1).checkSubtype(_,w.type)}if(0===u.errors.length)return new et(n,o,f,y)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else{for(var k=(s.length?s:a).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(L).join(", ")+")":"("+L(e.type)+"...)"})).join(" | "),S=[],A=1;A<t.length;A++){var z=e.parse(t[A],1+S.length);if(!z)return null;S.push(L(z.type))}e.error("Expected arguments of type "+k+", but found ("+S.join(", ")+") instead.")}return null},et.register=function(t,e){for(var r in et.definitions=e,e)t[r]=et};var rt=function(t,e,r){this.type=E,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function nt(t){if(t instanceof et){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild((function(t){e&&!nt(t)&&(e=!1)})),e}function it(t){if(t instanceof et&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!it(t)&&(e=!1)})),e}function ot(t,e){if(t instanceof et&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!ot(t,e)&&(r=!1)})),r}rt.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,C);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,C);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,P))?null:new rt(n,i,o)},rt.prototype.evaluate=function(t){return new q(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},rt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},rt.prototype.possibleOutputs=function(){return[void 0]},rt.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var at=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};at.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new at(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},at.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},at.prototype.eachChild=function(){},at.prototype.possibleOutputs=function(){return[void 0]},at.prototype.serialize=function(){return["var",this.name]};var st=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new z),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function ut(t,e){for(var r,n,i=t.length-1,o=0,a=i,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new G("Input is not a number.");a=s-1}return 0}st.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},st.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new Y(e,[t]):"coerce"===r?new $(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[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 i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof K)&&function t(e){if(e instanceof at)return t(e.boundExpression);if(e instanceof et&&"error"===e.name)return!1;if(e instanceof rt)return!1;var r=e instanceof $||e instanceof Y;var n=!0;e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof K}));if(!n)return!1;return nt(e)&&ot(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new tt;try{o=new K(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},st.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new st(this.registry,n,e||null,i,this.errors)},st.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new A(n,t))},st.prototype.checkSubtype=function(t,e){var r=j(t,e);return r&&this.error(r),r};var lt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};function pt(t,e,r){return t*(1-r)+e*r}lt.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,M);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new lt(i,r,n)},lt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[ut(e,n)].evaluate(t)},lt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},lt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},lt.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ct=Object.freeze({number:pt,color:function(t,e,r){return new k(pt(t.r,e.r,r),pt(t.g,e.g,r),pt(t.b,e.b,r),pt(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return pt(t,e[n],r)}))}}),ht=.95047,ft=1,yt=1.08883,dt=4/29,mt=6/29,vt=3*mt*mt,gt=mt*mt*mt,xt=Math.PI/180,bt=180/Math.PI;function _t(t){return t>gt?Math.pow(t,1/3):t/vt+dt}function wt(t){return t>mt?t*t*t:vt*(t-dt)}function kt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function St(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function At(t){var e=St(t.r),r=St(t.g),n=St(t.b),i=_t((.4124564*e+.3575761*r+.1804375*n)/ht),o=_t((.2126729*e+.7151522*r+.072175*n)/ft);return{l:116*o-16,a:500*(i-o),b:200*(o-_t((.0193339*e+.119192*r+.9503041*n)/yt)),alpha:t.a}}function zt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=ft*wt(e),r=ht*wt(r),n=yt*wt(n),new k(kt(3.2404542*r-1.5371385*e-.4985314*n),kt(-.969266*r+1.8760108*e+.041556*n),kt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function It(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Mt={forward:At,reverse:zt,interpolate:function(t,e,r){return{l:pt(t.l,e.l,r),a:pt(t.a,e.a,r),b:pt(t.b,e.b,r),alpha:pt(t.alpha,e.alpha,r)}}},Pt={forward:function(t){var e=At(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*bt;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*xt,r=t.c;return zt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:It(t.h,e.h,r),c:pt(t.c,e.c,r),l:pt(t.l,e.l,r),alpha:pt(t.alpha,e.alpha,r)}}},Ct=Object.freeze({lab:Mt,hcl:Pt}),Bt=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[0],l=s[1];this.labels.push(u),this.outputs.push(l)}};function Vt(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}Bt.interpolationFactor=function(e,r,n,i){var o=0;if("exponential"===e.name)o=Vt(r,e.base,n,i);else if("linear"===e.name)o=Vt(r,1,n,i);else if("cubic-bezier"===e.name){var a=e.controlPoints;o=new t(a[0],a[1],a[2],a[3]).solve(Vt(r,1,n,i))}return o},Bt.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,M)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=B:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<o.length;p+=2){var c=o[p],h=o[p+1],f=p+3,y=p+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Bt(l,r,n,i,u):e.error("Type "+L(l)+" is not interpolatable.")},Bt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=ut(e,n),a=e[o],s=e[o+1],u=Bt.interpolationFactor(this.interpolation,n,a,s),l=r[o].evaluate(t),p=r[o+1].evaluate(t);return"interpolate"===this.operator?ct[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?Pt.reverse(Pt.interpolate(Pt.forward(l),Pt.forward(p),u)):Mt.reverse(Mt.interpolate(Mt.forward(l),Mt.forward(p),u))},Bt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},Bt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},Bt.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Tt=function(t,e){this.type=t,this.args=e};Tt.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],u=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!u)return null;r=r||u.type,i.push(u)}var l=n&&i.some((function(t){return j(n,t.type)}));return new Tt(l?T:r,i)},Tt.prototype.evaluate=function(t){for(var e=null,r=0,n=this.args;r<n.length;r+=1){if(null!==(e=n[r].evaluate(t)))break}return e},Tt.prototype.eachChild=function(t){this.args.forEach(t)},Tt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Tt.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Et=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Et.prototype.evaluate=function(t){return this.result.evaluate(t)},Et.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1])}t(this.result)},Et.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new Et(r,a):null},Et.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Et.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var Ft=function(t,e,r){this.type=t,this.index=e,this.input=r};Ft.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,M),n=e.parse(t[2],2,O(e.expectedType||T));if(!r||!n)return null;var i=n.type;return new Ft(i.itemType,r,n)},Ft.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new G("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new G("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new G("Array index must be an integer, but found "+e+" instead.");return r[e]},Ft.prototype.eachChild=function(t){t(this.index),t(this.input)},Ft.prototype.possibleOutputs=function(){return[void 0]},Ft.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ot=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};Ot.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var h=c[p];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,Z(h)))return null}else r=Z(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var y=e.parse(t[1],1,T);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new Ot(r,n,y,i,o,d):null},Ot.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Z(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ot.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ot.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Ot.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(c=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],c=p[0],h=p[1];1===h.length?e.push(s(h[0])):e.push(h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Lt=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function Dt(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function jt(t,e,r,n){return 0===n.compare(e,r)}function qt(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=C,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,T);if(!o)return null;if(!Dt(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+L(o.type)+"'.");var a=e.parse(t[2],2,T);if(!a)return null;if(!Dt(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+L(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+L(o.type)+"' and '"+L(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Y(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Y(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,E)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Z(o),u=Z(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new G('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=Z(o),p=Z(a);if("string"!==l.kind||"string"!==p.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}Lt.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,C);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Lt(r,n,s):null},Lt.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},Lt.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t(i),t(o)}t(this.otherwise)},Lt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map((function(t){t[0];return t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Lt.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ut=qt("==",(function(t,e,r){return e===r}),jt),Rt=qt("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!jt(0,e,r,n)})),Nt=qt("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Zt=qt(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Jt=qt("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Kt=qt(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Gt=function(t,e,r,n,i){this.type=P,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Gt.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,M);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,P)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,P)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,M)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,M))?null:new Gt(r,i,o,a,s)},Gt.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Gt.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Gt.prototype.possibleOutputs=function(){return[void 0]},Gt.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Xt=function(t){this.type=M,this.input=t};Xt.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+L(r.type)+" instead."):new Xt(r):null},Xt.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new G("Expected value to be of type string or array, but found "+L(Z(e))+" instead.")},Xt.prototype.eachChild=function(t){t(this.input)},Xt.prototype.possibleOutputs=function(){return[void 0]},Xt.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Yt={"==":Ut,"!=":Rt,">":Zt,"<":Nt,">=":Kt,"<=":Jt,array:Y,at:Ft,boolean:Y,case:Lt,coalesce:Tt,collator:rt,format:H,interpolate:Bt,"interpolate-hcl":Bt,"interpolate-lab":Bt,length:Xt,let:Et,literal:K,match:Ot,number:Y,"number-format":Gt,object:Y,step:lt,string:Y,"to-boolean":$,"to-color":$,"to-number":$,"to-string":$,var:at};function Ht(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=N(r,n,i,a);if(s)throw new G(s);return new k(r/255*a,n/255*a,i/255*a,a)}function Wt(t,e){return t in e}function $t(t,e){var r=e[t];return void 0===r?null:r}function Qt(t){return{type:t}}function te(t){return{result:"success",value:t}}function ee(t){return{result:"error",value:t}}function re(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ne(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ie(t){return!!t.expression&&t.expression.interpolated}function oe(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ae(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function se(t){return t}function ue(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function le(t,e,r,n,i){return ue(typeof r===i?n[r]:void 0,t.default,e.default)}function pe(t,e,r){if("number"!==oe(r))return ue(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=ut(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function ce(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==oe(r))return ue(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=ut(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=ct[e.type]||se;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ct[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function he(t,e,r){return"color"===e.type?r=k.parse(r):"formatted"===e.type?r=R.fromString(r.toString()):oe(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ue(r,t.default,e.default)}et.register(Yt,{error:[{kind:"error"},[P],function(t,e){var r=e[0];throw new G(r.evaluate(t))}],typeof:[P,[T],function(t,e){return L(Z(e[0].evaluate(t)))}],"to-rgba":[O(M,4),[B],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[B,[M,M,M],Ht],rgba:[B,[M,M,M,M],Ht],has:{type:C,overloads:[[[P],function(t,e){return Wt(e[0].evaluate(t),t.properties())}],[[P,V],function(t,e){var r=e[0],n=e[1];return Wt(r.evaluate(t),n.evaluate(t))}]]},get:{type:T,overloads:[[[P],function(t,e){return $t(e[0].evaluate(t),t.properties())}],[[P,V],function(t,e){var r=e[0],n=e[1];return $t(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[T,[P],function(t,e){return $t(e[0].evaluate(t),t.featureState||{})}],properties:[V,[],function(t){return t.properties()}],"geometry-type":[P,[],function(t){return t.geometryType()}],id:[T,[],function(t){return t.id()}],zoom:[M,[],function(t){return t.globals.zoom}],"heatmap-density":[M,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[M,[],function(t){return t.globals.lineProgress||0}],accumulated:[T,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[M,Qt(M),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1){r+=i[n].evaluate(t)}return r}],"*":[M,Qt(M),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1){r*=i[n].evaluate(t)}return r}],"-":{type:M,overloads:[[[M,M],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[M],function(t,e){return-e[0].evaluate(t)}]]},"/":[M,[M,M],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[M,[M,M],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[M,[],function(){return Math.LN2}],pi:[M,[],function(){return Math.PI}],e:[M,[],function(){return Math.E}],"^":[M,[M,M],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[M,[M],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[M,[M],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[M,[M],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[M,[M],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[M,[M],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[M,[M],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[M,[M],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[M,[M],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[M,[M],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[M,[M],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[M,Qt(M),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[M,Qt(M),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[M,[M],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[M,[M],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[M,[M],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[M,[M],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[C,[P,T],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[C,[T],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[C,[P],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<o}],"filter-id-<":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[C,[T],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[C,[],function(t){return null!==t.id()}],"filter-type-in":[C,[O(P)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[C,[O(T)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[C,[P,O(T)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[C,[P,O(T)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:C,overloads:[[[C,C],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Qt(C),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(!n[r].evaluate(t))return!1}return!0}]]},any:{type:C,overloads:[[[C,C],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[Qt(C),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(n[r].evaluate(t))return!0}return!1}]]},"!":[C,[C],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[C,[P],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[P,[P],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[P,[P],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[P,Qt(T),function(t,e){return e.map((function(e){return J(e.evaluate(t))})).join("")}],"resolved-locale":[P,[E],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var fe=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new tt,this._defaultValue=e?function(t){return"color"===t.type&&ae(t.default)?new k(0,0,0,0):"color"===t.type?k.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function ye(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Yt}function de(t,e){var r=new st(Yt,[],e?function(t){var e={color:B,string:P,number:M,enum:P,boolean:C,formatted:F};if("array"===t.type)return O(e[t.value]||T,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?te(new fe(n,e)):ee(r.errors)}fe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},fe.prototype.evaluate=function(t,e,r,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.formattedSection=n||null;try{var i=this.expression.evaluate(this._evaluator);if(null==i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new G("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(i)+" instead.");return i}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var me=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!it(e.expression)};me.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},me.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)};var ve=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!it(e.expression),this.interpolationType=n};function ge(t,e){if("error"===(t=de(t,e)).result)return t;var r=t.value.expression,n=nt(r);if(!n&&!re(e))return ee([new A("","data expressions not supported")]);var i=ot(r,["zoom"]);if(!i&&!ne(e))return ee([new A("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof Et)r=t(e.result);else if(e instanceof Tt)for(var n=0,i=e.args;n<i.length;n+=1){var o=i[n];if(r=t(o))break}else(e instanceof lt||e instanceof Bt)&&e.input instanceof et&&"zoom"===e.input.name&&(r=e);if(r instanceof A)return r;e.eachChild((function(e){var n=t(e);n instanceof A?r=n:!r&&n?r=new A("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new A("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}));return r}(r);if(!o&&!i)return ee([new A("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof A)return ee([o]);if(o instanceof Bt&&!ie(e))return ee([new A("",'"interpolate" expressions cannot be used with this property')]);if(!o)return te(new me(n?"constant":"source",t.value));var a=o instanceof Bt?o.interpolation:void 0;return te(new ve(n?"camera":"composite",t.value,o.labels,a))}ve.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},ve.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)},ve.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Bt.interpolationFactor(this.interpolationType,t,e,r):0};var xe=function(t,e){this._parameters=t,this._specification=e,S(this,function t(e,r){var n,i,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,l=s||!u,p=e.type||(ie(r)?"exponential":"interval");if(a&&((e=S({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],k.parse(t[1])]}))),e.default?e.default=k.parse(e.default):e.default=k.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Ct[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===p)n=ce;else if("interval"===p)n=pe;else if("categorical"===p){n=le,i=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var f=h[c];i[f[0]]=f[1]}o=typeof e.stops[0][0]}else{if("identity"!==p)throw new Error('Unknown function type "'+p+'"');n=he}if(s){for(var y={},d=[],m=0;m<e.stops.length;m++){var v=e.stops[m],g=v[0].zoom;void 0===y[g]&&(y[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},d.push(g)),y[g].stops.push([v[0].value,v[1]])}for(var x=[],b=0,_=d;b<_.length;b+=1){var w=_[b];x.push([y[w].zoom,t(y[w],r)])}var A={name:"linear"};return{kind:"composite",interpolationType:A,interpolationFactor:Bt.interpolationFactor.bind(void 0,A),zoomStops:x.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return ce({stops:x,base:e.base},r,i).evaluate(i,n)}}}if(l){var z="exponential"===p?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:z,interpolationFactor:Bt.interpolationFactor.bind(void 0,z),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var a=t.zoom;return n(e,r,a,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?ue(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};xe.deserialize=function(t){return new xe(t._parameters,t._specification)},xe.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var be=self.ImageData,_e={};function we(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),_e[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var ke in we("Object",Object),g.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},g.deserialize=function(t){return new g(t.buffer)},we("Grid",g),we("Color",k),we("Error",Error),we("StylePropertyFunction",xe),we("StyleExpression",fe,{omit:["_evaluator"]}),we("ZoomDependentExpression",ve),we("ZoomConstantExpression",me),we("CompoundExpression",et,{omit:["_evaluate"]}),Yt)Yt[ke]._classRegistryKey||we("Expression_"+ke,Yt[ke]);function Se(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof be)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,o=t;i<o.length;i+=1){var a=o[i];n.push(Se(a,e))}return n}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var p in t)if(t.hasOwnProperty(p)&&!(_e[u].omit.indexOf(p)>=0)){var c=t[p];l[p]=_e[u].shallow.indexOf(p)>=0?c:Se(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(l.$name=u),l}throw new Error("can't serialize object of type "+typeof t)}function Ae(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof be)return t;if(Array.isArray(t))return t.map(Ae);if("object"==typeof t){var e=t.$name||"Object",r=_e[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];n[a]=_e[e].shallow.indexOf(a)>=0?s:Ae(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ze=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};ze.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))};var Ie=function(t,e,r){var n;this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},n=this,["receive","process"].forEach((function(t){n[t]&&(n[t]=n[t].bind(n))})),this.invoker=new ze(this.process),this.target.addEventListener("message",this.receive,!1)};Ie.prototype.send=function(t,e,r,n){var i=this,o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var a=[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:Se(e,a)},a),{cancel:function(){r&&delete i.callbacks[o],i.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:i.mapId})}}},Ie.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()},Ie.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if("<response>"===r.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(r.error?n(Ae(r.error)):n(null,Ae(r.data)))}else{var i=!1,o=r.hasCallback?function(r,n){i=!0,delete t.cancelCallbacks[e];var o=[];t.target.postMessage({id:e,type:"<response>",sourceMapId:t.mapId,error:r?Se(r):null,data:Se(n,o)},o)}:function(t){i=!0},a=null,s=Ae(r.data);if(this.parent[r.type])a=this.parent[r.type](r.sourceMapId,s,o);else if(this.parent.getWorkerSource){var u=r.type.split(".");a=this.parent.getWorkerSource(r.sourceMapId,u[0],s.source)[u[1]](s,o)}else o(new Error("Could not find function "+r.type));!i&&a&&a.cancel&&(this.cancelCallbacks[e]=a.cancel)}}},Ie.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var Me={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},Pe=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ce(t){var e=t.key,r=t.value;return r?[new Pe(e,r,"constants have been deprecated as of v8")]:[]}function Be(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Ve(t){return Be(t)?t.valueOf():t}function Te(t){if(Array.isArray(t))return t.map(Te);if(t instanceof Object&&!Be(t)){var e={};for(var r in t)e[r]=Te(t[r]);return e}return Ve(t)}function Ee(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=oe(r);if("object"!==u)return[new Pe(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=ir;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new Pe(e,r[l],'unknown property "'+l+'"'));continue}h=ir}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Pe(e,r,'missing required property "'+f+'"'));return s}function Fe(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||ir;if("array"!==oe(e))return[new Pe(o,e,"array expected, "+oe(e)+" found")];if(r.length&&e.length!==r.length)return[new Pe(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Pe(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===oe(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:i,key:o+"["+l+"]"}));return u}function Oe(t){var e=t.key,r=t.value,n=t.valueSpec,i=oe(r);return"number"!==i?[new Pe(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Pe(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Pe(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Le(t){var e,r,n,i=t.valueSpec,o=Ve(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===oe(t.value.stops)&&"array"===oe(t.value.stops[0])&&"object"===oe(t.value.stops[0][0]),p=Ee({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Pe(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Fe({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===oe(r)&&0===r.length&&e.push(new Pe(t.key,r,"array must have at least one stop"));return e},default:function(t){return ir({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new Pe(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new Pe(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ie(t.valueSpec)&&p.push(new Pe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!re(t.valueSpec)?p.push(new Pe(t.key,t.value,"property functions not supported")):s&&!ne(t.valueSpec)&&p.push(new Pe(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new Pe(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==oe(o))return[new Pe(s,o,"array expected, "+oe(o)+" found")];if(2!==o.length)return[new Pe(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==oe(o[0]))return[new Pe(s,o,"object expected, "+oe(o[0])+" found")];if(void 0===o[0].zoom)return[new Pe(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Pe(s,o,"object stop key must have value")];if(n&&n>Ve(o[0].zoom))return[new Pe(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ve(o[0].zoom)!==n&&(n=Ve(o[0].zoom),r=void 0,a={}),e=e.concat(Ee({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Oe,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return ye(Te(o[1]))?e.concat([new Pe(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(ir({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=oe(t.value),u=Ve(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new Pe(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Pe(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return re(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pe(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new Pe(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new Pe(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new Pe(t.key,l,"integer expected, found "+u)]}}function De(t){var e=("property"===t.expressionContext?ge:de)(Te(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Pe(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==r.possibleOutputs().indexOf(void 0))return[new Pe(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!it(r))return[new Pe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!it(r))return[new Pe(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ot(r,["zoom","feature-state"]))return[new Pe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!nt(r))return[new Pe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function je(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ve(r))&&i.push(new Pe(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Ve(r))&&i.push(new Pe(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function qe(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!qe(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}var Ue={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Re(t){if(null==t)return function(){return!0};qe(t)||(t=Ze(t));var e=de(t,Ue);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function Ne(t,e){return t<e?-1:t>e?1:0}function Ze(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Je(t[1],t[2],"=="):"!="===r?Xe(Je(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Je(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ze))):"all"===r?["all"].concat(t.slice(1).map(Ze)):"none"===r?["all"].concat(t.slice(1).map(Ze).map(Xe)):"in"===r?Ke(t[1],t.slice(2)):"!in"===r?Xe(Ke(t[1],t.slice(2))):"has"===r?Ge(t[1]):"!has"!==r||Xe(Ge(t[1]))}function Je(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Ke(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Ne)]]:["filter-in-small",t,["literal",e]]}}function Ge(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xe(t){return["!",t]}function Ye(t){return qe(Te(t.value))?De(S({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var n=e.key;if("array"!==oe(r))return[new Pe(n,r,"array expected, "+oe(r)+" found")];var i=e.styleSpec;var o;var a=[];if(r.length<1)return[new Pe(n,r,"filter array must have at least 1 element")];a=a.concat(je({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(Ve(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ve(r[1])&&a.push(new Pe(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Pe(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=oe(r[1]))&&a.push(new Pe(n+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;s<r.length;s++)o=oe(r[s]),"$type"===Ve(r[1])?a=a.concat(je({key:n+"["+s+"]",value:r[s],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new Pe(n+"["+s+"]",r[s],"string, number, or boolean expected, "+o+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=oe(r[1]),2!==r.length?a.push(new Pe(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==o&&a.push(new Pe(n+"[1]",r[1],"string expected, "+o+" found"))}return a}(t)}function He(t,e){var r=t.key,n=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return ir({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[a];if(!p)return[new Pe(r,o,'unknown property "'+a+'"')];if("string"===oe(o)&&re(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Pe(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var c=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&c.push(new Pe(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&ae(Te(o))&&"identity"===Ve(o.type)&&c.push(new Pe(r,o,'"text-font" does not support identity functions'))),c.concat(ir({key:t.key,value:o,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function We(t){return He(t,"paint")}function $e(t){return He(t,"layout")}function Qe(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new Pe(n,r,'either "type" or "ref" is required'));var a,s=Ve(r.type),u=Ve(r.ref);if(r.id)for(var l=Ve(r.id),p=0;p<t.arrayIndex;p++){var c=i.layers[p];Ve(c.id)===l&&e.push(new Pe(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Pe(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){Ve(t.id)===u&&(a=t)})),a?a.ref?e.push(new Pe(n,r.ref,"ref cannot reference another ref layer")):s=Ve(a.type):e.push(new Pe(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&Ve(h.type);h?"vector"===f&&"raster"===s?e.push(new Pe(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Pe(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Pe(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new Pe(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Pe(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Pe(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Pe(n,r,'missing required property "source"'));return e=e.concat(Ee({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return ir({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Ye,layout:function(t){return Ee({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return $e(S({layerType:s},t))}}})},paint:function(t){return Ee({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return We(S({layerType:s},t))}}})}}}))}function tr(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new Pe(r,e,'"type" is required')];var o,a=Ve(e.type);switch(a){case"vector":case"raster":case"raster-dem":return o=Ee({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n});case"geojson":if(o=Ee({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p=u[1],c="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,De({key:r+"."+s+".map",value:p,expressionContext:"cluster-map"})),o.push.apply(o,De({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Ee({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Ee({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Pe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return je({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function er(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=oe(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new Pe("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=u&&n[u[1]]&&n[u[1]].transition?o.concat(ir({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?o.concat(ir({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):o.concat([new Pe(s,e[s],'unknown property "'+s+'"')])}return o}function rr(t){var e=t.value,r=t.key,n=oe(e);return"string"!==n?[new Pe(r,e,"string expected, "+n+" found")]:[]}var nr={"*":function(){return[]},array:Fe,boolean:function(t){var e=t.value,r=t.key,n=oe(e);return"boolean"!==n?[new Pe(r,e,"boolean expected, "+n+" found")]:[]},number:Oe,color:function(t){var e=t.key,r=t.value,n=oe(r);return"string"!==n?[new Pe(e,r,"color expected, "+n+" found")]:null===w(r)?[new Pe(e,r,'color expected, "'+r+'" found')]:[]},constants:Ce,enum:je,filter:Ye,function:Le,layer:Qe,object:Ee,source:tr,light:er,string:rr,formatted:function(t){return 0===rr(t).length?[]:De(t)}};function ir(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&ae(Ve(e))?Le(t):r.expression&&ye(Te(e))?De(t):r.type&&nr[r.type]?nr[r.type](t):Ee(S({},t,{valueSpec:r.type?n[r.type]:r}))}function or(t){var e=t.value,r=t.key,n=rr(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new Pe(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Pe(r,e,'"glyphs" url must include a "{range}" token')),n)}function ar(t,e){e=e||Me;var r=[];return r=r.concat(ir({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:or,"*":function(){return[]}}})),t.constants&&(r=r.concat(Ce({key:"constants",value:t.constants,style:t,styleSpec:e}))),sr(r)}function sr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function ur(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return sr(t.apply(this,e))}}function lr(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function pr(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}ar.source=ur(tr),ar.light=ur(er),ar.layer=ur(Qe),ar.filter=ur(Ye),ar.paintProperty=ur(We),ar.layoutProperty=ur($e);var cr=function(t,e){void 0===e&&(e={}),a(this,e),this.type=t},hr=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",a({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(cr),fr=function(){};fr.prototype.on=function(t,e){return this._listeners=this._listeners||{},lr(t,e,this._listeners),this},fr.prototype.off=function(t,e){return pr(t,e,this._listeners),pr(t,e,this._oneTimeListeners),this},fr.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},lr(t,e,this._oneTimeListeners),this},fr.prototype.fire=function(t,e){"string"==typeof t&&(t=new cr(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1){i[n].call(this,t)}for(var o=0,s=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<s.length;o+=1){var u=s[o];pr(r,u,this._oneTimeListeners),u.call(this,t)}var l=this._eventedParent;l&&(a(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof hr&&console.error(t.error);return this},fr.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},fr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var yr=ar,dr=yr.paintProperty,mr=yr.layoutProperty;var vr=function(){this.first=!0};vr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var gr={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function xr(t){for(var e=0,r=t;e<r.length;e+=1){if(_r(r[e].charCodeAt(0)))return!0}return!1}function br(t){return!gr.Arabic(t)&&(!gr["Arabic Supplement"](t)&&(!gr["Arabic Extended-A"](t)&&(!gr["Arabic Presentation Forms-A"](t)&&!gr["Arabic Presentation Forms-B"](t))))}function _r(t){return 746===t||747===t||!(t<4352)&&(!!gr["Bopomofo Extended"](t)||(!!gr.Bopomofo(t)||(!(!gr["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||(!!gr["CJK Compatibility Ideographs"](t)||(!!gr["CJK Compatibility"](t)||(!!gr["CJK Radicals Supplement"](t)||(!!gr["CJK Strokes"](t)||(!(!gr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!gr["CJK Unified Ideographs Extension A"](t)||(!!gr["CJK Unified Ideographs"](t)||(!!gr["Enclosed CJK Letters and Months"](t)||(!!gr["Hangul Compatibility Jamo"](t)||(!!gr["Hangul Jamo Extended-A"](t)||(!!gr["Hangul Jamo Extended-B"](t)||(!!gr["Hangul Jamo"](t)||(!!gr["Hangul Syllables"](t)||(!!gr.Hiragana(t)||(!!gr["Ideographic Description Characters"](t)||(!!gr.Kanbun(t)||(!!gr["Kangxi Radicals"](t)||(!!gr["Katakana Phonetic Extensions"](t)||(!(!gr.Katakana(t)||12540===t)||(!(!gr["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!gr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!gr["Unified Canadian Aboriginal Syllabics"](t)||(!!gr["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!gr["Vertical Forms"](t)||(!!gr["Yijing Hexagram Symbols"](t)||(!!gr["Yi Syllables"](t)||!!gr["Yi Radicals"](t))))))))))))))))))))))))))))))}function wr(t){return!(_r(t)||function(t){return!(!gr["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!gr["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!gr["Letterlike Symbols"](t)||(!!gr["Number Forms"](t)||(!(!gr["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!gr["Control Pictures"](t)||9251===t)||(!!gr["Optical Character Recognition"](t)||(!!gr["Enclosed Alphanumerics"](t)||(!!gr["Geometric Shapes"](t)||(!(!gr["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!gr["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!gr["CJK Symbols and Punctuation"](t)||(!!gr.Katakana(t)||(!!gr["Private Use Area"](t)||(!!gr["CJK Compatibility Forms"](t)||(!!gr["Small Form Variants"](t)||(!!gr["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function kr(t,e){return!(!e&&(t>=1424&&t<=2303||gr["Arabic Presentation Forms-A"](t)||gr["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||gr.Khmer(t))}self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date);var Sr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return null!=Sr.applyArabicShaping}},Ar=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new vr,this.transition={})};Ar.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1){if(!kr(n[r].charCodeAt(0),e))return!1}return!0}(t,Sr.isLoaded())},Ar.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ar.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var zr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(ae(t))return new xe(t,e);if(ye(t)){var r=ge(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=k.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};zr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},zr.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var Ir=function(t){this.property=t,this.value=new zr(t,void 0)};Ir.prototype.transitioned=function(t,e){return new Pr(this.property,this.value,e,a({},t.transition,this.transition),t.now)},Ir.prototype.untransitioned=function(){return new Pr(this.property,this.value,null,{},0)};var Mr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Mr.prototype.getValue=function(t){return c(this._values[t].value.value)},Mr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ir(this._values[t].property)),this._values[t].value=new zr(this._values[t].property,null===e?void 0:c(e))},Mr.prototype.getTransition=function(t){return c(this._values[t].transition)},Mr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ir(this._values[t].property)),this._values[t].transition=c(e)||void 0},Mr.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},Mr.prototype.transitioned=function(t,e){for(var r=new Cr(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},Mr.prototype.untransitioned=function(){for(var t=new Cr(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var Pr=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};Pr.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return n.possiblyEvaluate(t);var i=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(i))}return r};var Cr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Cr.prototype.possiblyEvaluate=function(t){for(var e=new Tr(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t)}return e},Cr.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var Br=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Br.prototype.getValue=function(t){return c(this._values[t].value)},Br.prototype.setValue=function(t,e){this._values[t]=new zr(this._values[t].property,null===e?void 0:c(e))},Br.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},Br.prototype.possiblyEvaluate=function(t){for(var e=new Tr(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t)}return e};var Vr=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Vr.prototype.isConstant=function(){return"constant"===this.value.kind},Vr.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Vr.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var Tr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Tr.prototype.get=function(t){return this._values[t]};var Er=function(t){this.specification=t};Er.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Er.prototype.interpolate=function(t,e,r){var n=ct[this.specification.type];return n?n(t,e,r):t};var Fr=function(t,e){this.specification=t,this.overrides=e};Fr.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Vr(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Vr(this,t.expression,e)},Fr.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Vr(this,{kind:"constant",value:void 0},t.parameters);var n=ct[this.specification.type];return n?new Vr(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},Fr.prototype.evaluate=function(t,e,r,n){return"constant"===t.kind?t.value:t.evaluate(e,r,n)};var Or=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Vr(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e),n=this._calculate(r,r,r,e);return new Vr(this,{kind:"constant",value:n},e)}if("camera"===t.expression.kind){var i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Vr(this,{kind:"constant",value:i},e)}return new Vr(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n){if("source"===t.kind){var i=t.evaluate(e,r,n);return this._calculate(i,i,i,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Fr),Lr=function(t){this.specification=t};Lr.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Ar(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ar(Math.floor(e.zoom),e)),t.expression.evaluate(new Ar(Math.floor(e.zoom+1),e)),e)}},Lr.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Lr.prototype.interpolate=function(t){return t};var Dr=function(t){this.specification=t};Dr.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Dr.prototype.interpolate=function(){return!1};var jr=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new zr(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Ir(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};we("DataDrivenProperty",Fr),we("DataConstantProperty",Er),we("CrossFadedDataDrivenProperty",Or),we("CrossFadedProperty",Lr),we("ColorRampProperty",Dr);var qr=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Br(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Mr(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(mr,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return l(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(dr,n,t,e,r))return!1}if(l(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,s,u)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&function(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var o=i[n];t.fire(new hr(new Error(o.message))),r=!0}return r}(this,t.call(yr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Me,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Vr&&re(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(fr),Ur={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Rr=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Nr=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Zr(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,o=(i=t.type,Ur[i].BYTES_PER_ELEMENT),a=r=Jr(r,Math.max(e,o)),s=t.components||1;return n=Math.max(n,o),r+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:Jr(r,Math.max(n,e)),alignment:e}}function Jr(t,e){return Math.ceil(t/e)*e}Nr.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Nr.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Nr.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Nr.prototype.clear=function(){this.length=0},Nr.prototype.resize=function(t){this.reserve(t),this.length=t},Nr.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Nr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Nr);Kr.prototype.bytesPerElement=4,we("StructArrayLayout2i4",Kr);var Gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Nr);Gr.prototype.bytesPerElement=8,we("StructArrayLayout4i8",Gr);var Xr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Nr);Xr.prototype.bytesPerElement=12,we("StructArrayLayout2i4i12",Xr);var Yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Nr);Yr.prototype.bytesPerElement=8,we("StructArrayLayout2i4ub8",Yr);var Hr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(Nr);Hr.prototype.bytesPerElement=16,we("StructArrayLayout8ui16",Hr);var Wr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var l=8*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+3]=i,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(Nr);Wr.prototype.bytesPerElement=16,we("StructArrayLayout4i4ui16",Wr);var $r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Nr);$r.prototype.bytesPerElement=12,we("StructArrayLayout3f12",$r);var Qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Nr);Qr.prototype.bytesPerElement=4,we("StructArrayLayout1ul4",Qr);var tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(Nr);tn.prototype.bytesPerElement=24,we("StructArrayLayout6i1ul2ui2i24",tn);var en=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Nr);en.prototype.bytesPerElement=12,we("StructArrayLayout2i2i2i12",en);var rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Nr);rn.prototype.bytesPerElement=12,we("StructArrayLayout2ub2f12",rn);var nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=22*t,g=11*t,x=44*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[g+2]=o,this.uint32[g+3]=a,this.uint32[g+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=p,this.float32[g+7]=c,this.float32[g+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=y,this.uint8[x+38]=d,this.uint32[g+10]=m,t},e}(Nr);nn.prototype.bytesPerElement=44,we("StructArrayLayout2i2ui3ul3ui2f3ub1ul44",nn);var on=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x){var b=this.length;return this.resize(b+1),this.emplace(b,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b){var _=24*t,w=12*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.int16[_+2]=n,this.int16[_+3]=i,this.int16[_+4]=o,this.int16[_+5]=a,this.uint16[_+6]=s,this.uint16[_+7]=u,this.uint16[_+8]=l,this.uint16[_+9]=p,this.uint16[_+10]=c,this.uint16[_+11]=h,this.uint16[_+12]=f,this.uint16[_+13]=y,this.uint16[_+14]=d,this.uint16[_+15]=m,this.uint16[_+16]=v,this.uint32[w+9]=g,this.float32[w+10]=x,this.float32[w+11]=b,t},e}(Nr);on.prototype.bytesPerElement=48,we("StructArrayLayout6i11ui1ul2f48",on);var an=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Nr);an.prototype.bytesPerElement=4,we("StructArrayLayout1f4",an);var sn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Nr);sn.prototype.bytesPerElement=6,we("StructArrayLayout3i6",sn);var un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=n,t},e}(Nr);un.prototype.bytesPerElement=8,we("StructArrayLayout1ul2ui8",un);var ln=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Nr);ln.prototype.bytesPerElement=6,we("StructArrayLayout3ui6",ln);var pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Nr);pn.prototype.bytesPerElement=4,we("StructArrayLayout2ui4",pn);var cn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Nr);cn.prototype.bytesPerElement=2,we("StructArrayLayout1ui2",cn);var hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Nr);hn.prototype.bytesPerElement=8,we("StructArrayLayout2f8",hn);var fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Nr);fn.prototype.bytesPerElement=16,we("StructArrayLayout4f16",fn);var yn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Rr);yn.prototype.size=24;var dn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new yn(this,t)},e}(tn);we("CollisionBoxArray",dn);var mn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},Object.defineProperties(e.prototype,r),e}(Rr);mn.prototype.size=44;var vn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new mn(this,t)},e}(nn);we("PlacedSymbolArray",vn);var gn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+15]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+16]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+9]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+9]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+10]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+10]=t},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+11]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+11]=t},Object.defineProperties(e.prototype,r),e}(Rr);gn.prototype.size=48;var xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new gn(this,t)},e}(on);we("SymbolInstanceArray",xn);var bn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Rr);bn.prototype.size=4;var _n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new bn(this,t)},e}(an);we("GlyphOffsetArray",_n);var wn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Rr);wn.prototype.size=6;var kn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new wn(this,t)},e}(sn);we("SymbolLineVertexArray",kn);var Sn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Rr);Sn.prototype.size=8;var An=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Sn(this,t)},e}(un);we("FeatureIndexArray",An);var zn=Zr([{name:"a_pos",components:2,type:"Int16"}],4).members,In=function(t){void 0===t&&(t=[]),this.segments=t};function Mn(t,e){return 256*(t=i(Math.floor(t),0,255))+(e=i(Math.floor(e),0,255))}In.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>In.MAX_VERTEX_ARRAY_LENGTH&&f("Max vertices per segment is "+In.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>In.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},In.prototype.get=function(){return this.segments},In.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},In.simpleSegment=function(t,e,r,n){return new In([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},In.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,we("SegmentVector",In);var Pn=function(){this.ids=[],this.positions=[],this.indexed=!1};function Cn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Pn.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n)},Pn.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var n=e+r>>1;this.ids[n]>=t?r=n:e=n+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},Pn.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(n>=i)return;var o=e[n+i>>1];var a=n-1;var s=i+1;for(;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;Cn(e,a,s),Cn(r,3*a,3*s),Cn(r,3*a+1,3*s+1),Cn(r,3*a+2,3*s+2)}t(e,r,n,s);t(e,r,s+1,i)}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},Pn.deserialize=function(t){var e=new Pn;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},we("FeaturePositionMap",Pn);var Bn=function(t,e){this.gl=t.gl,this.location=e},Vn=(function(t){function e(e,r){t.call(this,e,r),this.current=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}}(Bn),function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Bn)),Tn=(function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}}(Bn),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}}(Bn),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Bn)),En=function(t){function e(e,r){t.call(this,e,r),this.current=k.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Bn),Fn=new Float32Array(16);!function(t){function e(e,r){t.call(this,e,r),this.current=Fn}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}}(Bn);function On(t){return[Mn(255*t.r,255*t.g),Mn(255*t.b,255*t.a)]}var Ln=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};Ln.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Ln.prototype.setConstantPatternPositions=function(){},Ln.prototype.populatePaintArray=function(){},Ln.prototype.updatePaintArray=function(){},Ln.prototype.upload=function(){},Ln.prototype.destroy=function(){},Ln.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Ln.prototype.getBinding=function(t,e){return"color"===this.type?new En(t,e):new Vn(t,e)},Ln.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:Se(e),names:r,type:n}},Ln.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Ln(Ae(e),r,n)};var Dn=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};Dn.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Dn.prototype.populatePaintArray=function(){},Dn.prototype.updatePaintArray=function(){},Dn.prototype.upload=function(){},Dn.prototype.destroy=function(){},Dn.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},Dn.prototype.setUniforms=function(t,e,r,n,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&e.set(o.patternFrom)},Dn.prototype.getBinding=function(t,e){return new Tn(t,e)};var jn=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};jn.prototype.defines=function(){return[]},jn.prototype.setConstantPatternPositions=function(){},jn.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Ar(0),e,{},n);if("color"===this.type)for(var s=On(a),u=o;u<t;u++)i.emplaceBack(s[0],s[1]);else{for(var l=o;l<t;l++)i.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},jn.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:0},r,n);if("color"===this.type)for(var a=On(o),s=t;s<e;s++)i.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)i.emplace(u,o);this.maxValue=Math.max(this.maxValue,o)}},jn.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},jn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},jn.prototype.setUniforms=function(t,e){e.set(0)},jn.prototype.getBinding=function(t,e){return new Vn(t,e)};var qn=function(t,e,r,n,i,o){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};qn.prototype.defines=function(){return[]},qn.prototype.setConstantPatternPositions=function(){},qn.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Ar(this.zoom),e,{},n),s=this.expression.evaluate(new Ar(this.zoom+1),e,{},n);if("color"===this.type)for(var u=On(a),l=On(s),p=o;p<t;p++)i.emplaceBack(u[0],u[1],l[0],l[1]);else{for(var c=o;c<t;c++)i.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},qn.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);if("color"===this.type)for(var s=On(o),u=On(a),l=t;l<e;l++)i.emplace(l,s[0],s[1],u[0],u[1]);else{for(var p=t;p<e;p++)i.emplace(p,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},qn.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},qn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},qn.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},qn.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom))},qn.prototype.getBinding=function(t,e){return new Vn(t,e)};var Un=function(t,e,r,n,i,o,a){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};Un.prototype.defines=function(){return[]},Un.prototype.setConstantPatternPositions=function(){},Un.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,o=this.layerId,a=n.length;if(n.reserve(t),i.reserve(t),r&&e.patterns&&e.patterns[o]){var s=e.patterns[o],u=s.min,l=s.mid,p=s.max,c=r[u],h=r[l],f=r[p];if(!c||!h||!f)return;for(var y=a;y<t;y++)n.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1]),i.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},Un.prototype.updatePaintArray=function(t,e,r,n,i){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&r.patterns&&r.patterns[s]){var u=r.patterns[s],l=u.min,p=u.mid,c=u.max,h=i[l],f=i[p],y=i[c];if(!h||!f||!y)return;for(var d=t;d<e;d++)o.emplace(d,f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),a.emplace(d,f.tl[0],f.tl[1],f.br[0],f.br[1],y.tl[0],y.tl[1],y.br[0],y.br[1])}},Un.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Un.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Un.prototype.setUniforms=function(t,e){e.set(0)},Un.prototype.getBinding=function(t,e){return new Vn(t,e)};var Rn=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new Pn,this._bufferOffset=0};Rn.createDynamic=function(t,e,r){var n=new Rn,i=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof Vr&&re(a.property.specification)){var s=Zn(o,t.type),u=a.property.specification.type,l=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)n.binders[o]=new Dn(a.value.value,s,u),i.push("/u_"+o);else{var p=Jn(o,u,"source");n.binders[o]=new Un(a.value,s,u,l,e,p,t.id),i.push("/a_"+o)}else if("constant"===a.value.kind)n.binders[o]=new Ln(a.value.value,s,u),i.push("/u_"+o);else if("source"===a.value.kind){var c=Jn(o,u,"source");n.binders[o]=new jn(a.value,s,u,c),i.push("/a_"+o)}else{var h=Jn(o,u,"composite");n.binders[o]=new qn(a.value,s,u,l,e,h),i.push("/z_"+o)}}}return n.cacheKey=i.sort().join(""),n},Rn.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.binders){this.binders[o].populatePaintArray(t,e,n,i)}void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t},Rn.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){this.binders[r].setConstantPatternPositions(t,e)}},Rn.prototype.updatePaintArrays=function(t,e,r,n){var i=!1;for(var o in t)for(var a=0,s=this._featureMap.getPositions(+o);a<s.length;a+=1){var u=s[a],l=e.feature(u.index);for(var p in this.binders){var c=this.binders[p];if(!(c instanceof Ln||c instanceof Dn)&&!0===c.expression.isStateDependent){var h=r.paint.get(p);c.expression=h.value,c.updatePaintArray(u.start,u.end,l,t[o],n),i=!0}}}return i},Rn.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},Rn.prototype.getPaintVertexBuffers=function(){return this._buffers},Rn.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders)for(var i=this.binders[n],o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s]);r.push({name:s,property:n,binding:u})}}return r},Rn.prototype.setUniforms=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,u=a.property,l=a.binding;this.binders[u].setUniforms(t,l,n,r.get(u),s)}},Rn.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof Un){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&e.push(i)}else(n instanceof jn||n instanceof qn)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer)}this._buffers=e},Rn.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var n in this.binders){var i=this.binders[n];(i instanceof jn||i instanceof qn)&&i.paintVertexBuffer&&r.push(i.paintVertexBuffer)}this._buffers=r},Rn.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var Nn=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,o=e;i<o.length;i+=1){var a=o[i];this.programConfigurations[a.id]=Rn.createDynamic(a,r,n),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1};function Zn(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Jn(t,e,r){var n={color:{source:hn,composite:fn},number:{source:an,composite:hn}},i=function(t){return{"line-pattern":{source:Hr,composite:Hr},"fill-pattern":{source:Hr,composite:Hr},"fill-extrusion-pattern":{source:Hr,composite:Hr}}[t]}(t);return i&&i[r]||n[e][r]}Nn.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,r,n,i);this.needsUpload=!0},Nn.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,o=r;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,e,a,n)||this.needsUpload}},Nn.prototype.get=function(t){return this.programConfigurations[t]},Nn.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Nn.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},we("ConstantBinder",Ln),we("CrossFadedConstantBinder",Dn),we("SourceExpressionBinder",jn),we("CrossFadedCompositeBinder",Un),we("CompositeExpressionBinder",qn),we("ProgramConfiguration",Rn,{omit:["_buffers"]}),we("ProgramConfigurationSet",Nn);var Kn=8192;var Gn,Xn=(Gn=15,{min:-1*Math.pow(2,Gn-1),max:Math.pow(2,Gn-1)-1});function Yn(t){for(var e=Kn/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var o=r[n],a=0;a<o.length;a++){var s=o[a];s.x=Math.round(s.x*e),s.y=Math.round(s.y*e),(s.x<Xn.min||s.x>Xn.max||s.y<Xn.min||s.y>Xn.max)&&(f("Geometry exceeds allowed extent, reduce your vector tile buffer size"),s.x=i(s.x,Xn.min,Xn.max),s.y=i(s.y,Xn.min,Xn.max))}return r}function Hn(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Wn=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Kr,this.indexArray=new ln,this.segments=new In,this.programConfigurations=new Nn(zn,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function $n(t,e){for(var r=0;r<t.length;r++)if(si(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(si(t,e[n]))return!0;return!!ri(t,e)}function Qn(t,e,r){return!!si(t,e)||!!ii(e,t,r)}function ti(t,e){if(1===t.length)return ai(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(si(t,n[i]))return!0;for(var o=0;o<t.length;o++)if(ai(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(ri(t,e[a]))return!0;return!1}function ei(t,e,r){if(t.length>1){if(ri(t,e))return!0;for(var n=0;n<e.length;n++)if(ii(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(ii(t[i],e,r))return!0;return!1}function ri(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],o=0;o<e.length-1;o++){if(ni(n,i,e[o],e[o+1]))return!0}return!1}function ni(t,e,r,n){return y(t,r,n)!==y(e,r,n)&&y(t,e,r)!==y(t,e,n)}function ii(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++){if(oi(t,e[i-1],e[i])<n)return!0}return!1}function oi(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function ai(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)n=r[s],i=r[u],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function si(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ui(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var o=y(t,e,r[0]);return o!==y(t,e,r[1])||o!==y(t,e,r[2])||o!==y(t,e,r[3])}function li(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function pi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ci(t,e,n,i,o){if(!e[0]&&!e[1])return t;var a=r.convert(e)._mult(o);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u<t.length;u++){var l=t[u];s.push(l.sub(a))}return s}Wn.prototype.populate=function(t,e){var r=this.layers[0],n=[],i=null;"circle"===r.type&&(i=r.layout.get("circle-sort-key"));for(var o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.index,p=s.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ar(this.zoom),u)){var c=Yn(u),h=i?i.evaluate(u,{}):void 0,f={id:u.id,properties:u.properties,type:u.type,sourceLayerIndex:p,index:l,geometry:c,patterns:{},sortKey:h};n.push(f)}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,d=n;y<d.length;y+=1){var m=d[y],v=m,g=v.geometry,x=v.index,b=v.sourceLayerIndex,_=t[x].feature;this.addFeature(m,g,x),e.featureIndex.insert(_,g,x,b,this.index)}},Wn.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Wn.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Wn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Wn.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Wn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Wn.prototype.addFeature=function(t,e,r){for(var n=0,i=e;n<i.length;n+=1)for(var o=0,a=i[n];o<a.length;o+=1){var s=a[o],u=s.x,l=s.y;if(!(u<0||u>=Kn||l<0||l>=Kn)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;Hn(this.layoutVertexArray,u,l,-1,-1),Hn(this.layoutVertexArray,u,l,1,-1),Hn(this.layoutVertexArray,u,l,1,1),Hn(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},we("CircleBucket",Wn,{omit:["layers"]});var hi=new jr({"circle-sort-key":new Fr(Me.layout_circle["circle-sort-key"])}),fi={paint:new jr({"circle-radius":new Fr(Me.paint_circle["circle-radius"]),"circle-color":new Fr(Me.paint_circle["circle-color"]),"circle-blur":new Fr(Me.paint_circle["circle-blur"]),"circle-opacity":new Fr(Me.paint_circle["circle-opacity"]),"circle-translate":new Er(Me.paint_circle["circle-translate"]),"circle-translate-anchor":new Er(Me.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Er(Me.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Er(Me.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Fr(Me.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Fr(Me.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Fr(Me.paint_circle["circle-stroke-opacity"])}),layout:hi},yi="undefined"!=typeof Float32Array?Float32Array:Array;function di(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});mi=new yi(4),yi!=Float32Array&&(mi[0]=0,mi[1]=0,mi[2]=0,mi[3]=0),vi=mi;var mi,vi,gi=function(t){function e(e){t.call(this,e,fi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Wn(t)},e.prototype.queryRadius=function(t){var e=t;return li("circle-radius",this,e)+li("circle-stroke-width",this,e)+pi(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=ci(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return xi(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;f<y.length;f+=1)for(var d=0,m=y[f];d<m.length;d+=1){var v=m[d],g=p?v:xi(v,s),x=h,b=di([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=o.cameraToCenterDistance/b[3]),Qn(c,g,x))return!0}return!1},e}(qr);function xi(t,e){var n=di([],[t.x,t.y,0,1],e);return new r(n[0]/n[3],n[1]/n[3])}var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Wn);function _i(t,e,r,n){var i=e.width,o=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*o*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*o*r);return t.width=i,t.height=o,t.data=n,t}function wi(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=_i({},{width:n,height:i},r);ki(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=o.data}}function ki(t,e,r,n,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((r.y+u)*t.width+r.x)*o,p=((n.y+u)*e.width+n.x)*o,c=0;c<i.width*o;c++)s[p+c]=a[l+c];return e}we("HeatmapBucket",bi,{omit:["layers"]});var Si=function(t,e){_i(this,t,1,e)};Si.prototype.resize=function(t){wi(this,t,1)},Si.prototype.clone=function(){return new Si({width:this.width,height:this.height},new Uint8Array(this.data))},Si.copy=function(t,e,r,n,i){ki(t,e,r,n,i,1)};var Ai=function(t,e){_i(this,t,4,e)};Ai.prototype.resize=function(t){wi(this,t,4)},Ai.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Ai.prototype.clone=function(){return new Ai({width:this.width,height:this.height},new Uint8Array(this.data))},Ai.copy=function(t,e,r,n,i){ki(t,e,r,n,i,4)},we("AlphaImage",Si),we("RGBAImage",Ai);var zi={paint:new jr({"heatmap-radius":new Fr(Me.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Fr(Me.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Er(Me.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Dr(Me.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Er(Me.paint_heatmap["heatmap-opacity"])})};function Ii(t,e){for(var r=new Uint8Array(1024),n={},i=0,o=0;i<256;i++,o+=4){n[e]=i/255;var a=t.evaluate(n);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new Ai({width:256,height:1},r)}var Mi=function(t){function e(e){t.call(this,e,zi),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new bi(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Ii(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(qr),Pi={paint:new jr({"hillshade-illumination-direction":new Er(Me.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Er(Me.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Er(Me.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Er(Me.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Er(Me.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Er(Me.paint_hillshade["hillshade-accent-color"])})},Ci=function(t){function e(e){t.call(this,e,Pi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(qr),Bi=Zr([{name:"a_pos",components:2,type:"Int16"}],4).members,Vi=Ei,Ti=Ei;function Ei(t,e,r){r=r||2;var n,i,o,a,s,u,l,p=e&&e.length,c=p?e[0]*r:t.length,h=Fi(t,0,c,r,!0),f=[];if(!h||h.next===h.prev)return f;if(p&&(h=function(t,e,r,n){var i,o,a,s,u,l=[];for(i=0,o=e.length;i<o;i++)a=e[i]*n,s=i<o-1?e[i+1]*n:t.length,(u=Fi(t,a,s,n,!1))===u.next&&(u.steiner=!0),l.push(Ki(u));for(l.sort(Ri),i=0;i<l.length;i++)Ni(l[i],r),r=Oi(r,r.next);return r}(t,e,h,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var y=r;y<c;y+=r)(s=t[y])<n&&(n=s),(u=t[y+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return Li(h,f,r,n,i,l),f}function Fi(t,e,r,n,i){var o,a;if(i===oo(t,e,r,n)>0)for(o=e;o<r;o+=n)a=ro(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=ro(o,t[o],t[o+1],a);return a&&Hi(a,a.next)&&(no(a),a=a.next),a}function Oi(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Hi(n,n.next)&&0!==Yi(n.prev,n,n.next))n=n.next;else{if(no(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Li(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ji(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ji(t,n,i,o):Di(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),no(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Li(t=qi(Oi(t),e,r),e,r,n,i,o,2):2===a&&Ui(t,e,r,n,i,o):Li(Oi(t),e,r,n,i,o,1);break}}}function Di(t){var e=t.prev,r=t,n=t.next;if(Yi(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Gi(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Yi(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ji(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Yi(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,p=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=Ji(s,u,e,r,n),h=Ji(l,p,e,r,n),f=t.prevZ,y=t.nextZ;f&&f.z>=c&&y&&y.z<=h;){if(f!==t.prev&&f!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Yi(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,y!==t.prev&&y!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&Yi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Yi(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&Yi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function qi(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Hi(i,o)&&Wi(i,n,n.next,o)&&to(i,o)&&to(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),no(n),no(n.next),n=t=o),n=n.next}while(n!==t);return Oi(n)}function Ui(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Xi(a,s)){var u=eo(a,s);return a=Oi(a,a.next),u=Oi(u,u.next),Li(a,e,r,n,i,o),void Li(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Ri(t,e){return t.x-e.x}function Ni(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var u,l=r,p=r.x,c=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=p&&i!==n.x&&Gi(o<c?i:a,o,p,c,o<c?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),to(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Zi(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=eo(e,t);Oi(r,r.next)}}function Zi(t,e){return Yi(t.prev,t,e.prev)<0&&Yi(e.next,t,t.next)<0}function Ji(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ki(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Gi(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Xi(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Wi(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(to(t,e)&&to(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Yi(t.prev,t,e.prev)||Yi(t,e.prev,e))||Hi(t,e)&&Yi(t.prev,t,t.next)>0&&Yi(e.prev,e,e.next)>0)}function Yi(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Hi(t,e){return t.x===e.x&&t.y===e.y}function Wi(t,e,r,n){var i=Qi(Yi(t,e,r)),o=Qi(Yi(t,e,n)),a=Qi(Yi(r,n,t)),s=Qi(Yi(r,n,e));return i!==o&&a!==s||(!(0!==i||!$i(t,r,e))||(!(0!==o||!$i(t,n,e))||(!(0!==a||!$i(r,t,n))||!(0!==s||!$i(r,e,n)))))}function $i(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Qi(t){return t>0?1:t<0?-1:0}function to(t,e){return Yi(t.prev,t,t.next)<0?Yi(t,e,t.next)>=0&&Yi(t,t.prev,e)>=0:Yi(t,e,t.prev)<0||Yi(t,t.next,e)<0}function eo(t,e){var r=new io(t.i,t.x,t.y),n=new io(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function ro(t,e,r,n){var i=new io(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function no(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function io(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function oo(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function ao(t,e,r,n,i){!function t(e,r,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1),c=Math.max(n,Math.floor(r-s*l/a+p)),h=Math.min(i,Math.floor(r+(a-s)*l/a+p));t(e,r,c,h,o)}var f=e[r],y=n,d=i;for(so(e,n,r),o(e[i],f)>0&&so(e,n,i);y<d;){for(so(e,y,d),y++,d--;o(e[y],f)<0;)y++;for(;o(e[d],f)>0;)d--}0===o(e[n],f)?so(e,n,d):so(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}(t,e,r||0,n||t.length-1,i||uo)}function so(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function uo(t,e){return t<e?-1:t>e?1:0}function lo(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=d(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&o.push(n),n=[t[a]]):n.push(t[a]))}if(n&&o.push(n),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(ao(o[u],e,1,o[u].length-1,po),o[u]=o[u].slice(0,e));return o}function po(t,e){return e.area-t.area}function co(t,e,r){for(var n=r.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0)}return i}function ho(t,e,r,n,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:n-1},r,{}),c=l.evaluate({zoom:n},r,{}),h=l.evaluate({zoom:n+1},r,{});o[p]=!0,o[c]=!0,o[h]=!0,r.patterns[u.id]={min:p,mid:c,max:h}}}return r}Ei.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(oo(t,0,o,r));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*r,p=s<u-1?e[s+1]*r:t.length;a-=Math.abs(oo(t,l,p,r))}var c=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,f=n[s+1]*r,y=n[s+2]*r;c+=Math.abs((t[h]-t[y])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[y+1]-t[h+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},Ei.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r},Vi.default=Ti;var fo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Kr,this.indexArray=new ln,this.indexArray2=new pn,this.programConfigurations=new Nn(Bi,t.layers,t.zoom),this.segments=new In,this.segments2=new In,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};fo.prototype.populate=function(t,e){this.hasPattern=co("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,l=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ar(this.zoom),s)){var p=Yn(s),c=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:l,index:u,geometry:p,patterns:{},sortKey:c};n.push(h)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var f=0,y=n;f<y.length;f+=1){var d=y[f],m=d,v=m.geometry,g=m.index,x=m.sourceLayerIndex;if(this.hasPattern){var b=ho("fill",this.layers,d,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(d,v,g,{});var _=t[g].feature;e.featureIndex.insert(_,v,g,x,this.index)}},fo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},fo.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},fo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},fo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Bi),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},fo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},fo.prototype.addFeature=function(t,e,r,n){for(var i=0,o=lo(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,l=a;u<l.length;u+=1){s+=l[u].length}for(var p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),c=p.vertexLength,h=[],f=[],y=0,d=a;y<d.length;y+=1){var m=d[y];if(0!==m.length){m!==a[0]&&f.push(h.length/2);var v=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),g=v.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(g+m.length-1,g),h.push(m[0].x),h.push(m[0].y);for(var x=1;x<m.length;x++)this.layoutVertexArray.emplaceBack(m[x].x,m[x].y),this.indexArray2.emplaceBack(g+x-1,g+x),h.push(m[x].x),h.push(m[x].y);v.vertexLength+=m.length,v.primitiveLength+=m.length}}for(var b=Vi(h,f),_=0;_<b.length;_+=3)this.indexArray.emplaceBack(c+b[_],c+b[_+1],c+b[_+2]);p.vertexLength+=s,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},we("FillBucket",fo,{omit:["layers","patternFeatures"]});var yo=new jr({"fill-sort-key":new Fr(Me.layout_fill["fill-sort-key"])}),mo={paint:new jr({"fill-antialias":new Er(Me.paint_fill["fill-antialias"]),"fill-opacity":new Fr(Me.paint_fill["fill-opacity"]),"fill-color":new Fr(Me.paint_fill["fill-color"]),"fill-outline-color":new Fr(Me.paint_fill["fill-outline-color"]),"fill-translate":new Er(Me.paint_fill["fill-translate"]),"fill-translate-anchor":new Er(Me.paint_fill["fill-translate-anchor"]),"fill-pattern":new Or(Me.paint_fill["fill-pattern"])}),layout:yo},vo=function(t){function e(e){t.call(this,e,mo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new fo(t)},e.prototype.queryRadius=function(){return pi(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return ti(ci(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e.prototype.isTileClipped=function(){return!0},e}(qr),go=Zr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,xo=bo;function bo(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(_o,this,e)}function _o(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function wo(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],n+=((r=t[a]).x-e.x)*(e.y+r.y);return n}bo.types=["Unknown","Point","LineString","Polygon"],bo.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,u=[];t.pos<n;){if(o<=0){var l=t.readVarint();i=7&l,o=l>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},bo.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},bo.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=bo.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/o;t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(n=0;n<u.length;n++)c[n]=u[n][0];p(u=c);break;case 2:for(n=0;n<u.length;n++)p(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=wo(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}r&&i.push(r);return i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)p(u[n][i])}1===u.length?u=u[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(h.id=this.id),h};var ko=So;function So(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ao,this,e),this.length=this._features.length}function Ao(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function zo(t,e,r){if(3===t){var n=new ko(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}So.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new xo(this._pbf,e,this.extent,this._keys,this._values)};var Io={VectorTile:function(t,e){this.layers=t.readFields(zo,{},e)},VectorTileFeature:xo,VectorTileLayer:ko},Mo=Io.VectorTileFeature.types,Po=Math.pow(2,13);function Co(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*Po)+a,i*Po*2,o*Po*2,Math.round(s))}var Bo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Xr,this.indexArray=new ln,this.programConfigurations=new Nn(go,t.layers,t.zoom),this.segments=new In,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Vo(t,e){return t.x===e.x&&(t.x<0||t.x>Kn)||t.y===e.y&&(t.y<0||t.y>Kn)}function To(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>Kn}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>Kn}))}Bo.prototype.populate=function(t,e){this.features=[],this.hasPattern=co("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ar(this.zoom),o)){var u=Yn(o),l={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(l.id=o.id),this.hasPattern?this.features.push(ho("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index,!0)}}},Bo.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],o=i.geometry;this.addFeature(i,o,i.index,e)}},Bo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Bo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Bo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Bo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,go),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Bo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Bo.prototype.addFeature=function(t,e,r,n){for(var i=0,o=lo(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,l=a;u<l.length;u+=1){s+=l[u].length}for(var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=0,h=a;c<h.length;c+=1){var f=h[c];if(0!==f.length&&!To(f))for(var y=0,d=0;d<f.length;d++){var m=f[d];if(d>=1){var v=f[d-1];if(!Vo(m,v)){p.vertexLength+4>In.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=m.sub(v)._perp()._unit(),x=v.dist(m);y+x>32768&&(y=0),Co(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,y),Co(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,y),y+=x,Co(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,y),Co(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,y);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+s>In.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Mo[t.type]){for(var _=[],w=[],k=p.vertexLength,S=0,A=a;S<A.length;S+=1){var z=A[S];if(0!==z.length){z!==a[0]&&w.push(_.length/2);for(var I=0;I<z.length;I++){var M=z[I];Co(this.layoutVertexArray,M.x,M.y,0,0,1,1,0),_.push(M.x),_.push(M.y)}}}for(var P=Vi(_,w),C=0;C<P.length;C+=3)this.indexArray.emplaceBack(k+P[C],k+P[C+2],k+P[C+1]);p.primitiveLength+=P.length/3,p.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},we("FillExtrusionBucket",Bo,{omit:["layers","features"]});var Eo={paint:new jr({"fill-extrusion-opacity":new Er(Me["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Fr(Me["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Er(Me["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Er(Me["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Or(Me["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Fr(Me["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Fr(Me["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Er(Me["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Fo=function(t){function e(e){t.call(this,e,Eo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Bo(t)},e.prototype.queryRadius=function(){return pi(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s,u){var l=ci(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(e,n),c=this.paint.get("fill-extrusion-base").evaluate(e,n),h=function(t,e,n,i){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,i,1];di(l,l,e),o.push(new r(l[0]/l[3],l[1]/l[3]))}return o}(l,u,0,0),f=function(t,e,n,i){for(var o=[],a=[],s=i[8]*e,u=i[9]*e,l=i[10]*e,p=i[11]*e,c=i[8]*n,h=i[9]*n,f=i[10]*n,y=i[11]*n,d=0,m=t;d<m.length;d+=1){for(var v=m[d],g=[],x=[],b=0,_=v;b<_.length;b+=1){var w=_[b],k=w.x,S=w.y,A=i[0]*k+i[4]*S+i[12],z=i[1]*k+i[5]*S+i[13],I=i[2]*k+i[6]*S+i[14],M=i[3]*k+i[7]*S+i[15],P=I+l,C=M+p,B=A+c,V=z+h,T=I+f,E=M+y,F=new r((A+s)/C,(z+u)/C);F.z=P/C,g.push(F);var O=new r(B/E,V/E);O.z=T/E,x.push(O)}o.push(g),a.push(x)}return[o,a]}(i,c,p,u);return function(t,e,r){var n=1/0;ti(r,e)&&(n=Lo(r,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var u=o[s],l=o[s+1],p=a[s],c=a[s+1],h=[u,l,c,p,u];$n(r,h)&&(n=Math.min(n,Lo(r,h)))}return n!==1/0&&n}(f[0],f[1],h)},e}(qr);function Oo(t,e){return t.x*e.x+t.y*e.y}function Lo(t,e){if(1===t.length){var r=e[0],n=e[1],i=e[3],o=t[0],a=n.sub(r),s=i.sub(r),u=o.sub(r),l=Oo(a,a),p=Oo(a,s),c=Oo(s,s),h=Oo(u,a),f=Oo(u,s),y=l*c-p*p,d=(c*h-p*f)/y,m=(l*f-p*h)/y,v=1-d-m;return r.z*v+n.z*d+i.z*m}for(var g=1/0,x=0,b=e;x<b.length;x+=1){var _=b[x];g=Math.min(g,_.z)}return g}var Do=Zr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,jo=Io.VectorTileFeature.types,qo=Math.cos(Math.PI/180*37.5),Uo=Math.pow(2,14)/.5,Ro=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Yr,this.indexArray=new ln,this.programConfigurations=new Nn(Do,t.layers,t.zoom),this.segments=new In,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ro.prototype.populate=function(t,e){this.hasPattern=co("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),n=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,l=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ar(this.zoom),s)){var p=Yn(s),c=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:l,index:u,geometry:p,patterns:{},sortKey:c};n.push(h)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var f=0,y=n;f<y.length;f+=1){var d=y[f],m=d,v=m.geometry,g=m.index,x=m.sourceLayerIndex;if(this.hasPattern){var b=ho("line",this.layers,d,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(d,v,g,{});var _=t[g].feature;e.featureIndex.insert(_,v,g,x,this.index)}},Ro.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ro.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},Ro.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ro.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ro.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Do),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ro.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ro.prototype.addFeature=function(t,e,r,n){for(var i=this.layers[0].layout,o=i.get("line-join").evaluate(t,{}),a=i.get("line-cap"),s=i.get("line-miter-limit"),u=i.get("line-round-limit"),l=0,p=e;l<p.length;l+=1){var c=p[l];this.addLine(c,t,o,a,s,u,r,n)}},Ro.prototype.addLine=function(t,e,r,n,i,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var u=0;u<t.length-1;u++)this.totalDistance+=t[u].dist(t[u+1])}for(var l="Polygon"===jo[e.type],p=t.length;p>=2&&t[p-1].equals(t[p-2]);)p--;for(var c=0;c<p-1&&t[c].equals(t[c+1]);)c++;if(!(p<(l?3:2))){"bevel"===r&&(i=1.05);var h,f=Kn/(512*this.overscaling)*15,y=this.segments.prepareSegment(10*p,this.layoutVertexArray,this.indexArray),d=void 0,m=void 0,v=void 0,g=void 0;this.e1=this.e2=-1,l&&(h=t[p-2],g=t[c].sub(h)._unit()._perp());for(var x=c;x<p;x++)if(!(m=l&&x===p-1?t[c+1]:t[x+1])||!t[x].equals(m)){g&&(v=g),h&&(d=h),h=t[x],g=m?m.sub(h)._unit()._perp():v;var b=(v=v||g).add(g);0===b.x&&0===b.y||b._unit();var _=v.x*g.x+v.y*g.y,w=b.x*g.x+b.y*g.y,k=0!==w?1/w:1/0,S=2*Math.sqrt(2-2*w),A=w<qo&&d&&m,z=v.x*g.y-v.y*g.x>0;if(A&&x>c){var I=h.dist(d);if(I>2*f){var M=h.sub(h.sub(d)._mult(f/I)._round());this.updateDistance(d,M),this.addCurrentVertex(M,v,0,0,y),d=M}}var P=d&&m,C=P?r:l?"butt":n;if(P&&"round"===C&&(k<o?C="miter":k<=2&&(C="fakeround")),"miter"===C&&k>i&&(C="bevel"),"bevel"===C&&(k>2&&(C="flipbevel"),k<i&&(C="miter")),d&&this.updateDistance(d,h),"miter"===C)b._mult(k),this.addCurrentVertex(h,b,0,0,y);else if("flipbevel"===C){if(k>100)b=g.mult(-1);else{var B=k*v.add(g).mag()/v.sub(g).mag();b._perp()._mult(B*(z?-1:1))}this.addCurrentVertex(h,b,0,0,y),this.addCurrentVertex(h,b.mult(-1),0,0,y)}else if("bevel"===C||"fakeround"===C){var V=-Math.sqrt(k*k-1),T=z?V:0,E=z?0:V;if(d&&this.addCurrentVertex(h,v,T,E,y),"fakeround"===C)for(var F=Math.round(180*S/Math.PI/20),O=1;O<F;O++){var L=O/F;if(.5!==L){var D=L-.5;L+=L*D*(L-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*D*D+(.848013+_*(.215638*_-1.06021)))}var j=g.sub(v)._mult(L)._add(v)._unit()._mult(z?-1:1);this.addHalfVertex(h,j.x,j.y,!1,z,0,y)}m&&this.addCurrentVertex(h,g,-T,-E,y)}else if("butt"===C)this.addCurrentVertex(h,b,0,0,y);else if("square"===C){var q=d?1:-1;this.addCurrentVertex(h,b,q,q,y)}else"round"===C&&(d&&(this.addCurrentVertex(h,v,0,0,y),this.addCurrentVertex(h,v,1,1,y,!0)),m&&(this.addCurrentVertex(h,g,-1,-1,y,!0),this.addCurrentVertex(h,g,0,0,y)));if(A&&x<p-1){var U=h.dist(m);if(U>2*f){var R=h.add(m.sub(h)._mult(f/U)._round());this.updateDistance(h,R),this.addCurrentVertex(R,g,0,0,y),h=R}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},Ro.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,l=-e.y-e.x*n;this.addHalfVertex(t,a,s,o,!1,r,i),this.addHalfVertex(t,u,l,o,!0,-n,i),this.distance>Uo/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Ro.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=t.x,u=t.y,l=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6);var p=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),a.primitiveLength++),i?this.e2=p:this.e1=p},Ro.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Uo-1):this.distance},we("LineBucket",Ro,{omit:["layers","patternFeatures"]});var No=new jr({"line-cap":new Er(Me.layout_line["line-cap"]),"line-join":new Fr(Me.layout_line["line-join"]),"line-miter-limit":new Er(Me.layout_line["line-miter-limit"]),"line-round-limit":new Er(Me.layout_line["line-round-limit"]),"line-sort-key":new Fr(Me.layout_line["line-sort-key"])}),Zo={paint:new jr({"line-opacity":new Fr(Me.paint_line["line-opacity"]),"line-color":new Fr(Me.paint_line["line-color"]),"line-translate":new Er(Me.paint_line["line-translate"]),"line-translate-anchor":new Er(Me.paint_line["line-translate-anchor"]),"line-width":new Fr(Me.paint_line["line-width"]),"line-gap-width":new Fr(Me.paint_line["line-gap-width"]),"line-offset":new Fr(Me.paint_line["line-offset"]),"line-blur":new Fr(Me.paint_line["line-blur"]),"line-dasharray":new Lr(Me.paint_line["line-dasharray"]),"line-pattern":new Or(Me.paint_line["line-pattern"]),"line-gradient":new Dr(Me.paint_line["line-gradient"])}),layout:No},Jo=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Ar(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=a({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Fr))(Zo.paint.properties["line-width"].specification);Jo.useIntegerZoom=!0;var Ko=function(t){function e(e){t.call(this,e,Zo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Ii(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Jo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ro(t)},e.prototype.queryRadius=function(t){var e=t,r=Go(li("line-width",this,e),li("line-gap-width",this,e)),n=li("line-offset",this,e);return r/2+Math.abs(n)+pi(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=ci(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Go(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),p=this.paint.get("line-offset").evaluate(e,n);return p&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u-1],p=a[u],c=a[u+1],h=0===u?i:p.sub(l)._unit()._perp(),f=u===a.length-1?i:c.sub(p)._unit()._perp(),y=h._add(f)._unit(),d=y.x*f.x+y.y*f.y;y._mult(1/d),s.push(y._mult(e)._add(p))}n.push(s)}return n}(i,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var o=0;o<i.length;o++)if(si(t,i[o]))return!0;if(ei(t,i,r))return!0}return!1}(u,i,l)},e.prototype.isTileClipped=function(){return!0},e}(qr);function Go(t,e){return e>0?e+2*t:t}var Xo=Zr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),Yo=Zr([{name:"a_projected_pos",components:3,type:"Float32"}],4),Ho=(Zr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Zr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Wo=(Zr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Zr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),$o=Zr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Zr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"}]),Zr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),Zr([{type:"Float32",name:"offsetX"}]),Zr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Qo(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Sr.applyArabicShaping&&(t=Sr.applyArabicShaping(t)),t}(t.text,e,r)})),t}var ta={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ea=24,ra={horizontal:1,vertical:2,horizontalOnly:3},na=function(){this.text="",this.sectionIndex=[],this.sections=[]};function ia(t,e,r,n,i,o,a,s,u,l,p){var c,h=na.fromFeature(t,r);l===ra.vertical&&h.verticalizePunctuation();var f=Sr.processBidirectionalText,y=Sr.processStyledBidirectionalText;if(f&&1===h.sections.length){c=[];for(var d=0,m=f(h.toString(),pa(h,s,n,e));d<m.length;d+=1){var v=m[d],g=new na;g.text=v,g.sections=h.sections;for(var x=0;x<v.length;x++)g.sectionIndex.push(0);c.push(g)}}else if(y){c=[];for(var b=0,_=y(h.text,h.sectionIndex,pa(h,s,n,e));b<_.length;b+=1){var w=_[b],k=new na;k.text=w[0],k.sectionIndex=w[1],k.sections=h.sections,c.push(k)}}else c=function(t,e){for(var r=[],n=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(h,pa(h,s,n,e));var S=[],A={positionedGlyphs:S,text:h.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:l,lineCount:c.length,yOffset:-17};return function(t,e,r,n,i,o,a,s,u){for(var l=0,p=t.yOffset,c=0,h=t.positionedGlyphs,f="right"===o?1:"left"===o?0:.5,y=0,d=r;y<d.length;y+=1){var m=d[y];m.trim();var v=m.getMaxScale();if(m.length()){for(var g=h.length,x=0;x<m.length();x++){var b=m.getSection(x),_=m.getSectionIndex(x),w=m.getCharCode(x),k=24*(v-b.scale),S=e[b.fontStack],A=S&&S[w];A&&(a===ra.horizontal||!u&&!_r(w)||u&&(oa[w]||(I=w,gr.Arabic(I)||gr["Arabic Supplement"](I)||gr["Arabic Extended-A"](I)||gr["Arabic Presentation Forms-A"](I)||gr["Arabic Presentation Forms-B"](I)))?(h.push({glyph:w,x:l,y:p+k,vertical:!1,scale:b.scale,fontStack:b.fontStack,sectionIndex:_}),l+=A.metrics.advance*b.scale+s):(h.push({glyph:w,x:l,y:p+k,vertical:!0,scale:b.scale,fontStack:b.fontStack,sectionIndex:_}),l+=ea*b.scale+s))}if(h.length!==g){var z=l-s;c=Math.max(z,c),ha(h,e,g,h.length-1,f)}l=0,p+=n*v}else p+=n}var I;var M=ca(i),P=M.horizontalAlign,C=M.verticalAlign;!function(t,e,r,n,i,o,a){for(var s=(e-r)*i,u=(-n*a+.5)*o,l=0;l<t.length;l++)t[l].x+=s,t[l].y+=u}(h,f,P,C,c,n,r.length);var B=p-t.yOffset;t.top+=-C*B,t.bottom=t.top+B,t.left+=-P*c,t.right=t.left+c}(A,e,c,i,o,a,l,s,p),!!S.length&&A}na.fromFeature=function(t,e){for(var r=new na,n=0;n<t.sections.length;n++){var i=t.sections[n];r.sections.push({scale:i.scale||1,fontStack:i.fontStack||e}),r.text+=i.text;for(var o=0;o<i.text.length;o++)r.sectionIndex.push(n)}return r},na.prototype.length=function(){return this.text.length},na.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},na.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},na.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},na.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!wr(n)||ta[t[r+1]])&&(!i||!wr(i)||ta[t[r-1]])&&ta[t[r]]?e+=ta[t[r]]:e+=t[r]}return e}(this.text)},na.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&oa[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&oa[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},na.prototype.substring=function(t,e){var r=new na;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},na.prototype.toString=function(){return this.text},na.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)};var oa={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},aa={};function sa(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function ua(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function la(t,e,r,n,i,o){for(var a=null,s=sa(e,r,i,o),u=0,l=n;u<l.length;u+=1){var p=l[u],c=sa(e-p.x,r,i,o)+p.badness;c<=s&&(a=p,s=c)}return{index:t,x:e,priorBreak:a,badness:s}}function pa(t,e,r,n){if(!r)return[];if(!t)return[];for(var i,o=[],a=function(t,e,r,n){for(var i=0,o=0;o<t.length();o++){var a=t.getSection(o),s=n[a.fontStack],u=s&&s[t.getCharCode(o)];u&&(i+=u.metrics.advance*a.scale+e)}return i/Math.max(1,Math.ceil(i/r))}(t,e,r,n),s=t.text.indexOf("")>=0,u=0,l=0;l<t.length();l++){var p=t.getSection(l),c=t.getCharCode(l),h=n[p.fontStack],f=h&&h[c];if(f&&!oa[c]&&(u+=f.metrics.advance*p.scale+e),l<t.length()-1){var y=!!(!((i=c)<11904)&&(gr["Bopomofo Extended"](i)||gr.Bopomofo(i)||gr["CJK Compatibility Forms"](i)||gr["CJK Compatibility Ideographs"](i)||gr["CJK Compatibility"](i)||gr["CJK Radicals Supplement"](i)||gr["CJK Strokes"](i)||gr["CJK Symbols and Punctuation"](i)||gr["CJK Unified Ideographs Extension A"](i)||gr["CJK Unified Ideographs"](i)||gr["Enclosed CJK Letters and Months"](i)||gr["Halfwidth and Fullwidth Forms"](i)||gr.Hiragana(i)||gr["Ideographic Description Characters"](i)||gr["Kangxi Radicals"](i)||gr["Katakana Phonetic Extensions"](i)||gr.Katakana(i)||gr["Vertical Forms"](i)||gr["Yi Radicals"](i)||gr["Yi Syllables"](i)));(aa[c]||y)&&o.push(la(l+1,u,a,o,ua(c,t.getCharCode(l+1),y&&s),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(la(t.length(),u,a,o,0,!0))}function ca(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function ha(t,e,r,n,i){if(i){var o=t[n],a=e[o.fontStack],s=a&&a[o.glyph];if(s)for(var u=s.metrics.advance*o.scale,l=(t[n].x+u)*i,p=r;p<=n;p++)t[p].x-=l}}aa[10]=!0,aa[32]=!0,aa[38]=!0,aa[40]=!0,aa[41]=!0,aa[43]=!0,aa[45]=!0,aa[47]=!0,aa[173]=!0,aa[183]=!0,aa[8203]=!0,aa[8208]=!0,aa[8211]=!0,aa[8231]=!0;var fa=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(r);we("Anchor",fa);var ya=256;function da(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Ar(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,o=0;o<n.length&&n[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var s=n[o],u=n[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new Ar(s)),maxSize:r.evaluate(new Ar(u)),interpolationType:i}}var ma=Io.VectorTileFeature.types,va=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ga(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),o,a,s?s[0]:0,s?s[1]:0)}function xa(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}var ba=function(t){this.layoutVertexArray=new Wr,this.indexArray=new ln,this.programConfigurations=t,this.segments=new In,this.dynamicLayoutVertexArray=new $r,this.opacityVertexArray=new Qr,this.placedSymbolArray=new vn};ba.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Xo.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Yo.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,va,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t)},ba.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},we("SymbolBuffers",ba);var _a=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new In,this.collisionVertexArray=new rn};_a.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Ho.members,!0)},_a.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},we("CollisionBuffers",_a);var wa=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=da(this.zoom,e["text-size"]),this.iconSizeData=da(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var o="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return ra[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};wa.prototype.createArrays=function(){var t=this.layers[0].layout;this.hasPaintOverrides=za.hasPaintOverrides(t),this.text=new ba(new Nn(Xo.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new ba(new Nn(Xo.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.collisionBox=new _a(en,Wo.members,pn),this.collisionCircle=new _a(en,$o.members,ln),this.glyphOffsetArray=new _n,this.lineVertexArray=new kn,this.symbolInstances=new xn},wa.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||n)&&i){var a=ta[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},wa.prototype.populate=function(t,e){var r=this.layers[0],n=r.layout,i=n.get("text-font"),o=n.get("text-field"),a=n.get("icon-image"),s=("constant"!==o.value.kind||o.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==a.value.kind||a.value.value&&a.value.value.length>0,l=n.get("symbol-sort-key");if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,h=new Ar(this.zoom),f=0,y=t;f<y.length;f+=1){var d=y[f],m=d.feature,v=d.index,g=d.sourceLayerIndex;if(r._featureFilter(h,m)){var x=void 0;if(s){var b=r.getValueAndResolveTokens("text-field",m);x=Qo(b instanceof R?b:R.fromString(b),r,m)}var _=void 0;if(u&&(_=r.getValueAndResolveTokens("icon-image",m)),x||_){var w=this.sortFeaturesByKey?l.evaluate(m,{}):void 0,k={text:x,icon:_,index:v,sourceLayerIndex:g,geometry:Yn(m),properties:m.properties,type:ma[m.type],sortKey:w};if(void 0!==m.id&&(k.id=m.id),this.features.push(k),_&&(p[_]=!0),x){var S=i.evaluate(m,{}).join(","),A="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ra.vertical)>=0;for(var z=0,I=x.sections;z<I.length;z+=1){var M=I[z],P=xr(x.toString()),C=M.fontStack||S,B=c[C]=c[C]||{};this.calculateGlyphDependencies(M.text,B,A,this.allowVerticalPlacement,P)}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function o(e){n.push(t[e]),i++}function a(t,e,i){var o=r[t];return delete r[t],r[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(t,r,i){var o=e[r];return delete e[r],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,c),m=a(f,y,n[d].geometry);delete e[f],delete r[y],r[u(h,n[m].geometry,!0)]=m,n[d].geometry=null}else f in r?a(f,y,c):y in e?s(f,y,c):(o(l),e[f]=i-1,r[y]=i-1)}else o(l)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},wa.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},wa.prototype.isEmpty=function(){return 0===this.symbolInstances.length},wa.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},wa.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},wa.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},wa.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a<e.length-1&&(n+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},wa.prototype.addSymbols=function(t,e,r,n,i,o,a,s,u,l){var p=this,c=t.indexArray,h=t.layoutVertexArray,f=t.dynamicLayoutVertexArray,y=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,o.sortKey),d=this.glyphOffsetArray.length,m=y.vertexLength,v=this.allowVerticalPlacement&&a===ra.vertical?Math.PI/2:0,g=function(t){var e=t.tl,n=t.tr,i=t.bl,o=t.br,a=t.tex,u=y.vertexLength,l=t.glyphOffset[1];ga(h,s.x,s.y,e.x,l+e.y,a.x,a.y,r),ga(h,s.x,s.y,n.x,l+n.y,a.x+a.w,a.y,r),ga(h,s.x,s.y,i.x,l+i.y,a.x,a.y+a.h,r),ga(h,s.x,s.y,o.x,l+o.y,a.x+a.w,a.y+a.h,r),xa(f,s,v),c.emplaceBack(u,u+1,u+2),c.emplaceBack(u+1,u+2,u+3),y.vertexLength+=4,y.primitiveLength+=2,p.glyphOffsetArray.emplaceBack(t.glyphOffset[0])};if(o.text&&o.text.sections){var x=o.text.sections;if(this.hasPaintOverrides){for(var b,_=function(e,r){void 0===b||b===e&&!r||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},x[b]),b=e},w=0,k=e;w<k.length;w+=1){var S=k[w];_(S.sectionIndex,!1),g(S)}_(b,!0)}else{for(var A=0,z=e;A<z.length;A+=1){g(z[A])}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},x[0])}}else{for(var I=0,M=e;I<M.length;I+=1){g(M[I])}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{})}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,u,l,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0)},wa.prototype._addCollisionDebugVertex=function(t,e,r,n,i,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(o.x),Math.round(o.y))},wa.prototype.addCollisionDebugVertices=function(t,e,n,i,o,a,s,u){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),p=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,a,f,y,new r(t,e)),this._addCollisionDebugVertex(c,h,a,f,y,new r(n,e)),this._addCollisionDebugVertex(c,h,a,f,y,new r(n,i)),this._addCollisionDebugVertex(c,h,a,f,y,new r(t,i)),l.vertexLength+=4,u){var d=o.indexArray;d.emplaceBack(p,p+1,p+2),d.emplaceBack(p,p+2,p+3),l.primitiveLength+=2}else{var m=o.indexArray;m.emplaceBack(p,p+1),m.emplaceBack(p+1,p+2),m.emplaceBack(p+2,p+3),m.emplaceBack(p+3,p),l.primitiveLength+=4}},wa.prototype.addDebugCollisionBoxes=function(t,e,r){for(var n=t;n<e;n++){var i=this.collisionBoxArray.get(n),o=i.x1,a=i.y1,s=i.x2,u=i.y2,l=i.radius>0;this.addCollisionDebugVertices(o,a,s,u,l?this.collisionCircle:this.collisionBox,i.anchorPoint,r,l)}},wa.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e)}},wa.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,o,a){for(var s={},u=e;u<r;u++){var l=t.get(u);if(0===l.radius){s.textBox={x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,anchorPointX:l.anchorPointX,anchorPointY:l.anchorPointY},s.textFeatureIndex=l.featureIndex;break}s.textCircles||(s.textCircles=[],s.textFeatureIndex=l.featureIndex);s.textCircles.push(l.anchorPointX,l.anchorPointY,l.radius,l.signedDistanceFromAnchor,1)}for(var p=n;p<i;p++){var c=t.get(p);if(0===c.radius){s.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},s.verticalTextFeatureIndex=c.featureIndex;break}}for(var h=o;h<a;h++){var f=t.get(h);if(0===f.radius){s.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},s.iconFeatureIndex=f.featureIndex;break}}return s},wa.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex))}},wa.prototype.hasTextData=function(){return this.text.segments.get().length>0},wa.prototype.hasIconData=function(){return this.icon.segments.get().length>0},wa.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},wa.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},wa.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<r;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3)},wa.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),o},wa.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(o.verticalPlacedTextSymbolIndex);var a=this.icon.placedSymbolArray.get(i);if(a.numGlyphs){var s=a.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},we("SymbolBucket",wa,{omit:["layers","collisionBoxArray","features","compareText"]}),wa.MAX_GLYPHS=65535,wa.addDynamicAttributes=xa;var ka=new jr({"symbol-placement":new Er(Me.layout_symbol["symbol-placement"]),"symbol-spacing":new Er(Me.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Er(Me.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Fr(Me.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Er(Me.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Er(Me.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Er(Me.layout_symbol["icon-ignore-placement"]),"icon-optional":new Er(Me.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Er(Me.layout_symbol["icon-rotation-alignment"]),"icon-size":new Fr(Me.layout_symbol["icon-size"]),"icon-text-fit":new Er(Me.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Er(Me.layout_symbol["icon-text-fit-padding"]),"icon-image":new Fr(Me.layout_symbol["icon-image"]),"icon-rotate":new Fr(Me.layout_symbol["icon-rotate"]),"icon-padding":new Er(Me.layout_symbol["icon-padding"]),"icon-keep-upright":new Er(Me.layout_symbol["icon-keep-upright"]),"icon-offset":new Fr(Me.layout_symbol["icon-offset"]),"icon-anchor":new Fr(Me.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Er(Me.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Er(Me.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Er(Me.layout_symbol["text-rotation-alignment"]),"text-field":new Fr(Me.layout_symbol["text-field"]),"text-font":new Fr(Me.layout_symbol["text-font"]),"text-size":new Fr(Me.layout_symbol["text-size"]),"text-max-width":new Fr(Me.layout_symbol["text-max-width"]),"text-line-height":new Er(Me.layout_symbol["text-line-height"]),"text-letter-spacing":new Fr(Me.layout_symbol["text-letter-spacing"]),"text-justify":new Fr(Me.layout_symbol["text-justify"]),"text-radial-offset":new Fr(Me.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Er(Me.layout_symbol["text-variable-anchor"]),"text-anchor":new Fr(Me.layout_symbol["text-anchor"]),"text-max-angle":new Er(Me.layout_symbol["text-max-angle"]),"text-writing-mode":new Er(Me.layout_symbol["text-writing-mode"]),"text-rotate":new Fr(Me.layout_symbol["text-rotate"]),"text-padding":new Er(Me.layout_symbol["text-padding"]),"text-keep-upright":new Er(Me.layout_symbol["text-keep-upright"]),"text-transform":new Fr(Me.layout_symbol["text-transform"]),"text-offset":new Fr(Me.layout_symbol["text-offset"]),"text-allow-overlap":new Er(Me.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Er(Me.layout_symbol["text-ignore-placement"]),"text-optional":new Er(Me.layout_symbol["text-optional"])}),Sa={paint:new jr({"icon-opacity":new Fr(Me.paint_symbol["icon-opacity"]),"icon-color":new Fr(Me.paint_symbol["icon-color"]),"icon-halo-color":new Fr(Me.paint_symbol["icon-halo-color"]),"icon-halo-width":new Fr(Me.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Fr(Me.paint_symbol["icon-halo-blur"]),"icon-translate":new Er(Me.paint_symbol["icon-translate"]),"icon-translate-anchor":new Er(Me.paint_symbol["icon-translate-anchor"]),"text-opacity":new Fr(Me.paint_symbol["text-opacity"]),"text-color":new Fr(Me.paint_symbol["text-color"],{runtimeType:B,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Fr(Me.paint_symbol["text-halo-color"]),"text-halo-width":new Fr(Me.paint_symbol["text-halo-width"]),"text-halo-blur":new Fr(Me.paint_symbol["text-halo-blur"]),"text-translate":new Er(Me.paint_symbol["text-translate"]),"text-translate-anchor":new Er(Me.paint_symbol["text-translate-anchor"])}),layout:ka},Aa=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:I,this.defaultValue=t};Aa.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Aa.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Aa.prototype.possibleOutputs=function(){return[void 0]},Aa.prototype.serialize=function(){return null},we("FormatSectionOverride",Aa,{omit:["defaultValue"]});var za=function(t){function e(e){t.call(this,e,Sa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){if(t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],i=0,o=r;i<o.length;i+=1){var a=o[i];n.indexOf(a)<0&&n.push(a)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e){var r=this.layout.get(t).evaluate(e,{}),n=this._unevaluatedLayout._values[t];return n.isDataDriven()||ye(n.value)?r:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,r)},e.prototype.createBucket=function(t){return new wa(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Sa.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i=this.paint.get(n),o=new Aa(i),a=new fe(o,i.property.specification),s=null;s="constant"===i.value.kind||"source"===i.value.kind?new me("source",a):new ve("composite",a,i.value.zoomStops,i.value._interpolationType),this.paint._values[n]=new Vr(i.property,s,i.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=Sa.paint.properties[e],i=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1){var o=r[e];if(n.overrides&&n.overrides.hasOverride(o))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof R)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){if(!i)if(t instanceof K&&Z(t.value)===F){var e=t.value;o(e.sections)}else t instanceof H?o(t.sections):t.eachChild(a)},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e.hasPaintOverrides=function(t){for(var r=0,n=Sa.paint.overridableProperties;r<n.length;r+=1){var i=n[r];if(e.hasPaintOverride(t,i))return!0}return!1},e}(qr),Ia={paint:new jr({"background-color":new Er(Me.paint_background["background-color"]),"background-pattern":new Lr(Me.paint_background["background-pattern"]),"background-opacity":new Er(Me.paint_background["background-opacity"])})},Ma=function(t){function e(e){t.call(this,e,Ia)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(qr),Pa={paint:new jr({"raster-opacity":new Er(Me.paint_raster["raster-opacity"]),"raster-hue-rotate":new Er(Me.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Er(Me.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Er(Me.paint_raster["raster-brightness-max"]),"raster-saturation":new Er(Me.paint_raster["raster-saturation"]),"raster-contrast":new Er(Me.paint_raster["raster-contrast"]),"raster-resampling":new Er(Me.paint_raster["raster-resampling"]),"raster-fade-duration":new Er(Me.paint_raster["raster-fade-duration"])})},Ca=function(t){function e(e){t.call(this,e,Pa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(qr),Ba=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(qr),Va={circle:gi,heatmap:Mi,hillshade:Ci,fill:vo,"fill-extrusion":Fo,line:Ko,symbol:za,background:Ma,raster:Ca};function Ta(t){return"custom"===t.type?new Ba(t):new Va[t.type](t)}var Ea=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fa(t){var e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",n=0,i=t;n<i.length;n+=1){r+=Fa(i[n])+","}return r+"]"}for(var o=Object.keys(t).sort(),a="{",s=0;s<o.length;s++)a+=JSON.stringify(o[s])+":"+Fa(t[o[s]])+",";return a+"}"}function Oa(t){for(var e="",r=0,n=Ea;r<n.length;r+=1){e+="/"+Fa(t[n[r]])}return e}var La=function(t){this.keyCache={},t&&this.replace(t)};La.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},La.prototype.update=function(t,e){for(var r=this,n=0,i=t;n<i.length;n+=1){var a=i[n];this._layerConfigs[a.id]=a;var s=this._layers[a.id]=Ta(a);s._featureFilter=Re(s.filter),this.keyCache[a.id]&&delete this.keyCache[a.id]}for(var u=0,l=e;u<l.length;u+=1){var p=l[u];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var c=0,h=function(t,e){for(var r={},n=0;n<t.length;n++){var i=e&&e[t[n].id]||Oa(t[n]);e&&(e[t[n].id]=i);var o=r[i];o||(o=r[i]=[]),o.push(t[n])}var a=[];for(var s in r)a.push(r[s]);return a}(o(this._layerConfigs),this.keyCache);c<h.length;c+=1){var f=h[c].map((function(t){return r._layers[t.id]})),y=f[0];if("none"!==y.visibility){var d=y.source||"",m=this.familiesBySource[d];m||(m=this.familiesBySource[d]={});var v=y.sourceLayer||"_geojsonTileLayer",g=m[v];g||(g=m[v]=[]),g.push(f)}}};var Da,ja,qa={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ua={supported:!1,testSupport:function(t){if(Ra||!ja)return;Na?Za(t):Da=t}},Ra=!1,Na=!1;function Za(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,ja),t.isContextLost())return;Ua.supported=!0}catch(t){}t.deleteTexture(e),Ra=!0}self.document&&((ja=self.document.createElement("img")).onload=function(){Da&&Za(Da),Da=null,Na=!0},ja.onerror=function(){Ra=!0,Da=null},ja.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function Ja(t){return 0===t.indexOf("mapbox:")}var Ka=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Ga(t){return Ka.test(t)}var Xa=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/;function Ya(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(self.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var Ha=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Ha.prototype.getStorageKey=function(t){var e,r=Ya(qa.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n="",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},Ha.prototype.fetchEventData=function(){var t=v("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){f("Unable to read from LocalStorage")}},Ha.prototype.saveEventData=function(){var t=v("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){f("Unable to write to LocalStorage")}},Ha.prototype.processRequests=function(t){},Ha.prototype.postEvent=function(t,e,r,n){var i=this;if(qa.EVENTS_URL){var o=function(t){var e=t.match(Xa);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}(qa.EVENTS_URL);o.params.push("access_token="+(n||qa.ACCESS_TOKEN||""));var s,u,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.3.2",skuId:"01",userId:this.anonId},p=e?a(l,e):l,c={url:(s=o,u=s.params.length?"?"+s.params.join("&"):"",s.protocol+"://"+s.authority+s.path+u),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=hs(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},Ha.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Wa,$a=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(qa.EVENTS_URL&&n||qa.ACCESS_TOKEN&&t.some((function(t){return Ja(t)||Ga(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),u(this.anonId)||(this.anonId=s()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(Ha),Qa=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){qa.EVENTS_URL&&qa.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Ja(t)||Ga(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Ya(qa.ACCESS_TOKEN),n=r?r.u:qa.ACCESS_TOKEN,i=n!==this.eventData.tokenU;u(this.anonId)||(this.anonId=s(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),l=new Date(o),p=(o-this.eventData.lastSuccess)/864e5;i=i||p>=1||p<-1||a.getDate()!==l.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(Ha)),ts=(Qa.postTurnstileEvent.bind(Qa),new $a),es=(ts.postMapLoadEvent.bind(ts),"mapbox-tiles"),rs=42e4;function ns(t,e,r){if(self.caches){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=m(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<rs||function(t,e){if(void 0===Wa)try{new Response(new ReadableStream),Wa=!0}catch(t){Wa=!1}Wa?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);self.caches.open(es).then((function(e){return e.put(is(t.url),r)})).catch((function(t){return f(t.message)}))}))}}function is(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function os(t,e){if(!self.caches)return e(null);var r=is(t.url);self.caches.open(es).then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")),r=m(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var as=function(t){function e(e,r,n){401===r&&Ga(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function ss(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var us=ss()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function ls(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:us(),signal:n.signal}),o=!1,a=!1,s=(r=i.url).indexOf("sku=")>0&&Ga(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,o){if(!a){if(r&&"SecurityError"!==r.message&&f(r),n&&o)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new as(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(n&&s&&ns(i,n,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){return e(new Error(t.message))}))};return s?os(i,u):u(null,null),{cancel:function(){a=!0,o||n.abort()}}}var ps=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(us())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return ls(t,e);if(ss()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new as(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},cs=function(t,e){return ps(a(t,{type:"arrayBuffer"}),e)},hs=function(t,e){return ps(a(t,{method:"POST"}),e)},fs=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},ys=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<<l)-1,c=p>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},ds=ms;function ms(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ms.Varint=0,ms.Fixed64=1,ms.Bytes=2,ms.Fixed32=5;function vs(t){return t.type===ms.Bytes?t.readVarint()+t.pos:t.pos+1}function gs(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function xs(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function bs(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function _s(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function ws(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function ks(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Ss(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function As(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function zs(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Is(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Ms(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Ps(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Cs(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Bs(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ms.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ps(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Bs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ps(this.buf,this.pos)+4294967296*Ps(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ps(this.buf,this.pos)+4294967296*Bs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=fs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=fs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return gs(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ms.Bytes)return t.push(this.readVarint(e));var r=vs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==ms.Bytes)return t.push(this.readSVarint());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==ms.Bytes)return t.push(this.readBoolean());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==ms.Bytes)return t.push(this.readFloat());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==ms.Bytes)return t.push(this.readDouble());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==ms.Bytes)return t.push(this.readFixed32());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==ms.Bytes)return t.push(this.readSFixed32());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==ms.Bytes)return t.push(this.readFixed64());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==ms.Bytes)return t.push(this.readSFixed64());var e=vs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===ms.Varint)for(;this.buf[this.pos++]>127;);else if(e===ms.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ms.Fixed32)this.pos+=4;else{if(e!==ms.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Cs(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Cs(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Cs(this.buf,-1&t,this.pos),Cs(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Cs(this.buf,-1&t,this.pos),Cs(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&xs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ys(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ys(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&xs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ms.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,bs,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,_s,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ss,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ws,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ks,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,As,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,zs,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Is,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Ms,e)},writeBytesField:function(t,e){this.writeTag(t,ms.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ms.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ms.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ms.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ms.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ms.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ms.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ms.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ms.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ms.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Vs=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Vs.prototype.encode=function(t){return this._stringToNumber[t]},Vs.prototype.decode=function(t){return this._numberToString[t]};var Ts=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Es={geometry:{configurable:!0}};function Fs(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Es.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Es.geometry.set=function(t){this._geometry=t},Ts.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Ts.prototype,Es);var Os=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Os.prototype.setNorthEast=function(t){return this._ne=t instanceof Ls?new Ls(t.lng,t.lat):Ls.convert(t),this},Os.prototype.setSouthWest=function(t){return this._sw=t instanceof Ls?new Ls(t.lng,t.lat):Ls.convert(t),this},Os.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Ls)e=t,r=t;else{if(!(t instanceof Os))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Os.convert(t)):this.extend(Ls.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Ls(e.lng,e.lat),this._ne=new Ls(r.lng,r.lat)),this},Os.prototype.getCenter=function(){return new Ls((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Os.prototype.getSouthWest=function(){return this._sw},Os.prototype.getNorthEast=function(){return this._ne},Os.prototype.getNorthWest=function(){return new Ls(this.getWest(),this.getNorth())},Os.prototype.getSouthEast=function(){return new Ls(this.getEast(),this.getSouth())},Os.prototype.getWest=function(){return this._sw.lng},Os.prototype.getSouth=function(){return this._sw.lat},Os.prototype.getEast=function(){return this._ne.lng},Os.prototype.getNorth=function(){return this._ne.lat},Os.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Os.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Os.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Os.convert=function(t){return!t||t instanceof Os?t:new Os(t)};var Ls=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ls.prototype.wrap=function(){return new Ls((t=this.lng,(i=((t-(e=-180))%(n=(r=180)-e)+n)%n+e)===e?r:i),this.lat);var t,e,r,n,i},Ls.prototype.toArray=function(){return[this.lng,this.lat]},Ls.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ls.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Os(new Ls(this.lng-r,this.lat-e),new Ls(this.lng+r,this.lat+e))},Ls.convert=function(t){if(t instanceof Ls)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ls(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ls(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Ds=2*Math.PI*6378137;function js(t){return Ds*Math.cos(t*Math.PI/180)}function qs(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Us=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Us.fromLngLat=function(t,e){void 0===e&&(e=0);var r,n=Ls.convert(t);return new Us((180+n.lng)/360,(r=n.lat,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),function(t,e){return t/js(e)}(e,n.lat))},Us.prototype.toLngLat=function(){return new Ls(360*this.x-180,qs(this.y))},Us.prototype.toAltitude=function(){return t=this.z,e=this.y,t*js(qs(e));var t,e},Us.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ds*(t=qs(this.y),1/Math.cos(t*Math.PI/180));var t};var Rs=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Js(0,t,e,r)};Rs.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Rs.prototype.url=function(t,e){var r,n,i,o,a,s=(r=this.x,n=this.y,i=this.z,o=Fs(256*r,256*(n=Math.pow(2,i)-n-1),i),a=Fs(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<<o-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)},Rs.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new r((t.x*e-this.x)*Kn,(t.y*e-this.y)*Kn)};var Ns=function(t,e){this.wrap=t,this.canonical=e,this.key=Js(t,e.z,e.x,e.y)},Zs=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Rs(r,+n,+i),this.key=Js(e,t,n,i)};function Js(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*n+r)+e}Zs.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Zs.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Zs(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zs(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Zs.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Zs.prototype.children=function(t){if(this.overscaledZ>=t)return[new Zs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Zs(e,this.wrap,e,r,n),new Zs(e,this.wrap,e,r+1,n),new Zs(e,this.wrap,e,r,n+1),new Zs(e,this.wrap,e,r+1,n+1)]},Zs.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Zs.prototype.wrapped=function(){return new Zs(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Zs.prototype.unwrapTo=function(t){return new Zs(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Zs.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Zs.prototype.toUnwrapped=function(){return new Ns(this.wrap,this.canonical)},Zs.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Zs.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Us(t.x-this.wrap,t.y))},we("CanonicalTileID",Rs),we("OverscaledTileID",Zs,{omit:["posMatrix"]}),Zr([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var Ks=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new g(Kn,16,0),this.grid3D=new g(Kn,16,0),this.featureIndexArray=r||new An};function Gs(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function Xs(t,e){return e-t}function Ys(t,e,r,n,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<r/2;){var p=t[a-1],c=t[a],h=t[a+1];if(!h)return!1;var f=p.angleTo(c)-c.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:f}),l+=f;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Hs(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Ws(t,e,r){return t?.6*e*r:0}function $s(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Qs(t,e,r,n,i,o){for(var a=Ws(r,i,o),s=$s(r,n)*o,u=0,l=Hs(t)/2,p=0;p<t.length-1;p++){var c=t[p],h=t[p+1],f=c.dist(h);if(u+f>l){var y=(l-u)/f,d=pt(c.x,h.x,y),m=pt(c.y,h.y,y),v=new fa(d,m,h.angleTo(c),p);return v._round(),!a||Ys(t,v,s,a,e)?v:void 0}u+=f}}function tu(t,e,r,n,i,o,a,s,u){var l=Ws(n,o,a),p=$s(n,i),c=p*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c<e/4&&(e=c+e/4),function t(e,r,n,i,o,a,s,u,l){var p=a/2;var c=Hs(e);var h=0,f=r-n;var y=[];for(var d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],g=m.dist(v),x=v.angleTo(m);f+n<h+g;){var b=((f+=n)-h)/g,_=pt(m.x,v.x,b),w=pt(m.y,v.y,b);if(_>=0&&_<l&&w>=0&&w<l&&f-p>=0&&f+p<=c){var k=new fa(_,w,x,d);k._round(),i&&!Ys(e,k,a,i,o)||y.push(k)}}h+=g}u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l));return y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}Ks.prototype.insert=function(t,e,r,n,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],c=0;c<l.length;c++){var h=l[c];p[0]=Math.min(p[0],h.x),p[1]=Math.min(p[1],h.y),p[2]=Math.max(p[2],h.x),p[3]=Math.max(p[3],h.y)}p[0]<Kn&&p[1]<Kn&&p[2]>=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},Ks.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Io.VectorTile(new ds(this.rawTileData)).layers,this.sourceLayerCoder=new Vs(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ks.prototype.query=function(t,e,n){var i=this;this.loadVTLayers();for(var o=t.params||{},a=Kn/t.tileSize/t.scale,s=Re(o.filter),u=t.queryGeometry,l=t.queryPadding*a,p=Gs(u),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=Gs(t.cameraQueryGeometry),f=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,(function(e,n,i,o){return function(t,e,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&n<=u.y&&i>=u.x&&o>=u.y)return!0}var l=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var p=0,c=l;p<c.length;p+=1){if(si(t,c[p]))return!0}for(var h=0;h<t.length-1;h++){if(ui(t[h],t[h+1],l))return!0}return!1}(t.cameraQueryGeometry,e-l,n-l,i+l,o+l)})),y=0,d=f;y<d.length;y+=1){var m=d[y];c.push(m)}c.sort(Xs);for(var v,g={},x=function(r){var l=c[r];if(l!==v){v=l;var p=i.featureIndexArray.get(l),h=null;i.loadMatchingFeature(g,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,s,o.layers,e,(function(e,r){h||(h=Yn(e));var o={};return e.id&&(o=n.getState(r.sourceLayer||"_geojsonTileLayer",e.id)),r.queryIntersectsFeature(u,e,o,h,i.z,t.transform,a,t.pixelPosMatrix)}))}},b=0;b<c.length;b++)x(b);return g},Ks.prototype.loadMatchingFeature=function(t,e,r,n,i,o,a,s){var u=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,u)){var l=this.sourceLayerCoder.decode(r),p=this.vtLayers[l].feature(n);if(i(new Ar(this.tileID.overscaledZ),p))for(var c=0;c<u.length;c++){var h=u[c];if(!(o&&o.indexOf(h)<0)){var f=a[h];if(f){var y=!s||s(p,f);if(y){var d=new Ts(p,this.z,this.x,this.y);d.layer=f.serialize();var m=t[h];void 0===m&&(m=t[h]=[]),m.push({featureIndex:n,feature:d,intersectionZ:y})}}}}}},Ks.prototype.lookupSymbolFeatures=function(t,e,r,n,i,o){var a={};this.loadVTLayers();for(var s=Re(n),u=0,l=t;u<l.length;u+=1){var p=l[u];this.loadMatchingFeature(a,e,r,p,s,i,o)}return a},Ks.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1){if(t===i[n])return!0}return!1},we("FeatureIndex",Ks,{omit:["rawTileData","sourceLayerCoder"]});var eu=3;var ru=function(t,e,n,i,o,a,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l;if(this.boxStartIndex=t.length,p){var v=y-f,g=m-d;v>0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(t,e,n,n.segment,g,v,i,o,a,c))}else{if(h){var x=new r(d,f),b=new r(m,f),_=new r(d,y),w=new r(m,y),k=h*Math.PI/180;x._rotate(k),b._rotate(k),_._rotate(k),w._rotate(k),d=Math.min(x.x,b.x,_.x,w.x),m=Math.max(x.x,b.x,_.x,w.x),f=Math.min(x.y,b.y,_.y,w.y),y=Math.max(x.y,b.y,_.y,w.y)}t.emplaceBack(n.x,n.y,d,f,m,y,i,o,a,0,0)}this.boxEndIndex=t.length};ru.prototype._addLineCollisionCircles=function(t,e,r,n,i,o,a,s,u,l){var p=o/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-o/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m]}while(v>x);for(var b=e[m].dist(e[m+1]),_=-f;_<c+f;_++){var w=_*p,k=g+w;if(w<0&&(k+=w),w>i&&(k+=w-i),!(k<v)){for(;v+b<k;){if(v+=b,++m+1>=e.length)return;b=e[m].dist(e[m+1])}var S=k-v,A=e[m],z=e[m+1].sub(A)._unit()._mult(S)._add(A)._round(),I=Math.abs(k-y)<p?0:.8*(k-y);t.emplaceBack(z.x,z.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,I)}}};var nu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=iu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function iu(t,e){return t<e?-1:t>e?1:0}function ou(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var p=u[l];(!l||p.x<i)&&(i=p.x),(!l||p.y<o)&&(o=p.y),(!l||p.x>a)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=a-i,h=s-o,f=Math.min(c,h),y=f/2,d=new nu([],au);if(0===f)return new r(i,o);for(var m=i;m<a;m+=f)for(var v=o;v<s;v+=f)d.push(new su(m+y,v+y,y,t));for(var g=function(t){for(var e=0,r=0,n=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],l=i[s],p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p}return new su(r/e,n/e,0,t)}(t),x=d.length;d.length;){var b=d.pop();(b.d>g.d||!g.d)&&(g=b,n&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-g.d<=e||(y=b.h/2,d.push(new su(b.p.x-y,b.p.y-y,y,t)),d.push(new su(b.p.x+y,b.p.y-y,y,t)),d.push(new su(b.p.x-y,b.p.y+y,y,t)),d.push(new su(b.p.x+y,b.p.y+y,y,t)),x+=4)}return n&&(console.log("num probes: "+x),console.log("best distance: "+g.d)),g.p}function au(t,e){return e.max-t.max}function su(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],p=o[u];l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,oi(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}nu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},nu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},nu.prototype.peek=function(){return this.data[0]},nu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},nu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(o=s,a=e[s]),r(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var uu=_((function(t){t.exports=function(t,e){var r,n,i,o,a,s,u,l;for(r=3&t.length,n=t.length-r,i=e,a=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),lu=_((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),pu=uu,cu=uu,hu=lu;pu.murmur3=cu,pu.murmur2=hu;var fu=7;function yu(t,e,n,i,o,a){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=Kn/s,t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.minZoom,y=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Ar(h)),l["text-size"].possiblyEvaluate(new Ar(y))]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,v=d.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Ar(m)),l["icon-size"].possiblyEvaluate(new Ar(v))]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Ar(t.zoom+1)),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Ar(t.zoom+1)),p.textMaxSize=l["text-size"].possiblyEvaluate(new Ar(18));for(var g=u.get("text-line-height")*ea,x="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),b=u.get("text-keep-upright"),_=function(){var a=k[w],s=u.get("text-font").evaluate(a,{}).join(","),l=n,c={horizontal:{},vertical:void 0},h=a.text,y=[0,0];if(h){var d=h.toString(),m=u.get("text-letter-spacing").evaluate(a,{})*ea,v=function(t){for(var e=0,r=t;e<r.length;e+=1){if(!br(r[e].charCodeAt(0)))return!1}return!0}(d)?m:0,_=u.get("text-anchor").evaluate(a,{}),S=u.get("text-variable-anchor"),A=u.get("text-radial-offset").evaluate(a,{});S||(y=A?function(t,e){var r=0,n=0,i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-fu;break;case"bottom-right":case"bottom-left":n=-i+fu;break;case"bottom":n=-e+fu;break;case"top":n=e-fu}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(_,A*ea):u.get("text-offset").evaluate(a,{}).map((function(t){return t*ea})));var z=x?"center":u.get("text-justify").evaluate(a,{}),I="point"===u.get("symbol-placement")?u.get("text-max-width").evaluate(a,{})*ea:0,M=function(){t.allowVerticalPlacement&&xr(d)&&(c.vertical=ia(h,e,s,I,g,_,"left",v,y,ra.vertical,!0))};if(!x&&S){for(var P="auto"===z?S.map((function(t){return du(t)})):[z],C=!1,B=0;B<P.length;B++){var V=P[B];if(!c.horizontal[V])if(C)c.horizontal[V]=c.horizontal[0];else{var T=ia(h,e,s,I,g,"center",V,v,y,ra.horizontal,!1);T&&(c.horizontal[V]=T,C=1===T.lineCount)}}M()}else{"auto"===z&&(z=du(_));var E=ia(h,e,s,I,g,_,z,v,y,ra.horizontal,!1);E&&(c.horizontal[z]=E),M(),xr(d)&&x&&b&&(c.vertical=ia(h,e,s,I,g,_,z,v,y,ra.vertical,!1))}}var F=void 0;if(a.icon){var O=i[a.icon];O&&(F=function(t,e,r){var n=ca(r),i=n.horizontalAlign,o=n.verticalAlign,a=e[0],s=e[1],u=a-t.displaySize[0]*i,l=u+t.displaySize[0],p=s-t.displaySize[1]*o;return{image:t,top:p,bottom:p+t.displaySize[1],left:u,right:l}}(o[a.icon],u.get("icon-offset").evaluate(a,{}),u.get("icon-anchor").evaluate(a,{})),void 0===t.sdfIcons?t.sdfIcons=O.sdf:t.sdfIcons!==O.sdf&&f("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),O.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==u.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0))}(Object.keys(c.horizontal).length||F)&&function(t,e,n,i,o,a,s){var u=a.layoutTextSize.evaluate(e,{}),l=a.layoutIconSize.evaluate(e,{}),p=a.textMaxSize.evaluate(e,{});void 0===p&&(p=u);var c=t.layers[0].layout,h=c.get("icon-offset").evaluate(e,{}),y=gu(n.horizontal),d=u/24,m=t.tilePixelRatio*d,v=t.tilePixelRatio*p/24,g=t.tilePixelRatio*l,x=t.tilePixelRatio*c.get("symbol-spacing"),b=c.get("text-padding")*t.tilePixelRatio,_=c.get("icon-padding")*t.tilePixelRatio,w=c.get("text-max-angle")/180*Math.PI,k="map"===c.get("text-rotation-alignment")&&"point"!==c.get("symbol-placement"),S="map"===c.get("icon-rotation-alignment")&&"point"!==c.get("symbol-placement"),A=c.get("symbol-placement"),z=x/2,I=function(u,l){l.x<0||l.x>=Kn||l.y<0||l.y>=Kn||function(t,e,n,i,o,a,s,u,l,p,c,h,y,d,m,v,g,x,b,_,w){var k,S,A,z=t.addToLineVertexArray(e,n),I=0,M=0,P=0,C={},B=pu(""),V=(a.layout.get("text-radial-offset").evaluate(b,{})||0)*ea;if(t.allowVerticalPlacement&&i.vertical){var T=a.layout.get("text-rotate").evaluate(b,{})+90,E=i.vertical;A=new ru(s,n,e,u,l,p,E,c,h,y,t.overscaling,T)}for(var F in i.horizontal){var O=i.horizontal[F];if(!k){B=pu(O.text);var L=a.layout.get("text-rotate").evaluate(b,{});k=new ru(s,n,e,u,l,p,O,c,h,y,t.overscaling,L)}var D=1===O.lineCount;if(M+=vu(t,e,O,a,y,b,d,z,i.vertical?ra.horizontal:ra.horizontalOnly,D?Object.keys(i.horizontal):[F],C,_,w),D)break}i.vertical&&(P+=vu(t,e,i.vertical,a,y,b,d,z,ra.vertical,["vertical"],C,_,w));var j=k?k.boxStartIndex:t.collisionBoxArray.length,q=k?k.boxEndIndex:t.collisionBoxArray.length,U=A?A.boxStartIndex:t.collisionBoxArray.length,R=A?A.boxEndIndex:t.collisionBoxArray.length;if(o){var N=function(t,e,n,i,o,a){var s,u,l,p,c=e.image,h=n.layout,f=e.top-1/c.pixelRatio,y=e.left-1/c.pixelRatio,d=e.bottom+1/c.pixelRatio,m=e.right+1/c.pixelRatio;if("none"!==h.get("icon-text-fit")&&o){var v=m-y,g=d-f,x=h.get("text-size").evaluate(a,{})/24,b=o.left*x,_=o.right*x,w=o.top*x,k=_-b,S=o.bottom*x-w,A=h.get("icon-text-fit-padding")[0],z=h.get("icon-text-fit-padding")[1],I=h.get("icon-text-fit-padding")[2],M=h.get("icon-text-fit-padding")[3],P="width"===h.get("icon-text-fit")?.5*(S-g):0,C="height"===h.get("icon-text-fit")?.5*(k-v):0,B="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?k:v,V="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?S:g;s=new r(b+C-M,w+P-A),u=new r(b+C+z+B,w+P-A),l=new r(b+C+z+B,w+P+I+V),p=new r(b+C-M,w+P+I+V)}else s=new r(y,f),u=new r(m,f),l=new r(m,d),p=new r(y,d);var T=n.layout.get("icon-rotate").evaluate(a,{})*Math.PI/180;if(T){var E=Math.sin(T),F=Math.cos(T),O=[F,-E,E,F];s._matMult(O),u._matMult(O),p._matMult(O),l._matMult(O)}return[{tl:s,tr:u,bl:p,br:l,tex:c.paddedRect,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0}]}(0,o,a,0,gu(i.horizontal),b),Z=a.layout.get("icon-rotate").evaluate(b,{});S=new ru(s,n,e,u,l,p,o,m,v,!1,t.overscaling,Z),I=4*N.length;var J=t.iconSizeData,K=null;"source"===J.kind?(K=[ya*a.layout.get("icon-size").evaluate(b,{})])[0]>mu&&f(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===J.kind&&((K=[ya*w.compositeIconSizes[0].evaluate(b,{}),ya*w.compositeIconSizes[1].evaluate(b,{})])[0]>mu||K[1]>mu)&&f(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,N,K,x,g,b,!1,e,z.lineStartIndex,z.lineLength)}var G=S?S.boxStartIndex:t.collisionBoxArray.length,X=S?S.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=wa.MAX_GLYPHS&&f("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");t.symbolInstances.emplaceBack(e.x,e.y,C.right>=0?C.right:-1,C.center>=0?C.center:-1,C.left>=0?C.left:-1,C.vertical||-1,B,j,q,U,R,G,X,u,M,P,I,0,c,V)}(t,l,u,n,i,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,k,s,g,_,S,h,e,o,a)};if("line"===A)for(var M=0,P=function(t,e,n,i,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,p=0;p<u.length-1;p++){var c=u[p],h=u[p+1];c.x<e&&h.x<e||(c.x<e?c=new r(e,c.y+(h.y-c.y)*((e-c.x)/(h.x-c.x)))._round():h.x<e&&(h=new r(e,c.y+(h.y-c.y)*((e-c.x)/(h.x-c.x)))._round()),c.y<n&&h.y<n||(c.y<n?c=new r(c.x+(h.x-c.x)*((n-c.y)/(h.y-c.y)),n)._round():h.y<n&&(h=new r(c.x+(h.x-c.x)*((n-c.y)/(h.y-c.y)),n)._round()),c.x>=i&&h.x>=i||(c.x>=i?c=new r(i,c.y+(h.y-c.y)*((i-c.x)/(h.x-c.x)))._round():h.x>=i&&(h=new r(i,c.y+(h.y-c.y)*((i-c.x)/(h.x-c.x)))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new r(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round():h.y>=o&&(h=new r(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round()),l&&c.equals(l[l.length-1])||(l=[c],a.push(l)),l.push(h)))))}return a}(e.geometry,0,0,Kn,Kn);M<P.length;M+=1)for(var C=P[M],B=tu(C,x,w,n.vertical||y,i,24,v,t.overscaling,Kn),V=0,T=B;V<T.length;V+=1){var E=T[V],F=y;F&&xu(t,F.text,z,E)||I(C,E)}else if("line-center"===A)for(var O=0,L=e.geometry;O<L.length;O+=1){var D=L[O];if(D.length>1){var j=Qs(D,w,n.vertical||y,i,24,v);j&&I(D,j)}}else if("Polygon"===e.type)for(var q=0,U=lo(e.geometry,0);q<U.length;q+=1){var R=U[q],N=ou(R,16);I(R[0],new fa(N.x,N.y,0))}else if("LineString"===e.type)for(var Z=0,J=e.geometry;Z<J.length;Z+=1){var K=J[Z];I(K,new fa(K[0].x,K[0].y,0))}else if("Point"===e.type)for(var G=0,X=e.geometry;G<X.length;G+=1)for(var Y=X[G],H=0,W=Y;H<W.length;H+=1){var $=W[H];I([$],new fa($.x,$.y,0))}}(t,a,c,F,l,p,y)},w=0,k=t.features;w<k.length;w+=1)_();a&&t.generateCollisionDebugBuffers()}function du(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var mu=65535;function vu(t,e,n,i,o,a,s,u,l,p,c,h,y){var d=function(t,e,n,i,o,a,s,u){for(var l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,p=e.positionedGlyphs,c=[],h=0;h<p.length;h++){var f=p[h],y=s[f.fontStack],d=y&&y[f.glyph];if(d){var m=d.rect;if(m){var v=eu+1,g=d.metrics.advance*f.scale/2,x=o?[f.x+g,f.y]:[0,0],b=o?[0,0]:[f.x+g+n[0],f.y+n[1]],_=(o||u)&&f.vertical,w=[0,0];_&&(w=b,b=[0,0]);var k=(d.metrics.left-v)*f.scale-g+b[0],S=(-d.metrics.top-v)*f.scale+b[1],A=k+m.w*f.scale,z=S+m.h*f.scale,I=new r(k,S),M=new r(A,S),P=new r(k,z),C=new r(A,z);if(_){var B=new r(-g,g-e.yOffset),V=-Math.PI/2,T=ea/2-g,E=new r(5-e.yOffset-T,0),F=new(Function.prototype.bind.apply(r,[null].concat(w)));I._rotateAround(V,B)._add(E)._add(F),M._rotateAround(V,B)._add(E)._add(F),P._rotateAround(V,B)._add(E)._add(F),C._rotateAround(V,B)._add(E)._add(F)}if(l){var O=Math.sin(l),L=Math.cos(l),D=[L,-O,O,L];I._matMult(D),M._matMult(D),P._matMult(D),C._matMult(D)}c.push({tl:I,tr:M,bl:P,br:C,tex:m,writingMode:e.writingMode,glyphOffset:x,sectionIndex:f.sectionIndex})}}}return c}(0,n,s,i,o,a,h,t.allowVerticalPlacement),m=t.textSizeData,v=null;"source"===m.kind?(v=[ya*i.layout.get("text-size").evaluate(a,{})])[0]>mu&&f(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===m.kind&&((v=[ya*y.compositeTextSizes[0].evaluate(a,{}),ya*y.compositeTextSizes[1].evaluate(a,{})])[0]>mu||v[1]>mu)&&f(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,d,v,s,o,a,l,e,u.lineStartIndex,u.lineLength);for(var g=0,x=p;g<x.length;g+=1){c[x[g]]=t.text.placedSymbolArray.length-1}return 4*d.length}function gu(t){for(var e in t)return t[e];return null}function xu(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}else i[e]=[];return i[e].push(n),!1}function bu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p[l],h=a.length-1;h>=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=a.pop();h<a.length&&(a[h]=y)}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(a.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}var _u=function(t,e){var r=e.pixelRatio,n=e.version;this.paddedRect=t,this.pixelRatio=r,this.version=n},wu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};wu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},wu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},wu.tlbr.get=function(){return this.tl.concat(this.br)},wu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(_u.prototype,wu);var ku=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=bu(i),a=o.w,s=o.h,u=new Ai({width:a||1,height:s||1});for(var l in t){var p=t[l],c=r[l].paddedRect;Ai.copy(p.data,u,{x:0,y:0},{x:c.x+1,y:c.y+1},p.data)}for(var h in e){var f=e[h],y=n[h].paddedRect,d=y.x+1,m=y.y+1,v=f.data.width,g=f.data.height;Ai.copy(f.data,u,{x:0,y:0},{x:d,y:m},f.data),Ai.copy(f.data,u,{x:0,y:g-1},{x:d,y:m-1},{width:v,height:1}),Ai.copy(f.data,u,{x:0,y:0},{x:d,y:m+g},{width:v,height:1}),Ai.copy(f.data,u,{x:v-1,y:0},{x:d-1,y:m},{width:1,height:g}),Ai.copy(f.data,u,{x:0,y:0},{x:d+v,y:m},{width:1,height:g})}this.image=u,this.iconPositions=r,this.patternPositions=n};ku.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new _u(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},ku.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},ku.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],o=n[1];r.update(e.data,void 0,{x:i,y:o})}},we("ImagePosition",_u),we("ImageAtlas",ku);var Su=function(t){var e={},r=[];for(var n in t){var i=t[n],o=e[n]={};for(var a in i){var s=i[+a];if(s&&0!==s.bitmap.width&&0!==s.bitmap.height){var u={x:0,y:0,w:s.bitmap.width+2,h:s.bitmap.height+2};r.push(u),o[a]={rect:u,metrics:s.metrics}}}}var l=bu(r),p=l.w,c=l.h,h=new Si({width:p||1,height:c||1});for(var f in t){var y=t[f];for(var d in y){var m=y[+d];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var v=e[f][d].rect;Si.copy(m.bitmap,h,{x:0,y:0},{x:v.x+1,y:v.y+1},m.bitmap)}}}this.image=h,this.positions=e};we("GlyphAtlas",Su);var Au=function(t){this.tileID=new Zs(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies};function zu(t,e){for(var r=new Ar(e),n=0,i=t;n<i.length;n+=1){i[n].recalculate(r)}}Au.prototype.parse=function(t,e,r,n){var i=this;this.status="parsing",this.data=t,this.collisionBoxArray=new dn;var a=new Vs(Object.keys(t.layers).sort()),s=new Ks(this.tileID);s.bucketLayerIDs=[];var u,l,c,h,y={},d={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{}},m=e.familiesBySource[this.source];for(var v in m){var g=t.layers[v];if(g){1===g.version&&f('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=a.encode(v),b=[],_=0;_<g.length;_++){var w=g.feature(_);b.push({feature:w,index:_,sourceLayerIndex:x})}for(var k=0,S=m[v];k<S.length;k+=1){var A=S[k],z=A[0];if(!(z.minzoom&&this.zoom<Math.floor(z.minzoom)))if(!(z.maxzoom&&this.zoom>=z.maxzoom))if("none"!==z.visibility)zu(A,this.zoom),(y[z.id]=z.createBucket({index:s.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,d),s.bucketLayerIDs.push(A.map((function(t){return t.id})))}}}var I=p(d.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(I).length?r.send("getGlyphs",{uid:this.uid,stacks:I},(function(t,e){u||(u=t,l=e,C.call(i))})):l={};var M=Object.keys(d.iconDependencies);M.length?r.send("getImages",{icons:M},(function(t,e){u||(u=t,c=e,C.call(i))})):c={};var P=Object.keys(d.patternDependencies);function C(){if(u)return n(u);if(l&&c&&h){var t=new Su(l),e=new ku(c,h);for(var r in y){var i=y[r];i instanceof wa?(zu(i.layers,this.zoom),yu(i,l,t.positions,c,e.iconPositions,this.showCollisionBoxes)):i.hasPattern&&(i instanceof Ro||i instanceof fo||i instanceof Bo)&&(zu(i.layers,this.zoom),i.addFeatures(d,e.patternPositions))}this.status="done",n(null,{buckets:o(y).filter((function(t){return!t.isEmpty()})),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?l:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null})}}P.length?r.send("getImages",{icons:P},(function(t,e){u||(u=t,h=e,C.call(i))})):h={},C.call(this)};var Iu="undefined"!=typeof performance,Mu={getEntriesByName:function(t){return!!(Iu&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(Iu&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(Iu&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(Iu&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(Iu&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},Pu=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Mu.mark(this._marks.start)};function Cu(t,e){var r=cs(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new Io.VectorTile(new ds(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Pu.prototype.finish=function(){Mu.mark(this._marks.end);var t=Mu.getEntriesByName(this._marks.measure);return 0===t.length&&(Mu.measure(this._marks.measure,this._marks.start,this._marks.end),t=Mu.getEntriesByName(this._marks.measure),Mu.clearMarks(this._marks.start),Mu.clearMarks(this._marks.end),Mu.clearMeasures(this._marks.measure)),t},Mu.Performance=Pu;var Bu=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||Cu,this.loading={},this.loaded={}};Bu.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Mu.Performance(t.request),o=this.loading[n]=new Au(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete r.loading[n],t||!s)return o.status="done",r.loaded[n]=o,e(t);var u=s.rawData,l={};s.expires&&(l.expires=s.expires),s.cacheControl&&(l.cacheControl=s.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,r.layerIndex,r.actor,(function(t,r){if(t||!r)return e(t);e(null,a({rawTileData:u.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Bu.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,i=this;if(r&&r[n]){var o=r[n];o.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,r){var n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,i.actor,n)),e(t,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.actor,a):a())}},Bu.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},Bu.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Vu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return f('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var n=this.dim=e.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);for(var i=e.data,o="terrarium"===r?this._unpackTerrarium:this._unpackMapbox,a=0;a<n;a++)for(var s=0;s<n;s++){var u=4*(a*n+s);this.set(s,a,o(i[u],i[u+1],i[u+2]))}for(var l=0;l<n;l++)this.set(-1,l,this.get(0,l)),this.set(n,l,this.get(n-1,l)),this.set(l,-1,this.get(l,0)),this.set(l,n,this.get(l,n-1));this.set(-1,-1,this.get(0,0)),this.set(n,-1,this.get(n-1,0)),this.set(-1,n,this.get(0,n-1)),this.set(n,n,this.get(n-1,n-1))};Vu.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536},Vu.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},Vu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Vu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Vu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Vu.prototype.getPixels=function(){return new Ai({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Vu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l<a;l++)for(var p=n;p<i;p++)this.set(p,l,t.get(p+s,l+u))},we("DEMData",Vu);var Tu=function(){this.loaded={}};Tu.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=new Vu(r,i,n);this.loaded=this.loaded||{},this.loaded[r]=o,e(null,o)},Tu.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Eu={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function Fu(t){var e=0;if(t&&t.length>0){e+=Math.abs(Ou(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(Ou(t[r]))}return e}function Ou(t){var e,r,n,i,o,a,s=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(n=u-2,i=u-1,o=0):a===u-1?(n=u-1,i=0,o=1):(n=a,i=a+1,o=a+2),e=t[n],r=t[i],s+=(Lu(t[o][0])-Lu(e[0]))*Math.sin(Lu(r[1]));s=s*Eu.RADIUS*Eu.RADIUS/2}return s}function Lu(t){return t*Math.PI/180}var Du={geometry:function t(e){var r,n=0;switch(e.type){case"Polygon":return Fu(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)n+=Fu(e.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<e.geometries.length;r++)n+=t(e.geometries[r]);return n}},ring:Ou},ju=function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(qu(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(qu(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){"Polygon"===t.type?t.coordinates=Uu(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(qu(Uu,e)));return t}(e,r);default:return e}};function qu(t,e){return function(r){return t(r,e)}}function Uu(t,e){e=!!e,t[0]=Ru(t[0],e);for(var r=1;r<t.length;r++)t[r]=Ru(t[r],!e);return t}function Ru(t,e){return function(t){return Du.ring(t)>=0}(t)===e?t:t.reverse()}var Nu=Io.VectorTileFeature.prototype.toGeoJSON,Zu=function(t){this._feature=t,this.extent=Kn,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};Zu.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,n=this._feature.geometry;e<n.length;e+=1){var i=n[e];t.push([new r(i[0],i[1])])}return t}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,p=s[a];l<p.length;l+=1){var c=p[l];u.push(new r(c[0],c[1]))}o.push(u)}return o},Zu.prototype.toGeoJSON=function(t,e,r){return Nu.call(this,t,e,r)};var Ju=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=Kn,this.length=t.length,this._features=t};Ju.prototype.feature=function(t){return new Zu(this._features[t])};var Ku=Io.VectorTileFeature,Gu=Xu;function Xu(t,e){this.options=e||{},this.features=t,this.length=t.length}function Yu(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}Xu.prototype.feature=function(t){return new Yu(this.features[t],this.options.extent)},Yu.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var n=t[e],i=[],o=0;o<n.length;o++)i.push(new r(n[o][0],n[o][1]));this.geometry.push(i)}return this.geometry},Yu.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},Yu.prototype.toGeoJSON=Ku.prototype.toGeoJSON;var Hu=tl,Wu=tl,$u=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new Gu(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return tl({layers:r})},Qu=Gu;function tl(t){var e=new ds;return function(t,e){for(var r in t.layers)e.writeMessage(3,el,t.layers[r])}(t,e),e.finish()}function el(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,rl,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,sl,o[r])}function rl(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,nl,t),e.writeVarintField(3,r.type),e.writeMessage(4,al,r)}function nl(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var u=o[s];void 0===u&&(n.push(s),u=n.length-1,o[s]=u),e.writeVarint(u);var l=r.properties[s],p=typeof l;"string"!==p&&"boolean"!==p&&"number"!==p&&(l=JSON.stringify(l));var c=p+":"+l,h=a[c];void 0===h&&(i.push(l),h=i.length-1,a[c]=h),e.writeVarint(h)}}function il(t,e){return(e<<3)+(7&t)}function ol(t){return t<<1^t>>31}function al(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],l=1;1===n&&(l=u.length),e.writeVarint(il(1,l));for(var p=3===n?u.length-1:u.length,c=0;c<p;c++){1===c&&1!==n&&e.writeVarint(il(2,p-1));var h=u[c].x-i,f=u[c].y-o;e.writeVarint(ol(h)),e.writeVarint(ol(f)),i+=h,o+=f}3===n&&e.writeVarint(il(7,1))}}function sl(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function ul(t,e,r,n,i,o){if(!(i-n<=r)){var a=n+i>>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(s-p)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*p/s+c)),f=Math.min(o,Math.floor(n+(s-u)*p/s+c));t(e,r,n,h,f,a)}var y=r[2*n+a],d=i,m=o;for(ll(e,r,i,n),r[2*o+a]>y&&ll(e,r,i,o);d<m;){for(ll(e,r,d,m),d++,m--;r[2*d+a]<y;)d++;for(;r[2*m+a]>y;)m--}r[2*i+a]===y?ll(e,r,i,m):ll(e,r,++m,o),m<=n&&(i=m+1),n<=m&&(o=m-1)}}(t,e,a,n,i,o%2),ul(t,e,r,n,a-1,o+1),ul(t,e,r,a+1,i,o+1)}}function ll(t,e,r,n){pl(t,r,n),pl(e,2*r,2*n),pl(e,2*r+1,2*n+1)}function pl(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function cl(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}Hu.fromVectorTileJs=Wu,Hu.fromGeojsonVt=$u,Hu.GeoJSONWrapper=Qu;var hl=function(t){return t[0]},fl=function(t){return t[1]},yl=function(t,e,r,n,i){void 0===e&&(e=hl),void 0===r&&(r=fl),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u<t.length;u++)a[u]=u,s[2*u]=e(t[u]),s[2*u+1]=r(t[u]);ul(a,s,n,0,a.length-1,0)};yl.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],p=[];l.length;){var c=l.pop(),h=l.pop(),f=l.pop();if(h-f<=a)for(var y=f;y<=h;y++)s=e[2*y],u=e[2*y+1],s>=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);s=e[2*d],u=e[2*d+1],s>=r&&s<=i&&u>=n&&u<=o&&p.push(t[d]);var m=(c+1)%2;(0===c?r<=s:n<=u)&&(l.push(f),l.push(d-1),l.push(m)),(0===c?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(m))}}return p}(this.ids,this.coords,t,e,r,n,this.nodeSize)},yl.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),p=a.pop(),c=a.pop();if(p-c<=o)for(var h=c;h<=p;h++)cl(e[2*h],e[2*h+1],r,n)<=u&&s.push(t[h]);else{var f=Math.floor((c+p)/2),y=e[2*f],d=e[2*f+1];cl(y,d,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=y:n-i<=d)&&(a.push(c),a.push(f-1),a.push(m)),(0===l?r+i>=y:n+i>=d)&&(a.push(f+1),a.push(p),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var dl={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(t){return t}},ml=function(t){this.options=kl(Object.create(dl),t),this.trees=new Array(this.options.maxZoom+1)};function vl(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function gl(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:_l(n),y:wl(i),zoom:1/0,index:e,parentId:-1}}function xl(t){return{type:"Feature",id:t.id,properties:bl(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function bl(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return kl(kl({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function _l(t){return t/360+.5}function wl(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function kl(t,e){for(var r in e)t[r]=e[r];return t}function Sl(t){return t.x}function Al(t){return t.y}function zl(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function Il(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Ml(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)Ml(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)Ml(t,e[n][i])}(i),i}function Ml(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function Pl(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),"Point"===o)Cl(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)Cl(i[l],s);else if("LineString"===o)Bl(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(l=0;l<i.length;l++)s=[],Bl(i[l],s,a,!1),t.push(Il(u,"LineString",s,e.properties));return}Vl(i,s,a,!1)}else if("Polygon"===o)Vl(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)Pl(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var p=[];Vl(i[l],p,a,!0),s.push(p)}}t.push(Il(u,o,s,e.properties))}}function Cl(t,e){e.push(Tl(t[0])),e.push(El(t[1])),e.push(0)}function Bl(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var u=Tl(t[s][0]),l=El(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var p=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],c=e[n],h=e[n+1],f=r+3;f<n;f+=3){var y=zl(e[f],e[f+1],l,p,c,h);if(y>a)o=f,a=y;else if(y===a){var d=Math.abs(f-s);d<u&&(o=f,u=d)}}a>i&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Vl(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];Bl(t[i],o,r,n),e.push(o)}}function Tl(t){return t/360+.5}function El(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Fl(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a<n)return t;if(a<r||o>=n)return null;for(var u=[],l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.type,f=0===i?p.minX:p.minY,y=0===i?p.maxX:p.maxY;if(f>=r&&y<n)u.push(p);else if(!(y<r||f>=n)){var d=[];if("Point"===h||"MultiPoint"===h)Ol(c,d,r,n,i);else if("LineString"===h)Ll(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)jl(c,d,r,n,i,!1);else if("Polygon"===h)jl(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m<c.length;m++){var v=[];jl(c[m],v,r,n,i,!0),v.length&&d.push(v)}if(d.length){if(s.lineMetrics&&"LineString"===h){for(m=0;m<d.length;m++)u.push(Il(p.id,h,d[m],p.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===d.length?(h="LineString",d=d[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===d.length?"Point":"MultiPoint"),u.push(Il(p.id,h,d,p.tags))}}}return u.length?u:null}function Ol(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function Ll(t,e,r,n,i,o,a){for(var s,u,l=Dl(t),p=0===i?Ul:Rl,c=t.start,h=0;h<t.length-3;h+=3){var f=t[h],y=t[h+1],d=t[h+2],m=t[h+3],v=t[h+4],g=0===i?f:y,x=0===i?m:v,b=!1;a&&(s=Math.sqrt(Math.pow(f-m,2)+Math.pow(y-v,2))),g<r?x>r&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x<n&&(u=p(l,f,y,m,v,n),a&&(l.start=c+s*u)):ql(l,f,y,d),x<r&&g>=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!o&&b&&(a&&(l.end=c+s*u),e.push(l),l=Dl(t)),a&&(c+=s)}var _=t.length-3;f=t[_],y=t[_+1],d=t[_+2],(g=0===i?f:y)>=r&&g<=n&&ql(l,f,y,d),_=l.length-3,o&&_>=3&&(l[_]!==l[0]||l[_+1]!==l[1])&&ql(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Dl(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function jl(t,e,r,n,i,o){for(var a=0;a<t.length;a++)Ll(t[a],e,r,n,i,o,!1)}function ql(t,e,r,n){t.push(e),t.push(r),t.push(n)}function Ul(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}function Rl(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}function Nl(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=Zl(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(Zl(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(Zl(o.geometry[s][l],e));i.push(u)}r.push(Il(o.id,a,i,o.tags))}return r}function Zl(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function Jl(t,e){if(t.transformed)return t;var r,n,i,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],l=u.geometry,p=u.type;if(u.geometry=[],1===p)for(n=0;n<l.length;n+=2)u.geometry.push(Kl(l[n],l[n+1],e,o,a,s));else for(n=0;n<l.length;n++){var c=[];for(i=0;i<l[n].length;i+=2)c.push(Kl(l[n][i],l[n][i+1],e,o,a,s));u.geometry.push(c)}}return t.transformed=!0,t}function Kl(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function Gl(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,Xl(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,p=t[s].maxX,c=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),p>a.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function Xl(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)Yl(a,i,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)Yl(a,i[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)Yl(a,l[s],t,r,!0,0===s)}if(a.length){var p=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var c in p={},e.tags)p[c]=e.tags[c];p.mapbox_clip_start=i.start/i.size,p.mapbox_clip_end=i.end/i.size}var h={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:p};null!==e.id&&(h.id=e.id),t.features.push(h)}}function Yl(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===n||e[u+2]>a)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}(s,o),t.push(s)}}function Hl(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)Pl(r,t.features[n],e,n);else"Feature"===t.type?Pl(r,t,e):Pl(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=Fl(t,1,-1-r,r,0,-1,2,e),o=Fl(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=Fl(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Nl(i,1).concat(n)),o&&(n=n.concat(Nl(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Wl(t,e,r){return 32*((1<<t)*r+e)+t}function $l(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new Ju(n.features),o=Hu(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}ml.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],u=0;u<t.length;u++)t[u].geometry&&s.push(gl(t[u],u));this.trees[i+1]=new yl(s,Sl,Al,o,Float32Array),r&&console.timeEnd(a);for(var l=i;l>=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new yl(s,Sl,Al,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},ml.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],p=0,c=u.range(_l(r),wl(o),_l(i),wl(n));p<c.length;p+=1){var h=c[p],f=u.points[h];l.push(f.numPoints?xl(f):this.points[f.index])}return l},ml.prototype.getChildren=function(t){var e=t>>5,r=t%32,n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],u=0,l=i.within(o.x,o.y,a);u<l.length;u+=1){var p=l[u],c=i.points[p];c.parentId===t&&s.push(c.numPoints?xl(c):this.points[c.index])}if(0===s.length)throw new Error(n);return s},ml.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},ml.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.extent,s=o.radius/a,u=(r-s)/i,l=(r+1+s)/i,p={features:[]};return this._addTileFeatures(n.range((e-s)/i,u,(e+1+s)/i,l),n.points,e,r,i,p),0===e&&this._addTileFeatures(n.range(1-s/i,u,1,l),n.points,i,r,i,p),e===i-1&&this._addTileFeatures(n.range(0,u,s/i,l),n.points,-1,r,i,p),p.features.length?p:null},ml.prototype.getClusterExpansionZoom=function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},ml.prototype._appendLeaves=function(t,e,r,n,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=n?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},ml.prototype._addTileFeatures=function(t,e,r,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-r)),Math.round(this.options.extent*(u.y*i-n))]],tags:u.numPoints?bl(u):this.points[u.index].properties},p=u.numPoints?u.id:this.points[u.index].id;void 0!==p&&(l.id=p),o.features.push(l)}},ml.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},ml.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.radius,o=n.extent,a=n.reduce,s=i/(o*Math.pow(2,e)),u=0;u<t.length;u++){var l=t[u];if(!(l.zoom<=e)){l.zoom=e;for(var p=this.trees[e+1],c=p.within(l.x,l.y,s),h=l.numPoints||1,f=l.x*h,y=l.y*h,d=a&&h>1?this._map(l,!0):null,m=(u<<5)+(e+1),v=0,g=c;v<g.length;v+=1){var x=g[v],b=p.points[x];if(!(b.zoom<=e)){b.zoom=e;var _=b.numPoints||1;f+=b.x*_,y+=b.y*_,h+=_,b.parentId=m,a&&(d||(d=this._map(l,!0)),a(d,this._map(b)))}}1===h?r.push(l):(l.parentId=m,r.push(vl(f/h,y/h,m,h,d)))}}return r},ml.prototype._map=function(t,e){if(t.numPoints)return e?kl({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?kl({},n):n},Hl.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Hl.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<<e,c=Wl(e,r,n),h=this.tiles[c];if(!h&&(l>1&&console.time("creation"),h=this.tiles[c]=Gl(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===u.maxZoom||e===i)continue;var y=1<<i-e;if(r!==Math.floor(o/y)||n!==Math.floor(a/y))continue}else if(e===u.indexMaxZoom||h.numPoints<=u.indexMaxPoints)continue;if(h.source=null,0!==t.length){l>1&&console.time("clipping");var d,m,v,g,x,b,_=.5*u.buffer/u.extent,w=.5-_,k=.5+_,S=1+_;d=m=v=g=null,x=Fl(t,p,r-_,r+k,0,h.minX,h.maxX,u),b=Fl(t,p,r+w,r+S,0,h.minX,h.maxX,u),t=null,x&&(d=Fl(x,p,n-_,n+k,1,h.minY,h.maxY,u),m=Fl(x,p,n+w,n+S,1,h.minY,h.maxY,u),x=null),b&&(v=Fl(b,p,n-_,n+k,1,h.minY,h.maxY,u),g=Fl(b,p,n+w,n+S,1,h.minY,h.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},Hl.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t,s=Wl(t,e=(e%a+a)%a,r);if(this.tiles[s])return Jl(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,c=r;!u&&l>0;)l--,p=Math.floor(p/2),c=Math.floor(c/2),u=this.tiles[Wl(l,p,c)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,p,c),o>1&&console.time("drilling down"),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Jl(this.tiles[s],i):null):null};var Ql=function(t){function e(e,r,n){t.call(this,e,r,$l),n&&(this.loadGeoJSON=n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},e.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new Mu.Performance(r.request);this.loadGeoJSON(r,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));ju(o,!0);try{t._geoJSONIndex=r.cluster?new ml(function(t){var e=t.superclusterOptions,r=t.clusterProperties;if(!r||!e)return e;for(var n={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r),u=0,l=s;u<l.length;u+=1){var p=l[u],c=r[p],h=c[0],f=de(c[1]),y=de("string"==typeof h?[h,["accumulated"],["get",p]]:h);n[p]=f.value,i[p]=y.value}return e.map=function(t){a.properties=t;for(var e={},r=0,i=s;r<i.length;r+=1){var u=i[r];e[u]=n[u].evaluate(o,a)}return e},e.reduce=function(t,e){a.properties=e;for(var r=0,n=s;r<n.length;r+=1){var u=n[r];o.accumulated=t[u],t[u]=i[u].evaluate(o,a)}},e}(r)).load(o.features):function(t,e){return new Hl(t,e)}(o,r.geojsonVtOptions)}catch(i){return e(i)}t.loaded={};var a={};if(n){var s=n.finish();s&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(s)))}e(null,a)}))}},e.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},e.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)!function(t,e){ps(a(t,{type:"json"}),e)}(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(r){return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},e.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},e.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},e.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},e}(Bu);var tp=function(t){var e=this;this.self=t,this.actor=new Ie(t,this),this.layerIndexes={},this.workerSourceTypes={vector:Bu,geojson:Ql},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(Sr.isLoaded())throw new Error("RTL text plugin already registered.");Sr.applyArabicShaping=t.applyArabicShaping,Sr.processBidirectionalText=t.processBidirectionalText,Sr.processStyledBidirectionalText=t.processStyledBidirectionalText}};return tp.prototype.setReferrer=function(t,e){this.referrer=e},tp.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},tp.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},tp.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},tp.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},tp.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},tp.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},tp.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},tp.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},tp.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},tp.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},tp.prototype.loadRTLTextPlugin=function(t,e,r){try{Sr.isLoaded()||(this.self.importScripts(e),r(Sr.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(t){r(t.toString())}},tp.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new La),e},tp.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e][r]},tp.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new Tu),this.demWorkerSources[t][e]},tp.prototype.enforceCacheSizeLimit=function(t,e){!function(t){self.caches&&self.caches.open(es).then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))}(e)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new tp(self)),tp}();
|