define(["./createTaskProcessorWorker","./when-b60132fc","./earcut-2.2.1-20c8012f"],(function(t,e,r){"use strict";var n=function(t,e,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,p=-7,c=r?i-1:0,f=r?-1:1,h=t[e+c];for(c+=f,a=h&(1<<-p)-1,h>>=-p,p+=s;p>0;a=256*a+t[e+c],c+=f,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+t[e+c],c+=f,p-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=l}return(h?-1:1)*o*Math.pow(2,a-n)},i=function(t,e,r,n,i,a){var o,s,u,l=8*a-i-1,p=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+c>=1?f/u:f*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=p?(s=0,o=p):o+c>=1?(s=(e*u-1)*Math.pow(2,i),o+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[r+h]=255&s,h+=d,s/=256,i-=8);for(o=o<0;t[r+h]=255&o,h+=d,o/=256,l-=8);t[r+h-d]|=128*y},a={read:n,write:i};function o(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}o.Varint=0,o.Fixed64=1,o.Bytes=2,o.Fixed32=5;var s=4294967296,u=1/s;function l(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return c(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return c(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return c(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return c(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return c(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return c(t,n,e);throw new Error("Expected varint not more than 10 bytes")}function p(t){return t.type===o.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function f(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),h(r,n,e),d(n,e)}function h(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}function d(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)))))}function y(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(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 m(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function I(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function k(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&(a=t[i+1]))&&(l=(31&u)<<6|63&a)<=127&&(l=null):3===p?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((l=(15&u)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((l=(15&u)<<18|(63&a)<<12|(63&o)<<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}function M(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+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}function F(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=A(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=I(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=A(this.buf,this.pos)+A(this.buf,this.pos+4)*s;return this.pos+=8,t},readSFixed64:function(){var t=A(this.buf,this.pos)+I(this.buf,this.pos+4)*s;return this.pos+=8,t},readFloat:function(){var t=a.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=a.read(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:l(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=k(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=p(this);for(t=t||[];this.pos127;);else if(e===o.Bytes)this.pos=this.readVarint()+this.pos;else if(e===o.Fixed32)this.pos+=4;else{if(e!==o.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?f(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=M(this.buf,t,this.pos);var r=this.pos-e;r>=128&&y(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),a.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),a.write(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&&y(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,o.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,m,e)},writePackedSVarint:function(t,e){this.writeMessage(t,v,e)},writePackedBoolean:function(t,e){this.writeMessage(t,b,e)},writePackedFloat:function(t,e){this.writeMessage(t,g,e)},writePackedDouble:function(t,e){this.writeMessage(t,x,e)},writePackedFixed32:function(t,e){this.writeMessage(t,_,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,w,e)},writePackedFixed64:function(t,e){this.writeMessage(t,E,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,T,e)},writeBytesField:function(t,e){this.writeTag(t,o.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,o.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,o.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,o.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}},F.prototype.encode=function(t){return this._stringToNumber[t]},F.prototype.decode=function(t){return this._numberToString[t]};var O={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};function P(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=z(t.type),a=r=R(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:R(r,Math.max(n,e)),alignment:e}}function z(t){return O[t].BYTES_PER_ELEMENT}function R(t,e){return Math.ceil(t/e)*e}var C=1,B=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},D={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};D.tl.get=function(){return[this.paddedRect.x+C,this.paddedRect.y+C]},D.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-C,this.paddedRect.y+this.paddedRect.h-C]},D.tlbr.get=function(){return this.tl.concat(this.br)},D.displaySize.get=function(){return[(this.paddedRect.w-2*C)/this.pixelRatio,(this.paddedRect.h-2*C)/this.pixelRatio]},Object.defineProperties(B.prototype,D);var V=function(t,e){U(this,t,4,e)};function U(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function N(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=U({},{width:n,height:i},r);L(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data}}function L(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,u=0;u=0;f--){var h=o[f];if(!(c.w>h.w||c.h>h.h)){if(c.x=h.x,c.y=h.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===h.w&&c.h===h.h){var d=o.pop();f255?255:t}function Q(t){return t<0?0:t>1?1:t}function K(t){return"%"===t[t.length-1]?Y(parseFloat(t)/100*255):Y(parseInt(t))}function G(t){return"%"===t[t.length-1]?Q(parseFloat(t)/100):Q(parseFloat(t))}function W(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}function J(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in H)return H[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var a=r.substr(0,n),o=r.substr(n+1,i-(n+1)).split(","),s=1;switch(a){case"rgba":if(4!==o.length)return null;s=G(o.pop());case"rgb":return 3!==o.length?null:[K(o[0]),K(o[1]),K(o[2]),s];case"hsla":if(4!==o.length)return null;s=G(o.pop());case"hsl":if(3!==o.length)return null;var u=(parseFloat(o[0])%360+360)%360/360,l=G(o[1]),p=G(o[2]),c=p<=.5?p*(l+1):p+l-p*l,f=2*p-c;return[Y(255*W(f,c,u+1/3)),Y(255*W(f,c,u)),Y(255*W(f,c,u-1/3)),s];default:return null}}return null}var Z=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Z.parse=function(t){if(t){if(t instanceof Z)return t;if("string"==typeof t){var e=J(t);if(e)return new Z(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Z.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Z.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},Z.black=new Z(0,0,0,1),Z.white=new Z(1,1,1,1),Z.transparent=new Z(0,0,0,0),Z.red=new Z(1,0,0,1);var $={kind:"null"},tt={kind:"number"},et={kind:"string"},rt={kind:"boolean"},nt={kind:"color"},it={kind:"object"},at={kind:"value"},ot={kind:"formatted"},st={kind:"resolvedImage"};function ut(t,e){return{kind:"array",itemType:t,N:e}}function lt(t){if("array"===t.kind){var e=lt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var pt=[$,tt,et,rt,nt,ot,it,ut(at),st];function ct(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ct(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=pt;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."},It.isValue=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 ft)return!0;if(t instanceof dt)return!0;if(t instanceof yt)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in Rt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=Rt[s],n++}else a=Pt;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);o=t[2],n++}r=zt(a,o)}else r=Rt[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Bt={kind:"number"},Dt={kind:"value"};function Vt(t,e){return{kind:"array",itemType:t,N:e}}var Ut=function(t,e,r){this.type=t,this.index=e,this.input=r};Ut.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,Bt),n=e.parse(t[2],2,Vt(e.expectedType||Dt));if(!r||!n)return null;var i=n.type;return new Ut(i.itemType,r,n)},Ut.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new RuntimeError("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new RuntimeError("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new RuntimeError("Array index must be an integer, but found "+e+" instead.");return r[e]},Ut.prototype.eachChild=function(t){t(this.index),t(this.input)},Ut.prototype.possibleOutputs=function(){return[void 0]},Ut.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Nt={kind:"boolean"},Lt=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};Lt.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":validateRGBA(e[0],e[1],e[2],e[3])))return new Z(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new RuntimeError(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,u=this.args;sr}function le(t,e,r){return e<=r}function pe(t,e,r){return e>=r}function ce(t,e,r,n){return 0===n.compare(e,r)}function fe(t,e,r,n){return!ce(0,e,r,n)}function he(t,e,r,n){return n.compare(e,r)<0}function de(t,e,r,n){return n.compare(e,r)>0}function ye(t,e,r,n){return n.compare(e,r)<=0}function me(t,e,r,n){return n.compare(e,r)>=0}function ve(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=ee,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,re);if(!a)return null;if(!ie(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+toString(a.type)+"'.");var o=e.parse(t[2],2,re);if(!o)return null;if(!ie(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+toString(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+toString(a.type)+"' and '"+toString(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new Ct(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new Ct(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,ne)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=It.typeOf(a),u=It.typeOf(o);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new RuntimeError('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=It.typeOf(a),p=It.typeOf(o);if("string"!==l.kind||"string"!==p.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}var ge={};ge.Equals=ve("==",ae,ce),ge.NotEquals=ve("!=",oe,fe),ge.LessThan=ve("<",se,he),ge.GreaterThan=ve(">",ue,de),ge.LessThanOrEqual=ve("<=",le,ye),ge.GreaterThanOrEqual=ve(">=",pe,me);var xe={kind:"number"},be={kind:"string"},_e={kind:"color"},we={kind:"value"},Ee={kind:"formatted"},Te={kind:"resolvedImage"};function Ae(t,e){return{kind:"array",itemType:t,N:e}}var Se=function(t){this.type=Ee,this.sections=t};Se.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,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,xe)))return null;var u=null;if(o["text-font"]&&!(u=e.parse(o["text-font"],1,Ae(be))))return null;var l=null;if(o["text-color"]&&!(l=e.parse(o["text-color"],1,_e)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l}else{var c=e.parse(t[a],1,we);if(!c)return null;var f=c.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)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 Se(n)},Se.prototype.evaluate=function(t){return new dt(this.sections.map((function(e){var r=e.content.evaluate(t);return It.typeOf(r)===Te?new ht("",r,null,null,null):new ht(It.toString$1(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Se.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1&&(r=!0),new yt({name:e,available:r})},Me.prototype.eachChild=function(t){t(this.input)},Me.prototype.possibleOutputs=function(){return[void 0]},Me.prototype.serialize=function(){return["image",this.input.serialize()]};var Fe=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))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,Oe)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Pe: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.',h);var y=e.parse(f,d,l);if(!y)return null;l=l||y.type,u.push([c,y])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Fe(l,r,n,i,u):e.error("Type "+toString(l)+" is not interpolatable.")},Fe.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 a=findStopLessThanOrEqualTo(e,n),o=e[a],s=e[a+1],u=Fe.interpolationFactor(this.interpolation,n,o,s),l=r[a].evaluate(t),p=r[a+1].evaluate(t);return"interpolate"===this.operator?interpolate[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?hcl.reverse(hcl.interpolate(hcl.forward(l),hcl.forward(p),u)):lab.reverse(lab.interpolate(lab.forward(l),lab.forward(p),u))},Fe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=0},Ue.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Ue.prototype.possibleOutputs=function(){return[!0,!1]},Ue.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ne=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ne.prototype.evaluate=function(t){return this.result.evaluate(t)},Ne.prototype.eachChild=function(t){for(var e=0,r=this.bindings;eNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,It.typeOf(f)))return null}else r=It.typeOf(f);if(void 0!==i[String(f)])return l.error("Branch labels must be unique.");i[String(f)]=a.length}var h=e.parse(u,o,n);if(!h)return null;n=n||h.type,a.push(h)}var d=e.parse(t[1],1,je);if(!d)return null;var y=e.parse(t[t.length-1],t.length-1,n);return y?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new He(r,n,d,i,a,y):null},He.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(It.typeOf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},He.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},He.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},He.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();ie))throw new RuntimeError("Input is not a number.");o=s-1}return 0}Ke.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ye);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,Qe)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Qe)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ye)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ye))?null:new Ke(r,i,a,o,s)},Ke.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))},Ke.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)},Ke.prototype.possibleOutputs=function(){return[void 0]},Ke.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 We={kind:"number"},Je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)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([o,p])}return new Je(i,r,n)},Je.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[Ge(e,n)].evaluate(t)},Je.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 Ze=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ze.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ze(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ze.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ze.prototype.eachChild=function(){},Ze.prototype.possibleOutputs=function(){return[void 0]},Ze.prototype.serialize=function(){return["var",this.name]};var $e={"==":ge.Equals,"!=":ge.NotEquals,">":ge.GreaterThan,"<":ge.LessThan,">=":ge.GreaterThanOrEqual,"<=":ge.LessThanOrEqual,array:Ct,at:Ut,boolean:Ct,case:Lt,coalesce:qt,collator:te,format:Se,image:Me,in:Ue,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Xe,let:Ne,literal:qe,match:He,number:Ct,"number-format":Ke,object:Ct,step:Je,string:Ct,"to-boolean":Wt,"to-color":Wt,"to-number":Wt,"to-string":Wt,var:Ze};function tr(){}var er={};for(var rr in tr.register=function(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),er[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}},tr.register("Object",Object),tr.register("Color",Z),tr.register("ResolvedImage",yt),tr.register("ImageAtlas",j),tr.register("ImagePosition",B),tr.register("RGBAImage",V),tr.register("Formatted",dt),tr.register("FormattedSection",ht),$e)$e[rr]._classRegistryKey||tr.register("Expression_"+rr,$e[rr]);function nr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}tr.serialize=function(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(nr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i=0)){var c=t[p];"function"!=typeof c&&(l[p]=er[u].shallow.indexOf(p)>=0?c:tr.serialize(c,e))}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(l.$name=u),l}throw new Error("can't serialize object of type "+typeof t)},tr.deserialize=function(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||nr(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(tr.deserialize);if("object"==typeof t){var e=t.$name||"Object",r=er[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,a=Object.keys(t);i=0?s:tr.deserialize(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)};var ir=function(){this.first=!0};ir.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.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}},tr.register("EvaluationParameters",ar);var or=8192;function sr(t,e,r){return Math.min(r,Math.max(e,t))}function ur(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var lr=ur(15);function pr(t){for(var e=or/t.extent,r=t.loadGeometry(),n=0;nlr.max||o.ylr.max)&&(o.x=sr(o.x,lr.min,lr.max),o.y=sr(o.y,lr.min,lr.max))}return r}var cr=function(t){void 0===t&&(t=[]),this.segments=t};cr.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return(!i||i.vertexLength+t>cr.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},cr.prototype.get=function(){return this.segments},cr.prototype.destroy=function(){for(var t=0,e=this.segments;tthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*hr),fr),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},dr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){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]=a,this.uint8[u+7]=o,t},e}(dr);yr.prototype.bytesPerElement=8,tr.register("StructArrayLayout2i4ub8",yr);var mr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(dr);mr.prototype.bytesPerElement=6,tr.register("StructArrayLayout3ui6",mr);var vr=function(){this.ids=[],this.positions=[],this.indexed=!1};function gr(t,e,r,n){if(!(r>=n)){for(var i=t[r+n>>1],a=r-1,o=n+1;;){do{a++}while(t[a]i);if(a>=o)break;xr(t,a,o),xr(e,3*a,3*o),xr(e,3*a+1,3*o+1),xr(e,3*a+2,3*o+2)}gr(t,e,r,o),gr(t,e,o+1,n)}}function xr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}vr.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n)},vr.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e>1;this.ids[n]>=t?r=n:e=n+1}for(var i=[];this.ids[e]===t;){var a=this.positions[3*e],o=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:a,start:o,end:s}),e++}return i},vr.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return gr(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},vr.deserialize=function(t){var e=new vr;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},tr.register("FeaturePositionMap",vr);var br=function(t,e,r){this.property=t,this.value=e,this.parameters=r};function _r(){}br.prototype.isConstant=function(){return"constant"===this.value.kind},br.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},br.prototype.evaluate=function(t,e,r){return this.property.evaluate(this.value,this.parameters,t,e,r)},_r.supportsPropertyExpression=function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]},_r.supportsZoomExpression=function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1},_r.supportsInterpolation=function(t){return!!t.expression&&t.expression.interpolated};var wr={},Er=function(t,e){this.gl=t.gl,this.location=e};wr.Uniform1i=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Er),wr.Uniform1f=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Er),wr.Uniform2f=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Er),wr.Uniform3f=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Er),wr.Uniform4f=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Er),wr.UniformColor=function(t){function e(e,r){t.call(this,e,r),this.current=Z.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Er);var Tr=new Float32Array(16);wr.UniformMatrix4f=function(t){function e(e,r){t.call(this,e,r),this.current=Tr}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.gl.uniformMatrix4fv(this.location,!1,t)},e}(Er);var Ar=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.uint16[l+4]=a,this.uint16[l+5]=o,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(dr);Ar.prototype.bytesPerElement=16,tr.register("StructArrayLayout8ui16",Ar);var Sr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(dr);Sr.prototype.bytesPerElement=8,tr.register("StructArrayLayout2f8",Sr);var Ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(dr);Ir.prototype.bytesPerElement=16,tr.register("StructArrayLayout4f16",Ir);var kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(dr);function Mr(t,e,r){return Math.min(r,Math.max(e,t))}function Fr(t,e){return 256*(t=Mr(Math.floor(t),0,255))+(e=Mr(Math.floor(e),0,255))}function Or(t){return[Fr(255*t.r,255*t.g),Fr(255*t.b,255*t.a)]}kr.prototype.bytesPerElement=4,tr.register("StructArrayLayout1f4",kr);var Pr=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};Pr.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Pr.prototype.setConstantPatternPositions=function(){},Pr.prototype.populatePaintArray=function(){},Pr.prototype.updatePaintArray=function(){},Pr.prototype.upload=function(){},Pr.prototype.destroy=function(){},Pr.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Pr.prototype.getBinding=function(t,e){return"color"===this.type?new wr.UniformColor(t,e):new wr.Uniform1f(t,e)},Pr.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:tr.serialize(e),names:r,type:n}},Pr.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Pr(tr.deserialize(e),r,n)};var zr=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};zr.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},zr.prototype.populatePaintArray=function(){},zr.prototype.updatePaintArray=function(){},zr.prototype.upload=function(){},zr.prototype.destroy=function(){},zr.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},zr.prototype.setUniforms=function(t,e,r,n,i){var a=this.patternPositions;"u_pattern_to"===i&&a.patternTo&&e.set(a.patternTo),"u_pattern_from"===i&&a.patternFrom&&e.set(a.patternFrom)},zr.prototype.getBinding=function(t,e){return new wr.Uniform4f(t,e)};var Rr=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Rr.prototype.defines=function(){return[]},Rr.prototype.setConstantPatternPositions=function(){},Rr.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=i.length;i.reserve(t);var o=this.expression.evaluate(new ar(0),e,{},[],n);if("color"===this.type)for(var s=Or(o),u=a;ur;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(a-u)/a)*(o-a/2<0?-1:1);en(t,e,Math.max(r,Math.floor(e-o*u/a+l)),Math.min(n,Math.floor(e+(a-o)*u/a+l)),i)}var p=t[e],c=r,f=n;for(rn(t,r,e),i(t[n],p)>0&&rn(t,r,n);c0;)f--}0===i(t[r],p)?rn(t,r,f):rn(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function rn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function nn(t,e){return te?1:0}function an(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r1)for(var u=0;u=2&&t[p-1].equals(t[p-2]);)p--;for(var c=0;c0;if(A&&x>c){var I=f.dist(y);if(I>2*h){var k=f.sub(f.sub(y)._mult(h/I)._round());this.updateDistance(y,k),this.addCurrentVertex(k,v,0,0,d),y=k}}var M=y&&m,F=M?r:l?"butt":n;if(M&&"round"===F&&(Ei&&(F="bevel"),"bevel"===F&&(E>2&&(F="flipbevel"),E100)b=g.mult(-1);else{var O=E*v.add(g).mag()/v.sub(g).mag();b._perp()._mult(O*(S?-1:1))}this.addCurrentVertex(f,b,0,0,d),this.addCurrentVertex(f,b.mult(-1),0,0,d)}else if("bevel"===F||"fakeround"===F){var P=-Math.sqrt(E*E-1),z=S?P:0,R=S?0:P;if(y&&this.addCurrentVertex(f,v,z,R,d),"fakeround"===F)for(var C=Math.round(180*T/Math.PI/Gr),B=1;B2*h){var X=f.add(m.sub(f)._mult(h/L)._round());this.updateDistance(f,X),this.addCurrentVertex(X,g,0,0,d),f=X}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s)}},$r.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,l=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,u,l,a,!0,-n,i),this.distance>Zr/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},$r.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,u=t.y,l=this.scaledDistance*Jr;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(Yr*e)+128,Math.round(Yr*r)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6);var p=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),o.primitiveLength++),i?this.e2=p:this.e1=p},$r.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Zr-1):this.distance},tr.register("LineBucket",$r,{omit:["layers","patternFeatures"]});var un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.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}(dr);un.prototype.bytesPerElement=4,tr.register("StructArrayLayout2i4",un);var ln,pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(dr);function cn(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a1&&(hn.thisProgram=process.argv[1].replace(/\\/g,"/")),hn.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=hn),process.on("uncaughtException",(function(t){if(!(t instanceof bp))throw t})),process.on("unhandledRejection",wp),hn.quit=function(t){process.exit(t)},hn.inspect=function(){return"[Emscripten Module object]"};else if(gn)"undefined"!=typeof read&&(hn.read=function(t){return read(t)}),hn.readBinary=function(t){var e;return"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(_l("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs?hn.arguments=scriptArgs:void 0!==arguments&&(hn.arguments=arguments),"function"==typeof quit&&(hn.quit=function(t){quit(t)});else{if(!yn&&!mn)throw new Error("environment detection error");mn?_n=self.location.href:document.currentScript&&(_n=document.currentScript.src),_n=0!==_n.indexOf("blob:")?_n.substr(0,_n.lastIndexOf("/")+1):"",hn.read=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},mn&&(hn.readBinary=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),hn.readAsync=function(t,e,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)},hn.setWindowTitle=function(t){document.title=t}}var wn=hn.print||("undefined"!=typeof console?console.log.bind(console):"undefined"!=typeof print?print:null),En=hn.printErr||("undefined"!=typeof printErr?printErr:"undefined"!=typeof console&&console.warn.bind(console)||wn);for(fn in dn)dn.hasOwnProperty(fn)&&(hn[fn]=dn[fn]);function xl(t){xl.shown||(xl.shown={}),xl.shown[t]||(xl.shown[t]=1)}dn=void 0,_l(void 0===hn.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),_l(void 0===hn.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),_l(void 0===hn.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),_l(void 0===hn.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),Pi=Oi=Fi=function(){wp("cannot use the stack before compiled code is ready to run, and has provided stack access")};var Tn={"f64-rem":function(t,e){return t%e},debugger:function(){}};new Array(0);var An,Sn=0,In=function(t){Sn=t},kn=function(){return Sn};function bl(t,e,r){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return Pn[t>>0];case"i16":return Rn[t>>1];case"i32":case"i64":return Cn[t>>2];case"float":return Dn[t>>2];case"double":return Vn[t>>3];default:wp("invalid type for getValue: "+e)}return null}"object"!=typeof WebAssembly&&wp("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");var Mn=!1;function _l(t,e){t||wp("Assertion failed: "+e)}function wl(t){var e=hn["_"+t];return _l(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function El(t,e,r,n,i){var a={string:function(t){var e=0;if(null!=t&&0!==t){var r=1+(t.length<<2);kl(t,e=Fi(r),r)}return e},array:function(t){var e=Fi(t.length);return Ml(t,e),e}};var o=wl(t),s=[],u=0;if(_l("array"!==e,'Return type should not be "array".'),n)for(var l=0;l=n);)++i;if(i-e>16&&t.subarray&&Fn)return Fn.decode(t.subarray(e,i));for(var a="";e>10,56320|1023&l)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}function Sl(t,e){return t?Al(zn,t,e):""}function Il(t,e,r,n){if(!(n>0))return 0;for(var i=r,a=r+n-1,o=0;o=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(r>=a)break;e[r++]=s}else if(s<=2047){if(r+1>=a)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=a)break;s>=2097152&&xl("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."),e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-i}function kl(t,e,r){return _l("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Il(t,zn,e,r)}function Ml(t,e){_l(t.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),Pn.set(t,e)}function Fl(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var On,Pn,zn,Rn,Cn,Bn,Dn,Vn,Un=65536;function Ol(t,e){return t%e>0&&(t+=e-t%e),t}function Pl(){hn.HEAP8=Pn=new Int8Array(On),hn.HEAP16=Rn=new Int16Array(On),hn.HEAP32=Cn=new Int32Array(On),hn.HEAPU8=zn=new Uint8Array(On),hn.HEAPU16=new Uint16Array(On),hn.HEAPU32=Bn=new Uint32Array(On),hn.HEAPF32=Dn=new Float32Array(On),hn.HEAPF64=Vn=new Float64Array(On)}var Nn=5872,Ln=5248752,Xn=5248752,qn=5840;_l(Nn%16==0,"stack must start aligned"),_l(Xn%16==0,"heap must start aligned");var jn=5242880;hn.TOTAL_STACK&&_l(jn===hn.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Hn=hn.TOTAL_MEMORY||16777216;function zl(){34821223==Bn[(Ln>>2)-1]&&2310721022==Bn[(Ln>>2)-2]||wp("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+Bn[(Ln>>2)-2].toString(16)+" "+Bn[(Ln>>2)-1].toString(16)),1668509029!==Cn[0]&&wp("Runtime error: The application has corrupted its heap memory area (address zero)!")}function Rl(t){wp("Stack overflow! Attempted to allocate "+t+" bytes on the stack, but stack has only "+(Ln-Pi()+t)+" bytes available!")}if(Hn>2]=Xn,Cn[0]=1668509029,Rn[1]=25459,115!==zn[2]||99!==zn[3])throw"Runtime error: expected the system to be little-endian!";function Cl(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?hn.dynCall_v(r):hn.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}var Yn=[],Qn=[],Kn=[],Gn=[],Wn=!1,Jn=!1;function Bl(){if(hn.preRun)for("function"==typeof hn.preRun&&(hn.preRun=[hn.preRun]);hn.preRun.length;)t=hn.preRun.shift(),Yn.unshift(t);var t;Cl(Yn)}function Dl(){if(zl(),hn.postRun)for("function"==typeof hn.postRun&&(hn.postRun=[hn.postRun]);hn.postRun.length;)t=hn.postRun.shift(),Gn.unshift(t);var t;Cl(Gn)}_l(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),_l(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),_l(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),_l(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Zn=0,$n=null,ti=null,ei={};function Vl(t){Zn++,hn.monitorRunDependencies&&hn.monitorRunDependencies(Zn),t&&(_l(!ei[t]),ei[t]=1,null===$n&&"undefined"!=typeof setInterval&&($n=setInterval((function(){if(Mn)return clearInterval($n),void($n=null)}),1e4)))}function Ul(t){if(Zn--,hn.monitorRunDependencies&&hn.monitorRunDependencies(Zn),t&&(_l(ei[t]),delete ei[t]),0==Zn&&(null!==$n&&(clearInterval($n),$n=null),ti)){var e=ti;ti=null,e()}}hn.preloadedImages={},hn.preloadedAudios={};var ri={error:function(){wp("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){ri.error()},createDataFile:function(){ri.error()},createPreloadedFile:function(){ri.error()},createLazyFile:function(){ri.error()},open:function(){ri.error()},mkdev:function(){ri.error()},registerDevice:function(){ri.error()},analyzePath:function(){ri.error()},loadFilesFromDB:function(){ri.error()},ErrnoError:function(){ri.error()}};hn.FS_createDataFile=ri.createDataFile,hn.FS_createPreloadedFile=ri.createPreloadedFile;var ni,ii="data:application/octet-stream;base64,";function Nl(t){return String.prototype.startsWith?t.startsWith(ii):0===t.indexOf(ii)}var ai="undefined"==typeof window?self:window;function Ll(){try{if(hn.wasmBinary)return new Uint8Array(hn.wasmBinary);if(hn.readBinary)return hn.readBinary(ni);throw"both async and sync fetching of the wasm failed"}catch(t){wp(t)}}function Xl(t){var e={env:t,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:Tn};function r(t,e){var r=t.exports;hn.asm=r,Ul("wasm-instantiate")}Vl("wasm-instantiate");var n=hn;function i(t){_l(hn===n,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),n=null,r(t.instance)}function a(t){return(hn.wasmBinary||!yn&&!mn||"function"!=typeof fetch?new Promise((function(t,e){t(Ll())})):fetch(ni,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+ni+"'";return t.arrayBuffer()})).catch((function(){return Ll()}))).then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(t){}))}if(hn.instantiateWasm)try{return hn.instantiateWasm(e,r)}catch(t){return!1}return function(){if(hn.wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||Nl(ni)||"function"!=typeof fetch)return a(i);fetch(ni,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(i,(function(t){a(i)}))}))}(),{}}Nl(ni=ai.location.href.endsWith(".openrealspace")?"../../static/Build/Cesium/ThirdParty/earcut.wasm":"ThirdParty/earcut.wasm")||(ln=ni,ni=hn.locateFile?hn.locateFile(ln,_n):_n+ln),hn.asm=function(t,e,r){e.memory=An,e.table=new WebAssembly.Table({initial:260,maximum:260,element:"anyfunc"}),e.__memory_base=1024,e.__table_base=0;var n=Xl(e);return _l(n,"binaryen setup failed (no wasm support?)"),n};var oi=5856;function ql(t){return Mi(t)}_l(oi%8==0);var si={},ui=[];function jl(t){t&&si[t].refcount++}function Hl(t){if(!t||si[t])return t;for(var e in si)for(var r=+e,n=si[r].adjusted,i=n.length,a=0;a>2]},getStr:function(){return Sl(li.get())},get64:function(){var t=li.get(),e=li.get();return _l(t>=0?0===e:-1===e),t},getZero:function(){_l(0===li.get())}};function Jl(t,e){li.varargs=e;try{li.getStreamFromFD(),li.get(),li.get(),li.get(),li.get();return wp("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"),0}catch(t){return void 0!==ri&&t instanceof ri.ErrnoError||wp(t),-t.errno}}function Zl(){var t=hn._fflush;t&&t(0);var e=li.buffers;e[1].length&&li.printChar(1,10),e[2].length&&li.printChar(2,10)}function $l(t,e){li.varargs=e;try{for(var r=li.get(),n=li.get(),i=li.get(),a=0,o=0;o>2],u=Cn[n+(8*o+4)>>2],l=0;l>2]=t}function sp(t){wp("Cannot enlarge memory arrays to size "+t+" bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+Pn.length+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function up(t){t=Ol(t,65536);var e=On.byteLength;try{return-1!==An.grow((t-e)/65536)&&(On=An.buffer,!0)}catch(r){return console.error("emscripten_realloc_buffer: Attempted to grow from "+e+" bytes to "+t+" bytes, but got error: "+r),!1}}function lp(t){var e=ip();_l(t>e);var r=65536,n=2147418112;if(t>n)return!1;for(var i=Math.max(e,16777216);i0||(_l(0==(3&Ln)),Bn[(Ln>>2)-1]=34821223,Bn[(Ln>>2)-2]=2310721022,Bl(),Zn>0||hn.calledRun||(hn.setStatus?(hn.setStatus("Running..."),setTimeout((function(){setTimeout((function(){hn.setStatus("")}),1),e()}),1)):e(),zl()))}hn.dynCall_ii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_ii.apply(null,arguments)},hn.dynCall_iidiiii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_iidiiii.apply(null,arguments)},hn.dynCall_iiii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_iiii.apply(null,arguments)},hn.dynCall_jiji=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_jiji.apply(null,arguments)},hn.dynCall_v=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_v.apply(null,arguments)},hn.dynCall_vi=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_vi.apply(null,arguments)},hn.dynCall_vii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_vii.apply(null,arguments)},hn.dynCall_viiii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_viiii.apply(null,arguments)},hn.dynCall_viiiii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_viiiii.apply(null,arguments)},hn.dynCall_viiiiii=function(){return _l(Wn,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),_l(!Jn,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),hn.asm.dynCall_viiiiii.apply(null,arguments)},hn.asm=fi,hn.intArrayFromString||(hn.intArrayFromString=function(){wp("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.intArrayToString||(hn.intArrayToString=function(){wp("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.ccall=El,hn.cwrap=Tl,hn.setValue||(hn.setValue=function(){wp("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getValue=bl,hn.allocate||(hn.allocate=function(){wp("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getMemory||(hn.getMemory=function(){wp("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.AsciiToString||(hn.AsciiToString=function(){wp("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stringToAscii||(hn.stringToAscii=function(){wp("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.UTF8ArrayToString||(hn.UTF8ArrayToString=function(){wp("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.UTF8ToString||(hn.UTF8ToString=function(){wp("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stringToUTF8Array||(hn.stringToUTF8Array=function(){wp("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stringToUTF8||(hn.stringToUTF8=function(){wp("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.lengthBytesUTF8||(hn.lengthBytesUTF8=function(){wp("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.UTF16ToString||(hn.UTF16ToString=function(){wp("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stringToUTF16||(hn.stringToUTF16=function(){wp("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.lengthBytesUTF16||(hn.lengthBytesUTF16=function(){wp("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.UTF32ToString||(hn.UTF32ToString=function(){wp("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stringToUTF32||(hn.stringToUTF32=function(){wp("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.lengthBytesUTF32||(hn.lengthBytesUTF32=function(){wp("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.allocateUTF8||(hn.allocateUTF8=function(){wp("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stackTrace||(hn.stackTrace=function(){wp("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addOnPreRun||(hn.addOnPreRun=function(){wp("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addOnInit||(hn.addOnInit=function(){wp("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addOnPreMain||(hn.addOnPreMain=function(){wp("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addOnExit||(hn.addOnExit=function(){wp("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addOnPostRun||(hn.addOnPostRun=function(){wp("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.writeStringToMemory||(hn.writeStringToMemory=function(){wp("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.writeArrayToMemory||(hn.writeArrayToMemory=function(){wp("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.writeAsciiToMemory||(hn.writeAsciiToMemory=function(){wp("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addRunDependency||(hn.addRunDependency=function(){wp("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.removeRunDependency||(hn.removeRunDependency=function(){wp("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.ENV||(hn.ENV=function(){wp("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.FS||(hn.FS=function(){wp("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.FS_createFolder||(hn.FS_createFolder=function(){wp("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_createPath||(hn.FS_createPath=function(){wp("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_createDataFile||(hn.FS_createDataFile=function(){wp("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_createPreloadedFile||(hn.FS_createPreloadedFile=function(){wp("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_createLazyFile||(hn.FS_createLazyFile=function(){wp("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_createLink||(hn.FS_createLink=function(){wp("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_createDevice||(hn.FS_createDevice=function(){wp("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.FS_unlink||(hn.FS_unlink=function(){wp("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),hn.GL||(hn.GL=function(){wp("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.dynamicAlloc||(hn.dynamicAlloc=function(){wp("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.warnOnce||(hn.warnOnce=function(){wp("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.loadDynamicLibrary||(hn.loadDynamicLibrary=function(){wp("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.loadWebAssemblyModule||(hn.loadWebAssemblyModule=function(){wp("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getLEB||(hn.getLEB=function(){wp("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getFunctionTables||(hn.getFunctionTables=function(){wp("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.alignFunctionTables||(hn.alignFunctionTables=function(){wp("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.registerFunctions||(hn.registerFunctions=function(){wp("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.addFunction||(hn.addFunction=function(){wp("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.removeFunction||(hn.removeFunction=function(){wp("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getFuncWrapper||(hn.getFuncWrapper=function(){wp("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.prettyPrint||(hn.prettyPrint=function(){wp("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.makeBigInt||(hn.makeBigInt=function(){wp("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.dynCall||(hn.dynCall=function(){wp("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getCompilerSetting||(hn.getCompilerSetting=function(){wp("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stackSave||(hn.stackSave=function(){wp("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stackRestore||(hn.stackRestore=function(){wp("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.stackAlloc||(hn.stackAlloc=function(){wp("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.establishStackSpace||(hn.establishStackSpace=function(){wp("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.print||(hn.print=function(){wp("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.printErr||(hn.printErr=function(){wp("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.getTempRet0||(hn.getTempRet0=function(){wp("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.setTempRet0||(hn.setTempRet0=function(){wp("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.Pointer_stringify||(hn.Pointer_stringify=function(){wp("'Pointer_stringify' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),hn.ALLOC_NORMAL||Object.defineProperty(hn,"ALLOC_NORMAL",{get:function(){wp("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),hn.ALLOC_STACK||Object.defineProperty(hn,"ALLOC_STACK",{get:function(){wp("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),hn.ALLOC_DYNAMIC||Object.defineProperty(hn,"ALLOC_DYNAMIC",{get:function(){wp("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),hn.ALLOC_NONE||Object.defineProperty(hn,"ALLOC_NONE",{get:function(){wp("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),bp.prototype=new Error,bp.prototype.constructor=bp,ti=function t(){hn.calledRun||_p(),hn.calledRun||(ti=t)},hn.run=_p;var zi=[];function wp(t){hn.onAbort&&hn.onAbort(t),Mn=!0;var e,r="abort("+(t=void 0!==t?'"'+t+'"':"")+") at "+(e=Fl(),hn.extraStackTrace&&(e+="\n"+hn.extraStackTrace()),e.replace(/__Z[\w\d_]+/g,(function(t){return t==t?t:t+" ["+t+"]"})));throw zi&&zi.forEach((function(e){r=e(r,t)})),r}if(hn.abort=wp,hn.preInit)for("function"==typeof hn.preInit&&(hn.preInit=[hn.preInit]);hn.preInit.length>0;)hn.preInit.pop()();hn.noExitRuntime=!0,_p()}else hn=null;var Ri=hn,Ci=!1;if(e.defined(Ri)){Ri.onRuntimeInitialized=function(){Ci=!0};var Bi=Ri.cwrap("earcut","number",["number","number","number","number","number","number"])}var Di=P([{name:"a_pos",components:2,type:"Int16"}],4),Vi=Di.members,Ui=500,Ni=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 un,this.indexArray=new mr,this.indexArray2=new pn,this.programConfigurations=new Lr(Vi,t.layers,t.zoom),this.segments=new cr,this.segments2=new cr,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ni.prototype.populate=function(t,e){this.hasPattern=cn("fill",this.layers,e);for(var r=[],n=0,i=t;nthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*qi),Xi),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(ji);Hi.prototype.bytesPerElement=8;var Yi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Li);Yi.prototype.size=8;var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Yi(this,t)},e}(Hi);tr.register("FeatureIndexArray",Qi,{omit:["layers","patternFeatures"]});var Ki={FeatureIndexArray:Qi};function Gi(t,e){this.x=t,this.y=e}function Wi(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Ji,this,e)}function Ji(t,e,r){1==t?e.id=r.readVarint():2==t?Zi(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Zi(t,e){for(var r=t.readVarint()+t.pos;t.pos>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}function ia(t,e){this.layers=t.readFields(aa,{},e)}function aa(t,e,r){if(3===t){var n=new ea(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Gi.prototype={clone:function(){return new Gi(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Gi.convert=function(t){return t instanceof Gi?t:Array.isArray(t)?new Gi(t[0],t[1]):t},Wi.types=["Unknown","Point","LineString","Polygon"],Wi.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos>3}i--,1===n||2===n?(a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new Gi(a,o))):7===n?e&&e.push(e[0].clone()):console.log("VectorTileFeature loadGeometry unknown command "+n)}return e&&s.push(e),s},Wi.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=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),(a+=t.readSVarint())l&&(l=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,u,s,l]},Wi.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Wi.types[this.type];function p(t){for(var e=0;e=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 Wi(this._pbf,e,this.extent,this._keys,this._values)};var oa=3;function sa(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var a=0;a=p[h+0]&&n>=p[h+1])?(o[f]=!0,a.push(l[f])):o[f]=!1}}},sa.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),f=u;f<=p;f++)for(var h=l;h<=c;h++){var d=this.d*h+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(h),this._convertFromCellCoord(f+1),this._convertFromCellCoord(h+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},sa.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},sa.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},sa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=oa+this.cells.length+1+1,r=0,n=0;n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},ua.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)}))}))},ua.extend=function(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)}()},ua.validateUuid=function(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)},ua.bindAll=function(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))},ua.endsWith=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},ua.mapObject=function(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n},ua.filterObject=function(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n},ua.clone=function(t){return Array.isArray(t)?t.map(ua.clone):"object"==typeof t&&t?ua.mapObject(t,ua.clone):t},ua.deepEqual=function(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r=0)return!0;return!1};var pa={};ua.warnOnce=function(t){pa[t]||("undefined"!=typeof console&&console.warn(t),pa[t]=!0)},ua.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},ua.isWorker=function(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope},ua.parseCacheControl=function(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e};var ca=null;ua.isSafari=function(t){if(null==ca){var e=t.navigator?t.navigator.userAgent:null;ca=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return ca},ua.resolveTokens=function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))};var fa=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r=0)return!1;var r=!0;return t.eachChild((function(t){r&&!ma.isGlobalPropertyConstant(t,e)&&(r=!1)})),r};var va=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new fa),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function ga(t,e){const r=e[t];return void 0===r?null:r}va.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)},va.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new Ct(e,[t]):"coerce"===r?new Wt(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 a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}return!(a instanceof qe)&&a.type.kind,a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},va.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 va(this.registry,n,e||null,i,this.errors)},va.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 ha(n,t))},va.prototype.checkSubtype=function(t,e){var r=ct(t,e);return r&&this.error(r),r};var xa=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};function ba(t){return Array.isArray(t)?"("+t.map(toString).join(", ")+")":"("+toString(t.type)+"...)"}xa.prototype.evaluate=function(t,e){return this._evaluate(t,this.args,e)},xa.prototype.eachChild=function(t){this.args.forEach(t)},xa.prototype.possibleOutputs=function(){return[void 0]},xa.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},xa.parse=function(t,e){var r,n=t[0],i=xa.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l-1))}],"filter-type-==":[Ea,[wa],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ea,[wa,Sa],function(t,e,r){var n,i,a=e[0],o=e[1],s=a.value,u=o.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var l=s.match(/(\S*)\s*([+-])\s*(\S*)/),p=t.properties()[l[1]],c=l[2],f=t.properties()[l[3]];switch(c){case"+":n=p+f;break;case"-":n=p-f}i=o.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var h=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),d=h[1],y=(p=t.properties()[h[2]],h[3]);if(n="left"==d?p.substring(0,y):p.substring(p.length-y),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(u)){var m=u.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),v=m[1],g=(f=t.properties()[m[2]],m[3]);i="left"==v?f.substring(0,g):f.substring(f.length-g)}else i=o.value}else n=t.properties()[a.value],i=o.value,r&&(i=t.properties()[i]);return"number"!=typeof i||isNaN(Number(n))||(n=Number(n)),typeof n==typeof i&&n":[Ea,[wa,Sa],function(t,e,r){var n,i,a=e[0],o=e[1],s=a.value,u=o.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var l=s.match(/(\S*)\s*([+-])\s*(\S*)/),p=t.properties()[l[1]],c=l[2],f=t.properties()[l[3]];switch(c){case"+":n=p+f;break;case"-":n=p-f}i=o.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var h=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),d=h[1],y=(p=t.properties()[h[2]],h[3]);if(n="left"==d?p.substring(0,y):p.substring(p.length-y),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(u)){var m=u.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),v=m[1],g=(f=t.properties()[m[2]],m[3]);i="left"==v?f.substring(0,g):f.substring(f.length-g)}else i=o.value}else n=t.properties()[a.value],i=o.value,r&&(i=t.properties()[i]);return"number"!=typeof i||isNaN(Number(n))||(n=Number(n)),typeof n==typeof i&&n>i}],"filter-id->":[Ea,[Sa],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ea,[wa,Sa],function(t,e,r){var n,i,a=e[0],o=e[1],s=a.value,u=o.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var l=s.match(/(\S*)\s*([+-])\s*(\S*)/),p=t.properties()[l[1]],c=l[2],f=t.properties()[l[3]];switch(c){case"+":n=p+f;break;case"-":n=p-f}i=o.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var h=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),d=h[1],y=(p=t.properties()[h[2]],h[3]);if(n="left"==d?p.substring(0,y):p.substring(p.length-y),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(u)){var m=u.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),v=m[1],g=(f=t.properties()[m[2]],m[3]);i="left"==v?f.substring(0,g):f.substring(f.length-g)}else i=o.value}else n=t.properties()[a.value],i=o.value,r&&(i=t.properties()[i]);return"number"!=typeof i||isNaN(Number(n))||(n=Number(n)),typeof n==typeof i&&n<=i}],"filter-id-<=":[Ea,[Sa],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ea,[wa,Sa],function(t,e,r){var n,i,a=e[0],o=e[1],s=a.value,u=o.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var l=s.match(/(\S*)\s*([+-])\s*(\S*)/),p=t.properties()[l[1]],c=l[2],f=t.properties()[l[3]];switch(c){case"+":n=p+f;break;case"-":n=p-f}i=o.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var h=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),d=h[1],y=(p=t.properties()[h[2]],h[3]);if(n="left"==d?p.substring(0,y):p.substring(p.length-y),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(u)){var m=u.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),v=m[1],g=(f=t.properties()[m[2]],m[3]);i="left"==v?f.substring(0,g):f.substring(f.length-g)}else i=o.value}else n=t.properties()[a.value],i=o.value,r&&(i=t.properties()[i]);return"number"!=typeof i||isNaN(Number(n))||(n=Number(n)),typeof n==typeof i&&n>=i}],"filter-id->=":[Ea,[Sa],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ea,[Sa],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ea,[],function(t){return null!==t.id()}],"filter-type-in":[Ea,[Ma(wa)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ea,[Ma(Sa)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ea,[wa,Ma(Sa)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ea,[wa,Ma(Sa)],function(t,e){var r=e[0],n=e[1];return binarySearch(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ea,overloads:[[[Ea,Ea],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Fa(Ea),function(t,e){for(var r=0,n=e;rLa?Math.pow(t,1/3):t/Na+Va}function Ha(t){return t>Ua?t*t*t:Na*(t-Va)}function Ya(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qa(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ka(t){var e=Qa(t.r),r=Qa(t.g),n=Qa(t.b),i=ja((.4124564*e+.3575761*r+.1804375*n)/Ca),a=ja((.2126729*e+.7151522*r+.072175*n)/Ba);return{l:116*a-16,a:500*(i-a),b:200*(a-ja((.0193339*e+.119192*r+.9503041*n)/Da)),alpha:t.a}}function Ga(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=Ba*Ha(e),r=Ca*Ha(r),n=Da*Ha(n),new Color(Ya(3.2404542*r-1.5371385*e-.4985314*n),Ya(-.969266*r+1.8760108*e+.041556*n),Ya(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Wa(t,e,r){return{l:number(t.l,e.l,r),a:number(t.a,e.a,r),b:number(t.b,e.b,r),alpha:number(t.alpha,e.alpha,r)}}function Ja(t){var e=Ka(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*qa;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}}function Za(t){var e=t.h*Xa,r=t.c;return Ga({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})}function $a(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}function to(t,e,r){return{h:$a(t.h,e.h,r),c:number(t.c,e.c,r),l:number(t.l,e.l,r),alpha:number(t.alpha,e.alpha,r)}}var eo={forward:Ka,reverse:Ga,interpolate:Wa},ro={forward:Ja,reverse:Za,interpolate:to},no=Object.freeze({__proto__:null,lab:eo,hcl:ro});function io(){}function ao(t){return{result:"success",value:t}}function oo(t){return{result:"error",value:t}}io.isExpression=function(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in $e};var so={kind:"number"},uo={kind:"string"},lo={kind:"boolean"},po={kind:"color"},co={kind:"value"},fo={kind:"formatted"},ho={kind:"resolvedImage"};function yo(t,e){return{kind:"array",itemType:t,N:e}}function mo(t){var e=null;if(t instanceof Ne)e=mo(t.result);else if(t instanceof qt){for(var r of t.args)if(e=mo(r))break}else(t instanceof Je||t instanceof Fe)&&t.input instanceof va.CompoundExpression&&"zoom"===t.input.name&&(e=t);return e instanceof ha||t.eachChild((t=>{var r=mo(t);r instanceof ha?e=r:!e&&r?e=new ha("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new ha("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function vo(t){var e={color:po,string:uo,number:so,enum:uo,boolean:lo,formatted:fo,resolvedImage:ho};return"array"===t.type?yo(e[t.value]||co,t.length):e[t.type]}function go(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function xo(t){return t}function bo(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n=t.stops[i-1][0])return t.stops[i-1][1];var a=Ge(t.stops.map((t=>t[0])),r),o=Mo(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],u=t.stops[a+1][1],l=interpolate[e.type]||xo;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=no[t.colorSpace];l=(t,e)=>p.reverse(p.interpolate(p.forward(t),p.forward(e),o))}return"function"==typeof s.evaluate?{evaluate(...t){var e=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return l(e,r,o)}}:l(s,u,o)}function wo(t,e,r){return"color"===e.type?r=Z.parse(r):"formatted"===e.type?r=Formatted.fromString(r.toString()):"resolvedImage"===e.type?r=ResolvedImage.fromString(r.toString()):Oo(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ko(r,t.default,e.default)}function Eo(t,e){var r=new va($e,[],e?vo(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?ao(new Pa(n,e)):(assert(r.errors.length>0),oo(r.errors))}function To(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ma.isStateConstant(e.expression)}function Ao(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ma.isStateConstant(e.expression),this.interpolationType=n}function So(t,e){if("error"===(t=Eo(t,e)).result)return t;var r=t.value.expression,n=ma.isFeatureConstant(r);if(!n&&!_r.supportsPropertyExpression(e))return oo([new ha("","data expressions not supported")]);var i=ma.isGlobalPropertyConstant(r,["zoom"]);if(!i&&!_r.supportsZoomExpression(e))return oo([new ha("","zoom expressions not supported")]);var a=mo(r);if(!a&&!i)return oo([new ha("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof ha)return oo([a]);if(a instanceof Fe&&!_r.supportsInterpolation(e))return oo([new ha("",'"interpolate" expressions cannot be used with this property')]);if(!a)return ao(new To(n?"constant":"source",t.value));var o=a instanceof Fe?a.interpolation:void 0;return ao(new Ao(n?"camera":"composite",t.value,a.labels,o))}function Io(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"==typeof t.stops[0][0],s=o||void 0!==t.property,u=o||!s,l=t.type||(_r.supportsInterpolation(e)?"exponential":"interval");if(a&&((t=bo({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],Z.parse(t[1])]}))),t.default?t.default=Z.parse(t.default):t.default=Z.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!no[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===l)r=_o;else if("interval"===l)r=evaluateIntervalFunction;else if("categorical"===l){r=evaluateCategoricalFunction,n=Object.create(null);for(var p=0,c=t.stops;p=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&Array.isArray(t[2]);case"!in":case"!has":case"none":case"crossFields":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":case"like":case"!like":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 Co(t){if(!t)return!0;var e=t[0];return t.length<=1?"any"!==e:"=="===e?Bo(t[1],t[2],"=="):"!="===e?No(Bo(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Bo(t[1],t[2],e):"any"===e?Do(t.slice(1)):"all"===e?["all"].concat(t.slice(1).map(Co)):"crossFields"===e?["crossFields"].concat(t.slice(1).map(Co)):"none"===e?["all"].concat(t.slice(1).map(Co).map(No)):"in"===e?Vo(t[1],t.slice(2)):"!in"===e?No(Vo(t[1],t.slice(2))):"has"===e?Uo(t[1]):"!has"===e?No(Uo(t[1])):"like"===e?Bo(t[1],t[2],"like"):"!like"!==e||No(Bo(t[1],t[2],"like"))}function Bo(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 Do(t){return["any"].concat(t.map(Co))}function Vo(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(Ro)]]:["filter-in-small",t,["literal",e]]}}function Uo(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function No(t){return["!",t]}Po.createFilter=function(t){if(null==t)return function(){return!0};Po.isExpressionFilter(t)||(t=Co(t));var e=io.createExpression(t,zo);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,r){return e.value.evaluate(t,r)}};var Lo=Ki.FeatureIndexArray,Xo=function(t,e,r){this.x=t.x,this.y=t.y,this.z=t.z,this.grid=e||new sa(or,16,0),this.featureIndexArray=r||new Lo};function qo(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a=0&&c[3]>=0&&u.insert(s,c[0]-o,c[1]-o,c[2]+o,c[3]+o)}},Xo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ia(new o(this.rawTileData)).layers,this.sourceLayerCoder=new F(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Xo.prototype.query=function(t,r,n){var i=this;this.loadVTLayers();var a=t.params||{},o=Ho(this.z,t.tileSize,a),s=Po.createFilter(a.filter),u=t.queryGeometry,l=5,p=qo(u),c=[];e.defined(a.selectTolerance)&&(l+=o*a.selectTolerance),(c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l)).sort(jo);for(var f,h={},d=function(e){var n=c[e];if(n!==f){f=n;var l=i.featureIndexArray.get(n),p=null;i.loadMatchingFeature(h,l.bucketIndex,l.sourceLayerIndex,l.featureIndex,s,a.layers,r,(function(e,r){p||(p=pr(e));return r.queryIntersectsFeature(u,e,{},p,i.z,t.transform,o,t.pixelPosMatrix,t.adjustScale)}))}},y=0;y=or||l<0||l>=or)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;Zo(this.layoutVertexArray,u,l,-1,-1),Zo(this.layoutVertexArray,u,l,1,-1),Zo(this.layoutVertexArray,u,l,1,1),Zo(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},tr.register("CircleBucket",$o,{omit:["layers"]});var ts=function(t){this.specification=t};ts.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},ts.prototype.interpolate=function(t,e,r){var n=interpolate[this.specification.type];return n?n(t,e,r):t},tr.register("DataConstantProperty",ts);var es=function(t,e){this.specification=t,this.overrides=e};es.prototype.possiblyEvaluate=function(t,e,r){return"constant"===t.expression.kind||"camera"===t.expression.kind?new br(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r)},e):new br(this,t.expression,e)},es.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new br(this,{kind:"constant",value:void 0},t.parameters);var n=interpolate[this.specification.type];return n?new br(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},es.prototype.evaluate=function(t,e,r,n,i){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i)},tr.register("DataDrivenProperty",es);var rs=function(t,e){this.property=t,this.value=e,this.expression=io.normalizePropertyExpression(void 0===e?t.specification.default:e,t.specification)};function ns(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}rs.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},rs.prototype.possiblyEvaluate=function(t,e){return this.property.possiblyEvaluate(this,t,e)};var is=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};is.prototype.possiblyEvaluate=function(t,e){var r=t.now||0,n=this.value.possiblyEvaluate(t,e),i=this.prior;if(i){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r=this.maxzoom)||"none"===this.visibility)},ds.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},ds.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},ds.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e)},ds.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),ua.filterObject(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},ds.prototype._validate=function(t,e,r,n,i){return!0},ds.prototype.is3D=function(){return!1},ds.prototype.isTileClipped=function(){return!1},ds.prototype.hasOffscreenPass=function(){return!1},ds.prototype.resize=function(){},ds.prototype.isStateDependent=function(){return!0};var ys=8,ms={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"}},vs={"*":{type:"source"}},gs=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],xs={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},bs={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},_s={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},ws={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},Es={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"}}},Ts={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"}}},As={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"}},Ss=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Is={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ks={"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"}},Ms={"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"}},Fs={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Os={"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"}},Ps={"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"}},zs={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Rs={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Cs={type:"array",value:"*"},Bs={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Ds={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Vs={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Us={type:"array",value:"*",minimum:1},Ns={type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},Ls={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}},Xs=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],qs={"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"}},js={"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"}},Hs={"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"}},Ys={"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"}},Qs={"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-show-background":{type:"boolean",default:!1,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"}},Ks={"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"}},Gs={"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"}},Ws={"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"}},Js={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Zs={$version:ys,$root:ms,sources:vs,source:gs,source_vector:xs,source_raster:bs,source_raster_dem:_s,source_geojson:ws,source_video:Es,source_image:Ts,layer:As,layout:Ss,layout_background:Is,layout_fill:ks,layout_circle:Ms,layout_heatmap:Fs,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Os,layout_symbol:Ps,layout_raster:zs,layout_hillshade:Rs,filter:Cs,filter_operator:Bs,geometry_type:Ds,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:Vs,expression:Us,expression_name:Ns,light:Ls,paint:Xs,paint_fill:qs,"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:js,paint_circle:Hs,paint_heatmap:Ys,paint_symbol:Qs,paint_raster:Ks,paint_hillshade:Gs,paint_background:Ws,transition:Js,"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"}}};function $s(){}function tu(t,e,r){if(t.length>1){if(eu(t,e))return!0;for(var n=0;ne.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function au(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}$s.polygonIntersectsPolygon=function(t,e){for(var r=0;r=3)for(var a=0;a1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))};var ou=new os({"circle-sort-key":new es(Zs.layout_circle["circle-sort-key"])}),su=new os({"circle-radius":new es(Zs.paint_circle["circle-radius"]),"circle-color":new es(Zs.paint_circle["circle-color"]),"circle-blur":new es(Zs.paint_circle["circle-blur"]),"circle-opacity":new es(Zs.paint_circle["circle-opacity"]),"circle-translate":new ts(Zs.paint_circle["circle-translate"]),"circle-translate-anchor":new ts(Zs.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ts(Zs.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ts(Zs.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new es(Zs.paint_circle["circle-stroke-width"]),"circle-stroke-color":new es(Zs.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new es(Zs.paint_circle["circle-stroke-opacity"])}),uu={paint:su,layout:ou},lu=function(t){function r(e){t.call(this,e,uu)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.createBucket=function(t){return new $o(t)},r.prototype.queryRadius=function(t){var e=t;return ss.getMaximumPaintValue("circle-radius",this,e)+ss.getMaximumPaintValue("circle-stroke-width",this,e)+ss.translateDistance(this.paint.get("circle-translate"))},r.prototype.queryIntersectsFeature=function(t,r,n,i,a,o,s,u,l){u=fu();for(var p=ss.translate(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),0,s),c=this.paint.get("circle-radius").evaluate(r,n)+this.paint.get("circle-stroke-width").evaluate(r,n),f="map"===this.paint.get("circle-pitch-alignment"),h=f?p:cu(p,u),d=f?c*s:c,y=0,m=i;yn.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(es);tr.register("DataDrivenProperty",es);var yu=new os({"fill-sort-key":new es(Zs.layout_fill["fill-sort-key"])}),mu=new os({"fill-antialias":new ts(Zs.paint_fill["fill-antialias"]),"fill-opacity":new es(Zs.paint_fill["fill-opacity"]),"fill-color":new es(Zs.paint_fill["fill-color"]),"fill-outline-color":new es(Zs.paint_fill["fill-outline-color"]),"fill-translate":new ts(Zs.paint_fill["fill-translate"]),"fill-translate-anchor":new ts(Zs.paint_fill["fill-translate-anchor"]),"fill-pattern":new du(Zs.paint_fill["fill-pattern"])}),vu={paint:mu,layout:yu},gu=function(t){function e(e){t.call(this,e,vu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new Ni(t)},e.prototype.queryRadius=function(){return ss.translateDistance(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){var s=ss.translate(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),0,o);return $s.polygonIntersectsMultiPolygon(s,n)},e.prototype.isTileClipped=function(){return!0},e}(ds),xu=function(t){this.specification=t};xu.prototype.possiblyEvaluate=function(t,e,r){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new ar(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ar(Math.floor(e.zoom),e)),t.expression.evaluate(new ar(Math.floor(e.zoom+1),e)),e)}},xu.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},xu.prototype.interpolate=function(t){return t},tr.register("CrossFadedProperty",xu);var bu=function(t){this.specification=t};bu.prototype.possiblyEvaluate=function(t,e,r){return!!t.expression.evaluate(e,null,{},r)},bu.prototype.interpolate=function(){return!1},tr.register("ColorRampProperty",bu);var _u=new os({"line-cap":new ts(Zs.layout_line["line-cap"]),"line-join":new es(Zs.layout_line["line-join"]),"line-miter-limit":new ts(Zs.layout_line["line-miter-limit"]),"line-round-limit":new ts(Zs.layout_line["line-round-limit"]),"line-sort-key":new es(Zs.layout_line["line-sort-key"])}),wu=new os({"line-opacity":new es(Zs.paint_line["line-opacity"]),"line-color":new es(Zs.paint_line["line-color"]),"line-translate":new ts(Zs.paint_line["line-translate"]),"line-translate-anchor":new ts(Zs.paint_line["line-translate-anchor"]),"line-width":new es(Zs.paint_line["line-width"]),"line-gap-width":new es(Zs.paint_line["line-gap-width"]),"line-offset":new es(Zs.paint_line["line-offset"]),"line-blur":new es(Zs.paint_line["line-blur"]),"line-dasharray":new xu(Zs.paint_line["line-dasharray"]),"line-pattern":new du(Zs.paint_line["line-pattern"]),"line-gradient":new bu(Zs.paint_line["line-gradient"])}),Eu={paint:wu,layout:_u},Tu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new ar(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=extend({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(es),Au=new Tu(Eu.paint.properties["line-width"].specification);Au.useIntegerZoom=!0;var Su=function(t){function e(e){t.call(this,e,Eu)}function r(t,e){return e>0?e+2*t:t}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=renderColorRamp(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Au.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new $r(t)},e.prototype.queryRadius=function(t){var e=t,n=r(ss.getMaximumPaintValue("line-width",this,e),ss.getMaximumPaintValue("line-gap-width",this,e)),i=ss.getMaximumPaintValue("line-offset",this,e);return n/2+Math.abs(i)+ss.translateDistance(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,a,o,s){var u=ss.translate(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),0,s),l=r(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),p=s/2*(l=Math.max(l,5)),c=this.paint.get("line-offset").evaluate(e,n);return c&&(i=function(t,e){for(var r=[],n=new Gi(0,0),i=0;i=0&&n>=t&&Bu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Ru.prototype.substring=function(t,e){var r=new Ru;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Ru.prototype.toString=function(){return this.text},Ru.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Ru.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(zu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=Pu?null:++this.imageSectionID:(this.imageSectionID=Ou,this.imageSectionID)},Mu.shapeText=function(t,e,r,n,i,a,o,s,u,l,p,c,f,h,d,y){var m=Ru.fromFeature(t,i);c===Mu.WritingMode.vertical&&m.verticalizePunctuation(),Cu(m,void 0);var v=[],g={positionedLines:v,text:m.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:c,iconsInText:!1,verticalizable:!1};return!Fu(v)&&g};var Bu={};function Du(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}Bu[9]=!0,Bu[10]=!0,Bu[11]=!0,Bu[12]=!0,Bu[13]=!0,Bu[32]=!0,Mu.shapeIcon=function(t,e,r){var n=Du(r),i=n.horizontalAlign,a=n.verticalAlign,o=e[0],s=e[1],u=o-t.displaySize[0]*i,l=u+t.displaySize[0],p=s-t.displaySize[1]*a;return{image:t,top:p,bottom:p+t.displaySize[1],left:u,right:l}},Mu.fitIconToText=function(t,e,r,n,i,a){var o,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;o=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l]}var p,c,f,h,d=e.left*a,y=e.right*a;"width"===r||"both"===r?(h=i[0]+d-n[3],c=i[0]+y+n[1]):c=(h=i[0]+(d+y-s.displaySize[0])/2)+s.displaySize[0];var m=e.top*a,v=e.bottom*a;return"height"===r||"both"===r?(p=i[1]+m-n[0],f=i[1]+v+n[2]):f=(p=i[1]+(m+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:p,right:c,bottom:f,left:h,collisionPadding:o}};var Vu=128;function Uu(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new ar(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}},Yu=function(){};function Qu(t){return!Hu.Arabic(t)&&(!Hu["Arabic Supplement"](t)&&(!Hu["Arabic Extended-A"](t)&&(!Hu["Arabic Presentation Forms-A"](t)&&!Hu["Arabic Presentation Forms-B"](t))))}function Ku(t){return 746===t||747===t||!(t<4352)&&(!!Hu["Bopomofo Extended"](t)||(!!Hu.Bopomofo(t)||(!(!Hu["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||(!!Hu["CJK Compatibility Ideographs"](t)||(!!Hu["CJK Compatibility"](t)||(!!Hu["CJK Radicals Supplement"](t)||(!!Hu["CJK Strokes"](t)||(!(!Hu["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Hu["CJK Unified Ideographs Extension A"](t)||(!!Hu["CJK Unified Ideographs"](t)||(!!Hu["Enclosed CJK Letters and Months"](t)||(!!Hu["Hangul Compatibility Jamo"](t)||(!!Hu["Hangul Jamo Extended-A"](t)||(!!Hu["Hangul Jamo Extended-B"](t)||(!!Hu["Hangul Jamo"](t)||(!!Hu["Hangul Syllables"](t)||(!!Hu.Hiragana(t)||(!!Hu["Ideographic Description Characters"](t)||(!!Hu.Kanbun(t)||(!!Hu["Kangxi Radicals"](t)||(!!Hu["Katakana Phonetic Extensions"](t)||(!(!Hu.Katakana(t)||12540===t)||(!(!Hu["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Hu["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Hu["Unified Canadian Aboriginal Syllabics"](t)||(!!Hu["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Hu["Vertical Forms"](t)||(!!Hu["Yijing Hexagram Symbols"](t)||(!!Hu["Yi Syllables"](t)||!!Hu["Yi Radicals"](t))))))))))))))))))))))))))))))}function Gu(t){return t>=1424&&t<=2303||Hu["Arabic Presentation Forms-A"](t)||Hu["Arabic Presentation Forms-B"](t)}Yu.allowsVerticalWritingMode=function(t){for(var e=0,r=t;e0)&&("constant"!==i.value.kind||i.value.value.length>0),u=("constant"!==o.value.kind||!!o.value.value)&&Object.keys(o.parameters).length>0,l=n.get("symbol-sort-key");if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,f=e.availableImages,h=new ar(this.zoom),d=0,y=t;d=0;for(var M=0,F=b.sections;M=0;s--)a[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;this.addCollisionDebugVertices(o,s,u,l,p?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r,p)}},nl.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t0},nl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},nl.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},nl.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},nl.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},nl.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},nl.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)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},tr.register("SymbolBucket",nl,{omit:["layers","collisionBoxArray","compareText"]}),nl.MAX_GLYPHS=65535,nl.addDynamicAttributes=$u;var il={kind:"color"},al={kind:"formatted"},ol=new os({"symbol-placement":new ts(Zs.layout_symbol["symbol-placement"]),"symbol-spacing":new ts(Zs.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ts(Zs.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new es(Zs.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ts(Zs.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ts(Zs.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ts(Zs.layout_symbol["icon-ignore-placement"]),"icon-optional":new ts(Zs.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ts(Zs.layout_symbol["icon-rotation-alignment"]),"icon-size":new es(Zs.layout_symbol["icon-size"]),"icon-text-fit":new ts(Zs.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ts(Zs.layout_symbol["icon-text-fit-padding"]),"icon-image":new es(Zs.layout_symbol["icon-image"]),"icon-rotate":new es(Zs.layout_symbol["icon-rotate"]),"icon-padding":new ts(Zs.layout_symbol["icon-padding"]),"icon-keep-upright":new ts(Zs.layout_symbol["icon-keep-upright"]),"icon-offset":new es(Zs.layout_symbol["icon-offset"]),"icon-anchor":new es(Zs.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ts(Zs.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ts(Zs.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ts(Zs.layout_symbol["text-rotation-alignment"]),"text-field":new es(Zs.layout_symbol["text-field"]),"text-font":new es(Zs.layout_symbol["text-font"]),"text-size":new es(Zs.layout_symbol["text-size"]),"text-max-width":new es(Zs.layout_symbol["text-max-width"]),"text-line-height":new ts(Zs.layout_symbol["text-line-height"]),"text-letter-spacing":new es(Zs.layout_symbol["text-letter-spacing"]),"text-justify":new es(Zs.layout_symbol["text-justify"]),"text-radial-offset":new es(Zs.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ts(Zs.layout_symbol["text-variable-anchor"]),"text-anchor":new es(Zs.layout_symbol["text-anchor"]),"text-max-angle":new ts(Zs.layout_symbol["text-max-angle"]),"text-writing-mode":new ts(Zs.layout_symbol["text-writing-mode"]),"text-rotate":new es(Zs.layout_symbol["text-rotate"]),"text-padding":new ts(Zs.layout_symbol["text-padding"]),"text-keep-upright":new ts(Zs.layout_symbol["text-keep-upright"]),"text-transform":new es(Zs.layout_symbol["text-transform"]),"text-offset":new es(Zs.layout_symbol["text-offset"]),"text-allow-overlap":new ts(Zs.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ts(Zs.layout_symbol["text-ignore-placement"]),"text-optional":new ts(Zs.layout_symbol["text-optional"])}),sl=new os({"icon-opacity":new es(Zs.paint_symbol["icon-opacity"]),"icon-color":new es(Zs.paint_symbol["icon-color"]),"icon-halo-color":new es(Zs.paint_symbol["icon-halo-color"]),"icon-halo-width":new es(Zs.paint_symbol["icon-halo-width"]),"icon-halo-blur":new es(Zs.paint_symbol["icon-halo-blur"]),"icon-translate":new ts(Zs.paint_symbol["icon-translate"]),"icon-translate-anchor":new ts(Zs.paint_symbol["icon-translate-anchor"]),"text-opacity":new es(Zs.paint_symbol["text-opacity"]),"text-color":new es(Zs.paint_symbol["text-color"],{runtimeType:il,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new es(Zs.paint_symbol["text-halo-color"]),"text-halo-width":new es(Zs.paint_symbol["text-halo-width"]),"text-halo-blur":new es(Zs.paint_symbol["text-halo-blur"]),"text-show-background":new es(Zs.paint_symbol["text-show-background"]),"text-translate":new ts(Zs.paint_symbol["text-translate"]),"text-translate-anchor":new ts(Zs.paint_symbol["text-translate-anchor"])}),ul={paint:sl,layout:ol},ll=function(t){function e(e){t.call(this,e,ul)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a