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)(n=1))return n;for(;ro?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}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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,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 i="undefined"!=typeof self?self:{},o=Math.pow(2,53)-1;function a(t,e,r){return Math.min(r,Math.max(e,t))}function s(t){var e=[];for(var r in t)e.push(t[r]);return e}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function p(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 c(t,e){return-1!==t.indexOf(e,t.length-e.length)}function h(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function f(t){return Array.isArray(t)?t.map(f):"object"==typeof t&&t?h(t,f):t}var y={};function d(t){y[t]||("undefined"!=typeof console&&console.warn(t),y[t]=!0)}function m(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function v(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\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}var b=null;function w(t){if(null==b){var e=t.navigator?t.navigator.userAgent:null;b=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return b}function _(t){try{var e=i[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var S=k;function k(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var o=0;o=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},k.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}},k.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},k.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},k.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,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,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),c=s.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=o(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),h];case"hsla":if(4!==c.length)return null;h=o(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=o(c[1]),d=o(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*a(v,m,f+1/3)),n(255*a(v,m,f)),n(255*a(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,z=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function M(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var N=[B,V,T,E,D,j,F,R(O),q];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(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=N;r=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 $(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof z)return!0;if(t instanceof Y)return!0;if(t instanceof K)return!0;if(t instanceof H)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in nt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=nt[s],n++}else o=O;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=R(o,a)}else r=nt[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ot=function(t){this.type=j,this.sections=t};ot.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,V)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,R(T))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,D)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l}else{var c=e.parse(t[o],1,O);if(!c)return null;var h=c.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null})}}return new ot(n)},ot.prototype.evaluate=function(t){return new K(this.sections.map((function(e){var r=e.content.evaluate(t);return Q(r)===q?new J("",r,null,null,null):new J(tt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ot.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},at.prototype.eachChild=function(t){t(this.input)},at.prototype.outputDefined=function(){return!1},at.prototype.serialize=function(){return["image",this.input.serialize()]};var st={"to-boolean":E,"to-color":D,"to-number":V,"to-string":T},ut=function(t,e){this.type=t,this.args=e};ut.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=st[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":W(e[0],e[1],e[2],e[3])))return new z(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new rt(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=e[2]||t[1]<=e[1]||t[3]>=e[3])}function dt(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function mt(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function vt(t,e){for(var r,n,i,o,a,s,u,l=!1,p=0,c=e.length;p0&&s<0||a<0&&s>0}function bt(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}ft(e,t)}function At(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Bt(t,e)&&(r=!1)})),r}Mt.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if($(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new rt("Input is not a number.");o=a-1}return 0}Tt.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)},Tt.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new it(e,[t]):"coerce"===r?new ut(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&&"resolvedImage"!==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 et)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Vt)return t(e.boundExpression);if(e instanceof ct&&"error"===e.name)return!1;if(e instanceof ht)return!1;if(e instanceof Mt)return!1;var r=e instanceof ut||e instanceof it,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof et})),!!n&&Pt(e)&&Bt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new pt;try{o=new et(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 this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Tt.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 Tt(this.registry,n,e||null,i,this.errors)},Tt.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 P(n,t))},Tt.prototype.checkSubtype=function(t,e){var r=Z(t,e);return r&&this.error(r),r};var Dt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=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 Dt(i,r,n)},Dt.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[Et(e,n)].evaluate(t)},Dt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ot=Object.freeze({__proto__:null,number:Ft,color:function(t,e,r){return new z(Ft(t.r,e.r,r),Ft(t.g,e.g,r),Ft(t.b,e.b,r),Ft(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ft(t,e[n],r)}))}}),Lt=6/29*3*(6/29),jt=Math.PI/180,qt=180/Math.PI;function Rt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Lt+4/29}function Ut(t){return t>6/29?t*t*t:Lt*(t-4/29)}function Nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gt(t){var e=Zt(t.r),r=Zt(t.g),n=Zt(t.b),i=Rt((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Rt((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Rt((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Xt(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=1*Ut(e),r=.95047*Ut(r),n=1.08883*Ut(n),new z(Nt(3.2404542*r-1.5371385*e-.4985314*n),Nt(-.969266*r+1.8760108*e+.041556*n),Nt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Yt(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Jt={forward:Gt,reverse:Xt,interpolate:function(t,e,r){return{l:Ft(t.l,e.l,r),a:Ft(t.a,e.a,r),b:Ft(t.b,e.b,r),alpha:Ft(t.alpha,e.alpha,r)}}},Kt={forward:function(t){var e=Gt(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*qt;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*jt,r=t.c;return Xt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Yt(t.h,e.h,r),c:Ft(t.c,e.c,r),l:Ft(t.l,e.l,r),alpha:Ft(t.alpha,e.alpha,r)}}},Ht=Object.freeze({__proto__:null,lab:Jt,hcl:Kt}),Wt=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;o1})))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,V)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=D:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p=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 Wt(l,r,n,i,u):e.error("Type "+U(l)+" is not interpolatable.")},Wt.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=Et(e,n),a=Wt.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Ot[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?Kt.reverse(Kt.interpolate(Kt.forward(s),Kt.forward(u),a)):Jt.reverse(Jt.interpolate(Jt.forward(s),Jt.forward(u),a))},Wt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new rt("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new rt("Array index must be an integer, but found "+e+" instead.");return r[e]},ee.prototype.eachChild=function(t){t(this.index),t(this.input)},ee.prototype.outputDefined=function(){return!1},ee.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var re=function(t,e){this.type=E,this.needle=t,this.haystack=e};re.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,O),n=e.parse(t[2],2,O);return r&&n?G(r.type,[E,T,V,B,O])?new re(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead"):null},re.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");return r.indexOf(e)>=0},re.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},re.prototype.outputDefined=function(){return!0},re.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ne=function(t,e,r){this.type=V,this.needle=t,this.haystack=e,this.fromIndex=r};ne.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,O);if(!r||!n)return null;if(!G(r.type,[E,T,V,B,O]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ne(r,n,i):null}return new ne(r,n)},ne.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},ne.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ne.prototype.outputDefined=function(){return!1},ne.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var ie=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};ie.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;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,Q(h)))return null}else r=Q(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,O);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 ie(r,n,y,i,o,d):null},ie.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Q(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ie.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ie.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ie.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,V);if(!r||!n)return null;if(!G(r.type,[R(O),T,O]))return e.error("Expected first argument to be of type array or string, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ae(r.type,r,n,i):null}return new ae(r.type,r,n)},ae.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new rt("Expected first argument to be of type array or string, but found "+U(Q(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},ae.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},ae.prototype.outputDefined=function(){return!1},ae.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var pe=le("==",(function(t,e,r){return e===r}),ue),ce=le("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!ue(0,e,r,n)})),he=le("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),ye=le("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),de=le(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),me=function(t,e,r,n,i){this.type=T,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};me.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,V);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,T)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,T)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,V)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,V))?null:new me(r,i,o,a,s)},me.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))},me.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)},me.prototype.outputDefined=function(){return!1},me.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 ve=function(t){this.type=V,this.input=t};ve.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 "+U(r.type)+" instead."):new ve(r):null},ve.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 rt("Expected value to be of type string or array, but found "+U(Q(e))+" instead.")},ve.prototype.eachChild=function(t){t(this.input)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ge={"==":pe,"!=":ce,">":fe,"<":he,">=":de,"<=":ye,array:it,at:ee,boolean:it,case:oe,coalesce:Qt,collator:ht,format:ot,image:at,in:re,"index-of":ne,interpolate:Wt,"interpolate-hcl":Wt,"interpolate-lab":Wt,length:ve,let:te,literal:et,match:ie,number:it,"number-format":me,object:it,slice:ae,step:Dt,string:it,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,var:Vt,within:Mt};function xe(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=W(r,n,i,a);if(s)throw new rt(s);return new z(r/255*a,n/255*a,i/255*a,a)}function be(t,e){return t in e}function we(t,e){var r=e[t];return void 0===r?null:r}function _e(t){return{type:t}}function Se(t){return{result:"success",value:t}}function ke(t){return{result:"error",value:t}}function Ie(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ae(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ze(t){return!!t.expression&&t.expression.interpolated}function Me(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Pe(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ce(t){return t}function Be(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ve(t,e,r,n,i){return Be(typeof r===i?n[r]:void 0,t.default,e.default)}function Te(t,e,r){if("number"!==Me(r))return Be(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=Et(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Ee(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Me(r))return Be(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=Et(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=Ot[e.type]||Ce;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ht[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 De(t,e,r){return"color"===e.type?r=z.parse(r):"formatted"===e.type?r=K.fromString(r.toString()):"resolvedImage"===e.type?r=H.fromString(r.toString()):Me(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Be(r,t.default,e.default)}ct.register(ge,{error:[{kind:"error"},[T],function(t,e){throw new rt(e[0].evaluate(t))}],typeof:[T,[O],function(t,e){return U(Q(e[0].evaluate(t)))}],"to-rgba":[R(V,4),[D],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[D,[V,V,V],xe],rgba:[D,[V,V,V,V],xe],has:{type:E,overloads:[[[T],function(t,e){return be(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return be(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:O,overloads:[[[T],function(t,e){return we(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return we(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[O,[T],function(t,e){return we(e[0].evaluate(t),t.featureState||{})}],properties:[F,[],function(t){return t.properties()}],"geometry-type":[T,[],function(t){return t.geometryType()}],id:[O,[],function(t){return t.id()}],zoom:[V,[],function(t){return t.globals.zoom}],"heatmap-density":[V,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[V,[],function(t){return t.globals.lineProgress||0}],accumulated:[O,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[V,_e(V),function(t,e){for(var r=0,n=0,i=e;n":[E,[T,O],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->":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[E,[T,O],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-<=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[E,[T,O],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->=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[E,[O],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[E,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[E,[R(T)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[E,[R(O)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[E,[T,R(O)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[E,[T,R(O)],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:E,overloads:[[[E,E],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[_e(E),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in ge}function Le(t,e){var r=new Tt(ge,[],e?function(t){var e={color:D,string:T,number:V,enum:T,boolean:E,formatted:j,resolvedImage:q};return"array"===t.type?R(e[t.value]||O,t.length):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?Se(new Fe(n,e)):ke(r.errors)}Fe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Fe.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new rt("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var je=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ct(e.expression)};je.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},je.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var qe=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ct(e.expression),this.interpolationType=n};function Re(t,e){if("error"===(t=Le(t,e)).result)return t;var r=t.value.expression,n=Pt(r);if(!n&&!Ie(e))return ke([new P("","data expressions not supported")]);var i=Bt(r,["zoom"]);if(!i&&!Ae(e))return ke([new P("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof te)r=t(e.result);else if(e instanceof Qt)for(var n=0,i=e.args;n=0)){var p=t[l];u[l]=Ge[s].shallow.indexOf(l)>=0?p:He(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function We(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||Je(t)||Ke(t)||ArrayBuffer.isView(t)||t instanceof Ne)return t;if(Array.isArray(t))return t.map(We);if("object"==typeof t){var e=t.$name||"Object",r=Ge[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=0?s:We(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var $e=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()})};$e.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))},$e.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Qe=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 $e(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=g()?t:i};Qe.prototype.send=function(t,e,r,n,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=w(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:He(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"",targetMapId:n,sourceMapId:o.mapId})}}},Qe.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else g()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Qe.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Qe.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(We(e.error)):n(null,We(e.data)))}else{var i=!1,o=w(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?He(e):null,data:He(n,o)},o)}:function(t){i=!0},s=null,u=We(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Qe.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var tr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},er=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function rr(t){var e=t.value;return e?[new er(t.key,e,"constants have been deprecated as of v8")]:[]}function nr(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ir(t){if(Array.isArray(t))return t.map(ir);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=ir(t[r]);return e}return nr(t)}function or(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Me(r);if("object"!==u)return[new er(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=Cr;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new er(e,r[l],'unknown property "'+l+'"'));continue}h=Cr}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 er(e,r,'missing required property "'+f+'"'));return s}function ar(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Cr;if("array"!==Me(e))return[new er(o,e,"array expected, "+Me(e)+" found")];if(r.length&&e.length!==r.length)return[new er(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.lengthn.maximum?[new er(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ur(t){var e,r,n,i=t.valueSpec,o=nr(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Me(t.value.stops)&&"array"===Me(t.value.stops[0])&&"object"===Me(t.value.stops[0][0]),p=or({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 er(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(ar({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Me(r)&&0===r.length&&e.push(new er(t.key,r,"array must have at least one stop")),e},default:function(t){return Cr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new er(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new er(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ze(t.valueSpec)&&p.push(new er(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Ie(t.valueSpec)?p.push(new er(t.key,t.value,"property functions not supported")):s&&!Ae(t.valueSpec)&&p.push(new er(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new er(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==Me(o))return[new er(s,o,"array expected, "+Me(o)+" found")];if(2!==o.length)return[new er(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Me(o[0]))return[new er(s,o,"object expected, "+Me(o[0])+" found")];if(void 0===o[0].zoom)return[new er(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new er(s,o,"object stop key must have value")];if(n&&n>nr(o[0].zoom))return[new er(s,o[0].zoom,"stop zoom values must appear in ascending order")];nr(o[0].zoom)!==n&&(n=nr(o[0].zoom),r=void 0,a={}),e=e.concat(or({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:sr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Oe(ir(o[1]))?e.concat([new er(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Cr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Me(t.value),u=nr(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new er(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 er(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 Ie(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new er(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function dr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?mr(t[1],t[2],"=="):"!="===r?xr(mr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?mr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dr))):"all"===r?["all"].concat(t.slice(1).map(dr)):"none"===r?["all"].concat(t.slice(1).map(dr).map(xr)):"in"===r?vr(t[1],t.slice(2)):"!in"===r?xr(vr(t[1],t.slice(2))):"has"===r?gr(t[1]):"!has"===r?xr(gr(t[1])):"within"!==r||t}function mr(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 vr(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(yr)]]:["filter-in-small",t,["literal",e]]}}function gr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function xr(t){return["!",t]}function br(t){return cr(ir(t.value))?lr(M({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Me(r))return[new er(n,r,"array expected, "+Me(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new er(n,r,"filter array must have at least 1 element")];switch(a=a.concat(pr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),nr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===nr(r[1])&&a.push(new er(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new er(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Me(r[1]))&&a.push(new er(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},jr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var qr=Vr,Rr=qr.paintProperty,Ur=qr.layoutProperty,Nr=function(){this.first=!0};Nr.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=1536&&t<=1791},Gr=function(t){return t>=1872&&t<=1919},Xr=function(t){return t>=2208&&t<=2303},Yr=function(t){return t>=11904&&t<=12031},Jr=function(t){return t>=12032&&t<=12255},Kr=function(t){return t>=12272&&t<=12287},Hr=function(t){return t>=12288&&t<=12351},Wr=function(t){return t>=12352&&t<=12447},$r=function(t){return t>=12448&&t<=12543},Qr=function(t){return t>=12544&&t<=12591},tn=function(t){return t>=12704&&t<=12735},en=function(t){return t>=12736&&t<=12783},rn=function(t){return t>=12784&&t<=12799},nn=function(t){return t>=12800&&t<=13055},on=function(t){return t>=13056&&t<=13311},an=function(t){return t>=13312&&t<=19903},sn=function(t){return t>=19968&&t<=40959},un=function(t){return t>=40960&&t<=42127},ln=function(t){return t>=42128&&t<=42191},pn=function(t){return t>=63744&&t<=64255},cn=function(t){return t>=64336&&t<=65023},hn=function(t){return t>=65040&&t<=65055},fn=function(t){return t>=65072&&t<=65103},yn=function(t){return t>=65104&&t<=65135},dn=function(t){return t>=65136&&t<=65279},mn=function(t){return t>=65280&&t<=65519};function vn(t){for(var e=0,r=t;e=65097&&t<=65103)||pn(t)||on(t)||Yr(t)||en(t)||!(!Hr(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||an(t)||sn(t)||nn(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||function(t){return t>=44032&&t<=55215}(t)||Wr(t)||Kr(t)||function(t){return t>=12688&&t<=12703}(t)||Jr(t)||rn(t)||$r(t)&&12540!==t||!(!mn(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)||!(!yn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||hn(t)||function(t){return t>=19904&&t<=19967}(t)||un(t)||ln(t))))}function xn(t){return!(gn(t)||function(t){return!!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hr(t)||$r(t)||function(t){return t>=57344&&t<=63743}(t)||fn(t)||yn(t)||mn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function bn(t){return t>=1424&&t<=2303||cn(t)||dn(t)}function wn(t,e){return!(!e&&bn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function _n(t){for(var e=0,r=t;e=1&&i.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){d("Unable to write to LocalStorage")}},Dn.prototype.processRequests=function(t){},Dn.prototype.postEvent=function(t,e,r,n){var i=this;if(In.EVENTS_URL){var o=function(t){var e=t.match(Tn);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("&"):[]}}(In.EVENTS_URL);o.params.push("access_token="+(n||In.ACCESS_TOKEN||""));var a,s,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:"01",userId:this.anonId},p=e?u(l,e):l,c={url:(a=o,s=a.params.length?"?"+a.params.join("&"):"",a.protocol+"://"+a.authority+a.path+s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=Xn(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},Dn.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Fn,On,Ln=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r;var i=!(!n&&!In.ACCESS_TOKEN),o=Array.isArray(t)&&t.some((function(t){return Cn(t)||Vn(t)}));In.EVENTS_URL&&i&&o&&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(),p(this.anonId)||(this.anonId=l()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(Dn),jn=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){In.EVENTS_URL&&In.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Cn(t)||Vn(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=En(In.ACCESS_TOKEN),n=r?r.u:In.ACCESS_TOKEN,i=n!==this.eventData.tokenU;p(this.anonId)||(this.anonId=l(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.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}(Dn)),qn=(jn.postTurnstileEvent.bind(jn),new Ln);function Rn(){i.caches&&!Fn&&(Fn=i.caches.open("mapbox-tiles"))}function Un(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}qn.postMapLoadEvent.bind(qn),"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var Nn=function(t){function e(e,r,n){401===r&&Vn(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)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Zn=g()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===i.location.protocol?i.parent:i).location.href};var Gn=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Zn())&&!/^\w+:/.test(r))){if(i.fetch&&i.Request&&i.AbortController&&i.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new i.AbortController,o=new i.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Zn(),signal:n.signal}),a=!1,s=!1,u=(r=o.url).indexOf("sku=")>0&&Vn(r);"json"===t.type&&o.headers.set("Accept","application/json");var l=function(r,n,a){if(!s){if(r&&"SecurityError"!==r.message&&d(r),n&&a)return p(n);var l=Date.now();i.fetch(o).then((function(r){if(r.ok){var n=u?r.clone():null;return p(r,n,l)}return e(new Nn(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},p=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(Rn(),Fn){var n={status:e.status,statusText:e.statusText,headers:new i.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var o=x(e.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&n.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===On)try{new Response(new ReadableStream),On=!0}catch(t){On=!1}On?e(t.body):t.blob().then(e)}(e,(function(e){var r=new i.Response(e,n);Rn(),Fn&&Fn.then((function(e){return e.put(Un(t.url),r)})).catch((function(t){return d(t.message)}))})))}}(o,n,u),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(Rn(),!Fn)return e(null);var r=Un(t.url);Fn.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")||0),r=x(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)}(o,l):l(null,null),{cancel:function(){s=!0,a||n.abort()}}}(t,e);if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new i.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 Nn(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Xn=function(t,e){return Gn(u(t,{method:"POST"}),e)},Yn="unavailable",Jn=null,Kn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Yn||null!=Kn.applyArabicShaping},isLoading:function(){return"loading"===Yn},setState:function(t){Yn=t.pluginStatus,Jn=t.pluginURL},isParsed:function(){return null!=Kn.applyArabicShaping&&null!=Kn.processBidirectionalText&&null!=Kn.processStyledBidirectionalText},getPluginURL:function(){return Jn}},Hn=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 Nr,this.transition={})};Hn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Wn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Pe(t))return new Ue(t,e);if(Oe(t)){var r=Re(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=z.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Wn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Wn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var $n=function(t){this.property=t,this.value=new Wn(t,void 0)};$n.prototype.transitioned=function(t,e){return new ti(this.property,this.value,e,u({},t.transition,this.transition),t.now)},$n.prototype.untransitioned=function(){return new ti(this.property,this.value,null,{},0)};var Qn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Qn.prototype.getValue=function(t){return f(this._values[t].value.value)},Qn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new $n(this._values[t].property)),this._values[t].value=new Wn(this._values[t].property,null===e?void 0:f(e))},Qn.prototype.getTransition=function(t){return f(this._values[t].transition)},Qn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new $n(this._values[t].property)),this._values[t].transition=f(e)||void 0},Qn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var ei=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ei.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ii(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(ai),ui=function(t){this.specification=t};ui.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Hn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Hn(Math.floor(e.zoom),e)),t.expression.evaluate(new Hn(Math.floor(e.zoom+1),e)),e)}},ui.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},ui.prototype.interpolate=function(t){return t};var li=function(t){this.specification=t};li.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},li.prototype.interpolate=function(){return!1};var pi=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 Wn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new $n(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Xe("DataDrivenProperty",ai),Xe("DataConstantProperty",oi),Xe("CrossFadedDataDrivenProperty",si),Xe("CrossFadedProperty",ui),Xe("ColorRampProperty",li);var ci=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ri(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Qn(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(),this.paint=new ii(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Ur,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return c(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&&this._validate(Rr,"layers."+this.id+".paint."+t,t,e,r))return!1;if(c(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(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;nthis.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)}},yi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var 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}(yi);vi.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",vi);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);gi.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",gi);var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);xi.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",xi);var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);bi.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",bi);var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var 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}(yi);wi.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",wi);var _i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p){var c=10*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,this.uint16[c+8]=l,this.uint16[c+9]=p,t},e}(yi);_i.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",_i);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,o,a,s,u,l,p,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=c,this.int16[f+11]=h,t},e}(yi);Si.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",Si);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);ki.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ki);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(yi);Ii.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",Ii);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var p=10*t,c=5*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[c+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,t},e}(yi);Ai.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",Ai);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);zi.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",zi);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(yi);Mi.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",Mi);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);Pi.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",Pi);var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);Ci.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",Ci);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=o,this.uint32[x+3]=a,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(yi);Bi.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Bi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z){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,m,v,g,x,b,w,_,S,k,I,A,z)},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,w,_,S,k,I,A,z,M){var P=34*t,C=17*t;return this.int16[P+0]=e,this.int16[P+1]=r,this.int16[P+2]=n,this.int16[P+3]=i,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=u,this.uint16[P+8]=l,this.uint16[P+9]=p,this.uint16[P+10]=c,this.uint16[P+11]=h,this.uint16[P+12]=f,this.uint16[P+13]=y,this.uint16[P+14]=d,this.uint16[P+15]=m,this.uint16[P+16]=v,this.uint16[P+17]=g,this.uint16[P+18]=x,this.uint16[P+19]=b,this.uint16[P+20]=w,this.uint16[P+21]=_,this.uint16[P+22]=S,this.uint32[C+12]=k,this.float32[C+13]=I,this.float32[C+14]=A,this.float32[C+15]=z,this.float32[C+16]=M,t},e}(yi);Vi.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",Vi);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(yi);Ti.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",Ti);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);Ei.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",Ei);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(yi);Di.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Di);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var 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}(yi);Fi.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Fi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(yi);Oi.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Oi);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,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}(yi);Li.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",Li);var ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(fi);ji.prototype.size=20;var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ji(this,t)},e}(Ai);Xe("CollisionBoxArray",qi);var Ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},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},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(fi);Ri.prototype.size=48;var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ri(this,t)},e}(Bi);Xe("PlacedSymbolArray",Ui);var Ni=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(fi);Ni.prototype.size=68;var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ni(this,t)},e}(Vi);Xe("SymbolInstanceArray",Zi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Ti);Xe("GlyphOffsetArray",Gi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ei);Xe("SymbolLineVertexArray",Xi);var Yi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(fi);Yi.prototype.size=8;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yi(this,t)},e}(Di);Xe("FeatureIndexArray",Ji);var Ki=di([{name:"a_pos",components:2,type:"Int16"}],4).members,Hi=function(t){void 0===t&&(t=[]),this.segments=t};function Wi(t,e){return 256*(t=a(Math.floor(t),0,255))+a(Math.floor(e),0,255)}Hi.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Hi.MAX_VERTEX_ARRAY_LENGTH&&d("Max vertices per segment is "+Hi.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Hi.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},Hi.prototype.get=function(){return this.segments},Hi.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|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}})),to=I((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}})),eo=Qi,ro=to;eo.murmur3=Qi,eo.murmur2=ro;var no=function(){this.ids=[],this.positions=[],this.indexed=!1};no.prototype.add=function(t,e,r,n){this.ids.push(oo(t)),this.positions.push(e,r,n)},no.prototype.getPositions=function(t){for(var e=oo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},no.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;ao(e,a,s),ao(r,3*a,3*s),ao(r,3*a+1,3*s+1),ao(r,3*a+2,3*s+2)}s-ns.x+1||ls.y+1)&&d("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Ao(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Io(t):[]}}function zo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Mo=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 vi,this.indexArray=new Ci,this.segments=new Hi,this.programConfigurations=new bo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Po(t,e){for(var r=0;r1){if(To(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Oo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Lo(t,e){for(var r=!1,n=0,i=t.length-1;ne.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 jo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=m(t,e,r[0]);return o!==m(t,e,r[1])||o!==m(t,e,r[2])||o!==m(t,e,r[3])}function qo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ro(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Uo(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=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;zo(this.layoutVertexArray,l,p,-1,-1),zo(this.layoutVertexArray,l,p,1,-1),zo(this.layoutVertexArray,l,p,1,1),zo(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Xe("CircleBucket",Mo,{omit:["layers"]});var No=new pi({"circle-sort-key":new ai(tr.layout_circle["circle-sort-key"])}),Zo={paint:new pi({"circle-radius":new ai(tr.paint_circle["circle-radius"]),"circle-color":new ai(tr.paint_circle["circle-color"]),"circle-blur":new ai(tr.paint_circle["circle-blur"]),"circle-opacity":new ai(tr.paint_circle["circle-opacity"]),"circle-translate":new oi(tr.paint_circle["circle-translate"]),"circle-translate-anchor":new oi(tr.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new oi(tr.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new oi(tr.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ai(tr.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ai(tr.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ai(tr.paint_circle["circle-stroke-opacity"])}),layout:No},Go="undefined"!=typeof Float32Array?Float32Array:Array;function Xo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Yo(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)}),Jo=new Go(4),Go!=Float32Array&&(Jo[0]=0,Jo[1]=0,Jo[2]=0,Jo[3]=0);var Jo,Ko=function(t){function e(e){t.call(this,e,Zo)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Mo(t)},e.prototype.queryRadius=function(t){var e=t;return qo("circle-radius",this,e)+qo("circle-stroke-width",this,e)+Ro(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=Uo(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 Ho(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;ft.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;u80*r){n=o=t[0],i=a=t[1];for(var y=r;yo&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return fa(h,f,r,n,i,l),f}function ca(t,e,r,n,i){var o,a;if(i===Da(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Va(o,t[o],t[o+1],a);return a&&Aa(a,a.next)&&(Ta(a),a=a.next),a}function ha(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Aa(n,n.next)&&0!==Ia(n.prev,n,n.next))n=n.next;else{if(Ta(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function fa(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=wa(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;e0||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?da(t,n,i,o):ya(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ta(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?fa(t=ma(ha(t),e,r),e,r,n,i,o,2):2===a&&va(t,e,r,n,i,o):fa(ha(t),e,r,n,i,o,1);break}}}function ya(t){var e=t.prev,r=t,n=t.next;if(Ia(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Sa(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ia(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function da(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ia(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=wa(i.x=l&&h&&h.z<=p;){if(c!==t.prev&&c!==t.next&&Sa(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&Ia(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==t.prev&&h!==t.next&&Sa(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Ia(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=l;){if(c!==t.prev&&c!==t.next&&Sa(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&Ia(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=p;){if(h!==t.prev&&h!==t.next&&Sa(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Ia(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function ma(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Aa(i,o)&&za(i,n,n.next,o)&&Ca(i,o)&&Ca(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ta(n),Ta(n.next),n=t=o),n=n.next}while(n!==t);return ha(n)}function va(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ka(a,s)){var u=Ba(a,s);return a=ha(a,a.next),u=ha(u,u.next),fa(a,e,r,n,i,o),void fa(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function ga(t,e){return t.x-e.x}function xa(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.x&&n.x>=p&&i!==n.x&&Sa(or.x||n.x===r.x&&ba(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ba(e,t);ha(e,e.next),ha(r,r.next)}}function ba(t,e){return Ia(t.prev,t,e.prev)<0&&Ia(e.next,t,t.next)<0}function wa(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 _a(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function ka(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&&za(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ca(t,e)&&Ca(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)&&(Ia(t.prev,t,e.prev)||Ia(t,e.prev,e))||Aa(t,e)&&Ia(t.prev,t,t.next)>0&&Ia(e.prev,e,e.next)>0)}function Ia(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Aa(t,e){return t.x===e.x&&t.y===e.y}function za(t,e,r,n){var i=Pa(Ia(t,e,r)),o=Pa(Ia(t,e,n)),a=Pa(Ia(r,n,t)),s=Pa(Ia(r,n,e));return i!==o&&a!==s||!(0!==i||!Ma(t,r,e))||!(0!==o||!Ma(t,n,e))||!(0!==a||!Ma(r,t,n))||!(0!==s||!Ma(r,e,n))}function Ma(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 Pa(t){return t>0?1:t<0?-1:0}function Ca(t,e){return Ia(t.prev,t,t.next)<0?Ia(t,e,t.next)>=0&&Ia(t,t.prev,e)>=0:Ia(t,e,t.prev)<0||Ia(t,t.next,e)<0}function Ba(t,e){var r=new Ea(t.i,t.x,t.y),n=new Ea(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 Va(t,e,r,n){var i=new Ea(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 Ta(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 Ea(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 Da(t,e,r,n){for(var i=0,o=e,a=r-n;on;){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);t(e,r,Math.max(n,Math.floor(r-s*l/a+p)),Math.min(i,Math.floor(r+(a-s)*l/a+p)),o)}var c=e[r],h=n,f=i;for(Oa(e,n,r),o(e[i],c)>0&&Oa(e,n,i);h0;)f--}0===o(e[n],c)?Oa(e,n,f):Oa(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||La)}function Oa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function La(t,e){return te?1:0}function ja(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},ua.default=la;var Na=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 vi,this.indexArray=new Ci,this.indexArray2=new Fi,this.programConfigurations=new bo(t.layers,t.zoom),this.segments=new Hi,this.segments2=new Hi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Na.prototype.populate=function(t,e,r){this.hasPattern=Ra("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>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},Ka.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>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},Ka.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=Ka.types[this.type];function p(t){for(var e=0;e>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 es(t,e,r){if(3===t){var n=new $a(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Qa.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 Ja(this._pbf,e,this.extent,this._keys,this._values)};var rs={VectorTile:function(t,e){this.layers=t.readFields(es,{},e)},VectorTileFeature:Ja,VectorTileLayer:$a},ns=rs.VectorTileFeature.types,is=Math.pow(2,13);function os(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*is)+a,i*is*2,o*is*2,Math.round(s))}var as=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 xi,this.indexArray=new Ci,this.programConfigurations=new bo(t.layers,t.zoom),this.segments=new Hi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ss(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}as.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Ra("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||V.every((function(t){return t.y<0}))||V.every((function(t){return t.y>8192}))))for(var d=0,m=0;m=1){var g=y[m-1];if(!ss(v,g)){c.vertexLength+4>Hi.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),os(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),os(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),os(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),os(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var w=c.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+u>Hi.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===ns[t.type]){for(var _=[],S=[],k=c.vertexLength,I=0,A=s;I=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(S&&v>l){var I=p.dist(f);if(I>2*c){var A=p.sub(p.sub(f)._mult(c/I)._round());this.updateDistance(f,A),this.addCurrentVertex(A,d,0,0,h),f=A}}var z=f&&y,M=z?r:s?"butt":n;if(z&&"round"===M&&(wi&&(M="bevel"),"bevel"===M&&(w>2&&(M="flipbevel"),w100)g=m.mult(-1);else{var P=w*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(P*(k?-1:1))}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h)}else if("bevel"===M||"fakeround"===M){var C=-Math.sqrt(w*w-1),B=k?C:0,V=k?0:C;if(f&&this.addCurrentVertex(p,d,B,V,h),"fakeround"===M)for(var T=Math.round(180*_/Math.PI/20),E=1;E2*c){var q=p.add(y.sub(p)._mult(c/j)._round());this.updateDistance(p,q),this.addCurrentVertex(q,m,0,0,h),p=q}}}}},vs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>ms/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},vs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(ms-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},vs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},vs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Xe("LineBucket",vs,{omit:["layers","patternFeatures"]});var gs=new pi({"line-cap":new oi(tr.layout_line["line-cap"]),"line-join":new ai(tr.layout_line["line-join"]),"line-miter-limit":new oi(tr.layout_line["line-miter-limit"]),"line-round-limit":new oi(tr.layout_line["line-round-limit"]),"line-sort-key":new ai(tr.layout_line["line-sort-key"])}),xs={paint:new pi({"line-opacity":new ai(tr.paint_line["line-opacity"]),"line-color":new ai(tr.paint_line["line-color"]),"line-translate":new oi(tr.paint_line["line-translate"]),"line-translate-anchor":new oi(tr.paint_line["line-translate-anchor"]),"line-width":new ai(tr.paint_line["line-width"]),"line-gap-width":new ai(tr.paint_line["line-gap-width"]),"line-offset":new ai(tr.paint_line["line-offset"]),"line-blur":new ai(tr.paint_line["line-blur"]),"line-dasharray":new ui(tr.paint_line["line-dasharray"]),"line-pattern":new si(tr.paint_line["line-pattern"]),"line-gradient":new li(tr.paint_line["line-gradient"])}),layout:gs},bs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Hn(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=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(ai))(xs.paint.properties["line-width"].specification);bs.useIntegerZoom=!0;var ws=function(t){function e(e){t.call(this,e,xs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Dt,this.gradientVersion=(this.gradientVersion+1)%o)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=bs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new vs(t)},e.prototype.queryRadius=function(t){var e=t,r=_s(qo("line-width",this,e),qo("line-gap-width",this,e)),n=qo("line-offset",this,e);return r/2+Math.abs(n)+Ro(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=Uo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*_s(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=3)for(var o=0;o0?e+2*t:t}var Ss=di([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ks=di([{name:"a_projected_pos",components:3,type:"Float32"}],4),Is=(di([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),di([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),As=(di([{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"}]),di([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4));function zs(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()),Kn.applyArabicShaping&&(t=Kn.applyArabicShaping(t)),t}(t.text,e,r)})),t}di([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),di([{name:"triangle",components:3,type:"Uint16"}]),di([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),di([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),di([{type:"Float32",name:"offsetX"}]),di([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ms={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ps=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>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)},Cs=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<>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<0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},Bs=Vs;function Vs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Vs.Varint=0,Vs.Fixed64=1,Vs.Bytes=2,Vs.Fixed32=5;var Ts="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Es(t){return t.type===Vs.Bytes?t.readVarint()+t.pos:t.pos+1}function Ds(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Fs(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 Os(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Js(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Ks(t){for(var e=0,r=0,n=0,i=t;n=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>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=Xs(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Js(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Xs(this.buf,this.pos)+4294967296*Xs(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Xs(this.buf,this.pos)+4294967296*Js(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ps(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ps(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(n=(112&(i=o[r.pos++]))>>4,i<128)return Ds(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return Ds(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return Ds(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return Ds(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return Ds(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return Ds(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=this.pos;return this.pos=t,t-e>=12&&Ts?function(t,e,r){return Ts.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?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?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,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,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Vs.Bytes)return t.push(this.readVarint(e));var r=Es(this);for(t=t||[];this.pos127;);else if(e===Vs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Vs.Fixed32)this.pos+=4;else{if(e!==Vs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(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)),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,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(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;o55295&&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&&Fs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Cs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cs(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=128&&Fs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Vs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Os,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ls,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,js,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,qs,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Us,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ns,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Zs,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gs,e)},writeBytesField:function(t,e){this.writeTag(t,Vs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Vs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Vs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Vs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Vs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Vs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Vs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Vs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Vs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Vs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Hs=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},Ws={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Ws.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Ws.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Ws.tlbr.get=function(){return this.tl.concat(this.br)},Ws.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Hs.prototype,Ws);var $s=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Ks(i),a=new ra({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;ra.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var p in e){var c=e[p],h=n[p].paddedRect,f=h.x+1,y=h.y+1,d=c.data.width,m=c.data.height;ra.copy(c.data,a,{x:0,y:0},{x:f,y:y},c.data),ra.copy(c.data,a,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),ra.copy(c.data,a,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),ra.copy(c.data,a,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),ra.copy(c.data,a,{x:0,y:0},{x:f+d,y:y},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};$s.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 Hs(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},$s.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)},$s.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Xe("ImagePosition",Hs),Xe("ImageAtlas",$s);var Qs={horizontal:1,vertical:2,horizontalOnly:3},tu=function(){this.scale=1,this.fontStack="",this.imageName=null};tu.forText=function(t,e){var r=new tu;return r.scale=t||1,r.fontStack=e,r},tu.forImage=function(t){var e=new tu;return e.imageName=t,e};var eu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function ru(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m,v=eu.fromFeature(t,i);c===Qs.vertical&&v.verticalizePunctuation();var g=Kn.processBidirectionalText,x=Kn.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,w=g(v.toString(),lu(v,l,o,e,n,f,y));b0&&L>I&&(I=L)}else{var j=r[z.fontStack],q=j&&j[P];if(q&&q.rect)V=q.rect,B=q.metrics;else{var R=e[z.fontStack],U=R&&R[P];if(!U)continue;B=U.metrics}C=24*(w-z.scale)}D?(t.verticalizable=!0,k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=E*z.scale+l):(k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=B.advance*z.scale+l)}0!==k.length&&(y=Math.max(h-l,y),cu(k,0,k.length-1,m,I)),h=0;var N=o*w+I;S.lineOffset=Math.max(I,_),f+=N,d=Math.max(N,d),++v}else f+=o,++v}var Z,G=f- -17,X=pu(a),Y=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,p=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var c=0,h=t;c=0&&n>=t&&nu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},eu.prototype.substring=function(t,e){var r=new eu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},eu.prototype.toString=function(){return this.text},eu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},eu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(tu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var nu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},iu={};function ou(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function au(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,c=0,h=0;h-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;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(c)}return!0}function mu(t){for(var e=0,r=0;rl){var y=(l-u)/f,d=Ft(c.x,h.x,y),m=Ft(c.y,h.y,y),v=new fu(d,m,h.angleTo(c),p);return v._round(),!a||du(t,v,s,a,e)?v:void 0}u+=f}}function bu(t,e,r,n,i,o,a,s,u){var l=vu(n,o,a),p=gu(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=0&&w=0&&_=0&&f+p<=c){var S=new fu(w,_,x,d);S._round(),i&&!du(e,S,a,i,o)||y.push(S)}}h+=g}return u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l)),y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}function wu(t,e,n,i){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=h.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,w=0,_=m,S=0,k=v,I=0,A=g;if(a.content&&i){var z=a.content;x=_u(h,0,z[0]),w=_u(f,0,z[1]),b=_u(h,z[0],z[2]),_=_u(f,z[1],z[3]),S=z[0]-x,I=z[1]-w,k=z[2]-z[0]-b,A=z[3]-z[1]-_}var M=function(i,o,u,l){var h=ku(i.stretch-x,b,p,t.left),f=Iu(i.fixed-S,k,i.stretch,d),y=ku(o.stretch-w,_,c,t.top),v=Iu(o.fixed-I,A,o.stretch,m),g=ku(u.stretch-x,b,p,t.left),z=Iu(u.fixed-S,k,u.stretch,d),M=ku(l.stretch-w,_,c,t.top),P=Iu(l.fixed-I,A,l.stretch,m),C=new r(h,y),B=new r(g,y),V=new r(g,M),T=new r(h,M),E=new r(f/s,v/s),D=new r(z/s,P/s),F=e*Math.PI/180;if(F){var O=Math.sin(F),L=Math.cos(F),j=[L,-O,O,L];C._matMult(j),B._matMult(j),T._matMult(j),V._matMult(j)}var q=i.stretch+i.fixed,R=o.stretch+o.fixed;return{tl:C,tr:B,bl:T,br:V,tex:{x:a.paddedRect.x+1+q,y:a.paddedRect.y+1+R,w:u.stretch+u.fixed-q,h:l.stretch+l.fixed-R},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:E,pixelOffsetBR:D,minFontScaleX:k/s/p,minFontScaleY:A/s/c,isSDF:n}};if(i&&(a.stretchX||a.stretchY))for(var P=Su(h,v,d),C=Su(f,g,m),B=0;B0&&(y=Math.max(10,y),this.circleDiameter=y)}else{var d=a.top*s-u,m=a.bottom*s+u,v=a.left*s-u,g=a.right*s+u,x=a.collisionPadding;if(x&&(v-=x[0]*s,d-=x[1]*s,g+=x[2]*s,m+=x[3]*s),p){var b=new r(v,d),w=new r(g,d),_=new r(v,m),S=new r(g,m),k=p*Math.PI/180;b._rotate(k),w._rotate(k),_._rotate(k),S._rotate(k),v=Math.min(b.x,w.x,_.x,S.x),g=Math.max(b.x,w.x,_.x,S.x),d=Math.min(b.y,w.y,_.y,S.y),m=Math.max(b.y,w.y,_.y,S.y)}t.emplaceBack(e.x,e.y,v,d,g,m,n,i,o)}this.boxEndIndex=t.length},zu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Mu),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 Mu(t,e){return te?1:0}function Pu(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;la)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=Math.min(a-i,s-o),h=c/2,f=new zu([],Cu);if(0===c)return new r(i,o);for(var y=i;ym.d||!m.d)&&(m=g,n&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Bu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Bu(g.p.x+h,g.p.y-h,h,t)),f.push(new Bu(g.p.x-h,g.p.y+h,h,t)),f.push(new Bu(g.p.x+h,g.p.y+h,h,t)),v+=4)}return n&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Cu(t,e){return e.max-t.max}function Bu(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;it.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,Fo(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}zu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},zu.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}},zu.prototype.peek=function(){return this.data[0]},zu.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},zu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var Vu=Number.POSITIVE_INFINITY;function Tu(t,e,n,i,o,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),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.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Hn(c.minZoom),s),l["text-size"].possiblyEvaluate(new Hn(h),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,y=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Hn(f.minZoom),s),l["icon-size"].possiblyEvaluate(new Hn(y),s)]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Hn(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Hn(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new Hn(18));for(var m=24*u.get("text-line-height"),v="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),g=u.get("text-keep-upright"),x=u.get("text-size"),b=function(){var a,l,c=_[w],h=u.get("text-font").evaluate(c,{},s).join(","),f=x.evaluate(c,{},s),y=p.layoutTextSize.evaluate(c,{},s),b=p.layoutIconSize.evaluate(c,{},s),S={horizontal:{},vertical:void 0},k=c.text,I=[0,0];if(k){var A=k.toString(),z=24*u.get("text-letter-spacing").evaluate(c,{},s),M=function(t){for(var e=0,r=t;e=8192||u.y<0||u.y>=8192||function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,m,v,g,x,b,w,_,S,k,I){var A,z,M,P,C,B=t.addToLineVertexArray(e,r),V=0,T=0,E=0,D=0,F=-1,O=-1,L={},j=eo(""),q=0,R=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(q=(A=s.layout.get("text-offset").evaluate(w,{},k).map((function(t){return 24*t})))[0],R=A[1]):(q=24*s.layout.get("text-radial-offset").evaluate(w,{},k),R=Vu),t.allowVerticalPlacement&&n.vertical){var U=s.layout.get("text-rotate").evaluate(w,{},k)+90;P=new Au(u,e,l,p,c,n.vertical,h,f,y,U),a&&(C=new Au(u,e,l,p,c,a,v,g,y,U))}if(i){var N=s.layout.get("icon-rotate").evaluate(w,{}),Z="none"!==s.layout.get("icon-text-fit"),G=wu(i,N,S,Z),X=a?wu(a,N,S,Z):void 0;M=new Au(u,e,l,p,c,i,v,g,!1,N),V=4*G.length;var Y=t.iconSizeData,J=null;"source"===Y.kind?(J=[128*s.layout.get("icon-size").evaluate(w,{})])[0]>32640&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((J=[128*_.compositeIconSizes[0].evaluate(w,{},k),128*_.compositeIconSizes[1].evaluate(w,{},k)])[0]>32640||J[1]>32640)&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,J,b,x,w,!1,e,B.lineStartIndex,B.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1,X&&(T=4*X.length,t.addSymbols(t.icon,X,J,b,x,w,Qs.vertical,e,B.lineStartIndex,B.lineLength,-1,k),O=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var H=n.horizontal[K];if(!z){j=eo(H.text);var W=s.layout.get("text-rotate").evaluate(w,{},k);z=new Au(u,e,l,p,c,H,h,f,y,W)}var $=1===H.positionedLines.length;if(E+=Du(t,e,H,o,s,y,w,m,B,n.vertical?Qs.horizontal:Qs.horizontalOnly,$?Object.keys(n.horizontal):[K],L,F,_,k),$)break}n.vertical&&(D+=Du(t,e,n.vertical,o,s,y,w,m,B,Qs.vertical,["vertical"],L,O,_,k));var Q=z?z.boxStartIndex:t.collisionBoxArray.length,tt=z?z.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(z,st),st=ut(P,st),st=ut(M,st);var lt=(st=ut(C,st))>-1?1:0;lt&&(st*=I/24),t.glyphOffsetArray.length>=Gu.MAX_GLYPHS&&d("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,F,O,j,Q,tt,et,rt,nt,it,ot,at,l,E,D,V,T,lt,0,h,q,R,st)}(t,u,r,n,i,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,S,A,l,w,k,z,m,e,a,p,c,s)};if("line"===M)for(var V=0,T=function(t,e,n,i,o){for(var a=[],s=0;s=i&&h.x>=i||(c.x>=i?c=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=i&&(h=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round():h.y>=o&&(h=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round()),l&&c.equals(l[l.length-1])||a.push(l=[c]),l.push(h)))))}return a}(e.geometry,0,0,8192,8192);V1){var R=xu(q,I,n.vertical||v,i,24,b);R&&B(q,R)}}else if("Polygon"===e.type)for(var U=0,N=ja(e.geometry,0);U32640&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((x=[128*y.compositeTextSizes[0].evaluate(s,{},m),128*y.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||x[1]>32640)&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,v,x,u,a,s,p,e,l.lineStartIndex,l.lineLength,f,m);for(var b=0,w=c;b=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=i.get("symbol-sort-key");if(this.features=[],u||l){for(var c=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,y=new Hn(this.zoom),d=0,m=t;d=0;for(var V=0,T=k.sections;V=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;u0},Gu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Gu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Gu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Gu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Gu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||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=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",Gu,{omit:["layers","collisionBoxArray","features","compareText"]}),Gu.MAX_GLYPHS=65535,Gu.addDynamicAttributes=Ru;var Xu=new pi({"symbol-placement":new oi(tr.layout_symbol["symbol-placement"]),"symbol-spacing":new oi(tr.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new oi(tr.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ai(tr.layout_symbol["symbol-sort-key"]),"symbol-z-order":new oi(tr.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new oi(tr.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new oi(tr.layout_symbol["icon-ignore-placement"]),"icon-optional":new oi(tr.layout_symbol["icon-optional"]),"icon-rotation-alignment":new oi(tr.layout_symbol["icon-rotation-alignment"]),"icon-size":new ai(tr.layout_symbol["icon-size"]),"icon-text-fit":new oi(tr.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new oi(tr.layout_symbol["icon-text-fit-padding"]),"icon-image":new ai(tr.layout_symbol["icon-image"]),"icon-rotate":new ai(tr.layout_symbol["icon-rotate"]),"icon-padding":new oi(tr.layout_symbol["icon-padding"]),"icon-keep-upright":new oi(tr.layout_symbol["icon-keep-upright"]),"icon-offset":new ai(tr.layout_symbol["icon-offset"]),"icon-anchor":new ai(tr.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new oi(tr.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new oi(tr.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new oi(tr.layout_symbol["text-rotation-alignment"]),"text-field":new ai(tr.layout_symbol["text-field"]),"text-font":new ai(tr.layout_symbol["text-font"]),"text-size":new ai(tr.layout_symbol["text-size"]),"text-max-width":new ai(tr.layout_symbol["text-max-width"]),"text-line-height":new oi(tr.layout_symbol["text-line-height"]),"text-letter-spacing":new ai(tr.layout_symbol["text-letter-spacing"]),"text-justify":new ai(tr.layout_symbol["text-justify"]),"text-radial-offset":new ai(tr.layout_symbol["text-radial-offset"]),"text-variable-anchor":new oi(tr.layout_symbol["text-variable-anchor"]),"text-anchor":new ai(tr.layout_symbol["text-anchor"]),"text-max-angle":new oi(tr.layout_symbol["text-max-angle"]),"text-writing-mode":new oi(tr.layout_symbol["text-writing-mode"]),"text-rotate":new ai(tr.layout_symbol["text-rotate"]),"text-padding":new oi(tr.layout_symbol["text-padding"]),"text-keep-upright":new oi(tr.layout_symbol["text-keep-upright"]),"text-transform":new ai(tr.layout_symbol["text-transform"]),"text-offset":new ai(tr.layout_symbol["text-offset"]),"text-allow-overlap":new oi(tr.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new oi(tr.layout_symbol["text-ignore-placement"]),"text-optional":new oi(tr.layout_symbol["text-optional"])}),Yu={paint:new pi({"icon-opacity":new ai(tr.paint_symbol["icon-opacity"]),"icon-color":new ai(tr.paint_symbol["icon-color"]),"icon-halo-color":new ai(tr.paint_symbol["icon-halo-color"]),"icon-halo-width":new ai(tr.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ai(tr.paint_symbol["icon-halo-blur"]),"icon-translate":new oi(tr.paint_symbol["icon-translate"]),"icon-translate-anchor":new oi(tr.paint_symbol["icon-translate-anchor"]),"text-opacity":new ai(tr.paint_symbol["text-opacity"]),"text-color":new ai(tr.paint_symbol["text-color"],{runtimeType:D,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new ai(tr.paint_symbol["text-halo-color"]),"text-halo-width":new ai(tr.paint_symbol["text-halo-width"]),"text-halo-blur":new ai(tr.paint_symbol["text-halo-blur"]),"text-translate":new oi(tr.paint_symbol["text-translate"]),"text-translate-anchor":new oi(tr.paint_symbol["text-translate-anchor"])}),layout:Xu},Ju=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:B,this.defaultValue=t};Ju.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},Ju.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Ju.prototype.outputDefined=function(){return!1},Ju.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Ju,{omit:["defaultValue"]});var Ku=function(t){function e(e){t.call(this,e,Yu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;othis._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},cl.convert=function(t){return!t||t instanceof cl?t:new cl(t)};var hl=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")};hl.prototype.wrap=function(){return new hl(-180==(t=((this.lng- -180)%360+360)%360-180)?180:t,this.lat);var t},hl.prototype.toArray=function(){return[this.lng,this.lat]},hl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},hl.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},hl.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 cl(new hl(this.lng-r,this.lat-e),new hl(this.lng+r,this.lat+e))},hl.convert=function(t){if(t instanceof hl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new hl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new hl(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var fl=2*Math.PI*6371008.8;function yl(t){return fl*Math.cos(t*Math.PI/180)}function dl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var ml=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};ml.fromLngLat=function(t,e){void 0===e&&(e=0);var r=hl.convert(t);return new ml((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,function(t,e){return t/yl(e)}(e,r.lat))},ml.prototype.toLngLat=function(){return new hl(360*this.x-180,dl(this.y))},ml.prototype.toAltitude=function(){return this.z*yl(dl(this.y))},ml.prototype.meterInMercatorCoordinateUnits=function(){return 1/fl*(t=dl(this.y),1/Math.cos(t*Math.PI/180));var t};var vl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=bl(0,t,t,e,r)};vl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},vl.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=pl(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=pl(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<this.canonical.z?new xl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},xl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?bl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):bl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},xl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},xl.prototype.children=function(t){if(this.overscaledZ>=t)return[new xl(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 xl(e,this.wrap,e,r,n),new xl(e,this.wrap,e,r+1,n),new xl(e,this.wrap,e,r,n+1),new xl(e,this.wrap,e,r+1,n+1)]},xl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},wl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new rs.VectorTile(new Bs(this.rawTileData)).layers,this.sourceLayerCoder=new sl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},wl.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=fr(a.filter),l=t.queryGeometry,p=t.queryPadding*s,c=Sl(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=Sl(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-p,f.minY-p,f.maxX+p,f.maxY+p,(function(e,n,i,o){return function(t,e,n,i,o){for(var a=0,s=t;a=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=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),y=this.vtLayers[f].feature(n);if(i.needGeometry){var d=Ao(y,!0);if(!i.filter(new Hn(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!i.filter(new Hn(this.tileID.overscaledZ),y))return;for(var m=this.getId(y,f),v=0;v=M.maxzoom||"none"!==M.visibility&&(zl(z,this.zoom,r),(y[M.id]=M.createBucket({index:u.bucketLayerIDs.length,layers:z,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(w,m,this.tileID.canonical),u.bucketLayerIDs.push(z.map((function(t){return t.id}))))}}}var P=h(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?n.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){l||(l=t,p=e,V.call(o))})):p={};var C=Object.keys(m.iconDependencies);C.length?n.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){l||(l=t,c=e,V.call(o))})):c={};var B=Object.keys(m.patternDependencies);function V(){if(l)return i(l);if(p&&c&&f){var t=new Il(p),e=new $s(c,f);for(var n in y){var o=y[n];o instanceof Gu?(zl(o.layers,this.zoom,r),Tu(o,p,t.positions,c,e.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):o.hasPattern&&(o instanceof vs||o instanceof Na||o instanceof as)&&(zl(o.layers,this.zoom,r),o.addFeatures(m,this.tileID.canonical,e.patternPositions))}this.status="done",i(null,{buckets:s(y).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null})}}B.length?n.send("getImages",{icons:B,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){l||(l=t,f=e,V.call(o))})):f={},V.call(this)};var Ml=i.performance,Pl=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Ml.mark(this._marks.start)};function Cl(t,e){var r=function(t,e){return Gn(u(t,{type:"arrayBuffer"}),e)}(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new rs.VectorTile(new Bs(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Pl.prototype.finish=function(){Ml.mark(this._marks.end);var t=Ml.getEntriesByName(this._marks.measure);return 0===t.length&&(Ml.measure(this._marks.measure,this._marks.start,this._marks.end),t=Ml.getEntriesByName(this._marks.measure),Ml.clearMarks(this._marks.start),Ml.clearMarks(this._marks.end),Ml.clearMeasures(this._marks.measure)),t};var Bl=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||Cl,this.loading={},this.loaded={}};Bl.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Pl(t.request),o=this.loading[n]=new Al(t);o.abort=this.loadVectorData(t,(function(t,a){if(delete r.loading[n],t||!a)return o.status="done",r.loaded[n]=o,e(t);var s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=a.vectorTile,o.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,u({rawTileData:s.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Bl.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},Bl.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()},Bl.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Vl=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 d('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i=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)},Vl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Vl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Vl.prototype.getPixels=function(){return new ra({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Vl.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=Math.abs(s)?r-u+s:s-u+r,r=u}r+n>=0!=!!e&&t.reverse()}El.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=Tl&&i instanceof Tl?this.getImageData(i):i,a=new Vl(r,o,n);this.loaded=this.loaded||{},this.loaded[r]=a,e(null,a)},El.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var e=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new ra({width:e.width,height:e.height},e.data)},El.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Ol=rs.VectorTileFeature.prototype.toGeoJSON,Ll=function(t){this._feature=t,this.extent=8192,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};Ll.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,n=this._feature.geometry;e>31}function $l(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>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);t(e,r,n,Math.max(i,Math.floor(n-u*p/s+c)),Math.min(o,Math.floor(n+(s-u)*p/s+c)),a)}var h=r[2*n+a],f=i,y=o;for(tp(e,r,i,n),r[2*o+a]>h&&tp(e,r,i,o);fh;)y--}r[2*i+a]===h?tp(e,r,i,y):tp(e,r,++y,o),y<=n&&(i=y+1),n<=y&&(o=y-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};op.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++)u=e[2*y+1],(s=e[2*y])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);u=e[2*d+1],(s=e[2*d])>=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)},op.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++)rp(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];rp(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 ap={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},sp=function(t){this.options=yp(Object.create(ap),t),this.trees=new Array(this.options.maxZoom+1)};function up(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function lp(t,e){var r=t.geometry.coordinates,n=r[1];return{x:hp(r[0]),y:fp(n),zoom:1/0,index:e,parentId:-1}}function pp(t){return{type:"Feature",id:t.id,properties:cp(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 cp(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return yp(yp({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function hp(t){return t/360+.5}function fp(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 yp(t,e){for(var r in e)t[r]=e[r];return t}function dp(t){return t.x}function mp(t){return t.y}function vp(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 gp(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)xp(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(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;fa)o=f,a=y;else if(y===a){var d=Math.abs(f-s);di&&(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 Sp(t,e,r,n){for(var i=0;i1?1:r}function Ap(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&y=n)){var d=[];if("Point"===h||"MultiPoint"===h)zp(c,d,r,n,i);else if("LineString"===h)Mp(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)Cp(c,d,r,n,i,!1);else if("Polygon"===h)Cp(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function Mp(t,e,r,n,i,o,a){for(var s,u,l=Pp(t),p=0===i?Vp:Tp,c=t.start,h=0;hr&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x=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=Pp(t)),a&&(c+=s)}var w=t.length-3;f=t[w],y=t[w+1],d=t[w+2],(g=0===i?f:y)>=r&&g<=n&&Bp(l,f,y,d),w=l.length-3,o&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&Bp(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Pp(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Cp(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function jp(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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;n0===e)for(n=0,i=t.length;n24)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=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new op(s,dp,mp,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},sp.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(hp(r),fp(o),hp(i),fp(n));pe&&(h+=d.numPoints||1)}if(h>=o){for(var m=u.x*c,v=u.y*c,g=i&&c>1?this._map(u,!0):null,x=(s<<5)+(e+1)+this.points.length,b=0,w=p;b1)for(var k=0,I=p;k>5},sp.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},sp.prototype._map=function(t,e){if(t.numPoints)return e?yp({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?yp({},n):n},Rp.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Rp.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<1&&console.time("creation"),h=this.tiles[c]=Lp(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<1&&console.time("clipping");var d,m,v,g,x,b,w=.5*u.buffer/u.extent,_=.5-w,S=.5+w,k=1+w;d=m=v=g=null,x=Ap(t,p,r-w,r+S,0,h.minX,h.maxX,u),b=Ap(t,p,r+_,r+k,0,h.minX,h.maxX,u),t=null,x&&(d=Ap(x,p,n-w,n+S,1,h.minY,h.maxY,u),m=Ap(x,p,n+_,n+k,1,h.minY,h.maxY,u),x=null),b&&(v=Ap(b,p,n-w,n+S,1,h.minY,h.maxY,u),g=Ap(b,p,n+_,n+k,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)}}},Rp.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<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[Up(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]?Fp(this.tiles[s],i):null):null};var Zp=function(t){function e(e,r,n,i){t.call(this,e,r,n,Np),i&&(this.loadGeoJSON=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 Pl(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."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n