@opensystemslab/map 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/index.html +16 -1
- package/dist/map.es.js +11 -4
- package/dist/map.umd.js +14 -7
- package/package.json +4 -3
- package/types/{draw.d.ts → drawing.d.ts} +3 -2
- package/types/my-map.d.ts +7 -1
- package/types/snapping.d.ts +12 -0
package/dist/map.es.js
CHANGED
@@ -29,7 +29,7 @@ const ct=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?l(a({
|
|
29
29
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
30
30
|
read:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=i?r-1:0,p=i?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,u=8*o-r-1,h=(1<<u)-1,c=h>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,r),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,r),s=0));r>=8;t[i+d]=255&a,d+=f,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[i+d]=255&s,d+=f,s/=256,u-=8);t[i+d-f]|=128*y}},ul=cl,hl=ll;function cl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}cl.Varint=0,cl.Fixed64=1,cl.Bytes=2,cl.Fixed32=5;var pl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function dl(t){return t.type===cl.Bytes?t.readVarint()+t.pos:t.pos+1}function fl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function yl(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function gl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function ml(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function vl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function _l(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function xl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function bl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function wl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Tl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function El(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function kl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}cl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Tl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=kl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Tl(this.buf,this.pos)+4294967296*Tl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Tl(this.buf,this.pos)+4294967296*kl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=hl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=hl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return fl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&pl?function(t,e,i){return pl.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var o,s,a,l=t[r],u=null,h=l>239?4:l>223?3:l>191?2:1;if(r+h>i)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[r+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),r+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==cl.Bytes)return t.push(this.readVarint(e));var i=dl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==cl.Bytes)return t.push(this.readSVarint());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==cl.Bytes)return t.push(this.readBoolean());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==cl.Bytes)return t.push(this.readFloat());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==cl.Bytes)return t.push(this.readDouble());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==cl.Bytes)return t.push(this.readFixed32());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==cl.Bytes)return t.push(this.readSFixed32());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==cl.Bytes)return t.push(this.readFixed64());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==cl.Bytes)return t.push(this.readSFixed64());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===cl.Varint)for(;this.buf[this.pos++]>127;);else if(e===cl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===cl.Fixed32)this.pos+=4;else{if(e!==cl.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),El(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),El(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),El(this.buf,-1&t,this.pos),El(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),El(this.buf,-1&t,this.pos),El(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&yl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),hl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),hl.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 i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&yl(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,cl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,xl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,_l,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,bl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writeBytesField:function(t,e){this.writeTag(t,cl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,cl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,cl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,cl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,cl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,cl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,cl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,cl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,cl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,cl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Pl=[1,0,0,1,0,0],Ol=function(){function t(t,e,i,n,r){this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===kn?on(this.flatCoordinates_):sn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=gn(this.getExtent());this.flatInteriorPoints_=vs(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ga(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=_s(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=aa(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,n=0,r=i.length;n<r;++n){var o=i[n],s=aa(t,e,o,2,.5);_t(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Zn(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var n=_n(i)/_n(e);vr(Pl,i[0],i[3],n,-n,0,0,0),Go(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Pl,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Ol.prototype.getEndss=Ol.prototype.getEnds,Ol.prototype.getFlatCoordinates=Ol.prototype.getOrientedFlatCoordinates;var Rl=Ol,Il=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Fl(t,e,i){if(3===t){var n={keys:[],values:[],features:[]},r=i.readVarint()+i.pos;i.readFields(jl,n,r),n.length=n.features.length,n.length&&(e[n.name]=n)}}function jl(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var n=null,r=i.readVarint()+i.pos;i.pos<r;)n=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(n)}}function Ml(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var n=i.readVarint()+i.pos;i.pos<n;){var r=e.layer.keys[i.readVarint()],o=e.layer.values[i.readVarint()];e.properties[r]=o}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Al(t,e,i){t.pos=e.features[i];var n=t.readVarint()+t.pos,r={layer:e,type:0,properties:{}};return t.readFields(Ml,r,n),r}var Ll=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.dataProjection=new _i({code:"",units:vi.TILE_PIXELS}),i.featureClass_=n.featureClass?n.featureClass:Rl,i.geometryName_=n.geometryName,i.layerName_=n.layerName?n.layerName:"layer",i.layers_=n.layers?n.layers:null,i.idProperty_=n.idProperty,i}return Il(e,t),e.prototype.readRawGeometry_=function(t,e,i,n){t.pos=e.geometry;for(var r=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<r;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),i.push(a,l),u+=2):7===o?u>h&&(i.push(i[h],i[h+1]),u+=2):Ie(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,i){var n,r=e.type;if(0===r)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var i;1===t?i=1===e?kn:In:2===t?i=1===e?Pn:Fn:3===t&&(i=Rn);return i}(r,l.length);if(this.featureClass_===Rl)(n=new this.featureClass_(u,a,l,s,o)).transform(i.dataProjection);else{var h=void 0;if(u==Rn){for(var c=[],p=0,d=0,f=0,y=l.length;f<y;++f){var g=l[f];if(Cs(a,p,g,2)){if(0===c.length)continue;c[c.length-1].push(l[d])}else c.push(l.slice(d,f+1));d=f+1,p=g}h=c.length>1?new va(a,Ao,c):new Os(a,Ao,l)}else h=u===kn?new fs(a,Ao):u===Pn?new ca(a,Ao):u===Rn?new Os(a,Ao,l):u===In?new ya(a,Ao):u===Fn?new da(a,Ao,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var m=Qs(h,!1,i);n.setGeometry(m),n.setId(o),n.setProperties(s,!0)}return n},e.prototype.getType=function(){return ta},e.prototype.readFeatures=function(t,e){var i=this.layers_,n=this.adaptOptions(e),r=Zn(n.dataProjection);r.setWorldExtent(n.extent),n.dataProjection=r;var o=new ul(t),s=o.readFields(Fl,{}),a=[];for(var l in s)if(!i||-1!=i.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;r.setExtent(h);for(var c=0,p=u.length;c<p;++c){var d=Al(o,u,c);a.push(this.createFeature_(o,d,n))}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Js),zl="active",Dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Gl(t,e,i,n){var r=t.getZoom();if(void 0!==r){var o=t.getConstrainedZoom(r+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:ai})}}var Nl=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Dl(e,t),e.prototype.getActive=function(){return this.get(zl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(zl,t)},e.prototype.setMap=function(t){this.map_=t},e}(te),Bl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wl=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Bl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ho.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Gl(n.getView(),o,r,this.duration_),i.preventDefault(),e=!0}return!e},e}(Nl),ql=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Vl(t){for(var e=t.length,i=0,n=0,r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return[i/e,n/e]}var Ul=function(t){function e(e){var i=this,n=e||{};return i=t.call(this,n)||this,n.handleDownEvent&&(i.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(i.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(i.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(i.handleUpEvent=n.handleUpEvent),n.stopDown&&(i.stopDown=n.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return ql(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ho.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ho.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==ho.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ho.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===ho.POINTERDOWN||e===ho.POINTERDRAG||e===ho.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==ho.POINTERUP?delete this.trackedPointers_[i]:(t.type==ho.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Et(this.trackedPointers_)}},e}(Nl);function Xl(t){var e=arguments;return function(t){for(var i=!0,n=0,r=e.length;n<r&&(i=i&&e[n](t));++n);return i}}var Kl=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Yl=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Zl=bt,Hl=function(t){var e=t.originalEvent;return 0==e.button&&!(se&&ae&&e.ctrlKey)},$l=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Jl=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ql=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},tu=function(t){var e=t.originalEvent;return Ie(void 0!==e,56),"mouse"==e.pointerType},eu=function(t){var e=t.originalEvent;return Ie(void 0!==e,56),e.isPrimary&&0===e.button},iu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nu=function(t){function e(e){var i=t.call(this,{stopDown:wt})||this,n=e||{};i.kinetic_=n.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var r=n.condition?n.condition:Xl($l,eu);return i.condition_=n.onFocusOnly?Xl(Yl,r):r,i.noKinetic_=!1,i}return iu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,n=this.targetPointers,r=Vl(n);if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var o=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],s=t.map.getView();e=o,i=s.getResolution(),e[0]*=i,e[1]*=i,Bn(o,s.getRotation()),s.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=i.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-n*Math.cos(r),s[1]-n*Math.sin(r)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:ai})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Ul),ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ou=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:wt})||this).condition_=n.condition?n.condition:Kl,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return ru(e,t),e.prototype.handleDragEvent=function(t){if(tu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==jo){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!tu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!tu(t)&&(!(!Hl(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Ul),su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),au=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return su(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Os([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(yt),lu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),uu="boxstart",hu="boxdrag",cu="boxend",pu="boxcancel",du=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.coordinate=i,r.mapBrowserEvent=n,r}return lu(e,t),e}(dt),fu=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=e||{};return i.box_=new au(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Hl,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return lu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new du(hu,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new du(e?cu:pu,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new du(uu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Ul),yu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gu=function(t){function e(e){var i=this,n=e||{},r=n.condition?n.condition:Jl;return(i=t.call(this,{condition:r,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return yu(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(i),r=e.getResolutionForExtentInternal(n),o=e.getResolution()/r;(i=i.clone()).scale(o*o)}e.fitInternal(i,{duration:this.duration_,easing:ai})},e}(fu),mu=37,vu=38,_u=39,xu=40,bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return $l(t)&&Ql(t)},i.condition_=void 0!==n.condition?n.condition:i.defaultCondition_,i.duration_=void 0!==n.duration?n.duration:100,i.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,i}return bu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==zt){var i=t.originalEvent,n=i.keyCode;if(this.condition_(t)&&(n==xu||n==mu||n==_u||n==vu)){var r=t.map.getView(),o=r.getResolution()*this.pixelDelta_,s=0,a=0;n==xu?a=-o:n==mu?s=-o:n==_u?s=o:a=o;var l=[s,a];Bn(l,r.getRotation()),function(t,e,i){var n=t.getCenterInternal();if(n){var r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ui,center:t.getConstrainedCenter(r)})}}(r,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Nl),Su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Cu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:Ql,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return Su(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==zt||t.type==Dt){var i=t.originalEvent,n=i.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var r=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;Gl(r.getView(),o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Nl),Tu=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Eu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ku="trackpad",Pu="wheel",Ou=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var r=n.condition?n.condition:Zl;return i.condition_=n.onFocusOnly?Xl(Yl,r):r,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Eu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Wt)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Wt&&(e=n.deltaY,oe&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=le),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?ku:Pu);var o=i.getView();if(this.mode_===ku&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Fe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Gl(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Nl),Ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Iu=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return Ru(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==jo){var l=s.getViewport().getBoundingClientRect(),u=Vl(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Ul),Fu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ju=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Fu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=Vl(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Ul),Mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Au=function(t){function e(e,i,n){var r=t.call(this)||this;if(void 0!==n&&void 0===i)r.setFlatCoordinates(n,e);else{var o=i||0;r.setCenterAndRadius(e,o,n)}return r}return Mu(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,n){var r=this.flatCoordinates,o=t-r[0],s=e-r[1],a=o*o+s*s;if(a<n){if(0===a)for(var l=0;l<this.stride;++l)i[l]=r[l];else{var u=this.getRadius()/Math.sqrt(a);i[0]=r[0]+u*o,i[1]=r[1]+u*s;for(l=2;l<this.stride;++l)i[l]=r[l]}return i.length=this.stride,a}return n},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,n=t-i[0],r=e-i[1];return n*n+r*r<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return nn(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return An},e.prototype.intersectsExtent=function(t){if(Cn(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||pn(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var r=1;r<e;++r)n[e+r]=t[r];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,r=Qo(n,0,t,this.stride);n[r++]=n[0]+e;for(var o=1,s=this.stride;o<s;++o)n[r++]=n[o];n.length=r,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter(No(i,0,i.length,n,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter(Bo(i,0,i.length,n,t,e,i)),this.changed()},e}(Ko);Au.prototype.transform;var Lu=Au;function zu(t,e,i,n,r){Du(t,e,i||0,n||t.length-1,r||Nu)}function Du(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Du(t,e,Math.max(i,Math.floor(e-s*l/o+u)),Math.min(n,Math.floor(e+(o-s)*l/o+u)),r)}var h=t[e],c=i,p=n;for(Gu(t,i,e),r(t[n],h)>0&&Gu(t,i,n);c<p;){for(Gu(t,c,p),c++,p--;r(t[c],h)<0;)c++;for(;r(t[p],h)>0;)p--}0===r(t[i],h)?Gu(t,i,p):Gu(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function Gu(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Nu(t,e){return t<e?-1:t>e?1:0}class Bu{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!Ju(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;Ju(t,a)&&(e.leaf?i.push(s):$u(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i}collides(t){let e=this.data;if(!Ju(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(Ju(t,o)){if(e.leaf||$u(t,o))return!0;i.push(r)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Qu([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let s,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],s=o.pop(),l=!0),i.leaf){const n=Wu(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!$u(i,n)?a?(s++,i=a.children[s],l=!1):i=null:(r.push(i),o.push(s),s=0,a=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return o=Qu(t.slice(e,i+1)),qu(o,this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),o=Qu([]),o.leaf=!1,o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));th(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);th(t,u,e,a,this.compareMinY);for(let i=u;i<=e;i+=a){const r=Math.min(i+a-1,e);o.children.push(this._build(t,i,r,n-1))}}return qu(o,this.toBBox),o}_chooseSubtree(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i,n=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=Yu(l),h=(r=t,o=l,(Math.max(o.maxX,r.maxX)-Math.min(o.minX,r.minX))*(Math.max(o.maxY,r.maxY)-Math.min(o.minY,r.minY))-u);h<s?(s=h,n=u<n?u:n,i=l):h===s&&u<n&&(n=u,i=l)}e=i||e.children[0]}var r,o;return e}_insert(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),Uu(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}_split(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=Qu(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,qu(i,this.toBBox),qu(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,e){this.data=Qu([t,e]),this.data.height=t.height+1,this.data.leaf=!1,qu(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=Vu(t,0,s,this.toBBox),a=Vu(t,s,i,this.toBBox),l=Hu(e,a),u=Yu(e)+Yu(a);l<r?(r=l,n=s,o=u<o?u:o):l===r&&u<o&&(o=u,n=s)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:Xu,r=t.leaf?this.compareMinY:Ku;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=Vu(t,0,e,r),s=Vu(t,i-e,i,r);let a=Zu(o)+Zu(s);for(let l=e;l<i-e;l++){const e=t.children[l];Uu(o,t.leaf?r(e):e),a+=Zu(o)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Uu(s,t.leaf?r(e):e),a+=Zu(s)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)Uu(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():qu(t[i],this.toBBox)}}function Wu(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function qu(t,e){Vu(t,0,t.children.length,e,t)}function Vu(t,e,i,n,r){r||(r=Qu(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];Uu(r,t.leaf?n(e):e)}return r}function Uu(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Xu(t,e){return t.minX-e.minX}function Ku(t,e){return t.minY-e.minY}function Yu(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Zu(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Hu(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function $u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Ju(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Qu(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function th(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;zu(t,s,e,i,r),o.push(e,s,s,i)}}var eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ih="renderOrder",nh=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(i=t.call(this,r)||this).declutter_=void 0!==n.declutter&&n.declutter,i.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(n.style),i.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,i.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,i}return eh(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(ih)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Bu(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(ih,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:el,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Ie("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}($e),rh={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},oh=[rh.FILL],sh=[rh.STROKE],ah=[rh.BEGIN_PATH],lh=[rh.CLOSE_PATH],uh=rh,hh=function(){function t(){}return t.prototype.drawCustom=function(t,e,i){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),ch=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ph=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=r,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return ch(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,r=this.coordinates,o=r.length,s=0,a=t.length;s<a;s+=e)n[0]=t[s],n[1]=t[s+1],$i(i,n)&&(r[o++]=n[0],r[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,i,n,r,o){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],d=t[e+1],f=this.tmpCoordinate_,y=!0;for(u=e+n;u<i;u+=n)f[0]=t[u],f[1]=t[u+1],(c=tn(l,f))!==h?(y&&(s[a++]=p,s[a++]=d,y=!1),s[a++]=f[0],s[a++]=f[1]):c===Wi?(s[a++]=f[0],s[a++]=f[1],y=!1):y=!0,p=f[0],d=f[1],h=c;return(r&&y||u===e+n)&&(s[a++]=p,s[a++]=d),a},e.prototype.drawCustomCoordinates_=function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o],l=this.appendFlatLineCoordinates(t,e,a,n,!1,!1);r.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var n,r,o,s,a,l=t.getType(),u=t.getStride(),h=this.coordinates.length;if(l==jn){n=t.getOrientedFlatCoordinates(),s=[];var c=t.getEndss();a=0;for(var p=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(n,a,c[p],u,f),s.push(f)}this.instructions.push([uh.CUSTOM,h,s,t,i,ls])}else l==Rn||l==Fn?(o=[],n=l==Rn?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(n,0,t.getEnds(),u,o),this.instructions.push([uh.CUSTOM,h,o,t,i,as])):l==Pn||l==An?(n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,u,!1,!1),this.instructions.push([uh.CUSTOM,h,r,t,i,ss])):l==In?(n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,u))>h&&this.instructions.push([uh.CUSTOM,h,r,t,i,ss])):l==kn&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([uh.CUSTOM,h,r,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[uh.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[uh.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,r=e.length,o=-1;for(t=0;t<r;++t)(n=(i=e[t])[0])==uh.END_GEOMETRY?o=t:n==uh.BEGIN_GEOMETRY&&(i[2]=t,vt(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Ya(n||"#000")}else i.fillStyle=void 0;if(e){var r=e.getColor();i.strokeStyle=Ya(r||"#000");var o=e.getLineCap();i.lineCap=void 0!==o?o:"round";var s=e.getLineDash();i.lineDash=s?s.slice():zr;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();i.miterLimit=void 0!==h?h:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[uh.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[uh.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!xt(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[uh.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Zi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Yi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(hh),dh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fh=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return dh(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([uh.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([uh.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([uh.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([uh.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=r,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ph),yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return yh(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[uh.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,zr,0],ah);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(sh),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ah);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(sh),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(sh),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(sh),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(ah)},e}(ph),mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return mh(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var r=this.state,o=void 0!==r.fillStyle,s=void 0!==r.strokeStyle,a=i.length;this.instructions.push(ah),this.hitDetectionInstructions.push(ah);for(var l=0;l<a;++l){var u=i[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!s),p=[uh.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(lh),this.hitDetectionInstructions.push(lh)),e=u}return o&&(this.instructions.push(oh),this.hitDetectionInstructions.push(oh)),s&&(this.instructions.push(sh),this.hitDetectionInstructions.push(sh)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([uh.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var l=[uh.CIRCLE,a];this.instructions.push(ah,l),this.hitDetectionInstructions.push(ah,l),void 0!==i.fillStyle&&(this.instructions.push(oh),this.hitDetectionInstructions.push(oh)),void 0!==i.strokeStyle&&(this.instructions.push(sh),this.hitDetectionInstructions.push(sh)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([uh.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([uh.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,n=0,r=i.length;n<r;++n)i[n]=ns(i[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(ph);function _h(t,e,i,n,r){var o,s,a,l,u,h,c,p,d,f=i,y=i,g=0,m=0,v=i;for(o=i;o<n;o+=r){var _=e[o],x=e[o+1];void 0!==l&&(p=_-l,d=x-u,a=Math.sqrt(p*p+d*d),void 0!==h&&(m+=s,Math.acos((h*p+c*d)/(s*a))>t&&(m>g&&(g=m,f=v,y=o),m=0,v=o-r)),s=a,h=p,c=d),l=_,u=x}return(m+=a)>g?[v,o]:[f,y]}var xh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bh={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},wh={Circle:vh,Default:ph,Image:fh,LineString:gh,Polygon:vh,Text:function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return xh(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,u=t.getStride();if(r.placement!==sl||a!=Pn&&a!=Fn&&a!=Rn&&a!=jn){var h=r.overflow?null:[];switch(a){case kn:case In:l=t.getFlatCoordinates();break;case Pn:l=t.getFlatMidpoint();break;case An:l=t.getCenter();break;case Fn:l=t.getFlatMidpoints(),u=2;break;case Rn:l=t.getFlatInteriorPoint(),r.overflow||h.push(l[2]/this.resolution),u=3;break;case jn:var c=t.getFlatInteriorPoints();l=[];for(w=0,S=c.length;w<S;w+=3)r.overflow||h.push(c[w+2]/this.resolution),l.push(c[w],c[w+1]);if(0===l.length)return;u=2}if((R=this.appendFlatPointCoordinates(l,u))===s)return;if(h&&(R-s)/2!=l.length/u){var p=s/2;h=h.filter((function(t,e){var i=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return i||--p,i}))}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var d=r.padding;if(d!=Dr&&(r.scale[0]<0||r.scale[1]<0)){var f=r.padding[0],y=r.padding[1],g=r.padding[2],m=r.padding[3];r.scale[0]<0&&(y=-y,m=-m),r.scale[1]<0&&(f=-f,g=-g),d=[f,y,g,m]}var v=this.pixelRatio;this.instructions.push([uh.DRAW_IMAGE,s,R,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,d==Dr?Dr:d.map((function(t){return t*v})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var _=1/v;this.hitDetectionInstructions.push([uh.DRAW_IMAGE,s,R,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,d,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!Cn(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),a==Pn)x=[l.length];else if(a==Fn)x=t.getEnds();else if(a==Rn)x=t.getEnds().slice(0,1);else if(a==jn){var b=t.getEndss();x=[];for(var w=0,S=b.length;w<S;++w)x.push(b[w][0])}this.beginGeometry(t,e);for(var C=r.textAlign,T=0,E=void 0,k=0,P=x.length;k<P;++k){if(null==C){var O=_h(r.maxAngle,l,T,x[k],u);T=O[0],E=O[1]}else E=x[k];for(var w=T;w<E;w+=u)o.push(l[w],l[w+1]);var R=o.length;T=x[k],this.drawChars_(s,R),s=R}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,n=this.textState_,r=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=bh[n.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([uh.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,a,u,r,c*a,h,o,1]),this.hitDetectionInstructions.push([uh.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,1,u,r,c,h,o,1/a])},e.prototype.setTextStyle=function(t,e){var i,n,r;if(t){var o=t.getFill();o?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=Ya(o.getColor()||"#000")):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(r=this.textStrokeState_)||(r={},this.textStrokeState_=r);var a=s.getLineDash(),l=s.getLineDashOffset(),u=s.getWidth(),h=s.getMiterLimit();r.lineCap=s.getLineCap()||"round",r.lineDash=a?a.slice():zr,r.lineDashOffset=void 0===l?0:l,r.lineJoin=s.getLineJoin()||"round",r.lineWidth=void 0===u?1:u,r.miterLimit=void 0===h?10:h,r.strokeStyle=Ya(s.getColor()||"#000")}else r=null,this.textStrokeState_=r;i=this.textState_;var c=t.getFont()||"10px sans-serif";Ur(c);var p=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Dr,i.scale=void 0===p?[1,1]:p;var d=t.getOffsetX(),f=t.getOffsetY(),y=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===g?0:g,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:$t(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+$t(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(ph)},Sh=function(){function t(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var n in i){var r=i[n].finish();t[e][n]=r}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);var r=n[e];void 0===r&&(r=new(0,wh[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r);return r},t}(),Ch=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Th=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Ch(e,t),e.prototype.getFeatures=function(t){return Zt()},e.prototype.prepareFrame=function(t){return Zt()},e.prototype.renderFrame=function(t,e){return Zt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,r){var o=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,r,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){},e.prototype.getDataAtPixel=function(t,e,i){return Zt()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Aa&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Aa&&e!=La&&t.addEventListener(It,this.boundHandleImageChange_),e==ja&&(t.load(),e=t.getState()),e==Aa},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ye&&t.changed()},e}(Yt),Eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),kh=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Eh(e,t),e.prototype.useContainer=function(t,e,i){var n,r,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(r=a.getContext("2d")));if(!r||0!==r.canvas.width&&r.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=r,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=o;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(r=pe()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=r}},e.prototype.clipUnrotated=function(t,e,i){var n=bn(i),r=wn(i),o=yn(i),s=fn(i);gr(e.coordinateToPixelTransform,n),gr(e.coordinateToPixelTransform,r),gr(e.coordinateToPixelTransform,o),gr(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;gr(a,n),gr(a,r),gr(a,o),gr(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var r=new Lr(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(We,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(qe,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,r,o,s){var a=r/2,l=o/2,u=n/e,h=-u,c=-t[0]+s,p=-t[1];return vr(this.tempTransform,a,l,u,h,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,r=gr(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer().getExtent();if(s&&!$i(s,gr(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(r[0]),l=Math.round(r[1]),u=document.createElement("canvas"),h=u.getContext("2d");u.width=1,u.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,a,l,1,1,0,0,1,1),n=h.getImageData(0,0,1,1).data}catch(c){return"SecurityError"===c.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Th),Ph="Circle",Oh="Default",Rh="Image",Ih="LineString",Fh="Polygon",jh="Text";function Mh(t,e,i,n,r,o,s,a,l,u,h,c){var p=t[e],d=t[e+1],f=0,y=0,g=0,m=0;function v(){f=p,y=d,p=t[e+=n],d=t[e+1],m+=g,g=Math.sqrt((p-f)*(p-f)+(d-y)*(d-y))}do{v()}while(e<i-n&&m+g<o);for(var _=(o-m)/g,x=Ge(f,p,_),b=Ge(y,d,_),w=e-n,S=m,C=o+a*l(u,r,h);e<i-n&&m+g<C;)v();var T,E=Ge(f,p,_=(C-m)/g),k=Ge(y,d,_);if(c){var P=[x,b,E,k];No(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=x>E;var O,R=Math.PI,I=[],F=w+n===e;if(g=0,m=S,p=t[e=w],d=t[e+1],F){v();var j=Math.atan2(d-y,p-f);T&&(j+=j>0?-R:R);var M=(E+x)/2,A=(k+b)/2;return I[0]=[M,A,(C-o)/2,j,r],I}for(var L=0,z=r.length;L<z;){v();var D=Math.atan2(d-y,p-f);if(T&&(D+=D>0?-R:R),void 0!==O){var G=D-O;if(G+=G>R?-2*R:G<-R?2*R:0,Math.abs(G)>s)return null}O=D;for(var N=L,B=0;L<z;++L){var W=a*l(u,r[T?z-L-1:L],h);if(e+n<i&&m+g<o+B+W/2)break;B+=W}if(L!==N){var q=T?r.substring(z-N,z-L):r.substring(N,L);M=Ge(f,p,_=(o+B/2-m)/g),A=Ge(y,d,_);I.push([M,A,B/2,D,q]),o+=B}}return I}var Ah=[1/0,1/0,-1/0,-1/0],Lh=[],zh=[],Dh=[],Gh=[];function Nh(t){return t[3].declutterBox}var Bh=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Wh(t,e){return"start"!==e&&"end"!==e||Bh.test(t)||(e="start"===e?"left":"right"),bh[e]}var qh=function(){function t(t,e,i,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,n){var r=t+e+i+n;if(this.labels_[r])return this.labels_[r];var o=n?this.strokeStates[n]:null,s=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Wh(t,a.textAlign||"center"),c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],y=function(t,e,i){for(var n=e.length,r=0,o=0;o<n;++o){var s=Yr(t,e[o]);r=Math.max(r,s),i.push(s)}return r}(a.font,p,f),g=Xr(a.font),m=y+c,v=[],_=(m+2)*u[0],x=(g*d+c)*u[1],b={width:_<0?Math.floor(_):Math.ceil(_),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",a.font),n)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(ue?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));i&&v.push("fillStyle",s.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var w,S=.5-h,C=h*m+S*c;if(n)for(w=0;w<d;++w)v.push("strokeText",[p[w],C+S*f[w],.5*(c+g)+w*g]);if(i)for(w=0;w<d;++w)v.push("fillText",[p[w],C+S*f[w],.5*(c+g)+w*g]);return this.labels_[r]=b,b},t.prototype.replayTextBackground_=function(t,e,i,n,r,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,n,r,o,s,a,l,u,h,c,p,d,f,y){var g,m=i-(s*=c[0]),v=n-(a*=c[1]),_=r+l>t?t-l:r,x=o+u>e?e-u:o,b=d[3]+_*c[0]+d[1],w=d[0]+x*c[1]+d[2],S=m-d[3],C=v-d[0];return(f||0!==h)&&(Lh[0]=S,Gh[0]=S,Lh[1]=C,zh[1]=C,zh[0]=S+b,Dh[0]=zh[0],Dh[1]=C+w,Gh[1]=Dh[1]),0!==h?(gr(g=vr([1,0,0,1,0,0],i,n,1,1,h,-i,-n),Lh),gr(g,zh),gr(g,Dh),gr(g,Gh),nn(Math.min(Lh[0],zh[0],Dh[0],Gh[0]),Math.min(Lh[1],zh[1],Dh[1],Gh[1]),Math.max(Lh[0],zh[0],Dh[0],Gh[0]),Math.max(Lh[1],zh[1],Dh[1],Gh[1]),Ah)):nn(Math.min(S,S+b),Math.min(C,C+w),Math.max(S,S+b),Math.max(C,C+w),Ah),p&&(m=Math.round(m),v=Math.round(v)),{drawImageX:m,drawImageY:v,drawImageW:_,drawImageH:x,originX:l,originY:u,declutterBox:{minX:Ah[0],minY:Ah[1],maxX:Ah[2],maxY:Ah[3],value:y},canvasTransform:g,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,r,o,s){var a=!(!o&&!s),l=n.declutterBox,u=t.canvas,h=s?s[2]*n.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(a&&this.replayTextBackground_(t,Lh,zh,Dh,Gh,o,s),Hr(t,n.canvasTransform,r,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=gr(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=Wh(t,r.textAlign||"center"),u=bh[r.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,i,n,r,o,s,a){var l;this.pixelCoordinates_&&xt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Go(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,h,c,p,d,f,y,g,m,v,_,x,b,w,S,C,T=0,E=n.length,k=0,P=0,O=0,R=null,I=null,F=this.coordinateCache_,j=this.viewRotation_,M=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:j},L=this.instructions!=n||this.overlaps?0:200;T<E;){var z=n[T];switch(z[0]){case uh.BEGIN_GEOMETRY:b=z[1],C=z[3],b.getGeometry()?void 0===s||Cn(s,C.getExtent())?++T:T=z[2]+1:T=z[2];break;case uh.BEGIN_PATH:P>L&&(this.fill_(t),P=0),O>L&&(t.stroke(),O=0),P||O||(t.beginPath(),p=NaN,d=NaN),++T;break;case uh.CIRCLE:var D=l[k=z[1]],G=l[k+1],N=l[k+2]-D,B=l[k+3]-G,W=Math.sqrt(N*N+B*B);t.moveTo(D+W,G),t.arc(D,G,W,0,2*Math.PI,!0),++T;break;case uh.CLOSE_PATH:t.closePath(),++T;break;case uh.CUSTOM:k=z[1],u=z[2];var q=z[3],V=z[4],U=6==z.length?z[5]:void 0;A.geometry=q,A.feature=b,T in F||(F[T]=[]);var X=F[T];U?U(l,k,u,2,X):(X[0]=l[k],X[1]=l[k+1],X.length=2),V(X,A),++T;break;case uh.DRAW_IMAGE:k=z[1],u=z[2],g=z[3],h=z[4],c=z[5];var K=z[6],Y=z[7],Z=z[8],H=z[9],$=z[10],J=z[11],Q=z[12],tt=z[13],et=z[14];if(!g&&z.length>=19){m=z[18],v=z[19],_=z[20],x=z[21];var it=this.drawLabelWithPointPlacement_(m,v,_,x);g=it.label,z[3]=g;var nt=z[22];h=(it.anchorX-nt)*this.pixelRatio,z[4]=h;var rt=z[23];c=(it.anchorY-rt)*this.pixelRatio,z[5]=c,K=g.height,z[6]=K,tt=g.width,z[13]=tt}var ot=void 0;z.length>24&&(ot=z[24]);var st=void 0,at=void 0,lt=void 0;z.length>16?(st=z[15],at=z[16],lt=z[17]):(st=Dr,at=!1,lt=!1),$&&M?J+=j:$||M||(J-=j);for(var ut=0;k<u;k+=2)if(!(ot&&ot[ut++]<tt/this.pixelRatio)){var ht=[t,e,g,Dt=this.calculateImageOrLabelDimensions_(g.width,g.height,l[k],l[k+1],tt,K,h,c,Z,H,J,Q,r,st,at||lt,b),Y,at?R:null,lt?I:null],ct=void 0,pt=void 0;if(a&&et){var dt=u-k;if(!et[dt]){et[dt]=ht;continue}if(ct=et[dt],delete et[dt],pt=Nh(ct),a.collides(pt))continue}a&&a.collides(Dt.declutterBox)||(ct&&(a&&a.insert(pt),this.replayImageOrLabel_.apply(this,ct)),a&&a.insert(Dt.declutterBox),this.replayImageOrLabel_.apply(this,ht))}++T;break;case uh.DRAW_CHARS:var ft=z[1],yt=z[2],gt=z[3],mt=z[4];x=z[5];var vt=z[6],_t=z[7],bt=z[8];_=z[9];var wt=z[10];m=z[11],v=z[12];var St=[z[13],z[13]],Ct=this.textStates[v],Tt=Ct.font,Et=[Ct.scale[0]*_t,Ct.scale[1]*_t],kt=void 0;Tt in this.widths_?kt=this.widths_[Tt]:(kt={},this.widths_[Tt]=kt);var Pt=ua(l,ft,yt,2),Ot=Math.abs(Et[0])*Zr(Tt,m,kt);if(mt||Ot<=Pt){var Rt=this.textStates[v].textAlign,It=Mh(l,ft,yt,2,m,(Pt-Ot)*bh[Rt],vt,Math.abs(Et[0]),Zr,Tt,kt,M?0:this.viewRotation_);t:if(It){var Ft=[],jt=void 0,Mt=void 0,At=void 0,Lt=void 0,zt=void 0;if(_)for(jt=0,Mt=It.length;jt<Mt;++jt){At=(zt=It[jt])[4],Lt=this.createLabel(At,v,"",_),h=zt[2]+(Et[0]<0?-wt:wt),c=gt*Lt.height+2*(.5-gt)*wt*Et[1]/Et[0]-bt;var Dt=this.calculateImageOrLabelDimensions_(Lt.width,Lt.height,zt[0],zt[1],Lt.width,Lt.height,h,c,0,0,zt[3],St,!1,Dr,!1,b);if(a&&a.collides(Dt.declutterBox))break t;Ft.push([t,e,Lt,Dt,1,null,null])}if(x)for(jt=0,Mt=It.length;jt<Mt;++jt){At=(zt=It[jt])[4],Lt=this.createLabel(At,v,x,""),h=zt[2],c=gt*Lt.height-bt;Dt=this.calculateImageOrLabelDimensions_(Lt.width,Lt.height,zt[0],zt[1],Lt.width,Lt.height,h,c,0,0,zt[3],St,!1,Dr,!1,b);if(a&&a.collides(Dt.declutterBox))break t;Ft.push([t,e,Lt,Dt,1,null,null])}a&&a.load(Ft.map(Nh));for(var Gt=0,Nt=Ft.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Ft[Gt])}}++T;break;case uh.END_GEOMETRY:if(void 0!==o){var Bt=o(b=z[1],C);if(Bt)return Bt}++T;break;case uh.FILL:L?P++:this.fill_(t),++T;break;case uh.MOVE_TO_LINE_TO:for(k=z[1],u=z[2],w=l[k],y=(S=l[k+1])+.5|0,(f=w+.5|0)===p&&y===d||(t.moveTo(w,S),p=f,d=y),k+=2;k<u;k+=2)f=(w=l[k])+.5|0,y=(S=l[k+1])+.5|0,k!=u-2&&f===p&&y===d||(t.lineTo(w,S),p=f,d=y);++T;break;case uh.SET_FILL_STYLE:R=z,this.alignFill_=z[2],P&&(this.fill_(t),P=0,O&&(t.stroke(),O=0)),t.fillStyle=z[1],++T;break;case uh.SET_STROKE_STYLE:I=z,O&&(t.stroke(),O=0),this.setStrokeStyle_(t,z),++T;break;case uh.STROKE:L?O++:t.stroke(),++T;break;default:++T}}P&&this.fill_(t),O&&t.stroke()},t.prototype.execute=function(t,e,i,n,r,o){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,r,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,i,n,r){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,r)},t}(),Vh=[Fh,Ph,Ih,Rh,jh,Oh],Uh=function(){function t(t,e,i,n,r,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var n=t[e];for(var r in n){var o=n[r];i[r]=new qh(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],n=0,r=t.length;n<r;++n)if(t[n]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o){var s=2*(n=Math.round(n))+1,a=vr(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=pe(s,s));var u,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(un(u=[1/0,1/0,-1/0,-1/0],t),Yi(u,e*(this.renderBuffer_+n),u));var c,p=function(t){if(void 0!==Xh[t])return Xh[t];for(var e=2*t+1,i=t*t,n=new Array(i+1),r=0;r<=t;++r)for(var o=0;o<=t;++o){var s=r*r+o*o;if(s>i)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+r)*e+(t+o))+3),r>0&&a.push(4*((t-r)*e+(t+o))+3),o>0&&(a.push(4*((t+r)*e+(t-o))+3),r>0&&a.push(4*((t-r)*e+(t-o))+3))}for(var l=[],u=(r=0,n.length);r<u;++r)n[r]&&l.push.apply(l,n[r]);return Xh[t]=l,l}(n);function d(t,e){for(var i=h.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(i[p[a]]>0){if(!o||c!==Rh&&c!==jh||-1!==o.indexOf(t)){var u=(p[a]-3)/4,d=n-u%s,f=n-(u/s|0),y=r(t,e,d*d+f*f);if(y)return y}h.clearRect(0,0,s,s);break}}var f,y,g,m,v,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(gt),f=_.length-1;f>=0;--f){var x=_[f].toString();for(g=this.executorsByZIndex_[x],y=Vh.length-1;y>=0;--y)if(void 0!==(m=g[c=Vh[y]])&&(v=m.executeHitDetection(h,a,i,d,u)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Go(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return kt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,h,c,p,d,f=o||Vh;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var y=a[l].toString();for(p=this.executorsByZIndex_[y],h=0,c=f.length;h<c;++h){void 0!==(d=p[f[h]])&&d.execute(t,e,i,n,r,s)}}this.maxExtent_&&t.restore()},t}(),Xh={};var Kh=Uh,Yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zh=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=n,l.transform_=r,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return Yh(e,t),e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var r=Go(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;u<h;u+=2){var c=r[u]-this.imageAnchorX_,p=r[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;vr(s,d,f,1,1,l,-d,-f),o.setTransform.apply(o,s),o.translate(d,f),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var r=Go(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=n){var a=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=vr(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,i,n,r){var o=this.context_,s=Go(t,e,i,n,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;r&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return r&&o.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var r=0,o=i.length;r<o;++r)e=this.moveToLineTo_(t,e,i[r],n,!0);return e},e.prototype.drawCircle=function(t){if(Cn(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var n=t.getFlatCoordinates();if(n){var r=t.getStride();return Go(n,0,n.length,r,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],r=Math.sqrt(i*i+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case kn:this.drawPoint(t);break;case Pn:this.drawLineString(t);break;case Rn:this.drawPolygon(t);break;case In:this.drawMultiPoint(t);break;case Fn:this.drawMultiLineString(t);break;case jn:this.drawMultiPolygon(t);break;case Mn:this.drawGeometryCollection(t);break;case An:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Cn(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Cn(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),r=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,l=o.length;a<l;++a)r=this.moveToLineTo_(n,r,o[a],s,!1);i.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),n=0,r=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=r.length;s<a;++s){var l=r[s];n=this.drawRings_(i,n,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(xt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var n=t.getColor();this.fillState_={fillStyle:Ya(n||"#000")}}else this.fillState_=null;if(e){var r=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||zr;this.strokeState_={lineCap:void 0!==o?o:"round",lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:Ya(r||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Ya(i||"#000")}}else this.textFillState_=null;var n=t.getStroke();if(n){var r=n.getColor(),o=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:s||zr,lineDashOffset:a||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Ya(r||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),y=t.getRotation(),g=t.getScaleArray(),m=t.getText(),v=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==m?m:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==y?y:0,this.textScale_=[this.pixelRatio_*g[0],this.pixelRatio_*g[1]]}else this.text_=""},e}(hh);function Hh(t,e,i,n,r,o,s){var a=pe(.5*t[0],.5*t[1]);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new Zh(a,.5,r,null,s),h=i.length,c=Math.floor(16777215/h),p={},d=1;d<=h;++d){var f=i[d-1],y=f.getStyleFunction()||n;if(n){var g=y(f,o);if(g){Array.isArray(g)||(g=[g]);for(var m="#"+("000000"+(d*c).toString(16)).slice(-6),v=0,_=g.length;v<_;++v){var x=g[v],b=x.getGeometryFunction()(f);if(b&&Cn(r,b.getExtent())){var w=x.clone(),S=w.getFill();S&&S.setColor(m);var C=w.getStroke();C&&(C.setColor(m),C.setLineDash(null)),w.setText(void 0);var T=x.getImage();if(T&&0!==T.getOpacity()){var E=T.getImageSize();if(!E)continue;var k=pe(E[0],E[1],void 0,{alpha:!1}),P=k.canvas;k.fillStyle=m,k.fillRect(0,0,P.width,P.height),w.setImage(new Xa({img:P,imgSize:E,anchor:T.getAnchor(),anchorXUnits:Pa,anchorYUnits:Pa,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var O=w.getZIndex()||0;(F=p[O])||(F={},p[O]=F,F[Rn]=[],F[An]=[],F[Pn]=[],F[kn]=[]),F[b.getType().replace("Multi","")].push(b,w)}}}}}for(var R=Object.keys(p).map(Number).sort(gt),I=(d=0,R.length);d<I;++d){var F=p[R[d]];for(var j in F){var M=F[j];for(v=0,_=M.length;v<_;v+=2){u.setStyle(M[v+1]);for(var A=0,L=e.length;A<L;++A)u.setTransform(e[A]),u.drawGeometry(M[v])}}}return a.getImageData(0,0,l.width,l.height)}function $h(t,e,i){var n=[];if(i){var r=Math.floor(.5*Math.round(t[0])),o=Math.floor(.5*Math.round(t[1])),s=4*(Fe(r,0,i.width-1)+Fe(o,0,i.height-1)*i.width),a=i.data[s],l=i.data[s+1],u=i.data[s+2]+256*(l+256*a),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Jh={Point:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Aa)return;var l=t.getBuilder(i.getZIndex(),Rh);l.setImageStyle(s,o),l.drawPoint(e,n)}if(a&&a.getText()){var u=t.getBuilder(i.getZIndex(),jh);u.setTextStyle(a,o),u.drawText(e,n)}},LineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Ih);s.setFillStrokeStyle(null,o),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),jh);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Fh);a.setFillStrokeStyle(o,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Aa)return;var l=t.getBuilder(i.getZIndex(),Rh);l.setImageStyle(s,o),l.drawMultiPoint(e,n)}if(a&&a.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(a,o),u.drawText(e,n)}},MultiLineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Ih);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),jh);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(s||o){var a=t.getBuilder(i.getZIndex(),Fh);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,i,n,r){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,Jh[a[o].getType()])(t,a[o],i,n,r)}},Circle:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Ph);a.setFillStrokeStyle(o,s),a.drawCircle(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(l),u.drawText(e,n)}}};function Qh(t,e){return parseInt($t(t),10)-parseInt($t(e),10)}function tc(t,e){var i=ec(t,e);return i*i}function ec(t,e){return.5*t/e}function ic(t,e,i,n,r,o,s){var a=!1,l=i.getImage();if(l){var u=l.getImageState();u==Aa||u==La?l.unlistenImageChange(r):(u==ja&&l.load(),u=l.getImageState(),l.listenImageChange(r),a=!0)}return function(t,e,i,n,r,o){var s=i.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(n,r);if(i.getRenderer())nc(t,a,i,e);else{(0,Jh[a.getType()])(t,a,i,e,o)}}(t,e,i,n,o,s),a}function nc(t,e,i,n){if(e.getType()!=Mn)t.getBuilder(i.getZIndex(),Oh).drawCustom(e,n,i.getRenderer());else for(var r=e.getGeometries(),o=0,s=r.length;o<s;++o)nc(t,r[o],i,n)}var rc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oc=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return rc(e,t),e.prototype.useContainer=function(e,i,n){n<1&&(e=null),t.prototype.useContainer.call(this,e,i,n)},e.prototype.renderWorlds=function(t,e,i){var n=e.extent,r=e.viewState,o=r.center,s=r.resolution,a=r.projection,l=r.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,d=!(p[So]||p[Co]),f=this.context,y=Math.round(e.size[0]*c),g=Math.round(e.size[1]*c),m=h.getWrapX()&&a.canWrapX(),v=m?Sn(u):null,_=m?Math.ceil((n[2]-u[2])/v)+1:1,x=m?Math.floor((n[0]-u[0])/v):0;do{var b=this.getRenderTransform(o,s,l,c,y,g,x*v);t.execute(f,1,b,l,d,void 0,i)}while(++x<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,i){yr(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),_r(this.inversePixelTransform,this.pixelTransform);var r=xr(this.pixelTransform);this.useContainer(e,r,n.opacity);var o=this.context,s=o.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return!this.containerReused&&s.width>0&&(s.width=0),this.container;var u=Math.round(t.size[0]*i),h=Math.round(t.size[1]*i);s.width!=u||s.height!=h?(s.width=u,s.height=h,s.style.transform!==r&&(s.style.transform=r)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection;var p=!1,d=!0;if(n.extent&&this.clipping){var f=hr(n.extent);(p=(d=Cn(f,t.extent))&&!Ji(f,t.extent))&&this.clipUnrotated(o,t,f)}d&&this.renderWorlds(a,t),p&&o.restore(),this.postRender(o,t);var y=n.opacity,g=this.container;return y!==parseFloat(g.style.opacity)&&(g.style.opacity=1===y?"":String(y)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];gr(this.pixelTransform,i);var n=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=.5*i[0],c=.5*i[1];u.push(this.getRenderTransform(n,r,o,.5,h,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!Ji(d,a)){for(var f=a[0],y=Sn(d),g=0,m=void 0;f<d[0];)m=y*--g,u.push(this.getRenderTransform(n,r,o,.5,h,c,m).slice()),f+=y;for(g=0,f=a[2];f>d[2];)m=y*++g,u.push(this.getRenderTransform(n,r,o,.5,h,c,m).slice()),f-=y}this.hitDetectionImageData_=Hh(i,u,this.renderedFeatures_,l.getStyleFunction(),a,r,o)}e($h(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),h={},c=function(t,e,i){var o=$t(t),s=h[o];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return h[o]=!0,r.splice(r.lastIndexOf(s),1),n(t,u,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return h[o]=!0,n(t,u,e);r.push(h[o]={feature:t,layer:u,geometry:e,distanceSq:i,callback:n})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(n){return s=n.forEachFeatureAtCoordinate(t,a,l,i,c,n===o.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var n=t.viewHints[So],r=t.viewHints[Co],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!s&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=Qh);var y=l.center.slice(),g=Yi(a,d*h),m=g.slice(),v=[g.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Ji(_,t.extent)){var x=Sn(_),b=Math.max(Sn(g)/2,x);g[0]=_[0]-b,g[2]=_[2]+b,Un(y,u);var w=function(t,e){var i=e.getExtent(),n=gn(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){var r=Sn(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}(v[0],u);w[0]<_[0]&&w[2]<_[2]?v.push([w[0]+x,w[1],w[2]+x,w[3]]):w[0]>_[0]&&w[2]>_[2]&&v.push([w[0]-x,w[1],w[2]-x,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Ji(this.wrappedRenderedExtent_,g))return xt(this.renderedExtent_,m)||(this.hitDetectionImageData_=null,this.renderedExtent_=m),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,C=new Sh(ec(h,c),g,h,c);this.getLayer().getDeclutter()&&(S=new Sh(ec(h,c),g,h,c));for(var T=0,E=v.length;T<E;++T)i.loadFeatures(v[T],h,u);var k=tc(h,c),P=function(t){var i,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,h)),i){var r=this.renderFeature(t,k,i,C,undefined,S);this.dirty_=this.dirty_||r}}.bind(this),O=ur(g),R=i.getFeaturesInExtent(O);f&&R.sort(f);for(T=0,E=R.length;T<E;++T)P(R[T]);this.renderedFeatures_=R;var I=C.finish(),F=new Kh(g,h,c,i.getOverlaps(),I,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new Kh(g,h,c,i.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=f,this.renderedExtent_=m,this.wrappedRenderedExtent_=g,this.renderedCenter_=y,this.renderedProjection_=u,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,r,o){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var a=0,l=i.length;a<l;++a)s=ic(n,t,i[a],e,this.boundHandleStyleImageChange_,r,o)||s;else s=ic(n,t,i,e,this.boundHandleStyleImageChange_,r,o);return s},e}(kh),sc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ac=function(t){function e(e){return t.call(this,e)||this}return sc(e,t),e.prototype.createRenderer=function(){return new oc(this)},e}(nh),lc=function(){function t(t){this.rbush_=new Bu(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[$t(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,r=e.length;n<r;n++){var o=t[n],s=e[n],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[n]=a,this.items_[$t(s)]=a}this.rbush_.load(i)},t.prototype.remove=function(t){var e=$t(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[$t(e)];an([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,n=0,r=t.length;n<r;n++)if(i=e(t[n]))return i;return i},t.prototype.isEmpty=function(){return kt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return nn(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),uc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function hc(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var cc=function(t){function e(e){var i=t.call(this)||this;return i.projection=Zn(e.projection),i.attributions_=hc(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ye,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return uc(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Zt()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=hc(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(te),pc="addfeature",dc="changefeature",fc="clear",yc="removefeature",gc="featuresloadstart",mc="featuresloadend",vc="featuresloaderror";function _c(t,e){return[[-1/0,-1/0,1/0,1/0]]}function xc(t,e,i,n,r,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,n,r):t,!0),e.getType()==ta&&(a.responseType="arraybuffer"),a.withCredentials=false,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var n=e.getType(),l=void 0;n==ea||n==ia?l=a.responseText:n==na?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==ta&&(l=a.response),l?o(e.readFeatures(l,{extent:i,featureProjection:r}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}function bc(t,e){return function(i,n,r,o,s){var a=this;xc(t,e,i,n,r,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||St)}}var wc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sc=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.feature=i,r.features=n,r}return wc(e,t),e}(dt),Cc=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ye,wrapX:void 0===n.wrapX||n.wrapX})||this).on,i.once,i.un,i.loader_=St,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(Ie(i.format_,7),i.loader_=bc(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:_c;var r,o,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new lc:null,i.loadedExtentsRtree_=new lc,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(r=n.features).getArray()),s||void 0!==r||(r=new oi(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==r&&i.bindFeaturesCollection_(r),i}return wc(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=$t(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Sc(pc,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[qt(e,It,this.handleFeatureChange_,this),qt(e,ft,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(Ie(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],r=0,o=t.length;r<o;r++){var s=$t(l=t[r]);this.addToIndex_(s,l)&&i.push(l)}r=0;for(var a=i.length;r<a;r++){var l;s=$t(l=i[r]);this.setupChangeEvents_(s,l);var u=l.getGeometry();if(u){var h=u.getExtent();e.push(h),n.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,n);r=0;for(var c=i.length;r<c;r++)this.dispatchEvent(new Sc(pc,i[r]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(pc,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(yc,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ti,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ei,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(Ut)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var n=new Sc(fc);this.dispatchEvent(n),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var n=e(i);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),kt(this.nullGeometryFeatures_)||_t(t,Et(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],n=t[1],r=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||bt;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(i,n,o,s))<u){r=t;var h=Math.sqrt(s);a[0]=i-h,a[1]=n-h,a[2]=i+h,a[3]=n+h}}})),r},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=$t(e),n=e.getGeometry();if(n){var r=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(r,e)):this.featuresRtree_&&this.featuresRtree_.update(r,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Sc(dc,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:$t(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&kt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var n=this.loadedExtentsRtree_,r=this.strategy_(t,e),o=function(t,o){var a=r[t];n.forEachInExtent(a,(function(t){return Ji(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new Sc(gc)),s.loader_.call(s,a,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Sc(mc,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Sc(vc))}.bind(s)),n.insert(a,{extent:a.slice()}))},s=this,a=0,l=r.length;a<l;++a)o(a);this.loading=this.loader_!==St&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(an(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=$t(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=$t(t);this.featureChangeKeys_[e].forEach(Ut),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Sc(yc,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Ie(this.format_,7),this.url_=t,this.setLoader(bc(t,this.format_))},e}(cc),Tc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ec="Point",kc="LineString",Pc="Polygon",Oc="Circle",Rc="drawstart",Ic="drawend",Fc="drawabort",jc=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return Tc(e,t),e}(dt);var Mc=function(t){function e(e){var i=this,n=e;n.stopDown||(n.stopDown=wt),(i=t.call(this,n)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case kn:case In:return Ec;case Pn:case Fn:return kc;case Rn:case jn:return Pc;case An:return Oc;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Pc?3:2,i.maxPoints_=i.mode_===Oc?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:bt;var r,o=e.geometryFunction;if(!o){var s,a=i.mode_;if(a===Oc)o=function(t,e,i){var n=e||new Lu([NaN,NaN]),r=lr(t[0]),o=Wn(r,lr(t[t.length-1]));return n.setCenterAndRadius(r,Math.sqrt(o)),n};else a===Ec?s=fs:a===kc?s=ca:a===Pc&&(s=Os),o=function(t,e,i){return e?a===Pc?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new s(t),e}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new ac({source:new Cc({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(r=il(),function(t,e){return r[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:$l,i.freehandCondition_,e.freehand?i.freehandCondition_=Zl:i.freehandCondition_=e.freehandCondition?e.freehandCondition:Jl,i.addChangeListener(zl,i.updateState_),i}return Tc(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===Mt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Ec&&this.freehandCondition_(e);var i=e.type===ho.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===ho.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===ho.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===ho.POINTERDOWN?n=!1:i&&this.getPointerCount()<2?(n=e.type===ho.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===ho.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===ho.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new uo(ho.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Ec||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],o=n*n+r*r;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,n=[this.finishCoordinate_],r=this.mode_;if(r===Ec)e=!0;else if(r===Oc)e=2===this.sketchCoords_.length;else if(r===kc)i=this.sketchCoords_.length>this.minPoints_;else if(r===Pc){var o=this.sketchCoords_;i=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),a=0,l=n.length;a<l;a++){var u=n[a],h=s.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=d){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new $s(new fs(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new $s);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new ca(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Ec?this.sketchCoords_=t.slice():this.mode_===Pc?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new $s(new ca(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new $s,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new jc(Rc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,n=this.getMap(),r=this.sketchFeature_.getGeometry(),o=n.getView().getProjection();(this.mode_===Ec?i=this.sketchCoords_:this.mode_===Pc?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,r,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(r.getType()===Rn&&this.mode_!==Pc)this.createOrUpdateCustomSketchLine_(r);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),o=this.mode_;o===kc||o===Oc?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,n,r)):o===Pc&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;if(n===kc||n===Oc){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var r=this.finishCoordinate_.slice();t[t.length-1]=r,this.createOrUpdateSketchPoint_(r)}this.geometryFunction_(t,e,i),e.getType()===Rn&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===Pc){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){r=t[t.length-2].slice();t[t.length-1]=r,this.createOrUpdateSketchPoint_(r)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===kc?(e.pop(),this.geometryFunction_(e,i,n)):this.mode_===Pc&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),this.type_===In?t.setGeometry(new ya([e])):this.type_===Fn?t.setGeometry(new da([e])):this.type_===jn&&t.setGeometry(new va([e])),this.dispatchEvent(new jc(Ic,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new jc(Fc,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),i===kc||i===Oc)e=this.sketchCoords_;else{if(i!==Pc)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var r=0;r<t.length;r++)this.addToDrawing_(t[r]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new $s(new fs(i)),this.updateSketchFeatures_(),this.dispatchEvent(new jc(Rc,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Ul),Ac=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lc=[0,0,0,0],zc=[],Dc="modifystart",Gc="modifyend",Nc=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.features=i,r.mapBrowserEvent=n,r}return Ac(e,t),e}(dt);function Bc(t,e){return t.index-e.index}function Wc(t,e,i){var n=e.geometry;if(n.getType()===An){var r=n;if(1===e.index){null;var o=Wn(r.getCenter(),lr(t)),s=Math.sqrt(o)-r.getRadius();return s*s}}var a=lr(t);return zc[0]=lr(e.segment[0]),zc[1]=lr(e.segment[1]),Vn(a,zc)}function qc(t,e,i){var n=e.geometry;if(n.getType()===An&&1===e.index){var r=n;return ar(r.getClosestPoint(lr(t)))}var o=lr(t);return zc[0]=lr(e.segment[0]),zc[1]=lr(e.segment[1]),ar(Gn(o,zc))}var Vc=function(t){function e(e){var i,n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:eu,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==ho.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Zl,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new lc,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new ac({source:new Cc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=il(),function(t,e){return i[kn]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new oi(r.source_.getFeatures()),r.source_.addEventListener(pc,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(yc,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(ti,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(ei,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Ac(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(It,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new oi;for(var i=this.featuresBeingModified_.getArray(),n=0,r=e.length;n<r;++n)for(var o=e[n],s=0,a=o.length;s<a;++s){var l=o[s].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Nc(Dc,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(It,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n){for(var r=i[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);e.remove(r)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Ki(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Ki(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Ki(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[s,n],index:u,segment:c};this.rBush_.insert(Ki(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},r={feature:t,geometry:e,index:1,segment:[i,i]},o=[n,r];n.featureSegments=o,r.featureSegments=o,this.rBush_.insert(on(i),n);var s=e;this.rBush_.insert(s.getExtent(),r)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=i[n];(0,this.SEGMENT_WRITERS_[r.getType()])(t,r)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new $s(new fs(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",i),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=ho.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=ho.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==ho.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],n=[],r=0,o=this.dragSegments_.length;r<o;++r){var s=this.dragSegments_[r],a=s[0],l=a.feature;-1===i.indexOf(l)&&i.push(l);var u=a.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=a.depth,c=void 0,p=a.segment,d=s[1];e.length<u.getStride();)e.push(p[d][e.length]);switch(u.getType()){case kn:c=e,p[0]=e,p[1]=e;break;case In:(c=u.getCoordinates())[a.index]=e,p[0]=e,p[1]=e;break;case Pn:(c=u.getCoordinates())[a.index+d]=e,p[d]=e;break;case Fn:case Rn:(c=u.getCoordinates())[h[0]][a.index+d]=e,p[d]=e;break;case jn:(c=u.getCoordinates())[h[1]][h[0]][a.index+d]=e,p[d]=e;break;case An:if(p[0]=e,p[1]=e,0===a.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=qn(lr(u.getCenter()),lr(e));u.setRadius(f),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,i,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var n=t.map.getView().getProjection(),r=[],o=i.getGeometry().getCoordinates(),s=Ki([o]),a=this.rBush_.getInExtent(s),l={};a.sort(Bc);for(var u=0,h=a.length;u<h;++u){var c=a[u],p=c.segment,d=$t(c.geometry),f=c.depth;if(f&&(d+="-"+f.join("-")),l[d]||(l[d]=new Array(2)),c.geometry.getType()!==An||1!==c.index)if(!Nn(p[0],o)||l[d][0])if(!Nn(p[1],o)||l[d][1])$t(p)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&r.push(c);else{if((c.geometry.getType()===Pn||c.geometry.getType()===Fn)&&l[d][0]&&0===l[d][0].index)continue;this.dragSegments_.push([c,1]),l[d][1]=c}else this.dragSegments_.push([c,0]),l[d][0]=c;else Nn(qc(e,c,n),o)&&!l[d][0]&&(this.dragSegments_.push([c,0]),l[d][0]=c)}r.length&&this.willModifyFeatures_(t,[r]);for(var y=r.length-1;y>=0;--y)this.insertVertex_(r[y],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],n=i.geometry;if(n.getType()===An){var r=n.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=r,o.segment[1]=r,s.segment[0]=r,s.segment[1]=r,this.rBush_.update(on(r),o);var a=n;this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Ki(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Nc(Gc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var n,r,o=this,s=i||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===kn&&(a=o.features_.getArray(),l=t,a.indexOf(l)>=0)){r=i;var s=i.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:i,segment:[s,s]}]}var a,l;return!0}),{layerFilter:l})}if(!n){var u=ur(Yi(hr(on(s,Lc)),e.getView().getResolution()*this.pixelTolerance_,Lc));n=this.rBush_.getInExtent(u)}if(n&&n.length>0){var h=n.sort((function(t,e){return Wc(s,t,a)-Wc(s,e,a)}))[0],c=h.segment,p=qc(s,h,a),d=e.getPixelFromCoordinate(p),f=qn(t,d);if(r||f<=this.pixelTolerance_){var y={};if(y[$t(c)]=!0,this.snapToPointer_||(this.delta_[0]=p[0]-s[0],this.delta_[1]=p[1]-s[1]),h.geometry.getType()===An&&1===h.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(p,[h.feature],[h.geometry]);else{var g=e.getPixelFromCoordinate(c[0]),m=e.getPixelFromCoordinate(c[1]),v=Wn(d,g),_=Wn(d,m);f=Math.sqrt(Math.min(v,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(p=v>_?c[1]:c[0]),this.createOrUpdateVertexFeature_(p,[h.feature],[h.geometry]);var x={};x[$t(h.geometry)]=!0;for(var b=1,w=n.length;b<w;++b){var S=n[b].segment;if(!(Nn(c[0],S[0])&&Nn(c[1],S[1])||Nn(c[0],S[1])&&Nn(c[1],S[0])))break;var C=$t(n[b].geometry);C in x||(x[C]=!0,y[$t(S)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,n=t.segment,r=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case Fn:case Rn:(i=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case jn:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case Pn:(i=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,a,s,1);var u={segment:[n[0],e],feature:r,geometry:o,depth:s,index:a};l.insert(Ki(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:r,geometry:o,depth:s,index:a+1};l.insert(Ki(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ho.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Nc(Gc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,n,r,o,s,a,l,u,h,c=this.dragSegments_,p={},d=!1;for(r=c.length-1;r>=0;--r)h=$t((u=(i=c[r])[0]).feature),u.depth&&(h+="-"+u.depth.join("-")),h in p||(p[h]={}),0===i[1]?(p[h].right=u,p[h].index=u.index):1==i[1]&&(p[h].left=u,p[h].index=u.index+1);for(h in p){switch(l=p[h].right,s=p[h].left,(a=(o=p[h].index)-1)<0&&(a=0),t=e=(n=(u=void 0!==s?s:l).geometry).getCoordinates(),d=!1,n.getType()){case Fn:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(o,1),d=!0);break;case Pn:e.length>2&&(e.splice(o,1),d=!0);break;case jn:t=t[u.depth[1]];case Rn:(t=t[u.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var f=[];if(void 0!==s&&(this.rBush_.remove(s),f.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==s&&void 0!==l){var y={depth:u.depth,feature:u.feature,geometry:u.geometry,index:a,segment:f};this.rBush_.insert(Ki(y.segment),y)}this.updateSegmentIndices_(n,o,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||xt(r.depth,i))&&r.index>e&&(r.index+=n)}))},e}(Ul),Uc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Xc(t){return t.feature?t.feature:t.element?t.element:void 0}var Kc=[],Yc=function(t){function e(e){var i=this,n=e||{},r=n;return r.handleDownEvent||(r.handleDownEvent=bt),r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).source_=n.source?n.source:null,i.vertex_=void 0===n.vertex||n.vertex,i.edge_=void 0===n.edge||n.edge,i.features_=n.features?n.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.rBush_=new lc,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Uc(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,n=$t(t),r=t.getGeometry();if(r){var o=this.SEGMENT_WRITERS_[r.getType()];o&&(this.indexedFeaturesExtents_[n]=r.getExtent([1/0,1/0,-1/0,-1/0]),o(t,r))}i&&(this.featureChangeListenerKeys_[n]=qt(t,It,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Xc(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Xc(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=$t(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Et(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,n=$t(t),r=this.indexedFeaturesExtents_[n];if(r){var o=this.rBush_,s=[];o.forEachInExtent(r,(function(e){t===e.feature&&s.push(e)}));for(var a=s.length-1;a>=0;--a)o.remove(s[a])}i&&(Ut(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var i=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();i&&(n.forEach(Ut),n.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(qt(this.features_,ti,this.handleFeatureAdd_,this),qt(this.features_,ei,this.handleFeatureRemove_,this)):this.source_&&n.push(qt(this.source_,pc,this.handleFeatureAdd_,this),qt(this.source_,yc,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var n=Ki([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),r=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(r=r.filter((function(t){return t.feature.getGeometry().getType()!==An})));var o=!1,s=null,a=null;if(0===r.length)return{snapped:o,vertex:s,vertexPixel:a};i.getView().getProjection();for(var l,u=lr(e),h=1/0,c=0;c<r.length;++c){var p=r[c];Kc[0]=lr(p.segment[0]),Kc[1]=lr(p.segment[1]);var d=Vn(u,Kc);d<h&&(l=p,h=d)}var f=l.segment;if(this.vertex_&&!this.edge_){var y=i.getPixelFromCoordinate(f[0]),g=i.getPixelFromCoordinate(f[1]),m=Wn(t,y),v=Wn(t,g);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(o=!0,s=m>v?f[1]:f[0],a=i.getPixelFromCoordinate(s))}else if(this.edge_){var _=l.feature.getGeometry().getType()===An;if(_){var x=l.feature.getGeometry();null,s=ar(function(t,e){var i=e.getRadius(),n=e.getCenter(),r=n[0],o=n[1],s=t[0]-r,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[r+i*s/l,o+i*a/l]}(u,x))}else Kc[0]=lr(f[0]),Kc[1]=lr(f[1]),s=ar(Gn(u,Kc));if(qn(t,a=i.getPixelFromCoordinate(s))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!_)){y=i.getPixelFromCoordinate(f[0]),g=i.getPixelFromCoordinate(f[1]),m=Wn(a,y),v=Wn(a,g);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(s=m>v?f[1]:f[0],a=i.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=Is(e).getCoordinates()[0],n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,segment:o};this.rBush_.insert(Ki(o),s)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=this.SEGMENT_WRITERS_[i[n].getType()];r&&r(t,i[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,segment:o};this.rBush_.insert(Ki(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Ki(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Ki(c),p)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Ki(l),u)}},e}(Ul);function Zc(t){var e=t||{},i=new oi,n=new Tu(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new ou),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Wl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nu({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Iu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new ju({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new wu),i.push(new Cu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Ou({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new gu({duration:e.zoomDuration})),i}var Hc=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function $c(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new Hc(t,e,i,n)}var Jc=Hc,Qc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),tp=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new Jc(0,0,0,0),i}return Qc(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==vo||i==xo||i==_o&&!n},e.prototype.getTile=function(t,e,i,n){var r=n.pixelRatio,o=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,r,o);return a.getState()==_o&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(vo)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(r),d=p.getZForResolution(o,h.zDirection),f=p.getResolution(d),y=t.extent,g=i.extent&&hr(i.extent);g&&(y=xn(y,hr(i.extent)));var m=h.getTilePixelRatio(l),v=Math.round(t.size[0]*m),_=Math.round(t.size[1]*m);if(a){var x=Math.round(Math.sqrt(v*v+_*_));v=x,_=x}var b=f*v/2/m,w=f*_/2/m,S=[s[0]-b,s[1]-w,s[0]+b,s[1]+w],C=p.getTileRangeForExtentAndZ(y,d),T={};T[d]={};var E=this.createLoadedTileFinder(h,r,T),k=this.tmpExtent,P=this.tmpTileRange_;this.newTiles_=!1;for(var O=C.minX;O<=C.maxX;++O)for(var R=C.minY;R<=C.maxY;++R){var I=this.getTile(d,O,R,t);if(this.isDrawableTile(I)){var F=$t(this);if(I.getState()==vo){T[d][I.tileCoord.toString()]=I;var j=I.inTransition(F);this.newTiles_||!j&&-1!==this.renderedTiles.indexOf(I)||(this.newTiles_=!0)}if(1===I.getAlpha(F,t.time))continue}var M=p.getTileCoordChildTileRange(I.tileCoord,P,k),A=!1;M&&(A=E(d+1,M)),A||p.forEachTileCoordParentTileRange(I.tileCoord,E,P,k)}var L=f/o;vr(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,a,-v/2,-_/2);var z=xr(this.pixelTransform);this.useContainer(e,z,i.opacity);var D=this.context,G=D.canvas;_r(this.inversePixelTransform,this.pixelTransform),vr(this.tempTransform,v/2,_/2,L,L,0,-v/2,-_/2),G.width!=v||G.height!=_?(G.width=v,G.height=_):this.containerReused||D.clearRect(0,0,v,_),g&&this.clipUnrotated(D,t,g),Ct(D,h.getContextOptions()),this.preRender(D,t),this.renderedTiles.length=0;var N,B,W,q=Object.keys(T).map(Number);q.sort(gt),1!==i.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var V=q.length-1;V>=0;--V){var U=q[V],X=h.getTilePixelSize(U,l,r),K=p.getResolution(U)/f,Y=X[0]*K*L,Z=X[1]*K*L,H=p.getTileCoordForCoordAndZ(bn(S),U),$=p.getTileCoordExtent(H),J=gr(this.tempTransform,[m*($[0]-S[0])/f,m*(S[3]-$[3])/f]),Q=m*h.getGutterForProjection(r),tt=T[U];for(var et in tt){var it=(I=tt[et]).tileCoord,nt=H[1]-it[1],rt=Math.round(J[0]-(nt-1)*Y),ot=H[2]-it[2],st=Math.round(J[1]-(ot-1)*Z),at=rt-(O=Math.round(J[0]-nt*Y)),lt=st-(R=Math.round(J[1]-ot*Z)),ut=d===U;if(!(j=ut&&1!==I.getAlpha($t(this),t.time)))if(N){D.save(),W=[O,R,O+at,R,O+at,R+lt,O,R+lt];for(var ht=0,ct=N.length;ht<ct;++ht)if(d!==U&&U<B[ht]){var pt=N[ht];D.beginPath(),D.moveTo(W[0],W[1]),D.lineTo(W[2],W[3]),D.lineTo(W[4],W[5]),D.lineTo(W[6],W[7]),D.moveTo(pt[6],pt[7]),D.lineTo(pt[4],pt[5]),D.lineTo(pt[2],pt[3]),D.lineTo(pt[0],pt[1]),D.clip()}N.push(W),B.push(U)}else D.clearRect(O,R,at,lt);this.drawTileImage(I,t,O,R,at,lt,Q,ut,i.opacity),N&&!j?(D.restore(),this.renderedTiles.unshift(I)):this.renderedTiles.push(I),this.updateUsedTiles(t.usedTiles,h,I)}}return this.renderedRevision=c,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!an(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=r,this.manageTilePyramid(t,h,p,l,r,y,d,u.getPreload()),this.scheduleExpireCache(t,h),this.postRender(D,t),i.extent&&D.restore(),z!==G.style.transform&&(G.style.transform=z),this.container},e.prototype.drawTileImage=function(t,e,i,n,r,o,s,a,l){var u=this.getTileImage(t);if(u){var h=$t(this),c=a?t.getAlpha(h,e.time):1,p=l*c,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,i,n,r,o),d&&this.context.restore(),1!==c?e.animate=!0:a&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var n=$t(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var n=$t(e);n in t||(t[n]={}),t[n][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,n,r,o,s,a,l){var u=$t(e);u in t.wantedTiles||(t.wantedTiles[u]={});var h,c,p,d,f,y,g=t.wantedTiles[u],m=t.tileQueue,v=0;for(y=i.getMinZoom();y<=s;++y)for(c=i.getTileRangeForExtentAndZ(o,y,c),p=i.getResolution(y),d=c.minX;d<=c.maxX;++d)for(f=c.minY;f<=c.maxY;++f)s-y<=a?(++v,(h=e.getTile(y,d,f,n,r)).getState()==go&&(g[h.getKey()]=!0,m.isKeyQueued(h.getKey())||m.enqueue([h,u,i.getTileCoordCenter(h.tileCoord),p])),void 0!==l&&l(h)):e.useTile(y,d,f,r);e.updateCacheSize(v,r)},e}(kh);tp.prototype.getLayer;var ep=tp,ip="image",np="hybrid",rp="vector",op=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),sp={image:[Fh,Ph,Ih,Rh,jh],hybrid:[Fh,Ih],vector:[]},ap={hybrid:[Rh,jh,Oh],vector:[Fh,Ph,Ih,Rh,jh,Oh]},lp=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.renderTileImageQueue_={},i.tileListenerKeys_={},i.tmpTransform_=[1,0,0,1,0,0],i}return op(e,t),e.prototype.prepareTile=function(t,e,i,n){var r,o=$t(t),s=t.getState();return s!==vo&&s!==_o||!(o in this.tileListenerKeys_)||(Ut(this.tileListenerKeys_[o]),delete this.tileListenerKeys_[o]),s!==vo&&s!==_o||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(r=!0,n&&(this.renderTileImageQueue_[o]=t))),r},e.prototype.getTile=function(e,i,n,r){var o=r.pixelRatio,s=r.viewState,a=s.resolution,l=s.projection,u=this.getLayer(),h=u.getSource().getTile(e,i,n,o,l);if(h.getState()<vo){h.wantedResolution=a;var c=$t(h);if(!(c in this.tileListenerKeys_)){var p=qt(h,It,this.prepareTile.bind(this,h,o,l,!0));this.tileListenerKeys_[c]=p}}else{var d=r.viewHints;!!(d[So]||d[Co])&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,l,!1)&&u.getRenderMode()!==rp&&this.renderTileImage_(h,r)}return t.prototype.getTile.call(this,e,i,n,r)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===rp?$t(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var n=this.getLayer(),r=n.getRevision(),o=n.getRenderOrder()||null,s=t.wantedResolution,a=t.getReplayState(n);if(a.dirty||a.renderedResolution!==s||a.renderedRevision!=r||a.renderedRenderOrder!=o){var l=n.getSource(),u=n.getDeclutter(),h=l.getTileGrid(),c=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),p=l.getSourceTiles(e,i,t),d=$t(n);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],u&&(t.declutterExecutorGroups[d]=[]);for(var f=function(i,r){var f=p[i];if(f.getState()!=vo)return"continue";var g=f.tileCoord,m=h.getTileCoordExtent(g),v=xn(c,m),_=Yi(v,n.getRenderBuffer()*s,y.tmpExtent),x=an(m,v)?null:_;a.dirty=!1;var b=new Sh(0,_,s,e),w=u?new Sh(0,v,s,e):void 0,S=tc(s,e),C=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,s)),e){var r=this.renderFeature(t,S,e,b,w);this.dirty_=this.dirty_||r,a.dirty=a.dirty||r}},T=f.getFeatures();o&&o!==a.renderedRenderOrder&&T.sort(o);for(var E=0,k=T.length;E<k;++E){var P=T[E];x&&!Cn(x,P.getGeometry().getExtent())||C.call(y,P)}var O=b.finish(),R=n.getRenderMode()!==rp&&u&&1===p.length?null:v,I=new Kh(R,s,e,l.getOverlaps(),O,n.getRenderBuffer());if(t.executorGroups[d].push(I),w){var F=new Kh(null,s,e,l.getOverlaps(),w.finish(),n.getRenderBuffer());t.declutterExecutorGroups[d].push(F)}},y=this,g=0,m=p.length;g<m;++g)f(g);a.renderedRevision=r,a.renderedRenderOrder=o,a.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){var o=e.viewState.resolution,s=e.viewState.rotation;i=null==i?0:i;var a=this.getLayer(),l=a.getSource().getTileGridForProjection(e.viewState.projection),u=Ki([t]);Yi(u,o*i,u);for(var h,c={},p=function(t,e,i){var o=t.getId();void 0===o&&(o=$t(t));var s=c[o];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return c[o]=!0,r.splice(r.lastIndexOf(s),1),n(t,a,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return c[o]=!0,n(t,a,e);r.push(c[o]={feature:t,layer:a,geometry:e,distanceSq:i,callback:n})}},d=this.renderedTiles,f=function(n,r){var c=d[n];if(!Cn(l.getTileCoordExtent(c.wrappedTileCoord),u))return"continue";var f=$t(a),y=[c.executorGroups[f]],g=c.declutterExecutorGroups[f];g&&y.push(g),y.some((function(n){for(var r=n===g?e.declutterTree.all().map((function(t){return t.value})):null,a=0,l=n.length;a<l;++a){var u=n[a];if(h=u.forEachFeatureAtCoordinate(t,o,s,i,p,r))return!0}}))},y=0,g=d.length;!h&&y<g;++y)f(y);return h},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var n,r=this.getLayer(),o=$t(r),s=r.getSource(),a=this.renderedProjection,l=a.getExtent(),u=this.renderedResolution,h=s.getTileGridForProjection(a),c=gr(this.renderedPixelToCoordinateTransform_,t.slice()),p=h.getTileCoordForCoordAndResolution(c,u),d=0,f=this.renderedTiles.length;d<f;++d)if(p.toString()===this.renderedTiles[d].tileCoord.toString()){if((n=this.renderedTiles[d]).getState()===vo){var y=h.getTileCoordExtent(n.tileCoord);s.getWrapX()&&a.canWrapX()&&!Ji(l,y)&&Un(c,a);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var g=bn(h.getTileCoordExtent(n.wrappedTileCoord)),m=[(c[0]-g[0])/u,(g[1]-c[1])/u],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=n.hitDetectionImageData[o];if(!_&&!this.animatingOrInteracting_){var x=Ds(h.getTileSize(h.getZForResolution(u))),b=this.renderedRotation_;_=Hh(x,[this.getRenderTransform(h.getTileCoordCenter(n.wrappedTileCoord),u,0,.5,.5*x[0],.5*x[1],0)],v,r.getStyleFunction(),h.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(r).renderedResolution,b),n.hitDetectionImageData[o]=_}e($h(m,v,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){Tt(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,r=!(n[So]||n[Co]),o=this.renderedTiles,s=0,a=o.length;s<a;++s){var l=o[s],u=l.declutterExecutorGroups[$t(this.getLayer())];if(u)for(var h=u.length-1;h>=0;--h)u[h].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,r,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,n=e.viewState,r=n.center,o=n.resolution,s=n.rotation,a=e.size,l=Math.round(a[0]*i),u=Math.round(a[1]*i),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),d=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return fr(mr(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(r,o,s,i,l,u,d))},e.prototype.renderFrame=function(e,i){var n=e.viewHints,r=!(n[So]||n[Co]);this.renderQueuedTileImages_(r,e),t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),s=o.getRenderMode(),a=o.getSource(),l=e.usedTiles[$t(a)];for(var u in this.renderTileImageQueue_)l&&u in l||delete this.renderTileImageQueue_[u];var h=this.context,c=h.globalAlpha;h.globalAlpha=o.getOpacity();for(var p=ap[s],d=e.viewState.rotation,f=this.renderedTiles,y=[],g=[],m=f.length-1;m>=0;--m)for(var v=f[m],_=this.getTileRenderTransform(v,e),x=v.executorGroups[$t(o)],b=!1,w=0,S=x.length;w<S;++w){var C=x[w];if(C.hasExecutors(p)){var T=v.tileCoord[0],E=void 0;if(!b&&(E=C.getClipCoords(_))){h.save();for(var k=0,P=y.length;k<P;++k){var O=y[k];T<g[k]&&(h.beginPath(),h.moveTo(E[0],E[1]),h.lineTo(E[2],E[3]),h.lineTo(E[4],E[5]),h.lineTo(E[6],E[7]),h.moveTo(O[6],O[7]),h.lineTo(O[4],O[5]),h.lineTo(O[2],O[3]),h.lineTo(O[0],O[1]),h.clip())}}C.execute(h,1,_,d,r,p),!b&&E&&(h.restore(),y.push(E),g.push(T),b=!0)}}return h.globalAlpha=c,this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var i in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var n=this.renderTileImageQueue_[i];delete this.renderTileImageQueue_[i],this.renderTileImage_(n,e)}},e.prototype.renderFeature=function(t,e,i,n,r){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var s=0,a=i.length;s<a;++s)o=ic(n,t,i[s],e,this.boundHandleStyleImageChange_,void 0,r)||o;else o=ic(n,t,i,e,this.boundHandleStyleImageChange_,void 0,r);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===rp)return!1;var i=t.getReplayState(e),n=e.getRevision(),r=t.wantedResolution;return i.renderedTileResolution!==r||i.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),n=t.getReplayState(i),r=i.getRevision(),o=t.executorGroups[$t(i)];n.renderedTileRevision=r;var s=t.wrappedTileCoord,a=s[0],l=i.getSource(),u=e.pixelRatio,h=e.viewState.projection,c=l.getTileGridForProjection(h),p=c.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*p,f=c.getResolution(a),y=t.getContext(i);u=Math.round(Math.max(u,d/u));var g=l.getTilePixelSize(a,u,h);y.canvas.width=g[0],y.canvas.height=g[1];var m=u/d;if(1!==m){var v=dr(this.tmpTransform_);mr(v,m,m),y.setTransform.apply(y,v)}var _=c.getTileCoordExtent(s,this.tmpExtent),x=d/f,b=dr(this.tmpTransform_);mr(b,x,-x),function(t,e,i){fr(t,yr(pr,1,0,0,1,e,i))}(b,-_[0],-_[3]);for(var w=0,S=o.length;w<S;++w){o[w].execute(y,m,b,0,!0,sp[i.getRenderMode()])}n.renderedTileResolution=t.wantedResolution},e}(ep),up="preload",hp="useInterimTilesOnError",cp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pp=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).on,i.once,i.un,n.renderMode===ip&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||np;return Ie(o==np||o==rp,28),i.renderMode_=o,i.setPreload(n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return cp(e,t),e.prototype.createRenderer=function(){return new lp(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(up)},e.prototype.getUseInterimTilesOnError=function(){return this.get(hp)},e.prototype.setPreload=function(t){this.set(up,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(hp,t)},e}(nh),dp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fp=function(t){function e(e,i,n){var r=t.call(this)||this,o=n||{};return r.tileCoord=e,r.state=i,r.interimTile=null,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return dp(e,t),e.prototype.changed=function(){this.dispatchEvent(It)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==vo)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==vo){t.interimTile=null;break}t.getState()==mo?e=t:t.getState()==go?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==_o&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Zt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:si(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(Rt),yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gp=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.extent=null,a.format_=r,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=n,a.key=n,a}return yp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==go&&(this.setState(mo),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(_o)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(vo)},e.prototype.setLoader=function(t){this.loader_=t},e}(fp),mp=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return Ie(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Ie(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Ie(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function vp(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function _p(t,e,i){return t+"/"+e+"/"+i}function xp(t){return _p(t[0],t[1],t[2])}function bp(t){return t.split("/").map(Number)}var wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wp(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=bp(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(xp(e.tileCoord)),e.release())}.bind(this))}},e}(mp),Cp="tileloadstart",Tp="tileloadend",Ep="tileloaderror",kp=[0,0,0],Pp=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Ie((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||gt,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o<s;++o)if(r){if(this.resolutions_[o]/this.resolutions_[o+1]!==r){r=void 0;break}}else r=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=r,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,Ie(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=bn(a)),Ie(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Ie(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,Ie(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new Jc(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(a){var n=this.getTileRangeForExtentAndZ(a,e);i.minX=Math.max(n.minX,i.minX),i.maxX=Math.min(n.maxX,i.maxX),i.minY=Math.max(n.minY,i.minY),i.maxY=Math.min(n.maxY,i.maxY)}return i}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,i){for(var n=this.getTileRangeForExtentAndZ(t,e),r=n.minX,o=n.maxX;r<=o;++r)for(var s=n.minY,a=n.maxY;s<=a;++s)i([e,r,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,n){var r,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):s=this.getTileCoordExtent(t,n);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?$c(r=Math.floor(r/2),r,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],r=2*t[2];return $c(n,n+1,r,r+1,e)}var o=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],r=t[1],o=t[2];if(e===n)return $c(r,o,r,o,i);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-n),a=Math.floor(r*s),l=Math.floor(o*s);return e<n?$c(a,a,l,l,i):$c(a,Math.floor(s*(r+1))-1,l,Math.floor(s*(o+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),r=this.getResolution(t),o=Ds(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*o[0]*r,a=n[0]+(e.maxX+1)*o[0]*r;return nn(s,n[1]+e.minY*o[1]*r,a,n[1]+(e.maxY+1)*o[1]*r,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=kp;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var r=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),$c(r,n[1],o,n[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Ds(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Ds(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*r[0]*n,s=i[1]-(t[2]+1)*r[1]*n;return nn(o,s,o+r[0]*n,s+r[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,r){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),l=Ds(this.getTileSize(o),this.tmpSize_),u=n?.5:0,h=n?.5:0,c=Math.floor((t-a[0])/i+u),p=Math.floor((a[1]-e)/i+h),d=s*c/l[0],f=s*p/l[1];return n?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),vp(o,d,f,r)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,r){var o=this.getOrigin(i),s=this.getResolution(i),a=Ds(this.getTileSize(i),this.tmpSize_),l=n?.5:0,u=n?.5:0,h=Math.floor((t-o[0])/s+l),c=Math.floor((o[1]-e)/s+u),p=h/a[0],d=c/a[1];return n?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),vp(i,p,d,r)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Fe(mt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i},t}();function Op(t){var e=t.getDefaultTileGrid();return e||(e=Fp(t),t.setDefaultTileGrid(e)),e}function Rp(t){var e=t||{},i=e.extent||Zn("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Ip(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Pp(n)}function Ip(t,e,i,n){for(var r=void 0!==e?e:42,o=_n(t),s=Sn(t),a=Ds(void 0!==i?i:256),l=n>0?n:Math.max(s/a[0],o/a[1]),u=r+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Fp(t,e,i,n){return function(t,e,i,n){var r=void 0!==n?n:Gi,o=Ip(t,e,i);return new Pp({extent:t,origin:mn(t,r),resolutions:o,tileSize:i})}(jp(t),e,i,n)}function jp(t){var e=(t=Zn(t)).getExtent();if(!e){var i=180*mi[vi.DEGREES]/t.getMetersPerUnit();e=nn(-i,-i,i,i)}return e}var Mp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ap=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=e.tileGrid;return n&&Ds(n.getTileSize(n.getMinZoom()),[256,256]),i.tileCache=new Sp(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Mp(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,n){var r=this.getTileCacheForProjection(t);if(!r)return!1;for(var o,s,a,l=!0,u=i.minX;u<=i.maxX;++u)for(var h=i.minY;h<=i.maxY;++h)s=_p(e,u,h),a=!1,r.containsKey(s)&&(a=(o=r.get(s)).getState()===vo)&&(a=!1!==n(o)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,n,r){return Zt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Op(t)},e.prototype.getTileCacheForProjection=function(t){return Ie(tr(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,r,o,s=this.getTileGridForProjection(i),a=this.getTilePixelRatio(e),l=Ds(s.getTileSize(t),this.tmpSize);return 1==a?l:(n=l,r=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=n[0]*r+.5|0,o[1]=n[1]*r+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],r=t.getTileCoordCenter(e),o=jp(i);if($i(o,r))return e;var s=Sn(o),a=Math.ceil((o[0]-r[0])/s);return r[0]+=s*a,t.getTileCoordForCoordAndZ(r,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(n,r)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(cc),Lp=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Mp(e,t),e}(dt),zp=Ap;function Dp(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return Ie(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function Gp(t,e){for(var i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=Dp(t[r],e);return function(t){if(1===t.length)return t[0];return function(e,i,n){if(e){var r=De(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[r](e,i,n)}}}(n)}var Np=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bp=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return Np(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=$t(i),r=i.getState();r==mo?(this.tileLoadingKeys_[n]=!0,e=Cp):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=r==_o?Ep:r==vo?Tp:void 0),null!=e&&this.dispatchEvent(new Lp(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),r=i[2].charCodeAt(0),o=void 0;for(o=n;o<=r;++o)e.push(t.replace(i[0],String.fromCharCode(o)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Gp(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var n=_p(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(zp),Wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qp=[],Vp=function(t){function e(e,i,n,r){var o=t.call(this,e,i,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=r.bind(void 0,o),o.wrappedTileCoord=n,o}return Wp(e,t),e.prototype.getContext=function(t){var e=$t(t);return e in this.context_||(this.context_[e]=pe(1,1,qp)),this.context_[e]},e.prototype.hasContext=function(t){return $t(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=$t(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)qp.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(fp),Up=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xp=function(t){function e(e){var i=this,n=e.projection||"EPSG:3857",r=e.extent||jp(n),o=e.tileGrid||Rp({extent:r,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Kp,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new Sp(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:gp,i.tileGrids_={},i}return Up(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var n=bp(i.peekFirstKey())[0],r=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===n&&i.getState()===vo)for(var o=i.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],u=l.tileCoord;if(Cn(t,r.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var d=h[c],f=d.getGeometry();Cn(t,f.getExtent())&&e.push(d)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var n=this.getTileCacheForProjection(e),r=Object.keys(i).reduce((function(t,e){var i,r,o=_p((r=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],r[1],r[2]);if(n.containsKey(o))for(var s=n.get(o).sourceTiles,a=0,l=s.length;a<l;++a)t[s[a].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(r)},e.prototype.getSourceTiles=function(t,e,i){var n=this;if(i.getState()===go){i.setState(mo);var r=i.wrappedTileCoord,o=this.getTileGridForProjection(e),s=o.getTileCoordExtent(r),a=r[0],l=o.getResolution(a);Yi(s,-l,s);var u=this.tileGrid,h=u.getExtent();h&&xn(s,h,s);var c=u.getZForResolution(l,1);u.forEachTileCoord(s,c,(function(r){var o=n.tileUrlFunction(r,t,e),s=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(r,o?go:xo,o,n.format_,n.tileLoadFunction);i.sourceTiles.push(s);var a=s.getState();if(a<vo){var l=function(t){n.handleTileChange(t);var e=s.getState();if(e===vo||e===_o){var r=s.getKey();r in i.errorTileKeys?s.getState()===vo&&delete i.errorTileKeys[r]:i.loadingSourceTiles--,e===_o?i.errorTileKeys[r]=!0:s.removeEventListener(It,l),0===i.loadingSourceTiles&&i.setState(kt(i.errorTileKeys)?vo:_o)}};s.addEventListener(It,l),i.loadingSourceTiles++}a===go&&(s.extent=u.getTileCoordExtent(r),s.projection=e,s.resolution=u.getResolution(r[0]),n.sourceTileCache.set(o,s),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===_o}))?_o:vo)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,n,r){var o,s=_p(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,r),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(r);if(u&&h){var p=c.getTileCoordExtent(u);Yi(p,-c.getResolution(t),p),Cn(h,p)||(u=null)}var d=!0;if(null!==u){var f=this.tileGrid,y=c.getResolution(t),g=f.getZForResolution(y,1),m=c.getTileCoordExtent(u);Yi(m,-y,m),f.forEachTileCoord(m,g,function(t){d=d&&!this.tileUrlFunction(t,n,r)}.bind(this))}var v=new Vp(l,d?xo:go,u,this.getSourceTiles.bind(this,n,r));return v.key=a,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(s,v)):this.tileCache.set(s,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var n=this.tileGrid;i=Fp(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var n=Ds(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(Bp);function Kp(t,e){t.setLoader((function(i,n,r){xc(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}var Yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zp=function(t){function e(e){return(e=Ct({},e)).controls||(e.controls=Zs()),e.interactions||(e.interactions=Zc({onFocusOnly:!0})),t.call(this,e)||this}return Yp(e,t),e.prototype.createRenderer=function(){return new Jr(this)},e}(Ns),Hp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var $p,Jp=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=r,a.src_=n,a.key=n,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return Hp(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=vo,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=_o,this.unlistenImage_(),this.image_=((t=pe(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=vo:this.state=xo,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==_o&&(this.state=go,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==go&&(this.state=mo,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ba(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(fp),Qp=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=ir(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Sn(n)==Sn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Sn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Sn(this.targetProj_.getExtent()):null;var l=bn(i),u=wn(i),h=yn(i),c=fn(i),p=this.transformInv_(l),d=this.transformInv_(u),f=this.transformInv_(h),y=this.transformInv_(c),g=10+(o?Math.max(0,Math.ceil(Me(dn(i)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,d,f,y,g),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,i){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,i,n,r,o){this.triangles_.push({source:[n,r,o],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,n,r,o,s,a,l){var u=Ki([r,o,s,a]),h=this.sourceWorldWidth_?Sn(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=Sn(Ki([t,e,i,n]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&h&&(d=h>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Cn(u,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var y=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(y),m=void 0;if(p)m=(De(r[0],c)+De(s[0],c))/2-De(g[0],c);else m=(r[0]+s[0])/2-g[0];var v=(r[1]+s[1])/2-g[1];d=m*m+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(_),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,_,b,r,o,x,w,l-1),this.addQuad_(b,_,i,n,w,x,s,a,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(S),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],E=this.transformInv_(T);this.addQuad_(t,S,T,n,r,C,E,a,l-1),this.addQuad_(S,e,i,T,C,o,s,E,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,r,s,a),0==(14&f)&&this.addTriangle_(t,i,e,r,s,o),f&&(0==(13&f)&&this.addTriangle_(e,n,t,o,a,r),0==(7&f)&&this.addTriangle_(e,n,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;un(t,r[0]),un(t,r[1]),un(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),td={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function ed(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function id(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function nd(t,e,i,n){var r=nr(i,e,t),o=Hn(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||$i(l,r)){var u=Hn(t,o,r)/o;isFinite(u)&&u>0&&(o/=u)}return o}function rd(t,e,i,n,r,o,s,a,l,u,h,c){var p=pe(Math.round(i*t),Math.round(i*e));if(Ct(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){ln(f,t.extent)}));var y=Sn(f),g=_n(f),m=pe(Math.round(i*y/n),Math.round(i*g/n));Ct(m,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],r=-(t.extent[3]-f[3]),o=Sn(t.extent),s=_n(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*v,r*v,o*v,s*v)}));var _=bn(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],y=s[1][1],g=s[2][0],v=s[2][1],x=d((a[0][0]-_[0])/o),b=d(-(a[0][1]-_[1])/o),w=d((a[1][0]-_[0])/o),S=d(-(a[1][1]-_[1])/o),C=d((a[2][0]-_[0])/o),T=d(-(a[2][1]-_[1])/o),E=l,k=u;l=0,u=0;var P=function(t){for(var e=t.length,i=0;i<e;i++){for(var n=i,r=Math.abs(t[i][i]),o=i+1;o<e;o++){var s=Math.abs(t[o][i]);s>r&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],h=i;h<e+1;h++)i==h?t[l][h]=0:t[l][h]+=u*t[i][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[h-=E,y-=k,0,0,w-x],[g-=E,v-=k,0,0,C-x],[0,0,h,y,S-b],[0,0,g,v,T-b]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===$p){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",ed(t,4,5,4,0),ed(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;$p=id(e,0)||id(e,4)||id(e,8)}return $p}()||c===td){p.moveTo(w,S);for(var O=x-w,R=b-S,I=0;I<4;I++)p.lineTo(w+d((I+1)*O/4),S+d(I*R/3)),3!=I&&p.lineTo(w+d((I+1)*O/4),S+d((I+1)*R/3));p.lineTo(C,T)}else p.moveTo(w,S),p.lineTo(x,b),p.lineTo(C,T);p.clip(),p.transform(P[0],P[2],P[1],P[3],x,b),p.translate(f[0]-E,f[3]-k),p.scale(n/i,-n/i),p.drawImage(m.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-_[0])/o,s=-(n[0][1]-_[1])/o,a=(n[1][0]-_[0])/o,l=-(n[1][1]-_[1])/o,u=(n[2][0]-_[0])/o,h=-(n[2][1]-_[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(r,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var od=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),sd=function(t){function e(e,i,n,r,o,s,a,l,u,h,c,p){var d=t.call(this,o,go)||this;d.renderEdges_=void 0!==c&&c,d.contextOptions_=p,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=r,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=r.getTileCoordExtent(d.wrappedTileCoord_),y=d.targetTileGrid_.getExtent(),g=d.sourceTileGrid_.getExtent(),m=y?xn(f,y):f;if(0===dn(m))return d.state=xo,d;var v=e.getExtent();v&&(g=g?xn(g,v):v);var _=r.getResolution(d.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=gn(i),o=nd(t,e,r,n);return(!isFinite(o)||o<=0)&&pn(i,(function(i){return o=nd(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,m,_);if(!isFinite(x)||x<=0)return d.state=xo,d;var b=void 0!==h?h:.5;if(d.triangulation_=new Qp(e,n,m,g,x*b,_),0===d.triangulation_.getTriangles().length)return d.state=xo,d;d.sourceZ_=i.getZForResolution(x);var w=d.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(w[1]=Fe(w[1],g[1],g[3]),w[3]=Fe(w[3],g[1],g[3])):w=xn(w,g)),dn(w)){for(var S=i.getTileRangeForExtentAndZ(w,d.sourceZ_),C=S.minX;C<=S.maxX;C++)for(var T=S.minY;T<=S.maxY;T++){var E=u(d.sourceZ_,C,T,a);E&&d.sourceTiles_.push(E)}0===d.sourceTiles_.length&&(d.state=xo)}else d.state=xo;return d}return od(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==vo&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=_o;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=rd(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=vo}this.changed()},e.prototype.load=function(){if(this.state==go){this.state=mo,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==go||r==mo){t++;var o=qt(e,It,(function(i){var n=e.getState();n!=vo&&n!=_o&&n!=xo||(Ut(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==go&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ut),this.sourcesListenerKeys_=null},e}(fp),ad=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ld(t,e){t.getImage().src=e}var ud=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:ld,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Jp,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?td:void 0,i.renderReprojectionEdges_=!1,i}return ad(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!tr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!tr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!tr(e,t)){var i=$t(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Op(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||tr(e,t))return this.tileCache;var i=$t(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Sp(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,u=new this.tileClass(s,void 0!==l?go:xo,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(It,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!tr(o,r)){var s=this.getTileCacheForProjection(r),a=[t,e,i],l=void 0,u=xp(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(r),d=this.getTileCoordForTileUrlFunction(a,r),f=new sd(o,c,r,p,a,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=h,l?(f.interimTile=l,f.refreshInterimChain(),s.replace(u,f)):s.set(u,f),f}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=_p(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==go?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Zn(t);if(i){var n=$t(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Bp),hd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cd=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);return delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).on,i.once,i.un,i.setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return hd(e,t),e.prototype.getPreload=function(){return this.get(up)},e.prototype.setPreload=function(t){this.set(up,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(hp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(hp,t)},e}($e),pd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dd=function(t){function e(e){return t.call(this,e)||this}return pd(e,t),e.prototype.createRenderer=function(){return new ep(this)},e}(cd),fd={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},yd=/(italic|oblique)$/i,gd={},md={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},vd="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _d(t){var e={exports:{}};return t(e,e.exports),e.exports}function xd(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
|
31
31
|
/*! https://mths.be/punycode v1.3.2 by @mathias */
|
32
|
-
_d((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof vd&&vd;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=36,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,y=String.fromCharCode;function g(t){throw RangeError(d[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=u)t=f(t/35);return f(n+36*t/(t+38))}function S(t){var e,i,n,r,o,s,a,h,c,p,d,y=[],m=t.length,v=0,_=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),y.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,s=1,a=u;r>=m&&g("invalid-input"),((h=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>f((l-v)/s))&&g("overflow"),v+=h*s,!(h<(c=a<=b?1:a>=b+26?26:a-b));a+=u)s>f(l/(p=u-c))&&g("overflow"),s*=p;b=w(v-o,e=y.length+1,0==o),f(v/e)>l-_&&g("overflow"),_+=f(v/e),v%=e,y.splice(v++,0,_)}return x(y)}function C(t){var e,i,n,r,o,s,a,h,c,p,d,m,v,x,S,C=[];for(m=(t=_(t)).length,e=128,i=0,o=72,s=0;s<m;++s)(d=t[s])<128&&C.push(y(d));for(n=r=C.length,r&&C.push("-");n<m;){for(a=l,s=0;s<m;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(v=n+1))&&g("overflow"),i+=(a-e)*v,e=a,s=0;s<m;++s)if((d=t[s])<e&&++i>l&&g("overflow"),d==e){for(h=i,c=u;!(h<(p=c<=o?1:c>=o+26?26:c-o));c+=u)S=h-p,x=u-p,C.push(y(b(p+S%x,0))),h=f(S/x);C.push(y(b(h,0))),o=w(i,v,n==r),i=0,++n}++i,++e}return C.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:x},decode:S,encode:C,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return v(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(vd)}));var bd=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),xd(r,c)?Array.isArray(r[c])?r[c].push(p):r[c]=[r[c],p]:r[c]=p}return r},wd=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Sd=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(wd(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(wd(t))})).join(e):r+encodeURIComponent(wd(t[n]))})).join(e):n?encodeURIComponent(wd(n))+i+encodeURIComponent(wd(t)):""};_d((function(t,e){e.decode=e.parse=bd,e.encode=e.stringify=Sd}));class Cd extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Td{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,n]of e)this.bindings[i]=n}concat(t){return new Td(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Ed={kind:"null"},kd={kind:"number"},Pd={kind:"string"},Od={kind:"boolean"},Rd={kind:"color"},Id={kind:"object"},Fd={kind:"value"},jd={kind:"collator"},Md={kind:"formatted"},Ad={kind:"resolvedImage"};function Ld(t,e){return{kind:"array",itemType:t,N:e}}function zd(t){if("array"===t.kind){const e=zd(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Dd=[Ed,kd,Pd,Od,Rd,Md,Id,Ld(Fd),Ad];function Gd(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Gd(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(const t of Dd)if(!Gd(t,e))return null}return`Expected ${zd(t)} but found ${zd(e)} instead.`}function Nd(t,e){return e.some((e=>e.kind===t.kind))}function Bd(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var Wd=_d((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function s(t){return"%"===t[t.length-1]?r(parseFloat(t)/100):r(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[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 l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var h=r.substr(0,l),c=r.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),y=s(c[2]),g=y<=.5?y*(f+1):y+f-y*f,m=2*y-g;return[n(255*a(m,g,d+1/3)),n(255*a(m,g,d)),n(255*a(m,g,d-1/3)),p];default:return null}}return null}}catch(l){}}));class qd{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof qd)return t;if("string"!=typeof t)return;const e=Wd.parseCSSColor(t);return e?new qd(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}qd.black=new qd(0,0,0,1),qd.white=new qd(1,1,1,1),qd.transparent=new qd(0,0,0,0),qd.red=new qd(1,0,0,1),qd.blue=new qd(0,0,1,1);class Vd{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ud{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Xd{constructor(t){this.sections=t}static fromString(t){return new Xd([new Ud(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Xd?t:Xd.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Kd{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Kd({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Yd(t,e,i,n){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`}function Zd(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 qd)return!0;if(t instanceof Vd)return!0;if(t instanceof Xd)return!0;if(t instanceof Kd)return!0;if(Array.isArray(t)){for(const e of t)if(!Zd(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Zd(t[e]))return!1;return!0}return!1}function Hd(t){if(null===t)return Ed;if("string"==typeof t)return Pd;if("boolean"==typeof t)return Od;if("number"==typeof t)return kd;if(t instanceof qd)return Rd;if(t instanceof Vd)return jd;if(t instanceof Xd)return Md;if(t instanceof Kd)return Ad;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const t=Hd(n);if(i){if(i===t)continue;i=Fd;break}i=t}return Ld(i||Fd,e)}return Id}function $d(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof qd||t instanceof Xd||t instanceof Kd?t.toString():JSON.stringify(t)}class Jd{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Zd(t[1]))return e.error("invalid value");const i=t[1];let n=Hd(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Jd(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof qd?["rgba"].concat(this.value.toArray()):this.value instanceof Xd?this.value.serialize():this.value}}class Qd{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const tf={string:Pd,number:kd,boolean:Od,object:Id};class ef{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in tf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=tf[i],n++}else r=Fd;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++}i=Ld(r,o)}else i=tf[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Fd);if(!i)return null;o.push(i)}return new ef(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!Gd(this.type,Hd(i)))return i;if(e===this.args.length-1)throw new Qd(`Expected value to be of type ${zd(this.type)}, but found ${zd(Hd(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class nf{constructor(t){this.type=Md,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(r&&"object"==typeof i&&!Array.isArray(i)){r=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,kd),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,Ld(Pd)),!o))return null;let s=null;if(i["text-color"]&&(s=e.parse(i["text-color"],1,Rd),!s))return null;const a=n[n.length-1];a.scale=t,a.font=o,a.textColor=s}else{const i=e.parse(t[o],1,Fd);if(!i)return null;const s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new nf(n)}evaluate(t){return new Xd(this.sections.map((e=>{const i=e.content.evaluate(t);return Hd(i)===Ad?new Ud("",i,null,null,null):new Ud($d(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class rf{constructor(t){this.type=Ad,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Pd);return i?new rf(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Kd.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const of={"to-boolean":Od,"to-color":Rd,"to-number":kd,"to-string":Pd};class sf{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=of[i],r=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Fd);if(!i)return null;r.push(i)}return new sf(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof qd)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Yd(e[0],e[1],e[2],e[3]),!i))return new qd(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Qd(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new Qd(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Xd.fromString($d(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Kd.fromString($d(this.args[0].evaluate(t))):$d(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new nf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new rf(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const af=["Unknown","Point","LineString","Polygon"];class lf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?af[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=qd.parse(t)),e}}class uf{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=uf.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[l,u]of s){a=new Ff(e.registry,e.path,null,e.scope);const n=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(l)?l[e-1]:l.type,s=a.parse(i,1+n.length,r);if(!s){o=!0;break}n.push(s)}if(!o)if(Array.isArray(l)&&l.length!==n.length)a.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new uf(i,r,u,n)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(zd).join(", ")})`:`(${zd(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(zd(i.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){uf.definitions=e;for(const i in e)t[i]=uf}}class hf{constructor(t,e,i){this.type=jd,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Od);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Od);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Pd),!o)?null:new hf(n,r,o)}evaluate(t){return new Vd(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function cf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function pf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function df(t,e){const i=(180+t[0])/360;const n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function ff(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function yf(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(ff(t,a[e],a[e+1]))return!1;n=t,r=a[e],o=a[e+1],r[1]>n[1]!=o[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function gf(t,e){for(let i=0;i<e.length;i++)if(yf(t,e[i]))return!0;return!1}function mf(t,e,i,n){const r=t[0]-i[0],o=t[1]-i[1],s=e[0]-i[0],a=e[1]-i[1],l=n[0]-i[0],u=n[1]-i[1],h=r*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function vf(t,e,i,n){const r=[e[0]-t[0],e[1]-t[1]],o=[n[0]-i[0],n[1]-i[1]];return 0!=(s=o)[0]*(a=r)[1]-s[1]*a[0]&&!(!mf(t,e,i,n)||!mf(i,n,t,e));var s,a}function _f(t,e,i){for(const n of i)for(let i=0;i<n.length-1;++i)if(vf(t,e,n[i],n[i+1]))return!0;return!1}function xf(t,e){for(let i=0;i<t.length;++i)if(!yf(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(_f(t[i],t[i+1],e))return!1;return!0}function bf(t,e){for(let i=0;i<e.length;i++)if(xf(t,e[i]))return!0;return!1}function wf(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=df(t[r][n],i);cf(e,s),o.push(s)}n.push(o)}return n}function Sf(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=wf(t[r],e,i);n.push(o)}return n}function Cf(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}cf(e,t)}function Tf(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const a of t)for(const t of a){const n=[t.x+o[0],t.y+o[1]];Cf(n,e,i,r),s.push(n)}return s}function Ef(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const l of t){const t=[];for(const i of l){const n=[i.x+o[0],i.y+o[1]];cf(e,n),t.push(n)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)Cf(n,e,i,r)}var a;return s}class kf{constructor(t,e){this.type=Od,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zd(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new kf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new kf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new kf(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=wf(e.coordinates,n,r),s=Tf(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!yf(t,o))return!1}if("MultiPolygon"===e.type){const o=Sf(e.coordinates,n,r),s=Tf(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!gf(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=wf(e.coordinates,n,r),s=Ef(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!xf(t,o))return!1}if("MultiPolygon"===e.type){const o=Sf(e.coordinates,n,r),s=Ef(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!bf(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Pf(t){if(t instanceof uf){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof kf)return!1;let e=!0;return t.eachChild((t=>{e&&!Pf(t)&&(e=!1)})),e}function Of(t){if(t instanceof uf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Of(t)&&(e=!1)})),e}function Rf(t,e){if(t instanceof uf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Rf(t,e)&&(i=!1)})),i}class If{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new If(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Ff{constructor(t,e=[],i,n=new Td,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new ef(e,[t]):"coerce"===i?new sf(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", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof Jd)&&"resolvedImage"!==r.type.kind&&jf(r)){const t=new lf;try{r=new Jd(r.type,r.evaluate(t))}catch(n){return this.error(n.message),null}}return r}return this.error(`Unknown expression "${r}". 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.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Ff(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Cd(i,t))}checkSubtype(t,e){const i=Gd(t,e);return i&&this.error(i),i}}function jf(t){if(t instanceof If)return jf(t.boundExpression);if(t instanceof uf&&"error"===t.name)return!1;if(t instanceof hf)return!1;if(t instanceof kf)return!1;const e=t instanceof sf||t instanceof ef;let i=!0;return t.eachChild((t=>{i=e?i&&jf(t):i&&t instanceof Jd})),!!i&&(Pf(t)&&Rf(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function Mf(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new Qd("Input is not a number.");s=a-1}return 0}class Af{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,r]of i)this.labels.push(n),this.outputs.push(r)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,kd);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],s=t[o+1],a=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([i,u])}return new Af(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);return i[Mf(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Lf=zf;function zf(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}function Df(t,e,i){return t*(1-i)+e*i}zf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},zf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},zf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},zf.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},zf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Gf=Object.freeze({__proto__:null,number:Df,color:function(t,e,i){return new qd(Df(t.r,e.r,i),Df(t.g,e.g,i),Df(t.b,e.b,i),Df(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>Df(t,e[n],i)))}});const Nf=4/29,Bf=6/29,Wf=3*Bf*Bf,qf=Math.PI/180,Vf=180/Math.PI;function Uf(t){return t>.008856451679035631?Math.pow(t,1/3):t/Wf+Nf}function Xf(t){return t>Bf?t*t*t:Wf*(t-Nf)}function Kf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Yf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zf(t){const e=Yf(t.r),i=Yf(t.g),n=Yf(t.b),r=Uf((.4124564*e+.3575761*i+.1804375*n)/.95047),o=Uf((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Uf((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function Hf(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xf(e),i=.95047*Xf(i),n=1.08883*Xf(n),new qd(Kf(3.2404542*i-1.5371385*e-.4985314*n),Kf(-.969266*i+1.8760108*e+.041556*n),Kf(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function $f(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Jf={forward:Zf,reverse:Hf,interpolate:function(t,e,i){return{l:Df(t.l,e.l,i),a:Df(t.a,e.a,i),b:Df(t.b,e.b,i),alpha:Df(t.alpha,e.alpha,i)}}},Qf={forward:function(t){const{l:e,a:i,b:n}=Zf(t),r=Math.atan2(n,i)*Vf;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*qf,i=t.c;return Hf({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:$f(t.h,e.h,i),c:Df(t.c,e.c,i),l:Df(t.l,e.l,i),alpha:Df(t.alpha,e.alpha,i)}}};class ty{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[o,s]of r)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=ey(e,t.base,i,n);else if("linear"===t.name)r=ey(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new Lf(o[0],o[1],o[2],o[3]).solve(ey(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}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(r=e.parse(r,2,kd),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Rd:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],n=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(i,r,a);if(!u)return null;a=a||u.type,s.push([t,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ty(a,i,n,r,s):e.error(`Type ${zd(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Mf(e,n),s=e[o],a=e[o+1],l=ty.interpolationFactor(this.interpolation,n,s,a),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?Gf[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?Qf.reverse(Qf.interpolate(Qf.forward(u),Qf.forward(h),l)):Jf.reverse(Jf.interpolate(Jf.forward(u),Jf.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function ey(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class iy{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const s of t.slice(1)){const t=e.parse(s,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>Gd(n,t.type)));return new iy(o?Fd:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof Kd&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class ny{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new ny(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class ry{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,kd),n=e.parse(t[2],2,Ld(e.expectedType||Fd));if(!i||!n)return null;const r=n.type;return new ry(r.itemType,i,n)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Qd(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new Qd(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new Qd(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class oy{constructor(t,e){this.type=Od,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,Fd);return i&&n?Nd(i.type,[Od,Pd,kd,Ed,Fd])?new oy(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${zd(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Bd(e,["boolean","string","number","null"]))throw new Qd(`Expected first argument to be of type boolean, string, number or null, but found ${zd(Hd(e))} instead.`);if(!Bd(i,["string","array"]))throw new Qd(`Expected second argument to be of type array or string, but found ${zd(Hd(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class sy{constructor(t,e,i){this.type=kd,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,Fd);if(!i||!n)return null;if(!Nd(i.type,[Od,Pd,kd,Ed,Fd]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${zd(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,kd);return r?new sy(i,n,r):null}return new sy(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Bd(e,["boolean","string","number","null"]))throw new Qd(`Expected first argument to be of type boolean, string, number or null, but found ${zd(Hd(e))} instead.`);if(!Bd(i,["string","array"]))throw new Qd(`Expected second argument to be of type array or string, but found ${zd(Hd(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ay{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let l=2;l<t.length-1;l+=2){let s=t[l];const a=t[l+1];Array.isArray(s)||(s=[s]);const u=e.concat(l);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Hd(t)))return null}else i=Hd(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const h=e.parse(a,l,n);if(!h)return null;n=n||h.type,o.push(h)}const s=e.parse(t[1],1,Fd);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new ay(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(Hd(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const o of e){const t=n[this.cases[o]];void 0===t?(n[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[t][1].push(o)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[o,s]of i)1===s.length?t.push(r(s[0])):t.push(s.map(r)),t.push(this.outputs[o].serialize());return t.push(this.otherwise.serialize()),t}}class ly{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(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.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let o=1;o<t.length-1;o+=2){const r=e.parse(t[o],o,Od);if(!r)return null;const s=e.parse(t[o+1],o+1,i);if(!s)return null;n.push([r,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new ly(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class uy{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,kd);if(!i||!n)return null;if(!Nd(i.type,[Ld(Fd),Pd,Fd]))return e.error(`Expected first argument to be of type array or string, but found ${zd(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,kd);return r?new uy(i.type,i,n,r):null}return new uy(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Bd(e,["string","array"]))throw new Qd(`Expected first argument to be of type array or string, but found ${zd(Hd(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function hy(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function cy(t,e,i,n){return 0===n.compare(e,i)}function py(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Od,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Fd);if(!o)return null;if(!hy(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${zd(o.type)}'.`);let s=e.parse(t[2],2,Fd);if(!s)return null;if(!hy(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${zd(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${zd(o.type)}' and '${zd(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new ef(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new ef(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,jd),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=Hd(o),i=Hd(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Qd(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Hd(o),i=Hd(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const dy=py("==",(function(t,e,i){return e===i}),cy),fy=py("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!cy(0,e,i,n)})),yy=py("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),gy=py(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),my=py("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),vy=py(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class _y{constructor(t,e,i,n,r){this.type=Pd,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,kd);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Pd),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Pd),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,kd),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,kd),!a)?null:new _y(i,r,o,s,a)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class xy{constructor(t){this.type=kd,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${zd(i.type)} instead.`):new xy(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Qd(`Expected value to be of type string or array, but found ${zd(Hd(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const by={"==":dy,"!=":fy,">":gy,"<":yy,">=":vy,"<=":my,array:ef,at:ry,boolean:ef,case:ly,coalesce:iy,collator:hf,format:nf,image:rf,in:oy,"index-of":sy,interpolate:ty,"interpolate-hcl":ty,"interpolate-lab":ty,length:xy,let:ny,literal:Jd,match:ay,number:ef,"number-format":_y,object:ef,slice:uy,step:Af,string:ef,"to-boolean":sf,"to-color":sf,"to-number":sf,"to-string":sf,var:If,within:kf};function wy(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=Yd(e,i,n,o);if(s)throw new Qd(s);return new qd(e/255*o,i/255*o,n/255*o,o)}function Sy(t,e){return t in e}function Cy(t,e){const i=e[t];return void 0===i?null:i}function Ty(t){return{type:t}}function Ey(t){return{result:"success",value:t}}function ky(t){return{result:"error",value:t}}function Py(t){return!!t.expression&&t.expression.interpolated}function Oy(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}uf.register(by,{error:[{kind:"error"},[Pd],(t,[e])=>{throw new Qd(e.evaluate(t))}],typeof:[Pd,[Fd],(t,[e])=>zd(Hd(e.evaluate(t)))],"to-rgba":[Ld(kd,4),[Rd],(t,[e])=>e.evaluate(t).toArray()],rgb:[Rd,[kd,kd,kd],wy],rgba:[Rd,[kd,kd,kd,kd],wy],has:{type:Od,overloads:[[[Pd],(t,[e])=>Sy(e.evaluate(t),t.properties())],[[Pd,Id],(t,[e,i])=>Sy(e.evaluate(t),i.evaluate(t))]]},get:{type:Fd,overloads:[[[Pd],(t,[e])=>Cy(e.evaluate(t),t.properties())],[[Pd,Id],(t,[e,i])=>Cy(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Fd,[Pd],(t,[e])=>Cy(e.evaluate(t),t.featureState||{})],properties:[Id,[],t=>t.properties()],"geometry-type":[Pd,[],t=>t.geometryType()],id:[Fd,[],t=>t.id()],zoom:[kd,[],t=>t.globals.zoom],"heatmap-density":[kd,[],t=>t.globals.heatmapDensity||0],"line-progress":[kd,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[kd,[],t=>t.globals.skyRadialProgress||0],accumulated:[Fd,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[kd,Ty(kd),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[kd,Ty(kd),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:kd,overloads:[[[kd,kd],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[kd],(t,[e])=>-e.evaluate(t)]]},"/":[kd,[kd,kd],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[kd,[kd,kd],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[kd,[],()=>Math.LN2],pi:[kd,[],()=>Math.PI],e:[kd,[],()=>Math.E],"^":[kd,[kd,kd],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[kd,[kd],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))],log2:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[kd,[kd],(t,[e])=>Math.sin(e.evaluate(t))],cos:[kd,[kd],(t,[e])=>Math.cos(e.evaluate(t))],tan:[kd,[kd],(t,[e])=>Math.tan(e.evaluate(t))],asin:[kd,[kd],(t,[e])=>Math.asin(e.evaluate(t))],acos:[kd,[kd],(t,[e])=>Math.acos(e.evaluate(t))],atan:[kd,[kd],(t,[e])=>Math.atan(e.evaluate(t))],min:[kd,Ty(kd),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[kd,Ty(kd),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[kd,[kd],(t,[e])=>Math.abs(e.evaluate(t))],round:[kd,[kd],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[kd,[kd],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[kd,[kd],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Od,[Pd,Fd],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Od,[Fd],(t,[e])=>t.id()===e.value],"filter-type-==":[Od,[Pd],(t,[e])=>t.geometryType()===e.value],"filter-<":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Od,[Fd],(t,[e])=>e.value in t.properties()],"filter-has-id":[Od,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Od,[Ld(Pd)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Od,[Ld(Fd)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Od,[Pd,Ld(Fd)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Od,[Pd,Ld(Fd)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Od,overloads:[[[Od,Od],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ty(Od),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Od,overloads:[[[Od,Od],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ty(Od),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Od,[Od],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Od,[Pd],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Pd,[Pd],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Pd,[Pd],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Pd,Ty(Fd),(t,e)=>e.map((e=>$d(e.evaluate(t)))).join("")],"resolved-locale":[Pd,[jd],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Ry{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new lf,this._defaultValue=e?"color"===(i=e).type&&Oy(i.default)?new qd(0,0,0,0):"color"===i.type?qd.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Qd(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}}}function Iy(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in by}function Fy(t,e){const i=new Ff(by,[],e?function(t){const e={color:Rd,string:Pd,number:kd,enum:Pd,boolean:Od,formatted:Md,resolvedImage:Ad};if("array"===t.type)return Ld(e[t.value]||Fd,t.length);return e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ey(new Ry(n,e)):ky(i.errors)}class jy{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Of(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class My{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Of(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?ty.interpolationFactor(this.interpolationType,t,e,i):0}}function Ay(t,e){if("error"===(t=Fy(t,e)).result)return t;const i=t.value.expression,n=Pf(i);if(!n&&("data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"]))return ky([new Cd("","data expressions not supported")]);var r;const o=Rf(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ky([new Cd("","zoom expressions not supported")]);const s=Ly(i);if(!s&&!o)return ky([new Cd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Cd)return ky([s]);if(s instanceof ty&&!Py(e))return ky([new Cd("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Ey(new jy(n?"constant":"source",t.value));const a=s instanceof ty?s.interpolation:void 0;return Ey(new My(n?"camera":"composite",t.value,s.labels,a))}function Ly(t){let e=null;if(t instanceof ny)e=Ly(t.result);else if(t instanceof iy){for(const i of t.args)if(e=Ly(i),e)break}else(t instanceof Af||t instanceof ty)&&t.input instanceof uf&&"zoom"===t.input.name&&(e=t);return e instanceof Cd||t.eachChild((t=>{const i=Ly(t);i instanceof Cd?e=i:!e&&i?e=new Cd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Cd("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function zy(t){return"object"==typeof t?["literal",t]:t}function Dy(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Gy(t,e){const i=zy((n=t.default,r=e.default,void 0!==n?n:void 0!==r?r:void 0));var n,r;return void 0===i&&"resolvedImage"===e.type?"":i}function Ny(t,e,i){const n=qy(t,e),r=["get",t.property];if("categorical"===n&&"boolean"==typeof i[0][0]){const n=["case"];for(const t of i)n.push(["==",r,t[0]],t[1]);return n.push(Gy(t,e)),n}if("categorical"===n){const n=["match",r];for(const t of i)Wy(n,t[0],t[1],!1);return n.push(Gy(t,e)),n}if("interval"===n){const e=["step",["number",r]];for(const t of i)Wy(e,t[0],t[1],!0);return By(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,zy(t.default)]}if("exponential"===n){const e=void 0!==t.base?t.base:1,n=[Dy(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of i)Wy(n,t[0],t[1],!1);return void 0===t.default?n:["case",["==",["typeof",r],"number"],n,zy(t.default)]}throw new Error(`Unknown property function type ${n}`)}function By(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function Wy(t,e,i,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(i))}function qy(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Vy(t){const e=["concat"],i=/{([^{}]+)}/g;let n=0;for(let r=i.exec(t);null!==r;r=i.exec(t)){const o=t.slice(n,i.lastIndex-r[0].length);n=i.lastIndex,o.length>0&&e.push(o),e.push(["get",r[1]])}if(1===e.length)return t;if(n<t.length)e.push(t.slice(n));else if(2===e.length)return["to-string",e[1]];return e}function Uy(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Uy(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const Xy={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ky(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Uy(t)||(t=Hy(t));const e=Fy(t,Xy);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:Zy(t)}}function Yy(t,e){return t<e?-1:t>e?1:0}function Zy(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(Zy(t[e]))return!0;return!1}function Hy(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?$y(t[1],t[2],"=="):"!="===e?tg($y(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?$y(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Hy))):"all"===e?["all"].concat(t.slice(1).map(Hy)):"none"===e?["all"].concat(t.slice(1).map(Hy).map(tg)):"in"===e?Jy(t[1],t.slice(2)):"!in"===e?tg(Jy(t[1],t.slice(2))):"has"===e?Qy(t[1]):"!has"===e?tg(Qy(t[1])):"within"!==e||t}function $y(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Jy(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((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Yy)]]:["filter-in-small",t,["literal",e]]}}function Qy(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function tg(t){return["!",t]}var eg=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ig(t,e){const i={};for(const n in t)"ref"!==n&&(i[n]=t[n]);return eg.forEach((t=>{t in e&&(i[t]=e[t])})),i}_d((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(a+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:y,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),n.push(p.yytext),r.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,s=p.yytext,a=p.yylineno,y=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=n[n.length-S],E._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[s,l,a,d.yy,x[1],n,r].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),n=n.slice(0,-1*S),r=r.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),n.push(E.$),r.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;o<r.length;o++)if((i=this._input.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const ng=Iy,rg=Ay,og=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const n=["color"===e.type?"to-color":e.type,i,zy(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}}(t,e);const n=i&&"object"==typeof i[0][0],r=n||void 0!==t.property,o=n||!r;return i=i.map((t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],Vy(t[1])]:[t[0],zy(t[1])])),n?function(t,e,i){const n={},r={},o=[];for(let s=0;s<i.length;s++){const e=i[s],a=e[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],o.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===qy({},e)){const i=[Dy(t),["linear"],["zoom"]];for(const t of o){Wy(i,t,Ny(n[t],e,r[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of o){Wy(t,i,Ny(n[i],e,r[i]),!0)}return By(t),t}}(t,e,i):o?function(t,e,i,n=["zoom"]){const r=qy(t,e);let o,s=!1;if("interval"===r)o=["step",n],s=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;o=[Dy(t),1===e?["linear"]:["exponential",e],n]}}for(const a of i)Wy(o,a[0],a[1],s);return By(o),o}(t,e,i):Ny(t,e,i)},sg=Oy;function ag(t){return t*Math.PI/180}var lg=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ug(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var hg,cg=Array(256).join(" ");function pg(t,e){if(e>=.05){for(var i="",n=t.split("\n"),r=cg.slice(0,Math.round(e/.1)),o=0,s=n.length;o<s;++o)o>0&&(i+="\n"),i+=n[o].split("").join(r);return i}return t}function dg(){return hg||(hg=ug(1,1).getContext("2d")),hg}function fg(t,e){return dg().measureText(t).width+(t.length-1)*e}var yg={};function gg(t,e,i,n){if(-1!==t.indexOf("\n")){for(var r=t.split("\n"),o=[],s=0,a=r.length;s<a;++s)o.push(gg(r[s],e,i,n));return o.join("\n")}var l=i+","+e+","+t+","+n,u=yg[l];if(!u){var h=t.split(" ");if(h.length>1){var c=dg();c.font=e;var p=c.measureText("M").width*i,d="";for(o=[],s=0,a=h.length;s<a;++s){var f=h[s],y=d+(d?" ":"")+f;fg(y,n)<=p?d=y:(d&&o.push(d),d=f)}d&&o.push(d);for(s=0,a=o.length;s<a&&a>1;++s){var g=o[s];if(fg(g,n)<.35*p){var m=s>0?fg(o[s-1],n):1/0,v=s<a-1?fg(o[s+1],n):1/0;o.splice(s,1),a-=1,m<v?(o[s-1]+=" "+g,s-=1):o[s]=g+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var _=o[s],x=o[s+1];if(fg(_,n)>.7*p&&fg(x,n)<.6*p){var b=_.split(" "),w=b.pop();fg(w,n)<.2*p&&(o[s]=b.join(" "),o[s+1]=w+" "+x),a-=1}}u=o.join("\n")}else u=t;u=pg(u,n),yg[l]=u}return u}Nr&&qt(Nr,jt,(function(){yg={}}));var mg,vg,_g=sg,xg=og,bg=ng,wg=rg,Sg={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Cg={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},Tg={},Eg={zoom:0},kg={};function Pg(t,e,i,n,r){var o=t.id;kg[o]||(kg[o]={});var s=kg[o];if(!s[i]){var a=(t[e]||Tg)[i],l=md[e+"_"+t.type][i];void 0===a&&(a=l.default);var u=bg(a);if(!u&&_g(a)&&(a=xg(a,l),u=!0),u){var h=function(t,e){var i=wg(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,l);s[i]=h.evaluate.bind(h)}else"color"==l.type&&(a=qd.parse(a)),s[i]=function(){return a}}return Eg.zoom=n,s[i](Eg,r)}var Og={};function Rg(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Ig=/^([^]*)\{(.*)\}([^]*)$/;function Fg(t,e){var i;do{if(i=t.match(Ig)){var n=e[i[2]]||"";t=i[1]+n+i[3]}}while(i);return t}function jg(t,e,i,n,r,o,s){if(void 0===n&&(n=lg),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,l=[a.width,a.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=ig(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],y=0,g=p.length;y<g;++y){var m=p[y],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=[],d[_]=w),w.push({layer:m,index:y}),f.push(v)}delete kg[v],delete Og[v]}var S=new Ka,C=new Ea,T={},E={},k=[],P=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=n.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,n=e.length;i<n;++i)if(e[i]<t&&i+1<n){var r=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(r)}return n-1}(e,n));for(var h=Sg[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(n,d){var f=o[n],y=f.layer,g=y.id,m=y.layout||Tg,v=y.paint||Tg;if("none"===m.visibility||"minzoom"in y&&u<y.minzoom||"maxzoom"in y&&u>=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,i,n){return t in Og||(Og[t]=Ky(e).filter),Eg.zoom=n,Og[t](Eg,i)}(g,_,c,u)){var x=void 0,b=void 0,w=void 0,P=void 0,O=void 0,R=void 0,I=f.index;if(3==h&&("fill"==y.type||"fill-extrusion"==y.type))if(b=Pg(y,"paint",y.type+"-opacity",u,c),y.type+"-pattern"in v){var F=Pg(y,"paint",y.type+"-pattern",u,c);if(F){var j="string"==typeof F?Fg(F,i):F.toString();if(a&&r&&r[j]){++p,(R=k[p])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new rl({fill:new Ea}),k[p]=R),w=R.getFill(),R.setZIndex(I);var M=E[lt=j+"."+b];if(!M)(ct=(ht=ug((ut=r[j]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),M=ct.createPattern(ht,"repeat"),E[lt]=M;w.setColor(M)}}}else(x=Rg(Pg(y,"paint",y.type+"-color",u,c),b))&&(y.type+"-outline-color"in v&&(O=Rg(Pg(y,"paint",y.type+"-outline-color",u,c),b)),O||(O=x),++p,(R=k[p])&&R.getFill()&&R.getStroke()&&!R.getText()||(R=new rl({fill:new Ea,stroke:new Ka}),k[p]=R),(w=R.getFill()).setColor(x),(P=R.getStroke()).setColor(O),P.setWidth(1),R.setZIndex(I));if(1!=h&&"line"==y.type){x=!("line-pattern"in v)&&"line-color"in v?Rg(Pg(y,"paint","line-color",u,c),Pg(y,"paint","line-opacity",u,c)):void 0;var A=Pg(y,"paint","line-width",u,c);x&&A>0&&(++p,(R=k[p])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new rl({stroke:new Ka}),k[p]=R),(P=R.getStroke()).setLineCap(Pg(y,"layout","line-cap",u,c)),P.setLineJoin(Pg(y,"layout","line-join",u,c)),P.setMiterLimit(Pg(y,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(A),P.setLineDash(v["line-dasharray"]?Pg(y,"paint","line-dasharray",u,c).map((function(t){return t*A})):null),R.setZIndex(I))}var L=!1,z=null,D=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var W=Pg(y,"layout","icon-image",u,c);if(W){G="string"==typeof W?Fg(W,i):W.toString();var q=void 0;if(a&&r&&r[G]){var V=Pg(y,"layout","icon-rotation-alignment",u,c);if(2==h){var U=t.getGeometry();if(U.getFlatMidpoint||U.getFlatMidpoints){var X=U.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===U.getType()?U.getFlatMidpoints():U.getFlatMidpoint();if(vg||(vg=new Rl("Point",mg=[NaN,NaN],[],{},null)),q=vg,mg[0]=K[0],mg[1]=K[1],"line"===(It=Pg(y,"layout","symbol-placement",u,c))&&"map"===V)for(var Y=U.getStride(),Z=U.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),nt=Math.min(Q,et),rt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=rt&&K[1]>=nt&&K[1]<=ot){D=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||q){var st=Pg(y,"layout","icon-size",u,c),at=void 0!==v["icon-color"]?Pg(y,"paint","icon-color",u,c):null;if(!at||0!==at.a){var lt=G+"."+st;if(null!==at&&(lt+="."+at),!(N=T[lt])){var ut=r[G];if(null!==at){var ht,ct;(ct=(ht=ug(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var yt=at.a;0!==yt&&(pt.data[dt]=255*at.r/yt,pt.data[dt+1]=255*at.g/yt,pt.data[dt+2]=255*at.b/yt),pt.data[dt+3]=yt}ct.putImageData(pt,0,0),N=new Xa({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio}),T[lt]=N}else N=new Xa({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===V,scale:st/ut.pixelRatio}),T[lt]=N}}N&&(++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R),R.setGeometry(q),N.setRotation(D+ag(Pg(y,"layout","icon-rotate",u,c))),N.setOpacity(Pg(y,"paint","icon-opacity",u,c)),N.setAnchor(Cg[Pg(y,"layout","icon-anchor",u,c)]),R.setImage(N),z=R.getText(),R.setText(void 0),R.setZIndex(I),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R);var gt=Pg(y,"paint","circle-radius",u,c),mt=Rg(Pg(y,"paint","circle-stroke-color",u,c),Pg(y,"paint","circle-stroke-opacity",u,c)),vt=Rg(Pg(y,"paint","circle-color",u,c),Pg(y,"paint","circle-opacity",u,c)),_t=Pg(y,"paint","circle-stroke-width",u,c),xt=gt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=new Ja({radius:gt,stroke:mt&&_t>0?new Ka({width:_t,color:mt}):void 0,fill:vt?new Ea({color:vt}):void 0}),T[xt]=N),R.setImage(N),z=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),L=!0}var bt=void 0;if("text-field"in m)bt=Fg(Pg(y,"layout","text-field",u,c).toString(),i).trim(),b=Pg(y,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(R=k[p])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(z||new al({padding:[2,2,2,2]})),z=R.getText();var wt=Math.round(Pg(y,"layout","text-size",u,c)),St=Pg(y,"layout","text-font",u,c),Ct=Pg(y,"layout","text-line-height",u,c),Tt=function(t,e,i){var n=gd[t];if(!n){Array.isArray(t)||(t=[t]);for(var r=400,o="normal",s=[],a=0,l=t.length;a<l;++a){var u=t[a].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):yd.test(h)&&(h=h.replace(yd,""),o=u[u.length-1].replace(h,"")),fd)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){r=fd[c],u.pop();break}"number"==typeof h&&(r=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),s.push(p)}n=gd[t]=[o,r,s]}return n[0]+" "+n[1]+" "+e+"px"+(i?"/"+i:"")+" "+n[2]}(s?s(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Pg(y,"layout","text-max-width",u,c),Pt=Pg(y,"layout","text-letter-spacing",u,c),Ot=2==h?pg(bt,Pt):gg(bt,Tt,kt,Pt);z.setText(Ot),z.setFont(Tt),z.setRotation(ag(Pg(y,"layout","text-rotate",u,c)));var Rt=Pg(y,"layout","text-anchor",u,c),It=L||1==h?"point":Pg(y,"layout","symbol-placement",u,c);z.setPlacement(It);var Ft=Pg(y,"paint","text-halo-width",u,c),jt=Pg(y,"layout","text-offset",u,c),Mt=Pg(y,"paint","text-translate",u,c),At=0,Lt=0;if("point"==It){var zt="center";-1!==Rt.indexOf("left")?(zt="left",Lt=Ft):-1!==Rt.indexOf("right")&&(zt="right",Lt=-Ft),z.setTextAlign(zt);var Dt=Pg(y,"layout","text-rotation-alignment",u,c);z.setRotateWithView("map"==Dt)}else z.setMaxAngle(ag(Pg(y,"layout","text-max-angle",u,c))*bt.length/Ot.length),z.setTextAlign(),z.setRotateWithView(!1);var Gt="middle";0==Rt.indexOf("bottom")?(Gt="bottom",At=-Ft-.5*(Ct-1)*wt):0==Rt.indexOf("top")&&(Gt="top",At=Ft+.5*(Ct-1)*wt),z.setTextBaseline(Gt),z.setOffsetX(jt[0]*wt+Lt+Mt[0]),z.setOffsetY(jt[1]*wt+At+Mt[1]),C.setColor(Rg(Pg(y,"paint","text-color",u,c),b)),z.setFill(C);var Nt=Rg(Pg(y,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),Ft*=2;var Bt=.5*wt;S.setWidth(Ft<=Bt?Ft:Bt),z.setStroke(S)}else z.setStroke(void 0);var Wt=Pg(y,"layout","text-padding",u,c),qt=z.getPadding();Wt!==qt[0]&&(qt[0]=Wt,qt[1]=Wt,qt[2]=Wt,qt[3]=Wt),R.setZIndex(I)}}},y=0,g=o.length;y<g;++y)f(y);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P}var Mg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ag=function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",r=void 0!==i.tileGrid?i.tileGrid:Rp({extent:jp(n),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return Mg(e,t),e}(ud),Lg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zg='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Dg=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:[zg];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:r,imageSmoothing:n.imageSmoothing,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:o,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Lg(e,t),e}(Ag);const Gg=Array.isArray;(function t(e,i=[]){return(...n)=>{return(r=[...i,...n]).length>=e.length?e(...r):t(e,r);var r}})((function(t,e,i){if(!Gg(i))throw new TypeError("reduce: list must be array or iterable");let n=0;const r=i.length;for(;n<r;)e=t(e,i[n],n,i),n++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Ng={color:"#ff0000",width:3},Bg=new Ka(Ng),Wg=new Ka(l(a({},Ng),{lineDash:[2,8]})),qg=new Ea({color:"rgba(255, 0, 0, 0.1)"}),Vg=new Ja({radius:6,fill:new Ea({color:"#ff0000"})}),Ug=new rl({image:new Ha({fill:new Ea({color:"#fff"}),stroke:new Ka({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry().getCoordinates()[0];return new ya(e)}}),Xg=new Cc,Kg=new ac({source:Xg,style:[new rl({fill:qg,stroke:Bg}),Ug]}),Yg=new Mc({source:Xg,type:"Polygon",style:new rl({stroke:Wg,fill:qg,image:Vg})}),Zg=new Yc({source:Xg,pixelTolerance:15}),Hg=new Vc({source:Xg,style:new rl({image:Vg})});
|
32
|
+
_d((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof vd&&vd;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=36,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,y=String.fromCharCode;function g(t){throw RangeError(d[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=u)t=f(t/35);return f(n+36*t/(t+38))}function S(t){var e,i,n,r,o,s,a,h,c,p,d,y=[],m=t.length,v=0,_=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),y.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,s=1,a=u;r>=m&&g("invalid-input"),((h=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>f((l-v)/s))&&g("overflow"),v+=h*s,!(h<(c=a<=b?1:a>=b+26?26:a-b));a+=u)s>f(l/(p=u-c))&&g("overflow"),s*=p;b=w(v-o,e=y.length+1,0==o),f(v/e)>l-_&&g("overflow"),_+=f(v/e),v%=e,y.splice(v++,0,_)}return x(y)}function C(t){var e,i,n,r,o,s,a,h,c,p,d,m,v,x,S,C=[];for(m=(t=_(t)).length,e=128,i=0,o=72,s=0;s<m;++s)(d=t[s])<128&&C.push(y(d));for(n=r=C.length,r&&C.push("-");n<m;){for(a=l,s=0;s<m;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(v=n+1))&&g("overflow"),i+=(a-e)*v,e=a,s=0;s<m;++s)if((d=t[s])<e&&++i>l&&g("overflow"),d==e){for(h=i,c=u;!(h<(p=c<=o?1:c>=o+26?26:c-o));c+=u)S=h-p,x=u-p,C.push(y(b(p+S%x,0))),h=f(S/x);C.push(y(b(h,0))),o=w(i,v,n==r),i=0,++n}++i,++e}return C.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:x},decode:S,encode:C,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return v(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(vd)}));var bd=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),xd(r,c)?Array.isArray(r[c])?r[c].push(p):r[c]=[r[c],p]:r[c]=p}return r},wd=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Sd=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(wd(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(wd(t))})).join(e):r+encodeURIComponent(wd(t[n]))})).join(e):n?encodeURIComponent(wd(n))+i+encodeURIComponent(wd(t)):""};_d((function(t,e){e.decode=e.parse=bd,e.encode=e.stringify=Sd}));class Cd extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Td{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,n]of e)this.bindings[i]=n}concat(t){return new Td(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Ed={kind:"null"},kd={kind:"number"},Pd={kind:"string"},Od={kind:"boolean"},Rd={kind:"color"},Id={kind:"object"},Fd={kind:"value"},jd={kind:"collator"},Md={kind:"formatted"},Ad={kind:"resolvedImage"};function Ld(t,e){return{kind:"array",itemType:t,N:e}}function zd(t){if("array"===t.kind){const e=zd(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Dd=[Ed,kd,Pd,Od,Rd,Md,Id,Ld(Fd),Ad];function Gd(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Gd(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(const t of Dd)if(!Gd(t,e))return null}return`Expected ${zd(t)} but found ${zd(e)} instead.`}function Nd(t,e){return e.some((e=>e.kind===t.kind))}function Bd(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var Wd=_d((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function s(t){return"%"===t[t.length-1]?r(parseFloat(t)/100):r(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[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 l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var h=r.substr(0,l),c=r.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),y=s(c[2]),g=y<=.5?y*(f+1):y+f-y*f,m=2*y-g;return[n(255*a(m,g,d+1/3)),n(255*a(m,g,d)),n(255*a(m,g,d-1/3)),p];default:return null}}return null}}catch(l){}}));class qd{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof qd)return t;if("string"!=typeof t)return;const e=Wd.parseCSSColor(t);return e?new qd(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}qd.black=new qd(0,0,0,1),qd.white=new qd(1,1,1,1),qd.transparent=new qd(0,0,0,0),qd.red=new qd(1,0,0,1),qd.blue=new qd(0,0,1,1);class Vd{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ud{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Xd{constructor(t){this.sections=t}static fromString(t){return new Xd([new Ud(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Xd?t:Xd.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Kd{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Kd({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Yd(t,e,i,n){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`}function Zd(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 qd)return!0;if(t instanceof Vd)return!0;if(t instanceof Xd)return!0;if(t instanceof Kd)return!0;if(Array.isArray(t)){for(const e of t)if(!Zd(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Zd(t[e]))return!1;return!0}return!1}function Hd(t){if(null===t)return Ed;if("string"==typeof t)return Pd;if("boolean"==typeof t)return Od;if("number"==typeof t)return kd;if(t instanceof qd)return Rd;if(t instanceof Vd)return jd;if(t instanceof Xd)return Md;if(t instanceof Kd)return Ad;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const t=Hd(n);if(i){if(i===t)continue;i=Fd;break}i=t}return Ld(i||Fd,e)}return Id}function $d(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof qd||t instanceof Xd||t instanceof Kd?t.toString():JSON.stringify(t)}class Jd{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Zd(t[1]))return e.error("invalid value");const i=t[1];let n=Hd(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Jd(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof qd?["rgba"].concat(this.value.toArray()):this.value instanceof Xd?this.value.serialize():this.value}}class Qd{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const tf={string:Pd,number:kd,boolean:Od,object:Id};class ef{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in tf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=tf[i],n++}else r=Fd;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++}i=Ld(r,o)}else i=tf[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Fd);if(!i)return null;o.push(i)}return new ef(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!Gd(this.type,Hd(i)))return i;if(e===this.args.length-1)throw new Qd(`Expected value to be of type ${zd(this.type)}, but found ${zd(Hd(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class nf{constructor(t){this.type=Md,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(r&&"object"==typeof i&&!Array.isArray(i)){r=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,kd),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,Ld(Pd)),!o))return null;let s=null;if(i["text-color"]&&(s=e.parse(i["text-color"],1,Rd),!s))return null;const a=n[n.length-1];a.scale=t,a.font=o,a.textColor=s}else{const i=e.parse(t[o],1,Fd);if(!i)return null;const s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new nf(n)}evaluate(t){return new Xd(this.sections.map((e=>{const i=e.content.evaluate(t);return Hd(i)===Ad?new Ud("",i,null,null,null):new Ud($d(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class rf{constructor(t){this.type=Ad,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Pd);return i?new rf(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Kd.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const of={"to-boolean":Od,"to-color":Rd,"to-number":kd,"to-string":Pd};class sf{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=of[i],r=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Fd);if(!i)return null;r.push(i)}return new sf(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof qd)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Yd(e[0],e[1],e[2],e[3]),!i))return new qd(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Qd(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new Qd(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Xd.fromString($d(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Kd.fromString($d(this.args[0].evaluate(t))):$d(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new nf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new rf(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const af=["Unknown","Point","LineString","Polygon"];class lf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?af[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=qd.parse(t)),e}}class uf{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=uf.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[l,u]of s){a=new Ff(e.registry,e.path,null,e.scope);const n=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(l)?l[e-1]:l.type,s=a.parse(i,1+n.length,r);if(!s){o=!0;break}n.push(s)}if(!o)if(Array.isArray(l)&&l.length!==n.length)a.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new uf(i,r,u,n)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(zd).join(", ")})`:`(${zd(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(zd(i.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){uf.definitions=e;for(const i in e)t[i]=uf}}class hf{constructor(t,e,i){this.type=jd,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Od);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Od);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Pd),!o)?null:new hf(n,r,o)}evaluate(t){return new Vd(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function cf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function pf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function df(t,e){const i=(180+t[0])/360;const n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function ff(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function yf(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(ff(t,a[e],a[e+1]))return!1;n=t,r=a[e],o=a[e+1],r[1]>n[1]!=o[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function gf(t,e){for(let i=0;i<e.length;i++)if(yf(t,e[i]))return!0;return!1}function mf(t,e,i,n){const r=t[0]-i[0],o=t[1]-i[1],s=e[0]-i[0],a=e[1]-i[1],l=n[0]-i[0],u=n[1]-i[1],h=r*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function vf(t,e,i,n){const r=[e[0]-t[0],e[1]-t[1]],o=[n[0]-i[0],n[1]-i[1]];return 0!=(s=o)[0]*(a=r)[1]-s[1]*a[0]&&!(!mf(t,e,i,n)||!mf(i,n,t,e));var s,a}function _f(t,e,i){for(const n of i)for(let i=0;i<n.length-1;++i)if(vf(t,e,n[i],n[i+1]))return!0;return!1}function xf(t,e){for(let i=0;i<t.length;++i)if(!yf(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(_f(t[i],t[i+1],e))return!1;return!0}function bf(t,e){for(let i=0;i<e.length;i++)if(xf(t,e[i]))return!0;return!1}function wf(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=df(t[r][n],i);cf(e,s),o.push(s)}n.push(o)}return n}function Sf(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=wf(t[r],e,i);n.push(o)}return n}function Cf(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}cf(e,t)}function Tf(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const a of t)for(const t of a){const n=[t.x+o[0],t.y+o[1]];Cf(n,e,i,r),s.push(n)}return s}function Ef(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const l of t){const t=[];for(const i of l){const n=[i.x+o[0],i.y+o[1]];cf(e,n),t.push(n)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)Cf(n,e,i,r)}var a;return s}class kf{constructor(t,e){this.type=Od,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zd(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new kf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new kf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new kf(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=wf(e.coordinates,n,r),s=Tf(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!yf(t,o))return!1}if("MultiPolygon"===e.type){const o=Sf(e.coordinates,n,r),s=Tf(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!gf(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=wf(e.coordinates,n,r),s=Ef(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!xf(t,o))return!1}if("MultiPolygon"===e.type){const o=Sf(e.coordinates,n,r),s=Ef(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!bf(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Pf(t){if(t instanceof uf){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof kf)return!1;let e=!0;return t.eachChild((t=>{e&&!Pf(t)&&(e=!1)})),e}function Of(t){if(t instanceof uf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Of(t)&&(e=!1)})),e}function Rf(t,e){if(t instanceof uf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Rf(t,e)&&(i=!1)})),i}class If{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new If(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Ff{constructor(t,e=[],i,n=new Td,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new ef(e,[t]):"coerce"===i?new sf(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", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof Jd)&&"resolvedImage"!==r.type.kind&&jf(r)){const t=new lf;try{r=new Jd(r.type,r.evaluate(t))}catch(n){return this.error(n.message),null}}return r}return this.error(`Unknown expression "${r}". 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.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Ff(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Cd(i,t))}checkSubtype(t,e){const i=Gd(t,e);return i&&this.error(i),i}}function jf(t){if(t instanceof If)return jf(t.boundExpression);if(t instanceof uf&&"error"===t.name)return!1;if(t instanceof hf)return!1;if(t instanceof kf)return!1;const e=t instanceof sf||t instanceof ef;let i=!0;return t.eachChild((t=>{i=e?i&&jf(t):i&&t instanceof Jd})),!!i&&(Pf(t)&&Rf(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function Mf(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new Qd("Input is not a number.");s=a-1}return 0}class Af{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,r]of i)this.labels.push(n),this.outputs.push(r)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,kd);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],s=t[o+1],a=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([i,u])}return new Af(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);return i[Mf(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Lf=zf;function zf(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}function Df(t,e,i){return t*(1-i)+e*i}zf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},zf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},zf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},zf.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},zf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Gf=Object.freeze({__proto__:null,number:Df,color:function(t,e,i){return new qd(Df(t.r,e.r,i),Df(t.g,e.g,i),Df(t.b,e.b,i),Df(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>Df(t,e[n],i)))}});const Nf=4/29,Bf=6/29,Wf=3*Bf*Bf,qf=Math.PI/180,Vf=180/Math.PI;function Uf(t){return t>.008856451679035631?Math.pow(t,1/3):t/Wf+Nf}function Xf(t){return t>Bf?t*t*t:Wf*(t-Nf)}function Kf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Yf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zf(t){const e=Yf(t.r),i=Yf(t.g),n=Yf(t.b),r=Uf((.4124564*e+.3575761*i+.1804375*n)/.95047),o=Uf((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Uf((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function Hf(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xf(e),i=.95047*Xf(i),n=1.08883*Xf(n),new qd(Kf(3.2404542*i-1.5371385*e-.4985314*n),Kf(-.969266*i+1.8760108*e+.041556*n),Kf(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function $f(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Jf={forward:Zf,reverse:Hf,interpolate:function(t,e,i){return{l:Df(t.l,e.l,i),a:Df(t.a,e.a,i),b:Df(t.b,e.b,i),alpha:Df(t.alpha,e.alpha,i)}}},Qf={forward:function(t){const{l:e,a:i,b:n}=Zf(t),r=Math.atan2(n,i)*Vf;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*qf,i=t.c;return Hf({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:$f(t.h,e.h,i),c:Df(t.c,e.c,i),l:Df(t.l,e.l,i),alpha:Df(t.alpha,e.alpha,i)}}};class ty{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[o,s]of r)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=ey(e,t.base,i,n);else if("linear"===t.name)r=ey(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new Lf(o[0],o[1],o[2],o[3]).solve(ey(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}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(r=e.parse(r,2,kd),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Rd:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],n=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(i,r,a);if(!u)return null;a=a||u.type,s.push([t,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ty(a,i,n,r,s):e.error(`Type ${zd(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Mf(e,n),s=e[o],a=e[o+1],l=ty.interpolationFactor(this.interpolation,n,s,a),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?Gf[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?Qf.reverse(Qf.interpolate(Qf.forward(u),Qf.forward(h),l)):Jf.reverse(Jf.interpolate(Jf.forward(u),Jf.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function ey(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class iy{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const s of t.slice(1)){const t=e.parse(s,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>Gd(n,t.type)));return new iy(o?Fd:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof Kd&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class ny{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new ny(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class ry{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,kd),n=e.parse(t[2],2,Ld(e.expectedType||Fd));if(!i||!n)return null;const r=n.type;return new ry(r.itemType,i,n)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Qd(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new Qd(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new Qd(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class oy{constructor(t,e){this.type=Od,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,Fd);return i&&n?Nd(i.type,[Od,Pd,kd,Ed,Fd])?new oy(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${zd(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Bd(e,["boolean","string","number","null"]))throw new Qd(`Expected first argument to be of type boolean, string, number or null, but found ${zd(Hd(e))} instead.`);if(!Bd(i,["string","array"]))throw new Qd(`Expected second argument to be of type array or string, but found ${zd(Hd(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class sy{constructor(t,e,i){this.type=kd,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,Fd);if(!i||!n)return null;if(!Nd(i.type,[Od,Pd,kd,Ed,Fd]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${zd(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,kd);return r?new sy(i,n,r):null}return new sy(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Bd(e,["boolean","string","number","null"]))throw new Qd(`Expected first argument to be of type boolean, string, number or null, but found ${zd(Hd(e))} instead.`);if(!Bd(i,["string","array"]))throw new Qd(`Expected second argument to be of type array or string, but found ${zd(Hd(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ay{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let l=2;l<t.length-1;l+=2){let s=t[l];const a=t[l+1];Array.isArray(s)||(s=[s]);const u=e.concat(l);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Hd(t)))return null}else i=Hd(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const h=e.parse(a,l,n);if(!h)return null;n=n||h.type,o.push(h)}const s=e.parse(t[1],1,Fd);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new ay(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(Hd(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const o of e){const t=n[this.cases[o]];void 0===t?(n[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[t][1].push(o)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[o,s]of i)1===s.length?t.push(r(s[0])):t.push(s.map(r)),t.push(this.outputs[o].serialize());return t.push(this.otherwise.serialize()),t}}class ly{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(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.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let o=1;o<t.length-1;o+=2){const r=e.parse(t[o],o,Od);if(!r)return null;const s=e.parse(t[o+1],o+1,i);if(!s)return null;n.push([r,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new ly(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class uy{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,kd);if(!i||!n)return null;if(!Nd(i.type,[Ld(Fd),Pd,Fd]))return e.error(`Expected first argument to be of type array or string, but found ${zd(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,kd);return r?new uy(i.type,i,n,r):null}return new uy(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Bd(e,["string","array"]))throw new Qd(`Expected first argument to be of type array or string, but found ${zd(Hd(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function hy(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function cy(t,e,i,n){return 0===n.compare(e,i)}function py(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Od,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Fd);if(!o)return null;if(!hy(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${zd(o.type)}'.`);let s=e.parse(t[2],2,Fd);if(!s)return null;if(!hy(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${zd(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${zd(o.type)}' and '${zd(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new ef(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new ef(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,jd),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=Hd(o),i=Hd(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Qd(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Hd(o),i=Hd(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const dy=py("==",(function(t,e,i){return e===i}),cy),fy=py("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!cy(0,e,i,n)})),yy=py("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),gy=py(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),my=py("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),vy=py(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class _y{constructor(t,e,i,n,r){this.type=Pd,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,kd);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Pd),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Pd),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,kd),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,kd),!a)?null:new _y(i,r,o,s,a)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class xy{constructor(t){this.type=kd,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${zd(i.type)} instead.`):new xy(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Qd(`Expected value to be of type string or array, but found ${zd(Hd(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const by={"==":dy,"!=":fy,">":gy,"<":yy,">=":vy,"<=":my,array:ef,at:ry,boolean:ef,case:ly,coalesce:iy,collator:hf,format:nf,image:rf,in:oy,"index-of":sy,interpolate:ty,"interpolate-hcl":ty,"interpolate-lab":ty,length:xy,let:ny,literal:Jd,match:ay,number:ef,"number-format":_y,object:ef,slice:uy,step:Af,string:ef,"to-boolean":sf,"to-color":sf,"to-number":sf,"to-string":sf,var:If,within:kf};function wy(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=Yd(e,i,n,o);if(s)throw new Qd(s);return new qd(e/255*o,i/255*o,n/255*o,o)}function Sy(t,e){return t in e}function Cy(t,e){const i=e[t];return void 0===i?null:i}function Ty(t){return{type:t}}function Ey(t){return{result:"success",value:t}}function ky(t){return{result:"error",value:t}}function Py(t){return!!t.expression&&t.expression.interpolated}function Oy(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}uf.register(by,{error:[{kind:"error"},[Pd],(t,[e])=>{throw new Qd(e.evaluate(t))}],typeof:[Pd,[Fd],(t,[e])=>zd(Hd(e.evaluate(t)))],"to-rgba":[Ld(kd,4),[Rd],(t,[e])=>e.evaluate(t).toArray()],rgb:[Rd,[kd,kd,kd],wy],rgba:[Rd,[kd,kd,kd,kd],wy],has:{type:Od,overloads:[[[Pd],(t,[e])=>Sy(e.evaluate(t),t.properties())],[[Pd,Id],(t,[e,i])=>Sy(e.evaluate(t),i.evaluate(t))]]},get:{type:Fd,overloads:[[[Pd],(t,[e])=>Cy(e.evaluate(t),t.properties())],[[Pd,Id],(t,[e,i])=>Cy(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Fd,[Pd],(t,[e])=>Cy(e.evaluate(t),t.featureState||{})],properties:[Id,[],t=>t.properties()],"geometry-type":[Pd,[],t=>t.geometryType()],id:[Fd,[],t=>t.id()],zoom:[kd,[],t=>t.globals.zoom],"heatmap-density":[kd,[],t=>t.globals.heatmapDensity||0],"line-progress":[kd,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[kd,[],t=>t.globals.skyRadialProgress||0],accumulated:[Fd,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[kd,Ty(kd),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[kd,Ty(kd),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:kd,overloads:[[[kd,kd],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[kd],(t,[e])=>-e.evaluate(t)]]},"/":[kd,[kd,kd],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[kd,[kd,kd],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[kd,[],()=>Math.LN2],pi:[kd,[],()=>Math.PI],e:[kd,[],()=>Math.E],"^":[kd,[kd,kd],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[kd,[kd],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))],log2:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[kd,[kd],(t,[e])=>Math.sin(e.evaluate(t))],cos:[kd,[kd],(t,[e])=>Math.cos(e.evaluate(t))],tan:[kd,[kd],(t,[e])=>Math.tan(e.evaluate(t))],asin:[kd,[kd],(t,[e])=>Math.asin(e.evaluate(t))],acos:[kd,[kd],(t,[e])=>Math.acos(e.evaluate(t))],atan:[kd,[kd],(t,[e])=>Math.atan(e.evaluate(t))],min:[kd,Ty(kd),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[kd,Ty(kd),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[kd,[kd],(t,[e])=>Math.abs(e.evaluate(t))],round:[kd,[kd],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[kd,[kd],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[kd,[kd],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Od,[Pd,Fd],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Od,[Fd],(t,[e])=>t.id()===e.value],"filter-type-==":[Od,[Pd],(t,[e])=>t.geometryType()===e.value],"filter-<":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Od,[Fd],(t,[e])=>e.value in t.properties()],"filter-has-id":[Od,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Od,[Ld(Pd)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Od,[Ld(Fd)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Od,[Pd,Ld(Fd)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Od,[Pd,Ld(Fd)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Od,overloads:[[[Od,Od],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ty(Od),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Od,overloads:[[[Od,Od],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ty(Od),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Od,[Od],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Od,[Pd],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Pd,[Pd],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Pd,[Pd],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Pd,Ty(Fd),(t,e)=>e.map((e=>$d(e.evaluate(t)))).join("")],"resolved-locale":[Pd,[jd],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Ry{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new lf,this._defaultValue=e?"color"===(i=e).type&&Oy(i.default)?new qd(0,0,0,0):"color"===i.type?qd.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Qd(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}}}function Iy(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in by}function Fy(t,e){const i=new Ff(by,[],e?function(t){const e={color:Rd,string:Pd,number:kd,enum:Pd,boolean:Od,formatted:Md,resolvedImage:Ad};if("array"===t.type)return Ld(e[t.value]||Fd,t.length);return e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ey(new Ry(n,e)):ky(i.errors)}class jy{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Of(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class My{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Of(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?ty.interpolationFactor(this.interpolationType,t,e,i):0}}function Ay(t,e){if("error"===(t=Fy(t,e)).result)return t;const i=t.value.expression,n=Pf(i);if(!n&&("data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"]))return ky([new Cd("","data expressions not supported")]);var r;const o=Rf(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ky([new Cd("","zoom expressions not supported")]);const s=Ly(i);if(!s&&!o)return ky([new Cd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Cd)return ky([s]);if(s instanceof ty&&!Py(e))return ky([new Cd("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Ey(new jy(n?"constant":"source",t.value));const a=s instanceof ty?s.interpolation:void 0;return Ey(new My(n?"camera":"composite",t.value,s.labels,a))}function Ly(t){let e=null;if(t instanceof ny)e=Ly(t.result);else if(t instanceof iy){for(const i of t.args)if(e=Ly(i),e)break}else(t instanceof Af||t instanceof ty)&&t.input instanceof uf&&"zoom"===t.input.name&&(e=t);return e instanceof Cd||t.eachChild((t=>{const i=Ly(t);i instanceof Cd?e=i:!e&&i?e=new Cd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Cd("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function zy(t){return"object"==typeof t?["literal",t]:t}function Dy(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Gy(t,e){const i=zy((n=t.default,r=e.default,void 0!==n?n:void 0!==r?r:void 0));var n,r;return void 0===i&&"resolvedImage"===e.type?"":i}function Ny(t,e,i){const n=qy(t,e),r=["get",t.property];if("categorical"===n&&"boolean"==typeof i[0][0]){const n=["case"];for(const t of i)n.push(["==",r,t[0]],t[1]);return n.push(Gy(t,e)),n}if("categorical"===n){const n=["match",r];for(const t of i)Wy(n,t[0],t[1],!1);return n.push(Gy(t,e)),n}if("interval"===n){const e=["step",["number",r]];for(const t of i)Wy(e,t[0],t[1],!0);return By(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,zy(t.default)]}if("exponential"===n){const e=void 0!==t.base?t.base:1,n=[Dy(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of i)Wy(n,t[0],t[1],!1);return void 0===t.default?n:["case",["==",["typeof",r],"number"],n,zy(t.default)]}throw new Error(`Unknown property function type ${n}`)}function By(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function Wy(t,e,i,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(i))}function qy(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Vy(t){const e=["concat"],i=/{([^{}]+)}/g;let n=0;for(let r=i.exec(t);null!==r;r=i.exec(t)){const o=t.slice(n,i.lastIndex-r[0].length);n=i.lastIndex,o.length>0&&e.push(o),e.push(["get",r[1]])}if(1===e.length)return t;if(n<t.length)e.push(t.slice(n));else if(2===e.length)return["to-string",e[1]];return e}function Uy(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Uy(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const Xy={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ky(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Uy(t)||(t=Hy(t));const e=Fy(t,Xy);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:Zy(t)}}function Yy(t,e){return t<e?-1:t>e?1:0}function Zy(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(Zy(t[e]))return!0;return!1}function Hy(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?$y(t[1],t[2],"=="):"!="===e?tg($y(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?$y(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Hy))):"all"===e?["all"].concat(t.slice(1).map(Hy)):"none"===e?["all"].concat(t.slice(1).map(Hy).map(tg)):"in"===e?Jy(t[1],t.slice(2)):"!in"===e?tg(Jy(t[1],t.slice(2))):"has"===e?Qy(t[1]):"!has"===e?tg(Qy(t[1])):"within"!==e||t}function $y(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Jy(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((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Yy)]]:["filter-in-small",t,["literal",e]]}}function Qy(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function tg(t){return["!",t]}var eg=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ig(t,e){const i={};for(const n in t)"ref"!==n&&(i[n]=t[n]);return eg.forEach((t=>{t in e&&(i[t]=e[t])})),i}_d((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(a+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:y,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),n.push(p.yytext),r.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,s=p.yytext,a=p.yylineno,y=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=n[n.length-S],E._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[s,l,a,d.yy,x[1],n,r].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),n=n.slice(0,-1*S),r=r.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),n.push(E.$),r.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;o<r.length;o++)if((i=this._input.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const ng=Iy,rg=Ay,og=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const n=["color"===e.type?"to-color":e.type,i,zy(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}}(t,e);const n=i&&"object"==typeof i[0][0],r=n||void 0!==t.property,o=n||!r;return i=i.map((t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],Vy(t[1])]:[t[0],zy(t[1])])),n?function(t,e,i){const n={},r={},o=[];for(let s=0;s<i.length;s++){const e=i[s],a=e[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],o.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===qy({},e)){const i=[Dy(t),["linear"],["zoom"]];for(const t of o){Wy(i,t,Ny(n[t],e,r[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of o){Wy(t,i,Ny(n[i],e,r[i]),!0)}return By(t),t}}(t,e,i):o?function(t,e,i,n=["zoom"]){const r=qy(t,e);let o,s=!1;if("interval"===r)o=["step",n],s=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;o=[Dy(t),1===e?["linear"]:["exponential",e],n]}}for(const a of i)Wy(o,a[0],a[1],s);return By(o),o}(t,e,i):Ny(t,e,i)},sg=Oy;function ag(t){return t*Math.PI/180}var lg=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ug(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var hg,cg=Array(256).join(" ");function pg(t,e){if(e>=.05){for(var i="",n=t.split("\n"),r=cg.slice(0,Math.round(e/.1)),o=0,s=n.length;o<s;++o)o>0&&(i+="\n"),i+=n[o].split("").join(r);return i}return t}function dg(){return hg||(hg=ug(1,1).getContext("2d")),hg}function fg(t,e){return dg().measureText(t).width+(t.length-1)*e}var yg={};function gg(t,e,i,n){if(-1!==t.indexOf("\n")){for(var r=t.split("\n"),o=[],s=0,a=r.length;s<a;++s)o.push(gg(r[s],e,i,n));return o.join("\n")}var l=i+","+e+","+t+","+n,u=yg[l];if(!u){var h=t.split(" ");if(h.length>1){var c=dg();c.font=e;var p=c.measureText("M").width*i,d="";for(o=[],s=0,a=h.length;s<a;++s){var f=h[s],y=d+(d?" ":"")+f;fg(y,n)<=p?d=y:(d&&o.push(d),d=f)}d&&o.push(d);for(s=0,a=o.length;s<a&&a>1;++s){var g=o[s];if(fg(g,n)<.35*p){var m=s>0?fg(o[s-1],n):1/0,v=s<a-1?fg(o[s+1],n):1/0;o.splice(s,1),a-=1,m<v?(o[s-1]+=" "+g,s-=1):o[s]=g+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var _=o[s],x=o[s+1];if(fg(_,n)>.7*p&&fg(x,n)<.6*p){var b=_.split(" "),w=b.pop();fg(w,n)<.2*p&&(o[s]=b.join(" "),o[s+1]=w+" "+x),a-=1}}u=o.join("\n")}else u=t;u=pg(u,n),yg[l]=u}return u}Nr&&qt(Nr,jt,(function(){yg={}}));var mg,vg,_g=sg,xg=og,bg=ng,wg=rg,Sg={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Cg={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},Tg={},Eg={zoom:0},kg={};function Pg(t,e,i,n,r){var o=t.id;kg[o]||(kg[o]={});var s=kg[o];if(!s[i]){var a=(t[e]||Tg)[i],l=md[e+"_"+t.type][i];void 0===a&&(a=l.default);var u=bg(a);if(!u&&_g(a)&&(a=xg(a,l),u=!0),u){var h=function(t,e){var i=wg(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,l);s[i]=h.evaluate.bind(h)}else"color"==l.type&&(a=qd.parse(a)),s[i]=function(){return a}}return Eg.zoom=n,s[i](Eg,r)}var Og={};function Rg(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Ig=/^([^]*)\{(.*)\}([^]*)$/;function Fg(t,e){var i;do{if(i=t.match(Ig)){var n=e[i[2]]||"";t=i[1]+n+i[3]}}while(i);return t}function jg(t,e,i,n,r,o,s){if(void 0===n&&(n=lg),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,l=[a.width,a.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=ig(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],y=0,g=p.length;y<g;++y){var m=p[y],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=[],d[_]=w),w.push({layer:m,index:y}),f.push(v)}delete kg[v],delete Og[v]}var S=new Ka,C=new Ea,T={},E={},k=[],P=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=n.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,n=e.length;i<n;++i)if(e[i]<t&&i+1<n){var r=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(r)}return n-1}(e,n));for(var h=Sg[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(n,d){var f=o[n],y=f.layer,g=y.id,m=y.layout||Tg,v=y.paint||Tg;if("none"===m.visibility||"minzoom"in y&&u<y.minzoom||"maxzoom"in y&&u>=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,i,n){return t in Og||(Og[t]=Ky(e).filter),Eg.zoom=n,Og[t](Eg,i)}(g,_,c,u)){var x=void 0,b=void 0,w=void 0,P=void 0,O=void 0,R=void 0,I=f.index;if(3==h&&("fill"==y.type||"fill-extrusion"==y.type))if(b=Pg(y,"paint",y.type+"-opacity",u,c),y.type+"-pattern"in v){var F=Pg(y,"paint",y.type+"-pattern",u,c);if(F){var j="string"==typeof F?Fg(F,i):F.toString();if(a&&r&&r[j]){++p,(R=k[p])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new rl({fill:new Ea}),k[p]=R),w=R.getFill(),R.setZIndex(I);var M=E[lt=j+"."+b];if(!M)(ct=(ht=ug((ut=r[j]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),M=ct.createPattern(ht,"repeat"),E[lt]=M;w.setColor(M)}}}else(x=Rg(Pg(y,"paint",y.type+"-color",u,c),b))&&(y.type+"-outline-color"in v&&(O=Rg(Pg(y,"paint",y.type+"-outline-color",u,c),b)),O||(O=x),++p,(R=k[p])&&R.getFill()&&R.getStroke()&&!R.getText()||(R=new rl({fill:new Ea,stroke:new Ka}),k[p]=R),(w=R.getFill()).setColor(x),(P=R.getStroke()).setColor(O),P.setWidth(1),R.setZIndex(I));if(1!=h&&"line"==y.type){x=!("line-pattern"in v)&&"line-color"in v?Rg(Pg(y,"paint","line-color",u,c),Pg(y,"paint","line-opacity",u,c)):void 0;var A=Pg(y,"paint","line-width",u,c);x&&A>0&&(++p,(R=k[p])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new rl({stroke:new Ka}),k[p]=R),(P=R.getStroke()).setLineCap(Pg(y,"layout","line-cap",u,c)),P.setLineJoin(Pg(y,"layout","line-join",u,c)),P.setMiterLimit(Pg(y,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(A),P.setLineDash(v["line-dasharray"]?Pg(y,"paint","line-dasharray",u,c).map((function(t){return t*A})):null),R.setZIndex(I))}var L=!1,z=null,D=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var W=Pg(y,"layout","icon-image",u,c);if(W){G="string"==typeof W?Fg(W,i):W.toString();var q=void 0;if(a&&r&&r[G]){var V=Pg(y,"layout","icon-rotation-alignment",u,c);if(2==h){var U=t.getGeometry();if(U.getFlatMidpoint||U.getFlatMidpoints){var X=U.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===U.getType()?U.getFlatMidpoints():U.getFlatMidpoint();if(vg||(vg=new Rl("Point",mg=[NaN,NaN],[],{},null)),q=vg,mg[0]=K[0],mg[1]=K[1],"line"===(It=Pg(y,"layout","symbol-placement",u,c))&&"map"===V)for(var Y=U.getStride(),Z=U.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),nt=Math.min(Q,et),rt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=rt&&K[1]>=nt&&K[1]<=ot){D=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||q){var st=Pg(y,"layout","icon-size",u,c),at=void 0!==v["icon-color"]?Pg(y,"paint","icon-color",u,c):null;if(!at||0!==at.a){var lt=G+"."+st;if(null!==at&&(lt+="."+at),!(N=T[lt])){var ut=r[G];if(null!==at){var ht,ct;(ct=(ht=ug(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var yt=at.a;0!==yt&&(pt.data[dt]=255*at.r/yt,pt.data[dt+1]=255*at.g/yt,pt.data[dt+2]=255*at.b/yt),pt.data[dt+3]=yt}ct.putImageData(pt,0,0),N=new Xa({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio}),T[lt]=N}else N=new Xa({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===V,scale:st/ut.pixelRatio}),T[lt]=N}}N&&(++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R),R.setGeometry(q),N.setRotation(D+ag(Pg(y,"layout","icon-rotate",u,c))),N.setOpacity(Pg(y,"paint","icon-opacity",u,c)),N.setAnchor(Cg[Pg(y,"layout","icon-anchor",u,c)]),R.setImage(N),z=R.getText(),R.setText(void 0),R.setZIndex(I),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R);var gt=Pg(y,"paint","circle-radius",u,c),mt=Rg(Pg(y,"paint","circle-stroke-color",u,c),Pg(y,"paint","circle-stroke-opacity",u,c)),vt=Rg(Pg(y,"paint","circle-color",u,c),Pg(y,"paint","circle-opacity",u,c)),_t=Pg(y,"paint","circle-stroke-width",u,c),xt=gt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=new Ja({radius:gt,stroke:mt&&_t>0?new Ka({width:_t,color:mt}):void 0,fill:vt?new Ea({color:vt}):void 0}),T[xt]=N),R.setImage(N),z=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),L=!0}var bt=void 0;if("text-field"in m)bt=Fg(Pg(y,"layout","text-field",u,c).toString(),i).trim(),b=Pg(y,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(R=k[p])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(z||new al({padding:[2,2,2,2]})),z=R.getText();var wt=Math.round(Pg(y,"layout","text-size",u,c)),St=Pg(y,"layout","text-font",u,c),Ct=Pg(y,"layout","text-line-height",u,c),Tt=function(t,e,i){var n=gd[t];if(!n){Array.isArray(t)||(t=[t]);for(var r=400,o="normal",s=[],a=0,l=t.length;a<l;++a){var u=t[a].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):yd.test(h)&&(h=h.replace(yd,""),o=u[u.length-1].replace(h,"")),fd)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){r=fd[c],u.pop();break}"number"==typeof h&&(r=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),s.push(p)}n=gd[t]=[o,r,s]}return n[0]+" "+n[1]+" "+e+"px"+(i?"/"+i:"")+" "+n[2]}(s?s(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Pg(y,"layout","text-max-width",u,c),Pt=Pg(y,"layout","text-letter-spacing",u,c),Ot=2==h?pg(bt,Pt):gg(bt,Tt,kt,Pt);z.setText(Ot),z.setFont(Tt),z.setRotation(ag(Pg(y,"layout","text-rotate",u,c)));var Rt=Pg(y,"layout","text-anchor",u,c),It=L||1==h?"point":Pg(y,"layout","symbol-placement",u,c);z.setPlacement(It);var Ft=Pg(y,"paint","text-halo-width",u,c),jt=Pg(y,"layout","text-offset",u,c),Mt=Pg(y,"paint","text-translate",u,c),At=0,Lt=0;if("point"==It){var zt="center";-1!==Rt.indexOf("left")?(zt="left",Lt=Ft):-1!==Rt.indexOf("right")&&(zt="right",Lt=-Ft),z.setTextAlign(zt);var Dt=Pg(y,"layout","text-rotation-alignment",u,c);z.setRotateWithView("map"==Dt)}else z.setMaxAngle(ag(Pg(y,"layout","text-max-angle",u,c))*bt.length/Ot.length),z.setTextAlign(),z.setRotateWithView(!1);var Gt="middle";0==Rt.indexOf("bottom")?(Gt="bottom",At=-Ft-.5*(Ct-1)*wt):0==Rt.indexOf("top")&&(Gt="top",At=Ft+.5*(Ct-1)*wt),z.setTextBaseline(Gt),z.setOffsetX(jt[0]*wt+Lt+Mt[0]),z.setOffsetY(jt[1]*wt+At+Mt[1]),C.setColor(Rg(Pg(y,"paint","text-color",u,c),b)),z.setFill(C);var Nt=Rg(Pg(y,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),Ft*=2;var Bt=.5*wt;S.setWidth(Ft<=Bt?Ft:Bt),z.setStroke(S)}else z.setStroke(void 0);var Wt=Pg(y,"layout","text-padding",u,c),qt=z.getPadding();Wt!==qt[0]&&(qt[0]=Wt,qt[1]=Wt,qt[2]=Wt,qt[3]=Wt),R.setZIndex(I)}}},y=0,g=o.length;y<g;++y)f(y);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P}var Mg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ag=function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",r=void 0!==i.tileGrid?i.tileGrid:Rp({extent:jp(n),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return Mg(e,t),e}(ud),Lg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zg='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Dg=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:[zg];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:r,imageSmoothing:n.imageSmoothing,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:o,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Lg(e,t),e}(Ag);const Gg=Array.isArray;function Ng(t,e){if(1===arguments.length)return e=>Ng(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let n=0;for(;n<e.length;)i.push(e.slice(n,n+=t));return i}(function t(e,i=[]){return(...n)=>{return(r=[...i,...n]).length>=e.length?e(...r):t(e,r);var r}})((function(t,e,i){if(!Gg(i))throw new TypeError("reduce: list must be array or iterable");let n=0;const r=i.length;for(;n<r;)e=t(e,i[n],n,i),n++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Bg=new Cc({features:[],wrapX:!1}),Wg=new ac({source:Bg,style:new rl({image:new Ja({radius:3,fill:new Ea({color:"grey"})})})});function qg(t,e){return Ng(2,t.getSource().getFeaturesInExtent(e).filter((t=>"Point"!==t.getGeometry().getType())).flatMap((t=>t.flatCoordinates_))).forEach(((t,e)=>{Bg.addFeature(new $s({geometry:new fs(t),i:e}))}))}const Vg={color:"#ff0000",width:3},Ug=new Ka(Vg),Xg=new Ka(l(a({},Vg),{lineDash:[2,8]})),Kg=new Ea({color:"rgba(255, 0, 0, 0.1)"}),Yg=new Ha({stroke:new Ka({color:"red",width:2}),points:4,radius1:15,radius2:1}),Zg=new Ja({radius:6,fill:new Ea({color:"#ff0000"})}),Hg=new rl({image:new Ha({fill:new Ea({color:"#fff"}),stroke:new Ka({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry().getCoordinates()[0];return new ya(e)}}),$g=new Cc,Jg=new ac({source:$g,style:[new rl({fill:Kg,stroke:Ug}),Hg]});const Qg=new Yc({source:Bg,pixelTolerance:15});
|
33
33
|
/**
|
34
34
|
* splaytree v3.1.0
|
35
35
|
* Fast Splay tree for Node and browser
|
@@ -38,7 +38,7 @@ _d((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="ob
|
|
38
38
|
* @license MIT
|
39
39
|
* @preserve
|
40
40
|
*/
|
41
|
-
var $g=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Jg(t,e){return t>e?1:t<e?-1:0}function Qg(t,e,i){for(var n=new $g(null,null),r=n,o=n;;){var s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,null===(e=a).left)break}o.left=e,o=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function tm(t,e,i,n){var r=new $g(t,e);if(null===i)return r.left=r.right=null,r;var o=n(t,(i=Qg(t,i,n)).key);return o<0?(r.left=i.left,r.right=i,i.left=null):o>=0&&(r.right=i.right,r.left=i,i.right=null),r}function em(t,e,i){var n=null,r=null;if(e){var o=i((e=Qg(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function im(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&im(t.left,o,!1,n,r),t.right&&im(t.right,o,!0,n,r)}}var nm=function(){function t(t){void 0===t&&(t=Jg),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=tm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new $g(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=Qg(t,this._root,n),o=n(t,r.key);return 0===o?this._root=r:(o<0?(i.left=r.left,i.right=r,r.left=null):o>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=Qg(t,e,i)).key)?(null===e.left?n=e.right:(n=Qg(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Qg(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Qg(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],n=!1,r=new $g(null,null),o=r;for(;!n;)e?(i.push(e),e=e.left):i.length>0?e=(e=o=o.next=i.pop()).right:n=!0;return o.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&sm(t,e,0,n-1,r),null===this._root)this._root=rm(t,e,0,n),this._size=n;else{var o=function(t,e,i){var n=new $g(null,null),r=n,o=t,s=e;for(;null!==o&&null!==s;)i(o.key,s.key)<0?(r.next=o,o=o.next):(r.next=s,s=s.next),r=r.next;null!==o?r.next=o:null!==s&&(r.next=s);return n.next}(this.toList(),function(t,e){for(var i=new $g(null,null),n=i,r=0;r<t.length;r++)n=n.next=new $g(t[r],e[r]);return n.next=null,i.next}(t,e),r);n=this._size+n,this._root=om({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return im(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=em(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=tm(e,i,s,n):o=tm(e,i,o,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=Qg(t.key,e,i)).left=t),e)}(o,s,n)},t.prototype.split=function(t){return em(t,this._root,this._comparator)},t}();function rm(t,e,i,n){var r=n-i;if(r>0){var o=i+Math.floor(r/2),s=t[o],a=e[o],l=new $g(s,a);return l.left=rm(t,e,i,o),l.right=rm(t,e,o+1,n),l}return null}function om(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=om(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=om(t,r+1,i),s}return null}function sm(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}sm(t,e,i,a,r),sm(t,e,a+1,n,r)}}function am(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function um(t,e,i){return e&&lm(t.prototype,e),i&&lm(t,i),t}var hm=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},cm=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},pm=Number.EPSILON;void 0===pm&&(pm=Math.pow(2,-52));var dm=pm*pm,fm=function(t,e){if(-pm<t&&t<pm&&-pm<e&&e<pm)return 0;var i=t-e;return i*i<dm*t*e?0:t<e?-1:1},ym=function(){function t(){am(this,t),this.reset()}return um(t,[{key:"reset",value:function(){this.xRounder=new gm,this.yRounder=new gm}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),gm=function(){function t(){am(this,t),this.tree=new nm,this.round(0)}return um(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===fm(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===fm(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),t}(),mm=new ym,vm=function(t,e){return t.x*e.y-t.y*e.x},_m=function(t,e){return t.x*e.x+t.y*e.y},xm=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y},o=vm(n,r);return fm(o,0)},bm=function(t){return Math.sqrt(_m(t,t))},wm=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return _m(r,n)/bm(r)/bm(n)},Sm=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},Cm=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},Tm=function(){function t(e,i){am(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return um(t,null,[{key:"compare",value:function(e,i){var n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:km.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),um(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var r=this.point.events[n];void 0===r.consumedBy&&(i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var r,o,s,a,l,u=n.otherSE;i.set(n,{sine:(r=e.point,o=t.point,s=u.point,a={x:o.x-r.x,y:o.y-r.y},l={x:s.x-r.x,y:s.y-r.y},vm(l,a)/bm(l)/bm(a)),cosine:wm(e.point,t.point,u.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var r=i.get(t),o=r.sine,s=r.cosine,a=i.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}}]),t}(),Em=0,km=function(){function t(e,i,n,r){am(this,t),this.id=++Em,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=n,this.windings=r}return um(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(r<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(r>o){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(r!==o){var g=l-s,m=r-i,v=u-a,_=o-n;if(g>m&&v<_)return 1;if(g<m&&v>_)return-1}return r>o?1:r<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),um(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var r=(t.y-e.y)/n.y,o=e.x+r*n.x;if(t.x===o)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=cm(e,i);if(null===n)return null;var r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=hm(e,s)&&0===this.comparePoint(s),u=hm(i,r)&&0===t.comparePoint(r),h=hm(e,a)&&0===this.comparePoint(a),c=hm(i,o)&&0===t.comparePoint(o);if(u&&l)return c&&!h?o:!c&&h?a:null;if(u)return h&&r.x===a.x&&r.y===a.y?null:r;if(l)return c&&o.x===s.x&&o.y===s.y?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var p=function(t,e,i,n){if(0===e.x)return Cm(i,n,t.x);if(0===n.x)return Cm(t,e,i.x);if(0===e.y)return Sm(i,n,t.y);if(0===n.y)return Sm(t,e,i.y);var r=vm(e,n);if(0==r)return null;var o={x:i.x-t.x,y:i.y-t.y},s=vm(o,e)/r,a=vm(o,n)/r;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(r,this.vector(),s,t.vector());return null===p?null:hm(n,p)?mm.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],n=void 0!==e.events,r=new Tm(e,!0),o=new Tm(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);var a=new t(r,s,this.rings.slice(),this.windings.slice());return Tm.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Tm.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,n=e;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var r=t.compare(i,n);if(0!==r){if(r>0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var u=n.rings[a],h=n.windings[a],c=i.rings.indexOf(u);-1===c?(i.rings.push(u),i.windings.push(h)):i.windings[c]+=h}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,r=0,o=this.rings.length;r<o;r++){var s=this.rings[r],a=this.windings[r],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var u=[],h=[],c=0,p=e.length;c<p;c++)if(0!==i[c]){var d=e[c],f=d.poly;if(-1===h.indexOf(f))if(d.isExterior)u.push(f);else{-1===h.indexOf(f)&&h.push(f);var y=u.indexOf(d.poly);-1!==y&&u.splice(y,1)}}for(var g=0,m=u.length;g<m;g++){var v=u[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(zm.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===zm.numMultiPolys&&r<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(zm.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,n){var r,o,s,a=Tm.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=i,o=e,s=-1}return new t(new Tm(r,!0),new Tm(o,!1),[n],[s])}}]),t}(),Pm=function(){function t(e,i,n){if(am(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=mm.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var o=r,s=1,a=e.length;s<a;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=mm.round(e[s][0],e[s][1]);l.x===o.x&&l.y===o.y||(this.segments.push(km.fromRing(o,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}r.x===o.x&&r.y===o.y||this.segments.push(km.fromRing(o,r,this))}return um(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),t}(),Om=function(){function t(e,i){if(am(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pm(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,r=e.length;n<r;n++){var o=new Pm(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=i}return um(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),Rm=function(){function t(e,i){if(am(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(s){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,r=e.length;n<r;n++){var o=new Om(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=i}return um(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),Im=function(){function t(e){am(this,t),this.events=e;for(var i=0,n=e.length;i<n;i++)e[i].segment.ringOut=this;this.poly=null}return um(t,null,[{key:"factory",value:function(e){for(var i=[],n=0,r=e.length;n<r;n++){var o=e[n];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],h=a.point,c=[];s=a,a=l,u.push(a),a.point!==h;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var d=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var y=null,g=0,m=c.length;g<m;g++)if(c[g].point===a.point){y=g;break}if(null===y){c.push({index:u.length,point:a.point});var v=a.getLeftmostComparator(s);l=p.sort(v)[0].otherSE;break}var _=c.splice(y)[0],x=u.splice(_.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(u))}}return i}}]),um(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var r=this.events[i].point,o=this.events[i+1].point;0!==xm(r,t,o)&&(e.push(r),t=r)}if(1===e.length)return null;var s=e[0],a=e[1];0===xm(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],p=u;p!=h;p+=l)c.push([e[p].x,e[p].y]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];Tm.compare(t,n)>0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),t}(),Fm=function(){function t(e){am(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return um(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),t}(),jm=function(){function t(e){am(this,t),this.rings=e,this.polys=this._composePolys(e)}return um(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(!r.poly)if(r.isExteriorRing())e.push(new Fm(r));else{var o=r.enclosingRing();o.poly||e.push(new Fm(o)),o.poly.addInterior(r)}}return e}}]),t}(),Mm=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:km.compare;am(this,t),this.queue=e,this.tree=new nm(i),this.segments=[]}return um(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,p=h.length;c<p;c++)i.push(h[c])}var d=null;if(a){var f=a.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(d=f),!a.isAnEndpoint(f)))for(var y=this._splitSafely(a,f),g=0,m=y.length;g<m;g++)i.push(y[g])}if(null!==l||null!==d){var v=null;if(null===l)v=d;else if(null===d)v=l;else{v=Tm.comparePoints(l,d)<=0?l:d}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(v),x=0,b=_.length;x<b;x++)i.push(_[x])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var w=s.getIntersection(a);if(null!==w){if(!s.isAnEndpoint(w))for(var S=this._splitSafely(s,w),C=0,T=S.length;C<T;C++)i.push(S[C]);if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),k=0,P=E.length;k<P;k++)i.push(E[k])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),t}(),Am="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Lm="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,zm=new(function(){function t(){am(this,t)}return um(t,[{key:"run",value:function(t,e,i){zm.type=t,mm.reset();for(var n=[new Rm(e,!0)],r=0,o=i.length;r<o;r++)n.push(new Rm(i[r],!1));if(zm.numMultiPolys=n.length,"difference"===zm.type)for(var s=n[0],a=1;a<n.length;)null!==cm(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===zm.type)for(var l=0,u=n.length;l<u;l++)for(var h=n[l],c=l+1,p=n.length;c<p;c++)if(null===cm(h.bbox,n[c].bbox))return[];for(var d=new nm(Tm.compare),f=0,y=n.length;f<y;f++)for(var g=n[f].getSweepEvents(),m=0,v=g.length;m<v;m++)if(d.insert(g[m]),d.size>Am)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new Mm(d),x=d.size,b=d.pop();b;){var w=b.key;if(d.size===x){var S=w.segment;throw new Error("Unable to pop() ".concat(w.isLeft?"left":"right"," SweepEvent ")+"[".concat(w.point.x,", ").concat(w.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Am)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Lm)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var C=_.process(w),T=0,E=C.length;T<E;T++){var k=C[T];void 0===k.consumedBy&&d.insert(k)}x=d.size,b=d.pop()}mm.reset();var P=Im.factory(_.segments);return new jm(P).getGeom()}}]),t}()),Dm=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return zm.run("union",t,i)};function Gm(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function Nm(t){return"Feature"===t.type?t.geometry:t}function Bm(t,e,i){void 0===i&&(i={});var n=Nm(t),r=Nm(e),o=Dm(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?function(t,e,i){void 0===i&&(i={});for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Gm({type:"Polygon",coordinates:t},e,i)}(o[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Gm({type:"MultiPolygon",coordinates:t},e,i)}(o,i.properties)}function Wm(t,e){const i=Dn(t),n=Math.round(100*i)/100;let r;return"m2"===e?r=n+" m²":"ha"===e&&(r=n/1e4+" ha"),r}function qm(t,e,i){const n=e.getExtent();return t.getView().fit(Yi(n,i))}function Vm(t,e){const[i,n,r]=Array.from(kr(t));return Sr([i,n,r,e])}const Um=new Cc,Xm=new Cc;function Km(t,e){const i=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,o=nr(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=o[0],(s<-180||s>180)&&(o[0]=De(s+180,360)-180),o).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,o,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:i,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,i=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>i.includes(t)||delete e[t]));const n=new Ta;n.readFeatures(t,{featureProjection:"EPSG:3857"}).forEach((t=>{const e=t.getProperties().TOID,i=Um.getFeatureById(e);i?Um.removeFeature(i):(t.setId(e),Um.addFeature(t))})),Xm.clear(),Xm.addFeature(n.readFeature(Um.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Bm(t,i):i}),null)))})).catch((t=>console.log(t)))}const Ym="© Crown copyright and database rights 2021 OS (0)100019252";var Zm,Hm=Object.freeze,$m=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,Qm=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?Jm(e,i):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&$m(e,i,o),o};let tv=class extends ht{constructor(){super(...arguments),this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.ariaLabel="Interactive map",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("#map"),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),n=(r=this.osVectorTilesApiKey,new dd({source:r?new Ag({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[Ym],attributionsCollapsible:!1,maxZoom:20}):new Dg({attributions:[zg]})}));var r;const o=function(t){let e=new pp({declutter:!0,source:new Xp({format:new Ll,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+t,attributions:[Ym],attributionsCollapsible:!1})});return t&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+t).then((t=>t.json())).then((t=>jg(e,t,"esri"))).catch((t=>console.log(t))),e}(this.osVectorTilesApiKey),s=new Zp({target:e,layers:[i?o:n],view:new Ls({projection:"EPSG:3857",extent:(l=[-10.76418,49.528423,1.9134116,61.331151],u="EPSG:4326",h="EPSG:3857",En(l,ir(u,h),void 0,c)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:Qn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:Zs({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(a=this.useScaleBarStyle,new Ys({units:"metric",bar:a,steps:4,text:!0,minWidth:140}))]:[]),interactions:Zc({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var a,l,u,h,c;const p=document.createElement("button");p.innerHTML="↻",p.title="Reset map view";p.addEventListener("click",(()=>{this.showFeaturesAtPoint?qm(s,Xm,this.featureBuffer):y.getFeatures().length>0?qm(s,y,this.geojsonBuffer):(s.getView().setCenter(Qn([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Xg.clear(),s.addInteraction(Yg),s.addInteraction(Zg))}),!1);const d=document.createElement("div");d.className="reset-control ol-unselectable ol-control",d.appendChild(p);var f=new ge({element:d});this.hideResetControl||s.addControl(f),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const y=new Cc;if("FeatureCollection"===this.geojsonData.type){let t=(new Ta).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});y.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Ta).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});y.addFeature(t)}const g=new ac({source:y,style:new rl({stroke:new Ka({color:this.geojsonColor,width:3}),fill:new Ea({color:this.geojsonFill?Vm(this.geojsonColor,.2):Vm(this.geojsonColor,0)})})});if(s.addLayer(g),y.getFeatures().length>0){qm(s,y,this.geojsonBuffer);const t=y.getFeatures()[0].getGeometry();console.log("geojsonData total area:",Wm(t,this.areaUnit))}if(this.drawMode&&(Xg.clear(),s.addLayer(Kg),s.addInteraction(Yg),s.addInteraction(Zg),s.addInteraction(Hg),Xg.on("change",(()=>{const t=Xg.getFeatures();if(t.length>0){const i=(e=t,"string"==typeof e?e[e.length-1]||"":e[e.length-1]).getGeometry();this.dispatch("geojsonChange",(new Ta).writeFeaturesObject(t,{featureProjection:"EPSG:3857"})),this.dispatch("areaChange",Wm(i,this.areaUnit)),s.removeInteraction(Yg),s.removeInteraction(Zg)}var e}))),this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Km(Qn([this.longitude,this.latitude]),this.osFeaturesApiKey),this.clickFeatures&&s.on("singleclick",(t=>{Km(t.coordinate,this.osFeaturesApiKey)}));const t=(m=this.featureColor,v=this.featureFill,new ac({source:Xm,style:new rl({stroke:new Ka({width:3,color:m}),fill:new Ea({color:Vm(m,v?.2:0)})})}));s.addLayer(t),Xm.on("change",(()=>{if("ready"===Xm.getState()&&Xm.getFeatures().length>0){qm(s,Xm,this.featureBuffer);const t=Xm.getFeatures()[0].getGeometry();console.log("feature(s) total area:",Wm(t,this.areaUnit))}}))}var m,v;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return q(Zm||(Zm=Hm($m(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="map" tabindex="0" aria-label='," />"],"raw",{value:Hm(e||t.slice())}))),this.ariaLabel);var t,e}};var ev;tv.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(t instanceof c)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return d(i)})`
|
41
|
+
var tm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function em(t,e){return t>e?1:t<e?-1:0}function im(t,e,i){for(var n=new tm(null,null),r=n,o=n;;){var s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,null===(e=a).left)break}o.left=e,o=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function nm(t,e,i,n){var r=new tm(t,e);if(null===i)return r.left=r.right=null,r;var o=n(t,(i=im(t,i,n)).key);return o<0?(r.left=i.left,r.right=i,i.left=null):o>=0&&(r.right=i.right,r.left=i,i.right=null),r}function rm(t,e,i){var n=null,r=null;if(e){var o=i((e=im(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function om(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&om(t.left,o,!1,n,r),t.right&&om(t.right,o,!0,n,r)}}var sm=function(){function t(t){void 0===t&&(t=em),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=nm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new tm(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=im(t,this._root,n),o=n(t,r.key);return 0===o?this._root=r:(o<0?(i.left=r.left,i.right=r,r.left=null):o>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=im(t,e,i)).key)?(null===e.left?n=e.right:(n=im(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=im(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=im(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],n=!1,r=new tm(null,null),o=r;for(;!n;)e?(i.push(e),e=e.left):i.length>0?e=(e=o=o.next=i.pop()).right:n=!0;return o.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&um(t,e,0,n-1,r),null===this._root)this._root=am(t,e,0,n),this._size=n;else{var o=function(t,e,i){var n=new tm(null,null),r=n,o=t,s=e;for(;null!==o&&null!==s;)i(o.key,s.key)<0?(r.next=o,o=o.next):(r.next=s,s=s.next),r=r.next;null!==o?r.next=o:null!==s&&(r.next=s);return n.next}(this.toList(),function(t,e){for(var i=new tm(null,null),n=i,r=0;r<t.length;r++)n=n.next=new tm(t[r],e[r]);return n.next=null,i.next}(t,e),r);n=this._size+n,this._root=lm({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return om(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=rm(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=nm(e,i,s,n):o=nm(e,i,o,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=im(t.key,e,i)).left=t),e)}(o,s,n)},t.prototype.split=function(t){return rm(t,this._root,this._comparator)},t}();function am(t,e,i,n){var r=n-i;if(r>0){var o=i+Math.floor(r/2),s=t[o],a=e[o],l=new tm(s,a);return l.left=am(t,e,i,o),l.right=am(t,e,o+1,n),l}return null}function lm(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=lm(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=lm(t,r+1,i),s}return null}function um(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}um(t,e,i,a,r),um(t,e,a+1,n,r)}}function hm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function pm(t,e,i){return e&&cm(t.prototype,e),i&&cm(t,i),t}var dm=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},fm=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},ym=Number.EPSILON;void 0===ym&&(ym=Math.pow(2,-52));var gm=ym*ym,mm=function(t,e){if(-ym<t&&t<ym&&-ym<e&&e<ym)return 0;var i=t-e;return i*i<gm*t*e?0:t<e?-1:1},vm=function(){function t(){hm(this,t),this.reset()}return pm(t,[{key:"reset",value:function(){this.xRounder=new _m,this.yRounder=new _m}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),_m=function(){function t(){hm(this,t),this.tree=new sm,this.round(0)}return pm(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===mm(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===mm(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),t}(),xm=new vm,bm=function(t,e){return t.x*e.y-t.y*e.x},wm=function(t,e){return t.x*e.x+t.y*e.y},Sm=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y},o=bm(n,r);return mm(o,0)},Cm=function(t){return Math.sqrt(wm(t,t))},Tm=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return wm(r,n)/Cm(r)/Cm(n)},Em=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},km=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},Pm=function(){function t(e,i){hm(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return pm(t,null,[{key:"compare",value:function(e,i){var n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:Rm.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),pm(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var r=this.point.events[n];void 0===r.consumedBy&&(i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var r,o,s,a,l,u=n.otherSE;i.set(n,{sine:(r=e.point,o=t.point,s=u.point,a={x:o.x-r.x,y:o.y-r.y},l={x:s.x-r.x,y:s.y-r.y},bm(l,a)/Cm(l)/Cm(a)),cosine:Tm(e.point,t.point,u.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var r=i.get(t),o=r.sine,s=r.cosine,a=i.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}}]),t}(),Om=0,Rm=function(){function t(e,i,n,r){hm(this,t),this.id=++Om,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=n,this.windings=r}return pm(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(r<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(r>o){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(r!==o){var g=l-s,m=r-i,v=u-a,_=o-n;if(g>m&&v<_)return 1;if(g<m&&v>_)return-1}return r>o?1:r<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),pm(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var r=(t.y-e.y)/n.y,o=e.x+r*n.x;if(t.x===o)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=fm(e,i);if(null===n)return null;var r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=dm(e,s)&&0===this.comparePoint(s),u=dm(i,r)&&0===t.comparePoint(r),h=dm(e,a)&&0===this.comparePoint(a),c=dm(i,o)&&0===t.comparePoint(o);if(u&&l)return c&&!h?o:!c&&h?a:null;if(u)return h&&r.x===a.x&&r.y===a.y?null:r;if(l)return c&&o.x===s.x&&o.y===s.y?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var p=function(t,e,i,n){if(0===e.x)return km(i,n,t.x);if(0===n.x)return km(t,e,i.x);if(0===e.y)return Em(i,n,t.y);if(0===n.y)return Em(t,e,i.y);var r=bm(e,n);if(0==r)return null;var o={x:i.x-t.x,y:i.y-t.y},s=bm(o,e)/r,a=bm(o,n)/r;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(r,this.vector(),s,t.vector());return null===p?null:dm(n,p)?xm.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],n=void 0!==e.events,r=new Pm(e,!0),o=new Pm(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);var a=new t(r,s,this.rings.slice(),this.windings.slice());return Pm.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Pm.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,n=e;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var r=t.compare(i,n);if(0!==r){if(r>0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var u=n.rings[a],h=n.windings[a],c=i.rings.indexOf(u);-1===c?(i.rings.push(u),i.windings.push(h)):i.windings[c]+=h}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,r=0,o=this.rings.length;r<o;r++){var s=this.rings[r],a=this.windings[r],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var u=[],h=[],c=0,p=e.length;c<p;c++)if(0!==i[c]){var d=e[c],f=d.poly;if(-1===h.indexOf(f))if(d.isExterior)u.push(f);else{-1===h.indexOf(f)&&h.push(f);var y=u.indexOf(d.poly);-1!==y&&u.splice(y,1)}}for(var g=0,m=u.length;g<m;g++){var v=u[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Nm.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===Nm.numMultiPolys&&r<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(Nm.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,n){var r,o,s,a=Pm.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=i,o=e,s=-1}return new t(new Pm(r,!0),new Pm(o,!1),[n],[s])}}]),t}(),Im=function(){function t(e,i,n){if(hm(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=xm.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var o=r,s=1,a=e.length;s<a;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=xm.round(e[s][0],e[s][1]);l.x===o.x&&l.y===o.y||(this.segments.push(Rm.fromRing(o,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}r.x===o.x&&r.y===o.y||this.segments.push(Rm.fromRing(o,r,this))}return pm(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),t}(),Fm=function(){function t(e,i){if(hm(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Im(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,r=e.length;n<r;n++){var o=new Im(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=i}return pm(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),jm=function(){function t(e,i){if(hm(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(s){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,r=e.length;n<r;n++){var o=new Fm(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=i}return pm(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),Mm=function(){function t(e){hm(this,t),this.events=e;for(var i=0,n=e.length;i<n;i++)e[i].segment.ringOut=this;this.poly=null}return pm(t,null,[{key:"factory",value:function(e){for(var i=[],n=0,r=e.length;n<r;n++){var o=e[n];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],h=a.point,c=[];s=a,a=l,u.push(a),a.point!==h;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var d=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var y=null,g=0,m=c.length;g<m;g++)if(c[g].point===a.point){y=g;break}if(null===y){c.push({index:u.length,point:a.point});var v=a.getLeftmostComparator(s);l=p.sort(v)[0].otherSE;break}var _=c.splice(y)[0],x=u.splice(_.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(u))}}return i}}]),pm(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var r=this.events[i].point,o=this.events[i+1].point;0!==Sm(r,t,o)&&(e.push(r),t=r)}if(1===e.length)return null;var s=e[0],a=e[1];0===Sm(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],p=u;p!=h;p+=l)c.push([e[p].x,e[p].y]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];Pm.compare(t,n)>0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),t}(),Am=function(){function t(e){hm(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return pm(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),t}(),Lm=function(){function t(e){hm(this,t),this.rings=e,this.polys=this._composePolys(e)}return pm(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(!r.poly)if(r.isExteriorRing())e.push(new Am(r));else{var o=r.enclosingRing();o.poly||e.push(new Am(o)),o.poly.addInterior(r)}}return e}}]),t}(),zm=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rm.compare;hm(this,t),this.queue=e,this.tree=new sm(i),this.segments=[]}return pm(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,p=h.length;c<p;c++)i.push(h[c])}var d=null;if(a){var f=a.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(d=f),!a.isAnEndpoint(f)))for(var y=this._splitSafely(a,f),g=0,m=y.length;g<m;g++)i.push(y[g])}if(null!==l||null!==d){var v=null;if(null===l)v=d;else if(null===d)v=l;else{v=Pm.comparePoints(l,d)<=0?l:d}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(v),x=0,b=_.length;x<b;x++)i.push(_[x])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var w=s.getIntersection(a);if(null!==w){if(!s.isAnEndpoint(w))for(var S=this._splitSafely(s,w),C=0,T=S.length;C<T;C++)i.push(S[C]);if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),k=0,P=E.length;k<P;k++)i.push(E[k])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),t}(),Dm="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Gm="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Nm=new(function(){function t(){hm(this,t)}return pm(t,[{key:"run",value:function(t,e,i){Nm.type=t,xm.reset();for(var n=[new jm(e,!0)],r=0,o=i.length;r<o;r++)n.push(new jm(i[r],!1));if(Nm.numMultiPolys=n.length,"difference"===Nm.type)for(var s=n[0],a=1;a<n.length;)null!==fm(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===Nm.type)for(var l=0,u=n.length;l<u;l++)for(var h=n[l],c=l+1,p=n.length;c<p;c++)if(null===fm(h.bbox,n[c].bbox))return[];for(var d=new sm(Pm.compare),f=0,y=n.length;f<y;f++)for(var g=n[f].getSweepEvents(),m=0,v=g.length;m<v;m++)if(d.insert(g[m]),d.size>Dm)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new zm(d),x=d.size,b=d.pop();b;){var w=b.key;if(d.size===x){var S=w.segment;throw new Error("Unable to pop() ".concat(w.isLeft?"left":"right"," SweepEvent ")+"[".concat(w.point.x,", ").concat(w.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Dm)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Gm)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var C=_.process(w),T=0,E=C.length;T<E;T++){var k=C[T];void 0===k.consumedBy&&d.insert(k)}x=d.size,b=d.pop()}xm.reset();var P=Mm.factory(_.segments);return new Lm(P).getGeom()}}]),t}()),Bm=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Nm.run("union",t,i)};function Wm(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function qm(t){return"Feature"===t.type?t.geometry:t}function Vm(t,e,i){void 0===i&&(i={});var n=qm(t),r=qm(e),o=Bm(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?function(t,e,i){void 0===i&&(i={});for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Wm({type:"Polygon",coordinates:t},e,i)}(o[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Wm({type:"MultiPolygon",coordinates:t},e,i)}(o,i.properties)}function Um(t,e){const i=Dn(t),n=Math.round(100*i)/100;let r;return"m2"===e?r=n+" m²":"ha"===e&&(r=n/1e4+" ha"),r}function Xm(t,e,i){const n=e.getExtent();return t.getView().fit(Yi(n,i))}function Km(t,e){const[i,n,r]=Array.from(kr(t));return Sr([i,n,r,e])}const Ym=new Cc,Zm=new Cc;function Hm(t,e){const i=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,o=nr(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=o[0],(s<-180||s>180)&&(o[0]=De(s+180,360)-180),o).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,o,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:i,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,i=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>i.includes(t)||delete e[t]));const n=new Ta;n.readFeatures(t,{featureProjection:"EPSG:3857"}).forEach((t=>{const e=t.getProperties().TOID,i=Ym.getFeatureById(e);i?Ym.removeFeature(i):(t.setId(e),Ym.addFeature(t))})),Zm.clear(),Zm.addFeature(n.readFeature(Ym.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Vm(t,i):i}),null)))})).catch((t=>console.log(t)))}const $m="© Crown copyright and database rights 2021 OS (0)100019252";var Jm,Qm=Object.freeze,tv=Object.defineProperty,ev=Object.getOwnPropertyDescriptor,iv=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?ev(e,i):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&tv(e,i,o),o};let nv=class extends ht{constructor(){super(...arguments),this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("#map"),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),n=(r=this.osVectorTilesApiKey,new dd({source:r?new Ag({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[$m],attributionsCollapsible:!1,maxZoom:20}):new Dg({attributions:[zg]})}));var r;const o=function(t){let e=new pp({declutter:!0,source:new Xp({format:new Ll,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+t,attributions:[$m],attributionsCollapsible:!1})});return t&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+t).then((t=>t.json())).then((t=>jg(e,t,"esri"))).catch((t=>console.log(t))),e}(this.osVectorTilesApiKey),s=new Zp({target:e,layers:[i?o:n],view:new Ls({projection:"EPSG:3857",extent:(l=[-10.76418,49.528423,1.9134116,61.331151],u="EPSG:4326",h="EPSG:3857",En(l,ir(u,h),void 0,c)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:Qn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:Zs({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(a=this.useScaleBarStyle,new Ys({units:"metric",bar:a,steps:4,text:!0,minWidth:140}))]:[]),interactions:Zc({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var a,l,u,h,c;const p=(d=this.drawPointer,new Mc({source:$g,type:"Polygon",style:new rl({stroke:Xg,fill:Kg,image:"crosshair"===d?Yg:Zg})}));var d;const f=function(t){return new Vc({source:$g,style:new rl({image:"crosshair"===t?Yg:Zg})})}(this.drawPointer),y=document.createElement("button");y.innerHTML="↻",y.title="Reset map view";y.addEventListener("click",(()=>{this.showFeaturesAtPoint?Xm(s,Zm,this.featureBuffer):v.getFeatures().length>0?Xm(s,v,this.geojsonBuffer):(s.getView().setCenter(Qn([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&($g.clear(),s.addInteraction(p),s.addInteraction(Qg))}),!1);const g=document.createElement("div");g.className="reset-control ol-unselectable ol-control",g.appendChild(y);var m=new ge({element:g});this.hideResetControl||s.addControl(m),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const v=new Cc;if("FeatureCollection"===this.geojsonData.type){let t=(new Ta).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});v.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Ta).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});v.addFeature(t)}const _=new ac({source:v,style:new rl({stroke:new Ka({color:this.geojsonColor,width:3}),fill:new Ea({color:this.geojsonFill?Km(this.geojsonColor,.2):Km(this.geojsonColor,0)})})});if(s.addLayer(_),v.getFeatures().length>0){Xm(s,v,this.geojsonBuffer);const t=v.getFeatures()[0].getGeometry();this.dispatch("geojsonDataArea",Um(t,this.areaUnit))}if(this.drawMode){const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Ta).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});$g.addFeature(t),Xm(s,$g,this.drawGeojsonDataBuffer)}else $g.clear();s.addLayer(Jg),t||s.addInteraction(p),s.addInteraction(f),s.addInteraction(Qg),$g.on("change",(()=>{const t=$g.getFeatures();if(t.length>0){const i=(e=t,"string"==typeof e?e[e.length-1]||"":e[e.length-1]).getGeometry();this.dispatch("geojsonChange",(new Ta).writeFeaturesObject(t,{featureProjection:"EPSG:3857"})),this.dispatch("areaChange",Um(i,this.areaUnit)),s.removeInteraction(p)}var e}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles&&(s.addLayer(Wg),Jg.setZIndex(1001),s.on("moveend",(()=>{s.getView().getZoom()<20?Bg.clear():setTimeout((()=>{Bg.clear();const t=s.getView().calculateExtent(s.getSize());qg(o,t)}),200)}))),this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Hm(Qn([this.longitude,this.latitude]),this.osFeaturesApiKey),this.clickFeatures&&s.on("singleclick",(t=>{Hm(t.coordinate,this.osFeaturesApiKey)}));const t=(x=this.featureColor,b=this.featureFill,new ac({source:Zm,style:new rl({stroke:new Ka({width:3,color:x}),fill:new Ea({color:Km(x,b?.2:0)})})}));s.addLayer(t),Zm.on("change",(()=>{if("ready"===Zm.getState()&&Zm.getFeatures().length>0){Xm(s,Zm,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Ta).writeFeaturesObject(Zm.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Zm.getFeatures()[0].getGeometry();this.dispatch("featuresAreaChange",Um(t,this.areaUnit))}}))}var x,b;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return q(Jm||(Jm=Qm(tv(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="map" tabindex="0" />'],"raw",{value:Qm(e||t.slice())}))));var t,e}};var rv;nv.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(t instanceof c)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return d(i)})`
|
42
42
|
:host {
|
43
43
|
display: block;
|
44
44
|
width: 800px;
|
@@ -52,7 +52,14 @@ var $g=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
|
|
52
52
|
overflow: hidden;
|
53
53
|
}
|
54
54
|
#map:focus {
|
55
|
-
outline: #
|
55
|
+
outline: #d3d3d3 solid 0.15em;
|
56
|
+
}
|
57
|
+
.ol-control button {
|
58
|
+
border-radius: 0 !important;
|
59
|
+
background-color: #2c2c2c !important;
|
60
|
+
}
|
61
|
+
.ol-control button:hover {
|
62
|
+
background-color: rgba(44, 44, 44, 0.85) !important;
|
56
63
|
}
|
57
64
|
.reset-control {
|
58
65
|
top: 70px;
|
@@ -65,4 +72,4 @@ var $g=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
|
|
65
72
|
z-index: 100;
|
66
73
|
background: white;
|
67
74
|
}
|
68
|
-
`,
|
75
|
+
`,iv([pt({type:Number})],nv.prototype,"latitude",2),iv([pt({type:Number})],nv.prototype,"longitude",2),iv([pt({type:Number})],nv.prototype,"zoom",2),iv([pt({type:Number})],nv.prototype,"minZoom",2),iv([pt({type:Number})],nv.prototype,"maxZoom",2),iv([pt({type:Boolean})],nv.prototype,"drawMode",2),iv([pt({type:Object})],nv.prototype,"drawGeojsonData",2),iv([pt({type:Number})],nv.prototype,"drawGeojsonDataBuffer",2),iv([pt({type:String})],nv.prototype,"drawPointer",2),iv([pt({type:Boolean})],nv.prototype,"showFeaturesAtPoint",2),iv([pt({type:Boolean})],nv.prototype,"clickFeatures",2),iv([pt({type:String})],nv.prototype,"featureColor",2),iv([pt({type:Boolean})],nv.prototype,"featureFill",2),iv([pt({type:Number})],nv.prototype,"featureBuffer",2),iv([pt({type:Object})],nv.prototype,"geojsonData",2),iv([pt({type:String})],nv.prototype,"geojsonColor",2),iv([pt({type:Boolean})],nv.prototype,"geojsonFill",2),iv([pt({type:Number})],nv.prototype,"geojsonBuffer",2),iv([pt({type:Boolean})],nv.prototype,"disableVectorTiles",2),iv([pt({type:String})],nv.prototype,"osVectorTilesApiKey",2),iv([pt({type:String})],nv.prototype,"osFeaturesApiKey",2),iv([pt({type:Boolean})],nv.prototype,"hideResetControl",2),iv([pt({type:Boolean})],nv.prototype,"staticMode",2),iv([pt({type:String})],nv.prototype,"areaUnit",2),iv([pt({type:Boolean})],nv.prototype,"showScale",2),iv([pt({type:Boolean})],nv.prototype,"useScaleBarStyle",2),nv=iv([(rv="my-map",t=>{return"function"==typeof t?(e=rv,i=t,window.customElements.define(e,i),i):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){window.customElements.define(t,e)}}})(rv,t);var e,i})],nv);export{nv as MyMap};
|