summaryrefslogtreecommitdiff
path: root/ishtar_common/static/ol/ol.js
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/static/ol/ol.js')
-rw-r--r--ishtar_common/static/ol/ol.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/ishtar_common/static/ol/ol.js b/ishtar_common/static/ol/ol.js
index 8ed611d3d..a7daef0a6 100644
--- a/ishtar_common/static/ol/ol.js
+++ b/ishtar_common/static/ol/ol.js
@@ -1,8 +1,3 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ol=e():t.ol=e()}(window,function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=9)}([function(t,e,i){"use strict";t.exports=n,t.exports.default=n;var r=i(5);function n(t,e){if(!(this instanceof n))return new n(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,r,n){n||(n=y(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o,s=e;s<i;s++)o=t.children[s],h(n,t.leaf?r(o):o);return n}function h(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 l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function p(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function f(t,e){var i=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,o-r)}function _(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,n,o){for(var s,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(s=e+Math.ceil((i-e)/n/2)*n,r(t,s,e,i,o),a.push(e,s,s,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!g(t,e))return i;for(var n,o,s,a,h=[];e;){for(n=0,o=e.children.length;n<o;n++)s=e.children[n],g(t,a=e.leaf?r(s):s)&&(e.leaf?i.push(s):_(t,a)?this._all(s,i):h.push(s));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!g(t,e))return!1;for(var r,n,o,s,a=[];e;){for(r=0,n=e.children.length;r<n;r++)if(o=e.children[r],g(t,s=e.leaf?i(o):o)){if(e.leaf||_(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=y([]),this},remove:function(t,e){if(!t)return this;for(var i,r,n,s,a=this.data,h=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],i=u.pop(),s=!0),a.leaf&&-1!==(n=o(t,a.children,e)))return a.children.splice(n,1),l.push(a),this._condense(l),this;s||a.leaf||!_(a,h)?r?(i++,a=r.children[i],s=!1):a=null:(l.push(a),u.push(i),i=0,r=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,r){var n,o=i-e+1,a=this._maxEntries;if(o<=a)return s(n=y(t.slice(e,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(n=y([])).leaf=!1,n.height=r;var h,l,u,p,c=Math.ceil(o/a),d=c*Math.ceil(Math.sqrt(a));for(v(t,e,i,d,this.compareMinX),h=e;h<=i;h+=d)for(v(t,h,u=Math.min(h+d-1,i),c,this.compareMinY),l=h;l<=u;l+=c)p=Math.min(l+c-1,u),n.children.push(this._build(t,l,p,r-1));return s(n,this.toBBox),n},_chooseSubtree:function(t,e,i,r){for(var n,o,s,a,h,l,u,c;r.push(e),!e.leaf&&r.length-1!==i;){for(u=c=1/0,n=0,o=e.children.length;n<o;n++)h=p(s=e.children[n]),(l=d(t,s)-h)<c?(c=l,u=h<u?h:u,a=s):l===c&&h<u&&(u=h,a=s);e=a||e.children[0]}return e},_insert:function(t,e,i){var r=this.toBBox,n=i?t:r(t),o=[],s=this._chooseSubtree(n,this.data,e,o);for(s.children.push(t),h(s,n);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},_split:function(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var o=this._chooseSplitIndex(i,n,r),a=y(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,n,o,s,h,l,u,c;for(l=u=1/0,r=e;r<=i-e;r++)s=f(n=a(t,0,r,this.toBBox),o=a(t,r,i,this.toBBox)),h=p(n)+p(o),s<l?(l=s,c=r,u=h<u?h:u):s===l&&h<u&&(u=h,c=r);return c},_chooseSplitAxis:function(t,e,i){var r=t.leaf?this.compareMinX:l,n=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,n)&&t.children.sort(r)},_allDistMargin:function(t,e,i,r){t.children.sort(r);var n,o,s=this.toBBox,l=a(t,0,e,s),u=a(t,i-e,i,s),p=c(l)+c(u);for(n=e;n<i-e;n++)o=t.children[n],h(l,t.leaf?s(o):o),p+=c(l);for(n=i-e-1;n>=e;n--)o=t.children[n],h(u,t.leaf?s(o):o),p+=c(u);return p},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)h(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():s(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,e,i){"use strict";t.exports=n;var r=i(6);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;function o(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function a(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function h(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function l(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function c(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function d(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function f(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function _(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function v(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function m(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=m(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(n=o[i.pos++],r=(112&n)>>4,n<128)return s(t,r,e);if(n=o[i.pos++],r|=(127&n)<<3,n<128)return s(t,r,e);if(n=o[i.pos++],r|=(127&n)<<10,n<128)return s(t,r,e);if(n=o[i.pos++],r|=(127&n)<<17,n<128)return s(t,r,e);if(n=o[i.pos++],r|=(127&n)<<24,n<128)return s(t,r,e);if(n=o[i.pos++],r|=(1&n)<<31,n<128)return s(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,i){var r="",n=e;for(;n<i;){var o,s,a,h=t[n],l=null,u=h>239?4:h>223?3:h>191?2:1;if(n+u>i)break;1===u?h<128&&(l=h):2===u?128==(192&(o=t[n+1]))&&(l=(31&h)<<6|63&o)<=127&&(l=null):3===u?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((l=(15&h)<<12|(63&o)<<6|63&s)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((l=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=u}return r}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.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),v(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),v(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+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}(r,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 r,n,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&a(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.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 r=this.pos-i;r>=128&&a(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,n.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){this.writeMessage(t,h,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,c,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,_,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,g,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,i){var r=i(7);e.Processor=r},,,function(t,e,i){t.exports=function(){"use strict";function t(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function e(t,e){return t<e?-1:t>e?1:0}return function(i,r,n,o,s){!function e(i,r,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,h=r-n+1,l=Math.log(a),u=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*u*(a-u)/a)*(h-a/2<0?-1:1),c=Math.max(n,Math.floor(r-h*u/a+p)),d=Math.min(o,Math.floor(r+(a-h)*u/a+p));e(i,r,c,d,s)}var f=i[r],_=n,g=o;for(t(i,n,r),s(i[o],f)>0&&t(i,n,o);_<g;){for(t(i,_,g),_++,g--;s(i[_],f)<0;)_++;for(;s(i[g],f)>0;)g--}0===s(i[n],f)?t(i,n,g):t(i,++g,o),g<=r&&(n=g+1),r<=g&&(o=g-1)}}(i,r,n||0,o||i.length-1,s||e)}}()},function(t,e){e.read=function(t,e,i,r,n){var o,s,a=8*n-r-1,h=(1<<a)-1,l=h>>1,u=-7,p=i?n-1:0,c=i?-1:1,d=t[e+p];for(p+=c,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+t[e+p],p+=c,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+t[e+p],p+=c,u-=8);if(0===o)o=1-l;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=l}return(d?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,i,r,n,o){var s,a,h,l=8*o-n-1,u=(1<<l)-1,p=u>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,_=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=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+p>=1?c/h:c*Math.pow(2,1-p))*h>=2&&(s++,h/=2),s+p>=u?(a=0,s=u):s+p>=1?(a=(e*h-1)*Math.pow(2,n),s+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;t[i+d]=255&a,d+=f,a/=256,n-=8);for(s=s<<n|a,l+=n;l>0;t[i+d]=255&s,d+=f,s/=256,l-=8);t[i+d-f]|=128*_}},function(t,e,i){var r=i(8).newImageData;function n(t){var e=!0;try{new ImageData(10,10)}catch(t){e=!1}function i(t,i,r){return e?new ImageData(t,i,r):{data:t,width:i,height:r}}return function(e){var r,n,o=e.buffers,s=e.meta,a=e.imageOps,h=e.width,l=e.height,u=o.length,p=o[0].byteLength;if(a){var c=new Array(u);for(n=0;n<u;++n)c[n]=i(new Uint8ClampedArray(o[n]),h,l);r=t(c,s).data}else{r=new Uint8ClampedArray(p);var d=new Array(u),f=new Array(u);for(n=0;n<u;++n)d[n]=new Uint8ClampedArray(o[n]),f[n]=[0,0,0,0];for(var _=0;_<p;_+=4){for(var g=0;g<u;++g){var y=d[g];f[g][0]=y[_],f[g][1]=y[_+1],f[g][2]=y[_+2],f[g][3]=y[_+3]}var v=t(f,s);r[_]=v[0],r[_+1]=v[1],r[_+2]=v[2],r[_+3]=v[3]}}return r.buffer}}function o(t,e){var i=Object.keys(t.lib||{}).map(function(e){return"var "+e+" = "+t.lib[e].toString()+";"}).concat(["var __minion__ = ("+n.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Blob(i,{type:"text/javascript"}),o=URL.createObjectURL(r),s=new Worker(o);return s.addEventListener("message",e),s}function s(t){var e;this._imageOps=!!t.imageOps;var i=[];if(e=0===t.threads?0:this._imageOps?1:t.threads||1)for(var r=0;r<e;++r)i[r]=o(t,this._onWorkerMessage.bind(this,r));else i[0]=function(t,e){var i=n(t.operation);return{postMessage:function(t){setTimeout(function(){e({data:{buffer:i(t),meta:t.meta}})},0)}}}(t,this._onWorkerMessage.bind(this,0));this._workers=i,this._queue=[],this._maxQueueLength=t.queue||1/0,this._running=0,this._dataLookup={},this._job=null}s.prototype.process=function(t,e,i){this._enqueue({inputs:t,meta:e,callback:i}),this._dispatch()},s.prototype.destroy=function(){for(var t in this)this[t]=null;this._destroyed=!0},s.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},s.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._job=this._queue.shift(),e=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map(function(t){return t.data.buffer}),n=this._workers.length;if(this._running=n,1===n)this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:e,height:i},r);else for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/n),a=0;a<n;++a){for(var h=a*s,l=[],u=0,p=r.length;u<p;++u)l.push(r[a].slice(h,h+s));this._workers[a].postMessage({buffers:l,meta:t.meta,imageOps:this._imageOps,width:e,height:i},l)}}},s.prototype._onWorkerMessage=function(t,e){this._destroyed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},s.prototype._resolveJob=function(){var t,e,i=this._job,n=this._workers.length;if(1===n)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var o=i.inputs[0].data.length;t=new Uint8ClampedArray(o),e=new Array(o);for(var s=4*Math.ceil(o/4/n),a=0;a<n;++a){var h=this._dataLookup[a].buffer,l=a*s;t.set(new Uint8ClampedArray(h),l),e[a]=this._dataLookup[a].meta}}this._job=null,this._dataLookup={},i.callback(null,r(t,i.inputs[0].width,i.inputs[0].height),e),this._dispatch()},t.exports=s},function(t,e){var i=!0;try{new ImageData(10,10)}catch(t){i=!1}var r=document.createElement("canvas").getContext("2d");e.newImageData=function(t,e,n){if(i)return new ImageData(t,e,n);var o=r.createImageData(e,n);return o.data.set(t),o}},function(t,e,i){"use strict";function r(){return function(){throw new Error("Unimplemented abstract method.")}()}i.r(e);var n=0;function o(t){return t.ol_uid||(t.ol_uid=String(++n))}var s="5.3.0",a=function(t){function e(e){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===s?s:"v"+s.split("-")[0])+"/doc/errors/#"+e+" for details.";t.call(this,i),this.code=e,this.name="AssertionError",this.message=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),h={ADD:"add",REMOVE:"remove"},l="propertychange",u="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,o=arguments.length;n<o;++n){var s=i[n];if(void 0!==s&&null!==s)for(var a in s)s.hasOwnProperty(a)&&(r[a]=s[a])}return r};function p(t){for(var e in t)delete t[e]}function c(t){var e=[];for(var i in t)e.push(t[i]);return e}function d(t){var e;for(e in t)return!1;return!e}function f(t,e,i,r){for(var n,o=0,s=t.length;o<s;++o)if((n=t[o]).listener===e&&n.bindTo===i)return r&&(n.deleteIndex=o),n}function _(t,e){var i=g(t);return i?i[e]:void 0}function g(t,e){var i=t.ol_lm;return!i&&e&&(i=t.ol_lm={}),i}function y(t,e){var i=_(t,e);if(i){for(var r=0,n=i.length;r<n;++r)t.removeEventListener(e,i[r].boundListener),p(i[r]);i.length=0;var o=g(t);o&&(delete o[e],0===Object.keys(o).length&&function(t){delete t.ol_lm}(t))}}function v(t,e,i,r,n){var o=g(t,!0),s=o[e];s||(s=o[e]=[]);var a=f(s,i,r,!1);return a?n||(a.callOnce=!1):(a={bindTo:r,callOnce:!!n,listener:i,target:t,type:e},t.addEventListener(e,function(t){var e=function(e){var i=t.listener,r=t.bindTo||t.target;return t.callOnce&&E(t),i.call(r,e)};return t.boundListener=e,e}(a)),s.push(a)),a}function m(t,e,i,r){return v(t,e,i,r,!0)}function x(t,e,i,r){var n=_(t,e);if(n){var o=f(n,i,r,!0);o&&E(o)}}function E(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var e=_(t.target,t.type);if(e){var i="deleteIndex"in t?t.deleteIndex:e.indexOf(t);-1!==i&&e.splice(i,1),0===e.length&&y(t.target,t.type)}p(t)}}function S(t){var e=g(t);if(e)for(var i in e)y(t,i)}var T=function(){this.disposed_=!1};T.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},T.prototype.disposeInternal=function(){};var C=T;function R(){return!0}function w(){return!1}function I(){}var L=function(t){this.propagationStopped,this.type=t,this.target=null};function O(t){t.stopPropagation()}L.prototype.preventDefault=function(){this.propagationStopped=!0},L.prototype.stopPropagation=function(){this.propagationStopped=!0};var P=L,b=function(t){function e(){t.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addEventListener=function(t,e){var i=this.listeners_[t];i||(i=this.listeners_[t]=[]),-1===i.indexOf(e)&&i.push(e)},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new P(t):t,i=e.type;e.target=this;var r,n=this.listeners_[i];if(n){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var o=0,s=n.length;o<s;++o)if(!1===n[o].call(this,e)||e.propagationStopped){r=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var a=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];a--;)this.removeEventListener(i,I);delete this.dispatching_[i]}return r}},e.prototype.disposeInternal=function(){S(this)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},e.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var r=i.indexOf(e);t in this.pendingRemovals_?(i[r]=I,++this.pendingRemovals_[t]):(i.splice(r,1),0===i.length&&delete this.listeners_[t])}},e}(C),M={CHANGE:"change",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"};var F=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent(M.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=v(this,t[n],e);return r}return v(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=m(this,t[n],e);return r}return m(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var i=0,r=t.length;i<r;++i)x(this,t[i],e);else x(this,t,e)},e}(b),A=function(t){function e(e,i,r){t.call(this,e),this.key=i,this.oldValue=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),N={};function G(t){return N.hasOwnProperty(t)?N[t]:N[t]="change:"+t}var D=function(t){function e(e){t.call(this),o(this),this.values_={},void 0!==e&&this.setProperties(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return Object.keys(this.values_)},e.prototype.getProperties=function(){return u({},this.values_)},e.prototype.notify=function(t,e){var i;i=G(t),this.dispatchEvent(new A(i,t,e)),i=l,this.dispatchEvent(new A(i,t,e))},e.prototype.set=function(t,e,i){if(i)this.values_[t]=e;else{var r=this.values_[t];this.values_[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.unset=function(t,e){if(t in this.values_){var i=this.values_[t];delete this.values_[t],e||this.notify(t,i)}},e}(F),k="length",j=function(t){function e(e,i){t.call(this,e),this.element=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),U=function(t){function e(e,i){t.call(this);var r=i||{};if(this.unique_=!!r.unique,this.array_=e||[],this.unique_)for(var n=0,o=this.array_.length;n<o;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(k)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new j(h.ADD,e))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new j(h.REMOVE,e)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new j(h.REMOVE,r)),this.dispatchEvent(new j(h.ADD,e))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(k,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===t&&i!==e)throw new a(58)},e}(D);function Y(t,e){if(!t)throw new a(e)}var B=function(t){function e(e){if(t.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,v(this,G(this.geometryName_),this.handleGeometryChanged_,this),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;this.setGeometry(i)}else{var r=e;this.setProperties(r)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(E(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=v(t,M.CHANGE,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;if(Array.isArray(t))e=t;else{Y("function"==typeof t.getZIndex,41);var i=t;e=[i]}return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){x(this,G(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,v(this,G(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},e}(D);function V(t,e){return t>e?1:t<e?-1:0}function X(t,e){return t.indexOf(e)>=0}function z(t,e,i){var r,n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;if(i>0){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return n-1}function W(t,e,i){for(;e<i;){var r=t[e];t[e]=t[i],t[i]=r,++e,--i}}function K(t,e){for(var i=Array.isArray(e)?e:[e],r=i.length,n=0;n<r;n++)t[t.length]=i[n]}function H(t,e){for(var i,r=t.length>>>0,n=0;n<r;n++)if(e(i=t[n],n,t))return i;return null}function Z(t,e){var i=t.length;if(i!==e.length)return!1;for(var r=0;r<i;r++)if(t[r]!==e[r])return!1;return!0}function q(t,e){var i,r=t.length,n=Array(t.length);for(i=0;i<r;i++)n[i]={index:i,value:t[i]};for(n.sort(function(t,i){return e(t.value,i.value)||t.index-i.index}),i=0;i<t.length;i++)t[i]=n[i].value}function J(t,e){var i;return!t.every(function(r,n){return i=n,!e(r,n,t)})?i:-1}var Q={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},$={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function tt(t){for(var e=ht(),i=0,r=t.length;i<r;++i)_t(e,t[i]);return e}function et(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function it(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function rt(t,e,i){var r,n;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function nt(t,e){return st(t,e[0],e[1])}function ot(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function st(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function at(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],s=e[0],a=e[1],h=$.UNKNOWN;return s<i?h|=$.LEFT:s>n&&(h|=$.RIGHT),a<r?h|=$.BELOW:a>o&&(h|=$.ABOVE),h===$.UNKNOWN&&(h=$.INTERSECTING),h}function ht(){return[1/0,1/0,-1/0,-1/0]}function lt(t,e,i,r,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=r,n):[t,e,i,r]}function ut(t){return lt(1/0,1/0,-1/0,-1/0,t)}function pt(t,e){var i=t[0],r=t[1];return lt(i,r,i,r,e)}function ct(t,e,i,r,n){return yt(ut(n),t,e,i,r)}function dt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ft(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function _t(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function gt(t,e){for(var i=0,r=e.length;i<r;++i)_t(t,e[i]);return t}function yt(t,e,i,r,n){for(;i<r;i+=n)vt(t,e[i],e[i+1]);return t}function vt(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function mt(t,e,i){var r;return(r=e.call(i,Et(t)))?r:(r=e.call(i,St(t)))?r:(r=e.call(i,Lt(t)))?r:(r=e.call(i,It(t)))||!1}function xt(t){var e=0;return bt(t)||(e=Ot(t)*Rt(t)),e}function Et(t){return[t[0],t[1]]}function St(t){return[t[2],t[1]]}function Tt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Ct(t,e,i,r,n){var o=e*r[0]/2,s=e*r[1]/2,a=Math.cos(i),h=Math.sin(i),l=o*a,u=o*h,p=s*a,c=s*h,d=t[0],f=t[1],_=d-l+c,g=d-l-c,y=d+l-c,v=d+l+c,m=f-u-p,x=f-u+p,E=f+u+p,S=f+u-p;return lt(Math.min(_,g,y,v),Math.min(m,x,E,S),Math.max(_,g,y,v),Math.max(m,x,E,S),n)}function Rt(t){return t[3]-t[1]}function wt(t,e,i){var r=i||[1/0,1/0,-1/0,-1/0];return Pt(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):ut(r),r}function It(t){return[t[0],t[3]]}function Lt(t){return[t[2],t[3]]}function Ot(t){return t[2]-t[0]}function Pt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function bt(t){return t[2]<t[0]||t[3]<t[1]}function Mt(t,e){var i=(t[2]-t[0])/2*(e-1),r=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=r,t[3]+=r}function Ft(t,e,i){var r=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(r,r,2),function(t,e,i){return lt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],i)}var At={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},Nt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};function Gt(t,e,i,r,n,o){for(var s=o||[],a=0,h=e;h<i;h+=r){var l=t[h],u=t[h+1];s[a++]=n[0]*l+n[2]*u+n[4],s[a++]=n[1]*l+n[3]*u+n[5]}return o&&s.length!=a&&(s.length=a),s}function Dt(t,e,i,r,n,o,s){for(var a=s||[],h=0,l=e;l<i;l+=r){a[h++]=t[l]+n,a[h++]=t[l+1]+o;for(var u=l+2;u<l+r;++u)a[h++]=t[u]}return s&&a.length!=h&&(a.length=h),a}function kt(t,e,i){return Math.min(Math.max(t,e),i)}var jt="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function Ut(t,e,i,r,n,o){var s=n-i,a=o-r;if(0!==s||0!==a){var h=((t-i)*s+(e-r)*a)/(s*s+a*a);h>1?(i=n,r=o):h>0&&(i+=s*h,r+=a*h)}return Yt(t,e,i,r)}function Yt(t,e,i,r){var n=i-t,o=r-e;return n*n+o*o}function Bt(t){return 180*t/Math.PI}function Vt(t){return t*Math.PI/180}function Xt(t,e){var i=t%e;return i*e<0?i+e:i}function zt(t,e,i){return t+i*(e-t)}
-/**
- * @license
- * Latitude/longitude spherical geodesy formulae taken from
- * http://www.movable-type.co.uk/scripts/latlong.html
- * Licensed under CC-BY-3.0.
- */var Wt=6371008.8;function Kt(t,e,i){var r=i||Wt,n=Vt(t[1]),o=Vt(e[1]),s=(o-n)/2,a=Vt(e[0]-t[0])/2,h=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}function Ht(t,e){for(var i=0,r=0,n=t.length;r<n-1;++r)i+=Kt(t[r],t[r+1],e);return i}function Zt(t,e){for(var i=0,r=t.length,n=t[r-1][0],o=t[r-1][1],s=0;s<r;s++){var a=t[s][0],h=t[s][1];i+=Vt(a-n)*(2+Math.sin(Vt(o))+Math.sin(Vt(h))),n=a,o=h}return i*e*e/2}function qt(t,e,i,r){var n=r||Wt,o=Vt(t[1]),s=Vt(t[0]),a=e/n,h=Math.asin(Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(i));return[Bt(s+Math.atan2(Math.sin(i)*Math.sin(a)*Math.cos(o),Math.cos(a)-Math.sin(o)*Math.sin(h))),Bt(h)]}var Jt={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Qt={};Qt[Jt.DEGREES]=2*Math.PI*6370997/360,Qt[Jt.FEET]=.3048,Qt[Jt.METERS]=1,Qt[Jt.USFEET]=1200/3937;var $t=Jt,te=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit};te.prototype.canWrapX=function(){return this.canWrapX_},te.prototype.getCode=function(){return this.code_},te.prototype.getExtent=function(){return this.extent_},te.prototype.getUnits=function(){return this.units_},te.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Qt[this.units_]},te.prototype.getWorldExtent=function(){return this.worldExtent_},te.prototype.getAxisOrientation=function(){return this.axisOrientation_},te.prototype.isGlobal=function(){return this.global_},te.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},te.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},te.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},te.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},te.prototype.setWorldExtent=function(t){this.worldExtent_=t},te.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},te.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var ee=te,ie=6378137,re=Math.PI*ie,ne=[-re,-re,re,re],oe=[-180,-85,180,85],se=function(t){function e(e){t.call(this,{code:e,units:$t.METERS,extent:ne,global:!0,worldExtent:oe,getPointResolution:function(t,e){return t/jt(e[1]/ie)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ee),ae=[new se("EPSG:3857"),new se("EPSG:102100"),new se("EPSG:102113"),new se("EPSG:900913"),new se("urn:ogc:def:crs:EPSG:6.18:3:3857"),new se("urn:ogc:def:crs:EPSG::3857"),new se("http://www.opengis.net/gml/srs/epsg.xml#3857")];function he(t,e,i){var r=t.length,n=i>1?i:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(r));for(var s=re,a=0;a<r;a+=n){o[a]=s*t[a]/180;var h=ie*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));h>s?h=s:h<-s&&(h=-s),o[a+1]=h}return o}function le(t,e,i){var r=t.length,n=i>1?i:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(r));for(var s=0;s<r;s+=n)o[s]=180*t[s]/re,o[s+1]=360*Math.atan(Math.exp(t[s+1]/ie))/Math.PI-90;return o}var ue=[-180,-90,180,90],pe=6378137*Math.PI/180,ce=function(t){function e(e,i){t.call(this,{code:e,units:$t.DEGREES,extent:ue,axisOrientation:i,global:!0,metersPerUnit:pe,worldExtent:ue})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ee),de=[new ce("CRS:84"),new ce("EPSG:4326","neu"),new ce("urn:ogc:def:crs:EPSG::4326","neu"),new ce("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new ce("urn:ogc:def:crs:OGC:1.3:CRS84"),new ce("urn:ogc:def:crs:OGC:2:84"),new ce("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ce("urn:x-ogc:def:crs:EPSG:4326","neu")],fe={};var _e={};function ge(t,e,i){var r=t.getCode(),n=e.getCode();r in _e||(_e[r]={}),_e[r][n]=i}function ye(t,e){var i;return t in _e&&e in _e[t]&&(i=_e[t][e]),i}function ve(t,e,i){var r;if(void 0!==e){for(var n=0,o=t.length;n<o;++n)e[n]=t[n];r=e}else r=t.slice();return r}function me(t,e,i){if(void 0!==e&&t!==e){for(var r=0,n=t.length;r<n;++r)e[r]=t[r];t=e}return t}function xe(t){!function(t,e){fe[t]=e}(t.getCode(),t),ge(t,t,ve)}function Ee(t){return"string"==typeof t?function(t){return fe[t]||null}(t):t||null}function Se(t,e,i,r){var n,o=(t=Ee(t)).getPointResolutionFunc();if(o)n=o(e,i);else if(t.getUnits()==$t.DEGREES&&!r||r==$t.DEGREES)n=e;else{var s=Le(t,Ee("EPSG:4326")),a=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(Kt((a=s(a,a,2)).slice(0,2),a.slice(2,4))+Kt(a.slice(4,6),a.slice(6,8)))/2;var h=r?Qt[r]:t.getMetersPerUnit();void 0!==h&&(n/=h)}return n}function Te(t){!function(t){t.forEach(xe)}(t),t.forEach(function(e){t.forEach(function(t){e!==t&&ge(e,t,ve)})})}function Ce(t,e){return t?"string"==typeof t?Ee(t):t:Ee(e)}function Re(t){return function(e,i,r){for(var n=e.length,o=void 0!==r?r:2,s=void 0!==i?i:new Array(n),a=0;a<n;a+=o){var h=t([e[a],e[a+1]]);s[a]=h[0],s[a+1]=h[1];for(var l=o-1;l>=2;--l)s[a+l]=e[a+l]}return s}}function we(t,e,i,r){var n=Ee(t),o=Ee(e);ge(n,o,Re(i)),ge(o,n,Re(r))}function Ie(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?i:Le(t,e)===ve&&i}function Le(t,e){var i=ye(t.getCode(),e.getCode());return i||(i=me),i}function Oe(t,e){return Le(Ee(t),Ee(e))}function Pe(t,e,i){return Oe(e,i)(t,void 0,t.length)}function be(t,e,i){return Ft(t,Oe(e,i))}Te(ae),Te(de),function(t,e,i,r){t.forEach(function(t){e.forEach(function(e){ge(t,e,i),ge(e,t,r)})})}(de,ae,he,le);var Me=new Array(6);function Fe(t){return Ne(t,1,0,0,1,0,0)}function Ae(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],h=e[0],l=e[1],u=e[2],p=e[3],c=e[4],d=e[5];return t[0]=i*h+n*l,t[1]=r*h+o*l,t[2]=i*u+n*p,t[3]=r*u+o*p,t[4]=i*c+n*d+s,t[5]=r*c+o*d+a,t}function Ne(t,e,i,r,n,o,s){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=o,t[5]=s,t}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function De(t,e){var i=e[0],r=e[1];return e[0]=t[0]*i+t[2]*r+t[4],e[1]=t[1]*i+t[3]*r+t[5],e}function ke(t,e){var i=Math.cos(e),r=Math.sin(e);return Ae(t,Ne(Me,i,r,-r,i,0,0))}function je(t,e,i){return Ae(t,Ne(Me,e,0,0,i,0,0))}function Ue(t,e,i){return Ae(t,Ne(Me,1,0,0,1,e,i))}function Ye(t,e,i,r,n,o,s,a){var h=Math.sin(o),l=Math.cos(o);return t[0]=r*l,t[1]=n*h,t[2]=-r*h,t[3]=n*l,t[4]=s*r*l-a*r*h+e,t[5]=s*n*h+a*n*l+i,t}function Be(t){var e=function(t){return t[0]*t[3]-t[1]*t[2]}(t);Y(0!==e,32);var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5];return t[0]=o/e,t[1]=-r/e,t[2]=-n/e,t[3]=i/e,t[4]=(n*a-o*s)/e,t[5]=-(i*a-r*s)/e,t}var Ve=[1,0,0,1,0,0],Xe=function(t){function e(){t.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return r()},e.prototype.closestPointXY=function(t,e,i,n){return r()},e.prototype.containsXY=function(t,e){return!1},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return r()},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){r()},e.prototype.scale=function(t,e,i){r()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return r()},e.prototype.getType=function(){return r()},e.prototype.applyTransform=function(t){r()},e.prototype.intersectsExtent=function(t){return r()},e.prototype.translate=function(t,e){r()},e.prototype.transform=function(t,e){var i=Ee(t),r=i.getUnits()==$t.TILE_PIXELS?function(t,r,n){var o=i.getExtent(),s=i.getWorldExtent(),a=Rt(s)/Rt(o);return Ye(Ve,s[0],s[3],a,-a,0,0,0),Gt(t,0,t.length,n,Ve,r),Oe(i,e)(t,r,n)}:Oe(i,e);return this.applyTransform(r),this},e}(D);function ze(t){var e;return t==At.XY?e=2:t==At.XYZ||t==At.XYM?e=3:t==At.XYZM&&(e=4),e}var We=function(t){function e(){t.call(this),this.layout=At.XY,this.stride=2,this.flatCoordinates=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeExtent=function(t){return ct(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return r()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(p(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];var i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[e]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=ze(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){r()},e.prototype.setLayout=function(t,e,i){var r;if(t)r=ze(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=At.XY,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=At.XY:3==t?e=At.XYZ:4==t&&(e=At.XYZM);return e}(r=e.length)}this.layout=t,this.stride=r},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(t,e,i,r,n,o,s){for(var a=s||[],h=Math.cos(n),l=Math.sin(n),u=o[0],p=o[1],c=0,d=e;d<i;d+=r){var f=t[d]-u,_=t[d+1]-p;a[c++]=u+f*h-_*l,a[c++]=p+f*l+_*h;for(var g=d+2;g<d+r;++g)a[c++]=t[g]}s&&a.length!=c&&(a.length=c)}(i,0,i.length,r,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var r=e;void 0===r&&(r=t);var n=i;n||(n=Tt(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,i,r,n,o,s,a){for(var h=a||[],l=s[0],u=s[1],p=0,c=e;c<i;c+=r){var d=t[c]-l,f=t[c+1]-u;h[p++]=l+n*d,h[p++]=u+o*f;for(var _=c+2;_<c+r;++_)h[p++]=t[_]}a&&h.length!=p&&(h.length=p)}(o,0,o.length,s,t,r,n,o),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Dt(i,0,i.length,r,t,e,i),this.changed()}},e}(Xe);function Ke(t,e,i,r){for(var n=0,o=t[i-r],s=t[i-r+1];e<i;e+=r){var a=t[e],h=t[e+1];n+=s*a-o*h,o=a,s=h}return n/2}function He(t,e,i,r){for(var n=0,o=0,s=i.length;o<s;++o){var a=i[o];n+=Ke(t,e,a,r),e=a}return n}function Ze(t,e,i,r,n,o,s){var a,h=t[e],l=t[e+1],u=t[i]-h,p=t[i+1]-l;if(0===u&&0===p)a=e;else{var c=((n-h)*u+(o-l)*p)/(u*u+p*p);if(c>1)a=i;else{if(c>0){for(var d=0;d<r;++d)s[d]=zt(t[e+d],t[i+d],c);return void(s.length=r)}a=e}}for(var f=0;f<r;++f)s[f]=t[a+f];s.length=r}function qe(t,e,i,r,n){var o=t[e],s=t[e+1];for(e+=r;e<i;e+=r){var a=t[e],h=t[e+1],l=Yt(o,s,a,h);l>n&&(n=l),o=a,s=h}return n}function Je(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];n=qe(t,e,a,r,n),e=a}return n}function Qe(t,e,i,r,n,o,s,a,h,l,u){if(e==i)return l;var p,c;if(0===n){if((c=Yt(s,a,t[e],t[e+1]))<l){for(p=0;p<r;++p)h[p]=t[e+p];return h.length=r,c}return l}for(var d=u||[NaN,NaN],f=e+r;f<i;)if(Ze(t,f-r,f,r,s,a,d),(c=Yt(s,a,d[0],d[1]))<l){for(l=c,p=0;p<r;++p)h[p]=d[p];h.length=r,f+=r}else f+=r*Math.max((Math.sqrt(c)-Math.sqrt(l))/n|0,1);if(o&&(Ze(t,i-r,e,r,s,a,d),(c=Yt(s,a,d[0],d[1]))<l)){for(l=c,p=0;p<r;++p)h[p]=d[p];h.length=r}return l}function $e(t,e,i,r,n,o,s,a,h,l,u){for(var p=u||[NaN,NaN],c=0,d=i.length;c<d;++c){var f=i[c];l=Qe(t,e,f,r,n,o,s,a,h,l,p),e=f}return l}function ti(t,e,i,r){for(var n=0,o=i.length;n<o;++n)t[e++]=i[n];return e}function ei(t,e,i,r){for(var n=0,o=i.length;n<o;++n)for(var s=i[n],a=0;a<r;++a)t[e++]=s[a];return e}function ii(t,e,i,r,n){for(var o=n||[],s=0,a=0,h=i.length;a<h;++a){var l=ei(t,e,i[a],r);o[s++]=l,e=l}return o.length=s,o}function ri(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=e;a<i;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function ni(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];o[s++]=ri(t,e,l,r,o[s]),e=l}return o.length=s,o}function oi(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];o[s++]=ni(t,e,l,r,o[s]),e=l[l.length-1]}return o.length=s,o}function si(t,e,i,r,n,o,s){var a=(i-e)/r;if(a<3){for(;e<i;e+=r)o[s++]=t[e],o[s++]=t[e+1];return s}var h=new Array(a);h[0]=1,h[a-1]=1;for(var l=[e,i-r],u=0;l.length>0;){for(var p=l.pop(),c=l.pop(),d=0,f=t[c],_=t[c+1],g=t[p],y=t[p+1],v=c+r;v<p;v+=r){var m=Ut(t[v],t[v+1],f,_,g,y);m>d&&(u=v,d=m)}d>n&&(h[(u-e)/r]=1,c+r<u&&l.push(c,u),u+r<p&&l.push(u,p))}for(var x=0;x<a;++x)h[x]&&(o[s++]=t[e+x*r],o[s++]=t[e+x*r+1]);return s}function ai(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=si(t,e,u,r,n,o,s),a.push(s),e=u}return s}function hi(t,e){return e*Math.round(t/e)}function li(t,e,i,r,n,o,s){if(e==i)return s;var a,h,l=hi(t[e],n),u=hi(t[e+1],n);e+=r,o[s++]=l,o[s++]=u;do{if(a=hi(t[e],n),h=hi(t[e+1],n),(e+=r)==i)return o[s++]=a,o[s++]=h,s}while(a==l&&h==u);for(;e<i;){var p=hi(t[e],n),c=hi(t[e+1],n);if(e+=r,p!=a||c!=h){var d=a-l,f=h-u,_=p-l,g=c-u;d*g==f*_&&(d<0&&_<d||d==_||d>0&&_>d)&&(f<0&&g<f||f==g||f>0&&g>f)?(a=p,h=c):(o[s++]=a,o[s++]=h,l=a,u=h,a=p,h=c)}}return o[s++]=a,o[s++]=h,s}function ui(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=li(t,e,u,r,n,o,s),a.push(s),e=u}return s}var pi=function(t){function e(e,i){t.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?this.setCoordinates(e,i):this.setFlatCoordinates(i,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,r){return r<rt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(qe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Qe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.getArea=function(){return Ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return ri(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=si(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,At.XY)},e.prototype.getType=function(){return Nt.LINEAR_RING},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ei(this.flatCoordinates,0,t,this.stride),this.changed()},e}(We),ci=function(t){function e(e,i){t.call(this),this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=Yt(t,e,n[0],n[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)i[a]=n[a];return i.length=s,o}return r},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return pt(this.flatCoordinates,t)},e.prototype.getType=function(){return Nt.POINT},e.prototype.intersectsExtent=function(t){return st(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ti(this.flatCoordinates,0,t,this.stride),this.changed()},e}(We);function di(t,e,i,r,n){return!mt(n,function(n){return!fi(t,e,i,r,n[0],n[1])})}function fi(t,e,i,r,n,o){for(var s=0,a=t[i-r],h=t[i-r+1];e<i;e+=r){var l=t[e],u=t[e+1];h<=o?u>o&&(l-a)*(o-h)-(n-a)*(u-h)>0&&s++:u<=o&&(l-a)*(o-h)-(n-a)*(u-h)<0&&s--,a=l,h=u}return 0!==s}function _i(t,e,i,r,n,o){if(0===i.length)return!1;if(!fi(t,e,i[0],r,n,o))return!1;for(var s=1,a=i.length;s<a;++s)if(fi(t,i[s-1],i[s],r,n,o))return!1;return!0}function gi(t,e,i,r,n,o,s){for(var a,h,l,u,p,c,d,f=n[o+1],_=[],g=0,y=i.length;g<y;++g){var v=i[g];for(u=t[v-r],c=t[v-r+1],a=e;a<v;a+=r)p=t[a],d=t[a+1],(f<=c&&d<=f||c<=f&&f<=d)&&(l=(f-c)/(d-c)*(p-u)+u,_.push(l)),u=p,c=d}var m=NaN,x=-1/0;for(_.sort(V),u=_[0],a=1,h=_.length;a<h;++a){p=_[a];var E=Math.abs(p-u);E>x&&_i(t,e,i,r,l=(u+p)/2,f)&&(m=l,x=E),u=p}return isNaN(m)&&(m=n[o]),s?(s.push(m,f,x),s):[m,f,x]}function yi(t,e,i,r,n){for(var o=[],s=0,a=i.length;s<a;++s){var h=i[s];o=gi(t,e,h,r,n,2*s,o),e=h[h.length-1]}return o}function vi(t,e,i,r,n,o){for(var s,a=[t[e],t[e+1]],h=[];e+r<i;e+=r){if(h[0]=t[e+r],h[1]=t[e+r+1],s=n.call(o,a,h))return s;a[0]=h[0],a[1]=h[1]}return!1}function mi(t,e,i,r,n){var o=yt([1/0,1/0,-1/0,-1/0],t,e,i,r);return!!Pt(n,o)&&(!!ot(n,o)||(o[0]>=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||vi(t,e,i,r,function(t,e){return function(t,e,i){var r=!1,n=at(t,e),o=at(t,i);if(n===$.INTERSECTING||o===$.INTERSECTING)r=!0;else{var s,a,h=t[0],l=t[1],u=t[2],p=t[3],c=e[0],d=e[1],f=i[0],_=i[1],g=(_-d)/(f-c);o&$.ABOVE&&!(n&$.ABOVE)&&(r=(s=f-(_-p)/g)>=h&&s<=u),r||!(o&$.RIGHT)||n&$.RIGHT||(r=(a=_-(f-u)*g)>=l&&a<=p),r||!(o&$.BELOW)||n&$.BELOW||(r=(s=f-(_-l)/g)>=h&&s<=u),r||!(o&$.LEFT)||n&$.LEFT||(r=(a=_-(f-h)*g)>=l&&a<=p)}return r}(n,t,e)}))))}function xi(t,e,i,r,n){if(!function(t,e,i,r,n){return!!(mi(t,e,i,r,n)||fi(t,e,i,r,n[0],n[1])||fi(t,e,i,r,n[0],n[3])||fi(t,e,i,r,n[2],n[1])||fi(t,e,i,r,n[2],n[3]))}(t,e,i[0],r,n))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o<s;++o)if(di(t,i[o-1],i[o],r,n)&&!mi(t,i[o-1],i[o],r,n))return!1;return!0}function Ei(t,e,i,r){for(;e<i-r;){for(var n=0;n<r;++n){var o=t[e+n];t[e+n]=t[i-r+n],t[i-r+n]=o}e+=r,i-=r}}function Si(t,e,i,r){for(var n=0,o=t[i-r],s=t[i-r+1];e<i;e+=r){var a=t[e],h=t[e+1];n+=(a-o)*(h+s),o=a,s=h}return n>0}function Ti(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s<a;++s){var h=i[s],l=Si(t,e,h,r);if(0===s){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=h}return!0}function Ci(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s<a;++s){var h=i[s],l=Si(t,e,h,r);(0===s?o&&l||!o&&!l:o&&!l||!o&&l)&&Ei(t,e,h,r),e=h}return e}function Ri(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o)e=Ci(t,e,i[o],r,n);return e}var wi=function(t){function e(e,i,r){t.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&r?(this.setFlatCoordinates(i,e),this.ends_=r):this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendLinearRing=function(t){this.flatCoordinates?K(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,i,r){return r<rt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Je(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$e(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.containsXY=function(t,e){return _i(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return He(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ci(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ni(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Tt(this.getExtent());this.flatInteriorPoint_=gi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ci(this.getFlatInteriorPoint(),At.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new pi(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,r=[],n=0,o=0,s=i.length;o<s;++o){var a=i[o],h=new pi(e.slice(n,a),t);r.push(h),n=a}return r},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Ti(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ci(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=ui(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,r),new e(i,At.XY,r)},e.prototype.getType=function(){return Nt.POLYGON},e.prototype.intersectsExtent=function(t){return xi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=ii(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(We),Ii=wi;function Li(t,e,i,r){for(var n=i||32,o=[],s=0;s<n;++s)K(o,qt(t,e,2*Math.PI*s/n,r));return o.push(o[0],o[1]),new wi(o,At.XY,[o.length])}function Oi(t){var e=t[0],i=t[1],r=t[2],n=t[3],o=[e,i,e,n,r,n,r,i,e,i];return new wi(o,At.XY,[o.length])}function Pi(t,e,i){for(var r=e||32,n=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=n*(r+1),h=new Array(a),l=0;l<a;l+=n){h[l]=0,h[l+1]=0;for(var u=2;u<n;u++)h[l+u]=s[u]}var p=[h.length],c=new wi(h,o,p);return bi(c,s,t.getRadius(),i),c}function bi(t,e,i,r){for(var n=t.getFlatCoordinates(),o=t.getStride(),s=n.length/o-1,a=r||0,h=0;h<=s;++h){var l=h*o,u=a+2*Xt(h,s)*Math.PI/s;n[l]=e[0]+i*Math.cos(u),n[l+1]=e[1]+i*Math.sin(u)}t.changed()}var Mi="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Fi=-1!==Mi.indexOf("firefox"),Ai=-1!==Mi.indexOf("safari")&&-1==Mi.indexOf("chrom"),Ni=-1!==Mi.indexOf("webkit")&&-1==Mi.indexOf("edge"),Gi=-1!==Mi.indexOf("macintosh"),Di=window.devicePixelRatio||1,ki=function(){var t=!1;try{t=!!document.createElement("canvas").getContext("2d").setLineDash}catch(t){}return t}(),ji="geolocation"in navigator,Ui="ontouchstart"in window,Yi="PointerEvent"in window,Bi=!!navigator.msPointerEnabled,Vi={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},Xi=function(t){function e(e){t.call(this,M.ERROR),this.code=e.code,this.message=e.message}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),zi=function(t){function e(e){t.call(this);var i=e||{};this.position_=null,this.transform_=me,this.watchId_=void 0,v(this,G(Vi.PROJECTION),this.handleProjectionChanged_,this),v(this,G(Vi.TRACKING),this.handleTrackingChanged_,this),void 0!==i.projection&&this.setProjection(i.projection),void 0!==i.trackingOptions&&this.setTrackingOptions(i.trackingOptions),this.setTracking(void 0!==i.tracking&&i.tracking)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.setTracking(!1),t.prototype.disposeInternal.call(this)},e.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=Le(Ee("EPSG:4326"),t),this.position_&&this.set(Vi.POSITION,this.transform_(this.position_)))},e.prototype.handleTrackingChanged_=function(){if(ji){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},e.prototype.positionChange_=function(t){var e=t.coords;this.set(Vi.ACCURACY,e.accuracy),this.set(Vi.ALTITUDE,null===e.altitude?void 0:e.altitude),this.set(Vi.ALTITUDE_ACCURACY,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(Vi.HEADING,null===e.heading?void 0:Vt(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var i=this.transform_(this.position_);this.set(Vi.POSITION,i),this.set(Vi.SPEED,null===e.speed?void 0:e.speed);var r=Li(this.position_,e.accuracy);r.applyTransform(this.transform_),this.set(Vi.ACCURACY_GEOMETRY,r),this.changed()},e.prototype.positionError_=function(t){this.setTracking(!1),this.dispatchEvent(new Xi(t))},e.prototype.getAccuracy=function(){return this.get(Vi.ACCURACY)},e.prototype.getAccuracyGeometry=function(){return this.get(Vi.ACCURACY_GEOMETRY)||null},e.prototype.getAltitude=function(){return this.get(Vi.ALTITUDE)},e.prototype.getAltitudeAccuracy=function(){return this.get(Vi.ALTITUDE_ACCURACY)},e.prototype.getHeading=function(){return this.get(Vi.HEADING)},e.prototype.getPosition=function(){return this.get(Vi.POSITION)},e.prototype.getProjection=function(){return this.get(Vi.PROJECTION)},e.prototype.getSpeed=function(){return this.get(Vi.SPEED)},e.prototype.getTracking=function(){return this.get(Vi.TRACKING)},e.prototype.getTrackingOptions=function(){return this.get(Vi.TRACKING_OPTIONS)},e.prototype.setProjection=function(t){this.set(Vi.PROJECTION,Ee(t))},e.prototype.setTracking=function(t){this.set(Vi.TRACKING,t)},e.prototype.setTrackingOptions=function(t){this.set(Vi.TRACKING_OPTIONS,t)},e}(D);function Wi(t,e,i){var r=void 0!==i?t.toFixed(i):""+t,n=r.indexOf(".");return(n=-1===n?r.length:n)>e?r:new Array(1+e-n).join("0")+r}function Ki(t,e){for(var i=(""+t).split("."),r=(""+e).split("."),n=0;n<Math.max(i.length,r.length);n++){var o=parseInt(i[n]||"0",10),s=parseInt(r[n]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}function Hi(t,e){return t[0]+=e[0],t[1]+=e[1],t}function Zi(t,e){var i,r,n=t[0],o=t[1],s=e[0],a=e[1],h=s[0],l=s[1],u=a[0],p=a[1],c=u-h,d=p-l,f=0===c&&0===d?0:(c*(n-h)+d*(o-l))/(c*c+d*d||0);return f<=0?(i=h,r=l):f>=1?(i=u,r=p):(i=h+f*c,r=l+f*d),[i,r]}function qi(t,e,i){var r=Xt(e+180,360)-180,n=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),a=Math.floor(n/3600),h=Math.floor((n-3600*a)/60),l=n-3600*a-60*h;return(l=Math.ceil(l*s)/s)>=60&&(l=0,h+=1),h>=60&&(h=0,a+=1),a+"° "+Wi(h,2)+"′ "+Wi(l,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function Ji(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function Qi(t,e){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){i=!1;break}return i}function $i(t,e){var i=Math.cos(e),r=Math.sin(e),n=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=n,t[1]=o,t}function tr(t,e){return t[0]*=e,t[1]*=e,t}function er(t,e){var i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function ir(t,e){return Math.sqrt(er(t,e))}function rr(t,e){return er(t,Zi(t,e))}function nr(t,e){return Ji(t,"{x}, {y}",e)}function or(t,e,i,r,n,o){var s=NaN,a=NaN,h=(i-e)/r;if(1===h)s=t[e],a=t[e+1];else if(2==h)s=(1-n)*t[e]+n*t[e+r],a=(1-n)*t[e+1]+n*t[e+r+1];else if(0!==h){for(var l=t[e],u=t[e+1],p=0,c=[0],d=e+r;d<i;d+=r){var f=t[d],_=t[d+1];p+=Math.sqrt((f-l)*(f-l)+(_-u)*(_-u)),c.push(p),l=f,u=_}var g=n*p,y=function(t,e,i){for(var r,n,o=i||V,s=0,a=t.length,h=!1;s<a;)(n=+o(t[r=s+(a-s>>1)],e))<0?s=r+1:(a=r,h=!n);return h?s:~s}(c,g);if(y<0){var v=(g-c[-y-2])/(c[-y-1]-c[-y-2]),m=e+(-y-2)*r;s=zt(t[m],t[m+r],v),a=zt(t[m+1],t[m+r+1],v)}else s=t[e+y*r],a=t[e+y*r+1]}return o?(o[0]=s,o[1]=a,o):[s,a]}function sr(t,e,i,r,n,o){if(i==e)return null;var s;if(n<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=n,s):null;if(t[i-1]<n)return o?((s=t.slice(i-r,i))[r-1]=n,s):null;if(n==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,h=i/r;a<h;){var l=a+h>>1;n<t[(l+1)*r-1]?h=l:a=l+1}var u=t[a*r-1];if(n==u)return t.slice((a-1)*r,(a-1)*r+r);var p=(n-u)/(t[(a+1)*r-1]-u);s=[];for(var c=0;c<r-1;++c)s.push(zt(t[(a-1)*r+c],t[a*r+c],p));return s.push(n),s}function ar(t,e,i,r){for(var n=t[e],o=t[e+1],s=0,a=e+r;a<i;a+=r){var h=t[a],l=t[a+1];s+=Math.sqrt((h-n)*(h-n)+(l-o)*(l-o)),n=h,o=l}return s}var hr=function(t){function e(e,i){t.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?this.setCoordinates(e,i):this.setFlatCoordinates(i,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendCoordinate=function(t){this.flatCoordinates?K(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,r){return r<rt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(qe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Qe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))},e.prototype.forEachSegment=function(t){return vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=At.XYM&&this.layout!=At.XYZM)return null;var i=void 0!==e&&e;return sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return ri(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},e.prototype.getLength=function(){return ar(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=si(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,At.XY)},e.prototype.getType=function(){return Nt.LINE_STRING},e.prototype.intersectsExtent=function(t){return mi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ei(this.flatCoordinates,0,t,this.stride),this.changed()},e}(We);function lr(t,e,i){for(var r,n,o,s,a,h,l=[],u=t(0),p=t(1),c=e(u),d=e(p),f=[p,u],_=[d,c],g=[1,0],y={},v=1e5;--v>0&&g.length>0;)o=g.pop(),u=f.pop(),c=_.pop(),(h=o.toString())in y||(l.push(c[0],c[1]),y[h]=!0),s=g.pop(),p=f.pop(),d=_.pop(),Ut((n=e(r=t(a=(o+s)/2)))[0],n[1],c[0],c[1],d[0],d[1])<i?(l.push(d[0],d[1]),y[h=s.toString()]=!0):(g.push(s,a,a,o),_.push(d,n,n,c),f.push(p,r,r,u));return l}var ur={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render",RENDERCOMPLETE:"rendercomplete"},pr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,cr=/^([a-z]*)$/i;function dr(t){return"string"==typeof t?t:yr(t)}var fr=function(){var t={},e=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(e>=1024){var n=0;for(var o in t)0==(3&n++)&&(delete t[o],--e)}r=function(t){var e,i,r,n,o;cr.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t));if(pr.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var h=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),r=parseInt(t.substr(1+2*s,s),16),n=h?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,r=(r<<4)+r,h&&(n=(n<<4)+n)),o=[e,i,r,n/255]}else 0==t.indexOf("rgba(")?gr(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),gr(o)):Y(!1,14);return o}(i),t[i]=r,++e}return r}}();function _r(t){return Array.isArray(t)?t:fr(t)}function gr(t){return t[0]=kt(t[0]+.5|0,0,255),t[1]=kt(t[1]+.5|0,0,255),t[2]=kt(t[2]+.5|0,0,255),t[3]=kt(t[3],0,1),t}function yr(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+i+","+r+","+(void 0===t[3]?1:t[3])+")"}var vr=function(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.checksum_=void 0};vr.prototype.clone=function(){var t=this.getColor();return new vr({color:Array.isArray(t)?t.slice():t||void 0})},vr.prototype.getColor=function(){return this.color_},vr.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},vr.prototype.getChecksum=function(){if(void 0===this.checksum_){var t=this.color_;t?Array.isArray(t)||"string"==typeof t?this.checksum_="f"+dr(t):this.checksum_=o(this.color_):this.checksum_="f-"}return this.checksum_};var mr=vr,xr=function(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width,this.checksum_=void 0};xr.prototype.clone=function(){var t=this.getColor();return new xr({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},xr.prototype.getColor=function(){return this.color_},xr.prototype.getLineCap=function(){return this.lineCap_},xr.prototype.getLineDash=function(){return this.lineDash_},xr.prototype.getLineDashOffset=function(){return this.lineDashOffset_},xr.prototype.getLineJoin=function(){return this.lineJoin_},xr.prototype.getMiterLimit=function(){return this.miterLimit_},xr.prototype.getWidth=function(){return this.width_},xr.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},xr.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},xr.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},xr.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},xr.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},xr.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},xr.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},xr.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=o(this.color_):this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var Er=xr,Sr="point",Tr="line",Cr=function(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new mr({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Sr,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding};Cr.prototype.clone=function(){return new Cr({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0})},Cr.prototype.getOverflow=function(){return this.overflow_},Cr.prototype.getFont=function(){return this.font_},Cr.prototype.getMaxAngle=function(){return this.maxAngle_},Cr.prototype.getPlacement=function(){return this.placement_},Cr.prototype.getOffsetX=function(){return this.offsetX_},Cr.prototype.getOffsetY=function(){return this.offsetY_},Cr.prototype.getFill=function(){return this.fill_},Cr.prototype.getRotateWithView=function(){return this.rotateWithView_},Cr.prototype.getRotation=function(){return this.rotation_},Cr.prototype.getScale=function(){return this.scale_},Cr.prototype.getStroke=function(){return this.stroke_},Cr.prototype.getText=function(){return this.text_},Cr.prototype.getTextAlign=function(){return this.textAlign_},Cr.prototype.getTextBaseline=function(){return this.textBaseline_},Cr.prototype.getBackgroundFill=function(){return this.backgroundFill_},Cr.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},Cr.prototype.getPadding=function(){return this.padding_},Cr.prototype.setOverflow=function(t){this.overflow_=t},Cr.prototype.setFont=function(t){this.font_=t},Cr.prototype.setMaxAngle=function(t){this.maxAngle_=t},Cr.prototype.setOffsetX=function(t){this.offsetX_=t},Cr.prototype.setOffsetY=function(t){this.offsetY_=t},Cr.prototype.setPlacement=function(t){this.placement_=t},Cr.prototype.setFill=function(t){this.fill_=t},Cr.prototype.setRotation=function(t){this.rotation_=t},Cr.prototype.setScale=function(t){this.scale_=t},Cr.prototype.setStroke=function(t){this.stroke_=t},Cr.prototype.setText=function(t){this.text_=t},Cr.prototype.setTextAlign=function(t){this.textAlign_=t},Cr.prototype.setTextBaseline=function(t){this.textBaseline_=t},Cr.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},Cr.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},Cr.prototype.setPadding=function(t){this.padding_=t};var Rr=Cr,wr=new Er({color:"rgba(0,0,0,0.2)"}),Ir=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],Lr=function(t){var e=t||{};this.map_=null,this.postcomposeListenerKey_=null,this.projection_=null,this.maxLat_=1/0,this.maxLon_=1/0,this.minLat_=-1/0,this.minLon_=-1/0,this.maxLatP_=1/0,this.maxLonP_=1/0,this.minLatP_=-1/0,this.minLonP_=-1/0,this.targetSize_=void 0!==e.targetSize?e.targetSize:100,this.maxLines_=void 0!==e.maxLines?e.maxLines:100,this.meridians_=[],this.parallels_=[],this.strokeStyle_=void 0!==e.strokeStyle?e.strokeStyle:wr,this.fromLonLatTransform_=void 0,this.toLonLatTransform_=void 0,this.projectionCenterLonLat_=null,this.meridiansLabels_=null,this.parallelsLabels_=null,1==e.showLabels&&(this.lonLabelFormatter_=void 0==e.lonLabelFormatter?qi.bind(this,"EW"):e.lonLabelFormatter,this.latLabelFormatter_=void 0==e.latLabelFormatter?qi.bind(this,"NS"):e.latLabelFormatter,this.lonLabelPosition_=void 0==e.lonLabelPosition?0:e.lonLabelPosition,this.latLabelPosition_=void 0==e.latLabelPosition?1:e.latLabelPosition,this.lonLabelStyle_=void 0!==e.lonLabelStyle?e.lonLabelStyle:new Rr({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new mr({color:"rgba(0,0,0,1)"}),stroke:new Er({color:"rgba(255,255,255,1)",width:3})}),this.latLabelStyle_=void 0!==e.latLabelStyle?e.latLabelStyle:new Rr({font:"12px Calibri,sans-serif",textAlign:"end",fill:new mr({color:"rgba(0,0,0,1)"}),stroke:new Er({color:"rgba(255,255,255,1)",width:3})}),this.meridiansLabels_=[],this.parallelsLabels_=[]),this.intervals_=void 0!==e.intervals?e.intervals:Ir,this.setMap(void 0!==e.map?e.map:null)};Lr.prototype.addMeridian_=function(t,e,i,r,n,o){var s=this.getMeridian_(t,e,i,r,o);if(Pt(s.getExtent(),n)){if(this.meridiansLabels_){var a=this.getMeridianPoint_(s,n,o);this.meridiansLabels_[o]={geom:a,text:this.lonLabelFormatter_(t)}}this.meridians_[o++]=s}return o},Lr.prototype.getMeridianPoint_=function(t,e,i){var r,n=t.getFlatCoordinates(),o=Math.max(e[1],n[1]),s=Math.min(e[3],n[n.length-1]),a=kt(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,o,s),h=[n[0],a];return i in this.meridiansLabels_?(r=this.meridiansLabels_[i].geom).setCoordinates(h):r=new ci(h),r},Lr.prototype.addParallel_=function(t,e,i,r,n,o){var s=this.getParallel_(t,e,i,r,o);if(Pt(s.getExtent(),n)){if(this.parallelsLabels_){var a=this.getParallelPoint_(s,n,o);this.parallelsLabels_[o]={geom:a,text:this.latLabelFormatter_(t)}}this.parallels_[o++]=s}return o},Lr.prototype.getParallelPoint_=function(t,e,i){var r,n=t.getFlatCoordinates(),o=Math.max(e[0],n[0]),s=Math.min(e[2],n[n.length-2]),a=[kt(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,o,s),n[1]];return i in this.parallelsLabels_?(r=this.parallelsLabels_[i].geom).setCoordinates(a):r=new ci(a),r},Lr.prototype.createGraticule_=function(t,e,i,r){var n=this.getInterval_(i);if(-1==n)return this.meridians_.length=this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var o,s,a,h,l=this.toLonLatTransform_(e),u=l[0],p=l[1],c=this.maxLines_,d=[Math.max(t[0],this.minLonP_),Math.max(t[1],this.minLatP_),Math.min(t[2],this.maxLonP_),Math.min(t[3],this.maxLatP_)],f=(d=be(d,this.projection_,"EPSG:4326"))[3],_=d[2],g=d[1],y=d[0];for(h=kt(u=Math.floor(u/n)*n,this.minLon_,this.maxLon_),s=this.addMeridian_(h,g,f,r,t,0),o=0;h!=this.minLon_&&o++<c;)h=Math.max(h-n,this.minLon_),s=this.addMeridian_(h,g,f,r,t,s);for(h=kt(u,this.minLon_,this.maxLon_),o=0;h!=this.maxLon_&&o++<c;)h=Math.min(h+n,this.maxLon_),s=this.addMeridian_(h,g,f,r,t,s);for(this.meridians_.length=s,this.meridiansLabels_&&(this.meridiansLabels_.length=s),a=kt(p=Math.floor(p/n)*n,this.minLat_,this.maxLat_),s=this.addParallel_(a,y,_,r,t,0),o=0;a!=this.minLat_&&o++<c;)a=Math.max(a-n,this.minLat_),s=this.addParallel_(a,y,_,r,t,s);for(a=kt(p,this.minLat_,this.maxLat_),o=0;a!=this.maxLat_&&o++<c;)a=Math.min(a+n,this.maxLat_),s=this.addParallel_(a,y,_,r,t,s);this.parallels_.length=s,this.parallelsLabels_&&(this.parallelsLabels_.length=s)},Lr.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1],r=-1,n=Math.pow(this.targetSize_*t,2),o=[],s=[],a=0,h=this.intervals_.length;a<h;++a){var l=this.intervals_[a]/2;if(o[0]=e-l,o[1]=i-l,s[0]=e+l,s[1]=i+l,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(s,s),Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)<=n)break;r=this.intervals_[a]}return r},Lr.prototype.getMap=function(){return this.map_},Lr.prototype.getMeridian_=function(t,e,i,r,n){var o=function(t,e,i,r,n){return lr(function(r){return[t,e+(i-e)*r]},Oe(Ee("EPSG:4326"),r),n)}(t,e,i,this.projection_,r),s=this.meridians_[n];return s?(s.setFlatCoordinates(At.XY,o),s.changed()):s=this.meridians_[n]=new hr(o,At.XY),s},Lr.prototype.getMeridians=function(){return this.meridians_},Lr.prototype.getParallel_=function(t,e,i,r,n){var o=function(t,e,i,r,n){return lr(function(r){return[e+(i-e)*r,t]},Oe(Ee("EPSG:4326"),r),n)}(t,e,i,this.projection_,r),s=this.parallels_[n];return s?(s.setFlatCoordinates(At.XY,o),s.changed()):s=new hr(o,At.XY),s},Lr.prototype.getParallels=function(){return this.parallels_},Lr.prototype.handlePostCompose_=function(t){var e,i,r,n,o=t.vectorContext,s=t.frameState,a=s.extent,h=s.viewState,l=h.center,u=h.projection,p=h.resolution,c=s.pixelRatio,d=p*p/(4*c*c);for((!this.projection_||!Ie(this.projection_,u))&&this.updateProjectionInfo_(u),this.createGraticule_(a,l,p,d),o.setFillStrokeStyle(null,this.strokeStyle_),e=0,i=this.meridians_.length;e<i;++e)r=this.meridians_[e],o.drawGeometry(r);for(e=0,i=this.parallels_.length;e<i;++e)r=this.parallels_[e],o.drawGeometry(r);if(this.meridiansLabels_)for(e=0,i=this.meridiansLabels_.length;e<i;++e)n=this.meridiansLabels_[e],this.lonLabelStyle_.setText(n.text),o.setTextStyle(this.lonLabelStyle_),o.drawGeometry(n.geom);if(this.parallelsLabels_)for(e=0,i=this.parallelsLabels_.length;e<i;++e)n=this.parallelsLabels_[e],this.latLabelStyle_.setText(n.text),o.setTextStyle(this.latLabelStyle_),o.drawGeometry(n.geom)},Lr.prototype.updateProjectionInfo_=function(t){var e=Ee("EPSG:4326"),i=t.getWorldExtent(),r=be(i,e,t);this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0],this.maxLatP_=r[3],this.maxLonP_=r[2],this.minLatP_=r[1],this.minLonP_=r[0],this.fromLonLatTransform_=Oe(e,t),this.toLonLatTransform_=Oe(t,e),this.projectionCenterLonLat_=this.toLonLatTransform_(Tt(t.getExtent())),this.projection_=t},Lr.prototype.setMap=function(t){this.map_&&(E(this.postcomposeListenerKey_),this.postcomposeListenerKey_=null,this.map_.render()),t&&(this.postcomposeListenerKey_=v(t,ur.POSTCOMPOSE,this.handlePostCompose_,this),t.render()),this.map_=t};var Or=Lr,Pr=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};Pr.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},Pr.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},Pr.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 r=this.points_[e+2]-this.points_[i+2];if(r<1e3/60)return!1;var n=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,n),this.initialVelocity_=Math.sqrt(n*n+o*o)/r,this.initialVelocity_>this.minVelocity_},Pr.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},Pr.prototype.getAngle=function(){return this.angle_};var br=Pr,Mr=function(t){function e(e,i,r){t.call(this,e),this.map=i,this.frameState=void 0!==r?r:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),Fr=function(t){function e(e,i,r,n,o){t.call(this,e,i,o),this.originalEvent=r,this.pixel=i.getEventPixel(r),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Mr),Ar={SINGLECLICK:"singleclick",CLICK:M.CLICK,DBLCLICK:M.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Nr=function(t){function e(e,i,r,n,o){t.call(this,e,i,r.originalEvent,n,o),this.pointerEvent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Fr),Gr={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Dr=function(t,e){this.dispatcher=t,this.mapping_=e};Dr.prototype.getEvents=function(){return Object.keys(this.mapping_)},Dr.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var kr=Dr,jr=1,Ur="mouse";function Yr(t){if(!this.isEventSimulatedFromTouch_(t)){jr.toString()in this.pointerMap&&this.cancel(t);var e=Wr(t,this.dispatcher);this.pointerMap[jr.toString()]=t,this.dispatcher.down(e,t)}}function Br(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Wr(t,this.dispatcher);this.dispatcher.move(e,t)}}function Vr(t){if(!this.isEventSimulatedFromTouch_(t)){var e=this.pointerMap[jr.toString()];if(e&&e.button===t.button){var i=Wr(t,this.dispatcher);this.dispatcher.up(i,t),this.cleanupMouse()}}}function Xr(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Wr(t,this.dispatcher);this.dispatcher.enterOver(e,t)}}function zr(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Wr(t,this.dispatcher);this.dispatcher.leaveOut(e,t)}}function Wr(t,e){var i=e.cloneEvent(t,t),r=i.preventDefault;return i.preventDefault=function(){t.preventDefault(),r()},i.pointerId=jr,i.isPrimary=!0,i.pointerType=Ur,i}var Kr=function(t){function e(e){var i={mousedown:Yr,mousemove:Br,mouseup:Vr,mouseover:Xr,mouseout:zr};t.call(this,e,i),this.pointerMap=e.pointerMap,this.lastTouches=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isEventSimulatedFromTouch_=function(t){for(var e=this.lastTouches,i=t.clientX,r=t.clientY,n=0,o=e.length,s=void 0;n<o&&(s=e[n]);n++){var a=Math.abs(i-s[0]),h=Math.abs(r-s[1]);if(a<=25&&h<=25)return!0}return!1},e.prototype.cancel=function(t){var e=Wr(t,this.dispatcher);this.dispatcher.cancel(e,t),this.cleanupMouse()},e.prototype.cleanupMouse=function(){delete this.pointerMap[jr.toString()]},e}(kr),Hr=["","unavailable","touch","pen","mouse"];function Zr(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)}function qr(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)}function Jr(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)}function Qr(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)}function $r(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)}function tn(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)}function en(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)}function rn(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)}var nn=function(t){function e(e){var i={MSPointerDown:Zr,MSPointerMove:qr,MSPointerUp:Jr,MSPointerOut:Qr,MSPointerOver:$r,MSPointerCancel:tn,MSGotPointerCapture:rn,MSLostPointerCapture:en};t.call(this,e,i),this.pointerMap=e.pointerMap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=Hr[t.pointerType]),e},e.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},e}(kr);function on(t){this.dispatcher.fireNativeEvent(t)}function sn(t){this.dispatcher.fireNativeEvent(t)}function an(t){this.dispatcher.fireNativeEvent(t)}function hn(t){this.dispatcher.fireNativeEvent(t)}function ln(t){this.dispatcher.fireNativeEvent(t)}function un(t){this.dispatcher.fireNativeEvent(t)}function pn(t){this.dispatcher.fireNativeEvent(t)}function cn(t){this.dispatcher.fireNativeEvent(t)}var dn=function(t){function e(e){var i={pointerdown:on,pointermove:sn,pointerup:an,pointerout:hn,pointerover:ln,pointercancel:un,gotpointercapture:cn,lostpointercapture:pn};t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(kr),fn=!1,_n=function(t){function e(e,i,r){t.call(this,e),this.originalEvent=i;var n=r||{};this.buttons=function(t){var e;if(t.buttons||fn)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e}(n),this.pressure=function(t,e){var i=0;i=t.pressure?t.pressure:e?.5:0;return i}(n,this.buttons),this.bubbles="bubbles"in n&&n.bubbles,this.cancelable="cancelable"in n&&n.cancelable,this.view="view"in n?n.view:null,this.detail="detail"in n?n.detail:null,this.screenX="screenX"in n?n.screenX:0,this.screenY="screenY"in n?n.screenY:0,this.clientX="clientX"in n?n.clientX:0,this.clientY="clientY"in n?n.clientY:0,this.ctrlKey="ctrlKey"in n&&n.ctrlKey,this.altKey="altKey"in n&&n.altKey,this.shiftKey="shiftKey"in n&&n.shiftKey,this.metaKey="metaKey"in n&&n.metaKey,this.button="button"in n?n.button:0,this.relatedTarget="relatedTarget"in n?n.relatedTarget:null,this.pointerId="pointerId"in n?n.pointerId:0,this.width="width"in n?n.width:0,this.height="height"in n?n.height:0,this.tiltX="tiltX"in n?n.tiltX:0,this.tiltY="tiltY"in n?n.tiltY:0,this.pointerType="pointerType"in n?n.pointerType:"",this.hwTimestamp="hwTimestamp"in n?n.hwTimestamp:0,this.isPrimary="isPrimary"in n&&n.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);!function(){try{var t=new MouseEvent("click",{buttons:1});fn=1===t.buttons}catch(t){}}();var gn=_n;function yn(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)}function vn(t){this.processTouches_(t,this.moveOverOut_)}function mn(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)}function xn(t){this.processTouches_(t,this.cancelOut_)}var En=function(t){function e(e,i){var r={touchstart:yn,touchmove:vn,touchend:mn,touchcancel:xn};t.call(this,e,r),this.pointerMap=e.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_,this.dedupTimeout_=2500}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},e.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&jr.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},e.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},e.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},e.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},e.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},e.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.radiusX||0,i.height=e.radiusY||0,i.pressure=e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},e.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),r=i.length;function n(){t.preventDefault()}for(var o=0;o<r;++o){var s=this.touchToPointer_(t,i[o]);s.preventDefault=n,e.call(this,t,s)}},e.prototype.findTouch_=function(t,e){for(var i=t.length,r=0;r<i;r++){if(t[r].identifier===e)return!0}return!1},e.prototype.vacuumTouches_=function(t){var e=t.touches,i=Object.keys(this.pointerMap),r=i.length;if(r>=e.length){for(var n=[],o=0;o<r;++o){var s=Number(i[o]),a=this.pointerMap[s];s==jr||this.findTouch_(e,s-2)||n.push(a.out)}for(var h=0;h<n.length;++h)this.cancelOut_(t,n[h])}},e.prototype.overDown_=function(t,e){this.pointerMap[e.pointerId]={target:e.target,out:e,outTarget:e.target},this.dispatcher.over(e,t),this.dispatcher.enter(e,t),this.dispatcher.down(e,t)},e.prototype.moveOverOut_=function(t,e){var i=e,r=this.pointerMap[i.pointerId];if(r){var n=r.out,o=r.outTarget;this.dispatcher.move(i,t),n&&o!==i.target&&(n.relatedTarget=i.target,i.relatedTarget=o,n.target=o,i.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(i,t)):(i.target=o,i.relatedTarget=null,this.cancelOut_(t,i))),r.out=i,r.outTarget=i.target}},e.prototype.upOut_=function(t,e){this.dispatcher.up(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},e.prototype.cancelOut_=function(t,e){this.dispatcher.cancel(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},e.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},e.prototype.dedupSynthMouse_=function(t){var e=this.mouseSource.lastTouches,i=t.changedTouches[0];if(this.isPrimaryTouch_(i)){var r=[i.clientX,i.clientY];e.push(r),setTimeout(function(){!function(t,e){var i=t.indexOf(e),r=i>-1;r&&t.splice(i,1)}(e,r)},this.dedupTimeout_)}},e}(kr),Sn=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]],Tn=function(t){function e(e){t.call(this),this.element_=e,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.registerSources=function(){if(Yi)this.registerSource("native",new dn(this));else if(Bi)this.registerSource("ms",new nn(this));else{var t=new Kr(this);this.registerSource("mouse",t),Ui&&this.registerSource("touch",new En(this,t))}this.register_()},e.prototype.registerSource=function(t,e){var i=e,r=i.getEvents();r&&(r.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},e.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.addEvents_(i.getEvents())}},e.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.removeEvents_(i.getEvents())}},e.prototype.eventHandler_=function(t){var e=t.type,i=this.eventMap_[e];i&&i(t)},e.prototype.addEvents_=function(t){t.forEach(function(t){v(this.element_,t,this.eventHandler_,this)}.bind(this))},e.prototype.removeEvents_=function(t){t.forEach(function(t){x(this.element_,t,this.eventHandler_,this)}.bind(this))},e.prototype.cloneEvent=function(t,e){for(var i={},r=0,n=Sn.length;r<n;r++){var o=Sn[r][0];i[o]=t[o]||e[o]||Sn[r][1]}return i},e.prototype.down=function(t,e){this.fireEvent(Gr.POINTERDOWN,t,e)},e.prototype.move=function(t,e){this.fireEvent(Gr.POINTERMOVE,t,e)},e.prototype.up=function(t,e){this.fireEvent(Gr.POINTERUP,t,e)},e.prototype.enter=function(t,e){t.bubbles=!1,this.fireEvent(Gr.POINTERENTER,t,e)},e.prototype.leave=function(t,e){t.bubbles=!1,this.fireEvent(Gr.POINTERLEAVE,t,e)},e.prototype.over=function(t,e){t.bubbles=!0,this.fireEvent(Gr.POINTEROVER,t,e)},e.prototype.out=function(t,e){t.bubbles=!0,this.fireEvent(Gr.POINTEROUT,t,e)},e.prototype.cancel=function(t,e){this.fireEvent(Gr.POINTERCANCEL,t,e)},e.prototype.leaveOut=function(t,e){this.out(t,e),this.contains_(t.target,t.relatedTarget)||this.leave(t,e)},e.prototype.enterOver=function(t,e){this.over(t,e),this.contains_(t.target,t.relatedTarget)||this.enter(t,e)},e.prototype.contains_=function(t,e){return!(!t||!e)&&t.contains(e)},e.prototype.makeEvent=function(t,e,i){return new gn(t,i,e)},e.prototype.fireEvent=function(t,e,i){var r=this.makeEvent(t,e,i);this.dispatchEvent(r)},e.prototype.fireNativeEvent=function(t){var e=this.makeEvent(t.type,t,t);this.dispatchEvent(e)},e.prototype.wrapMouseEvent=function(t,e){return this.makeEvent(t,Wr(e,this),e)},e.prototype.disposeInternal=function(){this.unregister_(),t.prototype.disposeInternal.call(this)},e}(b),Cn=function(t){function e(e,i){t.call(this),this.map_=e,this.clickTimeoutId_,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*Di:Di,this.down_=null;var r=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new Tn(r),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=v(this.pointerEventHandler_,Gr.POINTERDOWN,this.handlePointerDown_,this),this.relayedListenerKey_=v(this.pointerEventHandler_,Gr.POINTERMOVE,this.relayEvent_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.emulateClick_=function(t){var e=new Nr(Ar.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Nr(Ar.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Nr(Ar.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Ar.POINTERUP||e.type==Ar.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Ar.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Nr(Ar.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new Nr(Ar.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new Tn(document),this.dragListenerKeys_.push(v(this.documentPointerEventHandler_,Ar.POINTERMOVE,this.handlePointerMove_,this),v(this.documentPointerEventHandler_,Ar.POINTERUP,this.handlePointerUp_,this),v(this.pointerEventHandler_,Ar.POINTERCANCEL,this.handlePointerUp_,this)))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Nr(Ar.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}t.preventDefault()},e.prototype.relayEvent_=function(t){var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Nr(t.type,this.map_,t,e))},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(E(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(E(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),t.prototype.disposeInternal.call(this)},e}(b),Rn="postrender",wn="movestart",In="moveend",Ln={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},On={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5},Pn=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Pn.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,p(this.queuedElements_)},Pn.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(i);return delete this.queuedElements_[r],i},Pn.prototype.enqueue=function(t){Y(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Pn.prototype.getCount=function(){return this.elements_.length},Pn.prototype.getLeftChildIndex_=function(t){return 2*t+1},Pn.prototype.getRightChildIndex_=function(t){return 2*t+2},Pn.prototype.getParentIndex_=function(t){return t-1>>1},Pn.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Pn.prototype.isEmpty=function(){return 0===this.elements_.length},Pn.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Pn.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Pn.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,r=e.length,n=e[t],o=i[t],s=t;t<r>>1;){var a=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),l=h<r&&i[h]<i[a]?h:a;e[t]=e[l],i[t]=i[l],t=l}e[t]=n,i[t]=o,this.siftDown_(s,t)},Pn.prototype.siftDown_=function(t,e){for(var i=this.elements_,r=this.priorities_,n=i[e],o=r[e];e>t;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;i[e]=i[s],r[e]=r[s],e=s}i[e]=n,r[e]=o},Pn.prototype.reprioritize=function(){var t,e,i,r=this.priorityFunction_,n=this.elements_,o=this.priorities_,s=0,a=n.length;for(e=0;e<a;++e)(i=r(t=n[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=i,n[s++]=t);n.length=s,o.length=s,this.heapify_()};var bn=Pn,Mn=function(t){function e(e,i){t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()}),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&v(e[0],M.CHANGE,this.handleTileChange,this);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===On.LOADED||i===On.ERROR||i===On.EMPTY||i===On.ABORT){x(e,M.CHANGE,this.handleTileChange,this);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,r,n,o=0,s=!1;this.tilesLoading_<t&&o<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),(i=r.getState())===On.ABORT?s=!0:i!==On.IDLE||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,r.load());0===o&&s&&this.tileChangeCallback_()},e}(bn),Fn=42,An=256;function Nn(t){return t}function Gn(t,e){return void 0!==t?0:void 0}function Dn(t,e){return void 0!==t?t+e:void 0}var kn=0,jn=1,Un="center",Yn="resolution",Bn="rotation";function Vn(t){return Math.pow(t,3)}function Xn(t){return 1-Vn(1-t)}function zn(t){return 3*t*t-2*t*t*t}function Wn(t){return t}var Kn=0;function Hn(t,e){setTimeout(function(){t(e)},0)}function Zn(t){return!(t.sourceCenter&&t.targetCenter&&!Qi(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var qn=function(t){function e(e){t.call(this);var i=u({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=Ce(i.projection,"EPSG:3857"),this.applyOptions_(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyOptions_=function(t){var e={};e[Un]=void 0!==t.center?t.center:null;var i=function(t){var e,i,r,n=void 0!==t.minZoom?t.minZoom:Kn,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;i=a[n],r=void 0!==a[o]?a[o]:a[a.length-1],e=function(t){return function(e,i,r){if(void 0!==e){var n=z(t,e,r);n=kt(n+i,0,t.length-1);var o=Math.floor(n);if(n!=o&&o<t.length-1){var s=t[o]/t[o+1];return t[o]/Math.pow(s,n-o)}return t[o]}}}(a)}else{var h=Ce(t.projection,"EPSG:3857"),l=h.getExtent(),u=l?Math.max(Ot(l),Rt(l)):360*Qt[$t.DEGREES]/h.getMetersPerUnit(),p=u/An/Math.pow(2,Kn),c=p/Math.pow(2,28-Kn);void 0!==(i=t.maxResolution)?n=0:i=p/Math.pow(s,n),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,o):p/Math.pow(s,o):c),o=n+Math.floor(Math.log(i/r)/Math.log(s)),r=i/Math.pow(s,o-n),e=function(t,e,i){return function(r,n,o){if(void 0!==r){var s=-o/2+.5,a=Math.floor(Math.log(e/r)/Math.log(t)+s),h=Math.max(a+n,0);return void 0!==i&&(h=Math.min(h,i)),e/Math.pow(t,h)}}}(s,i,o-n)}return{constraint:e,maxResolution:i,minResolution:r,minZoom:n,zoomFactor:s}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=i.minZoom;var r=function(t){return void 0!==t.extent?function(t){return function(e){return e?[kt(e[0],t[0],t[2]),kt(e[1],t[1],t[3])]:void 0}}(t.extent):Nn}(t),n=i.constraint,o=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?function(t){var e=t||Vt(5);return function(t,i){return void 0!==t?Math.abs(t+i)<=e?0:t+i:void 0}}():!1===e?Dn:"number"==typeof e?function(t){var e=2*Math.PI/t;return function(t,i){return void 0!==t?t=Math.floor((t+i)/e+.5)*e:void 0}}(e):Dn}return Gn}(t);this.constraints_={center:r,resolution:n,rotation:o},void 0!==t.resolution?e[Yn]=t.resolution:void 0!==t.zoom&&(e[Yn]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(e[Yn]=kt(Number(this.getResolution()||e[Yn]),this.minResolution_,this.maxResolution_))),e[Bn]=void 0!==t.rotation?t.rotation:0,this.setProperties(e),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=u({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenter(),e.rotation=this.getRotation(),u({},e,t)},e.prototype.animate=function(t){var e,i=arguments,r=arguments.length;if(r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var n=arguments[r-1];return n.center&&this.setCenter(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&Hn(e,!0))}for(var o=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),h=this.getRotation(),l=[],u=0;u<r;++u){var p=i[u],c={start:o,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||zn};if(p.center&&(c.sourceCenter=s,c.targetCenter=p.center,s=c.targetCenter),void 0!==p.zoom?(c.sourceResolution=a,c.targetResolution=this.constrainResolution(this.maxResolution_,p.zoom-this.minZoom_,0),a=c.targetResolution):p.resolution&&(c.sourceResolution=a,c.targetResolution=p.resolution,a=c.targetResolution),void 0!==p.rotation){c.sourceRotation=h;var d=Xt(p.rotation-h+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=h+d,h=c.targetRotation}c.callback=e,Zn(c)?c.complete=!0:o+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(kn,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[kn]>0},e.prototype.getInteracting=function(){return this.hints_[jn]>0},e.prototype.cancelAnimations=function(){this.setHint(kn,-this.hints_[kn]);for(var t=0,e=this.animations_.length;t<e;++t){var i=this.animations_[t];i[0].callback&&Hn(i[0].callback,!1)}this.animations_.length=0},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var r=this.animations_[i],n=!0,o=0,s=r.length;o<s;++o){var a=r[o];if(!a.complete){var h=t-a.start,l=a.duration>0?h/a.duration:1;l>=1?(a.complete=!0,l=1):n=!1;var u=a.easing(l);if(a.sourceCenter){var p=a.sourceCenter[0],c=a.sourceCenter[1],d=p+u*(a.targetCenter[0]-p),f=c+u*(a.targetCenter[1]-c);this.set(Un,[d,f])}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);a.anchor&&this.set(Un,this.calculateCenterZoom(_,a.anchor)),this.set(Yn,_)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===u?Xt(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);a.anchor&&this.set(Un,this.calculateCenterRotate(g,a.anchor)),this.set(Bn,g)}if(e=!0,!a.complete)break}}if(n){this.animations_[i]=null,this.setHint(kn,-1);var y=r[0].callback;y&&Hn(y,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},e.prototype.calculateCenterRotate=function(t,e){var i,r=this.getCenter();return void 0!==r&&($i(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),Hi(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,r=this.getCenter(),n=this.getResolution();void 0!==r&&void 0!==n&&(i=[e[0]-t*(e[0]-r[0])/n,e[1]-t*(e[1]-r[1])/n]);return i},e.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+o(this)+'"]',i=document.querySelector(e);if(i){var r=getComputedStyle(i);t[0]=parseInt(r.width,10),t[1]=parseInt(r.height,10)}return t},e.prototype.constrainCenter=function(t){return this.constraints_.center(t)},e.prototype.constrainResolution=function(t,e,i){var r=e||0,n=i||0;return this.constraints_.resolution(t,r,n)},e.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},e.prototype.getCenter=function(){return this.get(Un)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_(),i=this.getCenter();Y(i,1);var r=this.getResolution();Y(void 0!==r,2);var n=this.getRotation();return Y(void 0!==n,3),Ct(i,r,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Yn)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){var i=e||this.getSizeFromViewport_(),r=Ot(t)/i[0],n=Rt(t)/i[1];return Math.max(r,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Bn)},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/n}},e.prototype.getState=function(t){var e=this.getCenter(),i=this.getProjection(),r=this.getResolution(),n=r/t,o=this.getRotation();return{center:[Math.round(e[0]/n)*n,Math.round(e[1]/n)*n],projection:void 0!==i?i:null,resolution:r,rotation:o,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,r=this.minZoom_||0;if(this.resolutions_){var n=z(this.resolutions_,t,1);r=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return r+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},e.prototype.fit=function(t,e){var i,r=e||{},n=r.size;n||(n=this.getSizeFromViewport_()),Y(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)?(Y(!bt(t),25),i=Oi(t)):t.getType()===Nt.CIRCLE?(i=Oi(t=t.getExtent())).rotate(this.getRotation(),Tt(t)):i=t;var o,s=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0===r.constrainResolution||r.constrainResolution,h=void 0!==r.nearest&&r.nearest;o=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.constrainResolution(this.maxResolution_,r.maxZoom-this.minZoom_,0):0;for(var l=i.getFlatCoordinates(),u=this.getRotation(),p=Math.cos(-u),c=Math.sin(-u),d=1/0,f=1/0,_=-1/0,g=-1/0,y=i.getStride(),v=0,m=l.length;v<m;v+=y){var x=l[v]*p-l[v+1]*c,E=l[v]*c+l[v+1]*p;d=Math.min(d,x),f=Math.min(f,E),_=Math.max(_,x),g=Math.max(g,E)}var S=this.getResolutionForExtent([d,f,_,g],[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);if(S=isNaN(S)?o:Math.max(S,o),a){var T=this.constrainResolution(S,0,0);!h&&T<S&&(T=this.constrainResolution(T,-1,0)),S=T}c=-c;var C=(d+_)/2,R=(f+g)/2,w=[(C+=(s[1]-s[3])/2*S)*p-(R+=(s[0]-s[2])/2*S)*c,R*p+C*c],L=r.callback?r.callback:I;void 0!==r.duration?this.animate({resolution:S,center:w,duration:r.duration,easing:r.easing},L):(this.setResolution(S),this.setCenter(w),Hn(L,!0))},e.prototype.centerOn=function(t,e,i){var r=this.getRotation(),n=Math.cos(-r),o=Math.sin(-r),s=t[0]*n-t[1]*o,a=t[1]*n+t[0]*o,h=this.getResolution(),l=(s+=(e[0]/2-i[0])*h)*n-(a+=(i[1]-e[1]/2)*h)*(o=-o),u=a*n+s*o;this.setCenter([l,u])},e.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},e.prototype.rotate=function(t,e){if(void 0!==e){var i=this.calculateCenterRotate(t,e);this.setCenter(i)}this.setRotation(t)},e.prototype.setCenter=function(t){this.set(Un,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.set(Yn,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setRotation=function(t){this.set(Bn,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e}(D);function Jn(t,e){var i=document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function Qn(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function $n(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function to(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var eo={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"},io=function(t){function e(e){t.call(this);var i=u({},e);i[eo.OPACITY]=void 0!==e.opacity?e.opacity:1,i[eo.VISIBLE]=void 0===e.visible||e.visible,i[eo.Z_INDEX]=e.zIndex,i[eo.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,i[eo.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,this.setProperties(i),this.state_=null,this.type}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return this.type},e.prototype.getLayerState=function(){var t=this.state_||{layer:this,managed:!0};return t.opacity=kt(this.getOpacity(),0,1),t.sourceState=this.getSourceState(),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=this.getZIndex()||0,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),this.state_=t,t},e.prototype.getLayersArray=function(t){return r()},e.prototype.getLayerStatesArray=function(t){return r()},e.prototype.getExtent=function(){return this.get(eo.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(eo.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(eo.MIN_RESOLUTION)},e.prototype.getOpacity=function(){return this.get(eo.OPACITY)},e.prototype.getSourceState=function(){return r()},e.prototype.getVisible=function(){return this.get(eo.VISIBLE)},e.prototype.getZIndex=function(){return this.get(eo.Z_INDEX)},e.prototype.setExtent=function(t){this.set(eo.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(eo.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(eo.MIN_RESOLUTION,t)},e.prototype.setOpacity=function(t){this.set(eo.OPACITY,t)},e.prototype.setVisible=function(t){this.set(eo.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(eo.Z_INDEX,t)},e}(D),ro={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},no={LAYERS:"layers"},oo=function(t){function e(e){var i=e||{},r=u({},i);delete r.layers;var n=i.layers;t.call(this,r),this.layersListenerKeys_=[],this.listenerKeys_={},v(this,G(no.LAYERS),this.handleLayersChanged_,this),n?Array.isArray(n)?n=new U(n.slice(),{unique:!0}):Y("function"==typeof n.getArray,43):n=new U(void 0,{unique:!0}),this.setLayers(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(E),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(v(t,h.ADD,this.handleLayersAdd_,this),v(t,h.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(E);p(this.listenerKeys_);for(var i=t.getArray(),r=0,n=i.length;r<n;r++){var s=i[r];this.listenerKeys_[o(s)]=[v(s,l,this.handleLayerChange_,this),v(s,M.CHANGE,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[o(e)]=[v(e,l,this.handleLayerChange_,this),v(e,M.CHANGE,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=o(t.element);this.listenerKeys_[e].forEach(E),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(no.LAYERS)},e.prototype.setLayers=function(t){this.set(no.LAYERS,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});for(var r=this.getLayerState(),n=i,o=e.length;n<o;n++){var s=e[n];s.opacity*=r.opacity,s.visible=s.visible&&r.visible,s.maxResolution=Math.min(s.maxResolution,r.maxResolution),s.minResolution=Math.max(s.minResolution,r.minResolution),void 0!==r.extent&&(void 0!==s.extent?s.extent=wt(s.extent,r.extent):s.extent=r.extent)}return e},e.prototype.getSourceState=function(){return ro.READY},e}(io);function so(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i}function ao(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function ho(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}var lo=function(t){function e(e){t.call(this);var i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,r,n,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new oo({layers:t.layers});o[Ln.LAYERGROUP]=s,o[Ln.TARGET]=t.target,o[Ln.VIEW]=void 0!==t.view?t.view:new qn,void 0!==t.controls&&(Array.isArray(t.controls)?i=new U(t.controls.slice()):(Y("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new U(t.interactions.slice()):(Y("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new U(t.overlays.slice()):(Y("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new U;return{controls:i,interactions:r,keyboardEventTarget:e,overlays:n,values:o}}(e);this.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,this.loadTilesWhileAnimating_=void 0!==e.loadTilesWhileAnimating&&e.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==e.loadTilesWhileInteracting&&e.loadTilesWhileInteracting,this.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Di,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+(Ui?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var r=[M.CLICK,M.DBLCLICK,M.MOUSEDOWN,M.TOUCHSTART,M.MSPOINTERDOWN,Ar.POINTERDOWN,M.MOUSEWHEEL,M.WHEEL],n=0,o=r.length;n<o;++n)v(this.overlayContainerStopEvent_,r[n],O);for(var s in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new Cn(this,e.moveTolerance),Ar)v(this.mapBrowserEventHandler_,Ar[s],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,v(this.viewport_,M.CONTEXTMENU,this.handleBrowserEvent,this),v(this.viewport_,M.WHEEL,this.handleBrowserEvent,this),v(this.viewport_,M.MOUSEWHEEL,this.handleBrowserEvent,this),this.controls=i.controls||new U,this.interactions=i.interactions||new U,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=this.createRenderer(),this.handleResize_,this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new Mn(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},v(this,G(Ln.LAYERGROUP),this.handleLayerGroupChanged_,this),v(this,G(Ln.VIEW),this.handleViewChanged_,this),v(this,G(Ln.SIZE),this.handleSizeChanged_,this),v(this,G(Ln.TARGET),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach(function(t){t.setMap(this)}.bind(this)),v(this.controls,h.ADD,function(t){t.element.setMap(this)},this),v(this.controls,h.REMOVE,function(t){t.element.setMap(null)},this),this.interactions.forEach(function(t){t.setMap(this)}.bind(this)),v(this.interactions,h.ADD,function(t){t.element.setMap(this)},this),v(this.interactions,h.REMOVE,function(t){t.element.setMap(null)},this),this.overlays_.forEach(this.addOverlayInternal_.bind(this)),v(this.overlays_,h.ADD,function(t){this.addOverlayInternal_(t.element)},this),v(this.overlays_,h.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)},this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),x(this.viewport_,M.CONTEXTMENU,this.handleBrowserEvent,this),x(this.viewport_,M.WHEEL,this.handleBrowserEvent,this),x(this.viewport_,M.MOUSEWHEEL,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(removeEventListener(M.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var r=this.getCoordinateFromPixel(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==i.layerFilter?i.layerFilter:R;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,n,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=null;return this.forEachFeatureAtPixel(t,function(t){i||(i=[]),i.push(t)},e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var r=i||{},n=void 0!==r.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=r.layerFilter||R;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,null,o,null)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixel(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:R,n=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Ln.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){var e=this.frameState_;return e?De(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Ln.LAYERGROUP)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getPixelFromCoordinate=function(t){var e=this.frameState_;return e?De(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Ln.SIZE)},e.prototype.getView=function(){return this.get(Ln.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,i,r){var n=this.frameState_;if(!(n&&e in n.wantedTiles))return 1/0;if(!n.wantedTiles[e][t.getKey()])return 1/0;var o=i[0]-n.focus[0],s=i[1]-n.focus[1];return 65536*Math.log(r)+Math.sqrt(o*o+s*s)/r},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,r=new Fr(i,this,t);this.handleMapBrowserEvent(r)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var e=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var i=e.length-1;i>=0;i--){var r=e[i];if(r.getActive())if(!r.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,r=i;if(t){var n=t.viewHints;n[kn]&&(i=this.loadTilesWhileAnimating_?8:0,r=2),n[jn]&&(i=this.loadTilesWhileInteracting_?8:0,r=2)}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,r))}!t||!this.hasListener(ur.RENDERCOMPLETE)||t.animate||this.tileQueue_.getTilesLoading()||function t(e){for(var i=0,r=e.length;i<r;++i){var n=e[i];if("function"==typeof n.getLayers)return t(n.getLayers().getArray());var o=n.getSource();if(o&&o.loading)return!0}return!1}(this.getLayers().getArray())||this.renderer_.dispatchRenderEvent(ur.RENDERCOMPLETE,t);for(var o=this.postRenderFunctions_,s=0,a=o.length;s<a;++s)o[s](this,t);o.length=0},e.prototype.handleSizeChanged_=function(){this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)E(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[v(r,M.KEYDOWN,this.handleBrowserEvent,this),v(r,M.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),addEventListener(M.RESIZE,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),$n(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(M.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(E(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(E(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",o(t)),this.viewPropertyListenerKey_=v(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=v(t,M.CHANGE,this.handleViewPropertyChanged_,this)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(E),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[v(t,l,this.render,this),v(t,M.CHANGE,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e,i=this.getSize(),r=this.getView(),n=[1/0,1/0,-1/0,-1/0],s=this.frameState_,a=null;if(void 0!==i&&function(t){return t[0]>0&&t[1]>0}(i)&&r&&r.isDef()){for(var h=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},p=0,c=l.length;p<c;++p)u[o(l[p].layer)]=l[p];e=r.getState(this.pixelRatio_),a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:n,focus:this.focus_?this.focus_:e.center,index:this.frameIndex_++,layerStates:u,layerStatesArray:l,pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:h,wantedTiles:{}}}if(a&&(a.extent=Ct(e.center,e.resolution,e.rotation,a.size,n)),this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),s)(!this.previousExtent_||!bt(this.previousExtent_)&&!dt(a.extent,this.previousExtent_))&&(this.dispatchEvent(new Mr(wn,this,s)),this.previousExtent_=ut(this.previousExtent_));this.previousExtent_&&!a.viewHints[kn]&&!a.viewHints[jn]&&!dt(a.extent,this.previousExtent_)&&(this.dispatchEvent(new Mr(In,this,a)),it(a.extent,this.previousExtent_))}this.dispatchEvent(new Mr(Rn,this,a)),setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(Ln.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(Ln.SIZE,t)},e.prototype.setTarget=function(t){this.set(Ln.TARGET,t)},e.prototype.setView=function(t){this.set(Ln.VIEW,t)},e.prototype.skipFeature=function(t){this.skippedFeatureUids_[o(t)]=!0,this.render()},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0)},e.prototype.unskipFeature=function(t){delete this.skippedFeatureUids_[o(t)],this.render()},e}(D);var uo=function(t){function e(e){t.call(this),this.element=e.element?e.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=e.render?e.render:I,e.target&&this.setTarget(e.target)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){$n(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&$n(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)E(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==I&&this.listenerKeys.push(v(t,Rn,this.render,this)),t.render())},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(D),po="ol-hidden",co="ol-selectable",fo="ol-unselectable",_o="ol-unsupported",go="ol-control",yo="ol-collapsed",vo=function(){var t,e={};return function(i){if(t||(t=document.createElement("div").style),!(i in e)){t.font=i;var r=t.fontFamily;if(t.font="",!r)return null;e[i]=r.split(/,\s?/)}return e[i]}}();function mo(t,e){return t.visible&&e>=t.minResolution&&e<t.maxResolution}var xo=function(t){function e(e){var i=u({},e);delete i.source,t.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,e.map&&this.setMap(e.map),v(this,G(eo.SOURCE),this.handleSourcePropertyChange_,this);var r=e.source?e.source:null;this.setSource(r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(eo.SOURCE)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():ro.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(E(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=v(t,M.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(E(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(E(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=v(t,ur.PRECOMPOSE,function(t){var e=t,i=this.getLayerState();i.managed=!1,void 0===this.getZIndex()&&(i.zIndex=1/0),e.frameState.layerStatesArray.push(i),e.frameState.layerStates[o(this)]=i},this),this.mapRenderKey_=v(this,M.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(eo.SOURCE,t)},e}(io);function Eo(t){this.updateElement_(t.frameState)}var So=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||Eo,target:i.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===i.collapsed||i.collapsed,this.overrideCollapsible_=void 0!==i.collapsible,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var r=void 0!==i.className?i.className:"ol-attribution",n=void 0!==i.tipLabel?i.tipLabel:"Attributions",o=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof o?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o):this.collapseLabel_=o;var s=void 0!==i.label?i.label:"i";"string"==typeof s?(this.label_=document.createElement("span"),this.label_.textContent=s):this.label_=s;var a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=n,h.appendChild(a),v(h,M.CLICK,this.handleClick_,this);var l=r+" "+fo+" "+go+(this.collapsed_&&this.collapsible_?" "+yo:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=l,u.appendChild(this.ulElement_),u.appendChild(h),this.renderedAttributions_=[],this.renderedVisible_=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],r=t.layerStatesArray,n=t.viewState.resolution,o=0,s=r.length;o<s;++o){var a=r[o];if(mo(a,n)){var h=a.layer.getSource();if(h){var l=h.getAttributions();if(l){var u=l(t);if(u)if(this.overrideCollapsible_||!1!==h.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(u))for(var p=0,c=u.length;p<c;++p)u[p]in e||(i.push(u[p]),e[u[p]]=!0);else u in e||(i.push(u),e[u]=!0)}}}}return i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Z(e,this.renderedAttributions_)){to(this.ulElement_);for(var r=0,n=e.length;r<n;++r){var o=document.createElement("li");o.innerHTML=e[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(yo),this.collapsed_?Qn(this.collapseLabel_,this.label_):Qn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e}(uo);function To(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var r="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains(po);n||0!==i?n&&0!==i&&this.element.classList.remove(po):this.element.classList.add(po)}this.label_.style.msTransform=r,this.label_.style.webkitTransform=r,this.label_.style.transform=r}this.rotation_=i}}var Co=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||To,target:i.target});var r=void 0!==i.className?i.className:"ol-rotate",n=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof n?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=n):(this.label_=n,this.label_.classList.add("ol-compass"));var o=i.tipLabel?i.tipLabel:"Reset rotation",s=document.createElement("button");s.className=r+"-reset",s.setAttribute("type","button"),s.title=o,s.appendChild(this.label_),v(s,M.CLICK,this.handleClick_,this);var a=r+" "+fo+" "+go,h=this.element;h.className=a,h.appendChild(s),this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:Xn}):t.setRotation(0))},e}(uo),Ro=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target});var r=void 0!==i.className?i.className:"ol-zoom",n=void 0!==i.delta?i.delta:1,o=void 0!==i.zoomInLabel?i.zoomInLabel:"+",s=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",a=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",h=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=r+"-in",l.setAttribute("type","button"),l.title=a,l.appendChild("string"==typeof o?document.createTextNode(o):o),v(l,M.CLICK,this.handleClick_.bind(this,n));var u=document.createElement("button");u.className=r+"-out",u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof s?document.createTextNode(s):s),v(u,M.CLICK,this.handleClick_.bind(this,-n));var p=r+" "+fo+" "+go,c=this.element;c.className=p,c.appendChild(l),c.appendChild(u),this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var r=e.constrainResolution(i,t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:r,duration:this.duration_,easing:Xn})):e.setResolution(r)}}},e}(uo);function wo(t){var e=t||{},i=new U;return(void 0===e.zoom||e.zoom)&&i.push(new Ro(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Co(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new So(e.attributionOptions)),i}var Io={ACTIVE:"active"};function Lo(t,e,i,r){Oo(t,e=t.constrainRotation(e,0),i,r)}function Oo(t,e,i,r){if(void 0!==e){var n=t.getRotation(),o=t.getCenter();void 0!==n&&o&&r>0?t.animate({rotation:e,anchor:i,duration:r,easing:Xn}):t.rotate(e,i)}}function Po(t,e,i,r,n){Mo(t,e=t.constrainResolution(e,0,n),i,r)}function bo(t,e,i,r){var n=t.getResolution(),o=t.constrainResolution(n,e,0);if(void 0!==o){var s=t.getResolutions();o=kt(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==o&&o!==n){var a=t.getCenter(),h=t.calculateCenterZoom(o,i);h=t.constrainCenter(h),i=[(o*a[0]-n*h[0])/(o-n),(o*a[1]-n*h[1])/(o-n)]}Mo(t,o,i,r)}function Mo(t,e,i,r){if(e){var n=t.getResolution(),o=t.getCenter();if(void 0!==n&&o&&e!==n&&r)t.animate({resolution:e,anchor:i,duration:r,easing:Xn});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}var Fo=function(t){function e(e){t.call(this),e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getActive=function(){return this.get(Io.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Io.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(D);function Ao(t){var e=!1;if(t.type==Ar.DBLCLICK){var i=t.originalEvent,r=t.map,n=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;bo(r.getView(),o,n,this.duration_),t.preventDefault(),e=!0}return!e}var No=function(t){function e(e){t.call(this,{handleEvent:Ao});var i=e||{};this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Fo),Go=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Do=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ko=function(t){return t.target.getTargetElement()===document.activeElement},jo=R,Uo=function(t){var e=t.originalEvent;return 0==e.button&&!(Ni&&Gi&&e.ctrlKey)},Yo=w,Bo=function(t){return"pointermove"==t.type},Vo=function(t){return t.type==Ar.SINGLECLICK},Xo=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},zo=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Wo=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Ko=function(t){var e=t.pointerEvent;return Y(void 0!==e,56),"mouse"==e.pointerType},Ho=function(t){var e=t.pointerEvent;return Y(void 0!==e,56),e.isPrimary&&0===e.button};function Zo(t){for(var e=t.length,i=0,r=0,n=0;n<e;n++)i+=t[n].clientX,r+=t[n].clientY;return[i/e,r/e]}var qo=function(t){function e(e){var i=e||{};t.call(this,i),i.handleDownEvent&&(this.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(this.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(this.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(this.handleUpEvent=i.handleUpEvent),i.stopDown&&(this.stopDown=i.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Ar.POINTERDRAG)this.handleDragEvent(t);else if(t.type==Ar.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Ar.POINTERDOWN){var r=this.handleDownEvent(t);r&&t.preventDefault(),this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==Ar.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===Ar.POINTERDOWN||e===Ar.POINTERDRAG||e===Ar.POINTERUP}(t)){var e=t.pointerEvent,i=e.pointerId.toString();t.type==Ar.POINTERUP?delete this.trackedPointers_[i]:t.type==Ar.POINTERDOWN?this.trackedPointers_[i]=e:i in this.trackedPointers_&&(this.trackedPointers_[i]=e),this.targetPointers=c(this.trackedPointers_)}},e}(Fo),Jo=function(t){function e(e){t.call(this,{stopDown:w});var i=e||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1,this.condition_=i.condition?i.condition:Xo,this.noKinetic_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().setHint(jn,1));var e=this.targetPointers,i=Zo(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var r=this.lastCentroid[0]-i[0],n=i[1]-this.lastCentroid[1],o=t.map.getView(),s=[r,n];tr(s,o.getResolution()),$i(s,o.getRotation()),Hi(s,o.getCenter()),s=o.constrainCenter(s),o.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length},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 r=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),o=i.getCenter(),s=e.getPixelFromCoordinate(o),a=e.getCoordinateFromPixel([s[0]-r*Math.cos(n),s[1]-r*Math.sin(n)]);i.animate({center:i.constrainCenter(a),duration:500,easing:Xn})}return this.panning_&&(this.panning_=!1,i.setHint(jn,-1)),!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.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(qo),Qo=function(t){function e(e){var i=e||{};t.call(this,{stopDown:w}),this.condition_=i.condition?i.condition:Do,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){if(Ko(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Gn){var r=e.getSize(),n=t.pixel,o=Math.atan2(r[1]/2-n[1],n[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;Oo(i,i.getRotation()-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){if(!Ko(t))return!0;var e=t.map.getView();return e.setHint(jn,-1),Lo(e,e.getRotation(),void 0,this.duration_),!1},e.prototype.handleDownEvent=function(t){return!!Ko(t)&&(!(!Uo(t)||!this.condition_(t))&&(t.map.getView().setHint(jn,1),this.lastAngle_=void 0,!0))},e}(qo),$o=function(t){function e(e){t.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=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_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ii([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(C),ts="boxstart",es="boxdrag",is="boxend",rs=function(t){function e(e,i,r){t.call(this,e),this.coordinate=i,this.mapBrowserEvent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),ns=function(t){function e(e){t.call(this);var i=e||{};this.box_=new $o(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.onBoxEnd_=i.onBoxEnd?i.onBoxEnd:I,this.startPixel_=null,this.condition_=i.condition?i.condition:jo,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:this.defaultBoxEndCondition}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.defaultBoxEndCondition=function(t,e,i){var r=i[0]-e[0],n=i[1]-e[1];return r*r+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){Ko(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new rs(es,t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!Ko(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new rs(is,t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!!Ko(t)&&(!(!Uo(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new rs(ts,t.coordinate,t)),!0))},e}(qo);function os(){var t=this.getMap(),e=t.getView(),i=t.getSize(),r=this.getGeometry().getExtent();if(this.out_){var n=e.calculateExtent(i),o=function(t,e){return gt(ut(e),t)}([t.getPixelFromCoordinate(Et(r)),t.getPixelFromCoordinate(Lt(r))]);Mt(n,1/e.getResolutionForExtent(o,i)),r=n}var s=e.constrainResolution(e.getResolutionForExtent(r,i)),a=Tt(r);a=e.constrainCenter(a),e.animate({resolution:s,center:a,duration:this.duration_,easing:Xn})}var ss=function(t){function e(e){var i=e||{},r=i.condition?i.condition:zo;t.call(this,{condition:r,className:i.className||"ol-dragzoom",onBoxEnd:os}),this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ns),as={LEFT:37,UP:38,RIGHT:39,DOWN:40};function hs(t){var e=!1;if(t.type==M.KEYDOWN){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==as.DOWN||i==as.LEFT||i==as.RIGHT||i==as.UP)){var r=t.map.getView(),n=r.getResolution()*this.pixelDelta_,o=0,s=0;i==as.DOWN?s=-n:i==as.LEFT?o=-n:i==as.RIGHT?o=n:s=n;var a=[o,s];$i(a,r.getRotation()),function(t,e,i){var r=t.getCenter();if(r){var n=t.constrainCenter([r[0]+e[0],r[1]+e[1]]);i?t.animate({duration:i,easing:Wn,center:n}):t.setCenter(n)}}(r,a,this.duration_),t.preventDefault(),e=!0}}return!e}var ls=function(t){function e(e){t.call(this,{handleEvent:hs});var i=e||{};this.defaultCondition_=function(t){return Xo(t)&&Wo(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Fo);function us(t){var e=!1;if(t.type==M.KEYDOWN||t.type==M.KEYPRESS){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var r=t.map,n=i=="+".charCodeAt(0)?this.delta_:-this.delta_;bo(r.getView(),n,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}var ps=function(t){function e(e){t.call(this,{handleEvent:us});var i=e||{};this.condition_=i.condition?i.condition:Wo,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Fo),cs="trackpad",ds="wheel",fs=function(t){function e(e){var i=e||{};t.call(this,i),this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.condition_=i.condition?i.condition:jo,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(jn,-1)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==M.WHEEL&&e!==M.MOUSEWHEEL)return!0;t.preventDefault();var i,r=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==M.WHEEL?(i=n.deltaY,Fi&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=Di),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==M.MOUSEWHEEL&&(i=-n.wheelDeltaY,Ai&&(i/=3)),0===i)return!1;var o=Date.now();if(void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?cs:ds),this.mode_===cs){var s=r.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint(jn,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),h=s.getMinResolution(),l=s.getMaxResolution(),u=0;if(a<h?(a=Math.max(a,h/this.trackpadZoomBuffer_),u=1):a>l&&(a=Math.min(a,l*this.trackpadZoomBuffer_),u=-1),this.lastAnchor_){var p=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(p))}return s.setResolution(a),0===u&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,i>0?-1:1),easing:Xn,anchor:this.lastAnchor_,duration:this.duration_}),u>0?s.animate({resolution:h,easing:Xn,anchor:this.lastAnchor_,duration:500}):u<0&&s.animate({resolution:l,easing:Xn,anchor:this.lastAnchor_,duration:500}),this.startTime_=o,!1}this.delta_+=i;var c=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),c),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();bo(e,-kt(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=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}(Fo),_s=function(t){function e(e){var i=e||{},r=i;r.stopDown||(r.stopDown=w),t.call(this,r),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],r=this.targetPointers[1],n=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=n-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=n;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Gn){var h=s.getViewport().getBoundingClientRect(),l=Zo(this.targetPointers);if(l[0]-=h.left,l[1]-=h.top,this.anchor_=s.getCoordinateFromPixel(l),this.rotating_){var u=a.getRotation();s.render(),Oo(a,u+e,this.anchor_)}}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(jn,-1),this.rotating_)Lo(e,e.getRotation(),this.anchor_,this.duration_);return!1}return!0},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().setHint(jn,1),!0}return!1},e}(qo),gs=function(t){function e(e){var i=e||{},r=i;r.stopDown||(r.stopDown=w),t.call(this,r),this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],r=this.targetPointers[1],n=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(n*n+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,h=a.getView(),l=h.getResolution(),u=h.getMaxResolution(),p=h.getMinResolution(),c=l*e;c>u?(e=u/l,c=u):c<p&&(e=p/l,c=p),1!=e&&(this.lastScaleDelta_=e);var d=a.getViewport().getBoundingClientRect(),f=Zo(this.targetPointers);f[0]-=d.left,f[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(f),a.render(),Mo(h,c,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();e.setHint(jn,-1);var i=e.getResolution();if(this.constrainResolution_||i<e.getMinResolution()||i>e.getMaxResolution()){var r=this.lastScaleDelta_-1;Po(e,i,this.anchor_,this.duration_,r)}return!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().setHint(jn,1),!0}return!1},e}(qo);function ys(t){var e=t||{},i=new U,r=new br(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Qo),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new No({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new Jo({condition:e.onFocusOnly?ko:void 0,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new _s),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new gs({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new ls),i.push(new ps({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new fs({condition:e.onFocusOnly?ko:void 0,constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new ss({duration:e.zoomDuration})),i}var vs=.5,ms=function(t){function e(e,i,r,n){t.call(this),this.extent=e,this.pixelRatio_=r,this.resolution=i,this.state=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(M.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return r()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){r()},e}(b),xs={IDLE:0,LOADING:1,LOADED:2,ERROR:3},Es=function(t){function e(e,i,r,n,o){var s=void 0!==o?xs.IDLE:xs.LOADED;t.call(this,e,i,r,s),this.loader_=void 0!==o?o:null,this.canvas_=n,this.error_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=xs.ERROR):this.state=xs.LOADED,this.changed()},e.prototype.load=function(){this.state==xs.IDLE&&(this.state=xs.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(ms),Ss={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"},Ts={IMAGE:"image",VECTOR:"vector"},Cs=function(t){function e(e,i,r,n,o){t.call(this,e),this.vectorContext=i,this.frameState=r,this.context=n,this.glContext=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),Rs=function(t){function e(e){t.call(this),this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(M.CLEAR)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},e.prototype.get=function(t){var e=this.entries_[t];return Y(void 0!==e,15),e===this.newest_?e.value_:(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e,e.value_)},e.prototype.remove=function(t){var e=this.entries_[t];return Y(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_},e.prototype.getCount=function(){return this.count_},e.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},e.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},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.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_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){Y(!(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_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(b),ws=[0,0,0,1],Is=[],Ls=[0,0,0,1],Os=[0,0,0,0],Ps=new Rs,bs={},Ms=null,Fs={},As=function(){var t,e,i=60,r=bs,n="32px ",o=["monospace","serif"],s=o.length,a="wmytzilWMYTZIL@#/&?$%10";function h(t){for(var i=Ns(),r=100;r<=700;r+=300){for(var h=r+" ",l=!0,u=0;u<s;++u){var p=o[u];if(i.font=h+n+p,e=i.measureText(a).width,t!=p){i.font=h+n+t+","+p;var c=i.measureText(a).width;l=l&&c!=e}}if(l)return!0}return!1}function l(){var e=!0;for(var n in r)r[n]<i&&(h(n)?(r[n]=i,p(Fs),Ms=null,Ps.clear()):(++r[n],e=!1));e&&(clearInterval(t),t=void 0)}return function(e){var n=vo(e);if(n)for(var o=0,s=n.length;o<s;++o){var a=n[o];a in r||(r[a]=i,h(a)||(r[a]=0,void 0===t&&(t=setInterval(l,32))))}}}();function Ns(){return Ms||(Ms=Jn(1,1)),Ms}var Gs=function(){var t,e=Fs;return function(i){var r=e[i];return void 0==r&&(t||((t=document.createElement("span")).textContent="M",t.style.margin=t.style.padding="0 !important",t.style.position="absolute !important",t.style.left="-99999px !important"),t.style.font=i,document.body.appendChild(t),r=e[i]=t.offsetHeight,document.body.removeChild(t)),r}}();function Ds(t,e){var i=Ns();return t!=i.font&&(i.font=t),i.measureText(e).width}function ks(t,e,i,r){0!==e&&(t.translate(i,r),t.rotate(e),t.translate(-i,-r))}var js=[1,0,0,1,0,0];function Us(t,e,i,r,n,o,s,a,h,l,u){var p;1!=i&&(p=t.globalAlpha,t.globalAlpha=p*i),e&&t.setTransform.apply(t,e),t.drawImage(r,n,o,s,a,h,l,s*u,a*u),p&&(t.globalAlpha=p),e&&t.setTransform.apply(t,js)}function Ys(t){return Array.isArray(t)?yr(t):t}var Bs=function(){};Bs.prototype.drawCustom=function(t,e,i){},Bs.prototype.drawGeometry=function(t){},Bs.prototype.setStyle=function(t){},Bs.prototype.drawCircle=function(t,e){},Bs.prototype.drawFeature=function(t,e){},Bs.prototype.drawGeometryCollection=function(t,e){},Bs.prototype.drawLineString=function(t,e){},Bs.prototype.drawMultiLineString=function(t,e){},Bs.prototype.drawMultiPoint=function(t,e){},Bs.prototype.drawMultiPolygon=function(t,e){},Bs.prototype.drawPoint=function(t,e){},Bs.prototype.drawPolygon=function(t,e){},Bs.prototype.drawText=function(t,e){},Bs.prototype.setFillStrokeStyle=function(t,e){},Bs.prototype.setImageStyle=function(t,e){},Bs.prototype.setTextStyle=function(t,e){};var Vs=Bs,Xs=function(t){function e(e,i,r,n,o){t.call(this),this.context_=e,this.pixelRatio_=i,this.extent_=r,this.transform_=n,this.viewRotation_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawImages_=function(t,e,i,r){if(this.image_){var n=Gt(t,e,i,2,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var h=this.imageRotation_;this.imageRotateWithView_&&(h+=this.viewRotation_);for(var l=0,u=n.length;l<u;l+=2){var p=n[l]-this.imageAnchorX_,c=n[l+1]-this.imageAnchorY_;if(0!==h||1!=this.imageScale_){var d=p+this.imageAnchorX_,f=c+this.imageAnchorY_;Ye(s,d,f,this.imageScale_,this.imageScale_,h,-d,-f),o.setTransform.apply(o,s)}o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,p,c,this.imageWidth_,this.imageHeight_)}0===h&&1==this.imageScale_||o.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,i,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Gt(t,e,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=r){var a=n[e]+this.textOffsetX_,h=n[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_){var l=Ye(this.tmpLocalTransform_,a,h,this.textScale_,this.textScale_,s,-a,-h);o.setTransform.apply(o,l)}this.textStrokeState_&&o.strokeText(this.text_,a,h),this.textFillState_&&o.fillText(this.text_,a,h)}0===s&&1==this.textScale_||o.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,i,r,n){var o=this.context_,s=Gt(t,e,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;n&&(a-=2);for(var h=2;h<a;h+=2)o.lineTo(s[h],s[h+1]);return n&&o.closePath(),i},e.prototype.drawRings_=function(t,e,i,r){for(var n=0,o=i.length;n<o;++n)e=this.moveToLineTo_(t,e,i[n],r,!0);return e},e.prototype.drawCircle=function(t){if(Pt(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 r=t.getFlatCoordinates();if(r){var n=t.getStride();return Gt(r,0,r.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],r=e[3]-e[1],n=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],n,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.drawGeometry=function(t){switch(t.getType()){case Nt.POINT:this.drawPoint(t);break;case Nt.LINE_STRING:this.drawLineString(t);break;case Nt.POLYGON:this.drawPolygon(t);break;case Nt.MULTI_POINT:this.drawMultiPoint(t);break;case Nt.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Nt.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Nt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Nt.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Pt(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,r=e.length;i<r;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){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){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(Pt(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 r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){var e=t.getExtent();if(Pt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,r=t.getFlatCoordinates(),n=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,h=o.length;a<h;++a)n=this.moveToLineTo_(r,n,o[a],s,!1);i.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(Pt(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(Pt(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(),r=0,n=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=n.length;s<a;++s){var h=n[s];r=this.drawRings_(i,r,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.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=e.lineCap=t.lineCap),ki&&(Z(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,ki&&(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_,r=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=e.font=t.font),i.textAlign!=r&&(i.textAlign=e.textAlign=r),i.textBaseline!=t.textBaseline&&(i.textBaseline=e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:Ys(i||ws)}}else this.fillState_=null;if(e){var r=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),s=e.getLineDashOffset(),a=e.getLineJoin(),h=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:"round",lineDash:o||Is,lineDashOffset:s||0,lineJoin:void 0!==a?a:"round",lineWidth:this.pixelRatio_*(void 0!==h?h:1),miterLimit:void 0!==l?l:10,strokeStyle:Ys(r||Ls)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),r=t.getOrigin(),n=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=n[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageWidth_=n[0]}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Ys(i||ws)}}else this.textFillState_=null;var r=t.getStroke();if(r){var n=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),h=r.getLineJoin(),l=r.getWidth(),u=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:s||Is,lineDashOffset:a||0,lineJoin:void 0!==h?h:"round",lineWidth:void 0!==l?l:1,miterLimit:void 0!==u?u:10,strokeStyle:Ys(n||Ls)}}else this.textStrokeState_=null;var p=t.getFont(),c=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),_=t.getRotation(),g=t.getScale(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==p?p:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==y?y:"",this.textOffsetX_=void 0!==c?this.pixelRatio_*c:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==_?_:0,this.textScale_=this.pixelRatio_*(void 0!==g?g:1)}else this.text_=""},e}(Vs),zs=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function Ws(t,e,i){return e+":"+t+":"+(i?dr(i):"null")}zs.prototype.clear=function(){this.cache_={},this.cacheSize_=0},zs.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},zs.prototype.get=function(t,e,i){var r=Ws(t,e,i);return r in this.cache_?this.cache_[r]:null},zs.prototype.set=function(t,e,i,r){var n=Ws(t,e,i);this.cache_[n]=r,++this.cacheSize_},zs.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var Ks=new zs;function Hs(t,e){Ks.expire()}function Zs(t,e){return t.zIndex-e.zIndex}var qs=function(t){function e(e){t.call(this),this.map_=e,this.layerRenderers_={},this.layerRendererListeners_={},this.layerRendererConstructors_=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){r()},e.prototype.registerLayerRenderers=function(t){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,t)},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Ye(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Be(Ge(r,i))},e.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,s,a){var h,l=e.viewState,u=l.resolution;function p(t,i){var s=e.layerStates[o(i)].managed;if(!(o(t)in e.skippedFeatureUids)||s)return r.call(n,t,s?i:null)}var c=l.projection,d=t;if(c.canWrapX()){var f=c.getExtent(),_=Ot(f),g=t[0];if(g<f[0]||g>f[2])d=[g+_*Math.ceil((f[0]-g)/_),t[1]]}var y,v=e.layerStatesArray;for(y=v.length-1;y>=0;--y){var m=v[y],x=m.layer;if(mo(m,u)&&s.call(a,x)){var E=this.getLayerRenderer(x),S=x.getSource();if(S&&(h=E.forEachFeatureAtCoordinate(S.getWrapX()?d:t,e,i,p)),h)return h}}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o,s,a){return r()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,R,this,r,n)},e.prototype.getLayerRenderer=function(t){var e=o(t);if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,r=0,n=this.layerRendererConstructors_.length;r<n;++r){var s=this.layerRendererConstructors_[r];if(s.handles(t)){i=s.create(this,t);break}}if(!i)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[e]=i,this.layerRendererListeners_[e]=v(i,M.CHANGE,this.handleLayerRendererChange_,this),i},e.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},e.prototype.getLayerRenderers=function(){return this.layerRenderers_},e.prototype.getMap=function(){return this.map_},e.prototype.handleLayerRendererChange_=function(){this.map_.render()},e.prototype.removeLayerRendererByKey_=function(t){var e=this.layerRenderers_[t];return delete this.layerRenderers_[t],E(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],e},e.prototype.removeUnusedLayerRenderers_=function(t,e){for(var i in this.layerRenderers_)e&&i in e.layerStates||this.removeLayerRendererByKey_(i).dispose()},e.prototype.renderFrame=function(t){r()},e.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Hs)},e.prototype.scheduleRemoveUnusedLayerRenderers=function(t){for(var e in this.layerRenderers_)if(!(e in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},e}(C),Js=[],Qs=function(t){function e(e){t.call(this,e);var i=e.getViewport();this.context_=Jn(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=fo,i.insertBefore(this.canvas_,i.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap(),r=this.context_;if(i.hasListener(t)){var n=e.extent,o=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),h=new Xs(r,o,n,a,s),l=new Cs(t,h,e,r,null);i.dispatchEvent(l)}},e.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,r=this.canvas_.height/2,n=t.pixelRatio/e.resolution,o=-n,s=-e.rotation,a=-e.center[0],h=-e.center[1];return Ye(this.transform_,i,r,n,o,s,a,h)},e.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,r=Math.round(t.size[0]*i),n=Math.round(t.size[1]*i);this.canvas_.width!=r||this.canvas_.height!=n?(this.canvas_.width=r,this.canvas_.height=n):e.clearRect(0,0,r,n);var o=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchRenderEvent(ur.PRECOMPOSE,t);var s=t.layerStatesArray;q(s,Zs),o&&(e.save(),ks(e,o,r/2,n/2));var a,h,l=t.viewState.resolution;for(a=0,h=s.length;a<h;++a){var u=s[a],p=u.layer,c=this.getLayerRenderer(p);mo(u,l)&&u.sourceState==ro.READY&&(c.prepareFrame(t,u)&&c.composeFrame(t,u,e))}o&&e.restore(),this.dispatchRenderEvent(ur.POSTCOMPOSE,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){var a,h,l=e.viewState.resolution,u=e.layerStatesArray,p=u.length,c=De(e.pixelToCoordinateTransform,t.slice());for(h=p-1;h>=0;--h){var d=u[h],f=d.layer;if(mo(d,l)&&o.call(s,f))if(a=this.getLayerRenderer(f).forEachLayerAtCoordinate(c,e,i,r,n))return a}},e.prototype.registerLayerRenderers=function(e){t.prototype.registerLayerRenderers.call(this,e);for(var i=0,r=e.length;i<r;++i){var n=e[i];X(Js,n)||Js.push(n)}},e}(qs),$s=function(t){function e(e){t.call(this),this.layer_=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createLoadedTileFinder=function(t,e,i){return function(r,n){return t.forEachLoadedTile(e,r,n,function(t){i[r]||(i[r]={}),i[r][t.tileCoord.toString()]=t})}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r){},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleImageChange_=function(t){t.target.getState()===xs.LOADED&&this.renderIfReadyAndVisible()},e.prototype.hasFeatureAtCoordinate=function(t,e){return!1},e.prototype.loadImage=function(t){var e=t.getState();return e!=xs.LOADED&&e!=xs.ERROR&&v(t,M.CHANGE,this.handleImageChange_,this),e==xs.IDLE&&(t.load(),e=t.getState()),e==xs.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==ro.READY&&this.changed()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var r=o(t);r in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i,r){var n=o(e),s=i.toString();n in t?s in t[n]?t[n][s].extend(r):t[n][s]=r:(t[n]={},t[n][s]=r)},e.prototype.manageTilePyramid=function(t,e,i,r,n,s,a,h,l,u){var p=o(e);p in t.wantedTiles||(t.wantedTiles[p]={});var c,d,f,_,g,y,v=t.wantedTiles[p],m=t.tileQueue;for(y=i.getMinZoom();y<=a;++y)for(d=i.getTileRangeForExtentAndZ(s,y,d),f=i.getResolution(y),_=d.minX;_<=d.maxX;++_)for(g=d.minY;g<=d.maxY;++g)a-y<=h?((c=e.getTile(y,_,g,r,n)).getState()==On.IDLE&&(v[c.getKey()]=!0,m.isKeyQueued(c.getKey())||m.enqueue([c,p,i.getTileCoordCenter(c.tileCoord),f])),void 0!==l&&l.call(u,c)):e.useTile(y,_,g,n)},e}(F),ta=function(t){function e(e){t.call(this,e),this.renderedResolution,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clip=function(t,e,i){var r=e.pixelRatio,n=e.size[0]*r,o=e.size[1]*r,s=e.viewState.rotation,a=It(i),h=Lt(i),l=St(i),u=Et(i);De(e.coordinateToPixelTransform,a),De(e.coordinateToPixelTransform,h),De(e.coordinateToPixelTransform,l),De(e.coordinateToPixelTransform,u),t.save(),ks(t,-s,n/2,o/2),t.beginPath(),t.moveTo(a[0]*r,a[1]*r),t.lineTo(h[0]*r,h[1]*r),t.lineTo(l[0]*r,l[1]*r),t.lineTo(u[0]*r,u[1]*r),t.clip(),ks(t,s,n/2,o/2)},e.prototype.dispatchComposeEvent_=function(t,e,i,r){var n=this.getLayer();if(n.hasListener(t)){var o=i.size[0]*i.pixelRatio,s=i.size[1]*i.pixelRatio,a=i.viewState.rotation;ks(e,-a,o/2,s/2);var h=void 0!==r?r:this.getTransform(i,0),l=new Xs(e,i.pixelRatio,i.extent,h,i.viewState.rotation),u=new Cs(t,l,i,e,null);n.dispatchEvent(u),ks(e,a,o/2,s/2)}},e.prototype.forEachLayerAtCoordinate=function(t,e,i,r,n){return this.forEachFeatureAtCoordinate(t,e,i,R)?r.call(n,this.getLayer(),null):void 0},e.prototype.postCompose=function(t,e,i,r){this.dispatchComposeEvent_(ur.POSTCOMPOSE,t,e,r)},e.prototype.preCompose=function(t,e,i){this.dispatchComposeEvent_(ur.PRECOMPOSE,t,e,i)},e.prototype.dispatchRenderEvent=function(t,e,i){this.dispatchComposeEvent_(ur.RENDER,t,e,i)},e.prototype.getTransform=function(t,e){var i=t.viewState,r=t.pixelRatio,n=r*t.size[0]/2,o=r*t.size[1]/2,s=r/i.resolution,a=-s,h=-i.rotation,l=-i.center[0]+e,u=-i.center[1];return Ye(this.transform_,n,o,s,a,h,l,u)},e.prototype.composeFrame=function(t,e,i){r()},e.prototype.prepareFrame=function(t,e){return r()},e}($s),ea=function(t){function e(e){t.call(this,e),this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0],this.hitCanvasContext_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.composeFrame=function(t,e,i){this.preCompose(i,t);var r=this.getImage();if(r){var n=e.extent,o=void 0!==n&&!ot(n,t.extent)&&Pt(n,t.extent);o&&this.clip(i,t,n);var s=this.getImageTransform(),a=i.globalAlpha;i.globalAlpha=e.opacity;var h=s[4],l=s[5],u=r.width*s[0],p=r.height*s[3];u>=.5&&p>=.5&&i.drawImage(r,0,0,+r.width,+r.height,Math.round(h),Math.round(l),Math.round(u),Math.round(p)),i.globalAlpha=a,o&&i.restore()}this.postCompose(i,t,e)},e.prototype.getImage=function(){return r()},e.prototype.getImageTransform=function(){return r()},e.prototype.forEachLayerAtCoordinate=function(t,e,i,r,n){if(this.getImage()){var o=De(this.coordinateToCanvasPixelTransform,t.slice());tr(o,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=Jn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),o[0],o[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return s[3]>0?r.call(n,this.getLayer(),s):void 0}},e}(ta),ia=function(t){function e(i){if(t.call(this,i),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,i.getType()===Ss.VECTOR)for(var r=0,n=Js.length;r<n;++r){var o=Js[r];if(o!==e&&o.handles(i)){this.vectorRenderer_=new o(i);break}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.vectorRenderer_&&this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.prepareFrame=function(t,e){var i,r=t.pixelRatio,n=t.size,o=t.viewState,s=o.center,a=o.resolution,h=this.getLayer().getSource(),l=t.viewHints,p=this.vectorRenderer_,c=t.extent;if(p||void 0===e.extent||(c=wt(c,e.extent)),!l[kn]&&!l[jn]&&!bt(c)){var d=o.projection,f=this.skippedFeatures_;if(p){var _=p.context,g=u({},t,{size:[Ot(c)/a,Rt(c)/a],viewState:u({},t.viewState,{rotation:0})}),y=Object.keys(g.skippedFeatureUids).sort();i=new Es(c,a,r,_.canvas,function(t){!p.prepareFrame(g,e)||!p.replayGroupChanged&&Z(f,y)||(_.canvas.width=g.size[0]*r,_.canvas.height=g.size[1]*r,p.compose(_,g,e),f=y,t())})}else i=h.getImage(c,a,r,d);i&&this.loadImage(i)&&(this.image_=i,this.skippedFeatures_=f)}if(this.image_){var v=(i=this.image_).getExtent(),m=i.getResolution(),x=i.getPixelRatio(),E=r*m/(a*x),S=Ye(this.imageTransform_,r*n[0]/2,r*n[1]/2,E,E,0,x*(v[0]-s[0])/m,x*(s[1]-v[3])/m);Ye(this.coordinateToCanvasPixelTransform,r*n[0]/2-S[4],r*n[1]/2-S[5],r/a,-r/a,0,-s[0],-s[1]),this.renderedResolution=m*r/x}return!!this.image_},e.prototype.forEachFeatureAtCoordinate=function(e,i,r,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,i,r,n):t.prototype.forEachFeatureAtCoordinate.call(this,e,i,r,n)},e}(ea);ia.handles=function(t){return t.getType()===Ss.IMAGE||t.getType()===Ss.VECTOR&&t.getRenderMode()===Ts.IMAGE},ia.create=function(t,e){return new ia(e)};var ra=ia,na=function(t,e,i,r){this.minX=t,this.maxX=e,this.minY=i,this.maxY=r};function oa(t,e,i,r,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=r,n):new na(t,e,i,r)}na.prototype.contains=function(t){return this.containsXY(t[1],t[2])},na.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},na.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},na.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},na.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)},na.prototype.getHeight=function(){return this.maxY-this.minY+1},na.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},na.prototype.getWidth=function(){return this.maxX-this.minX+1},na.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var sa=na,aa=function(t){function e(e,i){t.call(this,e),this.context=i?null:Jn(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new sa(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==On.LOADED||i==On.EMPTY||i==On.ERROR&&!r},e.prototype.getTile=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource().getTile(t,e,i,r,n);return s.getState()==On.ERROR&&(o.getUseInterimTilesOnError()?o.getPreload()>0&&(this.newTiles_=!0):s.setState(On.LOADED)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},e.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,r=t.size,n=t.viewState,s=n.projection,a=n.resolution,h=n.center,l=this.getLayer(),u=l.getSource(),p=u.getRevision(),c=u.getTileGridForProjection(s),d=c.getZForResolution(a,this.zDirection),f=c.getResolution(d),_=Math.round(a/f)||1,g=t.extent;if(void 0!==e.extent&&(g=wt(g,e.extent)),bt(g))return!1;var y=c.getTileRangeForExtentAndZ(g,d),v=c.getTileRangeExtent(d,y),m=u.getTilePixelRatio(i),x={};x[d]={};var E,S,T,C=this.createLoadedTileFinder(u,s,x),R=t.viewHints,w=R[kn]||R[jn],I=this.tmpExtent,L=this.tmpTileRange_;for(this.newTiles_=!1,S=y.minX;S<=y.maxX;++S)for(T=y.minY;T<=y.maxY;++T)if(!(Date.now()-t.time>16&&w)){if(E=this.getTile(d,S,T,i,s),this.isDrawableTile_(E)){var O=o(this);if(E.getState()==On.LOADED){x[d][E.tileCoord.toString()]=E;var P=E.inTransition(O);this.newTiles_||!P&&-1!==this.renderedTiles.indexOf(E)||(this.newTiles_=!0)}if(1===E.getAlpha(O,t.time))continue}var b=c.getTileCoordChildTileRange(E.tileCoord,L,I),M=!1;b&&(M=C(d+1,b)),M||c.forEachTileCoordParentTileRange(E.tileCoord,C,null,L,I)}var F=f*i/m*_;if(!(this.renderedResolution&&Date.now()-t.time>16&&w)&&(this.newTiles_||!this.renderedExtent_||!ot(this.renderedExtent_,g)||this.renderedRevision!=p||_!=this.oversampling_||!w&&F!=this.renderedResolution)){var A=this.context;if(A){var N=u.getTilePixelSize(d,i,s),G=Math.round(y.getWidth()*N[0]/_),D=Math.round(y.getHeight()*N[1]/_),k=A.canvas;k.width!=G||k.height!=D?(this.oversampling_=_,k.width=G,k.height=D):(this.renderedExtent_&&!dt(v,this.renderedExtent_)&&A.clearRect(0,0,G,D),_=this.oversampling_)}this.renderedTiles.length=0;var j,U,Y,B,V,X,z,W,K,H,Z=Object.keys(x).map(Number);for(Z.sort(function(t,e){return t===d?1:e===d?-1:t>e?1:t<e?-1:0}),B=0,V=Z.length;B<V;++B)for(var q in Y=Z[B],U=u.getTilePixelSize(Y,i,s),j=c.getResolution(Y)/f,z=m*u.getGutterForProjection(s),W=x[Y])E=W[q],S=((X=c.getTileCoordExtent(E.getTileCoord(),I))[0]-v[0])/f*m/_,T=(v[3]-X[3])/f*m/_,K=U[0]*j/_,H=U[1]*j/_,this.drawTileImage(E,t,e,S,T,K,H,z,d===Y),this.renderedTiles.push(E);this.renderedRevision=p,this.renderedResolution=f*i/m*_,this.renderedExtent_=v}var J=this.renderedResolution/a,Q=Ye(this.imageTransform_,i*r[0]/2,i*r[1]/2,J,J,0,(this.renderedExtent_[0]-h[0])/this.renderedResolution*i,(h[1]-this.renderedExtent_[3])/this.renderedResolution*i);return Ye(this.coordinateToCanvasPixelTransform,i*r[0]/2-Q[4],i*r[1]/2-Q[5],i/a,-i/a,0,-h[0],-h[1]),this.updateUsedTiles(t.usedTiles,u,d,y),this.manageTilePyramid(t,u,c,i,s,g,d,l.getPreload()),this.scheduleExpireCache(t,u),this.renderedTiles.length>0},e.prototype.drawTileImage=function(t,e,i,r,n,s,a,h,l){var u=this.getTileImage(t);if(u){var p=o(this),c=l?t.getAlpha(p,e.time):1,d=this.getLayer().getSource();1!==c||d.getOpaque(e.viewState.projection)||this.context.clearRect(r,n,s,a);var f=c!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,h,h,u.width-2*h,u.height-2*h,r,n,s,a),f&&this.context.restore(),1!==c?e.animate=!0:l&&t.endTransition(p)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.getTileImage=function(t){return t.getImage()},e}(ea);aa.handles=function(t){return t.getType()===Ss.TILE},aa.create=function(t,e){return new aa(e)},aa.prototype.getLayer;var ha=aa,la=i(0),ua=i.n(la),pa=function(){};pa.prototype.getReplay=function(t,e){return r()},pa.prototype.isEmpty=function(){return r()},pa.prototype.addDeclutter=function(t){return r()};var ca=pa,da={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function fa(t,e,i,r,n,o,s,a){for(var h,l,u,p=[],c=t[e]>t[i-r],d=n.length,f=t[e],_=t[e+1],g=t[e+=r],y=t[e+1],v=0,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-_,2)),x="",E=0,S=0;S<d;++S){l=c?d-S-1:S;var T=n.charAt(l),C=o(x=c?T+x:x+T)-E;E+=C;for(var R=s+C/2;e<i-r&&v+m<R;)f=g,_=y,g=t[e+=r],y=t[e+1],v+=m,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-_,2));var w=R-v,I=Math.atan2(y-_,g-f);if(c&&(I+=I>0?-Math.PI:Math.PI),void 0!==u){var L=I-u;if(L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>a)return null}var O=w/m,P=zt(f,g,O),b=zt(_,y,O);u==I?(c&&(h[0]=P,h[1]=b,h[2]=C/2),h[4]=x):(E=C,h=[P,b,C/2,I,x=T],c?p.unshift(h):p.push(h),u=I),s+=C}return p}var _a={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},ga=[_a.FILL],ya=[_a.STROKE],va=[_a.BEGIN_PATH],ma=[_a.CLOSE_PATH],xa=_a,Ea=[da.POLYGON,da.CIRCLE,da.LINE_STRING,da.IMAGE,da.TEXT,da.DEFAULT],Sa={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ta=[1/0,1/0,-1/0,-1/0],Ca=[1,0,0,1,0,0],Ra=function(t){function e(e,i,r,n,o,s){t.call(this),this.declutterTree=s,this.tolerance=e,this.maxExtent=i,this.overlaps=o,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=r,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replayTextBackground_=function(t,e,i,r,n,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},e.prototype.replayImage_=function(t,e,i,r,n,o,s,a,h,l,u,p,c,d,f,_,g,y){var v=g||y;e-=n*=c,i-=o*=c;var m,x,E,S,T=f+l>r.width?r.width-l:f,C=a+u>r.height?r.height-u:a,R=_[3]+T*c+_[1],w=_[0]+C*c+_[2],I=e-_[3],L=i-_[0];(v||0!==p)&&(m=[I,L],x=[I+R,L],E=[I+R,L+w],S=[I,L+w]);var O=null;if(0!==p){var P=e+n,b=i+o;O=Ye(Ca,P,b,1,1,p,-P,-b),ut(Ta),_t(Ta,De(Ca,m)),_t(Ta,De(Ca,x)),_t(Ta,De(Ca,E)),_t(Ta,De(Ca,S))}else lt(I,L,I+R,L+w,Ta);var M=t.canvas,F=y?y[2]*c/2:0,A=Ta[0]-F<=M.width&&Ta[2]+F>=0&&Ta[1]-F<=M.height&&Ta[3]+F>=0;if(d&&(e=Math.round(e),i=Math.round(i)),s){if(!A&&1==s[4])return;ft(s,Ta);var N=A?[t,O?O.slice(0):null,h,r,l,u,T,C,e,i,c]:null;N&&v&&N.push(g,y,m,x,E,S),s.push(N)}else A&&(v&&this.replayTextBackground_(t,m,x,E,S,g,y),Us(t,O,h,r,l,u,T,C,e,i,c))},e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatCoordinates=function(t,e,i,r,n,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=r);var h,l,u,p=[t[e],t[e+1]],c=[NaN,NaN],d=!0;for(h=e+r;h<i;h+=r)c[0]=t[h],c[1]=t[h+1],(u=at(a,c))!==l?(d&&(this.coordinates[s++]=p[0],this.coordinates[s++]=p[1]),this.coordinates[s++]=c[0],this.coordinates[s++]=c[1],d=!1):u===$.INTERSECTING?(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1],d=!1):d=!0,p[0]=c[0],p[1]=c[1],l=u;return(n&&d||h===e+r)&&(this.coordinates[s++]=p[0],this.coordinates[s++]=p[1]),s},e.prototype.drawCustomCoordinates_=function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o],h=this.appendFlatCoordinates(t,e,a,r,!1,!1);n.push(h),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var r,n,o,s,a,h=t.getType(),l=t.getStride(),u=this.coordinates.length;if(h==Nt.MULTI_POLYGON){r=(t=t).getOrientedFlatCoordinates(),s=[];var p=t.getEndss();a=0;for(var c=0,d=p.length;c<d;++c){var f=[];a=this.drawCustomCoordinates_(r,a,p[c],l,f),s.push(f)}this.instructions.push([xa.CUSTOM,u,s,t,i,oi])}else h==Nt.POLYGON||h==Nt.MULTI_LINE_STRING?(o=[],r=h==Nt.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(r,0,t.getEnds(),l,o),this.instructions.push([xa.CUSTOM,u,o,t,i,ni])):h==Nt.LINE_STRING||h==Nt.MULTI_POINT?(r=t.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,l,!1,!1),this.instructions.push([xa.CUSTOM,u,n,t,i,ri])):h==Nt.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([xa.CUSTOM,u,n,t,i]));this.endGeometry(t,e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[xa.BEGIN_GEOMETRY,e,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[xa.BEGIN_GEOMETRY,e,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){},e.prototype.fill_=function(t){if(this.alignFill_){var e=De(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.setTransform.apply(t,js)},e.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],ki&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},e.prototype.renderDeclutter_=function(t,e){if(t&&t.length>5){var i=t[4];if(1==i||i==t.length-5){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var n=5,o=t.length;n<o;++n){var s=t[n];s&&(s.length>11&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),Us.apply(void 0,s))}}t.length=5,ut(t)}}},e.prototype.replay_=function(t,e,i,r,n,s,a){var h;this.pixelCoordinates_&&Z(e,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Gt(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Ge(this.renderedTransform_,e));for(var l,u,p,c,f,_,g,y,v,m,x,E,S=!d(i),T=0,C=r.length,R=0,w=0,I=0,L=null,O=null,P=this.coordinateCache_,b=this.viewRotation_,M={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:b},F=this.instructions!=r||this.overlaps?0:200;T<C;){var A=r[T];switch(A[0]){case xa.BEGIN_GEOMETRY:m=A[1],S&&i[o(m)]||!m.getGeometry()?T=A[2]:void 0===a||Pt(a,m.getGeometry().getExtent())?++T:T=A[2]+1;break;case xa.BEGIN_PATH:w>F&&(this.fill_(t),w=0),I>F&&(t.stroke(),I=0),w||I||(t.beginPath(),c=f=NaN),++T;break;case xa.CIRCLE:var N=h[R=A[1]],G=h[R+1],D=h[R+2]-N,k=h[R+3]-G,j=Math.sqrt(D*D+k*k);t.moveTo(N+j,G),t.arc(N,G,j,0,2*Math.PI,!0),++T;break;case xa.CLOSE_PATH:t.closePath(),++T;break;case xa.CUSTOM:R=A[1],l=A[2];var U=A[3],Y=A[4],B=6==A.length?A[5]:void 0;M.geometry=U,M.feature=m,T in P||(P[T]=[]);var V=P[T];B?B(h,R,l,2,V):(V[0]=h[R],V[1]=h[R+1],V.length=2),Y(V,M),++T;break;case xa.DRAW_IMAGE:R=A[1],l=A[2],v=A[3],u=A[4],p=A[5],y=s?null:A[6];var X=A[7],z=A[8],W=A[9],K=A[10],H=A[11],q=A[12],J=A[13],Q=A[14],$=void 0,tt=void 0,et=void 0;for(A.length>16?($=A[15],tt=A[16],et=A[17]):($=Os,tt=et=!1),H&&(q+=b);R<l;R+=2)this.replayImage_(t,h[R],h[R+1],v,u,p,y,X,z,W,K,q,J,n,Q,$,tt?L:null,et?O:null);this.renderDeclutter_(y,m),++T;break;case xa.DRAW_CHARS:var it=A[1],rt=A[2],nt=A[3];y=s?null:A[4];var ot=A[5],st=A[6],at=A[7],ht=A[8],lt=A[9],ut=A[10],pt=A[11],ct=A[12],dt=A[13],ft=A[14],_t=ar(h,it,rt,2),gt=ht(ct);if(ot||gt<=_t){var yt=this,vt=yt.textStates[dt].textAlign,mt=fa(h,it,rt,2,ct,ht,(_t-gt)*Sa[vt],at);if(mt){var xt=void 0,Et=void 0,St=void 0,Tt=void 0,Ct=void 0;if(ut)for(xt=0,Et=mt.length;xt<Et;++xt)St=(Ct=mt[xt])[4],Tt=yt.getImage(St,dt,"",ut),u=Ct[2]+pt,p=nt*Tt.height+2*(.5-nt)*pt-lt,this.replayImage_(t,Ct[0],Ct[1],Tt,u,p,y,Tt.height,1,0,0,Ct[3],ft,!1,Tt.width,Os,null,null);if(st)for(xt=0,Et=mt.length;xt<Et;++xt)St=(Ct=mt[xt])[4],Tt=yt.getImage(St,dt,st,""),u=Ct[2],p=nt*Tt.height-lt,this.replayImage_(t,Ct[0],Ct[1],Tt,u,p,y,Tt.height,1,0,0,Ct[3],ft,!1,Tt.width,Os,null,null)}}this.renderDeclutter_(y,m),++T;break;case xa.END_GEOMETRY:if(void 0!==s){var Rt=s(m=A[1]);if(Rt)return Rt}++T;break;case xa.FILL:F?w++:this.fill_(t),++T;break;case xa.MOVE_TO_LINE_TO:for(R=A[1],l=A[2],x=h[R],g=(E=h[R+1])+.5|0,(_=x+.5|0)===c&&g===f||(t.moveTo(x,E),c=_,f=g),R+=2;R<l;R+=2)_=(x=h[R])+.5|0,g=(E=h[R+1])+.5|0,R!=l-2&&_===c&&g===f||(t.lineTo(x,E),c=_,f=g);++T;break;case xa.SET_FILL_STYLE:L=A,this.alignFill_=A[2],w&&(this.fill_(t),w=0,I&&(t.stroke(),I=0)),t.fillStyle=A[1],++T;break;case xa.SET_STROKE_STYLE:O=A,I&&(t.stroke(),I=0),this.setStrokeStyle_(t,A),++T;break;case xa.STROKE:F?I++:t.stroke(),++T;break;default:++T}}w&&this.fill_(t),I&&t.stroke()},e.prototype.replay=function(t,e,i,r,n){this.viewRotation_=i,this.replay_(t,e,r,this.instructions,n,void 0,void 0)},e.prototype.replayHitDetection=function(t,e,i,r,n,o){return this.viewRotation_=i,this.replay_(t,e,r,this.hitDetectionInstructions,!0,n,o)},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,r,n=e.length,o=-1;for(t=0;t<n;++t)(r=(i=e[t])[0])==xa.END_GEOMETRY?o=t:r==xa.BEGIN_GEOMETRY&&(i[2]=t,W(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var r=t.getColor();i.fillStyle=Ys(r||ws)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=Ys(n||Ls);var o=e.getLineCap();i.lineCap=void 0!==o?o:"round";var s=e.getLineDash();i.lineDash=s?s.slice():Is;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var h=e.getLineJoin();i.lineJoin=void 0!==h?h:"round";var l=e.getWidth();i.lineWidth=void 0!==l?l:1;var u=e.getMiterLimit();i.miterLimit=void 0!==u?u: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,e){var i=t.fillStyle,r=[xa.SET_FILL_STYLE,i];return"string"!=typeof i&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[xa.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,i){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!Z(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=h)},e.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[xa.END_GEOMETRY,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=it(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;et(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Vs),wa=function(t){function e(e,i,r,n,o,s){t.call(this,e,i,r,n,o,s),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,r){return this.appendFlatCoordinates(t,e,i,r,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([xa.DRAW_IMAGE,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([xa.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([xa.DRAW_IMAGE,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([xa.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),r=t.getSize(),n=t.getHitDetectionImage(1),o=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=r[0]},e}(Ra),Ia=function(t){function e(e,i,r,n,o,s){t.call(this,e,i,r,n,o,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinates_=function(t,e,i,r){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,r,!1,!1),s=[xa.MOVE_TO_LINE_TO,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([xa.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],va);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(ya),this.endGeometry(t,e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([xa.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],va);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),h=0,l=0,u=o.length;l<u;++l)h=this.drawFlatCoordinates_(s,h,o[l],a);this.hitDetectionInstructions.push(ya),this.endGeometry(t,e)}},e.prototype.finish=function(){var t=this.state;void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(ya),this.reverseHitDetectionInstructions(),this.state=null},e.prototype.applyStroke=function(e){void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(ya),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(va)},e}(Ra),La=function(t){function e(e,i,r,n,o,s){t.call(this,e,i,r,n,o,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinatess_=function(t,e,i,r){var n=this.state,o=void 0!==n.fillStyle,s=void 0!=n.strokeStyle,a=i.length;this.instructions.push(va),this.hitDetectionInstructions.push(va);for(var h=0;h<a;++h){var l=i[h],u=this.coordinates.length,p=this.appendFlatCoordinates(t,e,l,r,!0,!s),c=[xa.MOVE_TO_LINE_TO,u,p];this.instructions.push(c),this.hitDetectionInstructions.push(c),s&&(this.instructions.push(ma),this.hitDetectionInstructions.push(ma)),e=l}return o&&(this.instructions.push(ga),this.hitDetectionInstructions.push(ga)),s&&(this.instructions.push(ya),this.hitDetectionInstructions.push(ya)),e},e.prototype.drawCircle=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([xa.SET_FILL_STYLE,dr(ws)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([xa.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.appendFlatCoordinates(o,0,o.length,s,!1,!1);var h=[xa.CIRCLE,a];this.instructions.push(va,h),this.hitDetectionInstructions.push(va,h),this.hitDetectionInstructions.push(ga),void 0!==i.fillStyle&&this.instructions.push(ga),void 0!==i.strokeStyle&&(this.instructions.push(ya),this.hitDetectionInstructions.push(ya)),this.endGeometry(t,e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([xa.SET_FILL_STYLE,dr(ws)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([xa.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(t,e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([xa.SET_FILL_STYLE,dr(ws)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([xa.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(),h=0,l=0,u=o.length;l<u;++l)h=this.drawFlatCoordinatess_(s,h,o[l],a);this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t)for(var e=this.coordinates,i=0,r=e.length;i<r;++i)e[i]=hi(e[i],t)},e.prototype.setFillStrokeStyles_=function(t){var e=this.state;void 0!==e.fillStyle&&this.updateFillStyle(e,this.createFill,t),void 0!==e.strokeStyle&&this.updateStrokeStyle(e,this.applyStroke)},e}(Ra);function Oa(t,e,i,r,n){var o,s,a,h,l,u,p,c,d,f=i,_=i,g=0,y=0,v=i;for(o=i;o<r;o+=n){var m=e[o],x=e[o+1];void 0!==h&&(c=m-h,d=x-l,a=Math.sqrt(c*c+d*d),void 0!==u&&(y+=s,Math.acos((u*c+p*d)/(s*a))>t&&(y>g&&(g=y,f=v,_=o),y=0,v=o-n)),s=a,u=c,p=d),h=m,l=x}return(y+=a)>g?[v,o]:[f,_]}var Pa={Circle:La,Default:Ra,Image:wa,LineString:Ia,Polygon:La,Text:function(t){function e(e,i,r,n,o,s){t.call(this,e,i,r,n,o,s),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Ps.prune()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText=function(t,e){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var o,s,a=this.coordinates.length,h=t.getType(),l=null,u=2,p=2;if(n.placement===Tr){if(!Pt(this.getBufferedMaxExtent(),t.getExtent()))return;var c;if(l=t.getFlatCoordinates(),p=t.getStride(),h==Nt.LINE_STRING)c=[l.length];else if(h==Nt.MULTI_LINE_STRING)c=t.getEnds();else if(h==Nt.POLYGON)c=t.getEnds().slice(0,1);else if(h==Nt.MULTI_POLYGON){var d=t.getEndss();for(c=[],o=0,s=d.length;o<s;++o)c.push(d[o][0])}this.beginGeometry(t,e);for(var f,_=n.textAlign,g=0,y=0,v=c.length;y<v;++y){if(void 0==_){var m=Oa(n.maxAngle,l,g,c[y],p);g=m[0],f=m[1]}else f=c[y];for(o=g;o<f;o+=p)this.coordinates.push(l[o],l[o+1]);u=this.coordinates.length,g=c[y],this.drawChars_(a,u,this.declutterGroup_),a=u}this.endGeometry(t,e)}else{var x=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),E=x.width/this.pixelRatio;switch(h){case Nt.POINT:case Nt.MULTI_POINT:u=(l=t.getFlatCoordinates()).length;break;case Nt.LINE_STRING:l=t.getFlatMidpoint();break;case Nt.CIRCLE:l=t.getCenter();break;case Nt.MULTI_LINE_STRING:u=(l=t.getFlatMidpoints()).length;break;case Nt.POLYGON:if(l=t.getFlatInteriorPoint(),!n.overflow&&l[2]/this.resolution<E)return;p=3;break;case Nt.MULTI_POLYGON:var S=t.getFlatInteriorPoints();for(l=[],o=0,s=S.length;o<s;o+=3)(n.overflow||S[o+2]/this.resolution>=E)&&l.push(S[o],S[o+1]);if(0==(u=l.length))return}u=this.appendFlatCoordinates(l,0,u,p,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(x,a,u),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,i,r){var n,o=r+e+t+i+this.pixelRatio;if(!Ps.containsKey(o)){var s=r?this.strokeStates[r]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,h=this.textStates[e]||this.textState_,l=this.pixelRatio,u=h.scale*l,p=Sa[h.textAlign||"center"],c=r&&s.lineWidth?s.lineWidth:0,d=t.split("\n"),f=d.length,_=[],g=function(t,e,i){for(var r=e.length,n=0,o=0;o<r;++o){var s=Ds(t,e[o]);n=Math.max(n,s),i.push(s)}return n}(h.font,d,_),y=Gs(h.font),v=y*f,m=g+c,x=Jn(Math.ceil(m*u),Math.ceil((v+c)*u));n=x.canvas,Ps.set(o,n),1!=u&&x.scale(u,u),x.font=h.font,r&&(x.strokeStyle=s.strokeStyle,x.lineWidth=c,x.lineCap=s.lineCap,x.lineJoin=s.lineJoin,x.miterLimit=s.miterLimit,ki&&s.lineDash.length&&(x.setLineDash(s.lineDash),x.lineDashOffset=s.lineDashOffset)),i&&(x.fillStyle=a.fillStyle),x.textBaseline="middle",x.textAlign="center";var E,S=.5-p,T=p*n.width/u+S*c;if(r)for(E=0;E<f;++E)x.strokeText(d[E],T+S*_[E],.5*(c+y)+E*y);if(i)for(E=0;E<f;++E)x.fillText(d[E],T+S*_[E],.5*(c+y)+E*y)}return Ps.get(o)},e.prototype.drawTextImage_=function(t,e,i){var r=this.textState_,n=this.textStrokeState_,o=this.pixelRatio,s=Sa[r.textAlign||"center"],a=Sa[r.textBaseline],h=n&&n.lineWidth?n.lineWidth:0,l=s*t.width/o+2*(.5-s)*h,u=a*t.height/o+2*(.5-a)*h;this.instructions.push([xa.DRAW_IMAGE,e,i,t,(l-this.textOffsetX_)*o,(u-this.textOffsetY_)*o,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,t.width,r.padding==Os?Os:r.padding.map(function(t){return t*o}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([xa.DRAW_IMAGE,e,i,t,(l-this.textOffsetX_)*o,(u-this.textOffsetY_)*o,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/o,t.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},e.prototype.drawChars_=function(t,e,i){var r=this.textStrokeState_,n=this.textState_,o=this.textFillState_,s=this.strokeKey_;r&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||"center",scale:n.scale});var h=this.fillKey_;o&&(h in this.fillStates||(this.fillStates[h]={fillStyle:o.fillStyle}));var l=this.pixelRatio,u=Sa[n.textBaseline],p=this.textOffsetY_*l,c=this.text_,d=n.font,f=n.scale,_=r?r.lineWidth*f/2:0,g=this.widths_[d];g||(this.widths_[d]=g={}),this.instructions.push([xa.DRAW_CHARS,t,e,u,i,n.overflow,h,n.maxAngle,function(t){var e=g[t];return e||(e=g[t]=Ds(d,t)),e*f*l},p,s,_*l,c,a,1]),this.hitDetectionInstructions.push([xa.DRAW_CHARS,t,e,u,i,n.overflow,h,n.maxAngle,function(t){var e=g[t];return e||(e=g[t]=Ds(d,t)),e*f},p,s,_,c,a,1/l])},e.prototype.setTextStyle=function(t,e){var i,r,n;if(t){this.declutterGroup_=e;var s=t.getFill();s?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=Ys(s.getColor()||ws)):r=this.textFillState_=null;var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var h=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||"round",n.lineDash=h?h.slice():Is,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||"round",n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=Ys(a.getColor()||Ls)}else n=this.textStrokeState_=null;i=this.textState_;var c=t.getFont()||"10px sans-serif";As(c);var d=t.getScale();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()||Os,i.scale=void 0===d?1:d;var f=t.getOffsetX(),_=t.getOffsetY(),g=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===_?0:_,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===y?0:y,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:o(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+o(r.fillStyle):""}else this.text_=""},e}(Ra)},ba=function(t){function e(e,i,r,n,o,s,a){t.call(this),this.declutterTree_=s,this.declutterGroup_=null,this.tolerance_=e,this.maxExtent_=i,this.overlaps_=o,this.pixelRatio_=n,this.resolution_=r,this.renderBuffer_=a,this.replaysByZIndex_={},this.hitDetectionContext_=Jn(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addDeclutter=function(t){var e=null;return this.declutterTree_&&(t?(e=this.declutterGroup_)[4]++:(e=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),e},e.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()},e.prototype.hasReplays=function(t){for(var e in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[e],r=0,n=t.length;r<n;++r)if(t[r]in i)return!0;return!1},e.prototype.finish=function(){for(var t in this.replaysByZIndex_){var e=this.replaysByZIndex_[t];for(var i in e)e[i].finish()}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s){var a,h=2*(r=Math.round(r))+1,l=Ye(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-i,-t[0],-t[1]),u=this.hitDetectionContext_;u.canvas.width!==h||u.canvas.height!==h?(u.canvas.width=h,u.canvas.height=h):u.clearRect(0,0,h,h),void 0!==this.renderBuffer_&&(_t(a=[1/0,1/0,-1/0,-1/0],t),et(a,e*(this.renderBuffer_+r),a));var p,c,d=function(t){if(void 0!==Ma[t])return Ma[t];for(var e=2*t+1,i=new Array(e),r=0;r<e;r++)i[r]=new Array(e);var n=t,o=0,s=0;for(;n>=o;)Fa(i,t+n,t+o),Fa(i,t+o,t+n),Fa(i,t-o,t+n),Fa(i,t-n,t+o),Fa(i,t-n,t-o),Fa(i,t-o,t-n),Fa(i,t+o,t-n),Fa(i,t+n,t-o),2*((s+=1+2*++o)-n)+1>0&&(s+=1-2*(n-=1));return Ma[t]=i,i}(r);function f(t){for(var e=u.getImageData(0,0,h,h).data,i=0;i<h;i++)for(var r=0;r<h;r++)if(d[i][r]&&e[4*(r*h+i)+3]>0){var n=void 0;return(!p||c!=da.IMAGE&&c!=da.TEXT||-1!==p.indexOf(t))&&(n=o(t)),n||void u.clearRect(0,0,h,h)}}this.declutterTree_&&(p=this.declutterTree_.all().map(function(t){return t.value}));var _,g,y,v,m,x=Object.keys(this.replaysByZIndex_).map(Number);for(x.sort(V),_=x.length-1;_>=0;--_){var E=x[_].toString();for(y=this.replaysByZIndex_[E],g=Ea.length-1;g>=0;--g)if(void 0!==(v=y[c=Ea[g]]))if(!s||c!=da.IMAGE&&c!=da.TEXT){if(m=v.replayHitDetection(u,l,i,n,f,a))return m}else{var S=s[E];S?S.push(v,l.slice(0)):s[E]=[v,l.slice(0)]}}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],r=e[1],n=e[2],o=e[3],s=[i,r,i,o,n,o,n,r];return Gt(s,0,8,2,t,s),s},e.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new(0,Pa[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[e]=n);return n},e.prototype.getReplays=function(){return this.replaysByZIndex_},e.prototype.isEmpty=function(){return d(this.replaysByZIndex_)},e.prototype.replay=function(t,e,i,r,n,o,s){var a=Object.keys(this.replaysByZIndex_).map(Number);a.sort(V),t.save(),this.clip(t,e);var h,l,u,p,c,d,f=o||Ea;for(h=0,l=a.length;h<l;++h){var _=a[h].toString();for(c=this.replaysByZIndex_[_],u=0,p=f.length;u<p;++u){var g=f[u];if(d=c[g],void 0!==d)if(!s||g!=da.IMAGE&&g!=da.TEXT)d.replay(t,e,i,r,n);else{var y=s[_];y?y.push(d,e.slice(0)):s[_]=[d,e.slice(0)]}}}t.restore()},e}(ca),Ma={0:[[!0]]};function Fa(t,e,i){var r,n=Math.floor(t.length/2);if(e>=n)for(r=n;r<e;r++)t[r][i]=!0;else if(e<n)for(r=e+1;r<n;r++)t[r][i]=!0}var Aa=ba,Na=.5,Ga={Point:function(t,e,i,r){var n=i.getImage();if(n){if(n.getImageState()!=xs.LOADED)return;var o=t.getReplay(i.getZIndex(),da.IMAGE);o.setImageStyle(n,t.addDeclutter(!1)),o.drawPoint(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),da.TEXT);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,r)}},LineString:function(t,e,i,r){var n=i.getStroke();if(n){var o=t.getReplay(i.getZIndex(),da.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawLineString(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),da.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,r)}},Polygon:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var s=t.getReplay(i.getZIndex(),da.POLYGON);s.setFillStrokeStyle(n,o),s.drawPolygon(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),da.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}},MultiPoint:function(t,e,i,r){var n=i.getImage();if(n){if(n.getImageState()!=xs.LOADED)return;var o=t.getReplay(i.getZIndex(),da.IMAGE);o.setImageStyle(n,t.addDeclutter(!1)),o.drawMultiPoint(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),da.TEXT);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,r)}},MultiLineString:function(t,e,i,r){var n=i.getStroke();if(n){var o=t.getReplay(i.getZIndex(),da.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawMultiLineString(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),da.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,r)}},MultiPolygon:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(o||n){var s=t.getReplay(i.getZIndex(),da.POLYGON);s.setFillStrokeStyle(n,o),s.drawMultiPolygon(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),da.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}},GeometryCollection:function(t,e,i,r){var n,o,s=e.getGeometriesArray();for(n=0,o=s.length;n<o;++n){var a=Ga[s[n].getType()];a(t,s[n],i,r)}},Circle:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var s=t.getReplay(i.getZIndex(),da.CIRCLE);s.setFillStrokeStyle(n,o),s.drawCircle(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),da.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}}};function Da(t,e){return parseInt(o(t),10)-parseInt(o(e),10)}function ka(t,e){var i=ja(t,e);return i*i}function ja(t,e){return Na*t/e}function Ua(t,e,i,r,n,o){var s=!1,a=i.getImage();if(a){var h=a.getImageState();h==xs.LOADED||h==xs.ERROR?a.unlistenImageChange(n,o):(h==xs.IDLE&&a.load(),h=a.getImageState(),a.listenImageChange(n,o),s=!0)}return function(t,e,i,r){var n=i.getGeometryFunction()(e);if(!n)return;var o=n.getSimplifiedGeometry(r);if(i.getRenderer())!function t(e,i,r,n){if(i.getType()==Nt.GEOMETRY_COLLECTION){for(var o=i.getGeometries(),s=0,a=o.length;s<a;++s)t(e,o[s],r,n);return}var h=e.getReplay(r.getZIndex(),da.DEFAULT);h.drawCustom(i,n,r.getRenderer())}(t,o,i,e);else{var s=Ga[o.getType()];s(t,o,i,e)}}(t,e,i,r),s}var Ya=function(t){function e(e){t.call(this,e),this.declutterTree_=e.getDeclutter()?ua()(9,void 0):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=Jn(),v(Ps,M.CLEAR,this.handleFontsChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){x(Ps,M.CLEAR,this.handleFontsChanged_,this),t.prototype.disposeInternal.call(this)},e.prototype.compose=function(t,e,i){var r=e.extent,n=e.pixelRatio,o=i.managed?e.skippedFeatureUids:{},s=e.viewState,a=s.projection,h=s.rotation,l=a.getExtent(),u=this.getLayer().getSource(),p=this.getTransform(e,0),c=i.extent,d=void 0!==c;d&&this.clip(t,e,c);var f=this.replayGroup_;if(f&&!f.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var _,g=this.getLayer(),y=0,v=0,m=1!==i.opacity,x=g.hasListener(ur.RENDER);if(m||x){var E=t.canvas.width,S=t.canvas.height;if(h){var T=Math.round(Math.sqrt(E*E+S*S));y=(T-E)/2,v=(T-S)/2,E=S=T}this.context.canvas.width=E,this.context.canvas.height=S,_=this.context}else _=t;var C=_.globalAlpha;m||(_.globalAlpha=i.opacity),_!=t&&_.translate(y,v);var R=e.viewHints,w=!(R[kn]||R[jn]),I=e.size[0]*n,L=e.size[1]*n;if(ks(_,-h,I/2,L/2),f.replay(_,p,h,o,w),u.getWrapX()&&a.canWrapX()&&!ot(l,r)){for(var O,P=r[0],b=Ot(l),M=0;P<l[0];)O=b*--M,p=this.getTransform(e,O),f.replay(_,p,h,o,w),P+=b;for(M=0,P=r[2];P>l[2];)O=b*++M,p=this.getTransform(e,O),f.replay(_,p,h,o,w),P-=b}if(ks(_,h,I/2,L/2),x&&this.dispatchRenderEvent(_,e,p),_!=t){if(m){var F=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(_.canvas,-y,-v),t.globalAlpha=F}else t.drawImage(_.canvas,-y,-v);_.translate(-y,-v)}m||(_.globalAlpha=C)}d&&t.restore()},e.prototype.composeFrame=function(t,e,i){var r=this.getTransform(t,0);this.preCompose(i,t,r),this.compose(i,t,e),this.postCompose(i,t,e,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(this.replayGroup_){var s=e.viewState.resolution,a=e.viewState.rotation,h=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,s,a,i,{},function(t){var e=o(t);if(!(e in l))return l[e]=!0,r.call(n,t,h)},null)}},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e){var i=this.getLayer(),r=i.getSource(),n=t.viewHints[kn],o=t.viewHints[jn],s=i.getUpdateWhileAnimating(),a=i.getUpdateWhileInteracting();if(!this.dirty_&&!s&&n||!a&&o)return!0;var h=t.extent,l=t.viewState,u=l.projection,p=l.resolution,c=t.pixelRatio,d=i.getRevision(),f=i.getRenderBuffer(),_=i.getRenderOrder();void 0===_&&(_=Da);var g=et(h,f*p),y=l.projection.getExtent();if(r.getWrapX()&&l.projection.canWrapX()&&!ot(y,t.extent)){var v=Ot(y),m=Math.max(Ot(g)/2,v);g[0]=y[0]-m,g[2]=y[2]+m}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==d&&this.renderedRenderOrder_==_&&ot(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var x=new Aa(ja(p,c),g,p,c,r.getOverlaps(),this.declutterTree_,i.getRenderBuffer());r.loadFeatures(g,p,u);var E=function(t){var e,r=t.getStyleFunction()||i.getStyleFunction();if(r&&(e=r(t,p)),e){var n=this.renderFeature(t,p,c,e,x);this.dirty_=this.dirty_||n}}.bind(this);if(_){var S=[];r.forEachFeatureInExtent(g,function(t){S.push(t)}),S.sort(_);for(var T=0,C=S.length;T<C;++T)E(S[T])}else r.forEachFeatureInExtent(g,E);return x.finish(),this.renderedResolution_=p,this.renderedRevision_=d,this.renderedRenderOrder_=_,this.renderedExtent_=g,this.replayGroup_=x,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,r,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=0,a=r.length;s<a;++s)o=Ua(n,t,r[s],ka(e,i),this.handleStyleImageChange_,this)||o;else o=Ua(n,t,r,ka(e,i),this.handleStyleImageChange_,this);return o},e}(ta);Ya.handles=function(t){return t.getType()===Ss.VECTOR},Ya.create=function(t,e){return new Ya(e)};var Ba=Ya,Va={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"},Xa={image:[da.POLYGON,da.CIRCLE,da.LINE_STRING,da.IMAGE,da.TEXT],hybrid:[da.POLYGON,da.LINE_STRING]},za={image:[da.DEFAULT],hybrid:[da.IMAGE,da.TEXT,da.DEFAULT],vector:Ea},Wa=function(t){function e(e){t.call(this,e,!0),this.declutterTree_=e.getDeclutter()?ua()(9,void 0):null,this.dirty_=!1,this.renderedLayerRevision_,this.tmpTransform_=[1,0,0,1,0,0];var i=e.getRenderMode();this.zDirection=i===Va.VECTOR?1:0,i!==Va.VECTOR&&(this.context=Jn()),v(Ps,M.CLEAR,this.handleFontsChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){x(Ps,M.CLEAR,this.handleFontsChanged_,this),t.prototype.disposeInternal.call(this)},e.prototype.getTile=function(e,i,r,n,o){var s=t.prototype.getTile.call(this,e,i,r,n,o);return s.getState()===On.LOADED&&(this.createReplayGroup_(s,n,o),this.context&&this.renderTileImage_(s,n,o)),s},e.prototype.getTileImage=function(t){var e=this.getLayer();return t.getImage(e)},e.prototype.prepareFrame=function(e,i){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e,i)},e.prototype.createReplayGroup_=function(t,e,i){var r=this,n=this.getLayer(),o=n.getRevision(),s=n.getRenderOrder()||null,a=t.getReplayState(n);if(a.dirty||a.renderedRevision!=o||a.renderedRenderOrder!=s){for(var h=n.getSource(),l=h.getTileGrid(),u=h.getTileGridForProjection(i).getResolution(t.tileCoord[0]),p=t.extent,c=function(o,c){var d=t.getTile(t.tileKeys[o]);if(d.getState()==On.LOADED){var f=d.tileCoord,_=l.getTileCoordExtent(f),g=wt(p,_),y=dt(_,g)?null:et(g,n.getRenderBuffer()*u,r.tmpExtent),v=d.getProjection(),m=!1;Ie(i,v)||(m=!0,d.setProjection(i)),a.dirty=!1;var x=new Aa(0,g,u,e,h.getOverlaps(),r.declutterTree_,n.getRenderBuffer()),E=ka(u,e),S=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,u)),e){var r=this.renderFeature(t,E,e,x);this.dirty_=this.dirty_||r,a.dirty=a.dirty||r}},T=d.getFeatures();s&&s!==a.renderedRenderOrder&&T.sort(s);for(var C=0,R=T.length;C<R;++C){var w=T[C];m&&(v.getUnits()==$t.TILE_PIXELS&&(v.setWorldExtent(_),v.setExtent(d.getExtent())),w.getGeometry().transform(v,i)),y&&!Pt(y,w.getGeometry().getExtent())||S.call(r,w)}x.finish(),d.setReplayGroup(n,t.tileCoord.toString(),x)}},d=0,f=t.tileKeys.length;d<f;++d)c(d);a.renderedRevision=o,a.renderedRenderOrder=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var s=e.viewState.resolution,a=e.viewState.rotation;i=void 0==i?0:i;var h,l,u,p,c=this.getLayer(),d={},f=this.renderedTiles;for(u=0,p=f.length;u<p;++u){var _=f[u];if(nt(h=et(_.extent,i*s,h),t))for(var g=0,y=_.tileKeys.length;g<y;++g){var v=_.getTile(_.tileKeys[g]);if(v.getState()==On.LOADED){var m=v.getReplayGroup(c,_.tileCoord.toString());l=l||m.forEachFeatureAtCoordinate(t,s,a,i,{},function(t){var e=o(t);if(!(e in d))return d[e]=!0,r.call(n,t,c)},null)}}}return l},e.prototype.getReplayTransform_=function(t,e){var i=this.getLayer().getSource().getTileGrid(),r=t.tileCoord,n=i.getResolution(r[0]),o=e.viewState,s=e.pixelRatio,a=o.resolution/s,h=i.getTileCoordExtent(r,this.tmpExtent),l=o.center,u=It(h),p=e.size,c=Math.round(s*p[0]/2),d=Math.round(s*p[1]/2);return Ye(this.tmpTransform_,c,d,n/a,n/a,o.rotation,(u[0]-l[0])/n,(l[1]-u[1])/n)},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&void 0!==this.renderedLayerRevision_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.postCompose=function(e,i,r){var n=this.getLayer(),o=n.getRenderMode();if(o!=Va.IMAGE){var s,a,h=n.getDeclutter()?{}:null,l=n.getSource(),u=za[o],p=i.pixelRatio,c=i.viewState.rotation,d=i.size;c&&ks(e,-c,s=Math.round(p*d[0]/2),a=Math.round(p*d[1]/2)),h&&this.declutterTree_.clear();for(var f=i.viewHints,_=!(f[kn]||f[jn]),g=this.renderedTiles,y=l.getTileGridForProjection(i.viewState.projection),v=[],m=[],x=g.length-1;x>=0;--x){var E=g[x];if(E.getState()!=On.ABORT)for(var S=E.tileCoord,T=y.getTileCoordExtent(S,this.tmpExtent)[0]-E.extent[0],C=void 0,R=0,w=E.tileKeys.length;R<w;++R){var I=E.getTile(E.tileKeys[R]);if(I.getState()==On.LOADED){var L=I.getReplayGroup(n,S.toString());if(L&&L.hasReplays(u)){C||(C=this.getTransform(i,T));var O=I.tileCoord[0],P=L.getClipCoords(C);e.save(),e.globalAlpha=r.opacity;for(var b=0,M=v.length;b<M;++b){var F=v[b];O<m[b]&&(e.beginPath(),e.moveTo(P[0],P[1]),e.lineTo(P[2],P[3]),e.lineTo(P[4],P[5]),e.lineTo(P[6],P[7]),e.moveTo(F[6],F[7]),e.lineTo(F[4],F[5]),e.lineTo(F[2],F[3]),e.lineTo(F[0],F[1]),e.clip())}L.replay(e,C,c,{},_,u,h),e.restore(),v.push(P),m.push(O)}}}}h&&function(t,e,i,r){for(var n=Object.keys(t).map(Number).sort(V),o={},s=0,a=n.length;s<a;++s)for(var h=t[n[s].toString()],l=0,u=h.length;l<u;){var p=h[l++],c=h[l++];p.replay(e,c,i,o,r)}}(h,e,c,_),c&&ks(e,c,s,a)}t.prototype.postCompose.call(this,e,i,r)},e.prototype.renderFeature=function(t,e,i,r){if(!i)return!1;var n=!1;if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)n=Ua(r,t,i[o],e,this.handleStyleImageChange_,this)||n;else n=Ua(r,t,i,e,this.handleStyleImageChange_,this);return n},e.prototype.renderTileImage_=function(t,e,i){var r=this.getLayer(),n=t.getReplayState(r),o=r.getRevision(),s=Xa[r.getRenderMode()];if(s&&n.renderedTileRevision!==o){n.renderedTileRevision=o;var a=t.wrappedTileCoord,h=a[0],l=r.getSource(),u=l.getTileGridForProjection(i),p=u.getResolution(h),c=t.getContext(r),d=l.getTilePixelSize(h,e,i);c.canvas.width=d[0],c.canvas.height=d[1];for(var f=u.getTileCoordExtent(a,this.tmpExtent),_=0,g=t.tileKeys.length;_<g;++_){var y=t.getTile(t.tileKeys[_]);if(y.getState()==On.LOADED){var v=e/p,m=Fe(this.tmpTransform_);je(m,v,-v),Ue(m,-f[0],-f[3]),y.getReplayGroup(r,t.tileCoord.toString()).replay(c,m,0,{},!0,s)}}}},e}(ha);Wa.handles=function(t){return t.getType()===Ss.VECTOR_TILE},Wa.create=function(t,e){return new Wa(e)};var Ka=Wa,Ha=function(t){function e(e){(e=u({},e)).controls||(e.controls=wo()),e.interactions||(e.interactions=ys()),t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){var t=new Qs(this);return t.registerLayerRenderers([ra,ha,Ba,Ka]),t},e}(lo),Za={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"},qa={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},Ja=function(t){function e(e){t.call(this),this.options=e,this.id=e.id,this.insertFirst=void 0===e.insertFirst||e.insertFirst,this.stopEvent=void 0===e.stopEvent||e.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==e.className?e.className:"ol-overlay-container "+co,this.element.style.position="absolute",this.autoPan=void 0!==e.autoPan&&e.autoPan,this.autoPanAnimation=e.autoPanAnimation||{},this.autoPanMargin=void 0!==e.autoPanMargin?e.autoPanMargin:20,this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},this.mapPostrenderListenerKey=null,v(this,G(qa.ELEMENT),this.handleElementChanged,this),v(this,G(qa.MAP),this.handleMapChanged,this),v(this,G(qa.OFFSET),this.handleOffsetChanged,this),v(this,G(qa.POSITION),this.handlePositionChanged,this),v(this,G(qa.POSITIONING),this.handlePositioningChanged,this),void 0!==e.element&&this.setElement(e.element),this.setOffset(void 0!==e.offset?e.offset:[0,0]),this.setPositioning(void 0!==e.positioning?e.positioning:Za.TOP_LEFT),void 0!==e.position&&this.setPosition(e.position)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getElement=function(){return this.get(qa.ELEMENT)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(qa.MAP)},e.prototype.getOffset=function(){return this.get(qa.OFFSET)},e.prototype.getPosition=function(){return this.get(qa.POSITION)},e.prototype.getPositioning=function(){return this.get(qa.POSITIONING)},e.prototype.handleElementChanged=function(){to(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&($n(this.element),E(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=v(t,Rn,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element)}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.get(qa.POSITION)&&this.autoPan&&this.panIntoView()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(qa.ELEMENT,t)},e.prototype.setMap=function(t){this.set(qa.MAP,t)},e.prototype.setOffset=function(t){this.set(qa.OFFSET,t)},e.prototype.setPosition=function(t){this.set(qa.POSITION,t)},e.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var e=this.getRect(t.getTargetElement(),t.getSize()),i=this.getElement(),r=this.getRect(i,[function(t){var e=t.offsetWidth,i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)}(i),function(t){var e=t.offsetHeight,i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)}(i)]),n=this.autoPanMargin;if(!ot(e,r)){var o=r[0]-e[0],s=e[2]-r[2],a=r[1]-e[1],h=e[3]-r[3],l=[0,0];if(o<0?l[0]=o-n:s<0&&(l[0]=Math.abs(s)+n),a<0?l[1]=a-n:h<0&&(l[1]=Math.abs(h)+n),0!==l[0]||0!==l[1]){var u=t.getView().getCenter(),p=t.getPixelFromCoordinate(u),c=[p[0]+l[0],p[1]+l[1]];t.getView().animate({center:t.getCoordinateFromPixel(c),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},e.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,n=i.top+window.pageYOffset;return[r,n,r+e[0],n+e[1]]},e.prototype.setPositioning=function(t){this.set(qa.POSITIONING,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var i=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,r=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var o=r[0],s=r[1];if(n==Za.BOTTOM_RIGHT||n==Za.CENTER_RIGHT||n==Za.TOP_RIGHT){""!==this.rendered.left_&&(this.rendered.left_=i.left="");var a=Math.round(e[0]-t[0]-o)+"px";this.rendered.right_!=a&&(this.rendered.right_=i.right=a)}else{""!==this.rendered.right_&&(this.rendered.right_=i.right=""),n!=Za.BOTTOM_CENTER&&n!=Za.CENTER_CENTER&&n!=Za.TOP_CENTER||(o-=this.element.offsetWidth/2);var h=Math.round(t[0]+o)+"px";this.rendered.left_!=h&&(this.rendered.left_=i.left=h)}if(n==Za.BOTTOM_LEFT||n==Za.BOTTOM_CENTER||n==Za.BOTTOM_RIGHT){""!==this.rendered.top_&&(this.rendered.top_=i.top="");var l=Math.round(e[1]-t[1]-s)+"px";this.rendered.bottom_!=l&&(this.rendered.bottom_=i.bottom=l)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_=i.bottom=""),n!=Za.CENTER_LEFT&&n!=Za.CENTER_CENTER&&n!=Za.CENTER_RIGHT||(s-=this.element.offsetHeight/2);var u=Math.round(t[1]+s)+"px";this.rendered.top_!=u&&(this.rendered.top_=i.top=u)}},e.prototype.getOptions=function(){return this.options},e}(D),Qa=9729,$a=10242,th=10243,eh=3553,ih=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function rh(t,e){for(var i=ih.length,r=0;r<i;++r)try{var n=t.getContext(ih[r],e);if(n)return n}catch(t){}return null}var nh,oh;if("undefined"!=typeof window&&"WebGLRenderingContext"in window)try{var sh=rh(document.createElement("canvas"),{failIfMajorPerformanceCaveat:!0});sh&&(!0,nh=sh.getParameter(sh.MAX_TEXTURE_SIZE),oh=sh.getSupportedExtensions())}catch(t){}var ah=function(t){this.source_=t};ah.prototype.isAnimated=function(){return!1},ah.prototype.getType=function(){return r()},ah.prototype.getSource=function(){return this.source_};var hh=ah,lh=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return 35632},e}(hh),uh=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return 35633},e}(hh),ph=new lh("precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n"),ch=new uh("varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n"),dh=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_lineWidth=t.getUniformLocation(e,"u_lineWidth"),this.u_pixelRatio=t.getUniformLocation(e,"u_pixelRatio"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_fillColor=t.getUniformLocation(e,"u_fillColor"),this.u_strokeColor=t.getUniformLocation(e,"u_strokeColor"),this.u_size=t.getUniformLocation(e,"u_size"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_instruction=t.getAttribLocation(e,"a_instruction"),this.a_radius=t.getAttribLocation(e,"a_radius")};function fh(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var _h=function(t){function e(e,i){t.call(this),this.tolerance=e,this.maxExtent=i,this.origin=Tt(i),this.projectionMatrix_=[1,0,0,1,0,0],this.offsetRotateMatrix_=[1,0,0,1,0,0],this.offsetScaleMatrix_=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDeleteResourcesFunction=function(t){return r()},e.prototype.finish=function(t){r()},e.prototype.setUpProgram=function(t,e,i,n){return r()},e.prototype.shutDownProgram=function(t,e){r()},e.prototype.drawReplay=function(t,e,i,n){r()},e.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,n,o){return r()},e.prototype.drawHitDetectionReplay=function(t,e,i,r,n,o){return n?this.drawHitDetectionReplayOneByOne(t,e,i,r,o):this.drawHitDetectionReplayAll(t,e,i,r)},e.prototype.drawHitDetectionReplayAll=function(t,e,i,r){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,e,i,!0);var n=r(null);return n||void 0},e.prototype.replay=function(t,e,i,r,n,o,s,a,h,l,u){var p,c,d,f,_,g,y,v,m=t.getGL();this.lineStringReplay&&(p=m.isEnabled(m.STENCIL_TEST),c=m.getParameter(m.STENCIL_FUNC),d=m.getParameter(m.STENCIL_VALUE_MASK),f=m.getParameter(m.STENCIL_REF),_=m.getParameter(m.STENCIL_WRITEMASK),g=m.getParameter(m.STENCIL_FAIL),y=m.getParameter(m.STENCIL_PASS_DEPTH_PASS),v=m.getParameter(m.STENCIL_PASS_DEPTH_FAIL),m.enable(m.STENCIL_TEST),m.clear(m.STENCIL_BUFFER_BIT),m.stencilMask(255),m.stencilFunc(m.ALWAYS,1,255),m.stencilOp(m.KEEP,m.KEEP,m.REPLACE),this.lineStringReplay.replay(t,e,i,r,n,o,s,a,h,l,u),m.stencilMask(0),m.stencilFunc(m.NOTEQUAL,1,255)),t.bindBuffer(34962,this.verticesBuffer),t.bindBuffer(34963,this.indicesBuffer);var x=this.setUpProgram(m,t,n,o),E=Fe(this.projectionMatrix_);je(E,2/(i*n[0]),2/(i*n[1])),ke(E,-r),Ue(E,-(e[0]-this.origin[0]),-(e[1]-this.origin[1]));var S=Fe(this.offsetScaleMatrix_);je(S,2/n[0],2/n[1]);var T,C=Fe(this.offsetRotateMatrix_);return 0!==r&&ke(C,-r),m.uniformMatrix4fv(x.u_projectionMatrix,!1,fh(this.tmpMat4_,E)),m.uniformMatrix4fv(x.u_offsetScaleMatrix,!1,fh(this.tmpMat4_,S)),m.uniformMatrix4fv(x.u_offsetRotateMatrix,!1,fh(this.tmpMat4_,C)),m.uniform1f(x.u_opacity,s),void 0===h?this.drawReplay(m,t,a,!1):T=this.drawHitDetectionReplay(m,t,a,h,l,u),this.shutDownProgram(m,x),this.lineStringReplay&&(p||m.disable(m.STENCIL_TEST),m.clear(m.STENCIL_BUFFER_BIT),m.stencilFunc(c,f,d),m.stencilMask(_),m.stencilOp(g,v,y)),T},e.prototype.drawElements=function(t,e,i,r){var n=e.hasOESElementIndexUint?5125:5123,o=r-i,s=i*(e.hasOESElementIndexUint?4:2);t.drawElements(4,o,n,s)},e}(Vs),gh=[0,0,0,1],yh=[],vh=[0,0,0,1],mh=Number.EPSILON||2.220446049250313e-16,xh=function(t,e,i,r,n,o){var s=(i-t)*(o-e)-(n-t)*(r-e);return s<=mh&&s>=-mh?void 0:s>0},Eh=35044,Sh=function(t,e){this.arr_=void 0!==t?t:[],this.usage_=void 0!==e?e:Eh};Sh.prototype.getArray=function(){return this.arr_},Sh.prototype.getUsage=function(){return this.usage_};var Th=Sh,Ch=function(t){function e(e,i){t.call(this,e,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,r){var n,o,s=this.vertices.length,a=this.indices.length,h=s/4;for(n=e,o=i;n<o;n+=r)this.vertices[s++]=t[n],this.vertices[s++]=t[n+1],this.vertices[s++]=0,this.vertices[s++]=this.radius_,this.vertices[s++]=t[n],this.vertices[s++]=t[n+1],this.vertices[s++]=1,this.vertices[s++]=this.radius_,this.vertices[s++]=t[n],this.vertices[s++]=t[n+1],this.vertices[s++]=2,this.vertices[s++]=this.radius_,this.vertices[s++]=t[n],this.vertices[s++]=t[n+1],this.vertices[s++]=3,this.vertices[s++]=this.radius_,this.indices[a++]=h,this.indices[a++]=h+1,this.indices[a++]=h+2,this.indices[a++]=h+2,this.indices[a++]=h+3,this.indices[a++]=h,h+=4},e.prototype.drawCircle=function(t,e){var i=t.getRadius(),r=t.getStride();if(i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=i;var n=t.getFlatCoordinates();n=Dt(n,0,2,r,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,r)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var o=this.styles_[this.styles_.length-1];this.state_.fillColor=o[0],this.state_.strokeColor=o[1],this.state_.lineWidth=o[2],this.state_.changed=!1}},e.prototype.finish=function(t){this.verticesBuffer=new Th(this.vertices),this.indicesBuffer=new Th(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},e.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer;return function(){t.deleteBuffer(e),t.deleteBuffer(i)}},e.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(ph,ch);return this.defaultLocations_?n=this.defaultLocations_:(n=new dh(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,5126,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,5126,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,5126,!1,16,12),t.uniform2fv(n.u_size,i),t.uniform1f(n.u_pixelRatio,r),n},e.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_instruction),t.disableVertexAttribArray(e.a_radius)},e.prototype.drawReplay=function(t,e,i,r){var n,o,s,a;if(d(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setFillStyle_(t,a[0]),this.setStrokeStyle_(t,a[1],a[2]),this.drawElements(t,e,o,s),s=o;else this.drawReplaySkipping_(t,e,i)},e.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var s,a,h,l,u,p,c;for(c=this.startIndices.length-2,h=this.startIndices[c+1],s=this.styleIndices_.length-1;s>=0;--s)for(l=this.styles_[s],this.setFillStyle_(t,l[0]),this.setStrokeStyle_(t,l[1],l[2]),u=this.styleIndices_[s];c>=0&&this.startIndices[c]>=u;){if(a=this.startIndices[c],void 0===i[o(p=this.startIndicesFeature[c])]&&p.getGeometry()&&(void 0===n||Pt(n,p.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,a,h);var d=r(p);if(d)return d}c--,h=a}},e.prototype.drawReplaySkipping_=function(t,e,i){var r,n,s,a,h,l,u;for(l=this.startIndices.length-2,s=n=this.startIndices[l+1],r=this.styleIndices_.length-1;r>=0;--r){for(a=this.styles_[r],this.setFillStyle_(t,a[0]),this.setStrokeStyle_(t,a[1],a[2]),h=this.styleIndices_[r];l>=0&&this.startIndices[l]>=h;)u=this.startIndices[l],i[o(this.startIndicesFeature[l])]&&(n!==s&&this.drawElements(t,e,n,s),s=u),l--,n=u;n!==s&&this.drawElements(t,e,n,s),n=s=h}},e.prototype.setFillStyle_=function(t,e){t.uniform4fv(this.defaultLocations_.u_fillColor,e)},e.prototype.setStrokeStyle_=function(t,e,i){t.uniform4fv(this.defaultLocations_.u_strokeColor,e),t.uniform1f(this.defaultLocations_.u_lineWidth,i)},e.prototype.setFillStrokeStyle=function(t,e){var i,r;if(e){var n=e.getLineDash();this.state_.lineDash=n||yh;var o=e.getLineDashOffset();this.state_.lineDashOffset=o||0,i=(i=e.getColor())instanceof CanvasGradient||i instanceof CanvasPattern?vh:_r(i).map(function(t,e){return 3!=e?t/255:t})||vh,r=void 0!==(r=e.getWidth())?r:1}else i=[0,0,0,0],r=0;var s=t?t.getColor():[0,0,0,0];s=s instanceof CanvasGradient||s instanceof CanvasPattern?gh:_r(s).map(function(t,e){return 3!=e?t/255:t})||gh,this.state_.strokeColor&&Z(this.state_.strokeColor,i)&&this.state_.fillColor&&Z(this.state_.fillColor,s)&&this.state_.lineWidth===r||(this.state_.changed=!0,this.state_.fillColor=s,this.state_.strokeColor=i,this.state_.lineWidth=r,this.styles_.push([s,i,r]))},e}(_h),Rh=new lh("precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),wh=new uh("varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n"),Ih=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_image=t.getUniformLocation(e,"u_image"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord"),this.a_offsets=t.getAttribLocation(e,"a_offsets"),this.a_opacity=t.getAttribLocation(e,"a_opacity"),this.a_rotateWithView=t.getAttribLocation(e,"a_rotateWithView")},Lh={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};function Oh(t,e,i){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==e&&t.texParameteri(eh,$a,e),void 0!==i&&t.texParameteri(eh,th,i),r}function Ph(t,e,i,r,n){var o=Oh(t,r,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),o}function bh(t,e,i,r){var n=Oh(t,i,r);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),n}var Mh=function(t){function e(e,i){t.call(this),this.canvas_=e,this.gl_=i,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=X(oh,"OES_element_index_uint"),this.hasOESElementIndexUint&&i.getExtension("OES_element_index_uint"),v(this.canvas_,Lh.LOST,this.handleWebGLContextLost,this),v(this.canvas_,Lh.RESTORED,this.handleWebGLContextRestored,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bindBuffer=function(t,e){var i=this.getGL(),r=e.getArray(),n=o(e);if(n in this.bufferCache_){var s=this.bufferCache_[n];i.bindBuffer(t,s.buffer)}else{var a,h=i.createBuffer();i.bindBuffer(t,h),34962==t?a=new Float32Array(r):34963==t&&(a=this.hasOESElementIndexUint?new Uint32Array(r):new Uint16Array(r)),i.bufferData(t,a,e.getUsage()),this.bufferCache_[n]={buf:e,buffer:h}}},e.prototype.deleteBuffer=function(t){var e=this.getGL(),i=o(t),r=this.bufferCache_[i];e.isContextLost()||e.deleteBuffer(r.buffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){S(this.canvas_);var t=this.getGL();if(!t.isContextLost()){for(var e in this.bufferCache_)t.deleteBuffer(this.bufferCache_[e].buffer);for(var i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(var r in this.shaderCache_)t.deleteShader(this.shaderCache_[r]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},e.prototype.getShader=function(t){var e=o(t);if(e in this.shaderCache_)return this.shaderCache_[e];var i=this.getGL(),r=i.createShader(t.getType());return i.shaderSource(r,t.getSource()),i.compileShader(r),this.shaderCache_[e]=r,r},e.prototype.getProgram=function(t,e){var i=o(t)+"/"+o(e);if(i in this.programCache_)return this.programCache_[i];var r=this.getGL(),n=r.createProgram();return r.attachShader(n,this.getShader(t)),r.attachShader(n,this.getShader(e)),r.linkProgram(n),this.programCache_[i]=n,n},e.prototype.handleWebGLContextLost=function(){p(this.bufferCache_),p(this.shaderCache_),p(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var i=Ph(t,1,1),r=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,r),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=e,this.hitDetectionTexture_=i,this.hitDetectionRenderbuffer_=r},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)},e}(C),Fh=function(t){function e(e,i){t.call(this,e,i),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer,r=this.getTextures(!0),n=t.getGL();return function(){var o,s;if(!n.isContextLost())for(o=0,s=r.length;o<s;++o)n.deleteTexture(r[o]);t.deleteBuffer(e),t.deleteBuffer(i)}},e.prototype.drawCoordinates=function(t,e,i,r){var n,o,s,a,h,l,u=this.anchorX,p=this.anchorY,c=this.height,d=this.imageHeight,f=this.imageWidth,_=this.opacity,g=this.originX,y=this.originY,v=this.rotateWithView?1:0,m=-this.rotation,x=this.scale,E=this.width,S=Math.cos(m),T=Math.sin(m),C=this.indices.length,R=this.vertices.length;for(n=e;n<i;n+=r)h=t[n]-this.origin[0],l=t[n+1]-this.origin[1],o=R/8,s=-x*u,a=-x*(c-p),this.vertices[R++]=h,this.vertices[R++]=l,this.vertices[R++]=s*S-a*T,this.vertices[R++]=s*T+a*S,this.vertices[R++]=g/f,this.vertices[R++]=(y+c)/d,this.vertices[R++]=_,this.vertices[R++]=v,s=x*(E-u),a=-x*(c-p),this.vertices[R++]=h,this.vertices[R++]=l,this.vertices[R++]=s*S-a*T,this.vertices[R++]=s*T+a*S,this.vertices[R++]=(g+E)/f,this.vertices[R++]=(y+c)/d,this.vertices[R++]=_,this.vertices[R++]=v,s=x*(E-u),a=x*p,this.vertices[R++]=h,this.vertices[R++]=l,this.vertices[R++]=s*S-a*T,this.vertices[R++]=s*T+a*S,this.vertices[R++]=(g+E)/f,this.vertices[R++]=y/d,this.vertices[R++]=_,this.vertices[R++]=v,s=-x*u,a=x*p,this.vertices[R++]=h,this.vertices[R++]=l,this.vertices[R++]=s*S-a*T,this.vertices[R++]=s*T+a*S,this.vertices[R++]=g/f,this.vertices[R++]=y/d,this.vertices[R++]=_,this.vertices[R++]=v,this.indices[C++]=o,this.indices[C++]=o+1,this.indices[C++]=o+2,this.indices[C++]=o,this.indices[C++]=o+2,this.indices[C++]=o+3;return R},e.prototype.createTextures=function(t,e,i,r){var n,s,a,h,l=e.length;for(h=0;h<l;++h)(a=o(s=e[h]))in i?n=i[a]:(n=bh(r,s,33071,33071),i[a]=n),t[h]=n},e.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Rh,wh);return this.defaultLocations?n=this.defaultLocations:(n=new Ih(t,o),this.defaultLocations=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,5126,!1,32,0),t.enableVertexAttribArray(n.a_offsets),t.vertexAttribPointer(n.a_offsets,2,5126,!1,32,8),t.enableVertexAttribArray(n.a_texCoord),t.vertexAttribPointer(n.a_texCoord,2,5126,!1,32,16),t.enableVertexAttribArray(n.a_opacity),t.vertexAttribPointer(n.a_opacity,1,5126,!1,32,24),t.enableVertexAttribArray(n.a_rotateWithView),t.vertexAttribPointer(n.a_rotateWithView,1,5126,!1,32,28),n},e.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_offsets),t.disableVertexAttribArray(e.a_texCoord),t.disableVertexAttribArray(e.a_opacity),t.disableVertexAttribArray(e.a_rotateWithView)},e.prototype.drawReplay=function(t,e,i,r){var n,o,s,a=r?this.getHitDetectionTextures():this.getTextures(),h=r?this.hitDetectionGroupIndices:this.groupIndices;if(d(i))for(n=0,o=a.length,s=0;n<o;++n){t.bindTexture(eh,a[n]);var l=h[n];this.drawElements(t,e,s,l),s=l}else this.drawReplaySkipping(t,e,i,a,h)},e.prototype.drawReplaySkipping=function(t,e,i,r,n){var s,a,h=0;for(s=0,a=r.length;s<a;++s){t.bindTexture(eh,r[s]);for(var l=s>0?n[s-1]:0,u=n[s],p=l,c=l;h<this.startIndices.length&&this.startIndices[h]<=u;){void 0!==i[o(this.startIndicesFeature[h])]?(p!==c&&this.drawElements(t,e,p,c),c=p=h===this.startIndices.length-1?u:this.startIndices[h+1]):c=h===this.startIndices.length-1?u:this.startIndices[h+1],h++}p!==c&&this.drawElements(t,e,p,c)}},e.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var s,a,h,l,u,p=this.startIndices.length-1,c=this.getHitDetectionTextures();for(s=c.length-1;s>=0;--s)for(t.bindTexture(eh,c[s]),a=s>0?this.hitDetectionGroupIndices[s-1]:0,l=this.hitDetectionGroupIndices[s];p>=0&&this.startIndices[p]>=a;){if(h=this.startIndices[p],void 0===i[o(u=this.startIndicesFeature[p])]&&u.getGeometry()&&(void 0===n||Pt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,h,l);var d=r(u);if(d)return d}l=h,p--}},e.prototype.finish=function(t){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},e.prototype.getTextures=function(t){return r()},e.prototype.getHitDetectionTextures=function(){return r()},e}(_h),Ah=function(t){function e(e,i){t.call(this,e,i),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawMultiPoint=function(t,e){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var i=t.getFlatCoordinates(),r=t.getStride();this.drawCoordinates(i,0,i.length,r)},e.prototype.drawPoint=function(t,e){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var i=t.getFlatCoordinates(),r=t.getStride();this.drawCoordinates(i,0,i.length,r)},e.prototype.finish=function(e){var i=e.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Th(this.vertices);var r=this.indices;this.indicesBuffer=new Th(r);var n={};this.createTextures(this.textures_,this.images_,n,i),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,n,i),this.images_=null,this.hitDetectionImages_=null,t.prototype.finish.call(this,e)},e.prototype.setImageStyle=function(t){var e=t.getAnchor(),i=t.getImage(1),r=t.getImageSize(),n=t.getHitDetectionImage(1),s=t.getOpacity(),a=t.getOrigin(),h=t.getRotateWithView(),l=t.getRotation(),u=t.getSize(),p=t.getScale();0===this.images_.length?this.images_.push(i):o(this.images_[this.images_.length-1])!=o(i)&&(this.groupIndices.push(this.indices.length),this.images_.push(i)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):o(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=o(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=e[0],this.anchorY=e[1],this.height=u[1],this.imageHeight=r[1],this.imageWidth=r[0],this.opacity=s,this.originX=a[0],this.originY=a[1],this.rotation=l,this.rotateWithView=h,this.scale=p,this.width=u[0]},e.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},e.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_},e}(Fh);function Nh(t,e,i,r){var n=i-r;return t[e]===t[n]&&t[e+1]===t[n+1]&&(i-e)/r>3&&!!Ke(t,e,i,r)}var Gh=new lh("precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),Dh=new uh("varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n"),kh=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_lineWidth=t.getUniformLocation(e,"u_lineWidth"),this.u_miterLimit=t.getUniformLocation(e,"u_miterLimit"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_color=t.getUniformLocation(e,"u_color"),this.u_size=t.getUniformLocation(e,"u_size"),this.u_pixelRatio=t.getUniformLocation(e,"u_pixelRatio"),this.a_lastPos=t.getAttribLocation(e,"a_lastPos"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_nextPos=t.getAttribLocation(e,"a_nextPos"),this.a_direction=t.getAttribLocation(e,"a_direction")},jh=3,Uh=5,Yh=7,Bh=11,Vh=13,Xh=17,zh=19,Wh=23,Kh=function(t){function e(e,i){t.call(this,e,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,r){var n,o,s,a,h,l,u,p,c=this.vertices.length,d=this.indices.length,f="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,_="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,g=Nh(t,e,i,r),y=d,v=1;for(n=e,o=i;n<o;n+=r){if(h=c/7,l=u,u=p||[t[n],t[n+1]],n===e){if(p=[t[n+r],t[n+r+1]],i-e==2*r&&Z(u,p))break;if(!g){_&&(c=this.addVertices_([0,0],u,p,v*Yh*_,c),c=this.addVertices_([0,0],u,p,-v*Yh*_,c),this.indices[d++]=h+2,this.indices[d++]=h,this.indices[d++]=h+1,this.indices[d++]=h+1,this.indices[d++]=h+3,this.indices[d++]=h+2),c=this.addVertices_([0,0],u,p,v*jh*(_||1),c),y=(c=this.addVertices_([0,0],u,p,-v*jh*(_||1),c))/7-1;continue}l=[t[i-2*r],t[i-2*r+1]],s=p}else{if(n===i-r){if(g){p=s;break}l=l||[0,0],c=this.addVertices_(l,u,[0,0],v*Uh*(_||1),c),c=this.addVertices_(l,u,[0,0],-v*Uh*(_||1),c),this.indices[d++]=h,this.indices[d++]=y-1,this.indices[d++]=y,this.indices[d++]=y,this.indices[d++]=h+1,this.indices[d++]=h,_&&(c=this.addVertices_(l,u,[0,0],v*Bh*_,c),c=this.addVertices_(l,u,[0,0],-v*Bh*_,c),this.indices[d++]=h+2,this.indices[d++]=h,this.indices[d++]=h+1,this.indices[d++]=h+1,this.indices[d++]=h+3,this.indices[d++]=h+2);break}p=[t[n+r],t[n+r+1]]}a=xh(l[0],l[1],u[0],u[1],p[0],p[1])?-1:1,c=this.addVertices_(l,u,p,a*Vh*(f||1),c),c=this.addVertices_(l,u,p,a*Xh*(f||1),c),c=this.addVertices_(l,u,p,-a*zh*(f||1),c),n>e&&(this.indices[d++]=h,this.indices[d++]=y-1,this.indices[d++]=y,this.indices[d++]=h+2,this.indices[d++]=h,this.indices[d++]=v*a>0?y:y-1),this.indices[d++]=h,this.indices[d++]=h+2,this.indices[d++]=h+1,y=h+2,v=a,f&&(c=this.addVertices_(l,u,p,a*Wh*f,c),this.indices[d++]=h+1,this.indices[d++]=h+3,this.indices[d++]=h)}g&&(h=h||c/7,a=Si([l[0],l[1],u[0],u[1],p[0],p[1]],0,6,2)?1:-1,c=this.addVertices_(l,u,p,a*Vh*(f||1),c),c=this.addVertices_(l,u,p,-a*zh*(f||1),c),this.indices[d++]=h,this.indices[d++]=y-1,this.indices[d++]=y,this.indices[d++]=h+1,this.indices[d++]=h,this.indices[d++]=v*a>0?y:y-1)},e.prototype.addVertices_=function(t,e,i,r,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=e[0],this.vertices[n++]=e[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=r,n},e.prototype.isValid_=function(t,e,i,r){var n=i-e;return!(n<2*r)&&(n!==2*r||!Z([t[e],t[e+1]],[t[e+r],t[e+r+1]]))},e.prototype.drawLineString=function(t,e){var i=t.getFlatCoordinates(),r=t.getStride();this.isValid_(i,0,i.length,r)&&(i=Dt(i,0,i.length,r,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.drawCoordinates_(i,0,i.length,r))},e.prototype.drawMultiLineString=function(t,e){var i=this.indices.length,r=t.getEnds();r.unshift(0);var n,o,s=t.getFlatCoordinates(),a=t.getStride();if(r.length>1)for(n=1,o=r.length;n<o;++n)if(this.isValid_(s,r[n-1],r[n],a)){var h=Dt(s,r[n-1],r[n],a,-this.origin[0],-this.origin[1]);this.drawCoordinates_(h,0,h.length,a)}this.indices.length>i&&(this.startIndices.push(i),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1))},e.prototype.drawPolygonCoordinates=function(t,e,i){var r,n;if(Nh(t,0,t.length,i)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,i),e.length)for(r=0,n=e.length;r<n;++r)Nh(e[r],0,e[r].length,i)||(e[r].push(e[r][0]),e[r].push(e[r][1])),this.drawCoordinates_(e[r],0,e[r].length,i)},e.prototype.setPolygonStyle=function(t,e){var i=void 0===e?this.indices.length:e;this.startIndices.push(i),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1)},e.prototype.getCurrentIndex=function(){return this.indices.length},e.prototype.finish=function(t){this.verticesBuffer=new Th(this.vertices),this.indicesBuffer=new Th(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},e.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer;return function(){t.deleteBuffer(e),t.deleteBuffer(i)}},e.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Gh,Dh);return this.defaultLocations_?n=this.defaultLocations_:(n=new kh(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,5126,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,5126,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,5126,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,5126,!1,28,24),t.uniform2fv(n.u_size,i),t.uniform1f(n.u_pixelRatio,r),n},e.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_lastPos),t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_nextPos),t.disableVertexAttribArray(e.a_direction)},e.prototype.drawReplay=function(t,e,i,r){var n,o,s,a,h=t.getParameter(t.DEPTH_FUNC),l=t.getParameter(t.DEPTH_WRITEMASK);if(r||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),d(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setStrokeStyle_(t,a[0],a[1],a[2]),this.drawElements(t,e,o,s),t.clear(t.DEPTH_BUFFER_BIT),s=o;else this.drawReplaySkipping_(t,e,i);r||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(l),t.depthFunc(h))},e.prototype.drawReplaySkipping_=function(t,e,i){var r,n,s,a,h,l,u;for(l=this.startIndices.length-2,s=n=this.startIndices[l+1],r=this.styleIndices_.length-1;r>=0;--r){for(a=this.styles_[r],this.setStrokeStyle_(t,a[0],a[1],a[2]),h=this.styleIndices_[r];l>=0&&this.startIndices[l]>=h;)u=this.startIndices[l],i[o(this.startIndicesFeature[l])]&&(n!==s&&(this.drawElements(t,e,n,s),t.clear(t.DEPTH_BUFFER_BIT)),s=u),l--,n=u;n!==s&&(this.drawElements(t,e,n,s),t.clear(t.DEPTH_BUFFER_BIT)),n=s=h}},e.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var s,a,h,l,u,p,c;for(c=this.startIndices.length-2,h=this.startIndices[c+1],s=this.styleIndices_.length-1;s>=0;--s)for(l=this.styles_[s],this.setStrokeStyle_(t,l[0],l[1],l[2]),u=this.styleIndices_[s];c>=0&&this.startIndices[c]>=u;){if(a=this.startIndices[c],void 0===i[o(p=this.startIndicesFeature[c])]&&p.getGeometry()&&(void 0===n||Pt(n,p.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,a,h);var d=r(p);if(d)return d}c--,h=a}},e.prototype.setStrokeStyle_=function(t,e,i,r){t.uniform4fv(this.defaultLocations_.u_color,e),t.uniform1f(this.defaultLocations_.u_lineWidth,i),t.uniform1f(this.defaultLocations_.u_miterLimit,r)},e.prototype.setFillStrokeStyle=function(t,e){var i=e.getLineCap();this.state_.lineCap=void 0!==i?i:"round";var r=e.getLineDash();this.state_.lineDash=r||yh;var n=e.getLineDashOffset();this.state_.lineDashOffset=n||0;var o=e.getLineJoin();this.state_.lineJoin=void 0!==o?o:"round";var s=e.getColor();s=s instanceof CanvasGradient||s instanceof CanvasPattern?vh:_r(s).map(function(t,e){return 3!=e?t/255:t})||vh;var a=e.getWidth();a=void 0!==a?a:1;var h=e.getMiterLimit();h=void 0!==h?h:10,this.state_.strokeColor&&Z(this.state_.strokeColor,s)&&this.state_.lineWidth===a&&this.state_.miterLimit===h||(this.state_.changed=!0,this.state_.strokeColor=s,this.state_.lineWidth=a,this.state_.miterLimit=h,this.styles_.push([s,a,h]))},e}(_h),Hh=new lh("precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),Zh=new uh("\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n"),qh=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_color=t.getUniformLocation(e,"u_color"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.a_position=t.getAttribLocation(e,"a_position")},Jh=function(t){this.first_,this.last_,this.head_,this.circular_=void 0===t||t,this.length_=0};Jh.prototype.insertItem=function(t){var e={prev:void 0,next:void 0,data:t},i=this.head_;if(i){var r=i.next;e.prev=i,e.next=r,i.next=e,r&&(r.prev=e),i===this.last_&&(this.last_=e)}else this.first_=e,this.last_=e,this.circular_&&(e.next=e,e.prev=e);this.head_=e,this.length_++},Jh.prototype.removeItem=function(){var t=this.head_;if(t){var e=t.next,i=t.prev;e&&(e.prev=i),i&&(i.next=e),this.head_=e||i,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=i?this.head_.prev:this.head_),this.length_--}},Jh.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},Jh.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},Jh.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},Jh.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},Jh.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},Jh.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},Jh.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},Jh.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},Jh.prototype.concat=function(t){if(t.head_){if(this.head_){var e=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,e.prev=t.last_,t.last_.next=e,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},Jh.prototype.getLength=function(){return this.length_};var Qh=Jh,$h=function(t){this.rbush_=ua()(t,void 0),this.items_={}};$h.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_[o(e)]=i},$h.prototype.load=function(t,e){for(var i=new Array(e.length),r=0,n=e.length;r<n;r++){var s=t[r],a=e[r],h={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:a};i[r]=h,this.items_[o(a)]=h}this.rbush_.load(i)},$h.prototype.remove=function(t){var e=o(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},$h.prototype.update=function(t,e){var i=this.items_[o(e)];dt([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},$h.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},$h.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})},$h.prototype.forEach=function(t,e){return this.forEach_(this.getAll(),t,e)},$h.prototype.forEachInExtent=function(t,e,i){return this.forEach_(this.getInExtent(t),e,i)},$h.prototype.forEach_=function(t,e,i){for(var r,n=0,o=t.length;n<o;n++)if(r=e.call(i,t[n]))return r;return r},$h.prototype.isEmpty=function(){return d(this.items_)},$h.prototype.clear=function(){this.rbush_.clear(),this.items_={}},$h.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return lt(e.minX,e.minY,e.maxX,e.maxY,t)},$h.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]};var tl=$h,el=function(t){function e(e,i){t.call(this,e,i),this.lineStringReplay=new Kh(e,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i){var r=new Qh,n=new tl;this.processFlatCoordinates_(t,i,r,n,!0);var o=this.getMaxCoords_(r);if(e.length){var s,a,h=[];for(s=0,a=e.length;s<a;++s){var l={list:new Qh,maxCoords:void 0,rtree:new tl};h.push(l),this.processFlatCoordinates_(e[s],i,l.list,l.rtree,!1),this.classifyPoints_(l.list,l.rtree,!0),l.maxCoords=this.getMaxCoords_(l.list)}for(h.sort(function(t,e){return e.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-e.maxCoords[1]:e.maxCoords[0]-t.maxCoords[0]}),s=0;s<h.length;++s){var u=h[s].list,p=u.firstItem(),c=p,d=void 0;do{if(this.getIntersections_(c,n).length){d=!0;break}c=u.nextItem()}while(p!==c);d||this.bridgeHole_(u,h[s].maxCoords[0],r,o[0],n)&&(n.concat(h[s].rtree),this.classifyPoints_(r,n,!1))}}else this.classifyPoints_(r,n,!1);this.triangulate_(r,n)},e.prototype.processFlatCoordinates_=function(t,e,i,r,n){var o,s,a,h,l,u=Si(t,0,t.length,e),p=this.vertices.length/2,c=[],d=[];if(n===u){for(h=a=this.createPoint_(t[0],t[1],p++),o=e,s=t.length;o<s;o+=e)l=this.createPoint_(t[o],t[o+1],p++),d.push(this.insertItem_(h,l,i)),c.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)]),h=l;d.push(this.insertItem_(l,a,i)),c.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)])}else{var f=t.length-e;for(h=a=this.createPoint_(t[f],t[f+1],p++),o=f-e,s=0;o>=s;o-=e)l=this.createPoint_(t[o],t[o+1],p++),d.push(this.insertItem_(h,l,i)),c.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)]),h=l;d.push(this.insertItem_(l,a,i)),c.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)])}r.load(c,d)},e.prototype.getMaxCoords_=function(t){var e=t.firstItem(),i=e,r=[i.p0.x,i.p0.y];do{(i=t.nextItem()).p0.x>r[0]&&(r=[i.p0.x,i.p0.y])}while(i!==e);return r},e.prototype.classifyPoints_=function(t,e,i){var r=t.firstItem(),n=r,o=t.nextItem(),s=!1;do{var a=i?xh(o.p1.x,o.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):xh(n.p0.x,n.p0.y,n.p1.x,n.p1.y,o.p1.x,o.p1.y);void 0===a?(this.removeItem_(n,o,t,e),s=!0,o===r&&(r=t.getNextItem()),o=n,t.prevItem()):n.p1.reflex!==a&&(n.p1.reflex=a,s=!0),n=o,o=t.nextItem()}while(n!==r);return s},e.prototype.bridgeHole_=function(t,e,i,r,n){for(var o=t.firstItem();o.p1.x!==e;)o=t.nextItem();var s,a,h,l,u=o.p1,p={x:r,y:u.y,i:-1},c=1/0,d=this.getIntersections_({p0:u,p1:p},n,!0);for(s=0,a=d.length;s<a;++s){var f=d[s],_=this.calculateIntersection_(u,p,f.p0,f.p1,!0),g=Math.abs(u.x-_[0]);g<c&&void 0!==xh(u.x,u.y,f.p0.x,f.p0.y,f.p1.x,f.p1.y)&&(c=g,l={x:_[0],y:_[1],i:-1},o=f)}if(c===1/0)return!1;if(h=o.p1,c>0){var y=this.getPointsInTriangle_(u,l,o.p1,n);if(y.length){var v=1/0;for(s=0,a=y.length;s<a;++s){var m=y[s],x=Math.atan2(u.y-m.y,p.x-m.x);(x<v||x===v&&m.x<h.x)&&(v=x,h=m)}}}for(o=i.firstItem();o.p1.x!==h.x||o.p1.y!==h.y;)o=i.nextItem();var E={x:u.x,y:u.y,i:u.i,reflex:void 0},S={x:o.p1.x,y:o.p1.y,i:o.p1.i,reflex:void 0};return t.getNextItem().p0=E,this.insertItem_(u,o.p1,t,n),this.insertItem_(S,E,t,n),o.p1=S,t.setFirstItem(),i.concat(t),!0},e.prototype.triangulate_=function(t,e){for(var i=!1,r=this.isSimple_(t,e);t.getLength()>3;)if(r){if(!this.clipEars_(t,e,r,i)&&!this.classifyPoints_(t,e,i)&&!this.resolveSelfIntersections_(t,e,!0))break}else if(!this.clipEars_(t,e,r,i)&&!this.classifyPoints_(t,e,i)&&!this.resolveSelfIntersections_(t,e)){if(!(r=this.isSimple_(t,e))){this.splitPolygon_(t,e);break}i=!this.isClockwise_(t),this.classifyPoints_(t,e,i)}if(3===t.getLength()){var n=this.indices.length;this.indices[n++]=t.getPrevItem().p0.i,this.indices[n++]=t.getCurrItem().p0.i,this.indices[n++]=t.getNextItem().p0.i}},e.prototype.clipEars_=function(t,e,i,r){var n,o,s,a=this.indices.length,h=t.firstItem(),l=t.getPrevItem(),u=h,p=t.nextItem(),c=t.getNextItem(),d=!1;do{if(n=u.p0,o=u.p1,s=p.p1,!1===o.reflex){var f=void 0;f=i?0===this.getPointsInTriangle_(n,o,s,e,!0).length:r?this.diagonalIsInside_(c.p1,s,o,n,l.p0):this.diagonalIsInside_(l.p0,n,o,s,c.p1),(i||0===this.getIntersections_({p0:n,p1:s},e).length)&&f&&(i||!1===n.reflex||!1===s.reflex||Si([l.p0.x,l.p0.y,n.x,n.y,o.x,o.y,s.x,s.y,c.p1.x,c.p1.y],0,10,2)===!r)&&(this.indices[a++]=n.i,this.indices[a++]=o.i,this.indices[a++]=s.i,this.removeItem_(u,p,t,e),p===h&&(h=c),d=!0)}l=t.getPrevItem(),u=t.getCurrItem(),p=t.nextItem(),c=t.getNextItem()}while(u!==h&&t.getLength()>3);return d},e.prototype.resolveSelfIntersections_=function(t,e,i){var r=t.firstItem();t.nextItem();var n=r,o=t.nextItem(),s=!1;do{var a=this.calculateIntersection_(n.p0,n.p1,o.p0,o.p1,i);if(a){var h=!1,l=this.vertices.length,u=this.indices.length,p=l/2,c=t.prevItem();t.removeItem(),e.remove(c),h=c===r;var d=void 0;if(i?(a[0]===n.p0.x&&a[1]===n.p0.y?(t.prevItem(),d=n.p0,o.p0=d,e.remove(n),h=h||n===r):(d=o.p1,n.p1=d,e.remove(o),h=h||o===r),t.removeItem()):(d=this.createPoint_(a[0],a[1],p),n.p1=d,o.p0=d,e.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),e.update([Math.min(o.p0.x,o.p1.x),Math.min(o.p0.y,o.p1.y),Math.max(o.p0.x,o.p1.x),Math.max(o.p0.y,o.p1.y)],o)),this.indices[u++]=c.p0.i,this.indices[u++]=c.p1.i,this.indices[u++]=d.i,s=!0,h)break}n=t.getPrevItem(),o=t.nextItem()}while(n!==r);return s},e.prototype.isSimple_=function(t,e){var i=t.firstItem(),r=i;do{if(this.getIntersections_(r,e).length)return!1;r=t.nextItem()}while(r!==i);return!0},e.prototype.isClockwise_=function(t){var e=2*t.getLength(),i=new Array(e),r=t.firstItem(),n=r,o=0;do{i[o++]=n.p0.x,i[o++]=n.p0.y,n=t.nextItem()}while(n!==r);return Si(i,0,e,2)},e.prototype.splitPolygon_=function(t,e){var i=t.firstItem(),r=i;do{var n=this.getIntersections_(r,e);if(n.length){var o=n[0],s=this.vertices.length/2,a=this.calculateIntersection_(r.p0,r.p1,o.p0,o.p1),h=this.createPoint_(a[0],a[1],s),l=new Qh,u=new tl;this.insertItem_(h,r.p1,l,u),r.p1=h,e.update([Math.min(r.p0.x,h.x),Math.min(r.p0.y,h.y),Math.max(r.p0.x,h.x),Math.max(r.p0.y,h.y)],r);for(var p=t.nextItem();p!==o;)this.insertItem_(p.p0,p.p1,l,u),e.remove(p),t.removeItem(),p=t.getCurrItem();this.insertItem_(o.p0,h,l,u),o.p0=h,e.update([Math.min(o.p1.x,h.x),Math.min(o.p1.y,h.y),Math.max(o.p1.x,h.x),Math.max(o.p1.y,h.y)],o),this.classifyPoints_(t,e,!1),this.triangulate_(t,e),this.classifyPoints_(l,u,!1),this.triangulate_(l,u);break}r=t.nextItem()}while(r!==i)},e.prototype.createPoint_=function(t,e,i){var r=this.vertices.length;return this.vertices[r++]=t,this.vertices[r++]=e,{x:t,y:e,i:i,reflex:void 0}},e.prototype.insertItem_=function(t,e,i,r){var n={p0:t,p1:e};return i.insertItem(n),r&&r.insert([Math.min(t.x,e.x),Math.min(t.y,e.y),Math.max(t.x,e.x),Math.max(t.y,e.y)],n),n},e.prototype.removeItem_=function(t,e,i,r){i.getCurrItem()===e&&(i.removeItem(),t.p1=e.p1,r.remove(e),r.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},e.prototype.getPointsInTriangle_=function(t,e,i,r,n){for(var o=[],s=r.getInExtent([Math.min(t.x,e.x,i.x),Math.min(t.y,e.y,i.y),Math.max(t.x,e.x,i.x),Math.max(t.y,e.y,i.y)]),a=0,h=s.length;a<h;++a)for(var l in s[a]){var u=s[a][l];"object"!=typeof u||n&&!u.reflex||u.x===t.x&&u.y===t.y||u.x===e.x&&u.y===e.y||u.x===i.x&&u.y===i.y||-1!==o.indexOf(u)||!fi([t.x,t.y,e.x,e.y,i.x,i.y],0,6,2,u.x,u.y)||o.push(u)}return o},e.prototype.getIntersections_=function(t,e,i){for(var r=t.p0,n=t.p1,o=e.getInExtent([Math.min(r.x,n.x),Math.min(r.y,n.y),Math.max(r.x,n.x),Math.max(r.y,n.y)]),s=[],a=0,h=o.length;a<h;++a){var l=o[a];t!==l&&(i||l.p0!==n||l.p1!==r)&&this.calculateIntersection_(r,n,l.p0,l.p1,i)&&s.push(l)}return s},e.prototype.calculateIntersection_=function(t,e,i,r,n){var o=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==o){var s=((r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x))/o,a=((e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x))/o;if(!n&&s>mh&&s<1-mh&&a>mh&&a<1-mh||n&&s>=0&&s<=1&&a>=0&&a<=1)return[t.x+s*(e.x-t.x),t.y+s*(e.y-t.y)]}},e.prototype.diagonalIsInside_=function(t,e,i,r,n){if(void 0===e.reflex||void 0===r.reflex)return!1;var o=(i.x-r.x)*(e.y-r.y)>(i.y-r.y)*(e.x-r.x),s=(n.x-r.x)*(e.y-r.y)<(n.y-r.y)*(e.x-r.x),a=(t.x-e.x)*(r.y-e.y)>(t.y-e.y)*(r.x-e.x),h=(i.x-e.x)*(r.y-e.y)<(i.y-e.y)*(r.x-e.x),l=r.reflex?s||o:s&&o,u=e.reflex?h||a:h&&a;return l&&u},e.prototype.drawMultiPolygon=function(t,e){var i,r,n,o,s=t.getEndss(),a=t.getStride(),h=this.indices.length,l=this.lineStringReplay.getCurrentIndex(),u=t.getFlatCoordinates(),p=0;for(i=0,r=s.length;i<r;++i){var c=s[i];if(c.length>0){var d=Dt(u,p,c[0],a,-this.origin[0],-this.origin[1]);if(d.length){var f=[],_=void 0;for(n=1,o=c.length;n<o;++n)c[n]!==c[n-1]&&(_=Dt(u,c[n-1],c[n],a,-this.origin[0],-this.origin[1]),f.push(_));this.lineStringReplay.drawPolygonCoordinates(d,f,a),this.drawCoordinates_(d,f,a)}}p=c[c.length-1]}this.indices.length>h&&(this.startIndices.push(h),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(h),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>l&&this.lineStringReplay.setPolygonStyle(e,l)},e.prototype.drawPolygon=function(t,e){var i=t.getEnds(),r=t.getStride();if(i.length>0){var n=t.getFlatCoordinates().map(Number),o=Dt(n,0,i[0],r,-this.origin[0],-this.origin[1]);if(o.length){var s,a,h,l=[];for(s=1,a=i.length;s<a;++s)i[s]!==i[s-1]&&(h=Dt(n,i[s-1],i[s],r,-this.origin[0],-this.origin[1]),l.push(h));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(e),this.lineStringReplay.drawPolygonCoordinates(o,l,r),this.drawCoordinates_(o,l,r)}}},e.prototype.finish=function(t){this.verticesBuffer=new Th(this.vertices),this.indicesBuffer=new Th(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},e.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer,r=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(e),t.deleteBuffer(i),r()}},e.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Hh,Zh);return this.defaultLocations_?n=this.defaultLocations_:(n=new qh(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,5126,!1,8,0),n},e.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position)},e.prototype.drawReplay=function(t,e,i,r){var n,o,s,a,h=t.getParameter(t.DEPTH_FUNC),l=t.getParameter(t.DEPTH_WRITEMASK);if(r||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),d(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setFillStyle_(t,a),this.drawElements(t,e,o,s),s=o;else this.drawReplaySkipping_(t,e,i);r||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(l),t.depthFunc(h))},e.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var s,a,h,l,u,p,c;for(c=this.startIndices.length-2,h=this.startIndices[c+1],s=this.styleIndices_.length-1;s>=0;--s)for(l=this.styles_[s],this.setFillStyle_(t,l),u=this.styleIndices_[s];c>=0&&this.startIndices[c]>=u;){if(a=this.startIndices[c],void 0===i[o(p=this.startIndicesFeature[c])]&&p.getGeometry()&&(void 0===n||Pt(n,p.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,a,h);var d=r(p);if(d)return d}c--,h=a}},e.prototype.drawReplaySkipping_=function(t,e,i){var r,n,s,a,h,l,u;for(l=this.startIndices.length-2,s=n=this.startIndices[l+1],r=this.styleIndices_.length-1;r>=0;--r){for(a=this.styles_[r],this.setFillStyle_(t,a),h=this.styleIndices_[r];l>=0&&this.startIndices[l]>=h;)u=this.startIndices[l],i[o(this.startIndicesFeature[l])]&&(n!==s&&(this.drawElements(t,e,n,s),t.clear(t.DEPTH_BUFFER_BIT)),s=u),l--,n=u;n!==s&&(this.drawElements(t,e,n,s),t.clear(t.DEPTH_BUFFER_BIT)),n=s=h}},e.prototype.setFillStyle_=function(t,e){t.uniform4fv(this.defaultLocations_.u_color,e)},e.prototype.setFillStrokeStyle=function(t,e){var i=t?t.getColor():[0,0,0,0];if(i=i instanceof CanvasGradient||i instanceof CanvasPattern?gh:_r(i).map(function(t,e){return 3!=e?t/255:t})||gh,this.state_.fillColor&&Z(i,this.state_.fillColor)||(this.state_.fillColor=i,this.state_.changed=!0,this.styles_.push(i)),e)this.lineStringReplay.setFillStrokeStyle(null,e);else{var r=new Er({color:[0,0,0,0],width:0});this.lineStringReplay.setFillStrokeStyle(null,r)}},e}(_h),il=function(t,e){this.space_=e,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=Jn(t,t),this.canvas_=this.context_.canvas};il.prototype.get=function(t){return this.entries_[t]||null},il.prototype.add=function(t,e,i,r,n){for(var o=0,s=this.emptyBlocks_.length;o<s;++o){var a=this.emptyBlocks_[o];if(a.width>=e+this.space_&&a.height>=i+this.space_){var h={offsetX:a.x+this.space_,offsetY:a.y+this.space_,image:this.canvas_};return this.entries_[t]=h,r.call(n,this.context_,a.x+this.space_,a.y+this.space_),this.split_(o,a,e+this.space_,i+this.space_),h}}return null},il.prototype.split_=function(t,e,i,r){var n,o;e.width-i>e.height-r?(n={x:e.x+i,y:e.y,width:e.width-i,height:e.height},o={x:e.x,y:e.y+r,width:i,height:e.height-r},this.updateBlocks_(t,n,o)):(n={x:e.x+i,y:e.y,width:e.width-i,height:r},o={x:e.x,y:e.y+r,width:e.width,height:e.height-r},this.updateBlocks_(t,n,o))},il.prototype.updateBlocks_=function(t,e,i){var r=[t,1];e.width>0&&e.height>0&&r.push(e),i.width>0&&i.height>0&&r.push(i),this.emptyBlocks_.splice.apply(this.emptyBlocks_,r)};var rl=il,nl=function(t){var e=t||{};this.currentSize_=void 0!==e.initialSize?e.initialSize:256,this.maxSize_=void 0!==e.maxSize?e.maxSize:void 0!==nh?nh:2048,this.space_=void 0!==e.space?e.space:1,this.atlases_=[new rl(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new rl(this.currentHitSize_,this.space_)]};nl.prototype.getInfo=function(t){var e=this.getInfo_(this.atlases_,t);if(!e)return null;var i=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(e,i)},nl.prototype.getInfo_=function(t,e){for(var i=0,r=t.length;i<r;++i){var n=t[i].get(e);if(n)return n}return null},nl.prototype.mergeInfos_=function(t,e){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:e.image}},nl.prototype.add=function(t,e,i,r,n,o){if(e+this.space_>this.maxSize_||i+this.space_>this.maxSize_)return null;var s=this.add_(!1,t,e,i,r,o);if(!s)return null;var a=void 0!==n?n:I,h=this.add_(!0,t,e,i,a,o);return this.mergeInfos_(s,h)},nl.prototype.add_=function(t,e,i,r,n,o){var s,a,h,l,u=t?this.hitAtlases_:this.atlases_;for(h=0,l=u.length;h<l;++h){if(a=(s=u[h]).add(e,i,r,n,o))return a;if(!a&&h===l-1){var p=void 0;t?(p=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=p):(p=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=p),s=new rl(p,this.space_),u.push(s),++l}}return null};var ol=nl,sl=function(t){function e(e,i){t.call(this,e,i),this.images_=[],this.textures_=[],this.measureCanvas_=Jn(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText=function(t,e){if(this.text_){var i=null,r=2,n=2;switch(t.getType()){case Nt.POINT:case Nt.MULTI_POINT:r=(i=t.getFlatCoordinates()).length,n=t.getStride();break;case Nt.CIRCLE:i=t.getCenter();break;case Nt.LINE_STRING:i=t.getFlatMidpoint();break;case Nt.MULTI_LINE_STRING:r=(i=t.getFlatMidpoints()).length;break;case Nt.POLYGON:i=t.getFlatInteriorPoint();break;case Nt.MULTI_POLYGON:r=(i=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var s,a,h,l,u,p,c,d,f=this.currAtlas_,_=this.text_.split("\n"),g=this.getTextSize_(_),y=Math.round(g[0]*this.textAlign_-this.offsetX_),v=Math.round(g[1]*this.textBaseline_-this.offsetY_),m=this.state_.lineWidth/2*this.state_.scale;for(s=0,a=_.length;s<a;++s)for(u=0,p=f.height*s,h=0,l=(c=_[s].split("")).length;h<l;++h){if(d=f.atlas.getInfo(c[h])){var x=d.image;if(this.anchorX=y-u,this.anchorY=v-p,this.originX=0===h?d.offsetX-m:d.offsetX,this.originY=d.offsetY,this.height=f.height,this.width=0===h||h===c.length-1?f.width[c[h]]+m:f.width[c[h]],this.imageHeight=x.height,this.imageWidth=x.width,0===this.images_.length)this.images_.push(x);else o(this.images_[this.images_.length-1])!=o(x)&&(this.groupIndices.push(this.indices.length),this.images_.push(x));this.drawText_(i,0,r,n)}u+=this.width}}},e.prototype.getTextSize_=function(t){var e=this,i=this.currAtlas_,r=t.length*i.height;return[t.map(function(t){for(var r=0,n=0,o=t.length;n<o;++n){var s=t[n];i.width[s]||e.addCharToAtlas_(s),r+=i.width[s]?i.width[s]:0}return r}).reduce(function(t,e){return Math.max(t,e)}),r]},e.prototype.drawText_=function(t,e,i,r){for(var n=e,o=i;n<o;n+=r)this.drawCoordinates(t,e,i,r)},e.prototype.addCharToAtlas_=function(t){if(1===t.length){var e=this.currAtlas_,i=this.state_,r=this.measureCanvas_.getContext("2d");r.font=i.font;var n=Math.ceil(r.measureText(t).width*i.scale);e.atlas.add(t,n,e.height,function(e,r,n){e.font=i.font,e.fillStyle=i.fillColor,e.strokeStyle=i.strokeColor,e.lineWidth=i.lineWidth,e.lineCap=i.lineCap,e.lineJoin=i.lineJoin,e.miterLimit=i.miterLimit,e.textAlign="left",e.textBaseline="top",ki&&i.lineDash&&(e.setLineDash(i.lineDash),e.lineDashOffset=i.lineDashOffset),1!==i.scale&&e.setTransform(i.scale,0,0,i.scale,0,0),i.strokeColor&&e.strokeText(t,r,n),i.fillColor&&e.fillText(t,r,n)})&&(e.width[t]=n)}},e.prototype.finish=function(e){var i=e.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Th(this.vertices),this.indicesBuffer=new Th(this.indices);this.createTextures(this.textures_,this.images_,{},i),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,t.prototype.finish.call(this,e)},e.prototype.setTextStyle=function(t){var e=this.state_,i=t.getFill(),r=t.getStroke();if(t&&t.getText()&&(i||r)){if(i){var n=i.getColor();e.fillColor=Ys(n||gh)}else e.fillColor=null;if(r){var o=r.getColor();e.strokeColor=Ys(o||vh),e.lineWidth=r.getWidth()||1,e.lineCap=r.getLineCap()||"round",e.lineDashOffset=r.getLineDashOffset()||0,e.lineJoin=r.getLineJoin()||"round",e.miterLimit=r.getMiterLimit()||10;var s=r.getLineDash();e.lineDash=s?s.slice():yh}else e.strokeColor=null,e.lineWidth=0;e.font=t.getFont()||"10px sans-serif",e.scale=t.getScale()||1,this.text_=t.getText();var a=Sa[t.getTextAlign()],h=Sa[t.getTextBaseline()];this.textAlign_=void 0===a?.5:a,this.textBaseline_=void 0===h?.5:h,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(e)}else this.text_=""},e.prototype.getAtlas_=function(t){var e=[];for(var i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?e=e.concat(t[i]):e.push(t[i]));var r=this.calculateHash_(e);if(!this.atlases_[r]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var o=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[r]={atlas:new ol({space:t.lineWidth+1}),width:{},height:o}}return this.atlases_[r]},e.prototype.calculateHash_=function(t){for(var e="",i=0,r=t.length;i<r;++i)e+=t[i];return e},e.prototype.getTextures=function(t){return this.textures_},e.prototype.getHitDetectionTextures=function(){return this.textures_},e}(Fh),al=[1,1],hl={Circle:Ch,Image:Ah,LineString:Kh,Polygon:el,Text:sl},ll=function(t){function e(e,i,r){t.call(this),this.maxExtent_=i,this.tolerance_=e,this.renderBuffer_=r,this.replaysByZIndex_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addDeclutter=function(t){return[]},e.prototype.getDeleteResourcesFunction=function(t){var e,i=[];for(e in this.replaysByZIndex_){var r=this.replaysByZIndex_[e];for(var n in r)i.push(r[n].getDeleteResourcesFunction(t))}return function(){for(var t,e=arguments,r=i.length,n=0;n<r;n++)t=i[n].apply(this,e);return t}},e.prototype.finish=function(t){var e;for(e in this.replaysByZIndex_){var i=this.replaysByZIndex_[e];for(var r in i)i[r].finish(t)}},e.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new(0,hl[e])(this.tolerance_,this.maxExtent_),r[e]=n);return n},e.prototype.isEmpty=function(){return d(this.replaysByZIndex_)},e.prototype.replay=function(t,e,i,r,n,o,s,a){var h,l,u,p,c,d,f=Object.keys(this.replaysByZIndex_).map(Number);for(f.sort(V),h=0,l=f.length;h<l;++h)for(c=this.replaysByZIndex_[f[h].toString()],u=0,p=Ea.length;u<p;++u)d=c[Ea[u]],void 0!==d&&d.replay(t,e,i,r,n,o,s,a,void 0,!1)},e.prototype.replayHitDetection_=function(t,e,i,r,n,o,s,a,h,l,u){var p,c,d,f,_,g,y=Object.keys(this.replaysByZIndex_).map(Number);for(y.sort(function(t,e){return e-t}),p=0,c=y.length;p<c;++p)for(f=this.replaysByZIndex_[y[p].toString()],d=Ea.length-1;d>=0;--d)if(void 0!==(_=f[Ea[d]])&&(g=_.replay(t,e,i,r,n,o,s,a,h,l,u)))return g},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s,a,h,l){var u,p=e.getGL();return p.bindFramebuffer(p.FRAMEBUFFER,e.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(u=et(pt(t),r*this.renderBuffer_)),this.replayHitDetection_(e,t,r,n,al,s,a,h,function(t){var e=new Uint8Array(4);if(p.readPixels(0,0,1,1,p.RGBA,p.UNSIGNED_BYTE,e),e[3]>0){var i=l(t);if(i)return i}},!0,u)},e.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n,o,s,a,h){var l=e.getGL();return l.bindFramebuffer(l.FRAMEBUFFER,e.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(e,t,r,n,al,s,a,h,function(t){var e=new Uint8Array(4);return l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,e),e[3]>0},!1)},e}(ca),ul=function(t){function e(e,i,r,n,o,s,a){t.call(this),this.context_=e,this.center_=i,this.extent_=s,this.pixelRatio_=a,this.size_=o,this.rotation_=n,this.resolution_=r,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText_=function(t,e){var i=this.context_,r=t.getReplay(0,da.TEXT);r.setTextStyle(this.textStyle_),r.drawText(e,null),r.finish(i);r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),r.getDeleteResourcesFunction(i)()},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.drawGeometry=function(t){switch(t.getType()){case Nt.POINT:this.drawPoint(t,null);break;case Nt.LINE_STRING:this.drawLineString(t,null);break;case Nt.POLYGON:this.drawPolygon(t,null);break;case Nt.MULTI_POINT:this.drawMultiPoint(t,null);break;case Nt.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case Nt.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case Nt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case Nt.CIRCLE:this.drawCircle(t,null)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Pt(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t,e){var i,r,n=t.getGeometriesArray();for(i=0,r=n.length;i<r;++i)this.drawGeometry(n[i])},e.prototype.drawPoint=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.IMAGE);n.setImageStyle(this.imageStyle_),n.drawPoint(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.drawMultiPoint=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.IMAGE);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.drawLineString=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.LINE_STRING);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.drawMultiLineString=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.LINE_STRING);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.drawPolygon=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.POLYGON);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.drawMultiPolygon=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.POLYGON);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.drawCircle=function(t,e){var i=this.context_,r=new ll(1,this.extent_),n=r.getReplay(0,da.CIRCLE);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},e.prototype.setImageStyle=function(t){this.imageStyle_=t},e.prototype.setFillStrokeStyle=function(t,e){this.fillStyle_=t,this.strokeStyle_=e},e.prototype.setTextStyle=function(t){this.textStyle_=t},e}(Vs),pl=new lh("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n"),cl=new uh("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n"),dl=function(t,e){this.u_texCoordMatrix=t.getUniformLocation(e,"u_texCoordMatrix"),this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_texture=t.getUniformLocation(e,"u_texture"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord")},fl=function(t){function e(e,i){t.call(this,i),this.mapRenderer=e,this.arrayBuffer_=new Th([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=[1,0,0,1,0,0],this.projectionMatrix=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.defaultLocations_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bindFramebuffer=function(t,e){var i=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=e){var r=function(t,e,i){t.isContextLost()||(t.deleteFramebuffer(e),t.deleteTexture(i))}.bind(null,i,this.framebuffer,this.texture);t.postRenderFunctions.push(r);var n=Ph(i,e,e),o=i.createFramebuffer();i.bindFramebuffer(36160,o),i.framebufferTexture2D(36160,36064,eh,n,0),this.texture=n,this.framebuffer=o,this.framebufferDimension=e}else i.bindFramebuffer(36160,this.framebuffer)},e.prototype.composeFrame=function(t,e,i){this.dispatchComposeEvent_(ur.PRECOMPOSE,i,t),i.bindBuffer(34962,this.arrayBuffer_);var r,n=i.getGL(),o=i.getProgram(pl,cl);this.defaultLocations_?r=this.defaultLocations_:(r=new dl(n,o),this.defaultLocations_=r),i.useProgram(o)&&(n.enableVertexAttribArray(r.a_position),n.vertexAttribPointer(r.a_position,2,5126,!1,16,0),n.enableVertexAttribArray(r.a_texCoord),n.vertexAttribPointer(r.a_texCoord,2,5126,!1,16,8),n.uniform1i(r.u_texture,0)),n.uniformMatrix4fv(r.u_texCoordMatrix,!1,fh(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(r.u_projectionMatrix,!1,fh(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(r.u_opacity,e.opacity),n.bindTexture(eh,this.getTexture()),n.drawArrays(5,0,4),this.dispatchComposeEvent_(ur.POSTCOMPOSE,i,t)},e.prototype.dispatchComposeEvent_=function(t,e,i){var r=this.getLayer();if(r.hasListener(t)){var n=i.viewState,o=n.resolution,s=i.pixelRatio,a=i.extent,h=n.center,l=n.rotation,u=i.size,p=new ul(e,h,o,l,u,a,s),c=new Cs(t,p,i,null,e);r.dispatchEvent(c)}},e.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},e.prototype.getTexture=function(){return this.texture},e.prototype.getProjectionMatrix=function(){return this.projectionMatrix},e.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},e.prototype.prepareFrame=function(t,e,i){return r()},e.prototype.forEachLayerAtPixel=function(t,e,i,n){return r()},e}($s),_l=function(t){function e(e,i){t.call(this,e,i),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createTexture_=function(t){var e=t.getImage();return bh(this.mapRenderer.getGL(),e,33071,33071)},e.prototype.prepareFrame=function(t,e,i){var r=this.mapRenderer.getGL(),n=t.pixelRatio,o=t.viewState,s=o.center,a=o.resolution,h=o.rotation,l=this.image_,u=this.texture,p=this.getLayer().getSource(),c=t.viewHints,d=t.extent;if(void 0!==e.extent&&(d=wt(d,e.extent)),!c[kn]&&!c[jn]&&!bt(d)){var f=o.projection,_=p.getImage(d,a,n,f);if(_)if(this.loadImage(_)&&(l=_,u=this.createTexture_(_),this.texture)){var g=function(t,e){t.isContextLost()||t.deleteTexture(e)}.bind(null,r,this.texture);t.postRenderFunctions.push(g)}}if(l){var y=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(y.width,y.height,n,s,a,h,l.getExtent()),this.hitTransformationMatrix_=null;var v=this.texCoordMatrix;Fe(v),je(v,1,-1),Ue(v,0,-1),this.image_=l,this.texture=u}return!!l},e.prototype.updateProjectionMatrix_=function(t,e,i,r,n,o,s){var a=t*n,h=e*n,l=this.projectionMatrix;Fe(l),je(l,2*i/a,2*i/h),ke(l,-o),Ue(l,s[0]-r[0],s[1]-r[1]),je(l,(s[2]-s[0])/2,(s[3]-s[1])/2),Ue(l,1,1)},e.prototype.forEachLayerAtPixel=function(t,e,i,r){if(this.image_&&this.image_.getImage()){var n=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(e.size,n));var o=De(this.hitTransformationMatrix_,t.slice());if(!(o[0]<0||o[0]>n[0]||o[1]<0||o[1]>n[1])){this.hitCanvasContext_||(this.hitCanvasContext_=Jn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),o[0],o[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return s[3]>0?i.call(r,this.getLayer(),s):void 0}}},e.prototype.getHitTransformationMatrix_=function(t,e){var i=[1,0,0,1,0,0];Ue(i,-1,-1),je(i,2/t[0],2/t[1]),Ue(i,0,t[1]),je(i,1,-1);var r=Be(this.projectionMatrix.slice()),n=[1,0,0,1,0,0];return Ue(n,0,e[1]),je(n,1,-1),je(n,e[0]/2,e[1]/2),Ue(n,1,1),Ae(n,r),Ae(n,i),n},e}(fl);_l.handles=function(t){return t.getType()===Ss.IMAGE},_l.create=function(t,e){return new _l(t,e)};var gl=_l,yl=function(t){function e(e){t.call(this,e);var i=e.getViewport();this.canvas_=document.createElement("canvas"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=fo,i.insertBefore(this.canvas_,i.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=Jn(),this.renderedVisible_=!0,this.gl_=rh(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new Mh(this.canvas_,this.gl_),v(this.canvas_,Lh.LOST,this.handleWebGLContextLost,this),v(this.canvas_,Lh.RESTORED,this.handleWebGLContextRestored,this),this.textureCache_=new Rs,this.focus_=null,this.tileTextureQueue_=new bn(function(t){var e=t[1],i=t[2],r=e[0]-this.focus_[0],n=e[1]-this.focus_[1];return 65536*Math.log(i)+Math.sqrt(r*r+n*n)/i}.bind(this),function(t){return t[0].getKey()}),this.loadNextTileTexture_=function(t,e){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var i=this.tileTextureQueue_.dequeue(),r=i[0],n=i[3],o=i[4];this.bindTileTexture(r,n,o,Qa,Qa)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bindTileTexture=function(t,e,i,r,n){var o=this.getGL(),s=t.getKey();if(this.textureCache_.containsKey(s)){var a=this.textureCache_.get(s);o.bindTexture(eh,a.texture),a.magFilter!=r&&(o.texParameteri(eh,10240,r),a.magFilter=r),a.minFilter!=n&&(o.texParameteri(eh,10241,n),a.minFilter=n)}else{var h=o.createTexture(),l=t;if(o.bindTexture(eh,h),i>0){var u=this.clipTileContext_.canvas,p=this.clipTileContext_;this.clipTileCanvasWidth_!==e[0]||this.clipTileCanvasHeight_!==e[1]?(u.width=e[0],u.height=e[1],this.clipTileCanvasWidth_=e[0],this.clipTileCanvasHeight_=e[1]):p.clearRect(0,0,e[0],e[1]),p.drawImage(l.getImage(),i,i,e[0],e[1],0,0,e[0],e[1]),o.texImage2D(eh,0,6408,6408,5121,u)}else o.texImage2D(eh,0,6408,6408,5121,l.getImage());o.texParameteri(eh,10240,r),o.texParameteri(eh,10241,n),o.texParameteri(eh,$a,33071),o.texParameteri(eh,th,33071),this.textureCache_.set(s,{texture:h,magFilter:r,minFilter:n})}},e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var r=this.context_,n=e.extent,o=e.size,s=e.viewState,a=e.pixelRatio,h=s.resolution,l=s.center,u=s.rotation,p=new ul(r,l,h,u,o,n,a),c=new Cs(t,p,e,null,r);i.dispatchEvent(c)}},e.prototype.disposeInternal=function(){var e=this.getGL();e.isContextLost()||this.textureCache_.forEach(function(t){t&&e.deleteTexture(t.texture)}),this.context_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.expireCache_=function(t,e){for(var i,r=this.getGL();this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>1024;){if(i=this.textureCache_.peekLast())r.deleteTexture(i.texture);else{if(+this.textureCache_.peekLastKey()==e.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},e.prototype.getContext=function(){return this.context_},e.prototype.getGL=function(){return this.gl_},e.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},e.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var e=this.getLayerRenderers();for(var i in e){e[i].handleWebGLContextLost()}},e.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},e.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(33984),t.blendFuncSeparate(770,771,1,771),t.disable(2884),t.disable(2929),t.disable(3089),t.disable(2960)},e.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},e.prototype.renderFrame=function(t){var e=this.getContext(),i=this.getGL();if(i.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchRenderEvent(ur.PRECOMPOSE,t);var r=[],n=t.layerStatesArray;q(n,Zs);var o,s,a=t.viewState.resolution;for(o=0,s=n.length;o<s;++o){var h=n[o];if(mo(h,a)&&h.sourceState==ro.READY)this.getLayerRenderer(h.layer).prepareFrame(t,h,e)&&r.push(h)}var l=t.size[0]*t.pixelRatio,u=t.size[1]*t.pixelRatio;for(this.canvas_.width==l&&this.canvas_.height==u||(this.canvas_.width=l,this.canvas_.height=u),i.bindFramebuffer(36160,null),i.clearColor(0,0,0,0),i.clear(16384),i.enable(3042),i.viewport(0,0,this.canvas_.width,this.canvas_.height),o=0,s=r.length;o<s;++o){var p=r[o];this.getLayerRenderer(p.layer).composeFrame(t,p,e)}this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>1024&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchRenderEvent(ur.POSTCOMPOSE,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s){var a;if(this.getGL().isContextLost())return!1;var h,l=e.viewState,u=e.layerStatesArray;for(h=u.length-1;h>=0;--h){var p=u[h],c=p.layer;if(mo(p,l.resolution)&&o.call(s,c))if(a=this.getLayerRenderer(c).forEachFeatureAtCoordinate(t,e,i,r))return a}},e.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n){var o=!1;if(this.getGL().isContextLost())return!1;var s,a=e.viewState,h=e.layerStatesArray;for(s=h.length-1;s>=0;--s){var l=h[s],u=l.layer;if(mo(l,a.resolution)&&r.call(n,u))if(o=this.getLayerRenderer(u).hasFeatureAtCoordinate(t,e))return!0}return o},e.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){if(this.getGL().isContextLost())return!1;var a,h,l=e.viewState,u=e.layerStatesArray;for(h=u.length-1;h>=0;--h){var p=u[h],c=p.layer;if(mo(p,l.resolution)&&o.call(n,c))if(a=this.getLayerRenderer(c).forEachLayerAtPixel(t,e,r,n))return a}},e}(qs),vl=function(t){function e(e,i,r){t.call(this);var n=r||{};this.tileCoord=e,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===n.transition?250:n.transition,this.transitionStarts_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(M.CHANGE)},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()==On.LOADED)return 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()==On.LOADED){t.interimTile=null;break}t.getState()==On.LOADING?e=t:t.getState()==On.IDLE?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){this.state=t,this.changed()},e.prototype.load=function(){},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 r=e-i+1e3/60;return r>=this.transition_?1:Vn(r/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}(b);function ml(){var t=Jn(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var xl=function(t){function e(e,i,r,n,o,s){t.call(this,e,i,s),this.crossOrigin_=n,this.src_=r,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.imageListenerKeys_=null,this.tileLoadFunction_=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==On.LOADING&&(this.unlistenImage_(),this.image_=ml()),this.interimTile&&this.interimTile.dispose(),this.state=On.ABORT,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=On.ERROR,this.unlistenImage_(),this.image_=ml(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=On.LOADED:this.state=On.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==On.ERROR&&(this.state=On.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==On.IDLE&&(this.state=On.LOADING,this.changed(),this.imageListenerKeys_=[m(this.image_,M.ERROR,this.handleImageError_,this),m(this.image_,M.LOAD,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(E),this.imageListenerKeys_=null},e}(vl);function El(t,e,i,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=i,r):[t,e,i]}function Sl(t,e,i){return t+"/"+e+"/"+i}function Tl(t){return Sl(t[0],t[1],t[2])}function Cl(t){return(t[1]<<t[0])+t[2]}var Rl=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast(),i=e.tileCoord[0].toString();if(i in t&&t[i].contains(e.tileCoord))break;this.pop().dispose()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Tl(e.tileCoord)),e.dispose())},this)}},e}(Rs);function wl(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Il=function(t){function e(e){t.call(this),this.projection_=Ee(e.projection),this.attributions_=wl(e.attributions),this.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,this.loading=!1,this.state_=void 0!==e.state?e.state:ro.READY,this.wrapX_=void 0!==e.wrapX&&e.wrapX}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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 r()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=wl(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(D),Ll=[0,0,0],Ol=function(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Y(function(t,e,i){var r=e||V;return t.every(function(e,n){if(0===n)return!0;var o=r(t[n-1],e);return!(o>0||i&&0===o)})}(this.resolutions_,function(t,e){return e-t},!0),17),!t.origins)for(var i=0,r=this.resolutions_.length-1;i<r;++i)if(e){if(this.resolutions_[i]/this.resolutions_[i+1]!==e){e=void 0;break}}else e=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=e,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,Y(this.origins_.length==this.resolutions_.length,20));var n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=It(n)),Y(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Y(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:An,Y(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){return new sa(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):n&&this.calculateTileRanges_(n)};Ol.prototype.forEachTileCoord=function(t,e,i){for(var r=this.getTileRangeForExtentAndZ(t,e),n=r.minX,o=r.maxX;n<=o;++n)for(var s=r.minY,a=r.maxY;s<=a;++s)i([e,n,s])},Ol.prototype.forEachTileCoordParentTileRange=function(t,e,i,r,n){var o,s,a,h=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],a=t[2]):h=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(o=2===this.zoomFactor_?oa(s=Math.floor(s/2),s,a=Math.floor(a/2),a,r):this.getTileRangeForExtentAndZ(h,l,r),e.call(i,l,o))return!0;--l}return!1},Ol.prototype.getExtent=function(){return this.extent_},Ol.prototype.getMaxZoom=function(){return this.maxZoom},Ol.prototype.getMinZoom=function(){return this.minZoom},Ol.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Ol.prototype.getResolution=function(t){return this.resolutions_[t]},Ol.prototype.getResolutions=function(){return this.resolutions_},Ol.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],n=2*t[2];return oa(r,r+1,n,n+1,e)}var o=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},Ol.prototype.getTileRangeExtent=function(t,e,i){var r=this.getOrigin(t),n=this.getResolution(t),o=ho(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*n,a=r[0]+(e.maxX+1)*o[0]*n;return lt(s,r[1]+e.minY*o[1]*n,a,r[1]+(e.maxY+1)*o[1]*n,i)},Ol.prototype.getTileRangeForExtentAndZ=function(t,e,i){var r=Ll;this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r);var n=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[3],e,!0,r),oa(n,r[1],o,r[2],i)},Ol.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=ho(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*i,e[1]+(t[2]+.5)*r[1]*i]},Ol.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=ho(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*n[0]*r,s=i[1]+t[2]*n[1]*r;return lt(o,s,o+n[0]*r,s+n[1]*r,e)},Ol.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},Ol.prototype.getTileCoordForXYAndResolution_=function(t,e,i,r,n){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),h=ho(this.getTileSize(o),this.tmpSize_),l=r?.5:0,u=r?0:.5,p=Math.floor((t-a[0])/i+l),c=Math.floor((e-a[1])/i+u),d=s*p/h[0],f=s*c/h[1];return r?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),El(o,d,f,n)},Ol.prototype.getTileCoordForXYAndZ_=function(t,e,i,r,n){var o=this.getOrigin(i),s=this.getResolution(i),a=ho(this.getTileSize(i),this.tmpSize_),h=r?.5:0,l=r?0:.5,u=Math.floor((t-o[0])/s+h),p=Math.floor((e-o[1])/s+l),c=u/a[0],d=p/a[1];return r?(c=Math.ceil(c)-1,d=Math.ceil(d)-1):(c=Math.floor(c),d=Math.floor(d)),El(i,c,d,n)},Ol.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},Ol.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},Ol.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},Ol.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},Ol.prototype.getZForResolution=function(t,e){return kt(z(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},Ol.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),r=this.minZoom;r<e;++r)i[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=i};var Pl=Ol;function bl(t){var e=t.getDefaultTileGrid();return e||(e=Nl(t),t.setDefaultTileGrid(e)),e}function Ml(t,e,i,r){var n=void 0!==r?r:Q.TOP_LEFT,o=Al(t,e,i);return new Pl({extent:t,origin:function(t,e){var i;return e===Q.BOTTOM_LEFT?i=Et(t):e===Q.BOTTOM_RIGHT?i=St(t):e===Q.TOP_LEFT?i=It(t):e===Q.TOP_RIGHT?i=Lt(t):Y(!1,13),i}(t,n),resolutions:o,tileSize:i})}function Fl(t){var e=t||{},i=e.extent||Ee("EPSG:3857").getExtent(),r={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Al(i,e.maxZoom,e.tileSize)};return new Pl(r)}function Al(t,e,i){for(var r=void 0!==e?e:Fn,n=Rt(t),o=Ot(t),s=ho(void 0!==i?i:An),a=Math.max(o/s[0],n/s[1]),h=r+1,l=new Array(h),u=0;u<h;++u)l[u]=a/Math.pow(2,u);return l}function Nl(t,e,i,r){return Ml(Gl(t),e,i,r)}function Gl(t){var e=(t=Ee(t)).getExtent();if(!e){var i=180*Qt[$t.DEGREES]/t.getMetersPerUnit();e=lt(-i,-i,i,i)}return e}var Dl=function(t){function e(e){t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX}),this.opaque_=void 0!==e.opaque&&e.opaque,this.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,this.tileGrid=void 0!==e.tileGrid?e.tileGrid:null,this.tileCache=new Rl(e.cacheSize),this.tmpSize=[0,0],this.key_=e.key||"",this.tileOptions={transition:e.transition}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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,r){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var o,s,a,h=!0,l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u)s=Sl(e,l,u),a=!1,n.containsKey(s)&&(a=(o=n.get(s)).getState()===On.LOADED)&&(a=!1!==r(o)),a||(h=!1);return h},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,o){return r()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:bl(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!Ie(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var r=this.getTileGridForProjection(i),n=this.getTilePixelRatio(e),o=ho(r.getTileSize(t),this.tmpSize);return 1==n?o:ao(o,n,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var r=e[0],n=t.getTileCoordCenter(e),o=Gl(i);if(nt(o,n))return e;var s=Ot(o),a=Math.ceil((o[0]-n[0])/s);return n[0]+=s*a,t.getTileCoordForCoordAndZ(n,r)}(r,t,i)),function(t,e){var i=t[0],r=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||o.containsXY(r,n)}(t,r)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,i,r){},e}(Il),kl=function(t){function e(e,i){t.call(this,e),this.tile=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),jl=Dl,Ul=new lh("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n"),Yl=new uh("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n"),Bl=function(t,e){this.u_tileOffset=t.getUniformLocation(e,"u_tileOffset"),this.u_texture=t.getUniformLocation(e,"u_texture"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord")},Vl=function(t){function e(e,i){t.call(this,e,i),this.fragmentShader_=Ul,this.vertexShader_=Yl,this.locations_=null,this.renderArrayBuffer_=new Th([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),t.prototype.disposeInternal.call(this)},e.prototype.createLoadedTileFinder=function(t,e,i){var r=this.mapRenderer;return function(n,o){return t.forEachLoadedTile(e,n,o,function(t){var e=r.isTileTextureLoaded(t);return e&&(i[n]||(i[n]={}),i[n][t.tileCoord.toString()]=t),e})}},e.prototype.handleWebGLContextLost=function(){t.prototype.handleWebGLContextLost.call(this),this.locations_=null},e.prototype.prepareFrame=function(t,e,i){var r=this.mapRenderer,n=i.getGL(),o=t.viewState,s=o.projection,a=this.getLayer(),h=a.getSource();if(!(h instanceof jl))return!0;var l,u=h.getTileGridForProjection(s),p=u.getZForResolution(o.resolution),c=u.getResolution(p),d=h.getTilePixelSize(p,t.pixelRatio,s),f=d[0]/ho(u.getTileSize(p),this.tmpSize_)[0],_=c/f,g=h.getTilePixelRatio(f)*h.getGutterForProjection(s),y=o.center,v=t.extent,m=u.getTileRangeForExtentAndZ(v,p);if(this.renderedTileRange_&&this.renderedTileRange_.equals(m)&&this.renderedRevision_==h.getRevision())l=this.renderedFramebufferExtent_;else{var x=m.getSize(),E=function(t){return Y(0<t,29),Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}(Math.max(x[0]*d[0],x[1]*d[1])),S=_*E,T=u.getOrigin(p),C=T[0]+m.minX*d[0]*_,R=T[1]+m.minY*d[1]*_;l=[C,R,C+S,R+S],this.bindFramebuffer(t,E),n.viewport(0,0,E,E),n.clearColor(0,0,0,0),n.clear(16384),n.disable(3042);var w=i.getProgram(this.fragmentShader_,this.vertexShader_);i.useProgram(w),this.locations_||(this.locations_=new Bl(n,w)),i.bindBuffer(34962,this.renderArrayBuffer_),n.enableVertexAttribArray(this.locations_.a_position),n.vertexAttribPointer(this.locations_.a_position,2,5126,!1,16,0),n.enableVertexAttribArray(this.locations_.a_texCoord),n.vertexAttribPointer(this.locations_.a_texCoord,2,5126,!1,16,8),n.uniform1i(this.locations_.u_texture,0);var I={};I[p]={};var L,O,P,b,M,F,A=this.createLoadedTileFinder(h,s,I),N=a.getUseInterimTilesOnError(),G=!0,D=[1/0,1/0,-1/0,-1/0],k=new sa(0,0,0,0);for(b=m.minX;b<=m.maxX;++b)for(M=m.minY;M<=m.maxY;++M)if(O=h.getTile(p,b,M,f,s),void 0===e.extent||Pt(F=u.getTileCoordExtent(O.tileCoord,D),e.extent)){if((P=O.getState())==On.LOADED||P==On.EMPTY||P==On.ERROR&&!N||(O=O.getInterimTile()),(P=O.getState())==On.LOADED){if(r.isTileTextureLoaded(O)){I[p][O.tileCoord.toString()]=O;continue}}else if(P==On.EMPTY||P==On.ERROR&&!N)continue;G=!1,u.forEachTileCoordParentTileRange(O.tileCoord,A,null,k,D)||(L=u.getTileCoordChildTileRange(O.tileCoord,k,D))&&A(p+1,L)}var j=Object.keys(I).map(Number);j.sort(V);for(var U=new Float32Array(4),B=0,X=j.length;B<X;++B){var z=I[j[B]];for(var W in z)(O=z[W])instanceof xl&&(F=u.getTileCoordExtent(O.tileCoord,D),U[0]=2*(F[2]-F[0])/S,U[1]=2*(F[3]-F[1])/S,U[2]=2*(F[0]-l[0])/S-1,U[3]=2*(F[1]-l[1])/S-1,n.uniform4fv(this.locations_.u_tileOffset,U),r.bindTileTexture(O,d,g*f,Qa,Qa),n.drawArrays(5,0,4))}G?(this.renderedTileRange_=m,this.renderedFramebufferExtent_=l,this.renderedRevision_=h.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,h,p,m);var K=r.getTileTextureQueue();this.manageTilePyramid(t,h,u,f,s,v,p,a.getPreload(),function(t){t.getState()!=On.LOADED||r.isTileTextureLoaded(t)||K.isKeyQueued(t.getKey())||K.enqueue([t,u.getTileCoordCenter(t.tileCoord),u.getResolution(t.tileCoord[0]),d,g*f])},this),this.scheduleExpireCache(t,h);var H=this.texCoordMatrix;return Fe(H),Ue(H,(Math.round(y[0]/c)*c-l[0])/(l[2]-l[0]),(Math.round(y[1]/c)*c-l[1])/(l[3]-l[1])),0!==o.rotation&&ke(H,o.rotation),je(H,t.size[0]*o.resolution/(l[2]-l[0]),t.size[1]*o.resolution/(l[3]-l[1])),Ue(H,-.5,-.5),!0},e.prototype.forEachLayerAtPixel=function(t,e,i,r){if(this.framebuffer){var n=[t[0]/e.size[0],(e.size[1]-t[1])/e.size[1]],o=De(this.texCoordMatrix,n.slice()),s=[o[0]*this.framebufferDimension,o[1]*this.framebufferDimension],a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var h=new Uint8Array(4);return a.readPixels(s[0],s[1],1,1,a.RGBA,a.UNSIGNED_BYTE,h),h[3]>0?i.call(r,this.getLayer(),h):void 0}},e}(fl);Vl.handles=function(t){return t.getType()===Ss.TILE},Vl.create=function(t,e){return new Vl(t,e)};var Xl=Vl,zl=function(t){function e(e,i){t.call(this,e,i),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.composeFrame=function(t,e,i){this.layerState_=e;var r=t.viewState,n=this.replayGroup_,o=t.size,s=t.pixelRatio,a=this.mapRenderer.getGL();n&&!n.isEmpty()&&(a.enable(a.SCISSOR_TEST),a.scissor(0,0,o[0]*s,o[1]*s),n.replay(i,r.center,r.resolution,r.rotation,o,s,e.opacity,e.managed?t.skippedFeatureUids:{}),a.disable(a.SCISSOR_TEST))},e.prototype.disposeInternal=function(){var e=this.replayGroup_;if(e){var i=this.mapRenderer.getContext();e.getDeleteResourcesFunction(i)(),this.replayGroup_=null}t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(this.replayGroup_&&this.layerState_){var s=this.mapRenderer.getContext(),a=e.viewState,h=this.getLayer(),l=this.layerState_,u={};return this.replayGroup_.forEachFeatureAtCoordinate(t,s,a.center,a.resolution,a.rotation,e.size,e.pixelRatio,l.opacity,{},function(t){var e=o(t);if(!(e in u))return u[e]=!0,r.call(n,t,h)})}},e.prototype.hasFeatureAtCoordinate=function(t,e){if(this.replayGroup_&&this.layerState_){var i=this.mapRenderer.getContext(),r=e.viewState,n=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,i,r.center,r.resolution,r.rotation,e.size,e.pixelRatio,n.opacity,e.skippedFeatureUids)}return!1},e.prototype.forEachLayerAtPixel=function(t,e,i,r){var n=De(e.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,e)?i.call(r,this.getLayer(),null):void 0},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e,i){var r=this.getLayer(),n=r.getSource(),o=t.viewHints[kn],s=t.viewHints[jn],a=r.getUpdateWhileAnimating(),h=r.getUpdateWhileInteracting();if(!this.dirty_&&!a&&o||!h&&s)return!0;var l=t.extent,u=t.viewState,p=u.projection,c=u.resolution,d=t.pixelRatio,f=r.getRevision(),_=r.getRenderBuffer(),g=r.getRenderOrder();void 0===g&&(g=Da);var y=et(l,_*c);if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&ot(this.renderedExtent_,y))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(i)),this.dirty_=!1;var v=new ll(ja(c,d),y,r.getRenderBuffer());n.loadFeatures(y,c,p);var m=function(t){var e,i=t.getStyleFunction()||r.getStyleFunction();if(i&&(e=i(t,c)),e){var n=this.renderFeature(t,c,d,e,v);this.dirty_=this.dirty_||n}}.bind(this);if(g){var x=[];n.forEachFeatureInExtent(y,function(t){x.push(t)}),x.sort(g),x.forEach(m.bind(this))}else n.forEachFeatureInExtent(y,m);return v.finish(i),this.renderedResolution_=c,this.renderedRevision_=f,this.renderedRenderOrder_=g,this.renderedExtent_=y,this.replayGroup_=v,!0},e.prototype.renderFeature=function(t,e,i,r,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=r.length-1;s>=0;--s)o=Ua(n,t,r[s],ka(e,i),this.handleStyleImageChange_,this)||o;else o=Ua(n,t,r,ka(e,i),this.handleStyleImageChange_,this)||o;return o},e}(fl);zl.handles=function(t){return t.getType()===Ss.VECTOR},zl.create=function(t,e){return new zl(t,e)};var Wl=zl,Kl=function(t){function e(e){(e=u({},e)).controls||(e.controls=wo()),e.interactions||(e.interactions=ys()),t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){var t=new yl(this);return t.registerLayerRenderers([gl,Xl,Wl]),t},e}(lo),Hl={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};function Zl(t,e,i,r){return function(n,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,o,s):t,!0),e.getType()==Hl.ARRAY_BUFFER&&(a.responseType="arraybuffer"),a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var n,o=e.getType();o==Hl.JSON||o==Hl.TEXT?n=a.responseText:o==Hl.XML?(n=a.responseXML)||(n=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==Hl.ARRAY_BUFFER&&(n=a.response),n?i.call(this,e.readFeatures(n,{featureProjection:s}),e.readProjection(n),e.getLastExtent()):r.call(this)}else r.call(this)}.bind(this),a.onerror=function(){r.call(this)}.bind(this),a.send()}}function ql(t,e){return Zl(t,e,function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)},I)}function Jl(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Ql=document.implementation.createDocument("","",null),$l="http://www.w3.org/2001/XMLSchema-instance";function tu(t,e){return Ql.createElementNS(t,e)}function eu(t,e){return function t(e,i,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)i?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var n;for(n=e.firstChild;n;n=n.nextSibling)t(n,i,r)}return r}(t,e,[]).join("")}function iu(t){return"documentElement"in t}function ru(t){return(new DOMParser).parseFromString(t,"application/xml")}function nu(t,e){return function(i,r){var n=t.call(void 0!==e?e:this,i,r);void 0!==n&&K(r[r.length-1],n)}}function ou(t,e){return function(i,r){var n=t.call(void 0!==e?e:this,i,r);void 0!==n&&r[r.length-1].push(n)}}function su(t,e){return function(i,r){var n=t.call(void 0!==e?e:this,i,r);void 0!==n&&(r[r.length-1]=n)}}function au(t,e,i){return function(r,n){var o=t.call(void 0!==i?i:this,r,n);if(void 0!==o){var s=n[n.length-1],a=void 0!==e?e:r.localName;(a in s?s[a]:s[a]=[]).push(o)}}}function hu(t,e,i){return function(r,n){var o=t.call(void 0!==i?i:this,r,n);void 0!==o&&(n[n.length-1][void 0!==e?e:r.localName]=o)}}function lu(t,e){return function(i,r,n){t.call(void 0!==e?e:this,i,r,n),n[n.length-1].node.appendChild(i)}}function uu(t,e){var i,r;return function(e,n,o){if(void 0===i){i={};var s={};s[e.localName]=t,i[e.namespaceURI]=s,r=pu(e.localName)}yu(i,r,n,o)}}function pu(t,e){var i=t;return function(t,r,n){var o=r[r.length-1].node,s=i;return void 0===s&&(s=n),tu(void 0!==e?e:o.namespaceURI,s)}}var cu=pu();function du(t,e){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=t[e[n]];return r}function fu(t,e,i){var r,n,o=void 0!==i?i:{};for(r=0,n=t.length;r<n;++r)o[t[r]]=e;return o}function _u(t,e,i,r){var n;for(n=e.firstElementChild;n;n=n.nextElementSibling){var o=t[n.namespaceURI];if(void 0!==o){var s=o[n.localName];void 0!==s&&s.call(r,n,i)}}}function gu(t,e,i,r,n){return r.push(t),_u(e,i,r,n),r.pop()}function yu(t,e,i,r,n,o){for(var s,a,h=(void 0!==n?n:i).length,l=0;l<h;++l)void 0!==(s=i[l])&&void 0!==(a=e.call(void 0!==o?o:this,s,r,void 0!==n?n[l]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,r)}function vu(t,e,i,r,n,o,s){return n.push(t),yu(e,i,r,n,o,s),n.pop()}var mu=function(t){function e(e){t.call(this,{extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes}),this.matrixIds_=e.matrixIds}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(Pl),xu=mu;function Eu(t,e,i){var r=[],n=[],o=[],s=[],a=[],h=void 0!==i?i:[],l=t.SupportedCRS,u=Ee(l.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Ee(l),p=u.getMetersPerUnit(),c="ne"==u.getAxisOrientation().substr(0,2);return t.TileMatrix.sort(function(t,e){return e.ScaleDenominator-t.ScaleDenominator}),t.TileMatrix.forEach(function(e){if(!(h.length>0)||H(h,function(i){return e.Identifier==i.TileMatrix||-1===e.Identifier.indexOf(":")&&t.Identifier+":"+e.Identifier===i.TileMatrix})){n.push(e.Identifier);var i=28e-5*e.ScaleDenominator/p,l=e.TileWidth,u=e.TileHeight;c?o.push([e.TopLeftCorner[1],e.TopLeftCorner[0]]):o.push(e.TopLeftCorner),r.push(i),s.push(l==u?l:[l,u]),a.push([e.MatrixWidth,-e.MatrixHeight])}}),new mu({extent:e,origins:o,resolutions:r,matrixIds:n,tileSizes:s,sizes:a})}var Su=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale};Su.prototype.clone=function(){return new Su({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Su.prototype.getOpacity=function(){return this.opacity_},Su.prototype.getRotateWithView=function(){return this.rotateWithView_},Su.prototype.getRotation=function(){return this.rotation_},Su.prototype.getScale=function(){return this.scale_},Su.prototype.getSnapToPixel=function(){return!1},Su.prototype.getAnchor=function(){return r()},Su.prototype.getImage=function(t){return r()},Su.prototype.getHitDetectionImage=function(t){return r()},Su.prototype.getImageState=function(){return r()},Su.prototype.getImageSize=function(){return r()},Su.prototype.getHitDetectionImageSize=function(){return r()},Su.prototype.getOrigin=function(){return r()},Su.prototype.getSize=function(){return r()},Su.prototype.setOpacity=function(t){this.opacity_=t},Su.prototype.setRotateWithView=function(t){this.rotateWithView_=t},Su.prototype.setRotation=function(t){this.rotation_=t},Su.prototype.setScale=function(t){this.scale_=t},Su.prototype.setSnapToPixel=function(t){},Su.prototype.listenImageChange=function(t,e){return r()},Su.prototype.load=function(){r()},Su.prototype.unlistenImageChange=function(t,e){r()};var Tu=Su,Cu=function(t){function e(e){var i=void 0!==e.rotateWithView&&e.rotateWithView;t.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==e.rotation?e.rotation:0,scale:1}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==e.fill?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius_=void 0!==e.radius?e.radius:e.radius1,this.radius2_=e.radius2,this.angle_=void 0!==e.angle?e.angle:0,this.stroke_=void 0!==e.stroke?e.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=e.atlasManager,this.render_(this.atlasManager_)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},e.prototype.getImage=function(t){return this.canvas_},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return xs.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t,e){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t,e){},e.prototype.render_=function(t){var e,i,r="",n="",o=0,s=null,a=0,h=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Ls),i=Ys(i),void 0===(h=this.stroke_.getWidth())&&(h=1),s=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),ki||(s=null,a=0),void 0===(n=this.stroke_.getLineJoin())&&(n="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(o=this.stroke_.getMiterLimit())&&(o=10));var l=2*(this.radius_+h)+1,u={strokeStyle:i,strokeWidth:h,size:l,lineCap:r,lineDash:s,lineDashOffset:a,lineJoin:n,miterLimit:o};if(void 0===t){var p=Jn(l,l);this.canvas_=p.canvas,e=l=this.canvas_.width,this.draw_(u,p,0,0),this.createHitDetectionCanvas_(u)}else{l=Math.round(l);var c,d=!this.fill_;d&&(c=this.drawHitDetectionCanvas_.bind(this,u));var f=this.getChecksum(),_=t.add(f,l,l,this.draw_.bind(this,u),c);this.canvas_=_.image,this.origin_=[_.offsetX,_.offsetY],e=_.image.width,d?(this.hitDetectionCanvas_=_.hitImage,this.hitDetectionImageSize_=[_.hitImage.width,_.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[e,e])}this.anchor_=[l/2,l/2],this.size_=[l,l],this.imageSize_=[e,e]},e.prototype.draw_=function(t,e,i,r){var n,o,s;e.setTransform(1,0,0,1,0,0),e.translate(i,r),e.beginPath();var a=this.points_;if(a===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(a*=2),n=0;n<=a;n++)o=2*n*Math.PI/a-Math.PI/2+this.angle_,s=n%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(o),t.size/2+s*Math.sin(o))}if(this.fill_){var l=this.fill_.getColor();null===l&&(l=ws),e.fillStyle=Ys(l),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var e=Jn(t.size,t.size);this.hitDetectionCanvas_=e.canvas,this.drawHitDetectionCanvas_(t,e,0,0)}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,r){e.setTransform(1,0,0,1,0,0),e.translate(i,r),e.beginPath();var n=this.points_;if(n===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o,s,a,h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(n*=2),o=0;o<=n;o++)a=2*o*Math.PI/n-Math.PI/2+this.angle_,s=o%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}e.fillStyle=dr(ws),e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",e=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||e!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+t+e+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,t,e,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},e}(Tu),Ru=function(t){function e(e){var i=e||{};t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)},e}(Cu),wu={FRACTION:"fraction",PIXELS:"pixels"},Iu=function(t){function e(e,i,r,n,o,s){t.call(this),this.hitDetectionImage_=null,this.image_=e||new Image,null!==n&&(this.image_.crossOrigin=n),this.canvas_=s?document.createElement("canvas"):null,this.color_=s,this.imageListenerKeys_=null,this.imageState_=o,this.size_=r,this.src_=i,this.tainted_}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===xs.LOADED){this.tainted_=!1;var t=Jn(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(t){this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(M.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=xs.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=xs.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.isTainted_()){var e=this.size_[0],i=this.size_[1],r=Jn(e,i);r.fillRect(0,0,e,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==xs.IDLE){this.imageState_=xs.LOADING,this.imageListenerKeys_=[m(this.image_,M.ERROR,this.handleImageError_,this),m(this.image_,M.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},e.prototype.replaceColor_=function(){if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var e=t.getImageData(0,0,this.image_.width,this.image_.height),i=e.data,r=this.color_[0]/255,n=this.color_[1]/255,o=this.color_[2]/255,s=0,a=i.length;s<a;s+=4)i[s]*=r,i[s+1]*=n,i[s+2]*=o;t.putImageData(e,0,0)}},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(E),this.imageListenerKeys_=null},e}(b);var Lu={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Ou=function(t){function e(e){var i=e||{},r=void 0!==i.opacity?i.opacity:1,n=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,a=void 0!==i.rotateWithView&&i.rotateWithView;t.call(this,{opacity:r,rotation:n,scale:s,rotateWithView:a}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Lu.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:wu.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:wu.FRACTION,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var h=void 0!==i.img?i.img:null,l=void 0!==i.imgSize?i.imgSize:null,u=i.src;Y(!(void 0!==u&&h),4),Y(!h||h&&l,5),void 0!==u&&0!==u.length||!h||(u=h.src||o(h)),Y(void 0!==u&&u.length>0,6);var p=void 0!==i.src?xs.IDLE:xs.LOADED;this.color_=void 0!==i.color?_r(i.color):null,this.iconImage_=function(t,e,i,r,n,o){var s=Ks.get(e,r,o);return s||(s=new Iu(t,e,i,r,n,o),Ks.set(e,r,o,s)),s}(h,u,l,this.crossOrigin_,p,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Lu.TOP_LEFT,this.origin_=null,this.size_=void 0!==i.size?i.size:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==wu.FRACTION||this.anchorYUnits_==wu.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==wu.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==wu.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Lu.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Lu.TOP_RIGHT&&this.anchorOrigin_!=Lu.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Lu.BOTTOM_LEFT&&this.anchorOrigin_!=Lu.BOTTOM_RIGHT||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Lu.TOP_LEFT){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Lu.TOP_RIGHT&&this.offsetOrigin_!=Lu.BOTTOM_RIGHT||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Lu.BOTTOM_LEFT&&this.offsetOrigin_!=Lu.BOTTOM_RIGHT||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t,e){return v(this.iconImage_,M.CHANGE,t,e)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t,e){x(this.iconImage_,M.CHANGE,t,e)},e}(Tu),Pu=function(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Au,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex};Pu.prototype.clone=function(){var t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new Pu({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},Pu.prototype.getRenderer=function(){return this.renderer_},Pu.prototype.setRenderer=function(t){this.renderer_=t},Pu.prototype.getGeometry=function(){return this.geometry_},Pu.prototype.getGeometryFunction=function(){return this.geometryFunction_},Pu.prototype.getFill=function(){return this.fill_},Pu.prototype.setFill=function(t){this.fill_=t},Pu.prototype.getImage=function(){return this.image_},Pu.prototype.setImage=function(t){this.image_=t},Pu.prototype.getStroke=function(){return this.stroke_},Pu.prototype.setStroke=function(t){this.stroke_=t},Pu.prototype.getText=function(){return this.text_},Pu.prototype.setText=function(t){this.text_=t},Pu.prototype.getZIndex=function(){return this.zIndex_},Pu.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Au,this.geometry_=t},Pu.prototype.setZIndex=function(t){this.zIndex_=t};var bu=null;function Mu(t,e){if(!bu){var i=new mr({color:"rgba(255,255,255,0.4)"}),r=new Er({color:"#3399CC",width:1.25});bu=[new Pu({image:new Ru({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return bu}function Fu(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Nt.POLYGON]=[new Pu({fill:new mr({color:[255,255,255,.5]})})],t[Nt.MULTI_POLYGON]=t[Nt.POLYGON],t[Nt.LINE_STRING]=[new Pu({stroke:new Er({color:e,width:5})}),new Pu({stroke:new Er({color:i,width:3})})],t[Nt.MULTI_LINE_STRING]=t[Nt.LINE_STRING],t[Nt.CIRCLE]=t[Nt.POLYGON].concat(t[Nt.LINE_STRING]),t[Nt.POINT]=[new Pu({image:new Ru({radius:6,fill:new mr({color:i}),stroke:new Er({color:e,width:1.5})}),zIndex:1/0})],t[Nt.MULTI_POINT]=t[Nt.POINT],t[Nt.GEOMETRY_COLLECTION]=t[Nt.POLYGON].concat(t[Nt.LINE_STRING],t[Nt.POINT]),t}function Au(t){return t.getGeometry()}var Nu=Pu;function Gu(t,e){var i=/\{z\}/g,r=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(s,a,h){return s?t.replace(i,s[0].toString()).replace(r,s[1].toString()).replace(n,function(){return(-s[2]-1).toString()}).replace(o,function(){var t=s[0],i=e.getFullTileRange(t);return Y(i,55),(i.getHeight()+s[2]).toString()}):void 0}}function Du(t,e){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=Gu(t[n],e);return ku(r)}function ku(t){return 1===t.length?t[0]:function(e,i,r){if(e){var n=Xt(Cl(e),t.length);return t[n](e,i,r)}}}function ju(t,e,i){}function Uu(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var r,n=i[1].charCodeAt(0),o=i[2].charCodeAt(0);for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=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}function Yu(t,e,i,r){var n=document.createElement("script"),s="olc_"+o(e);function a(){delete window[s],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var h=setTimeout(function(){a(),i&&i()},1e4);window[s]=function(t){clearTimeout(h),a(),e(t)},document.getElementsByTagName("head")[0].appendChild(n)}function Bu(t,e,i,r){var n=Pe(i,e,t),o=Se(e,r,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var h=t.getExtent();if(!h||nt(h,n)){var l=Se(t,o,n)/o;isFinite(l)&&l>0&&(o/=l)}return o}function Vu(t,e,i,r){var n=i-t,o=r-e,s=Math.sqrt(n*n+o*o);return[Math.round(i+n/s),Math.round(r+o/s)]}function Xu(t,e,i,r,n,o,s,a,h,l,u){var p=Jn(Math.round(i*t),Math.round(i*e));if(0===h.length)return p.canvas;p.scale(i,i);var c=[1/0,1/0,-1/0,-1/0];h.forEach(function(t,e,i){ft(c,t.extent)});var d=Ot(c),f=Rt(c),_=Jn(Math.round(i*d/r),Math.round(i*f/r)),g=i/r;h.forEach(function(t,e,i){var r=t.extent[0]-c[0],n=-(t.extent[3]-c[3]),o=Ot(t.extent),s=Rt(t.extent);_.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,r*g,n*g,o*g,s*g)});var y=It(s);return a.getTriangles().forEach(function(t,e,n){var s=t.source,a=t.target,h=s[0][0],l=s[0][1],u=s[1][0],d=s[1][1],f=s[2][0],g=s[2][1],v=(a[0][0]-y[0])/o,m=-(a[0][1]-y[1])/o,x=(a[1][0]-y[0])/o,E=-(a[1][1]-y[1])/o,S=(a[2][0]-y[0])/o,T=-(a[2][1]-y[1])/o,C=h,R=l;h=0,l=0;var w=function(t){for(var e=t.length,i=0;i<e;i++){for(var r=i,n=Math.abs(t[i][i]),o=i+1;o<e;o++){var s=Math.abs(t[o][i]);s>n&&(n=s,r=o)}if(0===n)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var h=i+1;h<e;h++)for(var l=-t[h][i]/t[i][i],u=i;u<e+1;u++)i==u?t[h][u]=0:t[h][u]+=l*t[i][u]}for(var p=new Array(e),c=e-1;c>=0;c--){p[c]=t[c][e]/t[c][c];for(var d=c-1;d>=0;d--)t[d][e]-=t[d][c]*p[c]}return p}([[u-=C,d-=R,0,0,x-v],[f-=C,g-=R,0,0,S-v],[0,0,u,d,E-m],[0,0,f,g,T-m]]);if(w){p.save(),p.beginPath();var I=(v+x+S)/3,L=(m+E+T)/3,O=Vu(I,L,v,m),P=Vu(I,L,x,E),b=Vu(I,L,S,T);p.moveTo(P[0],P[1]),p.lineTo(O[0],O[1]),p.lineTo(b[0],b[1]),p.clip(),p.transform(w[0],w[2],w[1],w[3],v,m),p.translate(c[0]-C,c[3]-R),p.scale(r/i,-r/i),p.drawImage(_.canvas,0,0),p.restore()}}),u&&(p.save(),p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach(function(t,e,i){var r=t.target,n=(r[0][0]-y[0])/o,s=-(r[0][1]-y[1])/o,a=(r[1][0]-y[0])/o,h=-(r[1][1]-y[1])/o,l=(r[2][0]-y[0])/o,u=-(r[2][1]-y[1])/o;p.beginPath(),p.moveTo(a,h),p.lineTo(n,s),p.lineTo(l,u),p.closePath(),p.stroke()}),p.restore()),p.canvas}var zu=function(t,e,i,r,n){this.sourceProj_=t,this.targetProj_=e;var o={},s=Oe(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=s(t)),o[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Ot(r)==Ot(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Ot(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Ot(this.targetProj_.getExtent()):null;var a=It(i),h=Lt(i),l=St(i),u=Et(i),p=this.transformInv_(a),c=this.transformInv_(h),d=this.transformInv_(l),f=this.transformInv_(u);if(this.addQuad_(a,h,l,u,p,c,d,f,10),this.wrapsXInSource_){var _=1/0;this.triangles_.forEach(function(t,e,i){_=Math.min(_,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])-_>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]-_>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-_>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-_>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))}o={}};zu.prototype.addTriangle_=function(t,e,i,r,n,o){this.triangles_.push({source:[r,n,o],target:[t,e,i]})},zu.prototype.addQuad_=function(t,e,i,r,n,o,s,a,h){var l=tt([n,o,s,a]),u=this.sourceWorldWidth_?Ot(l)/this.sourceWorldWidth_:null,p=this.sourceWorldWidth_,c=this.sourceProj_.canWrapX()&&u>.5&&u<1,d=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=Ot(tt([t,e,i,r]))/this.targetWorldWidth_>.25||d;!c&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)}if(d||!this.maxSourceExtent_||Pt(l,this.maxSourceExtent_)){if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(h>0))return;d=!0}if(h>0){if(!d){var f,_=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(_);if(c)f=(Xt(n[0],p)+Xt(s[0],p))/2-Xt(g[0],p);else f=(n[0]+s[0])/2-g[0];var y=(n[1]+s[1])/2-g[1];d=f*f+y*y>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var v=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(v),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],E=this.transformInv_(x);this.addQuad_(t,e,v,x,n,o,m,E,h-1),this.addQuad_(x,v,i,r,E,m,s,a,h-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(S),C=[(i[0]+r[0])/2,(i[1]+r[1])/2],R=this.transformInv_(C);this.addQuad_(t,S,C,r,n,T,R,a,h-1),this.addQuad_(S,e,i,C,T,o,s,R,h-1)}return}}if(c){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,r,n,s,a),this.addTriangle_(t,e,i,n,o,s)}},zu.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,i,r){var n=e.source;_t(t,n[0]),_t(t,n[1]),_t(t,n[2])}),t},zu.prototype.getTriangles=function(){return this.triangles_};var Wu=zu,Ku=function(t){function e(e,i,r,n,o,s,a,h,l,u,p){t.call(this,o,On.IDLE),this.renderEdges_=void 0!==p&&p,this.pixelRatio_=a,this.gutter_=h,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=n,this.wrappedTileCoord_=s||o,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var c=n.getTileCoordExtent(this.wrappedTileCoord_),d=this.targetTileGrid_.getExtent(),f=this.sourceTileGrid_.getExtent(),_=d?wt(c,d):c;if(0!==xt(_)){var g=e.getExtent();g&&(f=f?wt(f,g):g);var y=n.getResolution(this.wrappedTileCoord_[0]),v=Bu(e,r,Tt(_),y);if(!isFinite(v)||v<=0)this.state=On.EMPTY;else{var m=void 0!==u?u:vs;if(this.triangulation_=new Wu(e,r,_,f,v*m),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(v);var x=this.triangulation_.calculateSourceExtent();if(f&&(e.canWrapX()?(x[1]=kt(x[1],f[1],f[3]),x[3]=kt(x[3],f[1],f[3])):x=wt(x,f)),xt(x)){for(var E=i.getTileRangeForExtentAndZ(x,this.sourceZ_),S=E.minX;S<=E.maxX;S++)for(var T=E.minY;T<=E.maxY;T++){var C=l(this.sourceZ_,S,T,a);C&&this.sourceTiles_.push(C)}0===this.sourceTiles_.length&&(this.state=On.EMPTY)}else this.state=On.EMPTY}else this.state=On.EMPTY}}else this.state=On.EMPTY}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==On.LOADING&&this.unlistenSources_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,r){e&&e.getState()==On.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=On.ERROR;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r="number"==typeof i?i:i[0],n="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_=Xu(r,n,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=On.LOADED}this.changed()},e.prototype.load=function(){if(this.state==On.IDLE){this.state=On.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,r){var n=e.getState();if(n==On.IDLE||n==On.LOADING){t++;var o=v(e,M.CHANGE,function(i){var r=e.getState();r!=On.LOADED&&r!=On.ERROR&&r!=On.EMPTY||(E(o),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,i){t.getState()==On.IDLE&&t.load()}),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(E),this.sourcesListenerKeys_=null},e}(vl),Hu="tileloadstart",Zu="tileloadend",qu="tileloaderror",Ju=function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):ju,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,r=o(i),n=i.getState();n==On.LOADING?(this.tileLoadingKeys_[r]=!0,e=Hu):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=n==On.ERROR?qu:n==On.LOADED||n==On.ABORT?Zu:void 0),void 0!=e&&this.dispatchEvent(new kl(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=this.urls=Uu(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Du(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,i){var r=Sl(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(jl);function Qu(t,e){t.getImage().src=e}var $u=function(t){function e(e){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:Qu,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this.tileClass=void 0!==e.tileClass?e.tileClass:xl,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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 r in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[r];n.expireCache(n==i?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Ie(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Ie(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Ie(e,t)){var i=o(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=bl(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Ie(e,t))return this.tileCache;var i=o(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Rl(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,r,n,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=a?this.tileUrlFunction(a,r,n):void 0,l=new this.tileClass(s,void 0!==h?On.IDLE:On.EMPTY,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,v(l,M.CHANGE,this.handleTileChange,this),l},e.prototype.getTile=function(t,e,i,r,n){var o=this.getProjection();if(o&&n&&!Ie(o,n)){var s,a=this.getTileCacheForProjection(n),h=[t,e,i],l=Tl(h);a.containsKey(l)&&(s=a.get(l));var u=this.getKey();if(s&&s.key==u)return s;var p=this.getTileGridForProjection(o),c=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(h,n),f=new Ku(o,p,n,c,h,d,this.getTilePixelRatio(r),this.getGutter(),function(t,e,i,r){return this.getTileInternal(t,e,i,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return f.key=u,s?(f.interimTile=s,f.refreshInterimChain(),a.replace(l,f)):a.set(l,f),f}return this.getTileInternal(t,e,i,r,o||n)},e.prototype.getTileInternal=function(t,e,i,r,n){var o=null,s=Sl(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var h=o;o=this.createTile_(t,e,i,r,n,a),h.getState()==On.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,r,n,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=Ee(t);if(i){var r=o(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(Ju),tp=function(t){function e(e){var i=void 0!==e.hidpi&&e.hidpi;t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:Ee("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:ro.LOADING,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:i?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.hidpi_=i,this.culture_=void 0!==e.culture?e.culture:"en-us",this.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,this.apiKey_=e.key,this.imagerySet_=e.imagerySet,Yu("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_,this.handleImageryMetadataResponse.bind(this),void 0,"jsonp")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],i=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,r=Gl(this.getProjection()),n=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/n:[e.imageWidth/n,e.imageHeight/n],s=Fl({extent:r,minZoom:e.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=s;var a=this.culture_,h=this.hidpi_;if(this.tileUrlFunction=ku(e.imageUrlSubdomains.map(function(t){var i=[0,0,0],r=e.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,e,n){if(t){El(t[0],t[1],-t[2]-1,i);var o=r;return h&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,i,r=t[0],n=new Array(r),o=1<<r-1;for(e=0;e<r;++e)i=48,t[1]&o&&(i+=1),t[2]&o&&(i+=2),n[e]=String.fromCharCode(i),o>>=1;return n.join("")}(i))}}})),e.imageryProviders){var l=Le(Ee("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,n=this.getTileGrid().getTileCoordForCoordAndResolution(r.center,r.resolution)[0];return e.imageryProviders.map(function(e){for(var r=!1,o=e.coverageAreas,s=0,a=o.length;s<a;++s){var h=o[s];if(n>=h.zoomMin&&n<=h.zoomMax){var u=h.bbox;if(Pt(Ft([u[1],u[0],u[3],u[2]],l),t.extent)){r=!0;break}}}r&&i.push(e.attribution)}),i.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'),i}.bind(this))}this.setState(ro.READY)}else this.setState(ro.ERROR)},e}($u),ep=function(t){function e(e){var i=e||{},r=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Fl({extent:Gl(r),maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,opaque:i.opaque,projection:r,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,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})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($u),ip=function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:void 0!==e.maxZoom?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,wrapX:e.wrapX}),this.account_=e.account,this.mapId_=e.map||"",this.config_=e.config||{},this.templateCache_={},this.initializeMap_()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getConfig=function(){return this.config_},e.prototype.updateConfig=function(t){u(this.config_,t),this.initializeMap_()},e.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},e.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var i=new XMLHttpRequest;i.addEventListener("load",this.handleInitResponse_.bind(this,t)),i.addEventListener("error",this.handleInitError_.bind(this)),i.open("POST",e),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.config_))}},e.prototype.handleInitResponse_=function(t,e){var i=e.target;if(!i.status||i.status>=200&&i.status<300){var r;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState(ro.ERROR)}this.applyTemplate_(r),this.templateCache_[t]=r,this.setState(ro.READY)}else this.setState(ro.ERROR)},e.prototype.handleInitError_=function(t){this.setState(ro.ERROR)},e.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},e}(ep),rp={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"},np=function(t){function e(e,i){t.call(this,e),this.feature=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),op=function(t){function e(e){var i=e||{};t.call(this,{attributions:i.attributions,projection:void 0,state:ro.READY,wrapX:void 0===i.wrapX||i.wrapX}),this.loader_=I,this.format_=i.format,this.overlaps_=void 0==i.overlaps||i.overlaps,this.url_=i.url,void 0!==i.loader?this.loader_=i.loader:void 0!==this.url_&&(Y(this.format_,7),this.loader_=ql(this.url_,this.format_)),this.strategy_=void 0!==i.strategy?i.strategy:Jl;var r,n,o=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=o?new tl:null,this.loadedExtentsRtree_=new tl,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(i.features)?n=i.features:i.features&&(n=(r=i.features).getArray()),o||void 0!==r||(r=new U(n)),void 0!==n&&this.addFeaturesInternal(n),void 0!==r&&this.bindFeaturesCollection_(r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=o(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new np(rp.ADDFEATURE,t))}},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[v(e,M.CHANGE,this.handleFeatureChange_,this),v(e,l,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,r=e.getId();return void 0!==r?r.toString()in this.idIndex_?i=!1:this.idIndex_[r.toString()]=e:(Y(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],r=[],n=0,s=t.length;n<s;n++){var a=t[n],h=o(a);this.addToIndex_(h,a)&&i.push(a)}for(var l=0,u=i.length;l<u;l++){var p=i[l],c=o(p);this.setupChangeEvents_(c,p);var d=p.getGeometry();if(d){var f=d.getExtent();e.push(f),r.push(p)}else this.nullGeometryFeatures_[c]=p}this.featuresRtree_&&this.featuresRtree_.load(e,r);for(var _=0,g=i.length;_<g;_++)this.dispatchEvent(new np(rp.ADDFEATURE,i[_]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;v(this,rp.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),v(this,rp.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),v(t,h.ADD,function(t){e||(e=!0,this.addFeature(t.element),e=!1)},this),v(t,h.REMOVE,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)},this),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(E)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var r=new np(rp.CLEAR);this.dispatchEvent(r),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 r=e(i);if(r)return r}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),d(this.nullGeometryFeatures_)||K(t,c(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_.getInExtent(t)},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],r=t[1],n=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],h=e||R;return this.featuresRtree_.forEachInExtent(a,function(t){if(h(t)){var e=t.getGeometry(),l=s;if((s=e.closestPointXY(i,r,o,s))<l){n=t;var u=Math.sqrt(s);a[0]=i-u,a[1]=r-u,a[2]=i+u,a[3]=r+u}}}),n},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.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=o(e),r=e.getGeometry();if(r){var n=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var s=e.getId();if(void 0!==s){var a=s.toString();i in this.undefIdIndex_?(delete this.undefIdIndex_[i],this.idIndex_[a]=e):this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else i in this.undefIdIndex_||(this.removeFromIdIndex_(e),this.undefIdIndex_[i]=e);this.changed(),this.dispatchEvent(new np(rp.CHANGEFEATURE,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:o(t)in this.undefIdIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&d(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){var r=this,n=this.loadedExtentsRtree_,o=this.strategy_(t,e);this.loading=!1;for(var s=function(t,s){var a=o[t];n.forEachInExtent(a,function(t){return ot(t.extent,a)})||(r.loader_.call(r,a,e,i),n.insert(a,{extent:a.slice()}),r.loading=r.loader_!==I)},a=0,h=o.length;a<h;++a)s(a)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,function(i){if(dt(i.extent,t))return e=i,!0}),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=o(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=o(t);this.featureChangeKeys_[e].forEach(E),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i?delete this.idIndex_[i.toString()]:delete this.undefIdIndex_[e],this.dispatchEvent(new np(rp.REMOVEFEATURE,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}(Il),sp=function(t){function e(e){t.call(this,{attributions:e.attributions,wrapX:e.wrapX}),this.resolution=void 0,this.distance=void 0!==e.distance?e.distance:20,this.features=[],this.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return Y(e.getType()==Nt.POINT,10),e},this.source=e.source,v(this.source,M.CHANGE,this.refresh,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,i){this.source.loadFeatures(t,e,i),e!==this.resolution&&(this.clear(),this.resolution=e,this.cluster(),this.addFeatures(this.features))},e.prototype.setDistance=function(t){this.distance=t,this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features),t.prototype.refresh.call(this)},e.prototype.cluster=function(){if(void 0!==this.resolution){this.features.length=0;for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,i=this.source.getFeatures(),r={},n=0,s=i.length;n<s;n++){var a=i[n];if(!(o(a)in r)){var h=this.geometryFunction(a);if(h){pt(h.getCoordinates(),t),et(t,e,t);var l=this.source.getFeaturesInExtent(t);l=l.filter(function(t){var e=o(t);return!(e in r)&&(r[e]=!0,!0)}),this.features.push(this.createCluster(l))}}}}},e.prototype.createCluster=function(t){for(var e=[0,0],i=t.length-1;i>=0;--i){var r=this.geometryFunction(t[i]);r?Hi(e,r.getCoordinates()):t.splice(i,1)}tr(e,1/t.length);var n=new B(new ci(e));return n.set("features",t),n},e}(op),ap=function(t){function e(e,i,r,n,o,s){var a=e.getExtent(),h=i.getExtent(),l=h?wt(r,h):r,u=Bu(e,i,Tt(l),n),p=new Wu(e,i,l,a,u*vs),c=s(p.calculateSourceExtent(),u,o),d=xs.LOADED;c&&(d=xs.IDLE);var f=c?c.getPixelRatio():1;t.call(this,r,n,f,d),this.targetProj_=i,this.maxSourceExtent_=a,this.triangulation_=p,this.targetResolution_=n,this.targetExtent_=r,this.sourceImage_=c,this.sourcePixelRatio_=f,this.canvas_=null,this.sourceListenerKey_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==xs.LOADING&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==xs.LOADED){var e=Ot(this.targetExtent_)/this.targetResolution_,i=Rt(this.targetExtent_)/this.targetResolution_;this.canvas_=Xu(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==xs.IDLE){this.state=xs.LOADING,this.changed();var t=this.sourceImage_.getState();t==xs.LOADED||t==xs.ERROR?this.reproject_():(this.sourceListenerKey_=v(this.sourceImage_,M.CHANGE,function(t){var e=this.sourceImage_.getState();e!=xs.LOADED&&e!=xs.ERROR||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){E(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(ms),hp="imageloadstart",lp="imageloadend",up="imageloaderror",pp=function(t){function e(e,i){t.call(this,e),this.image=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);function cp(t,e){t.getImage().src=e}var dp=function(t){function e(e){t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state}),this.resolutions_=void 0!==e.resolutions?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=z(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,i,r){var n=this.getProjection();if(n&&r&&!Ie(n,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Ie(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&dt(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new ap(n,r,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,n)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return n&&(r=n),this.getImageInternal(t,e,i,r)},e.prototype.getImageInternal=function(t,e,i,n){return r()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case xs.LOADING:this.loading=!0,this.dispatchEvent(new pp(hp,e));break;case xs.LOADED:this.loading=!1,this.dispatchEvent(new pp(lp,e));break;case xs.ERROR:this.loading=!1,this.dispatchEvent(new pp(up,e))}},e}(Il),fp=function(t){function e(e,i,r,n,o,s){t.call(this,e,i,r,xs.IDLE),this.src_=n,this.image_=new Image,null!==o&&(this.image_.crossOrigin=o),this.imageListenerKeys_=null,this.state=xs.IDLE,this.imageLoadFunction_=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=xs.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Rt(this.extent)/this.image_.height),this.state=xs.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=xs.IDLE&&this.state!=xs.ERROR||(this.state=xs.LOADING,this.changed(),this.imageListenerKeys_=[m(this.image_,M.ERROR,this.handleImageError_,this),m(this.image_,M.LOAD,this.handleImageLoad_,this)],this.imageLoadFunction_(this,this.src_))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(E),this.imageListenerKeys_=null},e}(ms);function _p(t,e){var i=[];Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))});var r=i.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var gp=function(t){function e(e){var i=e||{};t.call(this,{attributions:i.attributions,projection:i.projection,resolutions:i.resolutions}),this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null,this.hidpi_=void 0===i.hidpi||i.hidpi,this.url_=i.url,this.imageLoadFunction_=void 0!==i.imageLoadFunction?i.imageLoadFunction:cp,this.params_=i.params||{},this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==i.ratio?i.ratio:1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,i,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),i=this.hidpi_?i:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&ot(n.getExtent(),t))return n;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};u(o,this.params_);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.ratio_){var h=this.ratio_*Ot(t)/2,l=this.ratio_*Rt(t)/2;t[0]=s-h,t[1]=a-l,t[2]=s+h,t[3]=a+l}var p=e/i,c=Math.ceil(Ot(t)/p),d=Math.ceil(Rt(t)/p);t[0]=s-p*c/2,t[2]=s+p*c/2,t[1]=a-p*d/2,t[3]=a+p*d/2,this.imageSize_[0]=c,this.imageSize_[1]=d;var f=this.getRequestUrl_(t,this.imageSize_,i,r,o);return this.image_=new fp(t,e,i,f,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),v(this.image_,M.CHANGE,this.handleImageChange,this),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,i,r,n){var o=r.getCode().split(":").pop();n.SIZE=e[0]+","+e[1],n.BBOX=t.join(","),n.BBOXSR=o,n.IMAGESR=o,n.DPI=Math.round(90*i);var s=this.url_,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&Y(!1,50),_p(a,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){u(this.params_,t),this.image_=null,this.changed()},e}(dp),yp=function(t){function e(e){var i=e||{};t.call(this,{attributions:i.attributions,projection:i.projection,resolutions:i.resolutions,state:i.state}),this.canvasFunction_=i.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=void 0!==i.ratio?i.ratio:1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImageInternal=function(t,e,i,r){e=this.findNearestResolution(e);var n=this.canvas_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&ot(n.getExtent(),t))return n;Mt(t=t.slice(),this.ratio_);var o=[Ot(t)/e*i,Rt(t)/e*i],s=this.canvasFunction_.call(this,t,e,i,o,r);return s&&(n=new Es(t,e,i,s)),this.canvas_=n,this.renderedRevision_=this.getRevision(),n},e}(dp);var vp=function(t){function e(e){t.call(this,{projection:e.projection,resolutions:e.resolutions}),this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,this.displayDpi_=void 0!==e.displayDpi?e.displayDpi:96,this.params_=e.params||{},this.url_=e.url,this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:cp,this.hidpi_=void 0===e.hidpi||e.hidpi,this.metersPerUnit_=void 0!==e.metersPerUnit?e.metersPerUnit:1,this.ratio_=void 0!==e.ratio?e.ratio:1,this.useOverlay_=void 0!==e.useOverlay&&e.useOverlay,this.image_=null,this.renderedRevision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,i,r){e=this.findNearestResolution(e),i=this.hidpi_?i:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&ot(n.getExtent(),t))return n;1!=this.ratio_&&Mt(t=t.slice(),this.ratio_);var o=[Ot(t)/e*i,Rt(t)/e*i];if(void 0!==this.url_){var s=this.getUrl(this.url_,this.params_,t,o,r);v(n=new fp(t,e,i,s,this.crossOrigin_,this.imageLoadFunction_),M.CHANGE,this.handleImageChange,this)}else n=null;return this.image_=n,this.renderedRevision_=this.getRevision(),n},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.updateParams=function(t){u(this.params_,t),this.changed()},e.prototype.getUrl=function(t,e,i,r,n){var o=function(t,e,i,r){var n=Ot(t),o=Rt(t),s=e[0],a=e[1],h=.0254/r;return a*n>s*o?n*i/(s*h):o*i/(a*h)}(i,r,this.metersPerUnit_,this.displayDpi_),s=Tt(i),a={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return u(a,e),_p(t,a)},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e}(dp),mp=function(t){function e(e){var i=void 0!==e.crossOrigin?e.crossOrigin:null,r=void 0!==e.imageLoadFunction?e.imageLoadFunction:cp;t.call(this,{attributions:e.attributions,projection:Ee(e.projection)}),this.url_=e.url,this.imageExtent_=e.imageExtent,this.image_=new fp(this.imageExtent_,void 0,1,this.url_,i,r),this.imageSize_=e.imageSize?e.imageSize:null,v(this.image_,M.CHANGE,this.handleImageChange,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,i,r){return Pt(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==xs.LOADED){var i,r,n=this.image_.getExtent(),o=this.image_.getImage();this.imageSize_?(i=this.imageSize_[0],r=this.imageSize_[1]):(i=o.width,r=o.height);var s=Rt(n)/r,a=Math.ceil(Ot(n)/s);if(a!=i){var h=Jn(a,r),l=h.canvas;h.drawImage(o,0,0,i,r,0,0,l.width,l.height),this.image_.setImage(l)}}t.prototype.handleImageChange.call(this,e)},e}(dp),xp="1.3.0",Ep="carmentaserver",Sp="geoserver",Tp="mapserver",Cp="qgis",Rp=[101,101],wp=function(t){function e(e){var i=e||{};t.call(this,{attributions:i.attributions,projection:i.projection,resolutions:i.resolutions}),this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null,this.url_=i.url,this.imageLoadFunction_=void 0!==i.imageLoadFunction?i.imageLoadFunction:cp,this.params_=i.params||{},this.v13_=!0,this.updateV13_(),this.serverType_=i.serverType,this.hidpi_=void 0===i.hidpi||i.hidpi,this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==i.ratio?i.ratio:1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getGetFeatureInfoUrl=function(t,e,i,r){if(void 0!==this.url_){var n=Ee(i),o=this.getProjection();o&&o!==n&&(e=Bu(o,n,t,e),t=Pe(t,n,o));var s=Ct(t,e,0,Rp),a={SERVICE:"WMS",VERSION:xp,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};u(a,this.params_,r);var h=Math.floor((t[0]-s[0])/e),l=Math.floor((s[3]-t[1])/e);return a[this.v13_?"I":"X"]=h,a[this.v13_?"J":"Y"]=l,this.getRequestUrl_(s,Rp,1,o||n,a)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,i,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==i||this.hidpi_&&void 0!==this.serverType_||(i=1);var n=e/i,o=Tt(t),s=Ct(o,n,0,[Math.ceil(Ot(t)/n),Math.ceil(Rt(t)/n)]),a=Ct(o,n,0,[Math.ceil(this.ratio_*Ot(t)/n),Math.ceil(this.ratio_*Rt(t)/n)]),h=this.image_;if(h&&this.renderedRevision_==this.getRevision()&&h.getResolution()==e&&h.getPixelRatio()==i&&ot(h.getExtent(),s))return h;var l={SERVICE:"WMS",VERSION:xp,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};u(l,this.params_),this.imageSize_[0]=Math.round(Ot(a)/n),this.imageSize_[1]=Math.round(Rt(a)/n);var p=this.getRequestUrl_(a,this.imageSize_,i,r,l);return this.image_=new fp(a,e,i,p,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),v(this.image_,M.CHANGE,this.handleImageChange,this),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,i,r,n){if(Y(void 0!==this.url_,9),n[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(n.STYLES=""),1!=i)switch(this.serverType_){case Sp:var o=90*i+.5|0;"FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+=";dpi:"+o:n.FORMAT_OPTIONS="dpi:"+o;break;case Tp:n.MAP_RESOLUTION=90*i;break;case Ep:case Cp:n.DPI=90*i;break;default:Y(!1,8)}n.WIDTH=e[0],n.HEIGHT=e[1];var s,a=r.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,n.BBOX=s.join(","),_p(this.url_,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){u(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||xp;this.v13_=Ki(t,"1.3")>=0},e}(dp),Ip='&#169; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',Lp=function(t){function e(e){var i,r=e||{};i=void 0!==r.attributions?r.attributions:[Ip];var n=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",o=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";t.call(this,{attributions:i,cacheSize:r.cacheSize,crossOrigin:n,opaque:void 0===r.opaque||r.opaque,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,url:o,wrapX:r.wrapX,attributionsCollapsible:!1})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ep),Op=i(2),Pp=function(t){function e(e){var i=e||{};t.call(this,i),this.type=Ss.IMAGE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(xo);Pp.prototype.getSource;var bp=Pp,Mp="preload",Fp="useInterimTilesOnError",Ap=function(t){function e(e){var i=e||{},r=u({},i);delete r.preload,delete r.useInterimTilesOnError,t.call(this,r),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=Ss.TILE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPreload=function(){return this.get(Mp)},e.prototype.setPreload=function(t){this.set(Mp,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Fp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Fp,t)},e}(xo);Ap.prototype.getSource;var Np=Ap,Gp="beforeoperations",Dp="afteroperations",kp={PIXEL:"pixel",IMAGE:"image"},jp=function(t){function e(e,i,r){t.call(this,e),this.extent=i.extent,this.resolution=i.viewState.resolution/i.pixelRatio,this.data=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),Up=null;function Yp(t,e,i){if(!t.prepareFrame(e,i))return null;var r=e.size[0],n=e.size[1];if(Up){var o=Up.canvas;o.width!==r||o.height!==n?Up=Jn(r,n):Up.clearRect(0,0,r,n)}else Up=Jn(r,n);return t.composeFrame(e,i,Up),Up.getImageData(0,0,r,n)}function Bp(t){var e=t,i=t,r=t,n=null;return"function"==typeof e.getTile?n=function(t){var e=new Np({source:t});return new ha(e)}(e):"function"==typeof i.getImage?n=function(t){var e=new bp({source:t});return new ra(e)}(i):r.getType()===Ss.TILE?n=new ha(r):r.getType()!=Ss.IMAGE&&r.getType()!=Ss.VECTOR||(n=new ra(r)),n}var Vp=function(t){function e(e){t.call(this,{projection:null}),this.worker_=null,this.operationType_=void 0!==e.operationType?e.operationType:kp.PIXEL,this.threads_=void 0!==e.threads?e.threads:1,this.renderers_=function(t){for(var e=t.length,i=new Array(e),r=0;r<e;++r)i[r]=Bp(t[r]);return i}(e.sources);for(var i=0,r=this.renderers_.length;i<r;++i)v(this.renderers_[i],M.CHANGE,this.changed,this);this.tileQueue_=new Mn(function(){return 1},this.changed.bind(this));for(var n=function(t){return t.map(function(t){return t.getLayer().getLayerState()})}(this.renderers_),s={},a=0,h=n.length;a<h;++a)s[o(n[a].layer)]=n[a];this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],extent:null,focus:null,index:0,layerStates:s,layerStatesArray:n,pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],skippedFeatureUids:{},tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{}},void 0!==e.operation&&this.setOperation(e.operation,e.lib)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setOperation=function(t,e){this.worker_=new Op.Processor({operation:t,imageOps:this.operationType_===kp.IMAGE,queue:1,lib:e,threads:this.threads_}),this.changed()},e.prototype.updateFrameState_=function(t,e,i){var r=u({},this.frameState_);r.viewState=u({},r.viewState);var n=Tt(t);r.extent=t.slice(),r.focus=n,r.size[0]=Math.round(Ot(t)/e),r.size[1]=Math.round(Rt(t)/e),r.time=Date.now(),r.animate=!1;var o=r.viewState;return o.center=n,o.projection=i,o.resolution=e,r},e.prototype.allSourcesReady_=function(){for(var t=!0,e=0,i=this.renderers_.length;e<i;++e)if(this.renderers_[e].getLayer().getSource().getState()!==ro.READY){t=!1;break}return t},e.prototype.getImage=function(t,e,i,r){if(!this.allSourcesReady_())return null;var n=this.updateFrameState_(t,e,r);if(this.requestedFrameState_=n,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),s=this.renderedImageCanvas_.getExtent();e===o&&dt(t,s)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),n.tileQueue.loadMoreTiles(16,16),n.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},e.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.renderers_.length,i=new Array(e),r=0;r<e;++r){var n=Yp(this.renderers_[r],t,t.layerStatesArray[r]);if(!n)return;i[r]=n}var o={};this.dispatchEvent(new jp(Gp,t,o)),this.worker_.process(i,o,this.onWorkerComplete_.bind(this,t))},e.prototype.onWorkerComplete_=function(t,e,i,r){if(!e&&i){var n=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&dt(n,this.requestedFrameState_.extent)){var s;if(this.renderedImageCanvas_)s=this.renderedImageCanvas_.getImage().getContext("2d");else s=Jn(Math.round(Ot(n)/o),Math.round(Rt(n)/o)),this.renderedImageCanvas_=new Es(n,o,1,s.canvas);s.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new jp(Dp,t,r))}}},e.prototype.getImageInternal=function(){return null},e}(dp),Xp=['Map tiles by <a href="https://stamen.com/">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.',Ip],zp={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},Wp={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:1,maxZoom:16}},Kp=function(t){function e(e){var i=e.layer.indexOf("-"),r=-1==i?e.layer:e.layer.slice(0,i),n=Wp[r],o=zp[e.layer],s=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;t.call(this,{attributions:Xp,cacheSize:e.cacheSize,crossOrigin:"anonymous",maxZoom:void 0!=e.maxZoom?e.maxZoom:n.maxZoom,minZoom:void 0!=e.minZoom?e.minZoom:n.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,url:s,wrapX:e.wrapX})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ep);function Hp(t,e,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){var n=r.getTileCoordExtent(t,this.tmpExtent_),o=ho(r.getTileSize(t[0]),this.tmpSize);1!=e&&(o=ao(o,e,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return u(s,this.params_),this.getRequestUrl_(t,o,n,e,i,s)}}var Zp=function(t){function e(e){var i=e||{};t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,tileUrlFunction:Hp,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition}),this.params_=i.params||{},this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.setKey(this.getKeyForParams_())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,i,r,n,o){var s=this.urls;if(s){var a,h=n.getCode().split(":").pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=i.join(","),o.BBOXSR=h,o.IMAGESR=h,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[Xt(Cl(t),s.length)];return _p(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.updateParams=function(t){u(this.params_,t),this.setKey(this.getKeyForParams_())},e}($u),qp=function(t){function e(e,i,r){t.call(this,e,On.LOADED),this.tileSize_=i,this.text_=r,this.canvas_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=Jn(t[0],t[1]);return e.strokeStyle="black",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="black",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.fillText(this.text_,t[0]/2,t[1]/2),this.canvas_=e.canvas,e.canvas},e.prototype.load=function(){},e}(vl),Jp=function(t){function e(e){t.call(this,{opaque:!1,projection:e.projection,tileGrid:e.tileGrid,wrapX:void 0===e.wrapX||e.wrapX})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getTile=function(t,e,i){var r=Sl(t,e,i);if(this.tileCache.containsKey(r))return this.tileCache.get(r);var n=ho(this.tileGrid.getTileSize(t)),o=[t,e,i],s=this.getTileCoordForTileUrlFunction(o),a=s?this.getTileCoordForTileUrlFunction(s).toString():"",h=new qp(o,n,a);return this.tileCache.set(r,h),h},e}(jl),Qp=function(t){function e(e){if(t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:Ee("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:ro.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.tileJSON_=null,e.url)if(e.jsonp)Yu(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{var i=new XMLHttpRequest;i.addEventListener("load",this.onXHRLoad_.bind(this)),i.addEventListener("error",this.onXHRError_.bind(this)),i.open("GET",e.url),i.send()}else e.tileJSON?this.handleTileJSONResponse(e.tileJSON):Y(!1,51)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,i=Ee("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var n=Le(i,r);e=Ft(t.bounds,n)}var o=t.minzoom||0,s=t.maxzoom||22,a=Fl({extent:Gl(r),maxZoom:s,minZoom:o});if(this.tileGrid=a,this.tileUrlFunction=Du(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var h=void 0!==e?e:i.getExtent();this.setAttributions(function(e){return Pt(h,e.extent)?[t.attribution]:null})}this.tileJSON_=t,this.setState(ro.READY)},e.prototype.handleTileJSONError=function(){this.setState(ro.ERROR)},e}($u);function $p(t,e,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var n=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.tmpExtent_),s=ho(r.getTileSize(t[0]),this.tmpSize),a=this.gutter_;0!==a&&(s=so(s,a,this.tmpSize),o=et(o,n*a,o)),1!=e&&(s=ao(s,e,this.tmpSize));var h={SERVICE:"WMS",VERSION:xp,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return u(h,this.params_),this.getRequestUrl_(t,s,o,e,i,h)}}var tc=function(t){function e(e){var i=e||{},r=i.params||{},n=!("TRANSPARENT"in r)||r.TRANSPARENT;t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,opaque:!n,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,tileUrlFunction:$p,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition}),this.gutter_=void 0!==i.gutter?i.gutter:0,this.params_=r,this.v13_=!0,this.serverType_=i.serverType,this.hidpi_=void 0===i.hidpi||i.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.updateV13_(),this.setKey(this.getKeyForParams_())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getGetFeatureInfoUrl=function(t,e,i,r){var n=Ee(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(n));var a=s.getTileCoordForCoordAndResolution(t,e);if(!(s.getResolutions().length<=a[0])){var h=s.getResolution(a[0]),l=s.getTileCoordExtent(a,this.tmpExtent_),p=ho(s.getTileSize(a[0]),this.tmpSize),c=this.gutter_;0!==c&&(p=so(p,c,this.tmpSize),l=et(l,h*c,l)),o&&o!==n&&(h=Bu(o,n,t,h),l=be(l,n,o),t=Pe(t,n,o));var d={SERVICE:"WMS",VERSION:xp,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};u(d,this.params_,r);var f=Math.floor((t[0]-l[0])/h),_=Math.floor((l[3]-t[1])/h);return d[this.v13_?"I":"X"]=f,d[this.v13_?"J":"Y"]=_,this.getRequestUrl_(a,p,l,1,o||n,d)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,i,r,n,o){var s=this.urls;if(s){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=r)switch(this.serverType_){case Sp:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case Tp:o.MAP_RESOLUTION=90*r;break;case Ep:case Cp:o.DPI=90*r;break;default:Y(!1,52)}var h,l,u=n.getAxisOrientation(),p=i;if(this.v13_&&"ne"==u.substr(0,2))h=i[0],p[0]=i[1],p[1]=h,h=i[2],p[2]=i[3],p[3]=h;if(o.BBOX=p.join(","),1==s.length)l=s[0];else l=s[Xt(Cl(t),s.length)];return _p(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},e.prototype.updateParams=function(t){u(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||xp;this.v13_=Ki(t,"1.3")>=0},e}($u),ec=function(t){function e(e,i,r,n,o,s){t.call(this,e,i),this.src_=r,this.extent_=n,this.preemptive_=o,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),i=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-i)*this.grid_.length)];if("string"!=typeof r)return null;var n=r.charCodeAt(Math.floor(e*r.length));n>=93&&n--,n>=35&&n--;var o=null;if((n-=32)in this.keys_){var s=this.keys_[n];o=this.data_&&s in this.data_?this.data_[s]:s}return o},e.prototype.forDataAtCoordinate=function(t,e,i,r){this.state==On.IDLE&&!0===r?(m(this,M.CHANGE,function(r){e.call(i,this.getData(t))},this),this.loadInternal_()):!0===r?setTimeout(function(){e.call(i,this.getData(t))}.bind(this),0):e.call(i,this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=On.ERROR,this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=On.EMPTY,this.changed()},e.prototype.loadInternal_=function(){if(this.state==On.IDLE)if(this.state=On.LOADING,this.jsonp_)Yu(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(i)}else this.handleError_()},e.prototype.onXHRError_=function(t){this.handleError_()},e.prototype.load=function(){this.preemptive_&&this.loadInternal_()},e}(vl),ic=function(t){function e(e){if(t.call(this,{projection:Ee("EPSG:3857"),state:ro.LOADING}),this.preemptive_=void 0===e.preemptive||e.preemptive,this.tileUrlFunction_=ju,this.template_=void 0,this.jsonp_=e.jsonp||!1,e.url)if(this.jsonp_)Yu(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{var i=new XMLHttpRequest;i.addEventListener("load",this.onXHRLoad_.bind(this)),i.addEventListener("error",this.onXHRError_.bind(this)),i.open("GET",e.url),i.send()}else e.tileJSON?this.handleTileJSONResponse(e.tileJSON):Y(!1,51)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,i,r){if(this.tileGrid){var n=this.tileGrid.getTileCoordForCoordAndResolution(t,e);this.getTile(n[0],n[1],n[2],1,this.getProjection()).forDataAtCoordinate(t,i,null,r)}else!0===r?setTimeout(function(){i(null)},0):i(null)},e.prototype.handleTileJSONError=function(){this.setState(ro.ERROR)},e.prototype.handleTileJSONResponse=function(t){var e,i=Ee("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var n=Le(i,r);e=Ft(t.bounds,n)}var o=t.minzoom||0,s=t.maxzoom||22,a=Fl({extent:Gl(r),maxZoom:s,minZoom:o});this.tileGrid=a,this.template_=t.template;var h=t.grids;if(h){if(this.tileUrlFunction_=Du(h,a),void 0!==t.attribution){var l=void 0!==e?e:i.getExtent();this.setAttributions(function(e){return Pt(l,e.extent)?[t.attribution]:null})}this.setState(ro.READY)}else this.setState(ro.ERROR)},e.prototype.getTile=function(t,e,i,r,n){var o=Sl(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=this.tileUrlFunction_(a,r,n),l=new ec(s,void 0!==h?On.IDLE:On.EMPTY,void 0!==h?h:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_);return this.tileCache.set(o,l),l},e.prototype.useTile=function(t,e,i){var r=Sl(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(jl),rc=function(t){function e(i,r,n,o,s,a,h,l,u,p,c,d,f,_,g){if(t.call(this,i,r,{transition:0}),this.context_={},this.loader_,this.replayState_={},this.sourceTiles_=p,this.tileKeys=[],this.extent=null,this.sourceRevision_=n,this.wrappedTileCoord=a,this.loadListenerKeys_=[],this.sourceTileListenerKeys_=[],a){var y=this.extent=u.getTileCoordExtent(a),m=u.getResolution(g),x=l.getZForResolution(m),E=g!=i[0],S=0;if(l.forEachTileCoord(y,x,function(t){var e=wt(y,l.getTileCoordExtent(t)),i=l.getExtent();if(i&&(e=wt(e,i,e)),Ot(e)/m>=.5&&Rt(e)/m>=.5){++S;var r=t.toString(),n=p[r];if(!n&&!E){var a=h(t,c,d);n=p[r]=new f(t,void 0==a?On.EMPTY:On.IDLE,void 0==a?"":a,o,s),this.sourceTileListenerKeys_.push(v(n,M.CHANGE,_))}!n||E&&n.getState()!=On.LOADED||(n.consumers++,this.tileKeys.push(r))}}.bind(this)),E&&S==this.tileKeys.length&&this.finishLoading_(),g<=i[0]&&this.state!=On.LOADED)for(;g>u.getMinZoom();){var T=new e(i,r,n,o,s,a,h,l,u,p,c,d,f,I,--g);if(T.state==On.LOADED){this.interimTile=T;break}}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state=On.ABORT,this.changed(),this.interimTile&&this.interimTile.dispose();for(var e=0,i=this.tileKeys.length;e<i;++e){var r=this.tileKeys[e],n=this.getTile(r);n.consumers--,0==n.consumers&&(delete this.sourceTiles_[r],n.dispose())}this.tileKeys.length=0,this.sourceTiles_=null,this.loadListenerKeys_.forEach(E),this.loadListenerKeys_.length=0,this.sourceTileListenerKeys_.forEach(E),this.sourceTileListenerKeys_.length=0,t.prototype.disposeInternal.call(this)},e.prototype.getContext=function(t){var e=o(t);return e in this.context_||(this.context_[e]=Jn()),this.context_[e]},e.prototype.getImage=function(t){return-1==this.getReplayState(t).renderedTileRevision?null:this.getContext(t).canvas},e.prototype.getReplayState=function(t){var e=o(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedRevision:-1,renderedTileRevision:-1}),this.replayState_[e]},e.prototype.getKey=function(){return this.tileKeys.join("/")+"-"+this.sourceRevision_},e.prototype.getTile=function(t){return this.sourceTiles_[t]},e.prototype.load=function(){var t=0,e={};this.state==On.IDLE&&this.setState(On.LOADING),this.state==On.LOADING&&this.tileKeys.forEach(function(i){var r=this.getTile(i);if(r.state==On.IDLE&&(r.setLoader(this.loader_),r.load()),r.state==On.LOADING){var n=v(r,M.CHANGE,function(i){var n=r.getState();if(n==On.LOADED||n==On.ERROR){var s=o(r);n==On.ERROR?e[s]=!0:(--t,delete e[s]),t-Object.keys(e).length==0&&this.finishLoading_()}}.bind(this));this.loadListenerKeys_.push(n),++t}}.bind(this)),t-Object.keys(e).length==0&&setTimeout(this.finishLoading_.bind(this),0)},e.prototype.finishLoading_=function(){for(var t=this.tileKeys.length,e=0,i=t-1;i>=0;--i){var r=this.getTile(this.tileKeys[i]).getState();r!=On.LOADED&&--t,r==On.EMPTY&&++e}t==this.tileKeys.length?(this.loadListenerKeys_.forEach(E),this.loadListenerKeys_.length=0,this.setState(On.LOADED)):this.setState(e==this.tileKeys.length?On.EMPTY:On.ERROR)},e}(vl);function nc(t,e){var i=Zl(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(i)}var oc=[0,0,4096,4096],sc=function(t){function e(e,i,r,n,o,s){t.call(this,e,i,s),this.consumers=0,this.extent_=null,this.format_=n,this.features_=null,this.loader_,this.projection_=null,this.replayGroups_={},this.tileLoadFunction_=o,this.url_=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.features_=null,this.replayGroups_={},this.state=On.ABORT,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getExtent=function(){return this.extent_||oc},e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.getKey=function(){return this.url_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getReplayGroup=function(t,e){return this.replayGroups_[o(t)+","+e]},e.prototype.load=function(){this.state==On.IDLE&&(this.setState(On.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_(null,NaN,null))},e.prototype.onLoad=function(t,e,i){this.setProjection(e),this.setFeatures(t),this.setExtent(i)},e.prototype.onError=function(){this.setState(On.ERROR)},e.prototype.setExtent=function(t){this.extent_=t},e.prototype.setFeatures=function(t){this.features_=t,this.setState(On.LOADED)},e.prototype.setProjection=function(t){this.projection_=t},e.prototype.setReplayGroup=function(t,e,i){this.replayGroups_[o(t)+","+e]=i},e.prototype.setLoader=function(t){this.loader_=t},e}(vl),ac=function(t){function e(e){var i=e.projection||"EPSG:3857",r=e.extent||Gl(i),n=e.tileGrid||Fl({extent:r,maxZoom:e.maxZoom||22,minZoom:e.minZoom,tileSize:e.tileSize||512});t.call(this,{attributions:e.attributions,cacheSize:void 0!==e.cacheSize?e.cacheSize:128,opaque:!1,projection:i,state:e.state,tileGrid:n,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:nc,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.format_=e.format?e.format:null,this.sourceTiles_={},this.overlaps_=void 0==e.overlaps||e.overlaps,this.tileClass=e.tileClass?e.tileClass:sc,this.tileGrids_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTiles_={}},e.prototype.getTile=function(t,e,i,r,n){var o=Sl(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=new rc(s,null!==a?On.IDLE:On.EMPTY,this.getRevision(),this.format_,this.tileLoadFunction,a,this.tileUrlFunction,this.tileGrid,this.getTileGridForProjection(n),this.sourceTiles_,r,n,this.tileClass,this.handleTileChange.bind(this),s[0]);return this.tileCache.set(o,h),h},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var r=this.tileGrid;i=this.tileGrids_[e]=Nl(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0)}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var r=ho(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(r[0]*e),Math.round(r[1]*e)]},e}(Ju),hc={KVP:"KVP",REST:"REST"},lc=function(t){function e(e){var i=void 0!==e.requestEncoding?e.requestEncoding:hc.KVP,r=e.tileGrid,n=e.urls;void 0===n&&void 0!==e.url&&(n=Uu(e.url)),t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:ju,urls:n,wrapX:void 0!==e.wrapX&&e.wrapX,transition:e.transition}),this.version_=void 0!==e.version?e.version:"1.0.0",this.format_=void 0!==e.format?e.format:"image/jpeg",this.dimensions_=void 0!==e.dimensions?e.dimensions:{},this.layer_=e.layer,this.matrixSet_=e.matrixSet,this.style_=e.style,this.requestEncoding_=i,this.setKey(this.getKeyForDimensions_()),n&&n.length>0&&(this.tileUrlFunction=ku(n.map(uc.bind(this))))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(ku(t.map(uc.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var i in this.dimensions_)e[t++]=i+"-"+this.dimensions_[i];return e.join("/")},e.prototype.updateDimensions=function(t){u(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e}($u);function uc(t){var e=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e==hc.KVP&&u(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e==hc.KVP?_p(t,i):t.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t});var r=this.tileGrid,n=this.dimensions_;return function(i,o,s){if(i){var a={TileMatrix:r.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};u(a,n);var h=t;return h=e==hc.KVP?_p(h,a):h.replace(/\{(\w+?)\}/g,function(t,e){return a[e]})}}}var pc={DEFAULT:"default",TRUNCATED:"truncated"},cc=function(t){function e(e,i,r,n,o,s,a){t.call(this,i,r,n,o,s,a),this.zoomifyImage_=null,this.tileSize_=ho(e.getTileSize(i[0]))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var e=t.prototype.getImage.call(this);if(this.state==On.LOADED){var i=this.tileSize_;if(e.width==i[0]&&e.height==i[1])return this.zoomifyImage_=e,e;var r=Jn(i[0],i[1]);return r.drawImage(e,0,0),this.zoomifyImage_=r.canvas,r.canvas}return e},e}(xl),dc=function(t){function e(e){var i=e||{},r=i.size,n=void 0!==i.tierSizeCalculation?i.tierSizeCalculation:pc.DEFAULT,o=r[0],s=r[1],a=i.extent||[0,-r[1],r[0],0],h=[],l=i.tileSize||An,u=l;switch(n){case pc.DEFAULT:for(;o>u||s>u;)h.push([Math.ceil(o/u),Math.ceil(s/u)]),u+=u;break;case pc.TRUNCATED:for(var p=o,c=s;p>u||c>u;)h.push([Math.ceil(p/u),Math.ceil(c/u)]),p>>=1,c>>=1;break;default:Y(!1,53)}h.push([1,1]),h.reverse();for(var d=[1],f=[0],_=1,g=h.length;_<g;_++)d.push(1<<_),f.push(h[_-1][0]*h[_-1][1]+f[_-1]);d.reverse();var y=new Pl({tileSize:l,extent:a,origin:It(a),resolutions:d}),v=i.url;v&&-1==v.indexOf("{TileGroup}")&&-1==v.indexOf("{tileIndex}")&&(v+="{TileGroup}/{z}-{x}-{y}.jpg");var m=ku(Uu(v).map(function(t){return function(e,i,r){if(e){var n=e[0],o=e[1],s=-e[2]-1,a=o+s*h[n][0],l=y.getTileSize(n),u=Array.isArray(l)?l[0]:l,p={z:n,x:o,y:s,tileIndex:a,TileGroup:"TileGroup"+((a+f[n])/u|0)};return t.replace(/\{(\w+?)\}/g,function(t,e){return p[e]})}}})),x=cc.bind(null,y);t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:x,tileGrid:y,tileUrlFunction:m,transition:i.transition})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($u);var fc="renderOrder",_c=function(t){function e(e){var i=e||{},r=u({},i);delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,t.call(this,r),this.declutter_=void 0!==i.declutter&&i.declutter,this.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(i.style),this.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,this.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,this.renderMode_=i.renderMode||Ts.VECTOR,this.type=Ss.VECTOR}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.setDeclutter=function(t){this.declutter_=t},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(fc)},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.setRenderOrder=function(t){this.set(fc,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Mu,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Y("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e.prototype.getRenderMode=function(){return this.renderMode_},e}(xo);_c.prototype.getSource;var gc=_c,yc={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},vc=["#00f","#0ff","#0f0","#ff0","#f00"];var mc=function(t){function e(e){var i=e||{},r=u({},i);delete r.gradient,delete r.radius,delete r.blur,delete r.shadow,delete r.weight,t.call(this,r),this.gradient_=null,this.shadow_=void 0!==i.shadow?i.shadow:250,this.circleImage_=void 0,this.styleCache_=null,v(this,G(yc.GRADIENT),this.handleGradientChanged_,this),this.setGradient(i.gradient?i.gradient:vc),this.setBlur(void 0!==i.blur?i.blur:15),this.setRadius(void 0!==i.radius?i.radius:8),v(this,G(yc.BLUR),this.handleStyleChanged_,this),v(this,G(yc.RADIUS),this.handleStyleChanged_,this),this.handleStyleChanged_();var n,o=i.weight?i.weight:"weight";n="string"==typeof o?function(t){return t.get(o)}:o,this.setStyle(function(t,e){var i=n(t),r=void 0!==i?kt(i,0,1):1,o=255*r|0,s=this.styleCache_[o];return s||(s=[new Nu({image:new Ou({opacity:r,src:this.circleImage_})})],this.styleCache_[o]=s),s}.bind(this)),this.setRenderOrder(null),v(this,ur.RENDER,this.handleRender_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createCircle_=function(){var t=this.getRadius(),e=this.getBlur(),i=t+e+1,r=2*i,n=Jn(r,r);n.shadowOffsetX=n.shadowOffsetY=this.shadow_,n.shadowBlur=e,n.shadowColor="#000",n.beginPath();var o=i-this.shadow_;return n.arc(o,o,t,0,2*Math.PI,!0),n.fill(),n.canvas.toDataURL()},e.prototype.getBlur=function(){return this.get(yc.BLUR)},e.prototype.getGradient=function(){return this.get(yc.GRADIENT)},e.prototype.getRadius=function(){return this.get(yc.RADIUS)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=Jn(1,256),i=e.createLinearGradient(0,0,1,256),r=1/(t.length-1),n=0,o=t.length;n<o;++n)i.addColorStop(n*r,t[n]);return e.fillStyle=i,e.fillRect(0,0,1,256),e.getImageData(0,0,1,256).data}(this.getGradient())},e.prototype.handleStyleChanged_=function(){this.circleImage_=this.createCircle_(),this.styleCache_=new Array(256),this.changed()},e.prototype.handleRender_=function(t){for(var e=t.context,i=e.canvas,r=e.getImageData(0,0,i.width,i.height),n=r.data,o=0,s=n.length;o<s;o+=4){var a=4*n[o+3];a&&(n[o]=this.gradient_[a],n[o+1]=this.gradient_[a+1],n[o+2]=this.gradient_[a+2])}e.putImageData(r,0,0)},e.prototype.setBlur=function(t){this.set(yc.BLUR,t)},e.prototype.setGradient=function(t){this.set(yc.GRADIENT,t)},e.prototype.setRadius=function(t){this.set(yc.RADIUS,t)},e}(gc),xc=function(t){function e(e){var i=e||{},r=i.renderMode||Va.HYBRID;Y(void 0==r||r==Va.IMAGE||r==Va.HYBRID||r==Va.VECTOR,28),i.declutter&&r==Va.IMAGE&&(r=Va.HYBRID),i.renderMode=r;var n=u({},i);delete n.preload,delete n.useInterimTilesOnError,t.call(this,n),this.setPreload(i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=Ss.VECTOR_TILE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPreload=function(){return this.get(Mp)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Fp)},e.prototype.setPreload=function(t){this.set(Mp,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Fp,t)},e}(gc);xc.prototype.getSource;var Ec=xc,Sc="addfeatures",Tc=function(t){function e(e,i,r,n){t.call(this,e),this.features=r,this.file=i,this.projection=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);function Cc(t){for(var e=t.dataTransfer.files,i=0,r=e.length;i<r;++i){var n=e.item(i),o=new FileReader;o.addEventListener(M.LOAD,this.handleResult_.bind(this,n)),o.readAsText(n)}}function Rc(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}var wc=function(t){function e(e){var i=e||{};t.call(this,{handleEvent:R}),this.formatConstructors_=i.formatConstructors?i.formatConstructors:[],this.projection_=i.projection?Ee(i.projection):null,this.dropListenKeys_=null,this.source_=i.source||null,this.target=i.target?i.target:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleResult_=function(t,e){var i=e.target.result,r=this.getMap(),n=this.projection_;n||(n=r.getView().getProjection());for(var o=this.formatConstructors_,s=[],a=0,h=o.length;a<h;++a){var l=new o[a];if((s=this.tryReadFeatures_(l,i,{featureProjection:n}))&&s.length>0)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(s)),this.dispatchEvent(new Tc(Sc,t,s,n))},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[v(e,M.DROP,Cc,this),v(e,M.DRAGENTER,Rc,this),v(e,M.DRAGOVER,Rc,this),v(e,M.DROP,Rc,this)]}},e.prototype.setActive=function(e){t.prototype.setActive.call(this,e),e?this.registerListeners_():this.unregisterListeners_()},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,i){try{return t.readFeatures(e,i)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(E),this.dropListenKeys_=null)},e}(Fo),Ic=function(t){function e(e){var i=e||{};t.call(this,i),this.condition_=i.condition?i.condition:zo,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=void 0!==i.duration?i.duration:400}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){if(Ko(t)){var e=t.map,i=e.getSize(),r=t.pixel,n=r[0]-i[0]/2,o=i[1]/2-r[1],s=Math.atan2(o,n),a=Math.sqrt(n*n+o*o),h=e.getView();if(h.getConstraints().rotation!==Gn&&void 0!==this.lastAngle_){var l=s-this.lastAngle_;Oo(h,h.getRotation()-l)}if(this.lastAngle_=s,void 0!==this.lastMagnitude_)Mo(h,this.lastMagnitude_*(h.getResolution()/a));void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/a),this.lastMagnitude_=a}},e.prototype.handleUpEvent=function(t){if(!Ko(t))return!0;var e=t.map.getView();e.setHint(jn,-1);var i=this.lastScaleDelta_-1;return Lo(e,e.getRotation()),Po(e,e.getResolution(),void 0,this.duration_,i),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!Ko(t)&&(!!this.condition_(t)&&(t.map.getView().setHint(jn,1),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(qo),Lc=function(t){function e(e,i,r){if(t.call(this),void 0!==r&&void 0===i)this.setFlatCoordinates(r,e);else{var n=i||0;this.setCenterAndRadius(e,n,r)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=t-n[0],s=e-n[1],a=o*o+s*s;if(a<r){if(0===a)for(var h=0;h<this.stride;++h)i[h]=n[h];else{var l=this.getRadius()/Math.sqrt(a);i[0]=n[0]+l*o,i[1]=n[1]+l*s;for(var u=2;u<this.stride;++u)i[u]=n[u]}return i.length=this.stride,a}return r},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,r=t-i[0],n=e-i[1];return r*r+n*n<=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 lt(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 Nt.CIRCLE},e.prototype.intersectsExtent=function(t){if(Pt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||mt(t,this.intersectsCoordinate,this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+i;for(var n=1;n<e;++n)r[e+n]=t[n];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,n=ti(r,0,t,this.stride);r[n++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[n++]=r[o];r.length=n,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}(We);Lc.prototype.transform;var Oc=Lc,Pc=function(t){function e(e,i,r){if(t.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,i);else if(void 0!==i&&r)this.setFlatCoordinates(i,e),this.ends_=r;else{for(var n=this.getLayout(),o=e,s=[],a=[],h=0,l=o.length;h<l;++h){var u=o[h];0===h&&(n=u.getLayout()),K(s,u.getFlatCoordinates()),a.push(s.length)}this.setFlatCoordinates(n,s),this.ends_=a}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendLineString=function(t){this.flatCoordinates?K(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,i,r){return r<rt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Je(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$e(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=At.XYM&&this.layout!=At.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,r,n,o,s){if(s)return sr(t,e,i[i.length-1],r,n,o);var a;if(n<t[r-1])return o?((a=t.slice(0,r))[r-1]=n,a):null;if(t[t.length-1]<n)return o?((a=t.slice(t.length-r))[r-1]=n,a):null;for(var h=0,l=i.length;h<l;++h){var u=i[h];if(e!=u){if(n<t[e+r-1])return null;if(n<=t[u-1])return sr(t,e,u,r,n,!1);e=u}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,n)},e.prototype.getCoordinates=function(){return ni(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new hr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,r=[],n=0,o=0,s=e.length;o<s;++o){var a=e[o],h=new hr(t.slice(n,a),i);r.push(h),n=a}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];K(t,or(e,i,a,n,.5)),i=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=ai(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,r),new e(i,At.XY,r)},e.prototype.getType=function(){return Nt.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){if(mi(t,e,i[o],r,n))return!0;e=i[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=ii(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(We),bc=function(t){function e(e,i){t.call(this),i&&!Array.isArray(e[0])?this.setFlatCoordinates(i,e):this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendPoint=function(t){this.flatCoordinates?K(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,r){if(r<rt(this.getExtent(),t,e))return r;for(var n=this.flatCoordinates,o=this.stride,s=0,a=n.length;s<a;s+=o){var h=Yt(t,e,n[s],n[s+1]);if(h<r){r=h;for(var l=0;l<o;++l)i[l]=n[s+l];i.length=o}}return r},e.prototype.getCoordinates=function(){return ri(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new ci(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,r=[],n=0,o=t.length;n<o;n+=i){var s=new ci(t.slice(n,n+i),e);r.push(s)}return r},e.prototype.getType=function(){return Nt.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,r=0,n=e.length;r<n;r+=i){if(st(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ei(this.flatCoordinates,0,t,this.stride),this.changed()},e}(We);function Mc(t,e,i,r){for(var n=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=i.length;s<a;++s){var h=i[s];o=ct(t,e,h[0],r),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=h[h.length-1]}return n}var Fc=function(t){function e(e,i,r){if(t.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var n=this.getLayout(),o=e,s=[],a=[],h=0,l=o.length;h<l;++h){var u=o[h];0===h&&(n=u.getLayout());for(var p=s.length,c=u.getEnds(),d=0,f=c.length;d<f;++d)c[d]+=p;K(s,u.getFlatCoordinates()),a.push(c)}i=n,e=s,r=a}void 0!==i&&r?(this.setFlatCoordinates(i,e),this.endss_=r):this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;K(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,n=(e=t.getEnds().slice()).length;r<n;++r)e[r]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),r=0;r<t;++r)i[r]=this.endss_[r].slice();return new e(this.flatCoordinates.slice(),this.layout,i)},e.prototype.closestPointXY=function(t,e,i,r){return r<rt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];n=Je(t,e,a,r,n),e=a[a.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,r,n,o,s,a,h,l,u){for(var p=u||[NaN,NaN],c=0,d=i.length;c<d;++c){var f=i[c];l=$e(t,e,f,r,n,o,s,a,h,l,p),e=f[f.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.containsXY=function(t,e){return function(t,e,i,r,n,o){if(0===i.length)return!1;for(var s=0,a=i.length;s<a;++s){var h=i[s];if(_i(t,e,h,r,n,o))return!0;e=h[h.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,r){for(var n=0,o=0,s=i.length;o<s;++o){var a=i[o];n+=He(t,e,a,r),e=a[a.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ri(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,oi(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Mc(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=yi(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new bc(this.getFlatInteriorPoints().slice(),At.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o)if(!Ti(t,e,i[o],r,n))return!1;return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ri(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=function(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h],p=[];s=ui(t,e,u,r,n,o,s,p),a.push(p),e=u[u.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,r),new e(i,At.XY,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var r=this.endss_[t].slice(),n=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Ii(this.flatCoordinates.slice(e,n),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],n=0,o=0,s=i.length;o<s;++o){var a=i[o].slice(),h=a[a.length-1];if(0!==n)for(var l=0,u=a.length;l<u;++l)a[l]-=n;var p=new Ii(e.slice(n,h),t,a);r.push(p),n=h}return r},e.prototype.getType=function(){return Nt.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(xi(t,e,a,r,n))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,r,n){for(var o=n||[],s=0,a=0,h=i.length;a<h;++a){var l=ii(t,e,i[a],r,o[s]);o[s++]=l,e=l[l.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(We),Ac={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},Nc="drawstart",Gc="drawend",Dc=function(t){function e(e,i){t.call(this,e),this.feature=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);var kc=function(t){function e(e){var i=e;i.stopDown||(i.stopDown=w),t.call(this,i),this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=function(t){var e;t===Nt.POINT||t===Nt.MULTI_POINT?e=Ac.POINT:t===Nt.LINE_STRING||t===Nt.MULTI_LINE_STRING?e=Ac.LINE_STRING:t===Nt.POLYGON||t===Nt.MULTI_POLYGON?e=Ac.POLYGON:t===Nt.CIRCLE&&(e=Ac.CIRCLE);return e}(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_===Ac.POLYGON?3:2,this.maxPoints_=e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:R;var r=e.geometryFunction;if(!r)if(this.type_===Nt.CIRCLE)r=function(t,e){var i=e||new Oc([NaN,NaN]),r=er(t[0],t[1]);return i.setCenterAndRadius(t[0],Math.sqrt(r)),i};else{var n,o=this.mode_;o===Ac.POINT?n=ci:o===Ac.LINE_STRING?n=hr:o===Ac.POLYGON&&(n=Ii),r=function(t,e){var i=e;return i?o===Ac.POLYGON?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new n(t),i}}this.geometryFunction_=r,this.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new gc({source:new op({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:function(){var t=Fu();return function(e,i){return t[e.getGeometry().getType()]}}(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Xo,this.freehandCondition_,e.freehand?this.freehandCondition_=jo:this.freehandCondition_=e.freehandCondition?e.freehandCondition:zo,v(this,G(Io.ACTIVE),this.updateState_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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===M.CONTEXTMENU&&e.preventDefault(),this.freehand_=this.mode_!==Ac.POINT&&this.freehandCondition_(e);var i=e.type===Ar.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===Ar.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===Ar.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e),r=!1):this.freehand_&&e.type===Ar.POINTERDOWN?r=!1:i?(r=e.type===Ar.POINTERMOVE)&&this.freehand_?r=this.handlePointerMove_(e):(e.pointerEvent.pointerType==Ur||e.type===Ar.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Ar.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):!!this.condition_(t)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Nr(Ar.POINTERMOVE,t.map,t.pointerEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var i=this.mode_===Ac.CIRCLE;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t):(this.startDrawing_(t),this.mode_===Ac.POINT&&this.finishDrawing()),e=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,r=e[0]-i[0],n=e[1]-i[1],o=r*r+n*n;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,r=[this.finishCoordinate_];if(this.mode_===Ac.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Ac.POLYGON){var n=this.sketchCoords_;i=n[0].length>this.minPoints_,r=[n[0][0],n[0][n[0].length-2]]}if(i)for(var o=t.map,s=0,a=r.length;s<a;s++){var h=r[s],l=o.getPixelFromCoordinate(h),u=t.pixel,p=u[0]-l[0],c=u[1]-l[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(p*p+c*c)<=d){this.finishCoordinate_=h;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new B(new ci(e)),this.updateSketchFeatures_())},e.prototype.startDrawing_=function(t){var e=t.coordinate;this.finishCoordinate_=e,this.mode_===Ac.POINT?this.sketchCoords_=e.slice():this.mode_===Ac.POLYGON?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new B(new hr(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_);this.sketchFeature_=new B,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Dc(Nc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,r,n=t.coordinate,o=this.sketchFeature_.getGeometry();(this.mode_===Ac.POINT?i=this.sketchCoords_:this.mode_===Ac.POLYGON?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(n=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=n[0],i[1]=n[1],this.geometryFunction_(this.sketchCoords_,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(n);if(o.getType()==Nt.POLYGON&&this.mode_!==Ac.POLYGON){this.sketchLine_||(this.sketchLine_=new B);var s=o.getLinearRing(0);(r=this.sketchLine_.getGeometry())?(r.setFlatCoordinates(s.getLayout(),s.getFlatCoordinates()),r.changed()):(r=new hr(s.getFlatCoordinates(),s.getLayout()),this.sketchLine_.setGeometry(r))}else this.sketchLineCoords_&&(r=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,r=t.coordinate,n=this.sketchFeature_.getGeometry();this.mode_===Ac.LINE_STRING?(this.finishCoordinate_=r.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(r.slice()),this.geometryFunction_(i,n)):this.mode_===Ac.POLYGON&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(r.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry();this.mode_===Ac.LINE_STRING?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Ac.POLYGON&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e)),0===t.length&&(this.finishCoordinate_=null),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry();this.mode_===Ac.LINE_STRING?(e.pop(),this.geometryFunction_(e,i)):this.mode_===Ac.POLYGON&&(e[0].pop(),this.geometryFunction_(e,i),e=i.getCoordinates()),this.type_===Nt.MULTI_POINT?t.setGeometry(new bc([e])):this.type_===Nt.MULTI_LINE_STRING?t.setGeometry(new Pc([e])):this.type_===Nt.MULTI_POLYGON&&t.setGeometry(new Fc([e])),this.dispatchEvent(new Dc(Gc,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 t&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),t},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.updateSketchFeatures_(),this.dispatchEvent(new Dc(Nc,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}(qo),jc={EXTENTCHANGED:"extentchanged"},Uc=function(t){function e(e){t.call(this,jc.EXTENTCHANGED),this.extent=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);function Yc(t){return function(e){return tt([t,e])}}function Bc(t,e){return t[0]==e[0]?function(i){return tt([t,[i[0],e[1]]])}:t[1]==e[1]?function(i){return tt([t,[e[0],i[1]]])}:null}var Vc=function(t){function e(e){var i=e||{};t.call(this,i),this.extent_=null,this.pointerHandler_=null,this.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,this.snappedToVertex_=!1,this.extentFeature_=null,this.vertexFeature_=null,e||(e={}),this.extentOverlay_=new gc({source:new op({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:function(){var t=Fu();return function(e,i){return t[Nt.POLYGON]}}(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new gc({source:new op({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:function(){var t=Fu();return function(e,i){return t[Nt.POINT]}}(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&this.setExtent(e.extent)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapToVertex_=function(t,e){var i=e.getCoordinateFromPixel(t),r=this.getExtent();if(r){var n=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(r);n.sort(function(t,e){return rr(i,t)-rr(i,e)});var o=n[0],s=Zi(i,o),a=e.getPixelFromCoordinate(s);if(ir(t,a)<=this.pixelTolerance_){var h=e.getPixelFromCoordinate(o[0]),l=e.getPixelFromCoordinate(o[1]),u=er(a,h),p=er(a,l),c=Math.sqrt(Math.min(u,p));return this.snappedToVertex_=c<=this.pixelTolerance_,this.snappedToVertex_&&(s=u>p?o[1]:o[0]),s}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,i=t.map,r=this.snapToVertex_(e,i);r||(r=i.getCoordinateFromPixel(e)),this.createOrUpdatePointerFeature_(r)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Oi(t)):e.setGeometry(void 0):(e=new B(t?Oi(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new B(new ci(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.pointerEvent||(e.type!=Ar.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,i=t.map,r=this.getExtent(),n=this.snapToVertex_(e,i),o=function(t){var e=null,i=null;return t[0]==r[0]?e=r[2]:t[0]==r[2]&&(e=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==e&&null!==i?[e,i]:null};if(n&&r){var s=n[0]==r[0]||n[0]==r[2]?n[0]:null,a=n[1]==r[1]||n[1]==r[3]?n[1]:null;null!==s&&null!==a?this.pointerHandler_=Yc(o(n)):null!==s?this.pointerHandler_=Bc(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.pointerHandler_=Bc(o([r[0],a]),o([r[2],a])))}else n=i.getCoordinateFromPixel(e),this.setExtent([n[0],n[1],n[0],n[1]]),this.pointerHandler_=Yc(n);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}return!0},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtent();return e&&0!==xt(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new Uc(this.extent_))},e}(qo),Xc=1,zc="modifystart",Wc="modifyend",Kc=function(t){function e(e,i,r){t.call(this,e),this.features=i,this.mapBrowserEvent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);function Hc(t,e){return t.index-e.index}function Zc(t,e){var i=e.geometry;if(i.getType()===Nt.CIRCLE){var r=i;if(e.index===Xc){var n=er(r.getCenter(),t),o=Math.sqrt(n)-r.getRadius();return o*o}}return rr(t,e.segment)}function qc(t,e){var i=e.geometry;return i.getType()===Nt.CIRCLE&&e.index===Xc?i.getClosestPoint(t):Zi(t,e.segment)}var Jc=function(t){function e(e){var i;if(t.call(this,e),this.condition_=e.condition?e.condition:Ho,this.defaultDeleteCondition_=function(t){return Go(t)&&Vo(t)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:jo,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.modified_=!1,this.rBush_=new tl,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new gc({source:new op({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:function(){var t=Fu();return function(e,i){return t[Nt.POINT]}}(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,Circle:this.writeCircleGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_},this.source_=null,e.source?(this.source_=e.source,i=new U(this.source_.getFeatures()),v(this.source_,rp.ADDFEATURE,this.handleSourceAdd_,this),v(this.source_,rp.REMOVEFEATURE,this.handleSourceRemove_,this)):i=e.features,!i)throw new Error("The modify interaction requires features or a source");this.features_=i,this.features_.forEach(this.addFeature_.bind(this)),v(this.features_,h.ADD,this.handleFeatureAdd_,this),v(this.features_,h.REMOVE,this.handleFeatureRemove_,this),this.lastPointerEvent_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature_=function(t){var e=t.getGeometry();e&&e.getType()in this.SEGMENT_WRITERS_&&this.SEGMENT_WRITERS_[e.getType()].call(this,t,e);var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),v(t,M.CHANGE,this.handleFeatureChange_,this)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Kc(zc,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),x(t,M.CHANGE,this.handleFeatureChange_,this)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach(function(e){t===e.feature&&i.push(e)});for(var r=i.length-1;r>=0;--r)e.remove(i[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(),r={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(tt(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:h};this.rBush_.insert(tt(h),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:h};this.rBush_.insert(tt(h),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var h=o[s],l=0,u=h.length-1;l<u;++l){var p=h.slice(l,l+2),c={feature:t,geometry:e,depth:[s,r],index:l,segment:p};this.rBush_.insert(tt(p),c)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:Xc,segment:[i,i]},o=[r,n];r.featureSegments=n.featureSegments=o,this.rBush_.insert(pt(i),r),this.rBush_.insert(e.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r)this.SEGMENT_WRITERS_[i[r].getType()].call(this,t,i[r])},e.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new B(new ci(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.pointerEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Ar.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=Ar.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Ar.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,i=0,r=this.dragSegments_.length;i<r;++i){for(var n=this.dragSegments_[i],o=n[0],s=o.depth,a=o.geometry,h=void 0,l=o.segment,u=n[1];e.length<a.getStride();)e.push(l[u][e.length]);switch(a.getType()){case Nt.POINT:h=e,l[0]=l[1]=e;break;case Nt.MULTI_POINT:(h=a.getCoordinates())[o.index]=e,l[0]=l[1]=e;break;case Nt.LINE_STRING:(h=a.getCoordinates())[o.index+u]=e,l[u]=e;break;case Nt.MULTI_LINE_STRING:case Nt.POLYGON:(h=a.getCoordinates())[s[0]][o.index+u]=e,l[u]=e;break;case Nt.MULTI_POLYGON:(h=a.getCoordinates())[s[1]][s[0]][o.index+u]=e,l[u]=e;break;case Nt.CIRCLE:l[0]=l[1]=e,0===o.index?(this.changingFeature_=!0,a.setCenter(e),this.changingFeature_=!1):(this.changingFeature_=!0,a.setRadius(ir(a.getCenter(),e)),this.changingFeature_=!1)}h&&this.setGeometryCoordinates_(a,h)}this.createOrUpdateVertexFeature_(e)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;this.handlePointerAtPixel_(t.pixel,t.map);var e=t.map.getCoordinateFromPixel(t.pixel);this.dragSegments_.length=0,this.modified_=!1;var i=this.vertexFeature_;if(i){var r=[],n=i.getGeometry().getCoordinates(),s=tt([n]),a=this.rBush_.getInExtent(s),h={};a.sort(Hc);for(var l=0,u=a.length;l<u;++l){var p=a[l],c=p.segment,d=o(p.feature),f=p.depth;if(f&&(d+="-"+f.join("-")),h[d]||(h[d]=new Array(2)),p.geometry.getType()===Nt.CIRCLE&&p.index===Xc)Qi(qc(e,p),n)&&!h[d][0]&&(this.dragSegments_.push([p,0]),h[d][0]=p);else if(Qi(c[0],n)&&!h[d][0])this.dragSegments_.push([p,0]),h[d][0]=p;else if(Qi(c[1],n)&&!h[d][1]){if((p.geometry.getType()===Nt.LINE_STRING||p.geometry.getType()===Nt.MULTI_LINE_STRING)&&h[d][0]&&0===h[d][0].index)continue;this.dragSegments_.push([p,1]),h[d][1]=p}else this.insertVertexCondition_(t)&&o(c)in this.vertexSegments_&&!h[d][0]&&!h[d][1]&&r.push([p,n])}r.length&&this.willModifyFeatures_(t);for(var _=r.length-1;_>=0;--_)this.insertVertex_.apply(this,r[_])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],r=i.geometry;if(r.getType()===Nt.CIRCLE){var n=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=o.segment[1]=n,s.segment[0]=s.segment[1]=n,this.rBush_.update(pt(n),o),this.rBush_.update(r.getExtent(),s)}else this.rBush_.update(tt(i.segment),i)}return this.modified_&&(this.dispatchEvent(new Kc(Wc,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map)},e.prototype.handlePointerAtPixel_=function(t,e){var i=e.getCoordinateFromPixel(t),r=et(pt(i),e.getView().getResolution()*this.pixelTolerance_),n=this.rBush_.getInExtent(r);if(n.length>0){n.sort(function(t,e){return Zc(i,t)-Zc(i,e)});var s=n[0],a=s.segment,h=qc(i,s),l=e.getPixelFromCoordinate(h),u=ir(t,l);if(u<=this.pixelTolerance_){var p={};if(s.geometry.getType()===Nt.CIRCLE&&s.index===Xc)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var c=e.getPixelFromCoordinate(a[0]),d=e.getPixelFromCoordinate(a[1]),f=er(l,c),_=er(l,d);u=Math.sqrt(Math.min(f,_)),this.snappedToVertex_=u<=this.pixelTolerance_,this.snappedToVertex_&&(h=f>_?a[1]:a[0]),this.createOrUpdateVertexFeature_(h);for(var g=1,y=n.length;g<y;++g){var v=n[g].segment;if(!(Qi(a[0],v[0])&&Qi(a[1],v[1])||Qi(a[0],v[1])&&Qi(a[1],v[0])))break;p[o(v)]=!0}}return p[o(a)]=!0,void(this.vertexSegments_=p)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,r=t.segment,n=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case Nt.MULTI_LINE_STRING:case Nt.POLYGON:(i=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case Nt.MULTI_POLYGON:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case Nt.LINE_STRING:(i=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var h=this.rBush_;h.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:n,geometry:o,depth:s,index:a};h.insert(tt(l.segment),l),this.dragSegments_.push([l,1]);var u={segment:[e,r[1]],feature:n,geometry:o,depth:s,index:a+1};h.insert(tt(u.segment),u),this.dragSegments_.push([u,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Ar.POINTERDRAG){var t=this.lastPointerEvent_;return this.willModifyFeatures_(t),this.removeVertex_(),this.dispatchEvent(new Kc(Wc,this.features_,t)),this.modified_=!1,!0}return!1},e.prototype.removeVertex_=function(){var t,e,i,r,n,s,a,h,l,u,p,c=this.dragSegments_,d={},f=!1;for(n=c.length-1;n>=0;--n)p=o((u=(i=c[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in d||(d[p]={}),0===i[1]?(d[p].right=u,d[p].index=u.index):1==i[1]&&(d[p].left=u,d[p].index=u.index+1);for(p in d){switch(l=d[p].right,a=d[p].left,h=(s=d[p].index)-1,u=void 0!==a?a:l,h<0&&(h=0),t=e=(r=u.geometry).getCoordinates(),f=!1,r.getType()){case Nt.MULTI_LINE_STRING:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(s,1),f=!0);break;case Nt.LINE_STRING:e.length>2&&(e.splice(s,1),f=!0);break;case Nt.MULTI_POLYGON:t=t[u.depth[1]];case Nt.POLYGON:(t=t[u.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),f=!0,0===s&&(t.pop(),t.push(t[0]),h=t.length-1))}if(f){this.setGeometryCoordinates_(r,e);var _=[];if(void 0!==a&&(this.rBush_.remove(a),_.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),_.push(l.segment[1])),void 0!==a&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:h,segment:_};this.rBush_.insert(tt(g.segment),g)}this.updateSegmentIndices_(r,s,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,r){this.rBush_.forEachInExtent(t.getExtent(),function(n){n.geometry===t&&(void 0===i||void 0===n.depth||Z(n.depth,i))&&n.index>e&&(n.index+=r)})},e}(qo),Qc={SELECT:"select"},$c=function(t){function e(e,i,r,n){t.call(this,e),this.selected=i,this.deselected=r,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P);function td(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),i=this.removeCondition_(t),r=this.toggleCondition_(t),n=!e&&!i&&!r,o=t.map,s=this.getFeatures(),a=[],h=[];if(n){p(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return h.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=s.getLength()-1;l>=0;--l){var u=s.item(l),c=h.indexOf(u);c>-1?h.splice(c,1):(s.remove(u),a.push(u))}0!==h.length&&s.extend(h)}else{o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.filter_(t,n))return!e&&!r||X(s.getArray(),t)?(i||r)&&X(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(h.push(t),this.addFeatureLayerAssociation_(t,n)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var d=a.length-1;d>=0;--d)s.remove(a[d]);s.extend(h)}return(h.length>0||a.length>0)&&this.dispatchEvent(new $c(Qc.SELECT,h,a,t)),Bo(t)}var ed=function(t){function e(e){t.call(this,{handleEvent:td});var i=e||{};this.condition_=i.condition?i.condition:Vo,this.addCondition_=i.addCondition?i.addCondition:Yo,this.removeCondition_=i.removeCondition?i.removeCondition:Yo,this.toggleCondition_=i.toggleCondition?i.toggleCondition:zo,this.multi_=!!i.multi&&i.multi,this.filter_=i.filter?i.filter:R,this.hitTolerance_=i.hitTolerance?i.hitTolerance:0;var r,n=new gc({source:new op({useSpatialIndex:!1,features:i.features,wrapX:i.wrapX}),style:i.style?i.style:function(){var t=Fu();return K(t[Nt.POLYGON],t[Nt.LINE_STRING]),K(t[Nt.GEOMETRY_COLLECTION],t[Nt.LINE_STRING]),function(e,i){return e.getGeometry()?t[e.getGeometry().getType()]:null}}(),updateWhileAnimating:!0,updateWhileInteracting:!0});if(this.featureOverlay_=n,i.layers)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return X(o,t)}}else r=R;this.layerFilter_=r,this.featureLayerAssociation_={};var s=this.getFeatures();v(s,h.ADD,this.addFeature_,this),v(s,h.REMOVE,this.removeFeature_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.featureOverlay_.getSource().getFeaturesCollection()},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(t)]},e.prototype.getOverlay=function(){return this.featureOverlay_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap(),r=this.getFeatures();i&&r.forEach(i.unskipFeature.bind(i)),t.prototype.setMap.call(this,e),this.featureOverlay_.setMap(e),e&&r.forEach(e.skipFeature.bind(e))},e.prototype.addFeature_=function(t){var e=this.getMap();e&&e.skipFeature(t.element)},e.prototype.removeFeature_=function(t){var e=this.getMap();e&&e.unskipFeature(t.element)},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(t)]},e}(Fo);function id(t){return t.feature?t.feature:t.element?t.element:void 0}var rd=function(t){function e(e){var i=e||{},r=i;r.handleDownEvent||(r.handleDownEvent=R),r.stopDown||(r.stopDown=w),t.call(this,r),this.source_=i.source?i.source:null,this.vertex_=void 0===i.vertex||i.vertex,this.edge_=void 0===i.edge||i.edge,this.features_=i.features?i.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelCoordinate_=null,this.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,this.sortByDistance_=function(t,e){var i=rr(this.pixelCoordinate_,t.segment),r=rr(this.pixelCoordinate_,e.segment);return i-r}.bind(this),this.rBush_=new tl,this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_,Circle:this.writeCircleGeometry_}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t,e){var i=void 0===e||e,r=o(t),n=t.getGeometry();if(n){var s=this.SEGMENT_WRITERS_[n.getType()];s&&(this.indexedFeaturesExtents_[r]=n.getExtent([1/0,1/0,-1/0,-1/0]),s.call(this,t,n))}i&&(this.featureChangeListenerKeys_[r]=v(t,M.CHANGE,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=id(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=id(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=o(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=c(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,r=o(t),n=this.indexedFeaturesExtents_[r];if(n){var s=this.rBush_,a=[];s.forEachInExtent(n,function(e){t===e.feature&&a.push(e)});for(var h=a.length-1;h>=0;--h)s.remove(a[h])}i&&(E(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var i=this.getMap(),r=this.featuresListenerKeys_,n=this.getFeatures_();i&&(r.forEach(E),r.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(v(this.features_,h.ADD,this.handleFeatureAdd_,this),v(this.features_,h.REMOVE,this.handleFeatureRemove_,this)):this.source_&&r.push(v(this.source_,rp.ADDFEATURE,this.handleFeatureAdd_,this),v(this.source_,rp.REMOVEFEATURE,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var r=tt([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(r);this.vertex_&&!this.edge_&&(n=n.filter(function(t){return t.feature.getGeometry().getType()!==Nt.CIRCLE}));var o,s,a,h,l=!1,u=null,p=null;if(n.length>0){this.pixelCoordinate_=e,n.sort(this.sortByDistance_);var c=n[0].segment,d=n[0].feature.getGeometry().getType()===Nt.CIRCLE;this.vertex_&&!this.edge_?(o=i.getPixelFromCoordinate(c[0]),s=i.getPixelFromCoordinate(c[1]),a=er(t,o),h=er(t,s),Math.sqrt(Math.min(a,h))<=this.pixelTolerance_&&(l=!0,u=a>h?c[1]:c[0],p=i.getPixelFromCoordinate(u))):this.edge_&&(u=d?function(t,e){var i=e.getRadius(),r=e.getCenter(),n=r[0],o=r[1],s=t[0]-n,a=t[1]-o;0===s&&0===a&&(s=1);var h=Math.sqrt(s*s+a*a);return[n+i*s/h,o+i*a/h]}(e,n[0].feature.getGeometry()):Zi(e,c),ir(t,p=i.getPixelFromCoordinate(u))<=this.pixelTolerance_&&(l=!0,this.vertex_&&!d&&(o=i.getPixelFromCoordinate(c[0]),s=i.getPixelFromCoordinate(c[1]),a=er(p,o),h=er(p,s),Math.sqrt(Math.min(a,h))<=this.pixelTolerance_&&(u=a>h?c[1]:c[0],p=i.getPixelFromCoordinate(u))))),l&&(p=[Math.round(p[0]),Math.round(p[1])])}return{snapped:l,vertex:u,vertexPixel:p}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){for(var i=Pi(e).getCoordinates()[0],r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(tt(o),s)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r){var n=this.SEGMENT_WRITERS_[i[r].getType()];n&&n.call(this,t,i[r])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(tt(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,segment:h};this.rBush_.insert(tt(h),l)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var h=o[s],l=0,u=h.length-1;l<u;++l){var p=h.slice(l,l+2),c={feature:t,segment:p};this.rBush_.insert(tt(p),c)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,segment:h};this.rBush_.insert(tt(h),l)}},e}(qo),nd="translatestart",od="translating",sd="translateend",ad=function(t){function e(e,i,r){t.call(this,e),this.features=i,this.coordinate=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(P),hd=function(t){function e(e){var i,r=e||{};if(t.call(this,r),this.lastCoordinate_=null,this.features_=void 0!==r.features?r.features:null,r.layers)if("function"==typeof r.layers)i=r.layers;else{var n=r.layers;i=function(t){return X(n,t)}}else i=R;this.layerFilter_=i,this.hitTolerance_=r.hitTolerance?r.hitTolerance:0,this.lastFeature_=null,v(this,G(Io.ACTIVE),this.handleActiveChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new U([this.lastFeature_]);return this.dispatchEvent(new ad(nd,e,t.coordinate)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new U([this.lastFeature_]);return this.dispatchEvent(new ad(sd,e,t.coordinate)),!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],n=this.features_||new U([this.lastFeature_]);n.forEach(function(t){var e=t.getGeometry();e.translate(i,r),t.setGeometry(e)}),this.lastCoordinate_=e,this.dispatchEvent(new ad(od,n,e))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t){if(!this.features_||X(this.features_.getArray(),t))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(i)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(qo);function ld(t){for(var e=[],i=0,r=t.length;i<r;++i)e.push(t[i].clone());return e}var ud=function(t){function e(e){t.call(this),this.geometries_=e||null,this.listenGeometriesChange_()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.unlistenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)x(this.geometries_[t],M.CHANGE,this.changed,this)},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)v(this.geometries_[t],M.CHANGE,this.changed,this)},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t},e.prototype.closestPointXY=function(t,e,i,r){if(r<rt(this.getExtent(),t,e))return r;for(var n=this.geometries_,o=0,s=n.length;o<s;++o)r=n[o].closestPointXY(t,e,i,r);return r},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)if(i[r].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){ut(t);for(var e=this.geometries_,i=0,r=e.length;i<r;++i)ft(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return ld(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(p(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i))return this.simplifiedGeometryCache[i];for(var r=[],n=this.geometries_,o=!1,s=0,a=n.length;s<a;++s){var h=n[s],l=h.getSimplifiedGeometry(t);r.push(l),l!==h&&(o=!0)}if(o){var u=new e(null);return u.setGeometriesArray(r),this.simplifiedGeometryCache[i]=u,u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Nt.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)i[r].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var r=i;r||(r=Tt(this.getExtent()));for(var n=this.geometries_,o=0,s=n.length;o<s;++o)n[o].scale(t,e,r);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(ld(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)i[r].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Xe),pd=function(){this.dataProjection=null,this.defaultFeatureProjection=null};pd.prototype.getReadOptions=function(t,e){var i;return e&&(i={dataProjection:e.dataProjection?e.dataProjection:this.readProjection(t),featureProjection:e.featureProjection}),this.adaptOptions(i)},pd.prototype.adaptOptions=function(t){return u({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},pd.prototype.getLastExtent=function(){return null},pd.prototype.getType=function(){return r()},pd.prototype.readFeature=function(t,e){return r()},pd.prototype.readFeatures=function(t,e){return r()},pd.prototype.readGeometry=function(t,e){return r()},pd.prototype.readProjection=function(t){return r()},pd.prototype.writeFeature=function(t,e){return r()},pd.prototype.writeFeatures=function(t,e){return r()},pd.prototype.writeGeometry=function(t,e){return r()};var cd=pd;function dd(t,e,i){var r,n=i?Ee(i.featureProjection):null,o=i?Ee(i.dataProjection):null;if(r=n&&o&&!Ie(n,o)?Array.isArray(t)?be(t,o,n):(e?t.clone():t).transform(e?n:o,e?o:n):t,e&&i&&void 0!==i.decimals&&!Array.isArray(r)){var s=Math.pow(10,i.decimals);r===t&&(r=t.clone()),r.applyTransform(function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*s)/s;return t})}return r}function fd(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var _d=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return Hl.JSON},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(fd(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(fd(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return r()},e.prototype.readFeaturesFromObject=function(t,e){return r()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(fd(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return r()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(fd(t))},e.prototype.readProjectionFromObject=function(t){return r()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return r()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return r()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return r()},e}(cd),gd={};gd[Nt.POINT]=function(t){var e;e=void 0!==t.m&&void 0!==t.z?new ci([t.x,t.y,t.z,t.m],At.XYZM):void 0!==t.z?new ci([t.x,t.y,t.z],At.XYZ):void 0!==t.m?new ci([t.x,t.y,t.m],At.XYM):new ci([t.x,t.y]);return e},gd[Nt.LINE_STRING]=function(t){var e=md(t);return new hr(t.paths[0],e)},gd[Nt.POLYGON]=function(t){var e=md(t);return new Ii(t.rings,e)},gd[Nt.MULTI_POINT]=function(t){var e=md(t);return new bc(t.points,e)},gd[Nt.MULTI_LINE_STRING]=function(t){var e=md(t);return new Pc(t.paths,e)},gd[Nt.MULTI_POLYGON]=function(t){var e=md(t);return new Fc(t.rings,e)};var yd={};function vd(t,e){if(!t)return null;var i;if("number"==typeof t.x&&"number"==typeof t.y)i=Nt.POINT;else if(t.points)i=Nt.MULTI_POINT;else if(t.paths){i=1===t.paths.length?Nt.LINE_STRING:Nt.MULTI_LINE_STRING}else if(t.rings){var r=t,n=md(r),o=function(t,e){var i,r,n=[],o=[],s=[];for(i=0,r=t.length;i<r;++i){n.length=0,ei(n,0,t[i],e.length);var a=Si(n,0,n.length,e.length);a?o.push([t[i]]):s.push(t[i])}for(;s.length;){var h=s.shift(),l=!1;for(i=o.length-1;i>=0;i--){var u=o[i][0],p=ot(new pi(u).getExtent(),new pi(h).getExtent());if(p){o[i].push(h),l=!0;break}}l||o.push([h.reverse()])}return o}(r.rings,n);1===o.length?(i=Nt.POLYGON,t.rings=o[0]):(i=Nt.MULTI_POLYGON,t.rings=o)}return dd((0,gd[i])(t),!1,e)}function md(t){var e=At.XY;return!0===t.hasZ&&!0===t.hasM?e=At.XYZM:!0===t.hasZ?e=At.XYZ:!0===t.hasM&&(e=At.XYM),e}function xd(t){var e=t.getLayout();return{hasZ:e===At.XYZ||e===At.XYZM,hasM:e===At.XYM||e===At.XYZM}}function Ed(t,e){return(0,yd[t.getType()])(dd(t,!0,e),e)}yd[Nt.POINT]=function(t,e){var i,r=t.getCoordinates(),n=t.getLayout();n===At.XYZ?i={x:r[0],y:r[1],z:r[2]}:n===At.XYM?i={x:r[0],y:r[1],m:r[2]}:n===At.XYZM?i={x:r[0],y:r[1],z:r[2],m:r[3]}:n===At.XY?i={x:r[0],y:r[1]}:Y(!1,34);return i},yd[Nt.LINE_STRING]=function(t,e){var i=t,r=xd(i);return{hasZ:r.hasZ,hasM:r.hasM,paths:[i.getCoordinates()]}},yd[Nt.POLYGON]=function(t,e){var i=t,r=xd(i);return{hasZ:r.hasZ,hasM:r.hasM,rings:i.getCoordinates(!1)}},yd[Nt.MULTI_POINT]=function(t,e){var i=t,r=xd(i);return{hasZ:r.hasZ,hasM:r.hasM,points:i.getCoordinates()}},yd[Nt.MULTI_LINE_STRING]=function(t,e){var i=t,r=xd(i);return{hasZ:r.hasZ,hasM:r.hasM,paths:i.getCoordinates()}},yd[Nt.MULTI_POLYGON]=function(t,e){for(var i=xd(t),r=t.getCoordinates(!1),n=[],o=0;o<r.length;o++)for(var s=r[o].length-1;s>=0;s--)n.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:n}};var Sd=function(t){function e(e){var i=e||{};t.call(this),this.geometryName_=i.geometryName}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeatureFromObject=function(t,e){var i=t,r=vd(i.geometry,e),n=new B;return this.geometryName_&&n.setGeometryName(this.geometryName_),n.setGeometry(r),e&&e.idField&&i.attributes[e.idField]&&n.setId(i.attributes[e.idField]),i.attributes&&n.setProperties(i.attributes),n},e.prototype.readFeaturesFromObject=function(t,e){var i=e||{};if(t.features){var r=[],n=t.features;i.idField=t.objectIdFieldName;for(var o=0,s=n.length;o<s;++o)r.push(this.readFeatureFromObject(n[o],i));return r}return[this.readFeatureFromObject(t,i)]},e.prototype.readGeometryFromObject=function(t,e){return vd(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?Ee("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return Ed(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={},r=t.getGeometry();r&&(i.geometry=Ed(r,e),e&&e.featureProjection&&(i.geometry.spatialReference={wkid:Number(Ee(e.featureProjection).getCode().split(":").pop())}));var n=t.getProperties();return delete n[t.getGeometryName()],d(n)?i.attributes={}:i.attributes=n,i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(this.writeFeatureObject(t[r],e));return{features:i}},e}(_d),Td=function(t){function e(){t.call(this),this.xmlSerializer_=new XMLSerializer}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return Hl.XML},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var i=ru(t);return this.readFeatureFromDocument(i,e)}return iu(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var i=this.readFeaturesFromDocument(t,e);return i.length>0?i[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var i=ru(t);return this.readFeaturesFromDocument(i,e)}return iu(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&K(i,this.readFeaturesFromNode(r,e));return i},e.prototype.readFeaturesFromNode=function(t,e){return r()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var i=ru(t);return this.readGeometryFromDocument(i,e)}return iu(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=ru(t);return this.readProjectionFromDocument(e)}return iu(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)},e.prototype.writeGeometryNode=function(t,e){return null},e}(cd),Cd="http://www.opengis.net/gml",Rd=/^[\s\xa0]*$/,wd=function(t){function e(e){t.call(this);var i=e||{};this.featureType=i.featureType,this.featureNS=i.featureNS,this.srsName=i.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:ou(this.readFeaturesInternal),featureMembers:su(this.readFeaturesInternal)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeaturesInternal=function(t,e){var i=t.localName,r=null;if("FeatureCollection"==i)r=gu([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==i||"featureMember"==i){var n=e[0],o=n.featureType,s=n.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,h=t.childNodes.length;a<h;++a){var l=t.childNodes[a];if(1===l.nodeType){var u=l.nodeName.split(":").pop();if(-1===o.indexOf(u)){var p="",c=0,d=l.namespaceURI;for(var f in s){if(s[f]===d){p=f;break}++c}p||(s[p="p"+c]=d),o.push(p+":"+u)}}}"featureMember"!=i&&(n.featureType=o,n.featureNS=s)}if("string"==typeof s){var _=s;(s={}).p0=_}var g={},y=Array.isArray(o)?o:[o];for(var v in s){for(var m={},x=0,E=y.length;x<E;++x){(-1===y[x].indexOf(":")?"p0":y[x].split(":")[0])===v&&(m[y[x].split(":").pop()]="featureMembers"==i?ou(this.readFeatureElement,this):su(this.readFeatureElement,this))}g[s[v]]=m}r=gu("featureMember"==i?void 0:[],g,t,e)}return null===r&&(r=[]),r},e.prototype.readGeometryElement=function(t,e){var i=e[0];i.srsName=t.firstElementChild.getAttribute("srsName"),i.srsDimension=t.firstElementChild.getAttribute("srsDimension");var r=gu(null,this.GEOMETRY_PARSERS,t,e,this);return r?dd(r,!1,i):void 0},e.prototype.readFeatureElementInternal=function(t,e,i){for(var r,n={},o=t.firstElementChild;o;o=o.nextElementSibling){var s=void 0,a=o.localName;0===o.childNodes.length||1===o.childNodes.length&&(3===o.firstChild.nodeType||4===o.firstChild.nodeType)?(s=eu(o,!1),Rd.test(s)&&(s=void 0)):(i&&(s=this.readGeometryElement(o,e)),s?"boundedBy"!==a&&(r=a):s=this.readFeatureElementInternal(o,e,!1)),n[a]?(n[a]instanceof Array||(n[a]=[n[a]]),n[a].push(s)):n[a]=s;var h=o.attributes.length;if(h>0){n[a]={_content_:n[a]};for(var l=0;l<h;l++){var u=o.attributes[l].name;n[a][u]=o.attributes[l].value}}}if(i){var p=new B(n);r&&p.setGeometryName(r);var c=t.getAttribute("fid")||function(t,e,i){return t.getAttributeNS(e,i)||""}(t,this.namespace,"id");return c&&p.setId(c),p}return n},e.prototype.readFeatureElement=function(t,e){return this.readFeatureElementInternal(t,e,!0)},e.prototype.readPoint=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i)return new ci(i,At.XYZ)},e.prototype.readMultiPoint=function(t,e){var i=gu([],this.MULTIPOINT_PARSERS_,t,e,this);return i?new bc(i):void 0},e.prototype.readMultiLineString=function(t,e){var i=gu([],this.MULTILINESTRING_PARSERS_,t,e,this);if(i)return new Pc(i)},e.prototype.readMultiPolygon=function(t,e){var i=gu([],this.MULTIPOLYGON_PARSERS_,t,e,this);if(i)return new Fc(i)},e.prototype.pointMemberParser_=function(t,e){_u(this.POINTMEMBER_PARSERS_,t,e,this)},e.prototype.lineStringMemberParser_=function(t,e){_u(this.LINESTRINGMEMBER_PARSERS_,t,e,this)},e.prototype.polygonMemberParser_=function(t,e){_u(this.POLYGONMEMBER_PARSERS_,t,e,this)},e.prototype.readLineString=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);return i?new hr(i,At.XYZ):void 0},e.prototype.readFlatLinearRing_=function(t,e){var i=gu(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);return i||void 0},e.prototype.readLinearRing=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i)return new pi(i,At.XYZ)},e.prototype.readPolygon=function(t,e){var i=gu([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(i&&i[0]){var r,n,o=i[0],s=[o.length];for(r=1,n=i.length;r<n;++r)K(o,i[r]),s.push(o.length);return new Ii(o,At.XYZ,s)}},e.prototype.readFlatCoordinatesFromNode_=function(t,e){return gu(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.readGeometryFromNode=function(t,e){var i=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return i||null},e.prototype.readFeaturesFromNode=function(t,e){var i={featureType:this.featureType,featureNS:this.featureNS};return e&&u(i,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[i])||[]},e.prototype.readProjectionFromNode=function(t){return Ee(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},e}(Td);wd.prototype.namespace=Cd,wd.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},wd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},wd.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},wd.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:ou(wd.prototype.pointMemberParser_),pointMembers:ou(wd.prototype.pointMemberParser_)}},wd.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:ou(wd.prototype.lineStringMemberParser_),lineStringMembers:ou(wd.prototype.lineStringMemberParser_)}},wd.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:ou(wd.prototype.polygonMemberParser_),polygonMembers:ou(wd.prototype.polygonMemberParser_)}},wd.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:ou(wd.prototype.readFlatCoordinatesFromNode_)}},wd.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:ou(wd.prototype.readLineString)}},wd.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:ou(wd.prototype.readPolygon)}},wd.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:su(wd.prototype.readFlatLinearRing_)}};var Id=wd;function Ld(t){return Od(eu(t,!1))}function Od(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function Pd(t){var e=eu(t,!1),i=Date.parse(e);return isNaN(i)?void 0:i/1e3}function bd(t){return Md(eu(t,!1))}function Md(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function Fd(t){return Ad(eu(t,!1))}function Ad(t){var e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function Nd(t){return eu(t,!1).trim()}function Gd(t,e){jd(t,e?"1":"0")}function Dd(t,e){var i=e.toPrecision();t.appendChild(Ql.createTextNode(i))}function kd(t,e){var i=e.toString();t.appendChild(Ql.createTextNode(i))}function jd(t,e){t.appendChild(Ql.createTextNode(e))}var Ud=Cd+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",Yd={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Bd=function(t){function e(e){var i=e||{};t.call(this,i),this.surface_=void 0!==i.surface&&i.surface,this.curve_=void 0!==i.curve&&i.curve,this.multiCurve_=void 0===i.multiCurve||i.multiCurve,this.multiSurface_=void 0===i.multiSurface||i.multiSurface,this.schemaLocation=i.schemaLocation?i.schemaLocation:Ud,this.hasZ=void 0!==i.hasZ&&i.hasZ}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readMultiCurve_=function(t,e){var i=gu([],this.MULTICURVE_PARSERS_,t,e,this);return i?new Pc(i):void 0},e.prototype.readMultiSurface_=function(t,e){var i=gu([],this.MULTISURFACE_PARSERS_,t,e,this);if(i)return new Fc(i)},e.prototype.curveMemberParser_=function(t,e){_u(this.CURVEMEMBER_PARSERS_,t,e,this)},e.prototype.surfaceMemberParser_=function(t,e){_u(this.SURFACEMEMBER_PARSERS_,t,e,this)},e.prototype.readPatch_=function(t,e){return gu([null],this.PATCHES_PARSERS_,t,e,this)},e.prototype.readSegment_=function(t,e){return gu([null],this.SEGMENTS_PARSERS_,t,e,this)},e.prototype.readPolygonPatch_=function(t,e){return gu([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)},e.prototype.readLineStringSegment_=function(t,e){return gu([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.interiorParser_=function(t,e){var i=gu(void 0,this.RING_PARSERS,t,e,this);i&&e[e.length-1].push(i)},e.prototype.exteriorParser_=function(t,e){var i=gu(void 0,this.RING_PARSERS,t,e,this);i&&(e[e.length-1][0]=i)},e.prototype.readSurface_=function(t,e){var i=gu([null],this.SURFACE_PARSERS_,t,e,this);if(i&&i[0]){var r,n,o=i[0],s=[o.length];for(r=1,n=i.length;r<n;++r)K(o,i[r]),s.push(o.length);return new Ii(o,At.XYZ,s)}},e.prototype.readCurve_=function(t,e){var i=gu([null],this.CURVE_PARSERS_,t,e,this);return i?new hr(i,At.XYZ):void 0},e.prototype.readEnvelope_=function(t,e){var i=gu([null],this.ENVELOPE_PARSERS_,t,e,this);return lt(i[1][0],i[1][1],i[2][0],i[2][1])},e.prototype.readFlatPos_=function(t,e){for(var i,r=eu(t,!1),n=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];i=n.exec(r);)o.push(parseFloat(i[1])),r=r.substr(i[0].length);if(""===r){var s,a,h=e[0].srsName,l="enu";if(h)l=Ee(h).getAxisOrientation();if("neu"===l)for(s=0,a=o.length;s<a;s+=3){var u=o[s],p=o[s+1];o[s]=p,o[s+1]=u}var c=o.length;if(2==c&&o.push(0),0!==c)return o}},e.prototype.readFlatPosList_=function(t,e){var i=eu(t,!1).replace(/^\s*|\s*$/g,""),r=e[0],n=r.srsName,o=r.srsDimension,s="enu";n&&(s=Ee(n).getAxisOrientation());var a,h,l,u=i.split(/\s+/),p=2;t.getAttribute("srsDimension")?p=Ad(t.getAttribute("srsDimension")):t.getAttribute("dimension")?p=Ad(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?p=Ad(t.parentNode.getAttribute("srsDimension")):o&&(p=Ad(o));for(var c=[],d=0,f=u.length;d<f;d+=p)a=parseFloat(u[d]),h=parseFloat(u[d+1]),l=3===p?parseFloat(u[d+2]):0,"en"===s.substr(0,2)?c.push(a,h,l):c.push(h,a,l);return c},e.prototype.writePos_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=n?"3":"2";t.setAttribute("srsDimension",o);var s=r.srsName,a="enu";s&&(a=Ee(s).getAxisOrientation());var h,l=e.getCoordinates();(h="en"===a.substr(0,2)?l[0]+" "+l[1]:l[1]+" "+l[0],n)&&(h+=" "+(l[2]||0));jd(t,h)},e.prototype.getCoords_=function(t,e,i){var r="enu";e&&(r=Ee(e).getAxisOrientation());var n="en"===r.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];i&&(n+=" "+(t[2]||0));return n},e.prototype.writePosList_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=n?"3":"2";t.setAttribute("srsDimension",o);for(var s,a=r.srsName,h=e.getCoordinates(),l=h.length,u=new Array(l),p=0;p<l;++p)s=h[p],u[p]=this.getCoords_(s,a,n);jd(t,u.join(" "))},e.prototype.writePoint_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=tu(t.namespaceURI,"pos");t.appendChild(n),this.writePos_(n,e,i)},e.prototype.writeEnvelope=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];vu({node:t},this.ENVELOPE_SERIALIZERS_,cu,n,i,["lowerCorner","upperCorner"],this)},e.prototype.writeLinearRing_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=tu(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)},e.prototype.RING_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1],n=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),tu(n.namespaceURI,void 0!==o?"interior":"exterior")},e.prototype.writeSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();vu({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=tu(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,i)}},e.prototype.writeCurveOrLineString_=function(t,e,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=tu(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)}else if("Curve"===t.nodeName){var o=tu(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,i)}},e.prototype.writeMultiSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();vu({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},e.prototype.writeMultiPoint_=function(t,e,i){var r=i[i.length-1],n=r.srsName,o=r.hasZ;n&&t.setAttribute("srsName",n);var s=e.getPoints();vu({node:t,hasZ:o,srsName:n},this.POINTMEMBER_SERIALIZERS_,pu("pointMember"),s,i,void 0,this)},e.prototype.writeMultiCurveOrLineString_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();vu({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},e.prototype.writeRing_=function(t,e,i){var r=tu(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing_(r,e,i)},e.prototype.writeSurfaceOrPolygonMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i))},e.prototype.writePointMember_=function(t,e,i){var r=tu(t.namespaceURI,"Point");t.appendChild(r),this.writePoint_(r,e,i)},e.prototype.writeLineStringOrCurveMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeCurveOrLineString_(r,e,i))},e.prototype.writeSurfacePatches_=function(t,e,i){var r=tu(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i)},e.prototype.writeCurveSegments_=function(t,e,i){var r=tu(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString_(r,e,i)},e.prototype.writeGeometryElement=function(t,e,i){var r,n=i[i.length-1],o=u({},n);o.node=t,r=Array.isArray(e)?n.dataProjection?be(e,n.featureProjection,n.dataProjection):e:dd(e,!0,n),vu(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[r],i,void 0,this)},e.prototype.writeFeatureElement=function(t,e,i){var r=e.getId();r&&t.setAttribute("fid",r);var n=i[i.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=e.getProperties(),h=[],l=[];for(var p in a){var c=a[p];null!==c&&(h.push(p),l.push(c),p==s||"function"==typeof c.getSimplifiedGeometry?p in n.serializers[o]||(n.serializers[o][p]=lu(this.writeGeometryElement,this)):p in n.serializers[o]||(n.serializers[o][p]=lu(jd)))}var d=u({},n);d.node=t,vu(d,n.serializers,pu(void 0,o),l,i,h)},e.prototype.writeFeatureMembers_=function(t,e,i){var r=i[i.length-1],n=r.featureType,o=r.featureNS,s={};s[o]={},s[o][n]=lu(this.writeFeatureElement,this);var a=u({},r);a.node=t,vu(a,s,pu(n,o),e,i)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1].node;return tu(this.namespace,Yd[r.nodeName])},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,i){var r,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.curve,h=n.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"LineString"===r&&!0===a?r="Curve":"MultiLineString"===r&&!0===h&&(r="MultiCurve"),tu(this.namespace,r)},e.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var i=tu(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&u(r,e),this.writeGeometryElement(i,t,[r]),i},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=tu(this.namespace,"featureMembers");i.setAttributeNS($l,"xsi:schemaLocation",this.schemaLocation);var r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&u(r,e),this.writeFeatureMembers_(i,t,[r]),i},e}(Id);Bd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:su(Bd.prototype.readFlatPos_),posList:su(Bd.prototype.readFlatPosList_)}},Bd.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:Bd.prototype.interiorParser_,exterior:Bd.prototype.exteriorParser_}},Bd.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:su(Id.prototype.readPoint),MultiPoint:su(Id.prototype.readMultiPoint),LineString:su(Id.prototype.readLineString),MultiLineString:su(Id.prototype.readMultiLineString),LinearRing:su(Id.prototype.readLinearRing),Polygon:su(Id.prototype.readPolygon),MultiPolygon:su(Id.prototype.readMultiPolygon),Surface:su(Bd.prototype.readSurface_),MultiSurface:su(Bd.prototype.readMultiSurface_),Curve:su(Bd.prototype.readCurve_),MultiCurve:su(Bd.prototype.readMultiCurve_),Envelope:su(Bd.prototype.readEnvelope_)}},Bd.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:ou(Bd.prototype.curveMemberParser_),curveMembers:ou(Bd.prototype.curveMemberParser_)}},Bd.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:ou(Bd.prototype.surfaceMemberParser_),surfaceMembers:ou(Bd.prototype.surfaceMemberParser_)}},Bd.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:ou(Id.prototype.readLineString),Curve:ou(Bd.prototype.readCurve_)}},Bd.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:ou(Id.prototype.readPolygon),Surface:ou(Bd.prototype.readSurface_)}},Bd.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:su(Bd.prototype.readPatch_)}},Bd.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:su(Bd.prototype.readSegment_)}},Bd.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:ou(Bd.prototype.readFlatPosList_),upperCorner:ou(Bd.prototype.readFlatPosList_)}},Bd.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:su(Bd.prototype.readPolygonPatch_)}},Bd.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:su(Bd.prototype.readLineStringSegment_)}},Bd.prototype.writeFeatures,Bd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:lu(Bd.prototype.writeRing_),interior:lu(Bd.prototype.writeRing_)}},Bd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:lu(jd),upperCorner:lu(jd)}},Bd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:lu(Bd.prototype.writeSurfaceOrPolygonMember_),polygonMember:lu(Bd.prototype.writeSurfaceOrPolygonMember_)}},Bd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:lu(Bd.prototype.writePointMember_)}},Bd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:lu(Bd.prototype.writeLineStringOrCurveMember_),curveMember:lu(Bd.prototype.writeLineStringOrCurveMember_)}},Bd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:lu(Bd.prototype.writeCurveOrLineString_),MultiCurve:lu(Bd.prototype.writeMultiCurveOrLineString_),Point:lu(Bd.prototype.writePoint_),MultiPoint:lu(Bd.prototype.writeMultiPoint_),LineString:lu(Bd.prototype.writeCurveOrLineString_),MultiLineString:lu(Bd.prototype.writeMultiCurveOrLineString_),LinearRing:lu(Bd.prototype.writeLinearRing_),Polygon:lu(Bd.prototype.writeSurfaceOrPolygon_),MultiPolygon:lu(Bd.prototype.writeMultiSurfaceOrPolygon_),Surface:lu(Bd.prototype.writeSurfaceOrPolygon_),MultiSurface:lu(Bd.prototype.writeMultiSurfaceOrPolygon_),Envelope:lu(Bd.prototype.writeEnvelope)}};var Vd=Bd,Xd=Vd;Xd.prototype.writeFeatures,Xd.prototype.writeFeaturesNode;var zd=Xd,Wd=Cd+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",Kd={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Hd=function(t){function e(e){var i=e||{};t.call(this,i),this.FEATURE_COLLECTION_PARSERS[Cd].featureMember=ou(this.readFeaturesInternal),this.schemaLocation=i.schemaLocation?i.schemaLocation:Wd}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFlatCoordinates_=function(t,e){var i=eu(t,!1).replace(/^\s*|\s*$/g,""),r=e[0].srsName,n="enu";if(r){var o=Ee(r);o&&(n=o.getAxisOrientation())}for(var s=i.trim().split(/\s+/),a=[],h=0,l=s.length;h<l;h++){var u=s[h].split(/,+/),p=parseFloat(u[0]),c=parseFloat(u[1]),d=3===u.length?parseFloat(u[2]):0;"en"===n.substr(0,2)?a.push(p,c,d):a.push(c,p,d)}return a},e.prototype.readBox_=function(t,e){var i=gu([null],this.BOX_PARSERS_,t,e,this);return lt(i[1][0],i[1][1],i[1][3],i[1][4])},e.prototype.innerBoundaryIsParser_=function(t,e){var i=gu(void 0,this.RING_PARSERS,t,e,this);i&&e[e.length-1].push(i)},e.prototype.outerBoundaryIsParser_=function(t,e){var i=gu(void 0,this.RING_PARSERS,t,e,this);i&&(e[e.length-1][0]=i)},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,i){var r,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"MultiLineString"===r&&!0===a&&(r="MultiCurve"),tu("http://www.opengis.net/gml",r)},e.prototype.writeFeatureElement=function(t,e,i){var r=e.getId();r&&t.setAttribute("fid",r);var n=i[i.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=e.getProperties(),h=[],l=[];for(var p in a){var c=a[p];null!==c&&(h.push(p),l.push(c),p==s||"function"==typeof c.getSimplifiedGeometry?p in n.serializers[o]||(n.serializers[o][p]=lu(this.writeGeometryElement,this)):p in n.serializers[o]||(n.serializers[o][p]=lu(jd)))}var d=u({},n);d.node=t,vu(d,n.serializers,pu(void 0,o),l,i,h)},e.prototype.writeCurveOrLineString_=function(t,e,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)}else if("Curve"===t.nodeName){var o=tu(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,i)}},e.prototype.writeLineStringOrCurveMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeCurveOrLineString_(r,e,i))},e.prototype.writeMultiCurveOrLineString_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();vu({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},e.prototype.writeGeometryElement=function(t,e,i){var r,n=i[i.length-1],o=u({},n);o.node=t,r=Array.isArray(e)?n.dataProjection?be(e,n.featureProjection,n.dataProjection):e:dd(e,!0,n),vu(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[r],i,void 0,this)},e.prototype.createCoordinatesNode_=function(t){var e=tu(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},e.prototype.writeCoordinates_=function(t,e,i){for(var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=e.getCoordinates(),a=s.length,h=new Array(a),l=0;l<a;++l){var u=s[l];h[l]=this.getCoords_(u,o,n)}jd(t,h.join(" "))},e.prototype.writeCurveSegments_=function(t,e,i){var r=tu(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString_(r,e,i)},e.prototype.writeSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();vu({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=tu(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,i)}},e.prototype.RING_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1],n=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),tu(n.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},e.prototype.writeSurfacePatches_=function(t,e,i){var r=tu(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i)},e.prototype.writeRing_=function(t,e,i){var r=tu(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing_(r,e,i)},e.prototype.getCoords_=function(t,e,i){var r="enu";e&&(r=Ee(e).getAxisOrientation());var n="en"===r.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];i&&(n+=","+(t[2]||0));return n},e.prototype.writePoint_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(s);var a=e.getCoordinates();jd(s,this.getCoords_(a,o,n))},e.prototype.writeMultiPoint_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=e.getPoints();vu({node:t,hasZ:n,srsName:o},this.POINTMEMBER_SERIALIZERS_,pu("pointMember"),s,i,void 0,this)},e.prototype.writePointMember_=function(t,e,i){var r=tu(t.namespaceURI,"Point");t.appendChild(r),this.writePoint_(r,e,i)},e.prototype.writeLinearRing_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)},e.prototype.writeMultiSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();vu({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},e.prototype.writeSurfaceOrPolygonMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i))},e.prototype.writeEnvelope=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];vu({node:t},this.ENVELOPE_SERIALIZERS_,cu,n,i,["lowerCorner","upperCorner"],this)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1].node;return tu("http://www.opengis.net/gml",Kd[r.nodeName])},e}(Id);Hd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:su(Hd.prototype.readFlatCoordinates_)}},Hd.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:Hd.prototype.innerBoundaryIsParser_,outerBoundaryIs:Hd.prototype.outerBoundaryIsParser_}},Hd.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:ou(Hd.prototype.readFlatCoordinates_)}},Hd.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:su(Id.prototype.readPoint),MultiPoint:su(Id.prototype.readMultiPoint),LineString:su(Id.prototype.readLineString),MultiLineString:su(Id.prototype.readMultiLineString),LinearRing:su(Id.prototype.readLinearRing),Polygon:su(Id.prototype.readPolygon),MultiPolygon:su(Id.prototype.readMultiPolygon),Box:su(Hd.prototype.readBox_)}},Hd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:lu(Hd.prototype.writeCurveOrLineString_),MultiCurve:lu(Hd.prototype.writeMultiCurveOrLineString_),Point:lu(Hd.prototype.writePoint_),MultiPoint:lu(Hd.prototype.writeMultiPoint_),LineString:lu(Hd.prototype.writeCurveOrLineString_),MultiLineString:lu(Hd.prototype.writeMultiCurveOrLineString_),LinearRing:lu(Hd.prototype.writeLinearRing_),Polygon:lu(Hd.prototype.writeSurfaceOrPolygon_),MultiPolygon:lu(Hd.prototype.writeMultiSurfaceOrPolygon_),Surface:lu(Hd.prototype.writeSurfaceOrPolygon_),MultiSurface:lu(Hd.prototype.writeMultiSurfaceOrPolygon_),Envelope:lu(Hd.prototype.writeEnvelope)}},Hd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:lu(Hd.prototype.writeLineStringOrCurveMember_),curveMember:lu(Hd.prototype.writeLineStringOrCurveMember_)}},Hd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{outerBoundaryIs:lu(Hd.prototype.writeRing_),innerBoundaryIs:lu(Hd.prototype.writeRing_)}},Hd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:lu(Hd.prototype.writePointMember_)}},Hd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:lu(Hd.prototype.writeSurfaceOrPolygonMember_),polygonMember:lu(Hd.prototype.writeSurfaceOrPolygonMember_)}},Hd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:lu(jd),upperCorner:lu(jd)}};var Zd=Hd,qd=function(t){function e(e){var i=e||{};t.call(this,i),this.schemaLocation=i.schemaLocation?i.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Vd);qd.prototype.namespace="http://www.opengis.net/gml/3.2",qd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:su(Vd.prototype.readFlatPos_),posList:su(Vd.prototype.readFlatPosList_)}},qd.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Vd.prototype.interiorParser_,exterior:Vd.prototype.exteriorParser_}},qd.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:su(Id.prototype.readPoint),MultiPoint:su(Id.prototype.readMultiPoint),LineString:su(Id.prototype.readLineString),MultiLineString:su(Id.prototype.readMultiLineString),LinearRing:su(Id.prototype.readLinearRing),Polygon:su(Id.prototype.readPolygon),MultiPolygon:su(Id.prototype.readMultiPolygon),Surface:su(qd.prototype.readSurface_),MultiSurface:su(Vd.prototype.readMultiSurface_),Curve:su(qd.prototype.readCurve_),MultiCurve:su(Vd.prototype.readMultiCurve_),Envelope:su(qd.prototype.readEnvelope_)}},qd.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{curveMember:ou(Vd.prototype.curveMemberParser_),curveMembers:ou(Vd.prototype.curveMemberParser_)}},qd.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:ou(Vd.prototype.surfaceMemberParser_),surfaceMembers:ou(Vd.prototype.surfaceMemberParser_)}},qd.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:ou(Id.prototype.readLineString),Curve:ou(Vd.prototype.readCurve_)}},qd.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:ou(Id.prototype.readPolygon),Surface:ou(Vd.prototype.readSurface_)}},qd.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{patches:su(Vd.prototype.readPatch_)}},qd.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{segments:su(Vd.prototype.readSegment_)}},qd.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:ou(Vd.prototype.readFlatPosList_),upperCorner:ou(Vd.prototype.readFlatPosList_)}},qd.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml/3.2":{PolygonPatch:su(Vd.prototype.readPolygonPatch_)}},qd.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml/3.2":{LineStringSegment:su(Vd.prototype.readLineStringSegment_)}},qd.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml/3.2":{pointMember:ou(Id.prototype.pointMemberParser_),pointMembers:ou(Id.prototype.pointMemberParser_)}},qd.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:ou(Id.prototype.lineStringMemberParser_),lineStringMembers:ou(Id.prototype.lineStringMemberParser_)}},qd.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml/3.2":{polygonMember:ou(Id.prototype.polygonMemberParser_),polygonMembers:ou(Id.prototype.polygonMemberParser_)}},qd.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Point:ou(Id.prototype.readFlatCoordinatesFromNode_)}},qd.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:ou(Id.prototype.readLineString)}},qd.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:ou(Id.prototype.readPolygon)}},qd.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:su(Id.prototype.readFlatLinearRing_)}},qd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{exterior:lu(Vd.prototype.writeRing_),interior:lu(Vd.prototype.writeRing_)}},qd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:lu(jd),upperCorner:lu(jd)}},qd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:lu(Vd.prototype.writeSurfaceOrPolygonMember_),polygonMember:lu(Vd.prototype.writeSurfaceOrPolygonMember_)}},qd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{pointMember:lu(Vd.prototype.writePointMember_)}},qd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:lu(Vd.prototype.writeLineStringOrCurveMember_),curveMember:lu(Vd.prototype.writeLineStringOrCurveMember_)}},qd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{Curve:lu(Vd.prototype.writeCurveOrLineString_),MultiCurve:lu(Vd.prototype.writeMultiCurveOrLineString_),Point:lu(qd.prototype.writePoint_),MultiPoint:lu(Vd.prototype.writeMultiPoint_),LineString:lu(Vd.prototype.writeCurveOrLineString_),MultiLineString:lu(Vd.prototype.writeMultiCurveOrLineString_),LinearRing:lu(Vd.prototype.writeLinearRing_),Polygon:lu(Vd.prototype.writeSurfaceOrPolygon_),MultiPolygon:lu(Vd.prototype.writeMultiSurfaceOrPolygon_),Surface:lu(Vd.prototype.writeSurfaceOrPolygon_),MultiSurface:lu(Vd.prototype.writeMultiSurfaceOrPolygon_),Envelope:lu(Vd.prototype.writeEnvelope)}};var Jd=qd,Qd=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],$d={rte:Lf,trk:Of,wpt:Pf},tf=fu(Qd,{rte:ou(Lf),trk:ou(Of),wpt:ou(Pf)}),ef=fu(Qd,{text:hu(Nd,"linkText"),type:hu(Nd,"linkType")}),rf=fu(Qd,{rte:lu(function(t,e,i){var r=i[0],n=e.getProperties(),o={node:t};o.properties=n;var s=e.getGeometry();if(s.getType()==Nt.LINE_STRING){var a=dd(s,!0,r);o.geometryLayout=a.getLayout(),n.rtept=a.getCoordinates()}var h=i[i.length-1].node,l=df[h.namespaceURI],u=du(n,l);vu(o,ff,cu,u,i,l)}),trk:lu(function(t,e,i){var r=i[0],n=e.getProperties(),o={node:t};o.properties=n;var s=e.getGeometry();if(s.getType()==Nt.MULTI_LINE_STRING){var a=dd(s,!0,r);n.trkseg=a.getLineStrings()}var h=i[i.length-1].node,l=gf[h.namespaceURI],u=du(n,l);vu(o,yf,cu,u,i,l)}),wpt:lu(function(t,e,i){var r=i[0],n=i[i.length-1];n.properties=e.getProperties();var o=e.getGeometry();if(o.getType()==Nt.POINT){var s=dd(o,!0,r);n.geometryLayout=s.getLayout(),Mf(t,s.getCoordinates(),i)}})}),nf=function(t){function e(e){t.call(this);var i=e||{};this.dataProjection=Ee("EPSG:4326"),this.readExtensions_=i.readExtensions}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,i=t.length;e<i;++e){var r=t[e];if(this.readExtensions_){var n=r.get("extensionsNode_")||null;this.readExtensions_(r,n)}r.set("extensionsNode_",void 0)}},e.prototype.readFeatureFromNode=function(t,e){if(!X(Qd,t.namespaceURI))return null;var i=$d[t.localName];if(!i)return null;var r=i(t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_([r]),r):null},e.prototype.readFeaturesFromNode=function(t,e){if(!X(Qd,t.namespaceURI))return[];if("gpx"==t.localName){var i=gu([],tf,t,[this.getReadOptions(t,e)]);return i?(this.handleReadExtensions_(i),i):[]}return[]},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=tu("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",$l),i.setAttributeNS($l,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),vu({node:i},rf,Tf,t,[e]),i},e}(Td),of=fu(Qd,{name:hu(Nd),cmt:hu(Nd),desc:hu(Nd),src:hu(Nd),link:wf,number:hu(Fd),extensions:If,type:hu(Nd),rtept:function(t,e){var i=gu({},sf,t,e);if(i){var r=e[e.length-1],n=r.flatCoordinates,o=r.layoutOptions;Cf(n,o,t,i)}}}),sf=fu(Qd,{ele:hu(bd),time:hu(Pd)}),af=fu(Qd,{name:hu(Nd),cmt:hu(Nd),desc:hu(Nd),src:hu(Nd),link:wf,number:hu(Fd),type:hu(Nd),extensions:If,trkseg:function(t,e){var i=e[e.length-1];_u(hf,t,e);var r=i.flatCoordinates;i.ends.push(r.length)}}),hf=fu(Qd,{trkpt:function(t,e){var i=gu({},lf,t,e);if(i){var r=e[e.length-1],n=r.flatCoordinates,o=r.layoutOptions;Cf(n,o,t,i)}}}),lf=fu(Qd,{ele:hu(bd),time:hu(Pd)}),uf=fu(Qd,{ele:hu(bd),time:hu(Pd),magvar:hu(bd),geoidheight:hu(bd),name:hu(Nd),cmt:hu(Nd),desc:hu(Nd),src:hu(Nd),link:wf,sym:hu(Nd),type:hu(Nd),fix:hu(Nd),sat:hu(Fd),hdop:hu(bd),vdop:hu(bd),pdop:hu(bd),ageofdgpsdata:hu(bd),dgpsid:hu(Fd),extensions:If}),pf=["text","type"],cf=fu(Qd,{text:lu(jd),type:lu(jd)}),df=fu(Qd,["name","cmt","desc","src","link","number","type","rtept"]),ff=fu(Qd,{name:lu(jd),cmt:lu(jd),desc:lu(jd),src:lu(jd),link:lu(bf),number:lu(kd),type:lu(jd),rtept:uu(lu(Mf))}),_f=fu(Qd,["ele","time"]),gf=fu(Qd,["name","cmt","desc","src","link","number","type","trkseg"]),yf=fu(Qd,{name:lu(jd),cmt:lu(jd),desc:lu(jd),src:lu(jd),link:lu(bf),number:lu(kd),type:lu(jd),trkseg:uu(lu(function(t,e,i){var r={node:t};r.geometryLayout=e.getLayout(),r.properties={},vu(r,mf,vf,e.getCoordinates(),i)}))}),vf=pu("trkpt"),mf=fu(Qd,{trkpt:lu(Mf)}),xf=fu(Qd,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),Ef=fu(Qd,{ele:lu(Dd),time:lu(function(t,e){var i=new Date(1e3*e),r=i.getUTCFullYear()+"-"+Wi(i.getUTCMonth()+1,2)+"-"+Wi(i.getUTCDate(),2)+"T"+Wi(i.getUTCHours(),2)+":"+Wi(i.getUTCMinutes(),2)+":"+Wi(i.getUTCSeconds(),2)+"Z";t.appendChild(Ql.createTextNode(r))}),magvar:lu(Dd),geoidheight:lu(Dd),name:lu(jd),cmt:lu(jd),desc:lu(jd),src:lu(jd),link:lu(bf),sym:lu(jd),type:lu(jd),fix:lu(jd),sat:lu(kd),hdop:lu(Dd),vdop:lu(Dd),pdop:lu(Dd),ageofdgpsdata:lu(Dd),dgpsid:lu(kd)}),Sf={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function Tf(t,e,i){var r=t.getGeometry();if(r){var n=Sf[r.getType()];if(n)return tu(e[e.length-1].node.namespaceURI,n)}}function Cf(t,e,i,r){return t.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in r?(t.push(r.ele),delete r.ele,e.hasZ=!0):t.push(0),"time"in r?(t.push(r.time),delete r.time,e.hasM=!0):t.push(0),t}function Rf(t,e,i){var r=At.XY,n=2;if(t.hasZ&&t.hasM?(r=At.XYZM,n=4):t.hasZ?(r=At.XYZ,n=3):t.hasM&&(r=At.XYM,n=3),4!==n){for(var o=0,s=e.length/4;o<s;o++)e[o*n]=e[4*o],e[o*n+1]=e[4*o+1],t.hasZ&&(e[o*n+2]=e[4*o+2]),t.hasM&&(e[o*n+2]=e[4*o+3]);if(e.length=e.length/4*n,i)for(var a=0,h=i.length;a<h;a++)i[a]=i[a]/4*n}return r}function wf(t,e){var i=e[e.length-1],r=t.getAttribute("href");null!==r&&(i.link=r),_u(ef,t,e)}function If(t,e){e[e.length-1].extensionsNode_=t}function Lf(t,e){var i=e[0],r=gu({flatCoordinates:[],layoutOptions:{}},of,t,e);if(r){var n=r.flatCoordinates;delete r.flatCoordinates;var o=r.layoutOptions;delete r.layoutOptions;var s=Rf(o,n),a=new hr(n,s);dd(a,!1,i);var h=new B(a);return h.setProperties(r),h}}function Of(t,e){var i=e[0],r=gu({flatCoordinates:[],ends:[],layoutOptions:{}},af,t,e);if(r){var n=r.flatCoordinates;delete r.flatCoordinates;var o=r.ends;delete r.ends;var s=r.layoutOptions;delete r.layoutOptions;var a=Rf(s,n,o),h=new Pc(n,a,o);dd(h,!1,i);var l=new B(h);return l.setProperties(r),l}}function Pf(t,e){var i=e[0],r=gu({},uf,t,e);if(r){var n={},o=Cf([],n,t,r),s=Rf(n,o),a=new ci(o,s);dd(a,!1,i);var h=new B(a);return h.setProperties(r),h}}function bf(t,e,i){t.setAttribute("href",e);var r=i[i.length-1].properties,n=[r.linkText,r.linkType];vu({node:t},cf,cu,n,i,pf)}function Mf(t,e,i){var r=i[i.length-1],n=r.node.namespaceURI,o=r.properties;switch(t.setAttributeNS(null,"lat",String(e[1])),t.setAttributeNS(null,"lon",String(e[0])),r.geometryLayout){case At.XYZM:0!==e[3]&&(o.time=e[3]);case At.XYZ:0!==e[2]&&(o.ele=e[2]);break;case At.XYM:0!==e[2]&&(o.time=e[2])}var s="rtept"==t.nodeName?_f[n]:xf[n],a=du(o,s);vu({node:t,properties:o},Ef,cu,a,i,s)}var Ff=nf;function Af(t,e){if(!t)return null;var i;switch(t.type){case Nt.POINT:i=function(t){return new ci(t.coordinates)}(t);break;case Nt.LINE_STRING:i=function(t){return new hr(t.coordinates)}(t);break;case Nt.POLYGON:i=function(t){return new Ii(t.coordinates)}(t);break;case Nt.MULTI_POINT:i=function(t){return new bc(t.coordinates)}(t);break;case Nt.MULTI_LINE_STRING:i=function(t){return new Pc(t.coordinates)}(t);break;case Nt.MULTI_POLYGON:i=function(t){return new Fc(t.coordinates)}(t);break;case Nt.GEOMETRY_COLLECTION:i=function(t,e){var i=t.geometries.map(function(t){return Af(t,e)});return new ud(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return dd(i,!1,e)}function Nf(t,e){var i,r=(t=dd(t,!0,e)).getType();switch(r){case Nt.POINT:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Nt.LINE_STRING:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Nt.POLYGON:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Nt.MULTI_POINT:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Nt.MULTI_LINE_STRING:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Nt.MULTI_POLYGON:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Nt.GEOMETRY_COLLECTION:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(t){var i=u({},e);return delete i.featureProjection,Nf(t,i)})}}(t,e);break;case Nt.CIRCLE:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return i}var Gf=function(t){function e(e){var i=e||{};t.call(this),this.dataProjection=Ee(i.dataProjection?i.dataProjection:"EPSG:4326"),i.featureProjection&&(this.defaultFeatureProjection=Ee(i.featureProjection)),this.geometryName_=i.geometryName,this.extractGeometryName_=i.extractGeometryName}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeatureFromObject=function(t,e){var i=null,r=Af((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new B;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(r),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var r=t.features,n=0,o=r.length;n<o;++n)i.push(this.readFeatureFromObject(r[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Af(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Ee(i.properties.name):Y(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},r=t.getId();void 0!==r&&(i.id=r);var n=t.getGeometry();n&&(i.geometry=Nf(n,e));var o=t.getProperties();return delete o[t.getGeometryName()],d(o)||(i.properties=o),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Nf(t,this.adaptOptions(e))},e}(_d);function Df(t){return"string"==typeof t?t:""}var kf,jf,Uf,Yf,Bf,Vf,Xf,zf=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return Hl.TEXT},e.prototype.readFeature=function(t,e){return this.readFeatureFromText(Df(t),this.adaptOptions(e))},e.prototype.readFeatureFromText=function(t,e){return r()},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromText(Df(t),this.adaptOptions(e))},e.prototype.readFeaturesFromText=function(t,e){return r()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromText(Df(t),this.adaptOptions(e))},e.prototype.readGeometryFromText=function(t,e){return r()},e.prototype.readProjection=function(t){return this.readProjectionFromText(Df(t))},e.prototype.readProjectionFromText=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){return r()},e.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},e.prototype.writeFeaturesText=function(t,e){return r()},e.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},e.prototype.writeGeometryText=function(t,e){return r()},e}(cd),Wf={BAROMETRIC:"barometric",GPS:"gps",NONE:"none"},Kf=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,Hf=/^H.([A-Z]{3}).*?:(.*)/,Zf=/^HFDTE(\d{2})(\d{2})(\d{2})/,qf=/\r\n|\r|\n/,Jf=function(t){function e(e){t.call(this);var i=e||{};this.dataProjection=Ee("EPSG:4326"),this.altitudeMode_=i.altitudeMode?i.altitudeMode:Wf.NONE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeatureFromText=function(t,e){var i,r,n=this.altitudeMode_,o=t.split(qf),s={},a=[],h=2e3,l=0,u=1,p=-1;for(i=0,r=o.length;i<r;++i){var c=o[i],d=void 0;if("B"==c.charAt(0)){if(d=Kf.exec(c)){var f=parseInt(d[1],10),_=parseInt(d[2],10),g=parseInt(d[3],10),y=parseInt(d[4],10)+parseInt(d[5],10)/6e4;"S"==d[6]&&(y=-y);var v=parseInt(d[7],10)+parseInt(d[8],10)/6e4;if("W"==d[9]&&(v=-v),a.push(v,y),n!=Wf.NONE){var m=void 0;m=n==Wf.GPS?parseInt(d[11],10):n==Wf.BAROMETRIC?parseInt(d[12],10):0,a.push(m)}var x=Date.UTC(h,l,u,f,_,g);x<p&&(x=Date.UTC(h,l,u+1,f,_,g)),a.push(x/1e3),p=x}}else"H"==c.charAt(0)&&((d=Zf.exec(c))?(u=parseInt(d[1],10),l=parseInt(d[2],10)-1,h=2e3+parseInt(d[3],10)):(d=Hf.exec(c))&&(s[d[1]]=d[2].trim()))}if(0===a.length)return null;var E=n==Wf.NONE?At.XYM:At.XYZM,S=new hr(a,E),T=new B(dd(S,!1,e));return T.setProperties(s),T},e.prototype.readFeaturesFromText=function(t,e){var i=this.readFeatureFromText(t,e);return i?[i]:[]},e}(zf),Qf=["http://www.google.com/kml/ext/2.2"],$f=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],t_={fraction:wu.FRACTION,pixels:wu.PIXELS,insetPixels:wu.PIXELS},e_=fu($f,{ExtendedData:H_,Region:Z_,MultiGeometry:hu(j_,"geometry"),LineString:hu(G_,"geometry"),LinearRing:hu(D_,"geometry"),Point:hu(U_,"geometry"),Polygon:hu(B_,"geometry"),Style:hu(X_),StyleMap:function(t,e){var i=S_(t,e);if(!i)return;var r=e[e.length-1];Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:Y(!1,38)},address:hu(Nd),description:hu(Nd),name:hu(Nd),open:hu(Ld),phoneNumber:hu(Nd),styleUrl:hu(m_),visibility:hu(Ld)},fu(Qf,{MultiTrack:hu(function(t,e){var i=gu([],O_,t,e);if(!i)return;return new Pc(i)},"geometry"),Track:hu(b_,"geometry")})),i_=fu($f,{ExtendedData:H_,Region:Z_,Link:function(t,e){_u(r_,t,e)},address:hu(Nd),description:hu(Nd),name:hu(Nd),open:hu(Ld),phoneNumber:hu(Nd),visibility:hu(Ld)}),r_=fu($f,{href:hu(m_)}),n_=fu($f,{LatLonAltBox:function(t,e){var i=gu({},Q_,t,e);if(!i)return;var r=e[e.length-1],n=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];r.extent=n,r.altitudeMode=i.altitudeMode,r.minAltitude=parseFloat(i.minAltitude),r.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,e){var i=gu({},$_,t,e);if(!i)return;var r=e[e.length-1];r.minLodPixels=parseFloat(i.minLodPixels),r.maxLodPixels=parseFloat(i.maxLodPixels),r.minFadeExtent=parseFloat(i.minFadeExtent),r.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),o_=fu($f,["Document","Placemark"]),s_=fu($f,{Document:lu(function(t,e,i){vu({node:t},ng,og,e,i,void 0,this)}),Placemark:lu(Og)}),a_=null;var h_,l_=null;var u_,p_=null;var c_=null;var d_=null;var f_=null;var __=function(t){function e(e){t.call(this);var i=e||{};f_||(a_=new mr({color:kf=[255,255,255,1]}),jf=[20,2],Uf=wu.PIXELS,Yf=wu.PIXELS,Bf=[64,64],Vf="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Xf=.5,l_=new Ou({anchor:jf,anchorOrigin:Lu.BOTTOM_LEFT,anchorXUnits:Uf,anchorYUnits:Yf,crossOrigin:"anonymous",rotation:0,scale:Xf,size:Bf,src:Vf}),h_="NO_IMAGE",p_=new Er({color:kf,width:1}),u_=new Er({color:[51,51,51,1],width:2}),c_=new Rr({font:"bold 16px Helvetica",fill:a_,stroke:u_,scale:.8}),d_=new Nu({fill:a_,image:l_,text:c_,stroke:p_,zIndex:0}),f_=[d_]),this.dataProjection=Ee("EPSG:4326"),this.defaultStyle_=i.defaultStyle?i.defaultStyle:f_,this.extractStyles_=void 0===i.extractStyles||i.extractStyles,this.writeStyles_=void 0===i.writeStyles||i.writeStyles,this.sharedStyles_={},this.showPointNames_=void 0===i.showPointNames||i.showPointNames}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readDocumentOrFolder_=function(t,e){var i=gu([],fu($f,{Document:nu(this.readDocumentOrFolder_,this),Folder:nu(this.readDocumentOrFolder_,this),Placemark:ou(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return i||void 0},e.prototype.readPlacemark_=function(t,e){var i=gu({geometry:null},e_,t,e);if(i){var r=new B,n=t.getAttribute("id");null!==n&&r.setId(n);var o=e[0],s=i.geometry;if(s&&dd(s,!1,o),r.setGeometry(s),delete i.geometry,this.extractStyles_){var a=function(t,e,i,r,n){return function(o,s){var a,h=n,l="";if(h){var u=o.getGeometry();u&&(h=u.getType()===Nt.POINT)}if(h&&(l=o.get("name"),h=h&&!!l),t)return h?(a=g_(t[0],l),t.concat(a)):t;if(e){var p=function t(e,i,r){return Array.isArray(e)?e:"string"==typeof e?(!(e in r)&&"#"+e in r&&(e="#"+e),t(r[e],i,r)):i}(e,i,r);return h?(a=g_(p[0],l),p.concat(a)):p}return h?(a=g_(i[0],l),i.concat(a)):i}}(i.Style,i.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(a)}return delete i.Style,r.setProperties(i),r}},e.prototype.readSharedStyle_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=X_(t,e);if(r){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+i,o).href;else n="#"+i;this.sharedStyles_[n]=r}}},e.prototype.readSharedStyleMap_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=S_(t,e);if(r){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+i,o).href;else n="#"+i;this.sharedStyles_[n]=r}}},e.prototype.readFeatureFromNode=function(t,e){if(!X($f,t.namespaceURI))return null;var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null},e.prototype.readFeaturesFromNode=function(t,e){var i;if(!X($f,t.namespaceURI))return[];var r=t.localName;if("Document"==r||"Folder"==r)return(i=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==r){var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n?[n]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&K(i,s)}return i}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=ru(t);return this.readNameFromDocument(e)}return iu(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(e);if(i)return i}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(X($f,e.namespaceURI)&&"name"==e.localName)return Nd(e);for(var i=t.firstElementChild;i;i=i.nextElementSibling){var r=i.localName;if(X($f,i.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(i);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var i=ru(t);K(e,this.readNetworkLinksFromDocument(i))}else iu(t)?K(e,this.readNetworkLinksFromDocument(t)):K(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&K(e,this.readNetworkLinksFromNode(i));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(X($f,i.namespaceURI)&&"NetworkLink"==i.localName){var r=gu({},i_,i,[]);e.push(r)}for(var n=t.firstElementChild;n;n=n.nextElementSibling){var o=n.localName;!X($f,n.namespaceURI)||"Document"!=o&&"Folder"!=o&&"kml"!=o||K(e,this.readNetworkLinksFromNode(n))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var i=ru(t);K(e,this.readRegionFromDocument(i))}else iu(t)?K(e,this.readRegionFromDocument(t)):K(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&K(e,this.readRegionFromNode(i));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(X($f,i.namespaceURI)&&"Region"==i.localName){var r=gu({},n_,i,[]);e.push(r)}for(var n=t.firstElementChild;n;n=n.nextElementSibling){var o=n.localName;!X($f,n.namespaceURI)||"Document"!=o&&"Folder"!=o&&"kml"!=o||K(e,this.readRegionFromNode(n))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=tu($f[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",Qf[0]),i.setAttributeNS(r,"xmlns:xsi",$l),i.setAttributeNS($l,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var n={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=o_[i.namespaceURI],a=du(o,s);return vu(n,s_,cu,a,[e],s,this),i},e}(Td);function g_(t,e){var i=null,r=[0,0],n="start";if(t.getImage()){var o=t.getImage().getImageSize();if(null===o&&(o=Bf),2==o.length){var s=t.getImage().getScale();r[0]=s*o[0]/2,r[1]=-s*o[1]/2,n="left"}}if(null!==t.getText()){var a=t.getText();(i=a.clone()).setFont(a.getFont()||c_.getFont()),i.setScale(a.getScale()||c_.getScale()),i.setFill(a.getFill()||c_.getFill()),i.setStroke(a.getStroke()||u_)}else i=c_.clone();return i.setText(e),i.setOffsetX(r[0]),i.setOffsetY(r[1]),i.setTextAlign(n),new Nu({text:i})}function y_(t){var e=eu(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function v_(t){for(var e,i=eu(t,!1),r=[],n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=n.exec(i);){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=e[3]?parseFloat(e[3]):0;r.push(o,s,a),i=i.substr(e[0].length)}if(""===i)return r}function m_(t){var e=eu(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function x_(t){return bd(t)}var E_=fu($f,{Pair:function(t,e){var i=gu({},q_,t,e);if(!i)return;var r=i.key;if(r&&"normal"==r){var n=i.styleUrl;n&&(e[e.length-1]=n);var o=i.Style;o&&(e[e.length-1]=o)}}});function S_(t,e){return gu(void 0,E_,t,e)}var T_=fu($f,{Icon:hu(function(t,e){var i=gu({},M_,t,e);return i||null}),heading:hu(bd),hotSpot:hu(function(t){var e,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return e="insetPixels"!==i?"insetPixels"!==r?Lu.BOTTOM_LEFT:Lu.TOP_LEFT:"insetPixels"!==r?Lu.BOTTOM_RIGHT:Lu.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:t_[i],y:parseFloat(t.getAttribute("y")),yunits:t_[r],origin:e}}),scale:hu(x_)});var C_=fu($f,{color:hu(y_),scale:hu(x_)});var R_=fu($f,{color:hu(y_),width:hu(bd)});var w_=fu($f,{color:hu(y_),fill:hu(Ld),outline:hu(Ld)});var I_=fu($f,{coordinates:su(v_)});function L_(t,e){return gu(null,I_,t,e)}var O_=fu(Qf,{Track:ou(b_)});var P_=fu($f,{when:function(t,e){var i=e[e.length-1].whens,r=eu(t,!1),n=Date.parse(r);i.push(isNaN(n)?0:n)}},fu(Qf,{coord:function(t,e){var i=e[e.length-1].flatCoordinates,r=eu(t,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(n){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3]);i.push(o,s,a,0)}else i.push(0,0,0,0)}}));function b_(t,e){var i=gu({flatCoordinates:[],whens:[]},P_,t,e);if(i){for(var r=i.flatCoordinates,n=i.whens,o=0,s=Math.min(r.length,n.length);o<s;++o)r[4*o+3]=n[o];return new hr(r,At.XYZM)}}var M_=fu($f,{href:hu(m_)},fu(Qf,{x:hu(bd),y:hu(bd),w:hu(bd),h:hu(bd)}));var F_=fu($f,{coordinates:su(v_)});function A_(t,e){return gu(null,F_,t,e)}var N_=fu($f,{extrude:hu(Ld),tessellate:hu(Ld),altitudeMode:hu(Nd)});function G_(t,e){var i=gu({},N_,t,e),r=A_(t,e);if(r){var n=new hr(r,At.XYZ);return n.setProperties(i),n}}function D_(t,e){var i=gu({},N_,t,e),r=A_(t,e);if(r){var n=new Ii(r,At.XYZ,[r.length]);return n.setProperties(i),n}}var k_=fu($f,{LineString:ou(G_),LinearRing:ou(D_),MultiGeometry:ou(j_),Point:ou(U_),Polygon:ou(B_)});function j_(t,e){var i,r=gu([],k_,t,e);if(!r)return null;if(0===r.length)return new ud(r);for(var n,o,s=!0,a=r[0].getType(),h=1,l=r.length;h<l;++h)if(r[h].getType()!=a){s=!1;break}if(s)if(a==Nt.POINT){var u=r[0];n=u.getLayout(),o=u.getFlatCoordinates();for(var p=1,c=r.length;p<c;++p)K(o,r[p].getFlatCoordinates());z_(i=new bc(o,n),r)}else a==Nt.LINE_STRING?z_(i=new Pc(r),r):a==Nt.POLYGON?z_(i=new Fc(r),r):a==Nt.GEOMETRY_COLLECTION?i=new ud(r):Y(!1,37);else i=new ud(r);return i}function U_(t,e){var i=gu({},N_,t,e),r=A_(t,e);if(r){var n=new ci(r,At.XYZ);return n.setProperties(i),n}}var Y_=fu($f,{innerBoundaryIs:function(t,e){var i=gu(void 0,tg,t,e);if(i){var r=e[e.length-1];r.push(i)}},outerBoundaryIs:function(t,e){var i=gu(void 0,eg,t,e);if(i){var r=e[e.length-1];r[0]=i}}});function B_(t,e){var i=gu({},N_,t,e),r=gu([null],Y_,t,e);if(r&&r[0]){for(var n=r[0],o=[n.length],s=1,a=r.length;s<a;++s)K(n,r[s]),o.push(n.length);var h=new Ii(n,At.XYZ,o);return h.setProperties(i),h}}var V_=fu($f,{IconStyle:function(t,e){var i=gu({},T_,t,e);if(i){var r,n,o,s,a=e[e.length-1],h="Icon"in i?i.Icon:{},l=!("Icon"in i)||Object.keys(h).length>0,u=h.href;u?r=u:l&&(r=Vf);var p,c=Lu.BOTTOM_LEFT,d=i.hotSpot;d?(n=[d.x,d.y],o=d.xunits,s=d.yunits,c=d.origin):r===Vf?(n=jf,o=Uf,s=Yf):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(n=[.5,0],o=wu.FRACTION,s=wu.FRACTION);var f,_=h.x,g=h.y;void 0!==_&&void 0!==g&&(p=[_,g]);var y,v=h.w,m=h.h;void 0!==v&&void 0!==m&&(f=[v,m]);var x=i.heading;void 0!==x&&(y=Vt(x));var E=i.scale;if(l){r==Vf&&(f=Bf,void 0===E&&(E=Xf));var S=new Ou({anchor:n,anchorOrigin:c,anchorXUnits:o,anchorYUnits:s,crossOrigin:"anonymous",offset:p,offsetOrigin:Lu.BOTTOM_LEFT,rotation:y,scale:E,size:f,src:r});a.imageStyle=S}else a.imageStyle=h_}},LabelStyle:function(t,e){var i=gu({},C_,t,e);if(i){var r=e[e.length-1],n=new Rr({fill:new mr({color:"color"in i?i.color:kf}),scale:i.scale});r.textStyle=n}},LineStyle:function(t,e){var i=gu({},R_,t,e);if(i){var r=e[e.length-1],n=new Er({color:"color"in i?i.color:kf,width:"width"in i?i.width:1});r.strokeStyle=n}},PolyStyle:function(t,e){var i=gu({},w_,t,e);if(i){var r=e[e.length-1],n=new mr({color:"color"in i?i.color:kf});r.fillStyle=n;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function X_(t,e){var i=gu({},V_,t,e);if(!i)return null;var r,n="fillStyle"in i?i.fillStyle:a_,o=i.fill;void 0===o||o||(n=null),"imageStyle"in i?i.imageStyle!=h_&&(r=i.imageStyle):r=l_;var s="textStyle"in i?i.textStyle:c_,a="strokeStyle"in i?i.strokeStyle:p_,h=i.outline;return void 0===h||h||(a=null),[new Nu({fill:n,image:r,stroke:a,text:s,zIndex:void 0})]}function z_(t,e){var i,r,n,o=e.length,s=new Array(e.length),a=new Array(e.length),h=new Array(e.length);i=r=n=!1;for(var l=0;l<o;++l){var u=e[l];s[l]=u.get("extrude"),a[l]=u.get("tessellate"),h[l]=u.get("altitudeMode"),i=i||void 0!==s[l],r=r||void 0!==a[l],n=n||h[l]}i&&t.set("extrude",s),r&&t.set("tessellate",a),n&&t.set("altitudeMode",h)}var W_=fu($f,{displayName:hu(Nd),value:hu(Nd)});var K_=fu($f,{Data:function(t,e){var i=t.getAttribute("name");_u(W_,t,e);var r=e[e.length-1];null!==i?r[i]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,e){_u(J_,t,e)}});function H_(t,e){_u(K_,t,e)}function Z_(t,e){_u(n_,t,e)}var q_=fu($f,{Style:hu(X_),key:hu(Nd),styleUrl:hu(m_)});var J_=fu($f,{SimpleData:function(t,e){var i=t.getAttribute("name");if(null!==i){var r=Nd(t),n=e[e.length-1];n[i]=r}}});var Q_=fu($f,{altitudeMode:hu(Nd),minAltitude:hu(bd),maxAltitude:hu(bd),north:hu(bd),south:hu(bd),east:hu(bd),west:hu(bd)});var $_=fu($f,{minLodPixels:hu(bd),maxLodPixels:hu(bd),minFadeExtent:hu(bd),maxFadeExtent:hu(bd)});var tg=fu($f,{LinearRing:su(L_)});var eg=fu($f,{LinearRing:su(L_)});function ig(t,e){for(var i=_r(e),r=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],n=0;n<4;++n){var o=Math.floor(r[n]).toString(16);r[n]=1==o.length?"0"+o:o}jd(t,r.join(""))}var rg=fu($f,{Data:lu(function(t,e,i){t.setAttribute("name",e.name);var r={node:t},n=e.value;"object"==typeof n?(null!==n&&n.displayName&&vu(r,rg,cu,[n.displayName],i,["displayName"]),null!==n&&n.value&&vu(r,rg,cu,[n.value],i,["value"])):vu(r,rg,cu,[n],i,["value"])}),value:lu(function(t,e){jd(t,e)}),displayName:lu(function(t,e){!function(t,e){t.appendChild(Ql.createCDATASection(e))}(t,e)})});var ng=fu($f,{Placemark:lu(Og)}),og=function(t,e,i){return tu(e[e.length-1].node.namespaceURI,"Placemark")};var sg=pu("Data");var ag=fu($f,["href"],fu(Qf,["x","y","w","h"])),hg=fu($f,{href:lu(jd)},fu(Qf,{x:lu(Dd),y:lu(Dd),w:lu(Dd),h:lu(Dd)})),lg=function(t,e,i){return tu(Qf[0],"gx:"+i)};var ug=fu($f,["scale","heading","Icon","hotSpot"]),pg=fu($f,{Icon:lu(function(t,e,i){var r={node:t},n=i[i.length-1].node,o=ag[n.namespaceURI],s=du(e,o);vu(r,hg,cu,s,i,o),s=du(e,o=ag[Qf[0]]),vu(r,hg,lg,s,i,o)}),heading:lu(Dd),hotSpot:lu(function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)}),scale:lu(jg)});var cg=fu($f,["color","scale"]),dg=fu($f,{color:lu(ig),scale:lu(jg)});var fg=fu($f,["color","width"]),_g=fu($f,{color:lu(ig),width:lu(Dd)});var gg={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},yg=function(t,e,i){if(t)return tu(e[e.length-1].node.namespaceURI,gg[t.getType()])},vg=pu("Point"),mg=pu("LineString"),xg=pu("LinearRing"),Eg=pu("Polygon"),Sg=fu($f,{LineString:lu(Mg),Point:lu(Mg),Polygon:lu(Gg),GeometryCollection:lu(Tg)});function Tg(t,e,i){var r,n,o={node:t},s=e.getType();s==Nt.GEOMETRY_COLLECTION?(r=e.getGeometries(),n=yg):s==Nt.MULTI_POINT?(r=e.getPoints(),n=vg):s==Nt.MULTI_LINE_STRING?(r=e.getLineStrings(),n=mg):s==Nt.MULTI_POLYGON?(r=e.getPolygons(),n=Eg):Y(!1,39),vu(o,Sg,n,r,i)}var Cg=fu($f,{LinearRing:lu(Mg)});function Rg(t,e,i){vu({node:t},Cg,xg,[e],i)}var wg=fu($f,{ExtendedData:lu(function(t,e,i){for(var r={node:t},n=e.names,o=e.values,s=n.length,a=0;a<s;a++)vu(r,rg,sg,[{name:n[a],value:o[a]}],i)}),MultiGeometry:lu(Tg),LineString:lu(Mg),LinearRing:lu(Mg),Point:lu(Mg),Polygon:lu(Gg),Style:lu(function(t,e,i){var r={node:t},n={},o=e.getFill(),s=e.getStroke(),a=e.getImage(),h=e.getText();a&&"function"==typeof a.getSrc&&(n.IconStyle=a);h&&(n.LabelStyle=h);s&&(n.LineStyle=s);o&&(n.PolyStyle=o);var l=i[i.length-1].node,u=Ug[l.namespaceURI],p=du(n,u);vu(r,Yg,cu,p,i,u)}),address:lu(jd),description:lu(jd),name:lu(jd),open:lu(Gd),phoneNumber:lu(jd),styleUrl:lu(jd),visibility:lu(Gd)}),Ig=fu($f,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Lg=pu("ExtendedData");function Og(t,e,i){var r={node:t};e.getId()&&t.setAttribute("id",e.getId());var n=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(n||{}).sort().filter(function(t){return!o[t]});if(s.length>0){var a=du(n,s);vu(r,wg,Lg,[{names:s,values:a}],i)}var h=e.getStyleFunction();if(h){var l=h(e,0);if(l){var u=Array.isArray(l)?l[0]:l;this.writeStyles_&&(n.Style=u);var p=u.getText();p&&(n.name=p.getText())}}var c=i[i.length-1].node,d=Ig[c.namespaceURI],f=du(n,d);vu(r,wg,cu,f,i,d);var _=i[0],g=e.getGeometry();g&&(g=dd(g,!0,_)),vu(r,wg,yg,[g],i)}var Pg=fu($f,["extrude","tessellate","altitudeMode","coordinates"]),bg=fu($f,{extrude:lu(Gd),tessellate:lu(Gd),altitudeMode:lu(jd),coordinates:lu(function(t,e,i){var r,n=i[i.length-1],o=n.layout,s=n.stride;o==At.XY||o==At.XYM?r=2:o==At.XYZ||o==At.XYZM?r=3:Y(!1,34);var a=e.length,h="";if(a>0){h+=e[0];for(var l=1;l<r;++l)h+=","+e[l];for(var u=s;u<a;u+=s){h+=" "+e[u];for(var p=1;p<r;++p)h+=","+e[u+p]}}jd(t,h)})});function Mg(t,e,i){var r=e.getFlatCoordinates(),n={node:t};n.layout=e.getLayout(),n.stride=e.getStride();var o=e.getProperties();o.coordinates=r;var s=i[i.length-1].node,a=Pg[s.namespaceURI],h=du(o,a);vu(n,bg,cu,h,i,a)}var Fg=fu($f,{outerBoundaryIs:lu(Rg),innerBoundaryIs:lu(Rg)}),Ag=pu("innerBoundaryIs"),Ng=pu("outerBoundaryIs");function Gg(t,e,i){var r=e.getLinearRings(),n=r.shift(),o={node:t};vu(o,Fg,Ag,r,i),vu(o,Fg,Ng,[n],i)}var Dg=fu($f,{color:lu(ig)}),kg=pu("color");function jg(t,e){Dd(t,Math.round(1e6*e)/1e6)}var Ug=fu($f,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Yg=fu($f,{IconStyle:lu(function(t,e,i){var r={node:t},n={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),h={href:o};if(s){h.w=s[0],h.h=s[1];var l=e.getAnchor(),u=e.getOrigin();if(u&&a&&0!==u[0]&&u[1]!==s[1]&&(h.x=u[0],h.y=a[1]-(u[1]+s[1])),l&&(l[0]!==s[0]/2||l[1]!==s[1]/2)){var p={x:l[0],xunits:wu.PIXELS,y:s[1]-l[1],yunits:wu.PIXELS};n.hotSpot=p}}n.Icon=h;var c=e.getScale();1!==c&&(n.scale=c);var d=e.getRotation();0!==d&&(n.heading=d);var f=i[i.length-1].node,_=ug[f.namespaceURI],g=du(n,_);vu(r,pg,cu,g,i,_)}),LabelStyle:lu(function(t,e,i){var r={node:t},n={},o=e.getFill();o&&(n.color=o.getColor());var s=e.getScale();s&&1!==s&&(n.scale=s);var a=i[i.length-1].node,h=cg[a.namespaceURI],l=du(n,h);vu(r,dg,cu,l,i,h)}),LineStyle:lu(function(t,e,i){var r={node:t},n={color:e.getColor(),width:e.getWidth()},o=i[i.length-1].node,s=fg[o.namespaceURI],a=du(n,s);vu(r,_g,cu,a,i,s)}),PolyStyle:lu(function(t,e,i){vu({node:t},Dg,kg,[e.getColor()],i)})});var Bg=__,Vg=i(1),Xg=i.n(Vg),zg=[1,0,0,1,0,0],Wg=function(t,e,i,r,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};Wg.prototype.get=function(t){return this.properties_[t]},Wg.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Nt.POINT?pt(this.flatCoordinates_):ct(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},Wg.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Tt(this.getExtent());this.flatInteriorPoints_=gi(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},Wg.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Mc(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=yi(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},Wg.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=or(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},Wg.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,r=0,n=i.length;r<n;++r){var o=i[r],s=or(t,e,o,2,.5);K(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},Wg.prototype.getId=function(){return this.id_},Wg.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},Wg.prototype.getGeometry=function(){return this},Wg.prototype.getSimplifiedGeometry=function(t){return this},Wg.prototype.getProperties=function(){return this.properties_},Wg.prototype.getStride=function(){return 2},Wg.prototype.getStyleFunction=function(){},Wg.prototype.getType=function(){return this.type_},Wg.prototype.transform=function(t,e){var i=(t=Ee(t)).getExtent(),r=t.getWorldExtent(),n=Rt(r)/Rt(i);Ye(zg,r[0],r[3],n,-n,0,0,0),Gt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,zg,this.flatCoordinates_)},Wg.prototype.getEnds=Wg.prototype.getEndss=function(){return this.ends_},Wg.prototype.getFlatCoordinates=Wg.prototype.getOrientedFlatCoordinates;var Kg=Wg;function Hg(t,e,i){if(3===t){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Zg,r,n),r.length=r.features.length,r.length&&(e[r.name]=r)}}function Zg(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 r=null,n=i.readVarint()+i.pos;i.pos<n;)r=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(r)}}function qg(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos<r;){var n=e.layer.keys[i.readVarint()],o=e.layer.values[i.readVarint()];e.properties[n]=o}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Jg(t,e,i){t.pos=e.features[i];var r=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(qg,n,r),n}var Qg=function(t){function e(e){t.call(this);var i=e||{};this.dataProjection=new ee({code:"",units:$t.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:Kg,this.geometryName_=i.geometryName,this.layerName_=i.layerName?i.layerName:"layer",this.layers_=i.layers?i.layers:null,this.extent_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readRawGeometry_=function(t,e,i,r){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,o=1,s=0,a=0,h=0,l=0,u=0;t.pos<n;){if(!s){var p=t.readVarint();o=7&p,s=p>>3}s--,1===o||2===o?(a+=t.readSVarint(),h+=t.readSVarint(),1===o&&l>u&&(r.push(l),u=l),i.push(a,h),l+=2):7===o?l>u&&(i.push(i[u],i[u+1]),l+=2):Y(!1,59)}l>u&&(r.push(l),u=l)},e.prototype.createFeature_=function(t,e,i){var r,n=e.type;if(0===n)return null;var o=e.id,s=e.properties;s[this.layerName_]=e.layer.name;var a=[],h=[];this.readRawGeometry_(t,e,a,h);var l=function(t,e){var i;1===t?i=1===e?Nt.POINT:Nt.MULTI_POINT:2===t?i=1===e?Nt.LINE_STRING:Nt.MULTI_LINE_STRING:3===t&&(i=Nt.POLYGON);return i}(n,h.length);if(this.featureClass_===Kg)r=new this.featureClass_(l,a,h,s,o);else{var u;if(l==Nt.POLYGON){for(var p=[],c=0,d=0,f=0,_=h.length;f<_;++f){var g=h[f];Si(a,c,g,2)||(p.push(h.slice(d,f)),d=f),c=g}u=p.length>1?new Fc(a,At.XY,p):new Ii(a,At.XY,h)}else u=l===Nt.POINT?new ci(a,At.XY):l===Nt.LINE_STRING?new hr(a,At.XY):l===Nt.POLYGON?new Ii(a,At.XY,h):l===Nt.MULTI_POINT?new bc(a,At.XY):l===Nt.MULTI_LINE_STRING?new Pc(a,At.XY,h):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var y=dd(u,!1,this.adaptOptions(i));r.setGeometry(y),r.setId(o),r.setProperties(s)}return r},e.prototype.getLastExtent=function(){return this.extent_},e.prototype.getType=function(){return Hl.ARRAY_BUFFER},e.prototype.readFeatures=function(t,e){var i=this.layers_,r=new Xg.a(t),n=r.readFields(Hg,{}),o=[];for(var s in n)if(!i||-1!=i.indexOf(s)){for(var a=n[s],h=0,l=a.length;h<l;++h){var u=Jg(r,a,h);o.push(this.createFeature_(r,u))}this.extent_=a?[0,0,a.extent,a.extent]:null}return o},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(cd),$g=[null],ty=fu($g,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:ny}),ey=fu($g,{node:function(t,e){var i=e[0],r=e[e.length-1],n=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];r.nodes[n]=o;var s=gu({tags:{}},ry,t,e);if(!d(s.tags)){var a=new ci(o);dd(a,!1,i);var h=new B(a);h.setId(n),h.setProperties(s.tags),r.features.push(h)}},way:function(t,e){var i=gu({id:t.getAttribute("id"),ndrefs:[],tags:{}},ty,t,e);e[e.length-1].ways.push(i)}}),iy=function(t){function e(){t.call(this),this.dataProjection=Ee("EPSG:4326")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeaturesFromNode=function(t,e){var i=this.getReadOptions(t,e);if("osm"==t.localName){for(var r=gu({nodes:{},ways:[],features:[]},ey,t,[i]),n=0;n<r.ways.length;n++){for(var o=r.ways[n],s=[],a=0,h=o.ndrefs.length;a<h;a++){K(s,r.nodes[o.ndrefs[a]])}var l=void 0;dd(l=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new Ii(s,At.XY,[s.length]):new hr(s,At.XY),!1,i);var u=new B(l);u.setId(o.id),u.setProperties(o.tags),r.features.push(u)}if(r.features)return r.features}return[]},e}(Td),ry=fu($g,{tag:ny});function ny(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}var oy=iy;function sy(t,e,i,r,n,o){var s,a;void 0!==n?(s=n,a=void 0!==o?o:0):(s=[],a=0);for(var h=e;h<i;){var l=t[h++];s[a++]=t[h++],s[a++]=l;for(var u=2;u<r;++u)s[a++]=t[h++]}return s.length=a,s}function ay(t,e,i){var r,n=i||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var s=0,a=t.length;s<a;)for(r=0;r<e;++r,++s){var h=t[s],l=h-o[r];o[r]=h,t[s]=l}return ly(t,n)}function hy(t,e,i){var r,n=i||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var s=uy(t,n),a=0,h=s.length;a<h;)for(r=0;r<e;++r,++a)o[r]+=s[a],s[a]=o[r];return s}function ly(t,e){for(var i=e||1e5,r=0,n=t.length;r<n;++r)t[r]=Math.round(t[r]*i);return function(t){for(var e=0,i=t.length;e<i;++e){var r=t[e];t[e]=r<0?~(r<<1):r<<1}return function(t){for(var e="",i=0,r=t.length;i<r;++i)e+=py(t[i]);return e}(t)}(t)}function uy(t,e){for(var i=e||1e5,r=function(t){for(var e=function(t){for(var e=[],i=0,r=0,n=0,o=t.length;n<o;++n){var s=t.charCodeAt(n)-63;i|=(31&s)<<r,s<32?(e.push(i),i=0,r=0):r+=5}return e}(t),i=0,r=e.length;i<r;++i){var n=e[i];e[i]=1&n?~(n>>1):n>>1}return e}(t),n=0,o=r.length;n<o;++n)r[n]/=i;return r}function py(t){for(var e,i="";t>=32;)e=63+(32|31&t),i+=String.fromCharCode(e),t>>=5;return e=t+63,i+=String.fromCharCode(e)}var cy=function(t){function e(e){t.call(this);var i=e||{};this.dataProjection=Ee("EPSG:4326"),this.factor_=i.factor?i.factor:1e5,this.geometryLayout_=i.geometryLayout?i.geometryLayout:At.XY}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeatureFromText=function(t,e){var i=this.readGeometryFromText(t,e);return new B(i)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var i=ze(this.geometryLayout_),r=hy(t,i,this.factor_);sy(r,0,r.length,i,r);var n=ri(r,0,r.length,i);return dd(new hr(n,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var i=t.getGeometry();return i?this.writeGeometryText(i,e):(Y(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var i=(t=dd(t,!0,this.adaptOptions(e))).getFlatCoordinates(),r=t.getStride();return sy(i,0,i.length,r,i),ay(i,r,this.factor_)},e}(zf),dy={Point:function(t,e,i){var r=t.coordinates;e&&i&&vy(r,e,i);return new ci(r)},LineString:function(t,e){var i=fy(t.arcs,e);return new hr(i)},Polygon:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r)i[r]=fy(t.arcs[r],e);return new Ii(i)},MultiPoint:function(t,e,i){var r=t.coordinates;if(e&&i)for(var n=0,o=r.length;n<o;++n)vy(r[n],e,i);return new bc(r)},MultiLineString:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r)i[r]=fy(t.arcs[r],e);return new Pc(i)},MultiPolygon:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r){for(var o=t.arcs[r],s=[],a=0,h=o.length;a<h;++a)s[a]=fy(o[a],e);i[r]=s}return new Fc(i)}};function fy(t,e){for(var i,r,n=[],o=0,s=t.length;o<s;++o)i=t[o],o>0&&n.pop(),r=i>=0?e[i]:e[~i].slice().reverse(),n.push.apply(n,r);for(var a=0,h=n.length;a<h;++a)n[a]=n[a].slice();return n}function _y(t,e,i,r,n,o,s){for(var a=t.geometries,h=[],l=0,u=a.length;l<u;++l)h[l]=gy(a[l],e,i,r,n,o,s);return h}function gy(t,e,i,r,n,o,s){var a,h=t.type,l=dy[h];a="Point"===h||"MultiPoint"===h?l(t,i,r):l(t,e);var u=new B;u.setGeometry(dd(a,!1,s)),void 0!==t.id&&u.setId(t.id);var p=t.properties;return n&&(p||(p={}),p[n]=o),p&&u.setProperties(p),u}function yy(t,e,i){for(var r=0,n=0,o=0,s=t.length;o<s;++o){var a=t[o];r+=a[0],n+=a[1],a[0]=r,a[1]=n,vy(a,e,i)}}function vy(t,e,i){t[0]=t[0]*e[0]+i[0],t[1]=t[1]*e[1]+i[1]}var my=function(t){function e(e){t.call(this);var i=e||{};this.layerName_=i.layerName,this.layers_=i.layers?i.layers:null,this.dataProjection=Ee(i.dataProjection?i.dataProjection:"EPSG:4326")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var i,r=t,n=null,o=null;r.transform&&(n=(i=r.transform).scale,o=i.translate);var s=r.arcs;i&&function(t,e,i){for(var r=0,n=t.length;r<n;++r)yy(t[r],e,i)}(s,n,o);var a,h=[],l=r.objects,u=this.layerName_;for(var p in l)this.layers_&&-1==this.layers_.indexOf(p)||("GeometryCollection"===l[p].type?(a=l[p],h.push.apply(h,_y(a,s,n,o,u,p,e))):(a=l[p],h.push(gy(a,s,n,o,u,p,e))));return h}return[]},e.prototype.readProjectionFromObject=function(t){return this.dataProjection},e}(_d),xy=function(t){this.tagName_=t};xy.prototype.getTagName=function(){return this.tagName_};var Ey=xy,Sy=function(t){function e(e,i){t.call(this,e),this.conditions=i,Y(this.conditions.length>=2,57)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ey),Ty=function(t){function e(e){t.call(this,"And",Array.prototype.slice.call(arguments))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Sy),Cy=function(t){function e(e,i,r){t.call(this,"BBOX"),this.geometryName=e,this.extent=i,this.srsName=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ey),Ry=function(t){function e(e,i,r,n){t.call(this,e),this.geometryName=i||"the_geom",this.geometry=r,this.srsName=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ey),wy=function(t){function e(e,i,r){t.call(this,"Contains",e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ry),Iy=function(t){function e(e,i){t.call(this,e),this.propertyName=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ey),Ly=function(t){function e(e,i,r){t.call(this,"During",e),this.begin=i,this.end=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Iy),Oy=function(t){function e(e,i,r,n){t.call(this,e,i),this.expression=r,this.matchCase=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Iy),Py=function(t){function e(e,i,r){t.call(this,"PropertyIsEqualTo",e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oy),by=function(t){function e(e,i){t.call(this,"PropertyIsGreaterThan",e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oy),My=function(t){function e(e,i){t.call(this,"PropertyIsGreaterThanOrEqualTo",e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oy),Fy=function(t){function e(e,i,r){t.call(this,"Intersects",e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ry),Ay=function(t){function e(e,i,r){t.call(this,"PropertyIsBetween",e),this.lowerBoundary=i,this.upperBoundary=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Iy),Ny=function(t){function e(e,i,r,n,o,s){t.call(this,"PropertyIsLike",e),this.pattern=i,this.wildCard=void 0!==r?r:"*",this.singleChar=void 0!==n?n:".",this.escapeChar=void 0!==o?o:"!",this.matchCase=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Iy),Gy=function(t){function e(e){t.call(this,"PropertyIsNull",e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Iy),Dy=function(t){function e(e,i){t.call(this,"PropertyIsLessThan",e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oy),ky=function(t){function e(e,i){t.call(this,"PropertyIsLessThanOrEqualTo",e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oy),jy=function(t){function e(e){t.call(this,"Not"),this.condition=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ey),Uy=function(t){function e(e,i,r){t.call(this,"PropertyIsNotEqualTo",e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oy),Yy=function(t){function e(e){t.call(this,"Or",Array.prototype.slice.call(arguments))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Sy),By=function(t){function e(e,i,r){t.call(this,"Within",e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ry);function Vy(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Ty,e))}function Xy(t,e,i){return new Cy(t,e,i)}var zy={"http://www.opengis.net/gml":{boundedBy:hu(Id.prototype.readGeometryElement,"bounds")}},Wy={"http://www.opengis.net/wfs":{totalInserted:hu(Fd),totalUpdated:hu(Fd),totalDeleted:hu(Fd)}},Ky={"http://www.opengis.net/wfs":{TransactionSummary:hu(function(t,e){return gu({},Wy,t,e)},"transactionSummary"),InsertResults:hu(function(t,e){return gu([],ov,t,e)},"insertIds")}},Hy={"http://www.opengis.net/wfs":{PropertyName:lu(jd)}},Zy={"http://www.opengis.net/wfs":{Insert:lu(function(t,e,i){var r=i[i.length-1],n=r.featureType,o=r.featureNS,s=r.gmlVersion,a=tu(o,n);t.appendChild(a),2===s?Zd.prototype.writeFeatureElement(a,e,i):Vd.prototype.writeFeatureElement(a,e,i)}),Update:lu(function(t,e,i){var r=i[i.length-1];Y(void 0!==e.getId(),27);var n=r.featureType,o=r.featurePrefix,s=r.featureNS,a=av(o,n),h=e.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(Jy,"xmlns:"+o,s);var l=e.getId();if(void 0!==l){for(var u=e.getKeys(),p=[],c=0,d=u.length;c<d;c++){var f=e.get(u[c]);if(void 0!==f){var _=u[c];f&&"function"==typeof f.getSimplifiedGeometry&&(_=h),p.push({name:_,value:f})}}vu({gmlVersion:r.gmlVersion,node:t,hasZ:r.hasZ,srsName:r.srsName},Zy,pu("Property"),p,i),sv(t,l,i)}}),Delete:lu(function(t,e,i){var r=i[i.length-1];Y(void 0!==e.getId(),26);var n=r.featureType,o=r.featurePrefix,s=r.featureNS,a=av(o,n);t.setAttribute("typeName",a),t.setAttributeNS(Jy,"xmlns:"+o,s);var h=e.getId();void 0!==h&&sv(t,h,i)}),Property:lu(function(t,e,i){var r=tu($y,"Name"),n=i[i.length-1].gmlVersion;if(t.appendChild(r),jd(r,e.name),void 0!==e.value&&null!==e.value){var o=tu($y,"Value");t.appendChild(o),e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===n?Zd.prototype.writeGeometryElement(o,e.value,i):Vd.prototype.writeGeometryElement(o,e.value,i):jd(o,e.value)}}),Native:lu(function(t,e,i){e.vendorId&&t.setAttribute("vendorId",e.vendorId);void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore));void 0!==e.value&&jd(t,e.value)})}},qy="feature",Jy="http://www.w3.org/2000/xmlns/",Qy="http://www.opengis.net/ogc",$y="http://www.opengis.net/wfs",tv="http://www.opengis.net/fes",ev={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},iv="1.1.0",rv=function(t){function e(e){t.call(this);var i=e||{};this.featureType_=i.featureType,this.featureNS_=i.featureNS,this.gmlFormat_=i.gmlFormat?i.gmlFormat:new Vd,this.schemaLocation_=i.schemaLocation?i.schemaLocation:ev[iv]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var i={node:t};u(i,{featureType:this.featureType_,featureNS:this.featureNS_}),u(i,this.getReadOptions(t,e||{}));var r=[i];this.gmlFormat_.FEATURE_COLLECTION_PARSERS[Cd].featureMember=ou(Id.prototype.readFeaturesInternal);var n=gu([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,r,this.gmlFormat_);return n||(n=[]),n},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=ru(t);return this.readTransactionResponseFromDocument(e)}return iu(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=ru(t);return this.readFeatureCollectionMetadataFromDocument(e)}return iu(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},i=Ad(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=i,gu(e,zy,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return gu({},Ky,t,[])},e.prototype.writeGetFeature=function(t){var e,i=tu($y,"GetFeature");if(i.setAttribute("service","WFS"),i.setAttribute("version","1.1.0"),t&&(t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&i.setAttribute("count",String(t.count)),void 0!==t.viewParams&&i.setAttribute("viewParams ",t.viewParams),e=t.filter,t.bbox)){Y(t.geometryName,12);var r=Xy(t.geometryName,t.bbox,t.srsName);e=e?Vy(e,r):r}i.setAttributeNS($l,"xsi:schemaLocation",this.schemaLocation_);var n={node:i};return u(n,{srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]}),Y(Array.isArray(t.featureTypes),11),function(t,e,i){var r=i[i.length-1],n=u({},r);n.node=t,vu(n,hv,pu("Query"),e,i)}(i,t.featureTypes,[n]),i},e.prototype.writeTransaction=function(t,e,i,r){var n,o,s=[],a=tu($y,"Transaction"),h=r.version?r.version:iv,l="1.0.0"===h?2:3;a.setAttribute("service","WFS"),a.setAttribute("version",h),r&&(n=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle));var p=ev[h];a.setAttributeNS($l,"xsi:schemaLocation",p);var c=r.featurePrefix?r.featurePrefix:qy;return t&&(o=u({node:a},{featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,hasZ:r.hasZ,srsName:r.srsName}),u(o,n),vu(o,Zy,pu("Insert"),t,s)),e&&(o=u({node:a},{featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,hasZ:r.hasZ,srsName:r.srsName}),u(o,n),vu(o,Zy,pu("Update"),e,s)),i&&vu({node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,srsName:r.srsName},Zy,pu("Delete"),i,s),r.nativeElements&&vu({node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,srsName:r.srsName},Zy,pu("Native"),r.nativeElements,s),a},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var i=[{}];return this.gmlFormat_.readGeometryElement(e,i),Ee(i.pop().srsName)}return null},e}(Td);var nv={"http://www.opengis.net/ogc":{FeatureId:ou(function(t,e){return t.getAttribute("fid")})}};var ov={"http://www.opengis.net/wfs":{Feature:function(t,e){_u(nv,t,e)}}};function sv(t,e,i){var r=tu(Qy,"Filter"),n=tu(Qy,"FeatureId");r.appendChild(n),n.setAttribute("fid",e),t.appendChild(r)}function av(t,e){var i=(t=t||qy)+":";return 0===e.indexOf(i)?e:i+e}var hv={"http://www.opengis.net/wfs":{Query:lu(function(t,e,i){var r,n=i[i.length-1],o=n.featurePrefix,s=n.featureNS,a=n.propertyNames,h=n.srsName;r=o?av(o,e):e;t.setAttribute("typeName",r),h&&t.setAttribute("srsName",h);s&&t.setAttributeNS(Jy,"xmlns:"+o,s);var l=u({},n);l.node=t,vu(l,Hy,pu("PropertyName"),a,i);var p=n.filter;if(p){var c=tu(Qy,"Filter");t.appendChild(c),lv(c,p,i)}})},"http://www.opengis.net/ogc":{During:lu(function(t,e,i){var r=tu(tv,"ValueReference");jd(r,e.propertyName),t.appendChild(r);var n=tu(Cd,"TimePeriod");t.appendChild(n);var o=tu(Cd,"begin");n.appendChild(o),_v(o,e.begin);var s=tu(Cd,"end");n.appendChild(s),_v(s,e.end)}),And:lu(uv),Or:lu(uv),Not:lu(function(t,e,i){var r={node:t},n=e.condition;vu(r,hv,pu(n.getTagName()),[n],i)}),BBOX:lu(function(t,e,i){i[i.length-1].srsName=e.srsName,dv(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.extent,i)}),Contains:lu(function(t,e,i){i[i.length-1].srsName=e.srsName,dv(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.geometry,i)}),Intersects:lu(function(t,e,i){i[i.length-1].srsName=e.srsName,dv(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.geometry,i)}),Within:lu(function(t,e,i){i[i.length-1].srsName=e.srsName,dv(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.geometry,i)}),PropertyIsEqualTo:lu(pv),PropertyIsNotEqualTo:lu(pv),PropertyIsLessThan:lu(pv),PropertyIsLessThanOrEqualTo:lu(pv),PropertyIsGreaterThan:lu(pv),PropertyIsGreaterThanOrEqualTo:lu(pv),PropertyIsNull:lu(function(t,e,i){dv(t,e.propertyName)}),PropertyIsBetween:lu(function(t,e,i){dv(t,e.propertyName);var r=tu(Qy,"LowerBoundary");t.appendChild(r),fv(r,""+e.lowerBoundary);var n=tu(Qy,"UpperBoundary");t.appendChild(n),fv(n,""+e.upperBoundary)}),PropertyIsLike:lu(function(t,e,i){t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());dv(t,e.propertyName),fv(t,""+e.pattern)})}};function lv(t,e,i){vu({node:t},hv,pu(e.getTagName()),[e],i)}function uv(t,e,i){for(var r={node:t},n=e.conditions,o=0,s=n.length;o<s;++o){var a=n[o];vu(r,hv,pu(a.getTagName()),[a],i)}}function pv(t,e,i){void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),dv(t,e.propertyName),fv(t,""+e.expression)}function cv(t,e,i){var r=tu(Qy,t);jd(r,i),e.appendChild(r)}function dv(t,e){cv("PropertyName",t,e)}function fv(t,e){cv("Literal",t,e)}function _v(t,e){var i=tu(Cd,"TimeInstant");t.appendChild(i);var r=tu(Cd,"timePosition");i.appendChild(r),jd(r,e)}var gv=rv,yv={POINT:ci,LINESTRING:hr,POLYGON:Ii,MULTIPOINT:bc,MULTILINESTRING:Pc,MULTIPOLYGON:Fc},vv="EMPTY",mv="Z",xv="M",Ev=1,Sv=2,Tv=3,Cv=4,Rv=5,wv=6,Iv={};for(var Lv in Nt)Iv[Lv]=Nt[Lv].toUpperCase();var Ov=function(t){this.wkt=t,this.index_=-1};Ov.prototype.isAlpha_=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},Ov.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},Ov.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},Ov.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},Ov.prototype.nextToken=function(){var t,e=this.nextChar_(),i=this.index_,r=e;if("("==e)t=Sv;else if(","==e)t=Rv;else if(")"==e)t=Tv;else if(this.isNumeric_(e)||"-"==e)t=Cv,r=this.readNumber_();else if(this.isAlpha_(e))t=Ev,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=wv}return{position:i,value:r,type:t}},Ov.prototype.readNumber_=function(){var t,e=this.index_,i=!1,r=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_()}while(this.isNumeric_(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},Ov.prototype.readText_=function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()};var Pv=function(t){this.lexer_=t,this.token_,this.layout_=At.XY};function bv(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function Mv(t){for(var e=t.getCoordinates(),i=[],r=0,n=e.length;r<n;++r)i.push(e[r].join(" "));return i.join(",")}function Fv(t){for(var e=[],i=t.getLinearRings(),r=0,n=i.length;r<n;++r)e.push("("+Mv(i[r])+")");return e.join(",")}Pv.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},Pv.prototype.isTokenType=function(t){return this.token_.type==t},Pv.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},Pv.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},Pv.prototype.parseGeometryLayout_=function(){var t=At.XY,e=this.token_;if(this.isTokenType(Ev)){var i=e.value;i===mv?t=At.XYZ:i===xv?t=At.XYM:"ZM"===i&&(t=At.XYZM),t!==At.XY&&this.consume_()}return t},Pv.prototype.parseGeometryCollectionText_=function(){if(this.match(Sv)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(Rv));if(this.match(Tv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Pv.prototype.parsePointText_=function(){if(this.match(Sv)){var t=this.parsePoint_();if(this.match(Tv))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},Pv.prototype.parseLineStringText_=function(){if(this.match(Sv)){var t=this.parsePointList_();if(this.match(Tv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Pv.prototype.parsePolygonText_=function(){if(this.match(Sv)){var t=this.parseLineStringTextList_();if(this.match(Tv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Pv.prototype.parseMultiPointText_=function(){var t;if(this.match(Sv)){if(t=this.token_.type==Sv?this.parsePointTextList_():this.parsePointList_(),this.match(Tv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Pv.prototype.parseMultiLineStringText_=function(){if(this.match(Sv)){var t=this.parseLineStringTextList_();if(this.match(Tv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Pv.prototype.parseMultiPolygonText_=function(){if(this.match(Sv)){var t=this.parsePolygonTextList_();if(this.match(Tv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Pv.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,i=0;i<e;++i){var r=this.token_;if(!this.match(Cv))break;t.push(r.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())},Pv.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(Rv);)t.push(this.parsePoint_());return t},Pv.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(Rv);)t.push(this.parsePointText_());return t},Pv.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(Rv);)t.push(this.parseLineStringText_());return t},Pv.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(Rv);)t.push(this.parsePolygonText_());return t},Pv.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(Ev)&&this.token_.value==vv;return t&&this.consume_(),t},Pv.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},Pv.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(Ev)){var e=t.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==e){var i=this.parseGeometryCollectionText_();return new ud(i)}var r,n=yv[e];if(!n)throw new Error("Invalid geometry type: "+e);switch(e){case"POINT":r=this.parsePointText_();break;case"LINESTRING":r=this.parseLineStringText_();break;case"POLYGON":r=this.parsePolygonText_();break;case"MULTIPOINT":r=this.parseMultiPointText_();break;case"MULTILINESTRING":r=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":r=this.parseMultiPolygonText_();break;default:throw new Error("Invalid geometry type: "+e)}return r||(r=n===yv.POINT?[NaN,NaN]:[]),new n(r,this.layout_)}throw new Error(this.formatErrorMessage_())};var Av={Point:bv,LineString:Mv,Polygon:Fv,MultiPoint:function(t){for(var e=[],i=t.getPoints(),r=0,n=i.length;r<n;++r)e.push("("+bv(i[r])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],i=t.getLineStrings(),r=0,n=i.length;r<n;++r)e.push("("+Mv(i[r])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],i=t.getPolygons(),r=0,n=i.length;r<n;++r)e.push("("+Fv(i[r])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],i=t.getGeometries(),r=0,n=i.length;r<n;++r)e.push(Nv(i[r]));return e.join(",")}};function Nv(t){var e=t.getType(),i=(0,Av[e])(t);if(e=e.toUpperCase(),"function"==typeof t.getFlatCoordinates){var r=function(t){var e=t.getLayout(),i="";return e!==At.XYZ&&e!==At.XYZM||(i+=mv),e!==At.XYM&&e!==At.XYZM||(i+=xv),i}(t);r.length>0&&(e+=" "+r)}return 0===i.length?e+" "+vv:e+"("+i+")"}var Gv=function(t){function e(e){t.call(this);var i=e||{};this.splitCollection_=void 0!==i.splitCollection&&i.splitCollection}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parse_=function(t){var e=new Ov(t);return new Pv(e).parse()},e.prototype.readFeatureFromText=function(t,e){var i=this.readGeometryFromText(t,e);if(i){var r=new B;return r.setGeometry(i),r}return null},e.prototype.readFeaturesFromText=function(t,e){for(var i=[],r=this.readGeometryFromText(t,e),n=[],o=0,s=(i=this.splitCollection_&&r.getType()==Nt.GEOMETRY_COLLECTION?r.getGeometriesArray():[r]).length;o<s;++o){var a=new B;a.setGeometry(i[o]),n.push(a)}return n},e.prototype.readGeometryFromText=function(t,e){var i=this.parse_(t);return i?dd(i,!1,e):null},e.prototype.writeFeatureText=function(t,e){var i=t.getGeometry();return i?this.writeGeometryText(i,e):""},e.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(t[r].getGeometry());var o=new ud(i);return this.writeGeometryText(o,e)},e.prototype.writeGeometryText=function(t,e){return Nv(dd(t,!0,e))},e}(zf),Dv="http://www.w3.org/1999/xlink";function kv(t){return t.getAttributeNS(Dv,"href")}var jv=function(){};jv.prototype.read=function(t){if(t){if("string"==typeof t){var e=ru(t);return this.readFromDocument(e)}return iu(t)?this.readFromDocument(t):this.readFromNode(t)}return null},jv.prototype.readFromDocument=function(t){},jv.prototype.readFromNode=function(t){};var Uv=jv,Yv=[null,"http://www.opengis.net/wms"],Bv=fu(Yv,{Service:hu(function(t,e){return gu({},zv,t,e)}),Capability:hu(function(t,e){return gu({},Vv,t,e)})}),Vv=fu(Yv,{Request:hu(function(t,e){return gu({},$v,t,e)}),Exception:hu(function(t,e){return gu([],Zv,t,e)}),Layer:hu(function(t,e){return gu({},qv,t,e)})}),Xv=function(t){function e(){t.call(this),this.version=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=gu({version:this.version},Bv,t,[]);return e||null},e}(Uv),zv=fu(Yv,{Name:hu(Nd),Title:hu(Nd),Abstract:hu(Nd),KeywordList:hu(lm),OnlineResource:hu(kv),ContactInformation:hu(function(t,e){return gu({},Wv,t,e)}),Fees:hu(Nd),AccessConstraints:hu(Nd),LayerLimit:hu(Fd),MaxWidth:hu(Fd),MaxHeight:hu(Fd)}),Wv=fu(Yv,{ContactPersonPrimary:hu(function(t,e){return gu({},Kv,t,e)}),ContactPosition:hu(Nd),ContactAddress:hu(function(t,e){return gu({},Hv,t,e)}),ContactVoiceTelephone:hu(Nd),ContactFacsimileTelephone:hu(Nd),ContactElectronicMailAddress:hu(Nd)}),Kv=fu(Yv,{ContactPerson:hu(Nd),ContactOrganization:hu(Nd)}),Hv=fu(Yv,{AddressType:hu(Nd),Address:hu(Nd),City:hu(Nd),StateOrProvince:hu(Nd),PostCode:hu(Nd),Country:hu(Nd)}),Zv=fu(Yv,{Format:ou(Nd)}),qv=fu(Yv,{Name:hu(Nd),Title:hu(Nd),Abstract:hu(Nd),KeywordList:hu(lm),CRS:au(Nd),EX_GeographicBoundingBox:hu(function(t,e){var i=gu({},Qv,t,e);if(!i)return;var r=i.westBoundLongitude,n=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===n||void 0===o||void 0===s)return;return[r,n,o,s]}),BoundingBox:au(function(t,e){var i=[Md(t.getAttribute("minx")),Md(t.getAttribute("miny")),Md(t.getAttribute("maxx")),Md(t.getAttribute("maxy"))],r=[Md(t.getAttribute("resx")),Md(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}}),Dimension:au(function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Od(t.getAttribute("multipleValues")),nearestValue:Od(t.getAttribute("nearestValue")),current:Od(t.getAttribute("current")),values:Nd(t)}}),Attribution:hu(function(t,e){return gu({},Jv,t,e)}),AuthorityURL:au(function(t,e){var i=sm(t,e);if(i)return i.name=t.getAttribute("name"),i;return}),Identifier:au(Nd),MetadataURL:au(function(t,e){var i=sm(t,e);if(i)return i.type=t.getAttribute("type"),i;return}),DataURL:au(sm),FeatureListURL:au(sm),Style:au(function(t,e){return gu({},rm,t,e)}),MinScaleDenominator:hu(bd),MaxScaleDenominator:hu(bd),Layer:au(function(t,e){var i=e[e.length-1],r=gu({},qv,t,e);if(!r)return;var n=Od(t.getAttribute("queryable"));void 0===n&&(n=i.queryable);r.queryable=void 0!==n&&n;var o=Ad(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded);r.cascaded=o;var s=Od(t.getAttribute("opaque"));void 0===s&&(s=i.opaque);r.opaque=void 0!==s&&s;var a=Od(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets);r.noSubsets=void 0!==a&&a;var h=Md(t.getAttribute("fixedWidth"));h||(h=i.fixedWidth);r.fixedWidth=h;var l=Md(t.getAttribute("fixedHeight"));l||(l=i.fixedHeight);r.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach(function(t){if(t in i){var e=r[t]||[];r[t]=e.concat(i[t])}});return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(t){if(!(t in r)){var e=i[t];r[t]=e}}),r})}),Jv=fu(Yv,{Title:hu(Nd),OnlineResource:hu(kv),LogoURL:hu(hm)}),Qv=fu(Yv,{westBoundLongitude:hu(bd),eastBoundLongitude:hu(bd),southBoundLatitude:hu(bd),northBoundLatitude:hu(bd)}),$v=fu(Yv,{GetCapabilities:hu(am),GetMap:hu(am),GetFeatureInfo:hu(am)}),tm=fu(Yv,{Format:au(Nd),DCPType:au(function(t,e){return gu({},em,t,e)})}),em=fu(Yv,{HTTP:hu(function(t,e){return gu({},im,t,e)})}),im=fu(Yv,{Get:hu(sm),Post:hu(sm)}),rm=fu(Yv,{Name:hu(Nd),Title:hu(Nd),Abstract:hu(Nd),LegendURL:au(hm),StyleSheetURL:hu(sm),StyleURL:hu(sm)}),nm=fu(Yv,{Format:hu(Nd),OnlineResource:hu(kv)}),om=fu(Yv,{Keyword:ou(Nd)});function sm(t,e){return gu({},nm,t,e)}function am(t,e){return gu({},tm,t,e)}function hm(t,e){var i=sm(t,e);if(i){var r=[Ad(t.getAttribute("width")),Ad(t.getAttribute("height"))];return i.size=r,i}}function lm(t,e){return gu([],om,t,e)}var um=Xv,pm=function(t){function e(e){t.call(this);var i=e||{};this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new Zd,this.layers_=i.layers?i.layers:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var n=0,o=t.childNodes.length;n<o;n++){var s=t.childNodes[n];if(s.nodeType===Node.ELEMENT_NODE){var a=s,h=e[0],l=a.localName.replace("_layer","");if(!this.layers_||X(this.layers_,l)){var u=l+"_feature";h.featureType=u,h.featureNS=this.featureNS_;var p={};p[u]=ou(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var c=fu([h.featureNS,null],p);a.setAttribute("namespaceURI",this.featureNS_);var d=gu([],c,a,e,this.gmlFormat_);d&&K(r,d)}}}if("FeatureCollection"==i){var f=gu([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);f&&(r=f)}return r},e.prototype.readFeaturesFromNode=function(t,e){var i={};return e&&u(i,this.getReadOptions(t,e)),this.readFeatures_(t,[i])},e}(Td),cm=[null,"http://www.opengis.net/ows/1.1"],dm=fu(cm,{ServiceIdentification:hu(function(t,e){return gu({},wm,t,e)}),ServiceProvider:hu(function(t,e){return gu({},Im,t,e)}),OperationsMetadata:hu(function(t,e){return gu({},Sm,t,e)})}),fm=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=gu({},dm,t,[]);return e||null},e}(Uv),_m=fu(cm,{DeliveryPoint:hu(Nd),City:hu(Nd),AdministrativeArea:hu(Nd),PostalCode:hu(Nd),Country:hu(Nd),ElectronicMailAddress:hu(Nd)}),gm=fu(cm,{Value:au(function(t,e){return Nd(t)})}),ym=fu(cm,{AllowedValues:hu(function(t,e){return gu({},gm,t,e)})}),vm=fu(cm,{Phone:hu(function(t,e){return gu({},Tm,t,e)}),Address:hu(function(t,e){return gu({},_m,t,e)})}),mm=fu(cm,{HTTP:hu(function(t,e){return gu({},xm,t,e)})}),xm=fu(cm,{Get:au(function(t,e){var i=kv(t);if(!i)return;return gu({href:i},Cm,t,e)}),Post:void 0}),Em=fu(cm,{DCP:hu(function(t,e){return gu({},mm,t,e)})}),Sm=fu(cm,{Operation:function(t,e){var i=t.getAttribute("name"),r=gu({},Em,t,e);if(!r)return;e[e.length-1][i]=r}}),Tm=fu(cm,{Voice:hu(Nd),Facsimile:hu(Nd)}),Cm=fu(cm,{Constraint:au(function(t,e){var i=t.getAttribute("name");if(!i)return;return gu({name:i},ym,t,e)})}),Rm=fu(cm,{IndividualName:hu(Nd),PositionName:hu(Nd),ContactInfo:hu(function(t,e){return gu({},vm,t,e)})}),wm=fu(cm,{Abstract:hu(Nd),AccessConstraints:hu(Nd),Fees:hu(Nd),Title:hu(Nd),ServiceTypeVersion:hu(Nd),ServiceType:hu(Nd)}),Im=fu(cm,{ProviderName:hu(Nd),ProviderSite:hu(kv),ServiceContact:hu(function(t,e){return gu({},Rm,t,e)})});var Lm=fm,Om=[null,"http://www.opengis.net/wmts/1.0"],Pm=[null,"http://www.opengis.net/ows/1.1"],bm=fu(Om,{Contents:hu(function(t,e){return gu({},Fm,t,e)})}),Mm=function(t){function e(){t.call(this),this.owsParser_=new Lm}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=t.getAttribute("version").trim(),i=this.owsParser_.readFromNode(t);return i?(i.version=e,(i=gu(i,bm,t,[]))||null):null},e}(Uv),Fm=fu(Om,{Layer:au(function(t,e){return gu({},Am,t,e)}),TileMatrixSet:au(function(t,e){return gu({},Ym,t,e)})}),Am=fu(Om,{Style:au(function(t,e){var i=gu({},Nm,t,e);if(!i)return;var r="true"===t.getAttribute("isDefault");return i.isDefault=r,i}),Format:au(Nd),TileMatrixSetLink:au(function(t,e){return gu({},Gm,t,e)}),Dimension:au(function(t,e){return gu({},jm,t,e)}),ResourceURL:au(function(t,e){var i=t.getAttribute("format"),r=t.getAttribute("template"),n=t.getAttribute("resourceType"),o={};i&&(o.format=i);r&&(o.template=r);n&&(o.resourceType=n);return o})},fu(Pm,{Title:hu(Nd),Abstract:hu(Nd),WGS84BoundingBox:hu(function(t,e){var i=gu([],Um,t,e);if(2!=i.length)return;return tt(i)}),Identifier:hu(Nd)})),Nm=fu(Om,{LegendURL:au(function(t,e){var i={};return i.format=t.getAttribute("format"),i.href=kv(t),i})},fu(Pm,{Title:hu(Nd),Identifier:hu(Nd)})),Gm=fu(Om,{TileMatrixSet:hu(Nd),TileMatrixSetLimits:hu(function(t,e){return gu([],Dm,t,e)})}),Dm=fu(Om,{TileMatrixLimits:ou(function(t,e){return gu({},km,t,e)})}),km=fu(Om,{TileMatrix:hu(Nd),MinTileRow:hu(Fd),MaxTileRow:hu(Fd),MinTileCol:hu(Fd),MaxTileCol:hu(Fd)}),jm=fu(Om,{Default:hu(Nd),Value:au(Nd)},fu(Pm,{Identifier:hu(Nd)})),Um=fu(Pm,{LowerCorner:ou(Vm),UpperCorner:ou(Vm)}),Ym=fu(Om,{WellKnownScaleSet:hu(Nd),TileMatrix:au(function(t,e){return gu({},Bm,t,e)})},fu(Pm,{SupportedCRS:hu(Nd),Identifier:hu(Nd)})),Bm=fu(Om,{TopLeftCorner:hu(Vm),ScaleDenominator:hu(bd),TileWidth:hu(Fd),TileHeight:hu(Fd),MatrixWidth:hu(Fd),MatrixHeight:hu(Fd)},fu(Pm,{Identifier:hu(Nd)}));function Vm(t,e){var i=Nd(t).split(/\s+/);if(i&&2==i.length){var r=+i[0],n=+i[1];if(!isNaN(r)&&!isNaN(n))return[r,n]}}var Xm=Mm,zm=function(){var t;return function(){if(!t){var e=document.body;e.webkitRequestFullscreen?t="webkitfullscreenchange":e.mozRequestFullScreen?t="mozfullscreenchange":e.msRequestFullscreen?t="MSFullscreenChange":e.requestFullscreen&&(t="fullscreenchange")}return t}}();function Wm(){var t=document.body;return!!(t.webkitRequestFullscreen||t.mozRequestFullScreen&&document.mozFullScreenEnabled||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function Km(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function Hm(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var Zm=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target}),this.cssClassName_=void 0!==i.className?i.className:"ol-full-screen";var r=void 0!==i.label?i.label:"⤢";this.labelNode_="string"==typeof r?document.createTextNode(r):r;var n=void 0!==i.labelActive?i.labelActive:"×";this.labelActiveNode_="string"==typeof n?document.createTextNode(n):n,this.button_=document.createElement("button");var o=i.tipLabel?i.tipLabel:"Toggle full-screen";this.setClassName_(this.button_,Km()),this.button_.setAttribute("type","button"),this.button_.title=o,this.button_.appendChild(this.labelNode_),v(this.button_,M.CLICK,this.handleClick_,this);var s=this.cssClassName_+" "+fo+" "+go+" "+(Wm()?"":_o),a=this.element;a.className=s,a.appendChild(this.button_),this.keys_=void 0!==i.keys&&i.keys,this.source_=i.source}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},e.prototype.handleFullScreen_=function(){if(Wm()){var t,e=this.getMap();if(e)if(Km())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?function(t){t.mozRequestFullScreenWithKeys?t.mozRequestFullScreenWithKeys():t.webkitRequestFullscreen?t.webkitRequestFullscreen():Hm(t)}(t):Hm(t)}},e.prototype.handleFullScreenChange_=function(){var t=this.getMap();Km()?(this.setClassName_(this.button_,!0),Qn(this.labelActiveNode_,this.labelNode_)):(this.setClassName_(this.button_,!1),Qn(this.labelNode_,this.labelActiveNode_)),t&&t.updateSize()},e.prototype.setClassName_=function(t,e){var i=this.cssClassName_+"-true",r=this.cssClassName_+"-false",n=e?i:r;t.classList.remove(i),t.classList.remove(r),t.classList.add(n)},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&this.listenerKeys.push(v(document,zm(),this.handleFullScreenChange_,this))},e}(uo),qm="projection";function Jm(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}var Qm=function(t){function e(e){var i=e||{},r=document.createElement("div");r.className=void 0!==i.className?i.className:"ol-mouse-position",t.call(this,{element:r,render:i.render||Jm,target:i.target}),v(this,G(qm),this.handleProjectionChanged_,this),i.coordinateFormat&&this.setCoordinateFormat(i.coordinateFormat),i.projection&&this.setProjection(i.projection),this.undefinedHTML_=void 0!==i.undefinedHTML?i.undefinedHTML:"&#160;",this.renderOnMouseOut_=!!this.undefinedHTML_,this.renderedHTML_=r.innerHTML,this.mapProjection_=null,this.transform_=null,this.lastMouseMovePixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},e.prototype.getProjection=function(){return this.get(qm)},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.lastMouseMovePixel_=e.getEventPixel(t),this.updateHTML_(this.lastMouseMovePixel_)},e.prototype.handleMouseOut=function(t){this.updateHTML_(null),this.lastMouseMovePixel_=null},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var i=e.getViewport();this.listenerKeys.push(v(i,M.MOUSEMOVE,this.handleMouseMove,this),v(i,M.TOUCHSTART,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(v(i,M.MOUSEOUT,this.handleMouseOut,this),v(i,M.TOUCHEND,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set("coordinateFormat",t)},e.prototype.setProjection=function(t){this.set(qm,Ee(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var i=this.getProjection();this.transform_=i?Le(this.mapProjection_,i):me}var r=this.getMap().getCoordinateFromPixel(t);if(r){this.transform_(r,r);var n=this.getCoordinateFormat();e=n?n(r):r.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e}(uo);function $m(t){this.validateExtent_(),this.updateBox_()}var tx=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||$m,target:i.target}),this.collapsed_=void 0===i.collapsed||i.collapsed,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var r=void 0!==i.className?i.className:"ol-overviewmap",n=void 0!==i.tipLabel?i.tipLabel:"Overview map",o=void 0!==i.collapseLabel?i.collapseLabel:"«";"string"==typeof o?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o):this.collapseLabel_=o;var s=void 0!==i.label?i.label:"»";"string"==typeof s?(this.label_=document.createElement("span"),this.label_.textContent=s):this.label_=s;var a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=n,h.appendChild(a),v(h,M.CLICK,this.handleClick_,this),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.ovmap_=new Ha({controls:new U,interactions:new U,view:i.view});var l=this.ovmap_;i.layers&&i.layers.forEach(function(t){l.addLayer(t)}.bind(this));var u=document.createElement("div");u.className="ol-overviewmap-box",u.style.boxSizing="border-box",this.boxOverlay_=new Ja({position:[0,0],positioning:Za.BOTTOM_LEFT,element:u}),this.ovmap_.addOverlay(this.boxOverlay_);var p=r+" "+fo+" "+go+(this.collapsed_&&this.collapsible_?" "+yo:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=p,c.appendChild(this.ovmapDiv_),c.appendChild(h);var d=this,f=this.boxOverlay_,_=this.boxOverlay_.getElement(),g=function(t){var e=function(t){return{clientX:t.clientX-_.offsetWidth/2,clientY:t.clientY+_.offsetHeight/2}}(t),i=l.getEventCoordinate(e);f.setPosition(i)},y=function(t){var e=l.getEventCoordinate(t);d.getMap().getView().setCenter(e),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",y)};_.addEventListener("mousedown",function(){window.addEventListener("mousemove",g),window.addEventListener("mouseup",y)})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){var i=this.getMap();if(e!==i){if(i){var r=i.getView();r&&this.unbindView_(r),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(v(e,l,this.handleMapPropertyChange_,this)),0===this.ovmap_.getLayers().getLength()&&this.ovmap_.setLayerGroup(e.getLayerGroup());var n=e.getView();n&&(this.bindView_(n),n.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===Ln.VIEW){var e=t.oldValue;e&&this.unbindView_(e);var i=this.getMap().getView();this.bindView_(i)}},e.prototype.bindView_=function(t){v(t,G(Bn),this.handleRotationChanged_,this)},e.prototype.unbindView_=function(t){x(t,G(Bn),this.handleRotationChanged_,this)},e.prototype.handleRotationChanged_=function(){this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),r=t.getView().calculateExtent(i),n=e.getSize(),o=e.getView().calculateExtent(n),s=e.getPixelFromCoordinate(It(r)),a=e.getPixelFromCoordinate(St(r)),h=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),u=n[0],p=n[1];h<.1*u||l<.1*p||h>.75*u||l>.75*p?this.resetExtent_():ot(o,r)||this.recenter_()}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getSize(),r=t.getView().calculateExtent(i),n=e.getView(),o=Math.log(7.5)/Math.LN2;Mt(r,1/(.1*Math.pow(2,o/2))),n.fit(r)},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenter(i.getCenter())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),r=t.getView(),n=e.getView(),o=r.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),h=r.calculateExtent(i),l=n.getResolution(),u=Et(h),p=Lt(h),c=this.calculateCoordinateRotate_(o,u);s.setPosition(c),a&&(a.style.width=Math.abs((u[0]-p[0])/l)+"px",a.style.height=Math.abs((p[1]-u[1])/l)+"px")}},e.prototype.calculateCoordinateRotate_=function(t,e){var i,r=this.getMap().getView().getCenter();return r&&($i(i=[e[0]-r[0],e[1]-r[1]],t),Hi(i,r)),i},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(yo),this.collapsed_?Qn(this.collapseLabel_,this.label_):Qn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;this.collapsed_||t.isRendered()||(t.updateSize(),this.resetExtent_(),m(t,Rn,function(t){this.updateBox_()},this))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getOverviewMap=function(){return this.ovmap_},e}(uo),ex="units",ix={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},rx=[1,2,5];function nx(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}var ox=function(t){function e(e){var i=e||{},r=void 0!==i.className?i.className:"ol-scale-line";t.call(this,{element:document.createElement("div"),render:i.render||nx,target:i.target}),this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+fo,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==i.minWidth?i.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",v(this,G(ex),this.handleUnitsChanged_,this),this.setUnits(i.units||ix.METRIC)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getUnits=function(){return this.get(ex)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(ex,t)},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,r=this.getUnits(),n=r==ix.DEGREES?$t.DEGREES:$t.METERS,o=Se(i,t.resolution,e,n);i.getUnits()!=$t.DEGREES&&i.getMetersPerUnit()&&n==$t.METERS&&(o*=i.getMetersPerUnit());var s=this.minWidth_*o,a="";if(r==ix.DEGREES){var h=Qt[$t.DEGREES];i.getUnits()==$t.DEGREES?s*=h:o/=h,s<h/60?(a="″",o*=3600):s<h?(a="′",o*=60):a="°"}else r==ix.IMPERIAL?s<.9144?(a="in",o/=.0254):s<1609.344?(a="ft",o/=.3048):(a="mi",o/=1609.344):r==ix.NAUTICAL?(o/=1852,a="nm"):r==ix.METRIC?s<.001?(a="μm",o*=1e6):s<1?(a="mm",o*=1e3):s<1e3?a="m":(a="km",o/=1e3):r==ix.US?s<.9144?(a="in",o*=39.37):s<1609.344?(a="ft",o/=.30480061):(a="mi",o/=1609.3472):Y(!1,33);for(var l,u,p=3*Math.floor(Math.log(this.minWidth_*o)/Math.log(10));;){if(l=rx[(p%3+3)%3]*Math.pow(10,Math.floor(p/3)),u=Math.round(l/o),isNaN(u))return this.element.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++p}var c=l+" "+a;this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e}(uo),sx={VERTICAL:0,HORIZONTAL:1};function ax(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;e!==this.currentResolution_&&(this.currentResolution_=e,this.setThumbPosition_(e))}}var hx=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||ax}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=sx.VERTICAL,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.previousX_,this.previousY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==i.duration?i.duration:200;var r=void 0!==i.className?i.className:"ol-zoomslider",n=document.createElement("button");n.setAttribute("type","button"),n.className=r+"-thumb "+fo;var o=this.element;o.className=r+" "+fo+" "+go,o.appendChild(n),this.dragger_=new Tn(o),v(this.dragger_,Gr.POINTERDOWN,this.handleDraggerStart_,this),v(this.dragger_,Gr.POINTERMOVE,this.handleDraggerDrag_,this),v(this.dragger_,Gr.POINTERUP,this.handleDraggerEnd_,this),v(o,M.CLICK,this.handleContainerClick_,this),v(n,M.CLICK,O)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.dragger_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight,r=t.firstElementChild,n=getComputedStyle(r),o=r.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=r.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);this.thumbSize_=[o,s],e>i?(this.direction_=sx.HORIZONTAL,this.widthLimit_=e-o):(this.direction_=sx.VERTICAL,this.heightLimit_=i-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i);e.animate({resolution:e.constrainResolution(r),duration:this.duration_,easing:Xn})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.originalEvent.target===this.element.firstElementChild&&(this.getMap().getView().setHint(jn,1),this.previousX_=t.clientX,this.previousY_=t.clientY,this.dragging_=!0,0===this.dragListenerKeys_.length)){var e=this.handleDraggerDrag_,i=this.handleDraggerEnd_;this.dragListenerKeys_.push(v(document,M.MOUSEMOVE,e,this),v(document,Gr.POINTERMOVE,e,this),v(document,M.MOUSEUP,i,this),v(document,Gr.POINTERUP,i,this))}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=this.element.firstElementChild,i=t.clientX-this.previousX_+parseFloat(e.style.left),r=t.clientY-this.previousY_+parseFloat(e.style.top),n=this.getRelativePosition_(i,r);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_),this.setThumbPosition_(this.currentResolution_),this.previousX_=t.clientX,this.previousY_=t.clientY}},e.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.setHint(jn,-1),e.animate({resolution:e.constrainResolution(this.currentResolution_),duration:this.duration_,easing:Xn}),this.dragging_=!1,this.previousX_=void 0,this.previousY_=void 0,this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0}},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==sx.HORIZONTAL?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return kt(this.direction_===sx.HORIZONTAL?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return 1-this.getMap().getView().getValueForResolutionFunction()(t)},e}(uo),lx=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target}),this.extent=i.extent?i.extent:null;var r=void 0!==i.className?i.className:"ol-zoom-extent",n=void 0!==i.label?i.label:"E",o=void 0!==i.tipLabel?i.tipLabel:"Fit to extent",s=document.createElement("button");s.setAttribute("type","button"),s.title=o,s.appendChild("string"==typeof n?document.createTextNode(n):n),v(s,M.CLICK,this.handleClick_,this);var a=r+" "+fo+" "+go,h=this.element;h.className=a,h.appendChild(s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fit(e)},e}(uo),ux={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};ux.events.condition={},ux.extent={},ux.featureloader={},ux.format={},ux.format.filter={},ux.geom={},ux.has={},ux.interaction={},ux.layer={},ux.loadingstrategy={},ux.proj={},ux.proj.Units={},ux.proj.proj4={},ux.render={},ux.render.canvas={},ux.renderer={},ux.renderer.canvas={},ux.renderer.webgl={},ux.size={},ux.source={},ux.sphere={},ux.style={},ux.style.IconImageCache={},ux.tilegrid={},ux.xml={},ux.Collection=U,ux.Feature=B,ux.Geolocation=zi,ux.Graticule=Or,ux.Kinetic=br,ux.Map=Ha,ux.Object=D,ux.Observable=F,ux.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)E(t[e]);else E(t)},ux.Overlay=Ja,ux.PluggableMap=lo,ux.View=qn,ux.WebGLMap=Kl,ux.array.stableSort=q,ux.color.asArray=_r,ux.color.asString=dr,ux.colorlike.asColorLike=Ys,ux.control.Attribution=So,ux.control.Attribution.render=Eo,ux.control.Control=uo,ux.control.FullScreen=Zm,ux.control.MousePosition=Qm,ux.control.MousePosition.render=Jm,ux.control.OverviewMap=tx,ux.control.OverviewMap.render=$m,ux.control.Rotate=Co,ux.control.Rotate.render=To,ux.control.ScaleLine=ox,ux.control.ScaleLine.render=nx,ux.control.Zoom=Ro,ux.control.ZoomSlider=hx,ux.control.ZoomSlider.render=ax,ux.control.ZoomToExtent=lx,ux.control.defaults=wo,ux.coordinate.add=Hi,ux.coordinate.createStringXY=function(t){return function(e){return nr(e,t)}},ux.coordinate.format=Ji,ux.coordinate.rotate=$i,ux.coordinate.toStringHDMS=function(t,e){return t?qi("NS",t[1],e)+" "+qi("EW",t[0],e):""},ux.coordinate.toStringXY=nr,ux.easing.easeIn=Vn,ux.easing.easeOut=Xn,ux.easing.inAndOut=zn,ux.easing.linear=Wn,ux.easing.upAndDown=function(t){return t<.5?zn(2*t):1-zn(2*(t-.5))},ux.events.condition.altKeyOnly=Go,ux.events.condition.altShiftKeysOnly=Do,ux.events.condition.always=jo,ux.events.condition.click=function(t){return t.type==Ar.CLICK},ux.events.condition.doubleClick=function(t){return t.type==Ar.DBLCLICK},ux.events.condition.focus=ko,ux.events.condition.mouseOnly=Ko,ux.events.condition.never=Yo,ux.events.condition.noModifierKeys=Xo,ux.events.condition.platformModifierKeyOnly=function(t){var e=t.originalEvent;return!e.altKey&&(Gi?e.metaKey:e.ctrlKey)&&!e.shiftKey},ux.events.condition.pointerMove=Bo,ux.events.condition.primaryAction=Ho,ux.events.condition.shiftKeyOnly=zo,ux.events.condition.singleClick=Vo,ux.events.condition.targetNotEditable=Wo,ux.extent.applyTransform=Ft,ux.extent.boundingExtent=tt,ux.extent.buffer=et,ux.extent.containsCoordinate=nt,ux.extent.containsExtent=ot,ux.extent.containsXY=st,ux.extent.createEmpty=ht,ux.extent.equals=dt,ux.extent.extend=ft,ux.extent.getArea=xt,ux.extent.getBottomLeft=Et,ux.extent.getBottomRight=St,ux.extent.getCenter=Tt,ux.extent.getHeight=Rt,ux.extent.getIntersection=wt,ux.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},ux.extent.getTopLeft=It,ux.extent.getTopRight=Lt,ux.extent.getWidth=Ot,ux.extent.intersects=Pt,ux.extent.isEmpty=bt,ux.featureloader.xhr=ql,ux.format.EsriJSON=Sd,ux.format.Feature=cd,ux.format.GML=zd,ux.format.GML2=Zd,ux.format.GML3=Vd,ux.format.GML32=Jd,ux.format.GPX=Ff,ux.format.GeoJSON=Gf,ux.format.IGC=Jf,ux.format.KML=Bg,ux.format.MVT=Qg,ux.format.OSMXML=oy,ux.format.Polyline=cy,ux.format.Polyline.decodeDeltas=hy,ux.format.Polyline.decodeFloats=uy,ux.format.Polyline.encodeDeltas=ay,ux.format.Polyline.encodeFloats=ly,ux.format.TopoJSON=my,ux.format.WFS=gv,ux.format.WFS.writeFilter=function(t){var e=tu(Qy,"Filter");return lv(e,t,[]),e},ux.format.WKT=Gv,ux.format.WMSCapabilities=um,ux.format.WMSGetFeatureInfo=pm,ux.format.WMTSCapabilities=Xm,ux.format.filter.Bbox=Cy,ux.format.filter.Contains=wy,ux.format.filter.During=Ly,ux.format.filter.EqualTo=Py,ux.format.filter.GreaterThan=by,ux.format.filter.GreaterThanOrEqualTo=My,ux.format.filter.Intersects=Fy,ux.format.filter.IsBetween=Ay,ux.format.filter.IsLike=Ny,ux.format.filter.IsNull=Gy,ux.format.filter.LessThan=Dy,ux.format.filter.LessThanOrEqualTo=ky,ux.format.filter.Not=jy,ux.format.filter.NotEqualTo=Uy,ux.format.filter.Or=Yy,ux.format.filter.Within=By,ux.format.filter.and=Vy,ux.format.filter.bbox=Xy,ux.format.filter.between=function(t,e,i){return new Ay(t,e,i)},ux.format.filter.contains=function(t,e,i){return new wy(t,e,i)},ux.format.filter.during=function(t,e,i){return new Ly(t,e,i)},ux.format.filter.equalTo=function(t,e,i){return new Py(t,e,i)},ux.format.filter.greaterThan=function(t,e){return new by(t,e)},ux.format.filter.greaterThanOrEqualTo=function(t,e){return new My(t,e)},ux.format.filter.intersects=function(t,e,i){return new Fy(t,e,i)},ux.format.filter.isNull=function(t){return new Gy(t)},ux.format.filter.lessThan=function(t,e){return new Dy(t,e)},ux.format.filter.lessThanOrEqualTo=function(t,e){return new ky(t,e)},ux.format.filter.like=function(t,e,i,r,n,o){return new Ny(t,e,i,r,n,o)},ux.format.filter.not=function(t){return new jy(t)},ux.format.filter.notEqualTo=function(t,e,i){return new Uy(t,e,i)},ux.format.filter.or=function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Yy,e))},ux.format.filter.within=function(t,e,i){return new By(t,e,i)},ux.geom.Circle=Oc,ux.geom.Geometry=Xe,ux.geom.GeometryCollection=ud,ux.geom.LineString=hr,ux.geom.LinearRing=pi,ux.geom.MultiLineString=Pc,ux.geom.MultiPoint=bc,ux.geom.MultiPolygon=Fc,ux.geom.Point=ci,ux.geom.Polygon=Ii,ux.geom.Polygon.circular=Li,ux.geom.Polygon.fromCircle=Pi,ux.geom.Polygon.fromExtent=Oi,ux.geom.SimpleGeometry=We,ux.getUid=o,ux.has.DEVICE_PIXEL_RATIO=Di,ux.has.GEOLOCATION=ji,ux.has.TOUCH=Ui,ux.inherits=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},ux.interaction.DoubleClickZoom=No,ux.interaction.DragAndDrop=wc,ux.interaction.DragBox=ns,ux.interaction.DragPan=Jo,ux.interaction.DragRotate=Qo,ux.interaction.DragRotateAndZoom=Ic,ux.interaction.DragZoom=ss,ux.interaction.Draw=kc,ux.interaction.Draw.createBox=function(){return function(t,e){var i=tt(t),r=[[Et(i),St(i),Lt(i),It(i),Et(i)]],n=e;return n?n.setCoordinates(r):n=new Ii(r),n}},ux.interaction.Draw.createRegularPolygon=function(t,e){return function(i,r){var n=i[0],o=i[1],s=Math.sqrt(er(n,o)),a=r||Pi(new Oc(n),t),h=e;if(!e){var l=o[0]-n[0],u=o[1]-n[1];h=Math.atan(u/l)-(l<0?Math.PI:0)}return bi(a,n,s,h),a}},ux.interaction.Extent=Vc,ux.interaction.Interaction=Fo,ux.interaction.KeyboardPan=ls,ux.interaction.KeyboardZoom=ps,ux.interaction.Modify=Jc,ux.interaction.MouseWheelZoom=fs,ux.interaction.PinchRotate=_s,ux.interaction.PinchZoom=gs,ux.interaction.Pointer=qo,ux.interaction.Select=ed,ux.interaction.Snap=rd,ux.interaction.Translate=hd,ux.interaction.defaults=ys,ux.layer.Base=io,ux.layer.Group=oo,ux.layer.Heatmap=mc,ux.layer.Image=bp,ux.layer.Tile=Np,ux.layer.Vector=gc,ux.layer.VectorTile=Ec,ux.loadingstrategy.all=Jl,ux.loadingstrategy.bbox=function(t,e){return[t]},ux.loadingstrategy.tile=function(t){return function(e,i){var r=t.getZForResolution(i),n=t.getTileRangeForExtentAndZ(e,r),o=[],s=[r,0,0];for(s[1]=n.minX;s[1]<=n.maxX;++s[1])for(s[2]=n.minY;s[2]<=n.maxY;++s[2])o.push(t.getTileCoordExtent(s));return o}},ux.proj.Projection=ee,ux.proj.Units.METERS_PER_UNIT=Qt,ux.proj.addCoordinateTransforms=we,ux.proj.addEquivalentProjections=Te,ux.proj.addProjection=xe,ux.proj.equivalent=Ie,ux.proj.fromLonLat=function(t,e){return Pe(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},ux.proj.get=Ee,ux.proj.getPointResolution=Se,ux.proj.getTransform=Oe,ux.proj.proj4.register=function(t){var e,i,r=Object.keys(t.defs),n=r.length;for(e=0;e<n;++e){var o=r[e];if(!Ee(o)){var s=t.defs(o);xe(new ee({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:s.units}))}}for(e=0;e<n;++e){var a=r[e],h=Ee(a);for(i=0;i<n;++i){var l=r[i],u=Ee(l);if(!ye(a,l))if(t.defs[a]===t.defs[l])Te([h,u]);else{var p=t(a,l);we(h,u,p.forward,p.inverse)}}}},ux.proj.toLonLat=function(t,e){var i=Pe(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||r>180)&&(i[0]=Xt(r+180,360)-180),i},ux.proj.transform=Pe,ux.proj.transformExtent=be,ux.render.VectorContext=Vs,ux.render.canvas.labelCache=Ps,ux.render.toContext=function(t,e){var i=t.canvas,r=e||{},n=r.pixelRatio||Di,o=r.size;o&&(i.width=o[0]*n,i.height=o[1]*n,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],a=je([1,0,0,1,0,0],n,n);return new Xs(t,n,s,a,0)},ux.renderer.canvas.ImageLayer=ra,ux.renderer.canvas.Map=Qs,ux.renderer.canvas.TileLayer=ha,ux.renderer.canvas.VectorLayer=Ba,ux.renderer.canvas.VectorTileLayer=Ka,ux.renderer.webgl.ImageLayer=gl,ux.renderer.webgl.Map=yl,ux.renderer.webgl.TileLayer=Xl,ux.renderer.webgl.VectorLayer=Wl,ux.size.toSize=ho,ux.source.BingMaps=tp,ux.source.CartoDB=ip,ux.source.Cluster=sp,ux.source.Image=dp,ux.source.ImageArcGISRest=gp,ux.source.ImageCanvas=yp,ux.source.ImageMapGuide=vp,ux.source.ImageStatic=mp,ux.source.ImageWMS=wp,ux.source.OSM=Lp,ux.source.OSM.ATTRIBUTION=Ip,ux.source.Raster=Vp,ux.source.Source=Il,ux.source.Stamen=Kp,ux.source.Tile=jl,ux.source.TileArcGISRest=Zp,ux.source.TileDebug=Jp,ux.source.TileImage=$u,ux.source.TileJSON=Qp,ux.source.TileWMS=tc,ux.source.UTFGrid=ic,ux.source.Vector=op,ux.source.VectorTile=ac,ux.source.WMTS=lc,ux.source.WMTS.optionsFromCapabilities=function(t,e){var i=H(t.Contents.Layer,function(t,i,r){return t.Identifier==e.layer});if(null===i)return null;var r,n=t.Contents.TileMatrixSet;(r=i.TileMatrixSetLink.length>1?J(i.TileMatrixSetLink,"projection"in e?function(t,i,r){var o=H(n,function(e){return e.Identifier==t.TileMatrixSet}).SupportedCRS,s=Ee(o.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Ee(o),a=Ee(e.projection);return s&&a?Ie(s,a):o==e.projection}:function(t,i,r){return t.TileMatrixSet==e.matrixSet}):0)<0&&(r=0);var o=i.TileMatrixSetLink[r].TileMatrixSet,s=i.TileMatrixSetLink[r].TileMatrixSetLimits,a=i.Format[0];"format"in e&&(a=e.format),(r=J(i.Style,function(t,i,r){return"style"in e?t.Title==e.style:t.isDefault}))<0&&(r=0);var h=i.Style[r].Identifier,l={};"Dimension"in i&&i.Dimension.forEach(function(t,e,i){var r=t.Identifier,n=t.Default;void 0===n&&(n=t.Value[0]),l[r]=n});var u,p=H(t.Contents.TileMatrixSet,function(t,e,i){return t.Identifier==o}),c=p.SupportedCRS;if(c&&(u=Ee(c.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Ee(c)),"projection"in e){var d=Ee(e.projection);d&&(u&&!Ie(d,u)||(u=d))}var f,_,g=i.WGS84BoundingBox;if(void 0!==g){var y=Ee("EPSG:4326").getExtent();_=g[0]==y[0]&&g[2]==y[2],f=be(g,"EPSG:4326",u);var v=u.getExtent();v&&(ot(v,f)||(f=void 0))}var m=Eu(p,f,s),x=[],E=e.requestEncoding;if(E=void 0!==E?E:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var S=t.OperationsMetadata.GetTile.DCP.HTTP.Get,T=0,C=S.length;T<C;++T)if(S[T].Constraint){var R=H(S[T].Constraint,function(t){return"GetEncoding"==t.name}).AllowedValues.Value;if(""===E&&(E=R[0]),E!==hc.KVP)break;X(R,hc.KVP)&&x.push(S[T].href)}else S[T].href&&(E=hc.KVP,x.push(S[T].href));return 0===x.length&&(E=hc.REST,i.ResourceURL.forEach(function(t){"tile"===t.resourceType&&(a=t.format,x.push(t.template))})),{urls:x,layer:e.layer,matrixSet:o,format:a,projection:u,requestEncoding:E,tileGrid:m,style:h,dimensions:l,wrapX:_,crossOrigin:e.crossOrigin}},ux.source.XYZ=ep,ux.source.Zoomify=dc,ux.sphere.getArea=function t(e,i){var r=i||{},n=r.radius||Wt,o=r.projection||"EPSG:3857",s=e.getType();s!==Nt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,h,l,u,p,c,d=0;switch(s){case Nt.POINT:case Nt.MULTI_POINT:case Nt.LINE_STRING:case Nt.MULTI_LINE_STRING:case Nt.LINEAR_RING:break;case Nt.POLYGON:for(a=e.getCoordinates(),d=Math.abs(Zt(a[0],n)),l=1,u=a.length;l<u;++l)d-=Math.abs(Zt(a[l],n));break;case Nt.MULTI_POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)for(h=a[l],d+=Math.abs(Zt(h[0],n)),p=1,c=h.length;p<c;++p)d-=Math.abs(Zt(h[p],n));break;case Nt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(l=0,u=f.length;l<u;++l)d+=t(f[l],i);break;default:throw new Error("Unsupported geometry type: "+s)}return d},ux.sphere.getDistance=Kt,ux.sphere.getLength=function t(e,i){var r=i||{},n=r.radius||Wt,o=r.projection||"EPSG:3857",s=e.getType();s!==Nt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,h,l,u,p,c,d=0;switch(s){case Nt.POINT:case Nt.MULTI_POINT:break;case Nt.LINE_STRING:case Nt.LINEAR_RING:d=Ht(a=e.getCoordinates(),n);break;case Nt.MULTI_LINE_STRING:case Nt.POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)d+=Ht(a[l],n);break;case Nt.MULTI_POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)for(p=0,c=(h=a[l]).length;p<c;++p)d+=Ht(h[p],n);break;case Nt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(l=0,u=f.length;l<u;++l)d+=t(f[l],i);break;default:throw new Error("Unsupported geometry type: "+s)}return d},ux.style.AtlasManager=ol,ux.style.Circle=Ru,ux.style.Fill=mr,ux.style.Icon=Ou,ux.style.IconImageCache.shared=Ks,ux.style.Image=Tu,ux.style.RegularShape=Cu,ux.style.Stroke=Er,ux.style.Style=Nu,ux.style.Text=Rr,ux.tilegrid.TileGrid=Pl,ux.tilegrid.WMTS=xu,ux.tilegrid.WMTS.createFromCapabilitiesMatrixSet=Eu,ux.tilegrid.createXYZ=Fl,ux.xml.getAllTextContent=eu,ux.xml.parse=ru;e.default=ux}]).default});
+/*! For license information please see ol.js.LICENSE.txt */
+!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ol=n():t.ol=n()}(self,(function(){return function(){var t,n={226:function(t,n){n.read=function(t,n,i,r,e){var o,s,a=8*e-r-1,u=(1<<a)-1,c=u>>1,h=-7,f=i?e-1:0,l=i?-1:1,v=t[n+f];for(f+=l,o=v&(1<<-h)-1,v>>=-h,h+=a;h>0;o=256*o+t[n+f],f+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[n+f],f+=l,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=c}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,i,r,e,o){var s,a,u,c=8*o-e-1,h=(1<<c)-1,f=h>>1,l=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,s=h):(s=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-s))<1&&(s--,u*=2),(n+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(n*u-1)*Math.pow(2,e),s+=f):(a=n*Math.pow(2,f-1)*Math.pow(2,e),s=0));e>=8;t[i+v]=255&a,v+=d,a/=256,e-=8);for(s=s<<e|a,c+=e;c>0;t[i+v]=255&s,v+=d,s/=256,c-=8);t[i+v-d]|=128*p}},875:function(t,n,i){"use strict";function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}var s=i(692),a=Symbol("max"),u=Symbol("length"),c=Symbol("lengthCalculator"),h=Symbol("allowStale"),f=Symbol("maxAge"),l=Symbol("dispose"),v=Symbol("noDisposeOnSet"),d=Symbol("lruList"),p=Symbol("cache"),y=Symbol("updateAgeOnGet"),m=function(){return 1},w=function(){function t(n){if(r(this,t),"number"==typeof n&&(n={max:n}),n||(n={}),n.max&&("number"!=typeof n.max||n.max<0))throw new TypeError("max must be a non-negative number");this[a]=n.max||1/0;var i=n.length||m;if(this[c]="function"!=typeof i?m:i,this[h]=n.stale||!1,n.maxAge&&"number"!=typeof n.maxAge)throw new TypeError("maxAge must be a number");this[f]=n.maxAge||0,this[l]=n.dispose,this[v]=n.noDisposeOnSet||!1,this[y]=n.updateAgeOnGet||!1,this.reset()}return o(t,[{key:"max",get:function(){return this[a]},set:function(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[a]=t||1/0,x(this)}},{key:"allowStale",get:function(){return this[h]},set:function(t){this[h]=!!t}},{key:"maxAge",get:function(){return this[f]},set:function(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[f]=t,x(this)}},{key:"lengthCalculator",get:function(){return this[c]},set:function(t){var n=this;"function"!=typeof t&&(t=m),t!==this[c]&&(this[c]=t,this[u]=0,this[d].forEach((function(t){t.length=n[c](t.value,t.key),n[u]+=t.length}))),x(this)}},{key:"length",get:function(){return this[u]}},{key:"itemCount",get:function(){return this[d].length}},{key:"rforEach",value:function(t,n){n=n||this;for(var i=this[d].tail;null!==i;){var r=i.prev;k(this,t,i,n),i=r}}},{key:"forEach",value:function(t,n){n=n||this;for(var i=this[d].head;null!==i;){var r=i.next;k(this,t,i,n),i=r}}},{key:"keys",value:function(){return this[d].toArray().map((function(t){return t.key}))}},{key:"values",value:function(){return this[d].toArray().map((function(t){return t.value}))}},{key:"reset",value:function(){var t=this;this[l]&&this[d]&&this[d].length&&this[d].forEach((function(n){return t[l](n.key,n.value)})),this[p]=new Map,this[d]=new s,this[u]=0}},{key:"dump",value:function(){var t=this;return this[d].map((function(n){return!g(t,n)&&{k:n.key,v:n.value,e:n.now+(n.maxAge||0)}})).toArray().filter((function(t){return t}))}},{key:"dumpLru",value:function(){return this[d]}},{key:"set",value:function(t,n,i){if((i=i||this[f])&&"number"!=typeof i)throw new TypeError("maxAge must be a number");var r=i?Date.now():0,e=this[c](n,t);if(this[p].has(t)){if(e>this[a])return j(this,this[p].get(t)),!1;var o=this[p].get(t).value;return this[l]&&(this[v]||this[l](t,o.value)),o.now=r,o.maxAge=i,o.value=n,this[u]+=e-o.length,o.length=e,this.get(t),x(this),!0}var s=new S(t,n,e,r,i);return s.length>this[a]?(this[l]&&this[l](t,n),!1):(this[u]+=s.length,this[d].unshift(s),this[p].set(t,this[d].head),x(this),!0)}},{key:"has",value:function(t){if(!this[p].has(t))return!1;var n=this[p].get(t).value;return!g(this,n)}},{key:"get",value:function(t){return b(this,t,!0)}},{key:"peek",value:function(t){return b(this,t,!1)}},{key:"pop",value:function(){var t=this[d].tail;return t?(j(this,t),t.value):null}},{key:"del",value:function(t){j(this,this[p].get(t))}},{key:"load",value:function(t){this.reset();for(var n=Date.now(),i=t.length-1;i>=0;i--){var r=t[i],e=r.e||0;if(0===e)this.set(r.k,r.v);else{var o=e-n;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var t=this;this[p].forEach((function(n,i){return b(t,i,!1)}))}}]),t}(),b=function(t,n,i){var r=t[p].get(n);if(r){var e=r.value;if(g(t,e)){if(j(t,r),!t[h])return}else i&&(t[y]&&(r.value.now=Date.now()),t[d].unshiftNode(r));return e.value}},g=function(t,n){if(!n||!n.maxAge&&!t[f])return!1;var i=Date.now()-n.now;return n.maxAge?i>n.maxAge:t[f]&&i>t[f]},x=function(t){if(t[u]>t[a])for(var n=t[d].tail;t[u]>t[a]&&null!==n;){var i=n.prev;j(t,n),n=i}},j=function(t,n){if(n){var i=n.value;t[l]&&t[l](i.key,i.value),t[u]-=i.length,t[p].delete(i.key),t[d].removeNode(n)}},S=o((function t(n,i,e,o,s){r(this,t),this.key=n,this.value=i,this.length=e,this.now=o,this.maxAge=s||0})),k=function(t,n,i,r){var e=i.value;g(t,e)&&(j(t,i),t[h]||(e=void 0)),e&&n.call(r,e.value,e.key,t)};t.exports=w},63:function(t){var n={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},i=" ",r=/(italic|oblique)$/i,e={};t.exports=function(t,o,s){var a=e[t];if(!a){Array.isArray(t)||(t=[t]);for(var u=400,c="normal",h=[],f=0,l=t.length;f<l;++f){var v=t[f].split(" "),d=v[v.length-1].toLowerCase();for(var p in"normal"==d||"italic"==d||"oblique"==d?(c=d,v.pop(),d=v[v.length-1].toLowerCase()):r.test(d)&&(d=d.replace(r,""),c=v[v.length-1].replace(d,"")),n){var y=v.length>1?v[v.length-2].toLowerCase():"";if(d==p||d==p.replace("-","")||y+"-"+d==p){u=n[p],v.pop(),y&&p.startsWith(y)&&v.pop();break}}"number"==typeof d&&(u=d);var m=v.join(i).replace("Klokantech Noto Sans","Noto Sans");-1!==m.indexOf(i)&&(m='"'+m+'"'),h.push(m)}a=e[t]=[c,u,h]}return a[0]+i+a[1]+i+o+"px"+(s?"/"+s:"")+i+a[2]}},98:function(t,n,i){"use strict";t.exports=e;var r=i(226);function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var o=4294967296,s=1/o,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function u(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function h(t,n,i){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(var e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function f(t,n){for(var i=0;i<t.length;i++)n.writeVarint(t[i])}function l(t,n){for(var i=0;i<t.length;i++)n.writeSVarint(t[i])}function v(t,n){for(var i=0;i<t.length;i++)n.writeFloat(t[i])}function d(t,n){for(var i=0;i<t.length;i++)n.writeDouble(t[i])}function p(t,n){for(var i=0;i<t.length;i++)n.writeBoolean(t[i])}function y(t,n){for(var i=0;i<t.length;i++)n.writeFixed32(t[i])}function m(t,n){for(var i=0;i<t.length;i++)n.writeSFixed32(t[i])}function w(t,n){for(var i=0;i<t.length;i++)n.writeFixed64(t[i])}function b(t,n){for(var i=0;i<t.length;i++)n.writeSFixed64(t[i])}function g(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function x(t,n,i){t[i]=n,t[i+1]=n>>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function j(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}e.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),e=r>>3,o=this.pos;this.type=7&r,t(e,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=j(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=g(this.buf,this.pos)+g(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=g(this.buf,this.pos)+j(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){var r,e,o=i.buf;if(e=o[i.pos++],r=(112&e)>>4,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<3,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<10,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<17,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<24,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(1&e)<<31,e<128)return c(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[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,n=this.pos;return this.pos=t,t-n>=12&&a?function(t,n,i){return a.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var r="",e=n;for(;e<i;){var o,s,a,u=t[e],c=null,h=u>239?4:u>223?3:u>191?2:1;if(e+h>i)break;1===h?u<128&&(c=u):2===h?128==(192&(o=t[e+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===h?(o=t[e+1],s=t[e+2],128==(192&o)&&128==(192&s)&&((c=(15&u)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(o=t[e+1],s=t[e+2],a=t[e+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),e+=h}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==e.Bytes)return t.push(this.readVarint(n));var i=u(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==e.Bytes)return t.push(this.readSVarint());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==e.Bytes)return t.push(this.readBoolean());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==e.Bytes)return t.push(this.readFloat());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==e.Bytes)return t.push(this.readDouble());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed32());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed32());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed64());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed64());var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===e.Varint)for(;this.buf[this.pos++]>127;);else if(n===e.Bytes)this.pos=this.readVarint()+this.pos;else if(n===e.Fixed32)this.pos+=4;else{if(n!==e.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n<this.pos+t;)n*=2;if(n!==this.length){var i=new Uint8Array(n);i.set(this.buf),this.buf=i,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,n){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,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,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(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 n=this.pos;this.pos=function(t,n,i){for(var r,e,o=0;o<n.length;o++){if((r=n.charCodeAt(o))>55295&&r<57344){if(!e){r>56319||o+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):e=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(t[i++]=239,t[i++]=191,t[i++]=189,e=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&h(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var i=0;i<n;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,n){this.pos++;var i=this.pos;t(n,this);var r=this.pos-i;r>=128&&h(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,i){this.writeTag(t,e.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,f,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,b,n)},writeBytesField:function(t,n){this.writeTag(t,e.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,e.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,e.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,e.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},72:function(t,n,i){var r,e,o;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,r,e,o,s){!function t(i,r,e,o,s){for(;o>e;){if(o-e>600){var a=o-e+1,u=r-e+1,c=Math.log(a),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(a-h)/a)*(u-a/2<0?-1:1);t(i,r,Math.max(e,Math.floor(r-u*h/a+f)),Math.min(o,Math.floor(r+(a-u)*h/a+f)),s)}var l=i[r],v=e,d=o;for(n(i,e,r),s(i[o],l)>0&&n(i,e,o);v<d;){for(n(i,v,d),v++,d--;s(i[v],l)<0;)v++;for(;s(i[d],l)>0;)d--}0===s(i[e],l)?n(i,e,d):n(i,++d,o),d<=r&&(e=d+1),r<=d&&(o=d-1)}}(t,r,e||0,o||t.length-1,s||i)}function n(t,n,i){var r=t[n];t[n]=t[i],t[i]=r}function i(t,n){return t<n?-1:t>n?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,n,i){if(!i)return n.indexOf(t);for(var r=0;r<n.length;r++)if(i(t,n[r]))return r;return-1}function o(t,n){s(t,0,t.children.length,n,t)}function s(t,n,i,r,e){e||(e=d(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var o=n;o<i;o++){var s=t.children[o];a(e,t.leaf?r(s):s)}return e}function a(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function u(t,n){return t.minX-n.minX}function c(t,n){return t.minY-n.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function v(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,i,r,e,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=e)){var a=i+Math.ceil((r-i)/e/2)*e;t(n,a,i,r,o),s.push(i,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,i=[];if(!v(t,n))return i;for(var r=this.toBBox,e=[];n;){for(var o=0;o<n.children.length;o++){var s=n.children[o],a=n.leaf?r(s):s;v(t,a)&&(n.leaf?i.push(s):l(t,a)?this._all(s,i):e.push(s))}n=e.pop()}return i},r.prototype.collides=function(t){var n=this.data;if(!v(t,n))return!1;for(var i=[];n;){for(var r=0;r<n.children.length;r++){var e=n.children[r],o=n.leaf?this.toBBox(e):e;if(v(t,o)){if(n.leaf||l(t,o))return!0;i.push(e)}}n=i.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(t,n){if(!t)return this;for(var i,r,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],i=c.pop(),o=!0),s.leaf){var h=e(t,s.children,n);if(-1!==h)return s.children.splice(h,1),u.push(s),this._condense(u),this}o||s.leaf||!l(s,a)?r?(i++,s=r.children[i],o=!1):s=null:(u.push(s),c.push(i),i=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,n){return t.minX-n.minX},r.prototype.compareMinY=function(t,n){return t.minY-n.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,n){for(var i=[];t;)t.leaf?n.push.apply(n,t.children):i.push.apply(i,t.children),t=i.pop();return n},r.prototype._build=function(t,n,i,r){var e,s=i-n+1,a=this._maxEntries;if(s<=a)return o(e=d(t.slice(n,i+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(e=d([])).leaf=!1,e.height=r;var u=Math.ceil(s/a),c=u*Math.ceil(Math.sqrt(a));p(t,n,i,c,this.compareMinX);for(var h=n;h<=i;h+=c){var f=Math.min(h+c-1,i);p(t,h,f,u,this.compareMinY);for(var l=h;l<=f;l+=u){var v=Math.min(l+u-1,f);e.children.push(this._build(t,l,v,r-1))}}return o(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,n,i,r){for(;r.push(n),!n.leaf&&r.length-1!==i;){for(var e=1/0,o=1/0,s=void 0,a=0;a<n.children.length;a++){var u=n.children[a],c=h(u),f=(l=t,v=u,(Math.max(v.maxX,l.maxX)-Math.min(v.minX,l.minX))*(Math.max(v.maxY,l.maxY)-Math.min(v.minY,l.minY))-c);f<o?(o=f,e=c<e?c:e,s=u):f===o&&c<e&&(e=c,s=u)}n=s||n.children[0]}var l,v;return n},r.prototype._insert=function(t,n,i){var r=i?t:this.toBBox(t),e=[],o=this._chooseSubtree(r,this.data,n,e);for(o.children.push(t),a(o,r);n>=0&&e[n].children.length>this._maxEntries;)this._split(e,n),n--;this._adjustParentBBoxes(r,e,n)},r.prototype._split=function(t,n){var i=t[n],r=i.children.length,e=this._minEntries;this._chooseSplitAxis(i,e,r);var s=this._chooseSplitIndex(i,e,r),a=d(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,i){for(var r,e,o,a,u,c,f,l=1/0,v=1/0,d=n;d<=i-n;d++){var p=s(t,0,d,this.toBBox),y=s(t,d,i,this.toBBox),m=(e=p,o=y,a=Math.max(e.minX,o.minX),u=Math.max(e.minY,o.minY),c=Math.min(e.maxX,o.maxX),f=Math.min(e.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,f-u)),w=h(p)+h(y);m<l?(l=m,r=d,v=w<v?w:v):m===l&&w<v&&(v=w,r=d)}return r||i-n},r.prototype._chooseSplitAxis=function(t,n,i){var r=t.leaf?this.compareMinX:u,e=t.leaf?this.compareMinY:c;this._allDistMargin(t,n,i,r)<this._allDistMargin(t,n,i,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,i,r){t.children.sort(r);for(var e=this.toBBox,o=s(t,0,n,e),u=s(t,i-n,i,e),c=f(o)+f(u),h=n;h<i-n;h++){var l=t.children[h];a(o,t.leaf?e(l):l),c+=f(o)}for(var v=i-n-1;v>=n;v--){var d=t.children[v];a(u,t.leaf?e(d):d),c+=f(u)}return c},r.prototype._adjustParentBBoxes=function(t,n,i){for(var r=i;r>=0;r--)a(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,i=void 0;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r},"object"==s(n)?t.exports=o():void 0===(e="function"==typeof(r=o)?r.call(n,i,n,t):r)||(t.exports=e)},760:function(t,n,i){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var e=function(t){"use strict";var n,i=Object.prototype,e=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,n,i){return Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{c({},"")}catch(t){c=function(t,n,i){return t[n]=i}}function h(t,n,i,r){var e=n&&n.prototype instanceof m?n:m,o=Object.create(e.prototype),s=new E(r||[]);return o._invoke=function(t,n,i){var r=l;return function(e,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===e)throw o;return C()}for(i.method=e,i.arg=o;;){var s=i.delegate;if(s){var a=_(s,i);if(a){if(a===y)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===l)throw r=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=d;var u=f(t,n,i);if("normal"===u.type){if(r=i.done?p:v,u.arg===y)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(r=p,i.method="throw",i.arg=u.arg)}}}(t,i,s),o}function f(t,n,i){try{return{type:"normal",arg:t.call(n,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var l="suspendedStart",v="suspendedYield",d="executing",p="completed",y={};function m(){}function w(){}function b(){}var g={};c(g,s,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(A([])));j&&j!==i&&e.call(j,s)&&(g=j);var S=b.prototype=m.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(n){c(t,n,(function(t){return this._invoke(n,t)}))}))}function M(t,n){function i(o,s,a,u){var c=f(t[o],t,s);if("throw"!==c.type){var h=c.arg,l=h.value;return l&&"object"===r(l)&&e.call(l,"__await")?n.resolve(l.__await).then((function(t){i("next",t,a,u)}),(function(t){i("throw",t,a,u)})):n.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return i("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function e(){return new n((function(n,e){i(t,r,n,e)}))}return o=o?o.then(e,e):e()}}function _(t,i){var r=t.iterator[i.method];if(r===n){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=n,_(t,i),"throw"===i.method))return y;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var e=f(r,t.iterator,i.arg);if("throw"===e.type)return i.method="throw",i.arg=e.arg,i.delegate=null,y;var o=e.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=n),i.delegate=null,y):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(t){if(t){var i=t[s];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function i(){for(;++r<t.length;)if(e.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=n,i.done=!0,i};return o.next=o}}return{next:C}}function C(){return{value:n,done:!0}}return w.prototype=b,c(S,"constructor",b),c(b,"constructor",w),w.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===w||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},k(M.prototype),c(M.prototype,a,(function(){return this})),t.AsyncIterator=M,t.async=function(n,i,r,e,o){void 0===o&&(o=Promise);var s=new M(h(n,i,r,e),o);return t.isGeneratorFunction(i)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},k(S),c(S,u,"Generator"),c(S,s,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=[];for(var i in t)n.push(i);return n.reverse(),function i(){for(;n.length;){var r=n.pop();if(r in t)return i.value=r,i.done=!1,i}return i.done=!0,i}},t.values=A,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(T),!t)for(var i in this)"t"===i.charAt(0)&&e.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function r(r,e){return a.type="throw",a.arg=t,i.next=r,e&&(i.method="next",i.arg=n),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=e.call(s,"catchLoc"),c=e.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,n){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&e.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=n,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),y},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var e=r.arg;T(i)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,r){return this.delegate={iterator:A(t),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=n),y}},t}("object"===r(t=i.nmd(t))?t.exports:{});try{regeneratorRuntime=e}catch(t){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},338:function(t){(function(){var n;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return n},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},n=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},617:function(t,n,i){var r=i(279);t.exports=function(t,n,i){var e=i&&i.debug||!1,o=i&&i.startIndex||0;e&&console.log("starting findTagByName with",n," and ",i);var s=r(t,"<".concat(n,"[ >]"),o);if(e&&console.log("start:",s),-1!==s){var a=t.slice(s+n.length),u=r(a,"[ /]"+n+">",0),c=-1===u;c&&(u=r(a,"[ /]>",0));var h=s+n.length+u+1+(c?0:n.length)+1;if(e&&console.log("end:",h),-1!==h){var f=t.slice(s,h);return{inner:c?null:f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),outer:f,start:s,end:h}}}}},51:function(t,n,i){var r=i(617);t.exports=function(t,n,i){for(var e,o=[],s=i&&i.debug||!1,a=i&&i.startIndex||0;e=r(t,n,{debug:s,startIndex:a});)a=e.end,o.push(e);return s&&console.log("findTagsByName found",o.length,"tags"),o}},802:function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t,i,r){var e=r&&r.debug||!1;e&&console.log("getting "+i+" in "+t);var o="object"===n(t)?t.outer:t,s="".concat(i,'\\="([^"]*)"');e&&console.log("pattern:",s);var a=new RegExp(s).exec(o);if(e&&console.log("match:",a),a)return a[1]}},279:function(t){t.exports=function(t,n,i){var r=new RegExp(n).exec(t.slice(i));return r?i+r.index:-1}},518:function(t){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.head;case 1:if(!n){t.next=7;break}return t.next=4,n.value;case 4:n=n.next,t.next=1;break;case 7:case"end":return t.stop()}}),t,this)}))}},692:function(t,n,i){"use strict";function r(t){var n=this;if(n instanceof r||(n=new r),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){n.push(t)}));else if(arguments.length>0)for(var i=0,e=arguments.length;i<e;i++)n.push(arguments[i]);return n}function e(t,n,i){var r=n===t.head?new a(i,null,n,t):new a(i,n,n.next,t);return null===r.next&&(t.tail=r),null===r.prev&&(t.head=r),t.length++,r}function o(t,n){t.tail=new a(n,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function s(t,n){t.head=new a(n,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function a(t,n,i,r){if(!(this instanceof a))return new a(t,n,i,r);this.list=r,this.value=t,n?(n.next=this,this.prev=n):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}t.exports=r,r.Node=a,r.create=r,r.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var n=t.next,i=t.prev;return n&&(n.prev=i),i&&(i.next=n),t===this.head&&(this.head=n),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,n},r.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var n=this.head;t.list=this,t.next=n,n&&(n.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},r.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var n=this.tail;t.list=this,t.prev=n,n&&(n.next=t),this.tail=t,this.head||(this.head=t),this.length++}},r.prototype.push=function(){for(var t=0,n=arguments.length;t<n;t++)o(this,arguments[t]);return this.length},r.prototype.unshift=function(){for(var t=0,n=arguments.length;t<n;t++)s(this,arguments[t]);return this.length},r.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},r.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},r.prototype.forEach=function(t,n){n=n||this;for(var i=this.head,r=0;null!==i;r++)t.call(n,i.value,r,this),i=i.next},r.prototype.forEachReverse=function(t,n){n=n||this;for(var i=this.tail,r=this.length-1;null!==i;r--)t.call(n,i.value,r,this),i=i.prev},r.prototype.get=function(t){for(var n=0,i=this.head;null!==i&&n<t;n++)i=i.next;if(n===t&&null!==i)return i.value},r.prototype.getReverse=function(t){for(var n=0,i=this.tail;null!==i&&n<t;n++)i=i.prev;if(n===t&&null!==i)return i.value},r.prototype.map=function(t,n){n=n||this;for(var i=new r,e=this.head;null!==e;)i.push(t.call(n,e.value,this)),e=e.next;return i},r.prototype.mapReverse=function(t,n){n=n||this;for(var i=new r,e=this.tail;null!==e;)i.push(t.call(n,e.value,this)),e=e.prev;return i},r.prototype.reduce=function(t,n){var i,r=this.head;if(arguments.length>1)i=n;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,i=this.head.value}for(var e=0;null!==r;e++)i=t(i,r.value,e),r=r.next;return i},r.prototype.reduceReverse=function(t,n){var i,r=this.tail;if(arguments.length>1)i=n;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,i=this.tail.value}for(var e=this.length-1;null!==r;e--)i=t(i,r.value,e),r=r.prev;return i},r.prototype.toArray=function(){for(var t=new Array(this.length),n=0,i=this.head;null!==i;n++)t[n]=i.value,i=i.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,i=this.tail;null!==i;n++)t[n]=i.value,i=i.prev;return t},r.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(n<t||n<0)return i;t<0&&(t=0),n>this.length&&(n=this.length);for(var e=0,o=this.head;null!==o&&e<t;e++)o=o.next;for(;null!==o&&e<n;e++,o=o.next)i.push(o.value);return i},r.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(n<t||n<0)return i;t<0&&(t=0),n>this.length&&(n=this.length);for(var e=this.length,o=this.tail;null!==o&&e>n;e--)o=o.prev;for(;null!==o&&e>t;e--,o=o.prev)i.push(o.value);return i},r.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i<t;i++)r=r.next;var o=[];for(i=0;r&&i<n;i++)o.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(i=0;i<(arguments.length<=2?0:arguments.length-2);i++)r=e(this,r,i+2<2||arguments.length<=i+2?void 0:arguments[i+2]);return o},r.prototype.reverse=function(){for(var t=this.head,n=this.tail,i=t;null!==i;i=i.prev){var r=i.prev;i.prev=i.next,i.next=r}return this.head=n,this.tail=t,this};try{i(518)(r)}catch(t){}},752:function(){},640:function(){},630:function(){},920:function(t,n,i){"use strict";function r(){return function(){throw new Error("Unimplemented abstract method.")}()}i.d(n,{default:function(){return mL}});var e=0;function o(t){return t.ol_uid||(t.ol_uid=String(++e))}var s,a="6.14.1",u=(s=function(t,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}s(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),c=function(t){function n(n){var i=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+a.split("-")[0])+"/doc/errors/#"+n+" for details.";return(i=t.call(this,r)||this).code=n,i.name="AssertionError",i.message=r,i}return u(n,t),n}(Error);function h(t){t.stopPropagation()}var f=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),l="propertychange",v=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function d(t,n,i){for(var r,e,o=i||p,s=0,a=t.length,u=!1;s<a;)(e=+o(t[r=s+(a-s>>1)],n))<0?s=r+1:(a=r,u=!e);return u?s:~s}function p(t,n){return t>n?1:t<n?-1:0}function y(t,n){return t.indexOf(n)>=0}function m(t,n,i){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var e=void 0;if(i>0){for(e=1;e<r;++e)if(t[e]<n)return e-1}else if(i<0){for(e=1;e<r;++e)if(t[e]<=n)return e}else for(e=1;e<r;++e){if(t[e]==n)return e;if(t[e]<n)return"function"==typeof i?i(n,t[e-1],t[e])>0?e-1:e:t[e-1]-n<n-t[e]?e-1:e}return r-1}function w(t,n,i){for(;n<i;){var r=t[n];t[n]=t[i],t[i]=r,++n,--i}}function b(t,n){for(var i=Array.isArray(n)?n:[n],r=i.length,e=0;e<r;e++)t[t.length]=i[e]}function g(t,n){for(var i,r=t.length>>>0,e=0;e<r;e++)if(n(i=t[e],e,t))return i;return null}function x(t,n){var i=t.length;if(i!==n.length)return!1;for(var r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0}function j(t,n){var i;return!t.every((function(r,e){return i=e,!n(r,e,t)}))?i:-1}function S(t,n,i){var r=n||p;return t.every((function(n,e){if(0===e)return!0;var o=r(t[e-1],n);return!(o>0||i&&0===o)}))}function k(){return!0}function M(){return!1}function _(){}function O(t){var n,i,r,e=!1;return function(){var o=Array.prototype.slice.call(arguments);return e&&this===r&&x(o,i)||(e=!0,r=this,i=o,n=t.apply(this,arguments)),n}}function T(t){return function(){var n;try{n=t()}catch(t){return Promise.reject(t)}return n instanceof Promise?n:Promise.resolve(n)}()}var E="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r<e;++r){var o=arguments[r];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s])}return i};function A(t){for(var n in t)delete t[n]}var C="function"==typeof Object.values?Object.values:function(t){var n=[];for(var i in t)n.push(t[i]);return n};function R(t){var n;for(n in t)return!1;return!n}var P=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),I=function(t){function n(n){var i=t.call(this)||this;return i.t=n,i.S=null,i._=null,i.O=null,i}return P(n,t),n.prototype.addEventListener=function(t,n){if(t&&n){var i=this.O||(this.O={}),r=i[t]||(i[t]=[]);-1===r.indexOf(n)&&r.push(n)}},n.prototype.dispatchEvent=function(t){var n="string"==typeof t,i=n?t:t.type,r=this.O&&this.O[i];if(r){var e=n?new f(t):t;e.target||(e.target=this.t||this);var o,s=this._||(this._={}),a=this.S||(this.S={});i in s||(s[i]=0,a[i]=0),++s[i];for(var u=0,c=r.length;u<c;++u)if(!1===(o="handleEvent"in r[u]?r[u].handleEvent(e):r[u].call(this,e))||e.propagationStopped){o=!1;break}if(0==--s[i]){var h=a[i];for(delete a[i];h--;)this.removeEventListener(i,_);delete s[i]}return o}},n.prototype.disposeInternal=function(){this.O&&A(this.O)},n.prototype.getListeners=function(t){return this.O&&this.O[t]||void 0},n.prototype.hasListener=function(t){return!!this.O&&(t?t in this.O:Object.keys(this.O).length>0)},n.prototype.removeEventListener=function(t,n){var i=this.O&&this.O[t];if(i){var r=i.indexOf(n);-1!==r&&(this.S&&t in this.S?(i[r]=_,++this.S[t]):(i.splice(r,1),0===i.length&&delete this.O[t]))}},n}(v),N="change",z="error",F="clear",L="contextmenu",G="click",D="dblclick",U="dragenter",q="dragover",B="drop",W="keydown",V="keypress",X="load",H="resize",J="touchmove",K="wheel";function Y(t,n,i,r,e){if(r&&r!==t&&(i=i.bind(r)),e){var o=i;i=function(){t.removeEventListener(n,i),o.apply(this,arguments)}}var s={target:t,type:n,listener:i};return t.addEventListener(n,i),s}function Z(t,n,i,r){return Y(t,n,i,r,!0)}function $(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),A(t))}var Q=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tt=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.T=0,n}return Q(n,t),n.prototype.changed=function(){++this.T,this.dispatchEvent(N)},n.prototype.getRevision=function(){return this.T},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),e=0;e<i;++e)r[e]=Y(this,t[e],n);return r}return Y(this,t,n)},n.prototype.onceInternal=function(t,n){var i;if(Array.isArray(t)){var r=t.length;i=new Array(r);for(var e=0;e<r;++e)i[e]=Z(this,t[e],n)}else i=Z(this,t,n);return n.ol_key=i,i},n.prototype.unInternal=function(t,n){var i=n.ol_key;if(i)nt(i);else if(Array.isArray(t))for(var r=0,e=t.length;r<e;++r)this.removeEventListener(t[r],n);else this.removeEventListener(t,n)},n}(I);function nt(t){if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)$(t[n]);else $(t)}tt.prototype.on,tt.prototype.once,tt.prototype.un;var it=tt,rt=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),et=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.key=i,e.oldValue=r,e}return rt(n,t),n}(f),ot=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,o(i),i.A=null,void 0!==n&&i.setProperties(n),i}return rt(n,t),n.prototype.get=function(t){var n;return this.A&&this.A.hasOwnProperty(t)&&(n=this.A[t]),n},n.prototype.getKeys=function(){return this.A&&Object.keys(this.A)||[]},n.prototype.getProperties=function(){return this.A&&E({},this.A)||{}},n.prototype.hasProperties=function(){return!!this.A},n.prototype.notify=function(t,n){var i;i="change:".concat(t),this.hasListener(i)&&this.dispatchEvent(new et(i,t,n)),i=l,this.hasListener(i)&&this.dispatchEvent(new et(i,t,n))},n.prototype.addChangeListener=function(t,n){this.addEventListener("change:".concat(t),n)},n.prototype.removeChangeListener=function(t,n){this.removeEventListener("change:".concat(t),n)},n.prototype.set=function(t,n,i){var r=this.A||(this.A={});if(i)r[t]=n;else{var e=r[t];r[t]=n,e!==n&&this.notify(t,e)}},n.prototype.setProperties=function(t,n){for(var i in t)this.set(i,t[i],n)},n.prototype.applyProperties=function(t){t.A&&E(this.A||(this.A={}),t.A)},n.prototype.unset=function(t,n){if(this.A&&t in this.A){var i=this.A[t];delete this.A[t],R(this.A)&&(this.A=null),n||this.notify(t,i)}},n}(it),st="add",at="remove",ut=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ct="length",ht=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.element=i,e.index=r,e}return ut(n,t),n}(f),ft=function(t){function n(n,i){var r=t.call(this)||this;r.on,r.once,r.un;var e=i||{};if(r.C=!!e.unique,r.R=n||[],r.C)for(var o=0,s=r.R.length;o<s;++o)r.P(r.R[o],o);return r.G(),r}return ut(n,t),n.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},n.prototype.extend=function(t){for(var n=0,i=t.length;n<i;++n)this.push(t[n]);return this},n.prototype.forEach=function(t){for(var n=this.R,i=0,r=n.length;i<r;++i)t(n[i],i,n)},n.prototype.getArray=function(){return this.R},n.prototype.item=function(t){return this.R[t]},n.prototype.getLength=function(){return this.get(ct)},n.prototype.insertAt=function(t,n){this.C&&this.P(n),this.R.splice(t,0,n),this.G(),this.dispatchEvent(new ht(st,n,t))},n.prototype.pop=function(){return this.removeAt(this.getLength()-1)},n.prototype.push=function(t){this.C&&this.P(t);var n=this.getLength();return this.insertAt(n,t),this.getLength()},n.prototype.remove=function(t){for(var n=this.R,i=0,r=n.length;i<r;++i)if(n[i]===t)return this.removeAt(i)},n.prototype.removeAt=function(t){var n=this.R[t];return this.R.splice(t,1),this.G(),this.dispatchEvent(new ht(at,n,t)),n},n.prototype.setAt=function(t,n){var i=this.getLength();if(t<i){this.C&&this.P(n,t);var r=this.R[t];this.R[t]=n,this.dispatchEvent(new ht(at,r,t)),this.dispatchEvent(new ht(st,n,t))}else{for(var e=i;e<t;++e)this.insertAt(e,void 0);this.insertAt(t,n)}},n.prototype.G=function(){this.set(ct,this.R.length)},n.prototype.P=function(t,n){for(var i=0,r=this.R.length;i<r;++i)if(this.R[i]===t&&i!==n)throw new c(58)},n}(ot),lt=0,vt=1,dt=2,pt=3,yt=4;function mt(t){return Math.pow(t,3)}function wt(t){return 1-mt(1-t)}function bt(t){return 3*t*t-2*t*t*t}function gt(t){return t}var xt=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jt=function(t){function n(n,i,r){var e=t.call(this)||this,o=r||{};return e.tileCoord=n,e.state=i,e.interimTile=null,e.key="",e.D=void 0===o.transition?250:o.transition,e.U={},e.interpolate=!!o.interpolate,e}return xt(n,t),n.prototype.changed=function(){this.dispatchEvent(N)},n.prototype.release=function(){},n.prototype.getKey=function(){return this.key+"/"+this.tileCoord},n.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==dt)return this.D=0,t;t=t.interimTile}while(t);return this},n.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,n=this;do{if(t.getState()==dt){t.interimTile=null;break}t.getState()==vt?n=t:t.getState()==lt?n.interimTile=t.interimTile:n=t,t=n.interimTile}while(t)}},n.prototype.getTileCoord=function(){return this.tileCoord},n.prototype.getState=function(){return this.state},n.prototype.setState=function(t){if(this.state!==pt&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){r()},n.prototype.getAlpha=function(t,n){if(!this.D)return 1;var i=this.U[t];if(i){if(-1===i)return 1}else i=n,this.U[t]=i;var r=n-i+1e3/60;return r>=this.D?1:mt(r/this.D)},n.prototype.inTransition=function(t){return!!this.D&&-1!==this.U[t]},n.prototype.endTransition=function(t){this.D&&(this.U[t]=-1)},n}(I),St=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kt=function(t){function n(n){var i=this,r=lt;return(i=t.call(this,n.tileCoord,r,{transition:n.transition,interpolate:n.interpolate})||this).q=n.loader,i.B=null,i.W=null,i}return St(n,t),n.prototype.getData=function(){return this.B},n.prototype.getError=function(){return this.W},n.prototype.load=function(){this.state=vt,this.changed();var t=this;this.q().then((function(n){t.B=n,t.state=dt,t.changed()})).catch((function(n){t.W=n,t.state=pt,t.changed()}))},n}(jt);function Mt(t,n){if(!t)throw new c(n)}var _t=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Ot(t){return"function"==typeof t?t:(Array.isArray(t)?n=t:(Mt("function"==typeof t.getZIndex,41),n=[t]),function(){return n});var n}var Tt=function(t){function n(n){var i=t.call(this)||this;if(i.on,i.once,i.un,i.V=void 0,i.H="geometry",i.K=null,i.tt=void 0,i.nt=null,i.addChangeListener(i.H,i.it),n)if("function"==typeof n.getSimplifiedGeometry){var r=n;i.setGeometry(r)}else{var e=n;i.setProperties(e)}return i}return _t(n,t),n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.H)},n.prototype.getId=function(){return this.V},n.prototype.getGeometryName=function(){return this.H},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.rt=function(){this.changed()},n.prototype.it=function(){this.nt&&($(this.nt),this.nt=null);var t=this.getGeometry();t&&(this.nt=Y(t,N,this.rt,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.H,t)},n.prototype.setStyle=function(t){this.K=t,this.tt=t?Ot(t):void 0,this.changed()},n.prototype.setId=function(t){this.V=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.H,this.it),this.H=t,this.addChangeListener(this.H,this.it),this.it()},n}(ot),Et="XY",At="XYZ",Ct="XYM",Rt="XYZM",Pt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},It={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Nt={9001:It.METERS,9002:It.FEET,9003:It.USFEET,9101:It.RADIANS,9102:It.DEGREES};function zt(t){return Nt[t]}var Ft={};Ft[It.RADIANS]=6370997/(2*Math.PI),Ft[It.DEGREES]=2*Math.PI*6370997/360,Ft[It.FEET]=.3048,Ft[It.METERS]=1,Ft[It.USFEET]=1200/3937;var Lt,Gt=It,Dt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Ut=-1!==Dt.indexOf("firefox"),qt=-1!==Dt.indexOf("safari")&&-1==Dt.indexOf("chrom"),Bt=qt&&!!(Dt.indexOf("version/15.4")>=0||Dt.match(/cpu (os|iphone os) 15_4 like mac os x/)),Wt=-1!==Dt.indexOf("webkit")&&-1==Dt.indexOf("edge"),Vt=-1!==Dt.indexOf("macintosh"),Xt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Ht="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Jt="undefined"!=typeof Image&&Image.prototype.decode,Kt=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return t}(),Yt=new Array(6);function Zt(){return[1,0,0,1,0,0]}function $t(t){return tn(t,1,0,0,1,0,0)}function Qt(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=t[4],a=t[5],u=n[0],c=n[1],h=n[2],f=n[3],l=n[4],v=n[5];return t[0]=i*u+e*c,t[1]=r*u+o*c,t[2]=i*h+e*f,t[3]=r*h+o*f,t[4]=i*l+e*v+s,t[5]=r*l+o*v+a,t}function tn(t,n,i,r,e,o,s){return t[0]=n,t[1]=i,t[2]=r,t[3]=e,t[4]=o,t[5]=s,t}function nn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function rn(t,n){var i=n[0],r=n[1];return n[0]=t[0]*i+t[2]*r+t[4],n[1]=t[1]*i+t[3]*r+t[5],n}function en(t,n){var i=Math.cos(n),r=Math.sin(n);return Qt(t,tn(Yt,i,r,-r,i,0,0))}function on(t,n,i){return Qt(t,tn(Yt,n,0,0,i,0,0))}function sn(t,n,i){return tn(t,n,0,0,i,0,0)}function an(t,n,i){return Qt(t,tn(Yt,1,0,0,1,n,i))}function un(t,n,i,r,e,o,s,a){var u=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=e*u,t[2]=-r*u,t[3]=e*c,t[4]=s*r*c-a*r*u+n,t[5]=s*e*u+a*e*c+i,t}function cn(t,n){var i=hn(n);Mt(0!==i,32);var r=n[0],e=n[1],o=n[2],s=n[3],a=n[4],u=n[5];return t[0]=s/i,t[1]=-e/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*u-s*a)/i,t[5]=-(r*u-e*a)/i,t}function hn(t){return t[0]*t[3]-t[1]*t[2]}function fn(t){var n="matrix("+t.join(", ")+")";if(Ht)return n;var i=Lt||(Lt=document.createElement("div"));return i.style.transform=n,i.style.transform}var ln="bottom-left",vn="bottom-right",dn="top-left",pn="top-right",yn=0,mn=1,wn=2,bn=4,gn=8,xn=16;function jn(t){for(var n=An(),i=0,r=t.length;i<r;++i)Ln(n,t[i]);return n}function Sn(t,n,i){return i?(i[0]=t[0]-n,i[1]=t[1]-n,i[2]=t[2]+n,i[3]=t[3]+n,i):[t[0]-n,t[1]-n,t[2]+n,t[3]+n]}function kn(t,n){return n?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):t.slice()}function Mn(t,n,i){var r,e;return(r=n<t[0]?t[0]-n:t[2]<n?n-t[2]:0)*r+(e=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*e}function _n(t,n){return Tn(t,n[0],n[1])}function On(t,n){return t[0]<=n[0]&&n[2]<=t[2]&&t[1]<=n[1]&&n[3]<=t[3]}function Tn(t,n,i){return t[0]<=n&&n<=t[2]&&t[1]<=i&&i<=t[3]}function En(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=n[0],a=n[1],u=yn;return s<i?u|=xn:s>e&&(u|=bn),a<r?u|=gn:a>o&&(u|=wn),u===yn&&(u=mn),u}function An(){return[1/0,1/0,-1/0,-1/0]}function Cn(t,n,i,r,e){return e?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]}function Rn(t){return Cn(1/0,1/0,-1/0,-1/0,t)}function Pn(t,n){var i=t[0],r=t[1];return Cn(i,r,i,r,n)}function In(t,n,i,r,e){return Dn(Rn(e),t,n,i,r)}function Nn(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function zn(t,n,i){return Math.abs(t[0]-n[0])<i&&Math.abs(t[2]-n[2])<i&&Math.abs(t[1]-n[1])<i&&Math.abs(t[3]-n[3])<i}function Fn(t,n){return n[0]<t[0]&&(t[0]=n[0]),n[2]>t[2]&&(t[2]=n[2]),n[1]<t[1]&&(t[1]=n[1]),n[3]>t[3]&&(t[3]=n[3]),t}function Ln(t,n){n[0]<t[0]&&(t[0]=n[0]),n[0]>t[2]&&(t[2]=n[0]),n[1]<t[1]&&(t[1]=n[1]),n[1]>t[3]&&(t[3]=n[1])}function Gn(t,n){for(var i=0,r=n.length;i<r;++i)Ln(t,n[i]);return t}function Dn(t,n,i,r,e){for(;i<r;i+=e)qn(t,n[i],n[i+1]);return t}function Un(t,n){for(var i=0,r=n.length;i<r;++i)Gn(t,n[i]);return t}function qn(t,n,i){t[0]=Math.min(t[0],n),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],n),t[3]=Math.max(t[3],i)}function Bn(t,n){var i;return(i=n(Vn(t)))||(i=n(Xn(t)))||(i=n(Qn(t)))?i:(i=n($n(t)))||!1}function Wn(t){var n=0;return ii(t)||(n=ti(t)*Yn(t)),n}function Vn(t){return[t[0],t[1]]}function Xn(t){return[t[2],t[1]]}function Hn(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Jn(t,n){var i;return n===ln?i=Vn(t):n===vn?i=Xn(t):n===dn?i=$n(t):n===pn?i=Qn(t):Mt(!1,13),i}function Kn(t,n,i,r,e){var o=n*r[0]/2,s=n*r[1]/2,a=Math.cos(i),u=Math.sin(i),c=o*a,h=o*u,f=s*a,l=s*u,v=t[0],d=t[1],p=v-c+l,y=v-c-l,m=v+c-l,w=v+c+l,b=d-h-f,g=d-h+f,x=d+h+f,j=d+h-f;return Cn(Math.min(p,y,m,w),Math.min(b,g,x,j),Math.max(p,y,m,w),Math.max(b,g,x,j),e)}function Yn(t){return t[3]-t[1]}function Zn(t,n,i){var r=i||[1/0,1/0,-1/0,-1/0];return ni(t,n)?(t[0]>n[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]<n[2]?r[2]=t[2]:r[2]=n[2],t[3]<n[3]?r[3]=t[3]:r[3]=n[3]):Rn(r),r}function $n(t){return[t[0],t[3]]}function Qn(t){return[t[2],t[3]]}function ti(t){return t[2]-t[0]}function ni(t,n){return t[0]<=n[2]&&t[2]>=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function ii(t){return t[2]<t[0]||t[3]<t[1]}function ri(t,n){return n?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):t}function ei(t,n){var i=(t[2]-t[0])/2*(n-1),r=(t[3]-t[1])/2*(n-1);t[0]-=i,t[2]+=i,t[1]-=r,t[3]+=r}function oi(t,n,i){var r=!1,e=En(t,n),o=En(t,i);if(e===mn||o===mn)r=!0;else{var s=t[0],a=t[1],u=t[2],c=t[3],h=n[0],f=n[1],l=i[0],v=i[1],d=(v-f)/(l-h),p=void 0,y=void 0;o&wn&&!(e&wn)&&(r=(p=l-(v-c)/d)>=s&&p<=u),r||!(o&bn)||e&bn||(r=(y=v-(l-u)*d)>=a&&y<=c),r||!(o&gn)||e&gn||(r=(p=l-(v-a)/d)>=s&&p<=u),r||!(o&xn)||e&xn||(r=(y=v-(l-s)*d)>=a&&y<=c)}return r}function si(t,n,i,r){var e=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<r;++a)e.push(t[0]+o*a/r,t[1],t[2],t[1]+s*a/r,t[2]-o*a/r,t[3],t[0],t[3]-s*a/r);else e=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];n(e,e,2);for(var u=[],c=[],h=(a=0,e.length);a<h;a+=2)u.push(e[a]),c.push(e[a+1]);return function(t,n,i){return Cn(Math.min.apply(null,t),Math.min.apply(null,n),Math.max.apply(null,t),Math.max.apply(null,n),i)}(u,c,i)}function ai(t,n){var i=n.getExtent(),r=Hn(t);if(n.canWrapX()&&(r[0]<i[0]||r[0]>=i[2])){var e=ti(i),o=Math.floor((r[0]-i[0])/e)*e;t[0]-=o,t[2]-=o}return t}var ui=function(){function t(t){this.et=t.code,this.ot=t.units,this.st=void 0!==t.extent?t.extent:null,this.ut=void 0!==t.worldExtent?t.worldExtent:null,this.ct=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.ht=void 0!==t.global&&t.global,this.ft=!(!this.ht||!this.st),this.lt=t.getPointResolution,this.vt=null,this.dt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.ft},t.prototype.getCode=function(){return this.et},t.prototype.getExtent=function(){return this.st},t.prototype.getUnits=function(){return this.ot},t.prototype.getMetersPerUnit=function(){return this.dt||Ft[this.ot]},t.prototype.getWorldExtent=function(){return this.ut},t.prototype.getAxisOrientation=function(){return this.ct},t.prototype.isGlobal=function(){return this.ht},t.prototype.setGlobal=function(t){this.ht=t,this.ft=!(!t||!this.st)},t.prototype.getDefaultTileGrid=function(){return this.vt},t.prototype.setDefaultTileGrid=function(t){this.vt=t},t.prototype.setExtent=function(t){this.st=t,this.ft=!(!this.ht||!t)},t.prototype.setWorldExtent=function(t){this.ut=t},t.prototype.setGetPointResolution=function(t){this.lt=t},t.prototype.getPointResolutionFunc=function(){return this.lt},t}();function ci(t,n,i){return Math.min(Math.max(t,n),i)}var hi="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},fi="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function li(t,n,i,r,e,o){var s=e-i,a=o-r;if(0!==s||0!==a){var u=((t-i)*s+(n-r)*a)/(s*s+a*a);u>1?(i=e,r=o):u>0&&(i+=s*u,r+=a*u)}return vi(t,n,i,r)}function vi(t,n,i,r){var e=i-t,o=r-n;return e*e+o*o}function di(t){for(var n=t.length,i=0;i<n;i++){for(var r=i,e=Math.abs(t[i][i]),o=i+1;o<n;o++){var s=Math.abs(t[o][i]);s>e&&(e=s,r=o)}if(0===e)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var u=i+1;u<n;u++)for(var c=-t[u][i]/t[i][i],h=i;h<n+1;h++)i==h?t[u][h]=0:t[u][h]+=c*t[i][h]}for(var f=new Array(n),l=n-1;l>=0;l--){f[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*f[l]}return f}function pi(t){return 180*t/Math.PI}function yi(t){return t*Math.PI/180}function mi(t,n){var i=t%n;return i*n<0?i+n:i}function wi(t,n,i){return t+i*(n-t)}function bi(t,n){var i=Math.pow(10,n);return Math.round(t*i)/i}function gi(t,n){return Math.round(bi(t,n))}function xi(t,n){return Math.floor(bi(t,n))}function ji(t,n){return Math.ceil(bi(t,n))}var Si=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ki=6378137,Mi=Math.PI*ki,_i=[-Mi,-Mi,Mi,Mi],Oi=[-180,-85,180,85],Ti=ki*Math.log(Math.tan(Math.PI/2)),Ei=function(t){function n(n){return t.call(this,{code:n,units:Gt.METERS,extent:_i,global:!0,worldExtent:Oi,getPointResolution:function(t,n){return t/hi(n[1]/ki)}})||this}return Si(n,t),n}(ui),Ai=[new Ei("EPSG:3857"),new Ei("EPSG:102100"),new Ei("EPSG:102113"),new Ei("EPSG:900913"),new Ei("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ei("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ci(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;s<r;s+=e){o[s]=Mi*t[s]/180;var a=ki*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Ti?a=Ti:a<-Ti&&(a=-Ti),o[s+1]=a}return o}function Ri(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;s<r;s+=e)o[s]=180*t[s]/Mi,o[s+1]=360*Math.atan(Math.exp(t[s+1]/ki))/Math.PI-90;return o}var Pi=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ii=6378137,Ni=[-180,-90,180,90],zi=Math.PI*Ii/180,Fi=function(t){function n(n,i){return t.call(this,{code:n,units:Gt.DEGREES,extent:Ni,axisOrientation:i,global:!0,metersPerUnit:zi,worldExtent:Ni})||this}return Pi(n,t),n}(ui),Li=[new Fi("CRS:84"),new Fi("EPSG:4326","neu"),new Fi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Fi("urn:ogc:def:crs:OGC:2:84"),new Fi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Fi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Gi={};function Di(){Gi={}}function Ui(t){return Gi[t]||Gi[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function qi(t,n){Gi[t]=n}var Bi={};function Wi(){Bi={}}function Vi(t,n,i){var r=t.getCode(),e=n.getCode();r in Bi||(Bi[r]={}),Bi[r][e]=i}function Xi(t,n){var i;return t in Bi&&n in Bi[t]&&(i=Bi[t][n]),i}function Hi(t,n,i){var r=void 0!==i?t.toFixed(i):""+t,e=r.indexOf(".");return(e=-1===e?r.length:e)>n?r:new Array(1+n-e).join("0")+r}function Ji(t,n){for(var i=(""+t).split("."),r=(""+n).split("."),e=0;e<Math.max(i.length,r.length);e++){var o=parseInt(i[e]||"0",10),s=parseInt(r[e]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}function Ki(t,n){return t[0]+=+n[0],t[1]+=+n[1],t}function Yi(t,n){var i=n.getRadius(),r=n.getCenter(),e=r[0],o=r[1],s=t[0]-e,a=t[1]-o;0===s&&0===a&&(s=1);var u=Math.sqrt(s*s+a*a);return[e+i*s/u,o+i*a/u]}function Zi(t,n){var i,r,e=t[0],o=t[1],s=n[0],a=n[1],u=s[0],c=s[1],h=a[0],f=a[1],l=h-u,v=f-c,d=0===l&&0===v?0:(l*(e-u)+v*(o-c))/(l*l+v*v||0);return d<=0?(i=u,r=c):d>=1?(i=h,r=f):(i=u+d*l,r=c+d*v),[i,r]}function $i(t,n,i){var r=mi(n+180,360)-180,e=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),a=Math.floor(e/3600),u=Math.floor((e-3600*a)/60),c=e-3600*a-60*u;return(c=Math.ceil(c*s)/s)>=60&&(c=0,u+=1),u>=60&&(u=0,a+=1),a+"° "+Hi(u,2)+"′ "+Hi(c,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function Qi(t,n,i){return t?n.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function tr(t,n){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=n[r]){i=!1;break}return i}function nr(t,n){var i=Math.cos(n),r=Math.sin(n),e=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=e,t[1]=o,t}function ir(t,n){return t[0]*=n,t[1]*=n,t}function rr(t,n){var i=t[0]-n[0],r=t[1]-n[1];return i*i+r*r}function er(t,n){return Math.sqrt(rr(t,n))}function or(t,n){return rr(t,Zi(t,n))}function sr(t,n){return Qi(t,"{x}, {y}",n)}function ar(t,n){if(n.canWrapX()){var i=ti(n.getExtent()),r=ur(t,n,i);r&&(t[0]-=r*i)}return t}function ur(t,n,i){var r=n.getExtent(),e=0;if(n.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=i||ti(r);e=Math.floor((t[0]-r[0])/o)}return e}var cr=6371008.8;function hr(t,n,i){var r=i||cr,e=yi(t[1]),o=yi(n[1]),s=(o-e)/2,a=yi(n[0]-t[0])/2,u=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(e)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function fr(t,n){for(var i=0,r=0,e=t.length;r<e-1;++r)i+=hr(t[r],t[r+1],n);return i}function lr(t,n){for(var i=0,r=t.length,e=t[r-1][0],o=t[r-1][1],s=0;s<r;s++){var a=t[s][0],u=t[s][1];i+=yi(a-e)*(2+Math.sin(yi(o))+Math.sin(yi(u))),e=a,o=u}return i*n*n/2}function vr(t,n,i,r){var e=r||cr,o=yi(t[1]),s=yi(t[0]),a=n/e,u=Math.asin(Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(i));return[pi(s+Math.atan2(Math.sin(i)*Math.sin(a)*Math.cos(o),Math.cos(a)-Math.sin(o)*Math.sin(u))),pi(u)]}var dr=!0;function pr(t){dr=!(void 0===t||t)}function yr(t,n,i){var r;if(void 0!==n){for(var e=0,o=t.length;e<o;++e)n[e]=t[e];r=n}else r=t.slice();return r}function mr(t,n,i){if(void 0!==n&&t!==n){for(var r=0,e=t.length;r<e;++r)n[r]=t[r];t=n}return t}function wr(t){qi(t.getCode(),t),Vi(t,t,yr)}function br(t){t.forEach(wr)}function gr(t){return"string"==typeof t?Ui(t):t||null}function xr(t,n,i,r){var e,o=(t=gr(t)).getPointResolutionFunc();if(o){if(e=o(n,i),r&&r!==t.getUnits())(a=t.getMetersPerUnit())&&(e=e*a/Ft[r])}else{var s=t.getUnits();if(s==Gt.DEGREES&&!r||r==Gt.DEGREES)e=n;else{var a,u=Er(t,gr("EPSG:4326"));if(u===mr&&s!==Gt.DEGREES)e=n*t.getMetersPerUnit();else{var c=[i[0]-n/2,i[1],i[0]+n/2,i[1],i[0],i[1]-n/2,i[0],i[1]+n/2];e=(hr((c=u(c,c,2)).slice(0,2),c.slice(2,4))+hr(c.slice(4,6),c.slice(6,8)))/2}void 0!==(a=r?Ft[r]:t.getMetersPerUnit())&&(e/=a)}}return e}function jr(t){br(t),t.forEach((function(n){t.forEach((function(t){n!==t&&Vi(n,t,yr)}))}))}function Sr(t,n,i,r){t.forEach((function(t){n.forEach((function(n){Vi(t,n,i),Vi(n,t,r)}))}))}function kr(t,n){return t?"string"==typeof t?gr(t):t:gr(n)}function Mr(t){return function(n,i,r){for(var e=n.length,o=void 0!==r?r:2,s=void 0!==i?i:new Array(e),a=0;a<e;a+=o){var u=t([n[a],n[a+1]]);s[a]=u[0],s[a+1]=u[1];for(var c=o-1;c>=2;--c)s[a+c]=n[a+c]}return s}}function _r(t,n,i,r){var e=gr(t),o=gr(n);Vi(e,o,Mr(i)),Vi(o,e,Mr(r))}function Or(t,n){return pr(),Cr(t,"EPSG:4326",void 0!==n?n:"EPSG:3857")}function Tr(t,n){if(t===n)return!0;var i=t.getUnits()===n.getUnits();return(t.getCode()===n.getCode()||Er(t,n)===yr)&&i}function Er(t,n){var i=Xi(t.getCode(),n.getCode());return i||(i=mr),i}function Ar(t,n){return Er(gr(t),gr(n))}function Cr(t,n,i){return Ar(n,i)(t,void 0,t.length)}function Rr(t,n,i,r){return si(t,Ar(n,i),void 0,r)}var Pr=null;function Ir(t){Pr=gr(t)}function Nr(){return Pr}function zr(t,n){return Pr?Cr(t,n,Pr):t}function Fr(t,n){return Pr?Cr(t,Pr,n):(dr&&!tr(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(dr=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Lr(t,n){return Pr?Rr(t,n,Pr):t}function Gr(t,n){return Pr?Rr(t,Pr,n):t}function Dr(t,n){if(!Pr)return t;var i=gr(n).getUnits(),r=Pr.getUnits();return i&&r?t*Ft[i]/Ft[r]:t}function Ur(t,n){if(!Pr)return t;var i=gr(n).getUnits(),r=Pr.getUnits();return i&&r?t*Ft[r]/Ft[i]:t}function qr(t,n,i){return function(r){var e,o,s=r[0],a=r[1];if(t.canWrapX()){var u=t.getExtent(),c=ti(u);(o=ur(r,t,c))&&(s-=o*c),s=ci(s,u[0],u[2]),a=ci(a,u[1],u[3]),e=i([s,a])}else e=i(r);return o&&n.canWrapX()&&(e[0]+=o*ti(n.getExtent())),e}}function Br(){jr(Ai),jr(Li),Sr(Li,Ai,Ci,Ri)}function Wr(t,n,i,r,e,o){for(var s=o||[],a=0,u=n;u<i;u+=r){var c=t[u],h=t[u+1];s[a++]=e[0]*c+e[2]*h+e[4],s[a++]=e[1]*c+e[3]*h+e[5]}return o&&s.length!=a&&(s.length=a),s}function Vr(t,n,i,r,e,o,s){for(var a=s||[],u=Math.cos(e),c=Math.sin(e),h=o[0],f=o[1],l=0,v=n;v<i;v+=r){var d=t[v]-h,p=t[v+1]-f;a[l++]=h+d*u-p*c,a[l++]=f+d*c+p*u;for(var y=v+2;y<v+r;++y)a[l++]=t[y]}return s&&a.length!=l&&(a.length=l),a}function Xr(t,n,i,r,e,o,s,a){for(var u=a||[],c=s[0],h=s[1],f=0,l=n;l<i;l+=r){var v=t[l]-c,d=t[l+1]-h;u[f++]=c+e*v,u[f++]=h+o*d;for(var p=l+2;p<l+r;++p)u[f++]=t[p]}return a&&u.length!=f&&(u.length=f),u}function Hr(t,n,i,r,e,o,s){for(var a=s||[],u=0,c=n;c<i;c+=r){a[u++]=t[c]+e,a[u++]=t[c+1]+o;for(var h=c+2;h<c+r;++h)a[u++]=t[h]}return s&&a.length!=u&&(a.length=u),a}Br();var Jr=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kr=[1,0,0,1,0,0],Yr=function(t){function n(){var n=t.call(this)||this;return n.st=[1/0,1/0,-1/0,-1/0],n.yt=-1,n.simplifiedGeometryMaxMinSquaredTolerance=0,n.simplifiedGeometryRevision=0,n.simplifyTransformedInternal=O((function(t,n,i){if(!i)return this.getSimplifiedGeometry(n);var r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(n)})),n}return Jr(n,t),n.prototype.simplifyTransformed=function(t,n){return this.simplifyTransformedInternal(this.getRevision(),t,n)},n.prototype.clone=function(){return r()},n.prototype.closestPointXY=function(t,n,i,e){return r()},n.prototype.containsXY=function(t,n){var i=this.getClosestPoint([t,n]);return i[0]===t&&i[1]===n},n.prototype.getClosestPoint=function(t,n){var i=n||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},n.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},n.prototype.computeExtent=function(t){return r()},n.prototype.getExtent=function(t){if(this.yt!=this.getRevision()){var n=this.computeExtent(this.st);(isNaN(n[0])||isNaN(n[1]))&&Rn(n),this.yt=this.getRevision()}return ri(this.st,t)},n.prototype.rotate=function(t,n){r()},n.prototype.scale=function(t,n,i){r()},n.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},n.prototype.getSimplifiedGeometry=function(t){return r()},n.prototype.getType=function(){return r()},n.prototype.applyTransform=function(t){r()},n.prototype.intersectsExtent=function(t){return r()},n.prototype.translate=function(t,n){r()},n.prototype.transform=function(t,n){var i=gr(t),r=i.getUnits()==Gt.TILE_PIXELS?function(t,r,e){var o=i.getExtent(),s=i.getWorldExtent(),a=Yn(s)/Yn(o);return un(Kr,s[0],s[3],a,-a,0,0,0),Wr(t,0,t.length,e,Kr,r),Ar(i,n)(t,r,e)}:Ar(i,n);return this.applyTransform(r),this},n}(ot),Zr=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function $r(t){var n;return t==Et?n=2:t==At||t==Ct?n=3:t==Rt&&(n=4),n}function Qr(t,n,i){var r=t.getFlatCoordinates();if(r){var e=t.getStride();return Wr(r,0,r.length,e,n,i)}return null}var te=function(t){function n(){var n=t.call(this)||this;return n.layout=Et,n.stride=2,n.flatCoordinates=null,n}return Zr(n,t),n.prototype.computeExtent=function(t){return In(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinates=function(){return r()},n.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.getFlatCoordinates=function(){return this.flatCoordinates},n.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},n.prototype.getLayout=function(){return this.layout},n.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var n=this.getSimplifiedGeometryInternal(t);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},n.prototype.getSimplifiedGeometryInternal=function(t){return this},n.prototype.getStride=function(){return this.stride},n.prototype.setFlatCoordinates=function(t,n){this.stride=$r(t),this.layout=t,this.flatCoordinates=n},n.prototype.setCoordinates=function(t,n){r()},n.prototype.setLayout=function(t,n,i){var r;if(t)r=$r(t);else{for(var e=0;e<i;++e){if(0===n.length)return this.layout=Et,void(this.stride=2);n=n[0]}t=function(t){var n;2==t?n=Et:3==t?n=At:4==t&&(n=Rt);return n}(r=n.length)}this.layout=t,this.stride=r},n.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},n.prototype.rotate=function(t,n){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Vr(i,0,i.length,r,t,n,i),this.changed()}},n.prototype.scale=function(t,n,i){var r=n;void 0===r&&(r=t);var e=i;e||(e=Hn(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();Xr(o,0,o.length,s,t,r,e,o),this.changed()}},n.prototype.translate=function(t,n){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Hr(i,0,i.length,r,t,n,i),this.changed()}},n}(Yr);function ne(t,n,i,r,e,o,s){var a,u=t[n],c=t[n+1],h=t[i]-u,f=t[i+1]-c;if(0===h&&0===f)a=n;else{var l=((e-u)*h+(o-c)*f)/(h*h+f*f);if(l>1)a=i;else{if(l>0){for(var v=0;v<r;++v)s[v]=wi(t[n+v],t[i+v],l);return void(s.length=r)}a=n}}for(v=0;v<r;++v)s[v]=t[a+v];s.length=r}function ie(t,n,i,r,e){var o=t[n],s=t[n+1];for(n+=r;n<i;n+=r){var a=t[n],u=t[n+1],c=vi(o,s,a,u);c>e&&(e=c),o=a,s=u}return e}function re(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var a=i[o];e=ie(t,n,a,r,e),n=a}return e}function ee(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var a=i[o];e=re(t,n,a,r,e),n=a[a.length-1]}return e}function oe(t,n,i,r,e,o,s,a,u,c,h){if(n==i)return c;var f,l;if(0===e){if((l=vi(s,a,t[n],t[n+1]))<c){for(f=0;f<r;++f)u[f]=t[n+f];return u.length=r,l}return c}for(var v=h||[NaN,NaN],d=n+r;d<i;)if(ne(t,d-r,d,r,s,a,v),(l=vi(s,a,v[0],v[1]))<c){for(c=l,f=0;f<r;++f)u[f]=v[f];u.length=r,d+=r}else d+=r*Math.max((Math.sqrt(l)-Math.sqrt(c))/e|0,1);if(o&&(ne(t,i-r,n,r,s,a,v),(l=vi(s,a,v[0],v[1]))<c)){for(c=l,f=0;f<r;++f)u[f]=v[f];u.length=r}return c}function se(t,n,i,r,e,o,s,a,u,c,h){for(var f=h||[NaN,NaN],l=0,v=i.length;l<v;++l){var d=i[l];c=oe(t,n,d,r,e,o,s,a,u,c,f),n=d}return c}function ae(t,n,i,r,e,o,s,a,u,c,h){for(var f=h||[NaN,NaN],l=0,v=i.length;l<v;++l){var d=i[l];c=se(t,n,d,r,e,o,s,a,u,c,f),n=d[d.length-1]}return c}function ue(t,n,i,r){for(var e=0,o=i.length;e<o;++e)t[n++]=i[e];return n}function ce(t,n,i,r){for(var e=0,o=i.length;e<o;++e)for(var s=i[e],a=0;a<r;++a)t[n++]=s[a];return n}function he(t,n,i,r,e){for(var o=e||[],s=0,a=0,u=i.length;a<u;++a){var c=ce(t,n,i[a],r);o[s++]=c,n=c}return o.length=s,o}function fe(t,n,i,r,e){for(var o=e||[],s=0,a=0,u=i.length;a<u;++a){var c=he(t,n,i[a],r,o[s]);o[s++]=c,n=c[c.length-1]}return o.length=s,o}function le(t,n,i,r,e,o,s){var a=(i-n)/r;if(a<3){for(;n<i;n+=r)o[s++]=t[n],o[s++]=t[n+1];return s}var u=new Array(a);u[0]=1,u[a-1]=1;for(var c=[n,i-r],h=0;c.length>0;){for(var f=c.pop(),l=c.pop(),v=0,d=t[l],p=t[l+1],y=t[f],m=t[f+1],w=l+r;w<f;w+=r){var b=li(t[w],t[w+1],d,p,y,m);b>v&&(h=w,v=b)}v>e&&(u[(h-n)/r]=1,l+r<h&&c.push(l,h),h+r<f&&c.push(h,f))}for(w=0;w<a;++w)u[w]&&(o[s++]=t[n+w*r],o[s++]=t[n+w*r+1]);return s}function ve(t,n,i,r,e,o,s,a){for(var u=0,c=i.length;u<c;++u){var h=i[u];s=le(t,n,h,r,e,o,s),a.push(s),n=h}return s}function de(t,n,i,r,e,o,s){if(i<=n+r){for(;n<i;n+=r)o[s++]=t[n],o[s++]=t[n+1];return s}var a=t[n],u=t[n+1];o[s++]=a,o[s++]=u;var c=a,h=u;for(n+=r;n<i;n+=r)vi(a,u,c=t[n],h=t[n+1])>e&&(o[s++]=c,o[s++]=h,a=c,u=h);return c==a&&h==u||(o[s++]=c,o[s++]=h),s}function pe(t,n){return n*Math.round(t/n)}function ye(t,n,i,r,e,o,s){if(n==i)return s;var a,u,c=pe(t[n],e),h=pe(t[n+1],e);n+=r,o[s++]=c,o[s++]=h;do{if(a=pe(t[n],e),u=pe(t[n+1],e),(n+=r)==i)return o[s++]=a,o[s++]=u,s}while(a==c&&u==h);for(;n<i;){var f=pe(t[n],e),l=pe(t[n+1],e);if(n+=r,f!=a||l!=u){var v=a-c,d=u-h,p=f-c,y=l-h;v*y==d*p&&(v<0&&p<v||v==p||v>0&&p>v)&&(d<0&&y<d||d==y||d>0&&y>d)?(a=f,u=l):(o[s++]=a,o[s++]=u,c=a,h=u,a=f,u=l)}}return o[s++]=a,o[s++]=u,s}function me(t,n,i,r,e,o,s,a){for(var u=0,c=i.length;u<c;++u){var h=i[u];s=ye(t,n,h,r,e,o,s),a.push(s),n=h}return s}function we(t,n,i,r,e,o,s,a){for(var u=0,c=i.length;u<c;++u){var h=i[u],f=[];s=me(t,n,h,r,e,o,s,f),a.push(f),n=h[h.length-1]}return s}function be(t,n,i,r,e){for(var o=void 0!==e?e:[],s=0,a=n;a<i;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function ge(t,n,i,r,e){for(var o=void 0!==e?e:[],s=0,a=0,u=i.length;a<u;++a){var c=i[a];o[s++]=be(t,n,c,r,o[s]),n=c}return o.length=s,o}function xe(t,n,i,r,e){for(var o=void 0!==e?e:[],s=0,a=0,u=i.length;a<u;++a){var c=i[a];o[s++]=ge(t,n,c,r,o[s]),n=c[c.length-1]}return o.length=s,o}function je(t,n,i,r){for(var e=0,o=t[i-r],s=t[i-r+1];n<i;n+=r){var a=t[n],u=t[n+1];e+=s*a-o*u,o=a,s=u}return e/2}function Se(t,n,i,r){for(var e=0,o=0,s=i.length;o<s;++o){var a=i[o];e+=je(t,n,a,r),n=a}return e}function ke(t,n,i,r){for(var e=0,o=0,s=i.length;o<s;++o){var a=i[o];e+=Se(t,n,a,r),n=a[a.length-1]}return e}var Me=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_e=function(t){function n(n,i){var r=t.call(this)||this;return r.wt=-1,r.bt=-1,void 0===i||Array.isArray(n[0])?r.setCoordinates(n,i):r.setFlatCoordinates(i,n),r}return Me(n,t),n.prototype.clone=function(){return new n(this.flatCoordinates.slice(),this.layout)},n.prototype.closestPointXY=function(t,n,i,r){return r<Mn(this.getExtent(),t,n)?r:(this.bt!=this.getRevision()&&(this.wt=Math.sqrt(ie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.bt=this.getRevision()),oe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.wt,!0,t,n,i,r))},n.prototype.getArea=function(){return je(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getCoordinates=function(){return be(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=le(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new n(i,Et)},n.prototype.getType=function(){return Pt.LINEAR_RING},n.prototype.intersectsExtent=function(t){return!1},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ce(this.flatCoordinates,0,t,this.stride),this.changed()},n}(te),Oe=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Te=function(t){function n(n,i){var r=t.call(this)||this;return r.setCoordinates(n,i),r}return Oe(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=vi(t,n,e[0],e[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)i[a]=e[a];return i.length=s,o}return r},n.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},n.prototype.computeExtent=function(t){return Pn(this.flatCoordinates,t)},n.prototype.getType=function(){return Pt.POINT},n.prototype.intersectsExtent=function(t){return Tn(t,this.flatCoordinates[0],this.flatCoordinates[1])},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ue(this.flatCoordinates,0,t,this.stride),this.changed()},n}(te);function Ee(t,n,i,r,e){return!Bn(e,(function(e){return!Ae(t,n,i,r,e[0],e[1])}))}function Ae(t,n,i,r,e,o){for(var s=0,a=t[i-r],u=t[i-r+1];n<i;n+=r){var c=t[n],h=t[n+1];u<=o?h>o&&(c-a)*(o-u)-(e-a)*(h-u)>0&&s++:h<=o&&(c-a)*(o-u)-(e-a)*(h-u)<0&&s--,a=c,u=h}return 0!==s}function Ce(t,n,i,r,e,o){if(0===i.length)return!1;if(!Ae(t,n,i[0],r,e,o))return!1;for(var s=1,a=i.length;s<a;++s)if(Ae(t,i[s-1],i[s],r,e,o))return!1;return!0}function Re(t,n,i,r,e,o){if(0===i.length)return!1;for(var s=0,a=i.length;s<a;++s){var u=i[s];if(Ce(t,n,u,r,e,o))return!0;n=u[u.length-1]}return!1}function Pe(t,n,i,r,e,o,s){for(var a,u,c,h,f,l,v,d=e[o+1],y=[],m=0,w=i.length;m<w;++m){var b=i[m];for(h=t[b-r],l=t[b-r+1],a=n;a<b;a+=r)f=t[a],v=t[a+1],(d<=l&&v<=d||l<=d&&d<=v)&&(c=(d-l)/(v-l)*(f-h)+h,y.push(c)),h=f,l=v}var g=NaN,x=-1/0;for(y.sort(p),h=y[0],a=1,u=y.length;a<u;++a){f=y[a];var j=Math.abs(f-h);j>x&&Ce(t,n,i,r,c=(h+f)/2,d)&&(g=c,x=j),h=f}return isNaN(g)&&(g=e[o]),s?(s.push(g,d,x),s):[g,d,x]}function Ie(t,n,i,r,e){for(var o=[],s=0,a=i.length;s<a;++s){var u=i[s];o=Pe(t,n,u,r,e,2*s,o),n=u[u.length-1]}return o}function Ne(t,n,i,r,e){var o;for(n+=r;n<i;n+=r)if(o=e(t.slice(n-r,n),t.slice(n,n+r)))return o;return!1}function ze(t,n,i,r,e){var o=Dn([1/0,1/0,-1/0,-1/0],t,n,i,r);return!!ni(e,o)&&(!!On(e,o)||(o[0]>=e[0]&&o[2]<=e[2]||(o[1]>=e[1]&&o[3]<=e[3]||Ne(t,n,i,r,(function(t,n){return oi(e,t,n)})))))}function Fe(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){if(ze(t,n,i[o],r,e))return!0;n=i[o]}return!1}function Le(t,n,i,r,e){return!!ze(t,n,i,r,e)||(!!Ae(t,n,i,r,e[0],e[1])||(!!Ae(t,n,i,r,e[0],e[3])||(!!Ae(t,n,i,r,e[2],e[1])||!!Ae(t,n,i,r,e[2],e[3]))))}function Ge(t,n,i,r,e){if(!Le(t,n,i[0],r,e))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o<s;++o)if(Ee(t,i[o-1],i[o],r,e)&&!ze(t,i[o-1],i[o],r,e))return!1;return!0}function De(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(Ge(t,n,a,r,e))return!0;n=a[a.length-1]}return!1}function Ue(t,n,i,r){for(;n<i-r;){for(var e=0;e<r;++e){var o=t[n+e];t[n+e]=t[i-r+e],t[i-r+e]=o}n+=r,i-=r}}function qe(t,n,i,r){for(var e=0,o=t[i-r],s=t[i-r+1];n<i;n+=r){var a=t[n],u=t[n+1];e+=(a-o)*(u+s),o=a,s=u}return 0===e?void 0:e>0}function Be(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,a=i.length;s<a;++s){var u=i[s],c=qe(t,n,u,r);if(0===s){if(o&&c||!o&&!c)return!1}else if(o&&!c||!o&&c)return!1;n=u}return!0}function We(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(!Be(t,n,a,r,e))return!1;a.length&&(n=a[a.length-1])}return!0}function Ve(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,a=i.length;s<a;++s){var u=i[s],c=qe(t,n,u,r);(0===s?o&&c||!o&&!c:o&&!c||!o&&c)&&Ue(t,n,u,r),n=u}return n}function Xe(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o)n=Ve(t,n,i[o],r,e);return n}function He(t,n){for(var i=[],r=0,e=0,o=0,s=n.length;o<s;++o){var a=n[o];if(qe(t,r,a,2)){if(0===i.length)continue;i[i.length-1].push(n[e])}else i.push(n.slice(e,o+1));e=o+1,r=a}return i}var Je=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ke=function(t){function n(n,i,r){var e=t.call(this)||this;return e.gt=[],e.xt=-1,e.jt=null,e.wt=-1,e.bt=-1,e.St=-1,e.kt=null,void 0!==i&&r?(e.setFlatCoordinates(i,n),e.gt=r):e.setCoordinates(n,i),e}return Je(n,t),n.prototype.appendLinearRing=function(t){this.flatCoordinates?b(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.gt.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout,this.gt.slice());return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){return r<Mn(this.getExtent(),t,n)?r:(this.bt!=this.getRevision()&&(this.wt=Math.sqrt(re(this.flatCoordinates,0,this.gt,this.stride,0)),this.bt=this.getRevision()),se(this.flatCoordinates,0,this.gt,this.stride,this.wt,!0,t,n,i,r))},n.prototype.containsXY=function(t,n){return Ce(this.getOrientedFlatCoordinates(),0,this.gt,this.stride,t,n)},n.prototype.getArea=function(){return Se(this.getOrientedFlatCoordinates(),0,this.gt,this.stride)},n.prototype.getCoordinates=function(t){var n;return void 0!==t?Ve(n=this.getOrientedFlatCoordinates().slice(),0,this.gt,this.stride,t):n=this.flatCoordinates,ge(n,0,this.gt,this.stride)},n.prototype.getEnds=function(){return this.gt},n.prototype.getFlatInteriorPoint=function(){if(this.xt!=this.getRevision()){var t=Hn(this.getExtent());this.jt=Pe(this.getOrientedFlatCoordinates(),0,this.gt,this.stride,t,0),this.xt=this.getRevision()}return this.jt},n.prototype.getInteriorPoint=function(){return new Te(this.getFlatInteriorPoint(),Ct)},n.prototype.getLinearRingCount=function(){return this.gt.length},n.prototype.getLinearRing=function(t){return t<0||this.gt.length<=t?null:new _e(this.flatCoordinates.slice(0===t?0:this.gt[t-1],this.gt[t]),this.layout)},n.prototype.getLinearRings=function(){for(var t=this.layout,n=this.flatCoordinates,i=this.gt,r=[],e=0,o=0,s=i.length;o<s;++o){var a=i[o],u=new _e(n.slice(e,a),t);r.push(u),e=a}return r},n.prototype.getOrientedFlatCoordinates=function(){if(this.St!=this.getRevision()){var t=this.flatCoordinates;Be(t,0,this.gt,this.stride)?this.kt=t:(this.kt=t.slice(),this.kt.length=Ve(this.kt,0,this.gt,this.stride)),this.St=this.getRevision()}return this.kt},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=me(this.flatCoordinates,0,this.gt,this.stride,Math.sqrt(t),i,0,r),new n(i,Et,r)},n.prototype.getType=function(){return Pt.POLYGON},n.prototype.intersectsExtent=function(t){return Ge(this.getOrientedFlatCoordinates(),0,this.gt,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=he(this.flatCoordinates,0,t,this.stride,this.gt);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},n}(te),Ye=Ke;function Ze(t,n,i,r){for(var e=i||32,o=[],s=0;s<e;++s)b(o,vr(t,n,2*Math.PI*s/e,r));return o.push(o[0],o[1]),new Ke(o,Et,[o.length])}function $e(t){var n=t[0],i=t[1],r=t[2],e=t[3],o=[n,i,n,e,r,e,r,i,n,i];return new Ke(o,Et,[o.length])}function Qe(t,n,i){for(var r=n||32,e=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=e*(r+1),u=new Array(a),c=0;c<a;c+=e){u[c]=0,u[c+1]=0;for(var h=2;h<e;h++)u[c+h]=s[h]}var f=[u.length],l=new Ke(u,o,f);return to(l,s,t.getRadius(),i),l}function to(t,n,i,r){for(var e=t.getFlatCoordinates(),o=t.getStride(),s=e.length/o-1,a=r||0,u=0;u<=s;++u){var c=u*o,h=a+2*mi(u,s)*Math.PI/s;e[c]=n[0]+i*Math.cos(h),e[c+1]=n[1]+i*Math.sin(h)}t.changed()}var no=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),io="accuracy",ro="accuracyGeometry",eo="altitude",oo="altitudeAccuracy",so="heading",ao="position",uo="projection",co="speed",ho="tracking",fo="trackingOptions",lo=function(t){function n(n){var i=t.call(this,z)||this;return i.code=n.code,i.message=n.message,i}return no(n,t),n}(f),vo=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.Mt=null,i._t=mr,i.Ot=void 0,i.addChangeListener(uo,i.Tt),i.addChangeListener(ho,i.Et),void 0!==r.projection&&i.setProjection(r.projection),void 0!==r.trackingOptions&&i.setTrackingOptions(r.trackingOptions),i.setTracking(void 0!==r.tracking&&r.tracking),i}return no(n,t),n.prototype.disposeInternal=function(){this.setTracking(!1),t.prototype.disposeInternal.call(this)},n.prototype.Tt=function(){var t=this.getProjection();t&&(this._t=Er(gr("EPSG:4326"),t),this.Mt&&this.set(ao,this._t(this.Mt)))},n.prototype.Et=function(){if("geolocation"in navigator){var t=this.getTracking();t&&void 0===this.Ot?this.Ot=navigator.geolocation.watchPosition(this.At.bind(this),this.Ct.bind(this),this.getTrackingOptions()):t||void 0===this.Ot||(navigator.geolocation.clearWatch(this.Ot),this.Ot=void 0)}},n.prototype.At=function(t){var n=t.coords;this.set(io,n.accuracy),this.set(eo,null===n.altitude?void 0:n.altitude),this.set(oo,null===n.altitudeAccuracy?void 0:n.altitudeAccuracy),this.set(so,null===n.heading?void 0:yi(n.heading)),this.Mt?(this.Mt[0]=n.longitude,this.Mt[1]=n.latitude):this.Mt=[n.longitude,n.latitude];var i=this._t(this.Mt);this.set(ao,i),this.set(co,null===n.speed?void 0:n.speed);var r=Ze(this.Mt,n.accuracy);r.applyTransform(this._t),this.set(ro,r),this.changed()},n.prototype.Ct=function(t){this.dispatchEvent(new lo(t))},n.prototype.getAccuracy=function(){return this.get(io)},n.prototype.getAccuracyGeometry=function(){return this.get(ro)||null},n.prototype.getAltitude=function(){return this.get(eo)},n.prototype.getAltitudeAccuracy=function(){return this.get(oo)},n.prototype.getHeading=function(){return this.get(so)},n.prototype.getPosition=function(){return this.get(ao)},n.prototype.getProjection=function(){return this.get(uo)},n.prototype.getSpeed=function(){return this.get(co)},n.prototype.getTracking=function(){return this.get(ho)},n.prototype.getTrackingOptions=function(){return this.get(fo)},n.prototype.setProjection=function(t){this.set(uo,gr(t))},n.prototype.setTracking=function(t){this.set(ho,t)},n.prototype.setTrackingOptions=function(t){this.set(fo,t)},n}(ot),po=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yo=function(t){function n(n,i,r,e){var o=t.call(this)||this;return o.extent=n,o.Rt=r,o.resolution=i,o.state=e,o}return po(n,t),n.prototype.changed=function(){this.dispatchEvent(N)},n.prototype.getExtent=function(){return this.extent},n.prototype.getImage=function(){return r()},n.prototype.getPixelRatio=function(){return this.Rt},n.prototype.getResolution=function(){return this.resolution},n.prototype.getState=function(){return this.state},n.prototype.load=function(){r()},n}(I),mo=0,wo=1,bo=2,go=3,xo=4,jo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function So(t,n,i){var r=t,e=!0,o=!1,s=!1,a=[Z(r,X,(function(){s=!0,o||n()}))];return r.src&&Jt?(o=!0,r.decode().then((function(){e&&n()})).catch((function(t){e&&(s?n():i())}))):a.push(Z(r,z,i)),function(){e=!1,a.forEach($)}}var ko=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i,r,mo)||this;return a.Pt=e,a.Nt=new Image,null!==o&&(a.Nt.crossOrigin=o),a.zt=null,a.state=mo,a.Ft=s,a}return jo(n,t),n.prototype.getImage=function(){return this.Nt},n.prototype.Lt=function(){this.state=go,this.Gt(),this.changed()},n.prototype.Dt=function(){void 0===this.resolution&&(this.resolution=Yn(this.extent)/this.Nt.height),this.state=bo,this.Gt(),this.changed()},n.prototype.load=function(){this.state!=mo&&this.state!=go||(this.state=wo,this.changed(),this.Ft(this,this.Pt),this.zt=So(this.Nt,this.Dt.bind(this),this.Lt.bind(this)))},n.prototype.setImage=function(t){this.Nt=t,this.resolution=Yn(this.extent)/this.Nt.height},n.prototype.Gt=function(){this.zt&&(this.zt(),this.zt=null)},n}(yo),Mo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_o=function(t){function n(n,i,r,e,o){var s=this,a=void 0!==o?mo:bo;return(s=t.call(this,n,i,r,a)||this).q=void 0!==o?o:null,s.Ut=e,s.W=null,s}return Mo(n,t),n.prototype.getError=function(){return this.W},n.prototype.qt=function(t){t?(this.W=t,this.state=go):this.state=bo,this.changed()},n.prototype.load=function(){this.state==mo&&(this.state=wo,this.changed(),this.q(this.qt.bind(this)))},n.prototype.getImage=function(){return this.Ut},n}(yo);function Oo(t,n,i,r){var e;return e=i&&i.length?i.shift():Ht?new OffscreenCanvas(t||300,n||300):document.createElement("canvas"),t&&(e.width=t),n&&(e.height=n),e.getContext("2d",r)}function To(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)}function Eo(t){var n=t.offsetHeight,i=getComputedStyle(t);return n+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)}function Ao(t,n){var i=n.parentNode;i&&i.replaceChild(t,n)}function Co(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Ro(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Po(t,n){for(var i=t.childNodes,r=0;;++r){var e=i[r],o=n[r];if(!e&&!o)break;e!==o&&(e?o?t.insertBefore(o,e):(t.removeChild(e),--r):t.appendChild(o))}}var Io=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var No=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i,s)||this;return a.Bt=e,a.Pt=r,a.key=r,a.Nt=new Image,null!==e&&(a.Nt.crossOrigin=e),a.zt=null,a.Wt=o,a}return Io(n,t),n.prototype.getImage=function(){return this.Nt},n.prototype.setImage=function(t){this.Nt=t,this.state=dt,this.Gt(),this.changed()},n.prototype.Lt=function(){var t;this.state=pt,this.Gt(),this.Nt=((t=Oo(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},n.prototype.Dt=function(){var t=this.Nt;t.naturalWidth&&t.naturalHeight?this.state=dt:this.state=yt,this.Gt(),this.changed()},n.prototype.load=function(){this.state==pt&&(this.state=lt,this.Nt=new Image,null!==this.Bt&&(this.Nt.crossOrigin=this.Bt)),this.state==lt&&(this.state=vt,this.changed(),this.Wt(this,this.Pt),this.zt=So(this.Nt,this.Dt.bind(this),this.Lt.bind(this)))},n.prototype.Gt=function(){this.zt&&(this.zt(),this.zt=null)},n}(jt),zo=function(){function t(t,n,i){this.Vt=t,this.Xt=n,this.Ht=i,this.Jt=[],this.Kt=0,this.Yt=0}return t.prototype.begin=function(){this.Jt.length=0,this.Kt=0,this.Yt=0},t.prototype.update=function(t,n){this.Jt.push(t,n,Date.now())},t.prototype.end=function(){if(this.Jt.length<6)return!1;var t=Date.now()-this.Ht,n=this.Jt.length-3;if(this.Jt[n+2]<t)return!1;for(var i=n-3;i>0&&this.Jt[i+2]>t;)i-=3;var r=this.Jt[n+2]-this.Jt[i+2];if(r<1e3/60)return!1;var e=this.Jt[n]-this.Jt[i],o=this.Jt[n+1]-this.Jt[i+1];return this.Kt=Math.atan2(o,e),this.Yt=Math.sqrt(e*e+o*o)/r,this.Yt>this.Xt},t.prototype.getDistance=function(){return(this.Xt-this.Yt)/this.Vt},t.prototype.getAngle=function(){return this.Kt},t}(),Fo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Lo=/^([a-z]*)$|^hsla?\(.*\)$/i;function Go(t){return"string"==typeof t?t:Wo(t)}function Do(t){var n=document.createElement("div");if(n.style.color=t,""!==n.style.color){document.body.appendChild(n);var i=getComputedStyle(n).color;return document.body.removeChild(n),i}return""}var Uo=function(){var t={},n=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(n>=1024){var e=0;for(var o in t)0==(3&e++)&&(delete t[o],--n)}r=function(t){var n,i,r,e,o;Lo.exec(t)&&(t=Do(t));if(Fo.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var u=4===s||8===s;n=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),e=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(n=(n<<4)+n,i=(i<<4)+i,r=(r<<4)+r,u&&(e=(e<<4)+e)),o=[n,i,r,e/255]}else 0==t.indexOf("rgba(")?Bo(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Bo(o)):Mt(!1,14);return o}(i),t[i]=r,++n}return r}}();function qo(t){return Array.isArray(t)?t:Uo(t)}function Bo(t){return t[0]=ci(t[0]+.5|0,0,255),t[1]=ci(t[1]+.5|0,0,255),t[2]=ci(t[2]+.5|0,0,255),t[3]=ci(t[3],0,1),t}function Wo(t){var n=t[0];n!=(0|n)&&(n=n+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+n+","+i+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function Vo(t){return Lo.test(t)&&(t=Do(t)),Fo.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}var Xo=function(){function t(){this.Zt={},this.$t=0,this.Qt=32}return t.prototype.clear=function(){this.Zt={},this.$t=0},t.prototype.canExpireCache=function(){return this.$t>this.Qt},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.Zt){var i=this.Zt[n];0!=(3&t++)||i.hasListener()||(delete this.Zt[n],--this.$t)}}},t.prototype.get=function(t,n,i){var r=Ho(t,n,i);return r in this.Zt?this.Zt[r]:null},t.prototype.set=function(t,n,i,r){var e=Ho(t,n,i);this.Zt[e]=r,++this.$t},t.prototype.setSize=function(t){this.Qt=t,this.expire()},t}();function Ho(t,n,i){return n+":"+t+":"+(i?Go(i):"null")}var Jo=Xo,Ko=new Xo,Yo="opacity",Zo="visible",$o="extent",Qo="zIndex",ts="maxResolution",ns="minResolution",is="maxZoom",rs="minZoom",es="source",os="map";function ss(t){return(ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var as=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),us=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.tn=n.background;var r=E({},n);return"object"===ss(n.properties)&&(delete r.properties,E(r,n.properties)),r[Yo]=void 0!==n.opacity?n.opacity:1,Mt("number"==typeof r[Yo],64),r[Zo]=void 0===n.visible||n.visible,r[Qo]=n.zIndex,r[ts]=void 0!==n.maxResolution?n.maxResolution:1/0,r[ns]=void 0!==n.minResolution?n.minResolution:0,r[rs]=void 0!==n.minZoom?n.minZoom:-1/0,r[is]=void 0!==n.maxZoom?n.maxZoom:1/0,i.nn=void 0!==r.className?r.className:"ol-layer",delete r.className,i.setProperties(r),i.rn=null,i}return as(n,t),n.prototype.getBackground=function(){return this.tn},n.prototype.getClassName=function(){return this.nn},n.prototype.getLayerState=function(t){var n=this.rn||{layer:this,managed:void 0===t||t},i=this.getZIndex();return n.opacity=ci(Math.round(100*this.getOpacity())/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=void 0!==i||n.managed?i:1/0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.rn=n,n},n.prototype.getLayersArray=function(t){return r()},n.prototype.getLayerStatesArray=function(t){return r()},n.prototype.getExtent=function(){return this.get($o)},n.prototype.getMaxResolution=function(){return this.get(ts)},n.prototype.getMinResolution=function(){return this.get(ns)},n.prototype.getMinZoom=function(){return this.get(rs)},n.prototype.getMaxZoom=function(){return this.get(is)},n.prototype.getOpacity=function(){return this.get(Yo)},n.prototype.getSourceState=function(){return r()},n.prototype.getVisible=function(){return this.get(Zo)},n.prototype.getZIndex=function(){return this.get(Qo)},n.prototype.setBackground=function(t){this.tn=t,this.changed()},n.prototype.setExtent=function(t){this.set($o,t)},n.prototype.setMaxResolution=function(t){this.set(ts,t)},n.prototype.setMinResolution=function(t){this.set(ns,t)},n.prototype.setMaxZoom=function(t){this.set(is,t)},n.prototype.setMinZoom=function(t){this.set(rs,t)},n.prototype.setOpacity=function(t){Mt("number"==typeof t,64),this.set(Yo,t)},n.prototype.setVisible=function(t){this.set(Zo,t)},n.prototype.setZIndex=function(t){this.set(Qo,t)},n.prototype.disposeInternal=function(){this.rn&&(this.rn.layer=null,this.rn=null),t.prototype.disposeInternal.call(this)},n}(ot),cs="prerender",hs="postrender",fs="precompose",ls="postcompose",vs="rendercomplete",ds="undefined",ps="loading",ys="ready",ms="error",ws=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function bs(t,n){if(!t.visible)return!1;var i=n.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var r=n.zoom;return r>t.minZoom&&r<=t.maxZoom}var gs=function(t){function n(n){var i=this,r=E({},n);delete r.source,(i=t.call(this,r)||this).on,i.once,i.un,i.en=null,i.sn=null,i.an=null,i.cn=null,i.rendered=!1,n.render&&(i.render=n.render),n.map&&i.setMap(n.map),i.addChangeListener(es,i.hn);var e=n.source?n.source:null;return i.setSource(e),i}return ws(n,t),n.prototype.getLayersArray=function(t){var n=t||[];return n.push(this),n},n.prototype.getLayerStatesArray=function(t){var n=t||[];return n.push(this.getLayerState()),n},n.prototype.getSource=function(){return this.get(es)||null},n.prototype.getRenderSource=function(){return this.getSource()},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():ds},n.prototype.fn=function(){this.changed()},n.prototype.hn=function(){this.an&&($(this.an),this.an=null);var t=this.getSource();t&&(this.an=Y(t,N,this.fn,this)),this.changed()},n.prototype.getFeatures=function(t){return this.cn?this.cn.getFeatures(t):new Promise((function(t){return t([])}))},n.prototype.getData=function(t){return this.cn&&this.rendered?this.cn.getData(t):null},n.prototype.render=function(t,n){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,n)},n.prototype.unrender=function(){this.rendered=!1},n.prototype.setMapInternal=function(t){t||this.unrender(),this.set(os,t)},n.prototype.getMapInternal=function(){return this.get(os)},n.prototype.setMap=function(t){this.en&&($(this.en),this.en=null),t||this.changed(),this.sn&&($(this.sn),this.sn=null),t&&(this.en=Y(t,fs,(function(t){var n=t.frameState.layerStatesArray,i=this.getLayerState(!1);Mt(!n.some((function(t){return t.layer===i.layer})),67),n.push(i)}),this),this.sn=Y(this,N,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(es,t)},n.prototype.getRenderer=function(){return this.cn||(this.cn=this.createRenderer()),this.cn},n.prototype.hasRenderer=function(){return!!this.cn},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.cn&&(this.cn.dispose(),delete this.cn),this.setSource(null),t.prototype.disposeInternal.call(this)},n}(us),xs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function js(t,n){Ko.expire()}var Ss=function(t){function n(n){var i=t.call(this)||this;return i.vn=n,i}return xs(n,t),n.prototype.dispatchRenderEvent=function(t,n){r()},n.prototype.calculateMatrices2D=function(t){var n=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;un(i,t.size[0]/2,t.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),cn(r,i)},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o,s,a){var u,c=n.viewState;function h(t,n,i,r){return e.call(o,n,t?i:null,r)}var f=c.projection,l=ar(t.slice(),f),v=[[0,0]];if(f.canWrapX()&&r){var d=ti(f.getExtent());v.push([-d,0],[d,0])}for(var p=n.layerStatesArray,y=p.length,m=[],w=[],b=0;b<v.length;b++)for(var g=y-1;g>=0;--g){var x=p[g],j=x.layer;if(j.hasRenderer()&&bs(x,c)&&s.call(a,j)){var S=j.getRenderer(),k=j.getSource();if(S&&k){var M=k.getWrapX()?l:t,_=h.bind(null,x.managed);w[0]=M[0]+v[b][0],w[1]=M[1]+v[b][1],u=S.forEachFeatureAtCoordinate(w,n,i,_,m)}if(u)return u}}if(0!==m.length){var O=1/m.length;return m.forEach((function(t,n){return t.distanceSq+=n*O})),m.sort((function(t,n){return t.distanceSq-n.distanceSq})),m.some((function(t){return u=t.callback(t.feature,t.layer,t.geometry)})),u}},n.prototype.forEachLayerAtPixel=function(t,n,i,e,o){return r()},n.prototype.hasFeatureAtCoordinate=function(t,n,i,r,e,o){return void 0!==this.forEachFeatureAtCoordinate(t,n,i,r,k,this,e,o)},n.prototype.getMap=function(){return this.vn},n.prototype.renderFrame=function(t){r()},n.prototype.scheduleExpireIconCache=function(t){Ko.canExpireCache()&&t.postRenderFunctions.push(js)},n}(v),ks=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ms=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=e,o}return ks(n,t),n}(f),_s="ol-hidden",Os="ol-selectable",Ts="ol-unselectable",Es="ol-unsupported",As="ol-control",Cs="ol-collapsed",Rs=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Ps=["style","variant","weight","size","lineHeight","family"],Is=function(t){var n=t.match(Rs);if(!n)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,e=Ps.length;r<e;++r){var o=n[r+1];void 0!==o&&(i[Ps[r]]=o)}return i.families=i.family.split(/,\s?/),i};function Ns(t){return 1===t?"":String(Math.round(100*t)/100)}var zs="10px sans-serif",Fs="#000",Ls="round",Gs=[],Ds="round",Us=10,qs="#000",Bs="center",Ws="middle",Vs=[0,0,0,0],Xs=new ot,Hs=new I;Hs.setSize=function(){console.warn("labelCache is deprecated.")};var Js,Ks,Ys=null,Zs={},$s=function(){var t,n,i="32px ",r=["monospace","serif"],e=r.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var u=!0,c=0;c<e;++c){var h=r[c];if(n=na(t+" "+s+" "+i+h,o),a!=h){var f=na(t+" "+s+" "+i+a+","+h,o);u=u&&f!=n}}return!!u}function a(){for(var n=!0,i=Xs.getKeys(),r=0,e=i.length;r<e;++r){var o=i[r];Xs.get(o)<100&&(s.apply(this,o.split("\n"))?(A(Zs),Ys=null,Js=void 0,Xs.set(o,100)):(Xs.set(o,Xs.get(o)+1,!0),n=!1))}n&&(clearInterval(t),t=void 0)}return function(n){var i=Is(n);if(i)for(var r=i.families,e=0,o=r.length;e<o;++e){var u=r[e],c=i.style+"\n"+i.weight+"\n"+u;void 0===Xs.get(c)&&(Xs.set(c,100,!0),s(i.style,i.weight,u)||(Xs.set(c,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Qs=function(t){var n=Zs[t];if(null==n){if(Ht){var i=Is(t),r=ta(t,"Žg");n=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else Ks||((Ks=document.createElement("div")).innerHTML="M",Ks.style.minHeight="0",Ks.style.maxHeight="none",Ks.style.height="auto",Ks.style.padding="0",Ks.style.border="none",Ks.style.position="absolute",Ks.style.display="block",Ks.style.left="-99999px"),Ks.style.font=t,document.body.appendChild(Ks),n=Ks.offsetHeight,document.body.removeChild(Ks);Zs[t]=n}return n};function ta(t,n){return Ys||(Ys=Oo(1,1)),t!=Js&&(Ys.font=t,Js=Ys.font),Ys.measureText(n)}function na(t,n){return ta(t,n).width}function ia(t,n,i){if(n in i)return i[n];var r=na(t,n);return i[n]=r,r}function ra(t,n){for(var i=[],r=[],e=[],o=0,s=0,a=0,u=0,c=0,h=n.length;c<=h;c+=2){var f=n[c];if("\n"!==f&&c!==h){var l=n[c+1]||t.font,v=na(l,f);i.push(v),s+=v;var d=Qs(l);r.push(d),u=Math.max(u,d)}else o=Math.max(o,s),e.push(s),s=0,a+=u}return{width:o,height:a,widths:i,heights:r,lineWidths:e}}function ea(t,n,i,r,e,o,s,a,u,c,h){t.save(),1!==i&&(t.globalAlpha*=i),n&&t.setTransform.apply(t,n),r.contextInstructions?(t.translate(u,c),t.scale(h[0],h[1]),function(t,n){for(var i=t.contextInstructions,r=0,e=i.length;r<e;r+=2)Array.isArray(i[r+1])?n[i[r]].apply(n,i[r+1]):n[i[r]]=i[r+1]}(r,t)):h[0]<0||h[1]<0?(t.translate(u,c),t.scale(h[0],h[1]),t.drawImage(r,e,o,s,a,0,0,s,a)):t.drawImage(r,e,o,s,a,u,c,s*h[0],a*h[1]),t.restore()}var oa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sa=function(t){function n(n){var i=t.call(this,n)||this;i.dn=Y(Xs,l,n.redrawText.bind(n)),i.pn=document.createElement("div");var r=i.pn.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",i.pn.className="ol-unselectable ol-layers";var e=n.getViewport();return e.insertBefore(i.pn,e.firstChild||null),i.yn=[],i.mn=!0,i}return oa(n,t),n.prototype.dispatchRenderEvent=function(t,n){var i=this.getMap();if(i.hasListener(t)){var r=new Ms(t,void 0,n);i.dispatchEvent(r)}},n.prototype.disposeInternal=function(){$(this.dn),this.pn.parentNode.removeChild(this.pn),t.prototype.disposeInternal.call(this)},n.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(fs,t);var n=t.layerStatesArray.sort((function(t,n){return t.zIndex-n.zIndex})),i=t.viewState;this.yn.length=0;for(var r=[],e=null,o=0,s=n.length;o<s;++o){var a=n[o];t.layerIndex=o;var u=a.layer,c=u.getSourceState();if(!bs(a,i)||c!=ys&&c!=ds)u.unrender();else{var h=u.render(t,e);h&&(h!==e&&(this.yn.push(h),e=h),"getDeclutter"in u&&r.push(u))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);Po(this.pn,this.yn),this.dispatchRenderEvent(ls,t),this.mn||(this.pn.style.display="",this.mn=!0),this.scheduleExpireIconCache(t)}else this.mn&&(this.pn.style.display="none",this.mn=!1)},n.prototype.forEachLayerAtPixel=function(t,n,i,r,e){for(var o=n.viewState,s=n.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],c=u.layer;if(c.hasRenderer()&&bs(u,o)&&e(c)){var h=c.getRenderer().getDataAtPixel(t,n,i);if(h){var f=r(c,h);if(f)return f}}}},n}(Ss),aa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ua=function(t){function n(n,i){var r=t.call(this,n)||this;return r.layer=i,r}return aa(n,t),n}(f),ca="layers",ha=function(t){function n(n){var i=this,r=n||{},e=E({},r);delete e.layers;var o=r.layers;return(i=t.call(this,e)||this).on,i.once,i.un,i.wn=[],i.bn={},i.addChangeListener(ca,i.gn),o?Array.isArray(o)?o=new ft(o.slice(),{unique:!0}):Mt("function"==typeof o.getArray,43):o=new ft(void 0,{unique:!0}),i.setLayers(o),i}return aa(n,t),n.prototype.xn=function(){this.changed()},n.prototype.gn=function(){this.wn.forEach($),this.wn.length=0;var t=this.getLayers();for(var n in this.wn.push(Y(t,st,this.jn,this),Y(t,at,this.Sn,this)),this.bn)this.bn[n].forEach($);A(this.bn);for(var i=t.getArray(),r=0,e=i.length;r<e;r++){var o=i[r];this.kn(o),this.dispatchEvent(new ua("addlayer",o))}this.changed()},n.prototype.kn=function(t){var i=[Y(t,l,this.xn,this),Y(t,N,this.xn,this)];t instanceof n&&i.push(Y(t,"addlayer",this.Mn,this),Y(t,"removelayer",this._n,this)),this.bn[o(t)]=i},n.prototype.Mn=function(t){this.dispatchEvent(new ua("addlayer",t.layer))},n.prototype._n=function(t){this.dispatchEvent(new ua("removelayer",t.layer))},n.prototype.jn=function(t){var n=t.element;this.kn(n),this.dispatchEvent(new ua("addlayer",n)),this.changed()},n.prototype.Sn=function(t){var n=t.element,i=o(n);this.bn[i].forEach($),delete this.bn[i],this.dispatchEvent(new ua("removelayer",n)),this.changed()},n.prototype.getLayers=function(){return this.get(ca)},n.prototype.setLayers=function(t){var n=this.getLayers();if(n)for(var i=n.getArray(),r=0,e=i.length;r<e;++r)this.dispatchEvent(new ua("removelayer",i[r]));this.set(ca,t)},n.prototype.getLayersArray=function(t){var n=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(n)})),n},n.prototype.getLayerStatesArray=function(t){var n=void 0!==t?t:[],i=n.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(n)}));var r=this.getLayerState(),e=r.zIndex;t||void 0!==r.zIndex||(e=0);for(var o=i,s=n.length;o<s;o++){var a=n[o];a.opacity*=r.opacity,a.visible=a.visible&&r.visible,a.maxResolution=Math.min(a.maxResolution,r.maxResolution),a.minResolution=Math.max(a.minResolution,r.minResolution),a.minZoom=Math.max(a.minZoom,r.minZoom),a.maxZoom=Math.min(a.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==a.extent?a.extent=Zn(a.extent,r.extent):a.extent=r.extent),void 0===a.zIndex&&(a.zIndex=e)}return n},n.prototype.getSourceState=function(){return ys},n}(us),fa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),la=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.map=i,e.frameState=void 0!==r?r:null,e}return fa(n,t),n}(f),va=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),da=function(t){function n(n,i,r,e,o){var s=t.call(this,n,i,o)||this;return s.originalEvent=r,s.On=null,s.Tn=null,s.dragging=void 0!==e&&e,s}return va(n,t),Object.defineProperty(n.prototype,"pixel",{get:function(){return this.On||(this.On=this.map.getEventPixel(this.originalEvent)),this.On},set:function(t){this.On=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.Tn||(this.Tn=this.map.getCoordinateFromPixel(this.pixel)),this.Tn},set:function(t){this.Tn=t},enumerable:!1,configurable:!0}),n.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},n.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},n}(la),pa={SINGLECLICK:"singleclick",CLICK:G,DBLCLICK:D,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ya="pointermove",ma="pointerdown",wa="pointerup",ba="pointerout",ga=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xa=function(t){function n(n,i){var r=t.call(this,n)||this;r.vn=n,r.En,r.An=!1,r.Cn=!1,r.Rn=[],r.Pn=void 0===i?1:i,r.In=null;var e=r.vn.getViewport();return r.Nn=0,r.zn={},r.pn=e,r.Fn=Y(e,ma,r.Ln,r),r.Gn,r.Dn=Y(e,ya,r.Un,r),r.qn=r.Bn.bind(r),r.pn.addEventListener(J,r.qn,!!Kt&&{passive:!1}),r}return ga(n,t),n.prototype.Wn=function(t){var n=new da(pa.CLICK,this.vn,t);this.dispatchEvent(n),void 0!==this.En?(clearTimeout(this.En),this.En=void 0,n=new da(pa.DBLCLICK,this.vn,t),this.dispatchEvent(n)):this.En=setTimeout(function(){this.En=void 0;var n=new da(pa.SINGLECLICK,this.vn,t);this.dispatchEvent(n)}.bind(this),250)},n.prototype.Vn=function(t){var n=t;n.type==pa.POINTERUP||n.type==pa.POINTERCANCEL?delete this.zn[n.pointerId]:n.type==pa.POINTERDOWN&&(this.zn[n.pointerId]=!0),this.Nn=Object.keys(this.zn).length},n.prototype.Xn=function(t){this.Vn(t);var n=new da(pa.POINTERUP,this.vn,t);this.dispatchEvent(n),this.An&&!n.defaultPrevented&&!this.Cn&&this.Hn(t)&&this.Wn(this.In),0===this.Nn&&(this.Rn.forEach($),this.Rn.length=0,this.Cn=!1,this.In=null)},n.prototype.Hn=function(t){return 0===t.button},n.prototype.Ln=function(t){this.An=0===this.Nn,this.Vn(t);var n=new da(pa.POINTERDOWN,this.vn,t);for(var i in this.dispatchEvent(n),this.In={},t){var r=t[i];this.In[i]="function"==typeof r?_:r}if(0===this.Rn.length){var e=this.vn.getOwnerDocument();this.Rn.push(Y(e,pa.POINTERMOVE,this.Jn,this),Y(e,pa.POINTERUP,this.Xn,this),Y(this.pn,pa.POINTERCANCEL,this.Xn,this)),this.pn.getRootNode&&this.pn.getRootNode()!==e&&this.Rn.push(Y(this.pn.getRootNode(),pa.POINTERUP,this.Xn,this))}},n.prototype.Jn=function(t){if(this.Kn(t)){this.Cn=!0;var n=new da(pa.POINTERDRAG,this.vn,t,this.Cn);this.dispatchEvent(n)}},n.prototype.Un=function(t){this.Gn=t;var n=!(!this.In||!this.Kn(t));this.dispatchEvent(new da(t.type,this.vn,t,n))},n.prototype.Bn=function(t){var n=this.Gn;n&&!n.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},n.prototype.Kn=function(t){return this.Cn||Math.abs(t.clientX-this.In.clientX)>this.Pn||Math.abs(t.clientY-this.In.clientY)>this.Pn},n.prototype.disposeInternal=function(){this.Dn&&($(this.Dn),this.Dn=null),this.pn.removeEventListener(J,this.qn),this.Fn&&($(this.Fn),this.Fn=null),this.Rn.forEach($),this.Rn.length=0,this.pn=null,t.prototype.disposeInternal.call(this)},n}(I),ja="postrender",Sa="movestart",ka="moveend",Ma="loadstart",_a="loadend",Oa="layergroup",Ta="size",Ea="target",Aa="view",Ca=1/0,Ra=function(){function t(t,n){this.Yn=t,this.Zn=n,this.$n=[],this.Qn=[],this.ti={}}return t.prototype.clear=function(){this.$n.length=0,this.Qn.length=0,A(this.ti)},t.prototype.dequeue=function(){var t=this.$n,n=this.Qn,i=t[0];1==t.length?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.ni(0));var r=this.Zn(i);return delete this.ti[r],i},t.prototype.enqueue=function(t){Mt(!(this.Zn(t)in this.ti),31);var n=this.Yn(t);return n!=Ca&&(this.$n.push(t),this.Qn.push(n),this.ti[this.Zn(t)]=!0,this.ii(0,this.$n.length-1),!0)},t.prototype.getCount=function(){return this.$n.length},t.prototype.ri=function(t){return 2*t+1},t.prototype.ei=function(t){return 2*t+2},t.prototype.oi=function(t){return t-1>>1},t.prototype.si=function(){var t;for(t=(this.$n.length>>1)-1;t>=0;t--)this.ni(t)},t.prototype.isEmpty=function(){return 0===this.$n.length},t.prototype.isKeyQueued=function(t){return t in this.ti},t.prototype.isQueued=function(t){return this.isKeyQueued(this.Zn(t))},t.prototype.ni=function(t){for(var n=this.$n,i=this.Qn,r=n.length,e=n[t],o=i[t],s=t;t<r>>1;){var a=this.ri(t),u=this.ei(t),c=u<r&&i[u]<i[a]?u:a;n[t]=n[c],i[t]=i[c],t=c}n[t]=e,i[t]=o,this.ii(s,t)},t.prototype.ii=function(t,n){for(var i=this.$n,r=this.Qn,e=i[n],o=r[n];n>t;){var s=this.oi(n);if(!(r[s]>o))break;i[n]=i[s],r[n]=r[s],n=s}i[n]=e,r[n]=o},t.prototype.reprioritize=function(){var t,n,i,r=this.Yn,e=this.$n,o=this.Qn,s=0,a=e.length;for(n=0;n<a;++n)(i=r(t=e[n]))==Ca?delete this.ti[this.Zn(t)]:(o[s]=i,e[s++]=t);e.length=s,o.length=s,this.si()},t}(),Pa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ia=function(t){function n(n,i){var r=t.call(this,(function(t){return n.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return r.ai=r.handleTileChange.bind(r),r.ui=i,r.ci=0,r.hi={},r}return Pa(n,t),n.prototype.enqueue=function(n){var i=t.prototype.enqueue.call(this,n);i&&n[0].addEventListener(N,this.ai);return i},n.prototype.getTilesLoading=function(){return this.ci},n.prototype.handleTileChange=function(t){var n=t.target,i=n.getState();if(i===dt||i===pt||i===yt){n.removeEventListener(N,this.ai);var r=n.getKey();r in this.hi&&(delete this.hi[r],--this.ci),this.ui()}},n.prototype.loadMoreTiles=function(t,n){for(var i,r,e=0;this.ci<t&&e<n&&this.getCount()>0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==lt||r in this.hi||(this.hi[r]=!0,++this.ci,++e,i.load())},n}(Ra);function Na(t,n,i,r,e){if(!t||!(i in t.wantedTiles))return Ca;if(!t.wantedTiles[i][n.getKey()])return Ca;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(e)+Math.sqrt(s*s+a*a)/e}var za=0,Fa=1,La={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ga=256;function Da(t,n,i){return function(r,e,o,s,a){if(r){if(!e&&!n)return r;var u=n?0:o[0]*e,c=n?0:o[1]*e,h=a?a[0]:0,f=a?a[1]:0,l=t[0]+u/2+h,v=t[2]-u/2+h,d=t[1]+c/2+f,p=t[3]-c/2+f;l>v&&(v=l=(v+l)/2),d>p&&(p=d=(p+d)/2);var y=ci(r[0],l,v),m=ci(r[1],d,p);if(s&&i&&e){var w=30*e;y+=-w*Math.log(1+Math.max(0,l-r[0])/w)+w*Math.log(1+Math.max(0,r[0]-v)/w),m+=-w*Math.log(1+Math.max(0,d-r[1])/w)+w*Math.log(1+Math.max(0,r[1]-p)/w)}return[y,m]}}}function Ua(t){return t}function qa(t,n,i,r){var e=ti(n)/i[0],o=Yn(n)/i[1];return r?Math.min(t,Math.max(e,o)):Math.min(t,Math.min(e,o))}function Ba(t,n,i){var r=Math.min(t,n);return r*=Math.log(1+50*Math.max(0,t/n-1))/50+1,i&&(r=Math.max(r,i),r/=Math.log(1+50*Math.max(0,i/t-1))/50+1),ci(r,i/2,2*n)}function Wa(t,n,i,r){return function(e,o,s,a){if(void 0!==e){var u=t[0],c=t[t.length-1],h=i?qa(u,i,s,r):u;if(a)return void 0===n||n?Ba(e,h,c):ci(e,c,h);var f=Math.min(h,e),l=Math.floor(m(t,f,o));return t[l]>h&&l<t.length-1?t[l+1]:t[l]}}}function Va(t,n,i,r,e,o){return function(s,a,u,c){if(void 0!==s){var h=e?qa(n,e,u,o):n,f=void 0!==i?i:0;if(c)return void 0===r||r?Ba(s,h,f):ci(s,f,h);var l=Math.ceil(Math.log(n/h)/Math.log(t)-1e-9),v=-a*(.5-1e-9)+.5,d=Math.min(h,s),p=Math.floor(Math.log(n/d)/Math.log(t)+v),y=Math.max(l,p);return ci(n/Math.pow(t,y),f,h)}}}function Xa(t,n,i,r,e){return function(o,s,a,u){if(void 0!==o){var c=r?qa(t,r,a,e):t;return(void 0===i||i)&&u?Ba(o,c,n):ci(o,n,c)}}}function Ha(t){return void 0!==t?0:void 0}function Ja(t){return void 0!==t?t:void 0}function Ka(t){var n=2*Math.PI/t;return function(t,i){return i?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}}function Ya(t){var n=t||yi(5);return function(t,i){return i?t:void 0!==t?Math.abs(t)<=n?0:t:void 0}}var Za=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function $a(t,n){setTimeout((function(){t(n)}),0)}function Qa(t){if(void 0!==t.extent){var n=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Da(t.extent,t.constrainOnlyCenter,n)}var i=kr(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var r=i.getExtent().slice();return r[0]=-1/0,r[2]=1/0,Da(r,!1,!1)}return Ua}function tu(t){var n,i,r,e=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,u=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,h=kr(t.projection,"EPSG:3857"),f=h.getExtent(),l=t.constrainOnlyCenter,v=t.extent;if(a||v||!h.isGlobal()||(l=!1,v=f),void 0!==t.resolutions){var d=t.resolutions;i=d[e],r=void 0!==d[o]?d[o]:d[d.length-1],n=t.constrainResolution?Wa(d,u,!l&&v,c):Xa(i,r,u,!l&&v,c)}else{var p=(f?Math.max(ti(f),Yn(f)):360*Ft[Gt.DEGREES]/h.getMetersPerUnit())/Ga/Math.pow(2,0),y=p/Math.pow(2,28);void 0!==(i=t.maxResolution)?e=0:i=p/Math.pow(s,e),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,o):p/Math.pow(s,o):y),o=e+Math.floor(Math.log(i/r)/Math.log(s)),r=i/Math.pow(s,o-e),n=t.constrainResolution?Va(s,i,r,u,!l&&v,c):Xa(i,r,u,!l&&v,c)}return{constraint:n,maxResolution:i,minResolution:r,minZoom:e,zoomFactor:s}}function nu(t){if(void 0===t.enableRotation||t.enableRotation){var n=t.constrainRotation;return void 0===n||!0===n?Ya():!1===n?Ja:"number"==typeof n?Ka(n):Ja}return Ha}function iu(t){return!(t.sourceCenter&&t.targetCenter&&!tr(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function ru(t,n,i,r,e){var o=Math.cos(-e),s=Math.sin(-e),a=t[0]*o-t[1]*s,u=t[1]*o+t[0]*s;return[(a+=(n[0]/2-i[0])*r)*o-(u+=(i[1]-n[1]/2)*r)*(s=-s),u*o+a*s]}var eu=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=E({},n);return i.fi=[0,0],i.li=[],i.vi,i.di=kr(r.projection,"EPSG:3857"),i.yi=[100,100],i.mi=null,i.wi,i.bi,i.gi=null,i.xi,i.ji,i.Si=void 0,r.projection&&pr(),r.center&&(r.center=Fr(r.center,i.di)),r.extent&&(r.extent=Gr(r.extent,i.di)),i.ki(r),i}return Za(n,t),n.prototype.ki=function(t){var n=E({},t);for(var i in La)delete n[i];this.setProperties(n,!0);var r=tu(t);this.Mi=r.maxResolution,this._i=r.minResolution,this.Oi=r.zoomFactor,this.Ti=t.resolutions,this.Ei=t.padding,this.Ai=r.minZoom;var e=Qa(t),o=r.constraint,s=nu(t);this.Ci={center:e,resolution:o,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(n.prototype,"padding",{get:function(){return this.Ei},set:function(t){var n=this.Ei;this.Ei=t;var i=this.getCenter();if(i){var r=t||[0,0,0,0];n=n||[0,0,0,0];var e=this.getResolution(),o=e/2*(r[3]-n[3]+n[1]-r[1]),s=e/2*(r[0]-n[0]+n[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-s])}},enumerable:!1,configurable:!0}),n.prototype.Ri=function(t){var n=this.getProperties();return void 0!==n.resolution?n.resolution=this.getResolution():n.zoom=this.getZoom(),n.center=this.getCenterInternal(),n.rotation=this.getRotation(),E({},n,t)},n.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var n=new Array(arguments.length),i=0;i<n.length;++i){var r=arguments[i];r.center&&((r=E({},r)).center=Fr(r.center,this.getProjection())),r.anchor&&((r=E({},r)).anchor=Fr(r.anchor,this.getProjection())),n[i]=r}this.animateInternal.apply(this,n)},n.prototype.animateInternal=function(t){var n,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(n=arguments[i-1],--i);for(var r=0;r<i&&!this.isDef();++r){var e=arguments[r];e.center&&this.setCenterInternal(e.center),void 0!==e.zoom?this.setZoom(e.zoom):e.resolution&&this.setResolution(e.resolution),void 0!==e.rotation&&this.setRotation(e.rotation)}if(r!==i){for(var o=Date.now(),s=this.mi.slice(),a=this.wi,u=this.bi,c=[];r<i;++r){var h=arguments[r],f={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||bt,callback:n};if(h.center&&(f.sourceCenter=s,f.targetCenter=h.center.slice(),s=f.targetCenter),void 0!==h.zoom?(f.sourceResolution=a,f.targetResolution=this.getResolutionForZoom(h.zoom),a=f.targetResolution):h.resolution&&(f.sourceResolution=a,f.targetResolution=h.resolution,a=f.targetResolution),void 0!==h.rotation){f.sourceRotation=u;var l=mi(h.rotation-u+Math.PI,2*Math.PI)-Math.PI;f.targetRotation=u+l,u=f.targetRotation}iu(f)?f.complete=!0:o+=f.duration,c.push(f)}this.li.push(c),this.setHint(za,1),this.Pi()}else n&&$a(n,!0)},n.prototype.getAnimating=function(){return this.fi[za]>0},n.prototype.getInteracting=function(){return this.fi[Fa]>0},n.prototype.cancelAnimations=function(){var t;this.setHint(za,-this.fi[za]);for(var n=0,i=this.li.length;n<i;++n){var r=this.li[n];if(r[0].callback&&$a(r[0].callback,!1),!t)for(var e=0,o=r.length;e<o;++e){var s=r[e];if(!s.complete){t=s.anchor;break}}}this.li.length=0,this.Si=t,this.gi=null,this.xi=NaN,this.ji=NaN},n.prototype.Pi=function(){if(void 0!==this.vi&&(cancelAnimationFrame(this.vi),this.vi=void 0),this.getAnimating()){for(var t=Date.now(),n=!1,i=this.li.length-1;i>=0;--i){for(var r=this.li[i],e=!0,o=0,s=r.length;o<s;++o){var a=r[o];if(!a.complete){var u=t-a.start,c=a.duration>0?u/a.duration:1;c>=1?(a.complete=!0,c=1):e=!1;var h=a.easing(c);if(a.sourceCenter){var f=a.sourceCenter[0],l=a.sourceCenter[1],v=a.targetCenter[0],d=a.targetCenter[1];this.gi=a.targetCenter;var p=f+h*(v-f),y=l+h*(d-l);this.mi=[p,y]}if(a.sourceResolution&&a.targetResolution){var m=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var w=this.Ii(this.getRotation()),b=this.Ci.resolution(m,0,w,!0);this.mi=this.calculateCenterZoom(b,a.anchor)}this.xi=a.targetResolution,this.wi=m,this.Ni(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===h?mi(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.Ci.rotation(g,!0);this.mi=this.calculateCenterRotate(x,a.anchor)}this.ji=a.targetRotation,this.bi=g}if(this.Ni(!0),n=!0,!a.complete)break}}if(e){this.li[i]=null,this.setHint(za,-1),this.gi=null,this.xi=NaN,this.ji=NaN;var j=r[0].callback;j&&$a(j,!0)}}this.li=this.li.filter(Boolean),n&&void 0===this.vi&&(this.vi=requestAnimationFrame(this.Pi.bind(this)))}},n.prototype.calculateCenterRotate=function(t,n){var i,r=this.getCenterInternal();return void 0!==r&&(nr(i=[r[0]-n[0],r[1]-n[1]],t-this.getRotation()),Ki(i,n)),i},n.prototype.calculateCenterZoom=function(t,n){var i,r=this.getCenterInternal(),e=this.getResolution();void 0!==r&&void 0!==e&&(i=[n[0]-t*(n[0]-r[0])/e,n[1]-t*(n[1]-r[1])/e]);return i},n.prototype.Ii=function(t){var n=this.yi;if(t){var i=n[0],r=n[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return n},n.prototype.setViewportSize=function(t){this.yi=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t?zr(t,this.getProjection()):t},n.prototype.getCenterInternal=function(){return this.get(La.CENTER)},n.prototype.getConstraints=function(){return this.Ci},n.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},n.prototype.getHints=function(t){return void 0!==t?(t[0]=this.fi[0],t[1]=this.fi[1],t):this.fi.slice()},n.prototype.calculateExtent=function(t){return Lr(this.calculateExtentInternal(t),this.getProjection())},n.prototype.calculateExtentInternal=function(t){var n=t||this.zi(),i=this.getCenterInternal();Mt(i,1);var r=this.getResolution();Mt(void 0!==r,2);var e=this.getRotation();return Mt(void 0!==e,3),Kn(i,r,e,n)},n.prototype.getMaxResolution=function(){return this.Mi},n.prototype.getMinResolution=function(){return this._i},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this._i)},n.prototype.setMaxZoom=function(t){this.ki(this.Ri({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.Mi)},n.prototype.setMinZoom=function(t){this.ki(this.Ri({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this.ki(this.Ri({constrainResolution:t}))},n.prototype.getProjection=function(){return this.di},n.prototype.getResolution=function(){return this.get(La.RESOLUTION)},n.prototype.getResolutions=function(){return this.Ti},n.prototype.getResolutionForExtent=function(t,n){return this.getResolutionForExtentInternal(Gr(t,this.getProjection()),n)},n.prototype.getResolutionForExtentInternal=function(t,n){var i=n||this.zi(),r=ti(t)/i[0],e=Yn(t)/i[1];return Math.max(r,e)},n.prototype.getResolutionForValueFunction=function(t){var n=t||2,i=this.getConstrainedResolution(this.Mi),r=this._i,e=Math.log(i/r)/Math.log(n);return function(t){return i/Math.pow(n,t*e)}},n.prototype.getRotation=function(){return this.get(La.ROTATION)},n.prototype.getValueForResolutionFunction=function(t){var n=Math.log(t||2),i=this.getConstrainedResolution(this.Mi),r=this._i,e=Math.log(i/r)/n;return function(t){return Math.log(i/t)/n/e}},n.prototype.zi=function(t){var n=this.Ii(t),i=this.Ei;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n},n.prototype.getState=function(){var t=this.getProjection(),n=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),e=this.Ei;if(e){var o=this.zi();r=ru(r,this.Ii(),[o[0]/2+e[3],o[1]/2+e[0]],n,i)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:n,nextCenter:this.gi,nextResolution:this.xi,nextRotation:this.ji,rotation:i,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,n=this.getResolution();return void 0!==n&&(t=this.getZoomForResolution(n)),t},n.prototype.getZoomForResolution=function(t){var n,i,r=this.Ai||0;if(this.Ti){var e=m(this.Ti,t,1);r=e,n=this.Ti[e],i=e==this.Ti.length-1?2:n/this.Ti[e+1]}else n=this.Mi,i=this.Oi;return r+Math.log(n/t)/Math.log(i)},n.prototype.getResolutionForZoom=function(t){if(this.Ti){if(this.Ti.length<=1)return 0;var n=ci(Math.floor(t),0,this.Ti.length-2),i=this.Ti[n]/this.Ti[n+1];return this.Ti[n]/Math.pow(i,ci(t-n,0,1))}return this.Mi/Math.pow(this.Oi,t-this.Ai)},n.prototype.fit=function(t,n){var i;if(Mt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Mt(!ii(t),25),i=$e(r=Gr(t,this.getProjection()));else if(t.getType()===Pt.CIRCLE){var r;(i=$e(r=Gr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Hn(r))}else{var e=Nr();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,n)},n.prototype.rotatedExtentForGeometry=function(t){for(var n=this.getRotation(),i=Math.cos(n),r=Math.sin(-n),e=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,c=-1/0,h=0,f=e.length;h<f;h+=o){var l=e[h]*i-e[h+1]*r,v=e[h]*r+e[h+1]*i;s=Math.min(s,l),a=Math.min(a,v),u=Math.max(u,l),c=Math.max(c,v)}return[s,a,u,c]},n.prototype.fitInternal=function(t,n){var i=n||{},r=i.size;r||(r=this.zi());var e,o=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;e=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var a=this.rotatedExtentForGeometry(t),u=this.getResolutionForExtentInternal(a,[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);u=isNaN(u)?e:Math.max(u,e),u=this.getConstrainedResolution(u,s?0:1);var c=this.getRotation(),h=Math.sin(c),f=Math.cos(c),l=Hn(a);l[0]+=(o[1]-o[3])/2*u,l[1]+=(o[0]-o[2])/2*u;var v=l[0]*f-l[1]*h,d=l[1]*f+l[0]*h,p=this.getConstrainedCenter([v,d],u),y=i.callback?i.callback:_;void 0!==i.duration?this.animateInternal({resolution:u,center:p,duration:i.duration,easing:i.easing},y):(this.wi=u,this.mi=p,this.Ni(!1,!0),$a(y,!0))},n.prototype.centerOn=function(t,n,i){this.centerOnInternal(Fr(t,this.getProjection()),n,i)},n.prototype.centerOnInternal=function(t,n,i){this.setCenterInternal(ru(t,n,i,this.getResolution(),this.getRotation()))},n.prototype.calculateCenterShift=function(t,n,i,r){var e,o=this.Ei;if(o&&t){var s=this.zi(-i),a=ru(t,r,[s[0]/2+o[3],s[1]/2+o[0]],n,i);e=[t[0]-a[0],t[1]-a[1]]}return e},n.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},n.prototype.adjustCenter=function(t){var n=zr(this.mi,this.getProjection());this.setCenter([n[0]+t[0],n[1]+t[1]])},n.prototype.adjustCenterInternal=function(t){var n=this.mi;this.setCenterInternal([n[0]+t[0],n[1]+t[1]])},n.prototype.adjustResolution=function(t,n){var i=n&&Fr(n,this.getProjection());this.adjustResolutionInternal(t,i)},n.prototype.adjustResolutionInternal=function(t,n){var i=this.getAnimating()||this.getInteracting(),r=this.Ii(this.getRotation()),e=this.Ci.resolution(this.wi*t,0,r,i);n&&(this.mi=this.calculateCenterZoom(e,n)),this.wi*=t,this.Ni()},n.prototype.adjustZoom=function(t,n){this.adjustResolution(Math.pow(this.Oi,-t),n)},n.prototype.adjustRotation=function(t,n){n&&(n=Fr(n,this.getProjection())),this.adjustRotationInternal(t,n)},n.prototype.adjustRotationInternal=function(t,n){var i=this.getAnimating()||this.getInteracting(),r=this.Ci.rotation(this.bi+t,i);n&&(this.mi=this.calculateCenterRotate(r,n)),this.bi+=t,this.Ni()},n.prototype.setCenter=function(t){this.setCenterInternal(t?Fr(t,this.getProjection()):t)},n.prototype.setCenterInternal=function(t){this.mi=t,this.Ni()},n.prototype.setHint=function(t,n){return this.fi[t]+=n,this.changed(),this.fi[t]},n.prototype.setResolution=function(t){this.wi=t,this.Ni()},n.prototype.setRotation=function(t){this.bi=t,this.Ni()},n.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},n.prototype.Ni=function(t,n){var i=this.getAnimating()||this.getInteracting()||n,r=this.Ci.rotation(this.bi,i),e=this.Ii(r),o=this.Ci.resolution(this.wi,0,e,i),s=this.Ci.center(this.mi,o,e,i,this.calculateCenterShift(this.mi,o,r,e));this.get(La.ROTATION)!==r&&this.set(La.ROTATION,r),this.get(La.RESOLUTION)!==o&&(this.set(La.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),s&&this.get(La.CENTER)&&tr(this.get(La.CENTER),s)||this.set(La.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.Si=void 0},n.prototype.resolveConstraints=function(t,n,i){var r=void 0!==t?t:200,e=n||0,o=this.Ci.rotation(this.bi),s=this.Ii(o),a=this.Ci.resolution(this.wi,e,s),u=this.Ci.center(this.mi,a,s,!1,this.calculateCenterShift(this.mi,a,o,s));if(0===r&&!this.Si)return this.wi=a,this.bi=o,this.mi=u,void this.Ni();var c=i||(0===r?this.Si:void 0);this.Si=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&tr(this.getCenterInternal(),u)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:a,duration:r,easing:wt,anchor:c}))},n.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Fa,1)},n.prototype.endInteraction=function(t,n,i){var r=i&&Fr(i,this.getProjection());this.endInteractionInternal(t,n,r)},n.prototype.endInteractionInternal=function(t,n,i){this.setHint(Fa,-1),this.resolveConstraints(t,n,i)},n.prototype.getConstrainedCenter=function(t,n){var i=this.Ii(this.getRotation());return this.Ci.center(t,n||this.getResolution(),i)},n.prototype.getConstrainedZoom=function(t,n){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,n))},n.prototype.getConstrainedResolution=function(t,n){var i=n||0,r=this.Ii(this.getRotation());return this.Ci.resolution(t,i,r)},n}(ot);function ou(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*n,i[1]=t[1]+2*n,i}function su(t){return t[0]>0&&t[1]>0}function au(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*n+.5|0,i[1]=t[1]*n+.5|0,i}function uu(t,n){return Array.isArray(t)?t:(void 0===n?n=[t,t]:(n[0]=t,n[1]=t),n)}var cu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function hu(t){t instanceof gs?t.setMapInternal(null):t instanceof ha&&t.getLayers().forEach(hu)}function fu(t,n){if(t instanceof gs)t.setMapInternal(n);else if(t instanceof ha)for(var i=t.getLayers().getArray(),r=0,e=i.length;r<e;++r)fu(i[r],n)}var lu=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=function(t){var n=null;void 0!==t.keyboardEventTarget&&(n="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,r,e,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new ha({layers:t.layers});o[Oa]=s,o[Ea]=t.target,o[Aa]=t.view instanceof eu?t.view:new eu,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ft(t.controls.slice()):(Mt("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new ft(t.interactions.slice()):(Mt("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?e=new ft(t.overlays.slice()):(Mt("function"==typeof t.overlays.getArray,49),e=t.overlays):e=new ft;return{controls:i,interactions:r,keyboardEventTarget:n,overlays:e,values:o}}(n);i.Fi,i.Li=!0,i.Gi=i.handleBrowserEvent.bind(i),i.Di=void 0!==n.maxTilesLoading?n.maxTilesLoading:16,i.Rt=void 0!==n.pixelRatio?n.pixelRatio:Xt,i.Ui,i.qi,i.Bi=function(){this.qi=void 0,this.Wi(Date.now())}.bind(i),i.Vi=[1,0,0,1,0,0],i.Xi=[1,0,0,1,0,0],i.Hi=0,i.Ji=null,i.Ki=null,i.Yi=null,i.Zi=null,i.$i=null,i.Qi=document.createElement("div"),i.Qi.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.Qi.style.position="relative",i.Qi.style.overflow="hidden",i.Qi.style.width="100%",i.Qi.style.height="100%",i.tr=document.createElement("div"),i.tr.style.position="absolute",i.tr.style.zIndex="0",i.tr.style.width="100%",i.tr.style.height="100%",i.tr.style.pointerEvents="none",i.tr.className="ol-overlaycontainer",i.Qi.appendChild(i.tr),i.nr=document.createElement("div"),i.nr.style.position="absolute",i.nr.style.zIndex="0",i.nr.style.width="100%",i.nr.style.height="100%",i.nr.style.pointerEvents="none",i.nr.className="ol-overlaycontainer-stopevent",i.Qi.appendChild(i.nr),i.ir=null,i.Pn=n.moveTolerance,i.rr=r.keyboardEventTarget,i.er=null,i.controls=r.controls||new ft,i.interactions=r.interactions||new ft,i.sr=r.overlays,i.ar={},i.cn=null,i.ur=[],i.cr=new Ia(i.getTilePriority.bind(i),i.hr.bind(i)),i.addChangeListener(Oa,i.lr),i.addChangeListener(Aa,i.vr),i.addChangeListener(Ta,i.dr),i.addChangeListener(Ea,i.pr),i.setProperties(r.values);var e=i;return!n.view||n.view instanceof eu||n.view.then((function(t){e.setView(new eu(t))})),i.controls.addEventListener(st,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(at,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(st,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(at,function(t){t.element.setMap(null)}.bind(i)),i.sr.addEventListener(st,function(t){this.yr(t.element)}.bind(i)),i.sr.addEventListener(at,function(t){var n=t.element.getId();void 0!==n&&delete this.ar[n.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.sr.forEach(i.yr.bind(i)),i}return cu(n,t),n.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},n.prototype.addControl=function(t){this.getControls().push(t)},n.prototype.addInteraction=function(t){this.getInteractions().push(t)},n.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},n.prototype.mr=function(t){fu(t.layer,this)},n.prototype.addOverlay=function(t){this.getOverlays().push(t)},n.prototype.yr=function(t){var n=t.getId();void 0!==n&&(this.ar[n.toString()]=t),t.setMap(this)},n.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},n.prototype.forEachFeatureAtPixel=function(t,n,i){if(this.Ji&&this.cn){var r=this.getCoordinateFromPixelInternal(t),e=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,o=void 0!==i.layerFilter?i.layerFilter:k,s=!1!==i.checkWrapped;return this.cn.forEachFeatureAtCoordinate(r,this.Ji,e,s,n,null,o,null)}},n.prototype.getFeaturesAtPixel=function(t,n){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),n),i},n.prototype.getAllLayers=function(){var t=[];return function n(i){i.forEach((function(i){i instanceof ha?n(i.getLayers()):t.push(i)}))}(this.getLayers()),t},n.prototype.forEachLayerAtPixel=function(t,n,i){if(this.Ji&&this.cn){var r=i||{},e=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||k;return this.cn.forEachLayerAtPixel(t,this.Ji,e,n,o)}},n.prototype.hasFeatureAtPixel=function(t,n){if(!this.Ji||!this.cn)return!1;var i=this.getCoordinateFromPixelInternal(t),r=void 0!==(n=void 0!==n?n:{}).layerFilter?n.layerFilter:k,e=void 0!==n.hitTolerance?n.hitTolerance:0,o=!1!==n.checkWrapped;return this.cn.hasFeatureAtCoordinate(i,this.Ji,e,o,r,null)},n.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},n.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},n.prototype.getEventPixel=function(t){var n=this.Qi.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-n.left,i.clientY-n.top]},n.prototype.getTarget=function(){return this.get(Ea)},n.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},n.prototype.getCoordinateFromPixel=function(t){return zr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},n.prototype.getCoordinateFromPixelInternal=function(t){var n=this.Ji;return n?rn(n.pixelToCoordinateTransform,t.slice()):null},n.prototype.getControls=function(){return this.controls},n.prototype.getOverlays=function(){return this.sr},n.prototype.getOverlayById=function(t){var n=this.ar[t.toString()];return void 0!==n?n:null},n.prototype.getInteractions=function(){return this.interactions},n.prototype.getLayerGroup=function(){return this.get(Oa)},n.prototype.setLayers=function(t){var n=this.getLayerGroup();if(t instanceof ft)n.setLayers(t);else{var i=n.getLayers();i.clear(),i.extend(t)}},n.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},n.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),n=0,i=t.length;n<i;++n){var r=t[n];if(r.visible){var e=r.layer.getRenderer();if(e&&!e.ready)return!0;var o=r.layer.getSource();if(o&&o.loading)return!0}}return!1},n.prototype.getPixelFromCoordinate=function(t){var n=Fr(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(n)},n.prototype.getPixelFromCoordinateInternal=function(t){var n=this.Ji;return n?rn(n.coordinateToPixelTransform,t.slice(0,2)):null},n.prototype.getRenderer=function(){return this.cn},n.prototype.getSize=function(){return this.get(Ta)},n.prototype.getView=function(){return this.get(Aa)},n.prototype.getViewport=function(){return this.Qi},n.prototype.getOverlayContainer=function(){return this.tr},n.prototype.getOverlayContainerStopEvent=function(){return this.nr},n.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},n.prototype.getTilePriority=function(t,n,i,r){return Na(this.Ji,t,n,i,r)},n.prototype.handleBrowserEvent=function(t,n){var i=n||t.type,r=new da(i,this,t);this.handleMapBrowserEvent(r)},n.prototype.handleMapBrowserEvent=function(t){if(this.Ji){var n=t.originalEvent,i=n.type;if(i===ma||i===K||i===W){var r=this.getOwnerDocument(),e=this.Qi.getRootNode?this.Qi.getRootNode():r,o=n.target;if(this.nr.contains(o)||!(e===r?r.documentElement:e).contains(o))return}if(t.frameState=this.Ji,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},n.prototype.handlePostRender=function(){var t=this.Ji,n=this.cr;if(!n.isEmpty()){var i=this.Di,r=i;if(t){var e=t.viewHints;if(e[za]||e[Fa]){var o=Date.now()-t.time>8;i=o?0:8,r=o?0:2}}n.getTilesLoading()<i&&(n.reprioritize(),n.loadMoreTiles(i,r))}t&&this.cn&&!t.animate&&(!0===this.Fi?(this.hasListener(vs)&&this.cn.dispatchRenderEvent(vs,t),!1===this.Li&&(this.Li=!0,this.dispatchEvent(new la(_a,this,t)))):!0===this.Li&&(this.Li=!1,this.dispatchEvent(new la(Ma,this,t))));for(var s=this.ur,a=0,u=s.length;a<u;++a)s[a](this,t);s.length=0},n.prototype.dr=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},n.prototype.pr=function(){if(this.ir){for(var t=0,n=this.er.length;t<n;++t)$(this.er[t]);this.er=null,this.Qi.removeEventListener(L,this.Gi),this.Qi.removeEventListener(K,this.Gi),this.ir.dispose(),this.ir=null,Co(this.Qi)}var i=this.getTargetElement();if(i){for(var r in i.appendChild(this.Qi),this.cn||(this.cn=this.createRenderer()),this.ir=new xa(this,this.Pn),pa)this.ir.addEventListener(pa[r],this.handleMapBrowserEvent.bind(this));this.Qi.addEventListener(L,this.Gi,!1),this.Qi.addEventListener(K,this.Gi,!!Kt&&{passive:!1});var e=this.getOwnerDocument().defaultView,o=this.rr?this.rr:i;this.er=[Y(o,W,this.handleBrowserEvent,this),Y(o,V,this.handleBrowserEvent,this),Y(e,H,this.updateSize,this)]}else this.cn&&(clearTimeout(this.Ui),this.Ui=void 0,this.ur.length=0,this.cn.dispose(),this.cn=null),this.qi&&(cancelAnimationFrame(this.qi),this.qi=void 0);this.updateSize()},n.prototype.hr=function(){this.render()},n.prototype.wr=function(){this.render()},n.prototype.vr=function(){this.Yi&&($(this.Yi),this.Yi=null),this.Zi&&($(this.Zi),this.Zi=null);var t=this.getView();t&&(this.br(),this.Yi=Y(t,l,this.wr,this),this.Zi=Y(t,N,this.wr,this),t.resolveConstraints(0)),this.render()},n.prototype.lr=function(){this.$i&&(this.$i.forEach($),this.$i=null);var t=this.getLayerGroup();t&&(this.mr(new ua("addlayer",t)),this.$i=[Y(t,l,this.render,this),Y(t,N,this.render,this),Y(t,"addlayer",this.mr,this),Y(t,"removelayer",this.gr,this)]),this.render()},n.prototype.isRendered=function(){return!!this.Ji},n.prototype.renderSync=function(){this.qi&&cancelAnimationFrame(this.qi),this.Bi()},n.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),n=0,i=t.length;n<i;++n){var r=t[n].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}},n.prototype.render=function(){this.cn&&void 0===this.qi&&(this.qi=requestAnimationFrame(this.Bi))},n.prototype.removeControl=function(t){return this.getControls().remove(t)},n.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},n.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},n.prototype.gr=function(t){hu(t.layer)},n.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},n.prototype.Wi=function(t){var n=this,i=this.getSize(),r=this.getView(),e=this.Ji,s=null;if(void 0!==i&&su(i)&&r&&r.isDef()){var a=r.getHints(this.Ji?this.Ji.viewHints:void 0),u=r.getState();if(s={animate:!1,coordinateToPixelTransform:this.Vi,declutterTree:null,extent:Kn(u.center,u.resolution,u.rotation,i),index:this.Hi++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.Rt,pixelToCoordinateTransform:this.Xi,postRenderFunctions:[],size:i,tileQueue:this.cr,time:t,usedTiles:{},viewState:u,viewHints:a,wantedTiles:{},mapId:o(this),renderTargets:{}},u.nextCenter&&u.nextResolution){var c=isNaN(u.nextRotation)?u.rotation:u.nextRotation;s.nextExtent=Kn(u.nextCenter,u.nextResolution,c,i)}}if(this.Ji=s,this.cn.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.ur,s.postRenderFunctions),e)(!this.Ki||!ii(this.Ki)&&!Nn(s.extent,this.Ki))&&(this.dispatchEvent(new la(Sa,this,e)),this.Ki=Rn(this.Ki));this.Ki&&!s.viewHints[za]&&!s.viewHints[Fa]&&!Nn(s.extent,this.Ki)&&(this.dispatchEvent(new la(ka,this,s)),kn(s.extent,this.Ki))}this.dispatchEvent(new la(ja,this,s)),this.Fi=this.hasListener(Ma)||this.hasListener(_a)||this.hasListener(vs)?!this.cr.getTilesLoading()&&!this.cr.getCount()&&!this.getLoadingOrNotReady():void 0,this.Ui||(this.Ui=setTimeout((function(){n.Ui=void 0,n.handlePostRender()}),0))},n.prototype.setLayerGroup=function(t){var n=this.getLayerGroup();n&&this.gr(new ua("removelayer",n)),this.set(Oa,t)},n.prototype.setSize=function(t){this.set(Ta,t)},n.prototype.setTarget=function(t){this.set(Ea,t)},n.prototype.setView=function(t){if(!t||t instanceof eu)this.set(Aa,t);else{this.set(Aa,new eu);var n=this;t.then((function(t){n.setView(new eu(t))}))}},n.prototype.updateSize=function(){var t=this.getTargetElement(),n=void 0;if(t){var i=getComputedStyle(t),r=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),e=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(r)||isNaN(e)||!su(n=[r,e])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(n),this.br()},n.prototype.br=function(){var t=this.getView();if(t){var n=void 0,i=getComputedStyle(this.Qi);i.width&&i.height&&(n=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(n)}},n}(ot),vu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),du=function(t){function n(n){var i=t.call(this)||this,r=n.element;return!r||n.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),i.element=r||null,i.jr=null,i.vn=null,i.listenerKeys=[],n.render&&(i.render=n.render),n.target&&i.setTarget(n.target),i}return vu(n,t),n.prototype.disposeInternal=function(){Co(this.element),t.prototype.disposeInternal.call(this)},n.prototype.getMap=function(){return this.vn},n.prototype.setMap=function(t){this.vn&&Co(this.element);for(var n=0,i=this.listenerKeys.length;n<i;++n)$(this.listenerKeys[n]);(this.listenerKeys.length=0,this.vn=t,t)&&((this.jr?this.jr:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_&&this.listenerKeys.push(Y(t,ja,this.render,this)),t.render())},n.prototype.render=function(t){},n.prototype.setTarget=function(t){this.jr="string"==typeof t?document.getElementById(t):t},n}(ot),pu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yu=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).Sr=document.createElement("ul"),i.kr=void 0===r.collapsed||r.collapsed,i.Mr=i.kr,i._r=void 0!==r.collapsible,i.Tr=void 0===r.collapsible||r.collapsible,i.Tr||(i.kr=!1);var e=void 0!==r.className?r.className:"ol-attribution",o=void 0!==r.tipLabel?r.tipLabel:"Attributions",s=void 0!==r.expandClassName?r.expandClassName:e+"-expand",a=void 0!==r.collapseLabel?r.collapseLabel:"›",u=void 0!==r.collapseClassName?r.collapseClassName:e+"-collapse";"string"==typeof a?(i.Er=document.createElement("span"),i.Er.textContent=a,i.Er.className=u):i.Er=a;var c=void 0!==r.label?r.label:"i";"string"==typeof c?(i.Ar=document.createElement("span"),i.Ar.textContent=c,i.Ar.className=s):i.Ar=c;var h=i.Tr&&!i.kr?i.Er:i.Ar;i.Cr=document.createElement("button"),i.Cr.setAttribute("type","button"),i.Cr.setAttribute("aria-expanded",String(!i.kr)),i.Cr.title=o,i.Cr.appendChild(h),i.Cr.addEventListener(G,i.Rr.bind(i),!1);var f=e+" "+"ol-unselectable "+As+(i.kr&&i.Tr?" ol-collapsed":"")+(i.Tr?"":" ol-uncollapsible"),l=i.element;return l.className=f,l.appendChild(i.Cr),l.appendChild(i.Sr),i.Pr=[],i.mn=!0,i}return pu(n,t),n.prototype.Ir=function(t){for(var n={},i=[],r=!0,e=t.layerStatesArray,o=0,s=e.length;o<s;++o){var a=e[o];if(bs(a,t.viewState)){var u=a.layer.getSource();if(u){var c=u.getAttributions();if(c){var h=c(t);if(h)if(r=r&&!1!==u.getAttributionsCollapsible(),Array.isArray(h))for(var f=0,l=h.length;f<l;++f)h[f]in n||(i.push(h[f]),n[h[f]]=!0);else h in n||(i.push(h),n[h]=!0)}}}}return this._r||this.setCollapsible(r),i},n.prototype.Nr=function(t){if(t){var n=this.Ir(t),i=n.length>0;if(this.mn!=i&&(this.element.style.display=i?"":"none",this.mn=i),!x(n,this.Pr)){Ro(this.Sr);for(var r=0,e=n.length;r<e;++r){var o=document.createElement("li");o.innerHTML=n[r],this.Sr.appendChild(o)}this.Pr=n}}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.Rr=function(t){t.preventDefault(),this.zr(),this.Mr=this.kr},n.prototype.zr=function(){this.element.classList.toggle(Cs),this.kr?Ao(this.Er,this.Ar):Ao(this.Ar,this.Er),this.kr=!this.kr,this.Cr.setAttribute("aria-expanded",String(!this.kr))},n.prototype.getCollapsible=function(){return this.Tr},n.prototype.setCollapsible=function(t){this.Tr!==t&&(this.Tr=t,this.element.classList.toggle("ol-uncollapsible"),this.Mr&&this.zr())},n.prototype.setCollapsed=function(t){this.Mr=t,this.Tr&&this.kr!==t&&this.zr()},n.prototype.getCollapsed=function(){return this.kr},n.prototype.render=function(t){this.Nr(t.frameState)},n}(du),mu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wu=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var e=void 0!==r.className?r.className:"ol-rotate",o=void 0!==r.label?r.label:"⇧",s=void 0!==r.compassClassName?r.compassClassName:"ol-compass";i.Ar=null,"string"==typeof o?(i.Ar=document.createElement("span"),i.Ar.className=s,i.Ar.textContent=o):(i.Ar=o,i.Ar.classList.add(s));var a=r.tipLabel?r.tipLabel:"Reset rotation",u=document.createElement("button");u.className=e+"-reset",u.setAttribute("type","button"),u.title=a,u.appendChild(i.Ar),u.addEventListener(G,i.Rr.bind(i),!1);var c=e+" "+"ol-unselectable "+As,h=i.element;return h.className=c,h.appendChild(u),i.Fr=r.resetNorth?r.resetNorth:void 0,i.Lr=void 0!==r.duration?r.duration:250,i.Gr=void 0===r.autoHide||r.autoHide,i.Dr=void 0,i.Gr&&i.element.classList.add(_s),i}return mu(n,t),n.prototype.Rr=function(t){t.preventDefault(),void 0!==this.Fr?this.Fr():this.Ur()},n.prototype.Ur=function(){var t=this.getMap().getView();if(t){var n=t.getRotation();void 0!==n&&(this.Lr>0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.Lr,easing:wt}):t.setRotation(0))}},n.prototype.render=function(t){var n=t.frameState;if(n){var i=n.viewState.rotation;if(i!=this.Dr){var r="rotate("+i+"rad)";if(this.Gr){var e=this.element.classList.contains(_s);e||0!==i?e&&0!==i&&this.element.classList.remove(_s):this.element.classList.add(_s)}this.Ar.style.transform=r}this.Dr=i}},n}(du),bu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gu=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),target:r.target})||this;var e=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:e+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:e+"-out",u=void 0!==r.zoomInLabel?r.zoomInLabel:"+",c=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",h=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",f=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=s,l.setAttribute("type","button"),l.title=h,l.appendChild("string"==typeof u?document.createTextNode(u):u),l.addEventListener(G,i.Rr.bind(i,o),!1);var v=document.createElement("button");v.className=a,v.setAttribute("type","button"),v.title=f,v.appendChild("string"==typeof c?document.createTextNode(c):c),v.addEventListener(G,i.Rr.bind(i,-o),!1);var d=e+" "+"ol-unselectable "+As,p=i.element;return p.className=d,p.appendChild(l),p.appendChild(v),i.Lr=void 0!==r.duration?r.duration:250,i}return bu(n,t),n.prototype.Rr=function(t,n){n.preventDefault(),this.qr(t)},n.prototype.qr=function(t){var n=this.getMap().getView();if(n){var i=n.getZoom();if(void 0!==i){var r=n.getConstrainedZoom(i+t);this.Lr>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.Lr,easing:wt})):n.setZoom(r)}}},n}(du);function xu(t){var n=t||{},i=new ft;return(void 0===n.zoom||n.zoom)&&i.push(new gu(n.zoomOptions)),(void 0===n.rotate||n.rotate)&&i.push(new wu(n.rotateOptions)),(void 0===n.attribution||n.attribution)&&i.push(new yu(n.attributionOptions)),i}var ju="active",Su=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function ku(t,n,i){var r=t.getCenterInternal();if(r){var e=[r[0]+n[0],r[1]+n[1]];t.animateInternal({duration:void 0!==i?i:250,easing:gt,center:t.getConstrainedCenter(e)})}}function Mu(t,n,i,r){var e=t.getZoom();if(void 0!==e){var o=t.getConstrainedZoom(e+n),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==r?r:250,easing:wt})}}var _u=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,n&&n.handleEvent&&(i.handleEvent=n.handleEvent),i.vn=null,i.setActive(!0),i}return Su(n,t),n.prototype.getActive=function(){return this.get(ju)},n.prototype.getMap=function(){return this.vn},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(ju,t)},n.prototype.setMap=function(t){this.vn=t},n}(ot),Ou=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tu=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Br=r.delta?r.delta:1,i.Lr=void 0!==r.duration?r.duration:250,i}return Ou(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==pa.DBLCLICK){var i=t.originalEvent,r=t.map,e=t.coordinate,o=i.shiftKey?-this.Br:this.Br;Mu(r.getView(),o,e,this.Lr),i.preventDefault(),n=!0}return!n},n}(_u),Eu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Au(t){for(var n=t.length,i=0,r=0,e=0;e<n;e++)i+=t[e].clientX,r+=t[e].clientY;return[i/n,r/n]}var Cu=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,r)||this,r.handleDownEvent&&(i.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(i.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(i.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(i.handleUpEvent=r.handleUpEvent),r.stopDown&&(i.stopDown=r.stopDown),i.handlingDownUpSequence=!1,i.Wr={},i.targetPointers=[],i}return Eu(n,t),n.prototype.getPointerCount=function(){return this.targetPointers.length},n.prototype.handleDownEvent=function(t){return!1},n.prototype.handleDragEvent=function(t){},n.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var n=!1;if(this.Vr(t),this.handlingDownUpSequence){if(t.type==pa.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==pa.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==pa.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,n=this.stopDown(r)}else t.type==pa.POINTERMOVE&&this.handleMoveEvent(t);return!n},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.Vr=function(t){if(function(t){var n=t.type;return n===pa.POINTERDOWN||n===pa.POINTERDRAG||n===pa.POINTERUP}(t)){var n=t.originalEvent,i=n.pointerId.toString();t.type==pa.POINTERUP?delete this.Wr[i]:(t.type==pa.POINTERDOWN||i in this.Wr)&&(this.Wr[i]=n),this.targetPointers=C(this.Wr)}},n}(_u);function Ru(t){var n=arguments;return function(t){for(var i=!0,r=0,e=n.length;r<e&&(i=i&&n[r](t));++r);return i}}var Pu=function(t){var n=t.originalEvent;return n.altKey&&!(n.metaKey||n.ctrlKey)&&!n.shiftKey},Iu=function(t){var n=t.originalEvent;return n.altKey&&!(n.metaKey||n.ctrlKey)&&n.shiftKey},Nu=function(t){var n=t.map.getTargetElement(),i=t.map.getOwnerDocument().activeElement;return n.contains(i)},zu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||Nu(t)},Fu=k,Lu=function(t){var n=t.originalEvent;return 0==n.button&&!(Wt&&Vt&&n.ctrlKey)},Gu=M,Du=function(t){return t.type==pa.SINGLECLICK},Uu=function(t){var n=t.originalEvent;return!n.altKey&&!(n.metaKey||n.ctrlKey)&&!n.shiftKey},qu=function(t){var n=t.originalEvent;return!n.altKey&&!(n.metaKey||n.ctrlKey)&&n.shiftKey},Bu=function(t){var n=t.originalEvent.target.tagName;return"INPUT"!==n&&"SELECT"!==n&&"TEXTAREA"!==n},Wu=function(t){var n=t.originalEvent;return Mt(void 0!==n,56),"mouse"==n.pointerType},Vu=function(t){var n=t.originalEvent;return Mt(void 0!==n,56),n.isPrimary&&0===n.button},Xu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hu=function(t){function n(n){var i=t.call(this,{stopDown:M})||this,r=n||{};i.Xr=r.kinetic,i.lastCentroid=null,i.Hr,i.Jr=!1;var e=r.condition?r.condition:Ru(Uu,Vu);return i.Kr=r.onFocusOnly?Ru(zu,e):e,i.Yr=!1,i}return Xu(n,t),n.prototype.handleDragEvent=function(t){this.Jr||(this.Jr=!0,this.getMap().getView().beginInteraction());var n=this.targetPointers,i=Au(n);if(n.length==this.Hr){if(this.Xr&&this.Xr.update(i[0],i[1]),this.lastCentroid){var r=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],e=t.map.getView();ir(r,e.getResolution()),nr(r,e.getRotation()),e.adjustCenterInternal(r)}}else this.Xr&&this.Xr.begin();this.lastCentroid=i,this.Hr=n.length,t.originalEvent.preventDefault()},n.prototype.handleUpEvent=function(t){var n=t.map,i=n.getView();if(0===this.targetPointers.length){if(!this.Yr&&this.Xr&&this.Xr.end()){var r=this.Xr.getDistance(),e=this.Xr.getAngle(),o=i.getCenterInternal(),s=n.getPixelFromCoordinateInternal(o),a=n.getCoordinateFromPixelInternal([s[0]-r*Math.cos(e),s[1]-r*Math.sin(e)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:wt})}return this.Jr&&(this.Jr=!1,i.endInteraction()),!1}return this.Xr&&this.Xr.begin(),this.lastCentroid=null,!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.Kr(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.Xr&&this.Xr.begin(),this.Yr=this.targetPointers.length>1,!0}return!1},n}(Cu),Ju=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ku=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{stopDown:M})||this).Kr=r.condition?r.condition:Iu,i.Zr=void 0,i.Lr=void 0!==r.duration?r.duration:250,i}return Ju(n,t),n.prototype.handleDragEvent=function(t){if(Wu(t)){var n=t.map,i=n.getView();if(i.getConstraints().rotation!==Ha){var r=n.getSize(),e=t.pixel,o=Math.atan2(r[1]/2-e[1],e[0]-r[0]/2);if(void 0!==this.Zr){var s=o-this.Zr;i.adjustRotationInternal(-s)}this.Zr=o}}},n.prototype.handleUpEvent=function(t){return!Wu(t)||(t.map.getView().endInteraction(this.Lr),!1)},n.prototype.handleDownEvent=function(t){return!!Wu(t)&&(!(!Lu(t)||!this.Kr(t))&&(t.map.getView().beginInteraction(),this.Zr=void 0,!0))},n}(Cu),Yu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zu=function(t){function n(n){var i=t.call(this)||this;return i.$r=null,i.pn=document.createElement("div"),i.pn.style.position="absolute",i.pn.style.pointerEvents="auto",i.pn.className="ol-box "+n,i.vn=null,i.Qr=null,i.te=null,i}return Yu(n,t),n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.ne=function(){var t=this.Qr,n=this.te,i="px",r=this.pn.style;r.left=Math.min(t[0],n[0])+i,r.top=Math.min(t[1],n[1])+i,r.width=Math.abs(n[0]-t[0])+i,r.height=Math.abs(n[1]-t[1])+i},n.prototype.setMap=function(t){if(this.vn){this.vn.getOverlayContainer().removeChild(this.pn);var n=this.pn.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.vn=t,this.vn&&this.vn.getOverlayContainer().appendChild(this.pn)},n.prototype.setPixels=function(t,n){this.Qr=t,this.te=n,this.createOrUpdateGeometry(),this.ne()},n.prototype.createOrUpdateGeometry=function(){var t=this.Qr,n=this.te,i=[t,[t[0],n[1]],n,[n[0],t[1]]].map(this.vn.getCoordinateFromPixelInternal,this.vn);i[4]=i[0].slice(),this.$r?this.$r.setCoordinates([i]):this.$r=new Ye([i])},n.prototype.getGeometry=function(){return this.$r},n}(v),$u=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qu="boxstart",tc="boxdrag",nc="boxend",ic="boxcancel",rc=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.coordinate=i,e.mapBrowserEvent=r,e}return $u(n,t),n}(f),ec=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.ie=new Zu(r.className||"ol-dragbox"),i.re=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.Qr=null,i.Kr=r.condition?r.condition:Lu,i.ee=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return $u(n,t),n.prototype.defaultBoxEndCondition=function(t,n,i){var r=i[0]-n[0],e=i[1]-n[1];return r*r+e*e>=this.re},n.prototype.getGeometry=function(){return this.ie.getGeometry()},n.prototype.handleDragEvent=function(t){this.ie.setPixels(this.Qr,t.pixel),this.dispatchEvent(new rc(tc,t.coordinate,t))},n.prototype.handleUpEvent=function(t){this.ie.setMap(null);var n=this.ee(t,this.Qr,t.pixel);return n&&this.onBoxEnd(t),this.dispatchEvent(new rc(n?nc:ic,t.coordinate,t)),!1},n.prototype.handleDownEvent=function(t){return!!this.Kr(t)&&(this.Qr=t.pixel,this.ie.setMap(t.map),this.ie.setPixels(this.Qr,this.Qr),this.dispatchEvent(new rc(Qu,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(Cu),oc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sc=function(t){function n(n){var i=this,r=n||{},e=r.condition?r.condition:qu;return(i=t.call(this,{condition:e,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).Lr=void 0!==r.duration?r.duration:200,i.oe=void 0!==r.out&&r.out,i}return oc(n,t),n.prototype.onBoxEnd=function(t){var n=this.getMap().getView(),i=this.getGeometry();if(this.oe){var r=n.rotatedExtentForGeometry(i),e=n.getResolutionForExtentInternal(r),o=n.getResolution()/e;(i=i.clone()).scale(o*o)}n.fitInternal(i,{duration:this.Lr,easing:wt})},n}(ec),ac=37,uc=38,cc=39,hc=40,fc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lc=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.se=function(t){return Uu(t)&&Bu(t)},i.Kr=void 0!==r.condition?r.condition:i.se,i.Lr=void 0!==r.duration?r.duration:100,i.ae=void 0!==r.pixelDelta?r.pixelDelta:128,i}return fc(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==W){var i=t.originalEvent,r=i.keyCode;if(this.Kr(t)&&(r==hc||r==ac||r==cc||r==uc)){var e=t.map.getView(),o=e.getResolution()*this.ae,s=0,a=0;r==hc?a=-o:r==ac?s=-o:r==cc?s=o:a=o;var u=[s,a];nr(u,e.getRotation()),ku(e,u,this.Lr),i.preventDefault(),n=!0}}return!n},n}(_u),vc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dc=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Kr=r.condition?r.condition:Bu,i.Br=r.delta?r.delta:1,i.Lr=void 0!==r.duration?r.duration:100,i}return vc(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==W||t.type==V){var i=t.originalEvent,r=i.charCode;if(this.Kr(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var e=t.map,o=r=="+".charCodeAt(0)?this.Br:-this.Br;Mu(e.getView(),o,void 0,this.Lr),i.preventDefault(),n=!0}}return!n},n}(_u),pc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yc="trackpad",mc="wheel",wc=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,r)||this).ue=0,i.ce=0,i.wt=void 0!==r.maxDelta?r.maxDelta:1,i.Lr=void 0!==r.duration?r.duration:250,i.he=void 0!==r.timeout?r.timeout:80,i.fe=void 0===r.useAnchor||r.useAnchor,i.le=void 0!==r.constrainResolution&&r.constrainResolution;var e=r.condition?r.condition:Fu;return i.Kr=r.onFocusOnly?Ru(zu,e):e,i.ve=null,i.de=void 0,i.pe,i.ye=void 0,i.me=400,i.we,i.be=300,i}return pc(n,t),n.prototype.ge=function(){this.we=void 0,this.getMap().getView().endInteraction(void 0,this.ce?this.ce>0?1:-1:0,this.ve)},n.prototype.handleEvent=function(t){if(!this.Kr(t))return!0;if(t.type!==K)return!0;var n,i=t.map,r=t.originalEvent;if(r.preventDefault(),this.fe&&(this.ve=t.coordinate),t.type==K&&(n=r.deltaY,Ut&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=Xt),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.ce=n;var e=Date.now();void 0===this.de&&(this.de=e),(!this.ye||e-this.de>this.me)&&(this.ye=Math.abs(n)<4?yc:mc);var o=i.getView();if(this.ye===yc&&!o.getConstrainResolution()&&!this.le)return this.we?clearTimeout(this.we):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.we=setTimeout(this.ge.bind(this),this.he),o.adjustZoom(-n/this.be,this.ve),this.de=e,!1;this.ue+=n;var s=Math.max(this.he-(e-this.de),0);return clearTimeout(this.pe),this.pe=setTimeout(this.xe.bind(this,i),s),!1},n.prototype.xe=function(t){var n=t.getView();n.getAnimating()&&n.cancelAnimations();var i=-ci(this.ue,-this.wt*this.be,this.wt*this.be)/this.be;(n.getConstrainResolution()||this.le)&&(i=i?i>0?1:-1:0),Mu(n,i,this.ve,this.Lr),this.ye=void 0,this.ue=0,this.ve=null,this.de=void 0,this.pe=void 0},n.prototype.setMouseAnchor=function(t){this.fe=t,t||(this.ve=null)},n}(_u),bc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gc=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=M),(i=t.call(this,e)||this).je=null,i.Zr=void 0,i.Se=!1,i.ke=0,i.Me=void 0!==r.threshold?r.threshold:.3,i.Lr=void 0!==r.duration?r.duration:250,i}return bc(n,t),n.prototype.handleDragEvent=function(t){var n=0,i=this.targetPointers[0],r=this.targetPointers[1],e=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.Zr){var o=e-this.Zr;this.ke+=o,!this.Se&&Math.abs(this.ke)>this.Me&&(this.Se=!0),n=o}this.Zr=e;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Ha){var u=s.getViewport().getBoundingClientRect(),c=Au(this.targetPointers);c[0]-=u.left,c[1]-=u.top,this.je=s.getCoordinateFromPixelInternal(c),this.Se&&(s.render(),a.adjustRotationInternal(n,this.je))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.Lr),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.je=null,this.Zr=void 0,this.Se=!1,this.ke=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Cu),xc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jc=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=M),(i=t.call(this,e)||this).je=null,i.Lr=void 0!==r.duration?r.duration:400,i._e=void 0,i.Oe=1,i}return xc(n,t),n.prototype.handleDragEvent=function(t){var n=1,i=this.targetPointers[0],r=this.targetPointers[1],e=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(e*e+o*o);void 0!==this._e&&(n=this._e/s),this._e=s;var a=t.map,u=a.getView();1!=n&&(this.Oe=n);var c=a.getViewport().getBoundingClientRect(),h=Au(this.targetPointers);h[0]-=c.left,h[1]-=c.top,this.je=a.getCoordinateFromPixelInternal(h),a.render(),u.adjustResolutionInternal(n,this.je)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var n=t.map.getView(),i=this.Oe>1?1:-1;return n.endInteraction(this.Lr,i),!1}return!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.je=null,this._e=void 0,this.Oe=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Cu);function Sc(t){var n=t||{},i=new ft,r=new zo(-.005,.05,100);return(void 0===n.altShiftDragRotate||n.altShiftDragRotate)&&i.push(new Ku),(void 0===n.doubleClickZoom||n.doubleClickZoom)&&i.push(new Tu({delta:n.zoomDelta,duration:n.zoomDuration})),(void 0===n.dragPan||n.dragPan)&&i.push(new Hu({onFocusOnly:n.onFocusOnly,kinetic:r})),(void 0===n.pinchRotate||n.pinchRotate)&&i.push(new gc),(void 0===n.pinchZoom||n.pinchZoom)&&i.push(new jc({duration:n.zoomDuration})),(void 0===n.keyboard||n.keyboard)&&(i.push(new lc),i.push(new dc({delta:n.zoomDelta,duration:n.zoomDuration}))),(void 0===n.mouseWheelZoom||n.mouseWheelZoom)&&i.push(new wc({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(void 0===n.shiftDragZoom||n.shiftDragZoom)&&i.push(new sc({duration:n.zoomDuration})),i}var kc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mc=function(t){function n(n){return(n=E({},n)).controls||(n.controls=xu()),n.interactions||(n.interactions=Sc({onFocusOnly:!0})),t.call(this,n)||this}return kc(n,t),n.prototype.createRenderer=function(){return new sa(this)},n}(lu),_c="bottom-left",Oc="bottom-center",Tc="bottom-right",Ec="center-left",Ac="center-center",Cc="center-right",Rc="top-left",Pc="top-center",Ic="top-right";function Nc(t){return(Nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var zc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fc="element",Lc="map",Gc="offset",Dc="position",Uc="positioning",qc=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.options=n,i.id=n.id,i.insertFirst=void 0===n.insertFirst||n.insertFirst,i.stopEvent=void 0===n.stopEvent||n.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==n.className?n.className:"ol-overlay-container ol-selectable",i.element.style.position="absolute",i.element.style.pointerEvents="auto";var r=n.autoPan;return r&&"object"!==Nc(r)&&(r={animation:n.autoPanAnimation,margin:n.autoPanMargin}),i.autoPan=r||!1,i.rendered={_t:"",visible:!0},i.mapPostrenderListenerKey=null,i.addChangeListener(Fc,i.handleElementChanged),i.addChangeListener(Lc,i.handleMapChanged),i.addChangeListener(Gc,i.handleOffsetChanged),i.addChangeListener(Dc,i.handlePositionChanged),i.addChangeListener(Uc,i.handlePositioningChanged),void 0!==n.element&&i.setElement(n.element),i.setOffset(void 0!==n.offset?n.offset:[0,0]),i.setPositioning(void 0!==n.positioning?n.positioning:Rc),void 0!==n.position&&i.setPosition(n.position),i}return zc(n,t),n.prototype.getElement=function(){return this.get(Fc)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(Lc)||null},n.prototype.getOffset=function(){return this.get(Gc)},n.prototype.getPosition=function(){return this.get(Dc)},n.prototype.getPositioning=function(){return this.get(Uc)},n.prototype.handleElementChanged=function(){Ro(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Co(this.element),$(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=Y(t,ja,this.render,this),this.updatePixelPosition();var n=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(Fc,t)},n.prototype.setMap=function(t){this.set(Lc,t)},n.prototype.setOffset=function(t){this.set(Gc,t)},n.prototype.setPosition=function(t){this.set(Dc,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var n=this.getMap();if(n&&n.getTargetElement()&&this.get(Dc)){var i=this.getRect(n.getTargetElement(),n.getSize()),r=this.getElement(),e=this.getRect(r,[To(r),Eo(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!On(i,e)){var a=e[0]-i[0],u=i[2]-e[2],c=e[1]-i[1],h=i[3]-e[3],f=[0,0];if(a<0?f[0]=a-s:u<0&&(f[0]=Math.abs(u)+s),c<0?f[1]=c-s:h<0&&(f[1]=Math.abs(h)+s),0!==f[0]||0!==f[1]){var l=n.getView().getCenterInternal(),v=n.getPixelFromCoordinateInternal(l);if(!v)return;var d=[v[0]+f[0],v[1]+f[1]],p=o.animation||{};n.getView().animateInternal({center:n.getCoordinateFromPixelInternal(d),duration:p.duration,easing:p.easing})}}}},n.prototype.getRect=function(t,n){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,e=i.top+window.pageYOffset;return[r,e,r+n[0],e+n[1]]},n.prototype.setPositioning=function(t){this.set(Uc,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),n=this.getPosition();if(t&&t.isRendered()&&n){var i=t.getPixelFromCoordinate(n),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},n.prototype.updateRenderedPosition=function(t,n){var i=this.element.style,r=this.getOffset(),e=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";e==Tc||e==Cc||e==Ic?a="-100%":e!=Oc&&e!=Ac&&e!=Pc||(a="-50%"),e==_c||e==Oc||e==Tc?u="-100%":e!=Ec&&e!=Ac&&e!=Cc||(u="-50%");var c="translate(".concat(a,", ").concat(u,") translate(").concat(o,", ").concat(s,")");this.rendered._t!=c&&(this.rendered._t=c,i.transform=c,i.msTransform=c)},n.prototype.getOptions=function(){return this.options},n}(ot),Bc=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.Te=0,this.Ee={},this.Ae=null,this.Ce=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.Te=0,this.Ee={},this.Ae=null,this.Ce=null},t.prototype.containsKey=function(t){return this.Ee.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var n=this.Ae;n;)t(n.Re,n.Pe,this),n=n.newer},t.prototype.get=function(t,n){var i=this.Ee[t];return Mt(void 0!==i,15),i===this.Ce||(i===this.Ae?(this.Ae=this.Ae.newer,this.Ae.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.Ce,this.Ce.newer=i,this.Ce=i),i.Re},t.prototype.remove=function(t){var n=this.Ee[t];return Mt(void 0!==n,15),n===this.Ce?(this.Ce=n.older,this.Ce&&(this.Ce.newer=null)):n===this.Ae?(this.Ae=n.newer,this.Ae&&(this.Ae.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.Ee[t],--this.Te,n.Re},t.prototype.getCount=function(){return this.Te},t.prototype.getKeys=function(){var t,n=new Array(this.Te),i=0;for(t=this.Ce;t;t=t.older)n[i++]=t.Pe;return n},t.prototype.getValues=function(){var t,n=new Array(this.Te),i=0;for(t=this.Ce;t;t=t.older)n[i++]=t.Re;return n},t.prototype.peekLast=function(){return this.Ae.Re},t.prototype.peekLastKey=function(){return this.Ae.Pe},t.prototype.peekFirstKey=function(){return this.Ce.Pe},t.prototype.pop=function(){var t=this.Ae;return delete this.Ee[t.Pe],t.newer&&(t.newer.older=null),this.Ae=t.newer,this.Ae||(this.Ce=null),--this.Te,t.Re},t.prototype.replace=function(t,n){this.get(t),this.Ee[t].Re=n},t.prototype.set=function(t,n){Mt(!(t in this.Ee),16);var i={Pe:t,newer:null,older:this.Ce,Re:n};this.Ce?this.Ce.newer=i:this.Ae=i,this.Ce=i,this.Ee[t]=i,++this.Te},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Wc(t,n,i,r){return void 0!==r?(r[0]=t,r[1]=n,r[2]=i,r):[t,n,i]}function Vc(t,n,i){return t+"/"+n+"/"+i}function Xc(t){return Vc(t[0],t[1],t[2])}function Hc(t){var n=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return Vc(n[0],n[1],n[2])}function Jc(t){return t.split("/").map(Number)}function Kc(t){return(t[1]<<t[0])+t[2]}function Yc(t,n){var i=t[0],r=t[1],e=t[2];if(n.getMinZoom()>i||i>n.getMaxZoom())return!1;var o=n.getFullTileRange(i);return!o||o.containsXY(r,e)}var Zc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$c=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Zc(n,t),n.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Jc(this.peekFirstKey())[0];this.forEach(function(n){n.tileCoord[0]!==t&&(this.remove(Xc(n.tileCoord)),n.release())}.bind(this))}},n}(Bc),Qc=function(){function t(t,n,i,r){this.minX=t,this.maxX=n,this.minY=i,this.maxY=r}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,n){return this.minX<=t&&t<=this.maxX&&this.minY<=n&&n<=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 th(t,n,i,r,e){return void 0!==e?(e.minX=t,e.maxX=n,e.minY=i,e.maxY=r,e):new Qc(t,n,i,r)}var nh=Qc,ih=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rh=[],eh=function(t){function n(n,i,r,e){var o=t.call(this,n,i,{transition:0})||this;return o.Ne={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.ze={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=e.bind(void 0,o),o.wrappedTileCoord=r,o}return ih(n,t),n.prototype.getContext=function(t){var n=o(t);return n in this.Ne||(this.Ne[n]=Oo(1,1,rh)),this.Ne[n]},n.prototype.hasContext=function(t){return o(t)in this.Ne},n.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},n.prototype.getReplayState=function(t){var n=o(t);return n in this.ze||(this.ze[n]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.ze[n]},n.prototype.load=function(){this.getSourceTiles()},n.prototype.release=function(){for(var n in this.Ne)rh.push(this.Ne[n].canvas),delete this.Ne[n];t.prototype.release.call(this)},n}(jt),oh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sh=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i,s)||this;return a.extent=null,a.Fe=e,a.Le=null,a.q,a.projection=null,a.resolution,a.Wt=o,a.Ge=r,a.key=r,a}return oh(n,t),n.prototype.getFormat=function(){return this.Fe},n.prototype.getFeatures=function(){return this.Le},n.prototype.load=function(){this.state==lt&&(this.setState(vt),this.Wt(this,this.Ge),this.q&&this.q(this.extent,this.resolution,this.projection))},n.prototype.onLoad=function(t,n){this.setFeatures(t)},n.prototype.onError=function(){this.setState(pt)},n.prototype.setFeatures=function(t){this.Le=t,this.setState(dt)},n.prototype.setLoader=function(t){this.q=t},n}(jt);function ah(t){return Array.isArray(t)?Wo(t):t}var uh="arraybuffer",ch="json",hh="text",fh="xml",lh=!1;function vh(t,n,i,r,e,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,r,e):t,!0),n.getType()==uh&&(a.responseType="arraybuffer"),a.withCredentials=lh,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=n.getType(),u=void 0;r==ch||r==hh?u=a.responseText:r==fh?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==uh&&(u=a.response),u?o(n.readFeatures(u,{extent:i,featureProjection:e}),n.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function dh(t,n){return function(i,r,e,o,s){var a=this;vh(t,n,i,r,e,(function(t,n){a.addFeatures(t),void 0!==o&&o(t)}),s||_)}}function ph(t,n){return[[-1/0,-1/0,1/0,1/0]]}var yh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function mh(t,n,i,r){var e=document.createElement("script"),s="olc_"+o(n);function a(){delete window[s],e.parentNode.removeChild(e)}e.async=!0,e.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var u=setTimeout((function(){a(),i&&i()}),1e4);window[s]=function(t){clearTimeout(u),a(),n(t)},document.getElementsByTagName("head")[0].appendChild(e)}var wh,bh=function(t){function n(n){var i=this,r="Unexpected response status: "+n.status;return(i=t.call(this,r)||this).name="ResponseError",i.response=n,i}return yh(n,t),n}(Error),gh=function(t){function n(n){var i=t.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=n,i}return yh(n,t),n}(Error);function xh(t){return new Promise((function(n,i){var r=new XMLHttpRequest;r.addEventListener("load",(function(t){var r=t.target;if(!r.status||r.status>=200&&r.status<300){var e=void 0;try{e=JSON.parse(r.responseText)}catch(t){var o="Error parsing response text as JSON: "+t.message;return void i(new Error(o))}n(e)}else i(new bh(r))})),r.addEventListener("error",(function(t){i(new gh(t.target))})),r.open("GET",t),r.setRequestHeader("Accept","application/json"),r.send()}))}function jh(t,n){return n.indexOf("://")>=0?n:new URL(n,t).href}var Sh=function(){function t(){}return t.prototype.drawCustom=function(t,n,i,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,n){},t.prototype.drawFeature=function(t,n){},t.prototype.drawGeometryCollection=function(t,n){},t.prototype.drawLineString=function(t,n){},t.prototype.drawMultiLineString=function(t,n){},t.prototype.drawMultiPoint=function(t,n){},t.prototype.drawMultiPolygon=function(t,n){},t.prototype.drawPoint=function(t,n){},t.prototype.drawPolygon=function(t,n){},t.prototype.drawText=function(t,n){},t.prototype.setFillStrokeStyle=function(t,n){},t.prototype.setImageStyle=function(t,n){},t.prototype.setTextStyle=function(t,n){},t}(),kh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mh=function(t){function n(n,i,r,e,o,s,a){var u=t.call(this)||this;return u.Ne=n,u.Rt=i,u.st=r,u._t=e,u.De=o,u.Ue=s,u.qe=a,u.Be=null,u.We=null,u.Ve=null,u.Xe=null,u.He=null,u.Nt=null,u.Je=0,u.Ke=0,u.Ye=0,u.Ze=0,u.$e=0,u.Qe=0,u.no=!1,u.io=0,u.ro=[0,0],u.eo=0,u.oo="",u.so=0,u.ao=0,u.uo=!1,u.co=0,u.ho=[0,0],u.fo=null,u.lo=null,u.vo=null,u.do=[],u.po=[1,0,0,1,0,0],u}return kh(n,t),n.prototype.yo=function(t,n,i,r){if(this.Nt){var e=Wr(t,n,i,r,this._t,this.do),o=this.Ne,s=this.po,a=o.globalAlpha;1!=this.Ze&&(o.globalAlpha=a*this.Ze);var u=this.io;this.no&&(u+=this.De);for(var c=0,h=e.length;c<h;c+=2){var f=e[c]-this.Je,l=e[c+1]-this.Ke;if(0!==u||1!=this.ro[0]||1!=this.ro[1]){var v=f+this.Je,d=l+this.Ke;un(s,v,d,1,1,u,-v,-d),o.setTransform.apply(o,s),o.translate(v,d),o.scale(this.ro[0],this.ro[1]),o.drawImage(this.Nt,this.$e,this.Qe,this.eo,this.Ye,-this.Je,-this.Ke,this.eo,this.Ye),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.Nt,this.$e,this.Qe,this.eo,this.Ye,f,l,this.eo,this.Ye)}1!=this.Ze&&(o.globalAlpha=a)}},n.prototype.mo=function(t,n,i,r){if(this.vo&&""!==this.oo){this.fo&&this.wo(this.fo),this.lo&&this.bo(this.lo),this.xo(this.vo);var e=Wr(t,n,i,r,this._t,this.do),o=this.Ne,s=this.co;for(this.uo&&(s+=this.De);n<i;n+=r){var a=e[n]+this.so,u=e[n+1]+this.ao;if(0!==s||1!=this.ho[0]||1!=this.ho[1]){var c=un(this.po,a,u,1,1,s,-a,-u);o.setTransform.apply(o,c),o.translate(a,u),o.scale(this.ho[0],this.ho[1]),this.lo&&o.strokeText(this.oo,0,0),this.fo&&o.fillText(this.oo,0,0),o.setTransform(1,0,0,1,0,0)}else this.lo&&o.strokeText(this.oo,a,u),this.fo&&o.fillText(this.oo,a,u)}}},n.prototype.jo=function(t,n,i,r,e){var o=this.Ne,s=Wr(t,n,i,r,this._t,this.do);o.moveTo(s[0],s[1]);var a=s.length;e&&(a-=2);for(var u=2;u<a;u+=2)o.lineTo(s[u],s[u+1]);return e&&o.closePath(),i},n.prototype.So=function(t,n,i,r){for(var e=0,o=i.length;e<o;++e)n=this.jo(t,n,i[e],r,!0);return n},n.prototype.drawCircle=function(t){if(ni(this.st,t.getExtent())){if(this.Xe||this.He){this.Xe&&this.wo(this.Xe),this.He&&this.bo(this.He);var n=Qr(t,this._t,this.do),i=n[2]-n[0],r=n[3]-n[1],e=Math.sqrt(i*i+r*r),o=this.Ne;o.beginPath(),o.arc(n[0],n[1],e,0,2*Math.PI),this.Xe&&o.fill(),this.He&&o.stroke()}""!==this.oo&&this.mo(t.getCenter(),0,2,2)}},n.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},n.prototype.setTransform=function(t){this._t=t},n.prototype.drawGeometry=function(t){switch(t.getType()){case Pt.POINT:this.drawPoint(t);break;case Pt.LINE_STRING:this.drawLineString(t);break;case Pt.POLYGON:this.drawPolygon(t);break;case Pt.MULTI_POINT:this.drawMultiPoint(t);break;case Pt.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Pt.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Pt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Pt.CIRCLE:this.drawCircle(t)}},n.prototype.drawFeature=function(t,n){var i=n.getGeometryFunction()(t);i&&ni(this.st,i.getExtent())&&(this.setStyle(n),this.drawGeometry(i))},n.prototype.drawGeometryCollection=function(t){for(var n=t.getGeometriesArray(),i=0,r=n.length;i<r;++i)this.drawGeometry(n[i])},n.prototype.drawPoint=function(t){this.Ue&&(t=t.simplifyTransformed(this.Ue,this.qe));var n=t.getFlatCoordinates(),i=t.getStride();this.Nt&&this.yo(n,0,n.length,i),""!==this.oo&&this.mo(n,0,n.length,i)},n.prototype.drawMultiPoint=function(t){this.Ue&&(t=t.simplifyTransformed(this.Ue,this.qe));var n=t.getFlatCoordinates(),i=t.getStride();this.Nt&&this.yo(n,0,n.length,i),""!==this.oo&&this.mo(n,0,n.length,i)},n.prototype.drawLineString=function(t){if(this.Ue&&(t=t.simplifyTransformed(this.Ue,this.qe)),ni(this.st,t.getExtent())){if(this.He){this.bo(this.He);var n=this.Ne,i=t.getFlatCoordinates();n.beginPath(),this.jo(i,0,i.length,t.getStride(),!1),n.stroke()}if(""!==this.oo){var r=t.getFlatMidpoint();this.mo(r,0,2,2)}}},n.prototype.drawMultiLineString=function(t){this.Ue&&(t=t.simplifyTransformed(this.Ue,this.qe));var n=t.getExtent();if(ni(this.st,n)){if(this.He){this.bo(this.He);var i=this.Ne,r=t.getFlatCoordinates(),e=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,u=o.length;a<u;++a)e=this.jo(r,e,o[a],s,!1);i.stroke()}if(""!==this.oo){var c=t.getFlatMidpoints();this.mo(c,0,c.length,2)}}},n.prototype.drawPolygon=function(t){if(this.Ue&&(t=t.simplifyTransformed(this.Ue,this.qe)),ni(this.st,t.getExtent())){if(this.He||this.Xe){this.Xe&&this.wo(this.Xe),this.He&&this.bo(this.He);var n=this.Ne;n.beginPath(),this.So(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.Xe&&n.fill(),this.He&&n.stroke()}if(""!==this.oo){var i=t.getFlatInteriorPoint();this.mo(i,0,2,2)}}},n.prototype.drawMultiPolygon=function(t){if(this.Ue&&(t=t.simplifyTransformed(this.Ue,this.qe)),ni(this.st,t.getExtent())){if(this.He||this.Xe){this.Xe&&this.wo(this.Xe),this.He&&this.bo(this.He);var n=this.Ne,i=t.getOrientedFlatCoordinates(),r=0,e=t.getEndss(),o=t.getStride();n.beginPath();for(var s=0,a=e.length;s<a;++s){var u=e[s];r=this.So(i,r,u,o)}this.Xe&&n.fill(),this.He&&n.stroke()}if(""!==this.oo){var c=t.getFlatInteriorPoints();this.mo(c,0,c.length,2)}}},n.prototype.wo=function(t){var n=this.Ne,i=this.Be;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,n.fillStyle=t.fillStyle):(n.fillStyle=t.fillStyle,this.Be={fillStyle:t.fillStyle})},n.prototype.bo=function(t){var n=this.Ne,i=this.We;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,n.lineCap=t.lineCap),n.setLineDash&&(x(i.lineDash,t.lineDash)||n.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,n.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,n.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,n.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,n.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,n.strokeStyle=t.strokeStyle)):(n.lineCap=t.lineCap,n.setLineDash&&(n.setLineDash(t.lineDash),n.lineDashOffset=t.lineDashOffset),n.lineJoin=t.lineJoin,n.lineWidth=t.lineWidth,n.miterLimit=t.miterLimit,n.strokeStyle=t.strokeStyle,this.We={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},n.prototype.xo=function(t){var n=this.Ne,i=this.Ve,r=t.textAlign?t.textAlign:Bs;i?(i.font!=t.font&&(i.font=t.font,n.font=t.font),i.textAlign!=r&&(i.textAlign=r,n.textAlign=r),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,n.textBaseline=t.textBaseline)):(n.font=t.font,n.textAlign=r,n.textBaseline=t.textBaseline,this.Ve={font:t.font,textAlign:r,textBaseline:t.textBaseline})},n.prototype.setFillStrokeStyle=function(t,n){var i=this;if(t){var r=t.getColor();this.Xe={fillStyle:ah(r||Fs)}}else this.Xe=null;if(n){var e=n.getColor(),o=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),u=n.getLineJoin(),c=n.getWidth(),h=n.getMiterLimit(),f=s||Gs;this.He={lineCap:void 0!==o?o:Ls,lineDash:1===this.Rt?f:f.map((function(t){return t*i.Rt})),lineDashOffset:(a||0)*this.Rt,lineJoin:void 0!==u?u:Ds,lineWidth:(void 0!==c?c:1)*this.Rt,miterLimit:void 0!==h?h:Us,strokeStyle:ah(e||qs)}}else this.He=null},n.prototype.setImageStyle=function(t){var n;if(t&&(n=t.getSize())){var i=t.getAnchor(),r=t.getOrigin();this.Nt=t.getImage(this.Rt),this.Je=i[0]*this.Rt,this.Ke=i[1]*this.Rt,this.Ye=n[1]*this.Rt,this.Ze=t.getOpacity(),this.$e=r[0],this.Qe=r[1],this.no=t.getRotateWithView(),this.io=t.getRotation(),this.ro=t.getScaleArray(),this.eo=n[0]*this.Rt}else this.Nt=null},n.prototype.setTextStyle=function(t){if(t){var n=t.getFill();if(n){var i=n.getColor();this.fo={fillStyle:ah(i||Fs)}}else this.fo=null;var r=t.getStroke();if(r){var e=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),u=r.getLineJoin(),c=r.getWidth(),h=r.getMiterLimit();this.lo={lineCap:void 0!==o?o:Ls,lineDash:s||Gs,lineDashOffset:a||0,lineJoin:void 0!==u?u:Ds,lineWidth:void 0!==c?c:1,miterLimit:void 0!==h?h:Us,strokeStyle:ah(e||qs)}}else this.lo=null;var f=t.getFont(),l=t.getOffsetX(),v=t.getOffsetY(),d=t.getRotateWithView(),p=t.getRotation(),y=t.getScaleArray(),m=t.getText(),w=t.getTextAlign(),b=t.getTextBaseline();this.vo={font:void 0!==f?f:zs,textAlign:void 0!==w?w:Bs,textBaseline:void 0!==b?b:Ws},this.oo=void 0!==m?Array.isArray(m)?m.reduce((function(t,n,i){return t+(i%2?" ":n)}),""):m:"",this.so=void 0!==l?this.Rt*l:0,this.ao=void 0!==v?this.Rt*v:0,this.uo=void 0!==d&&d,this.co=void 0!==p?p:0,this.ho=[this.Rt*y[0],this.Rt*y[1]]}else this.oo=""},n}(Sh),_h="Circle",Oh="Default",Th="Image",Eh="LineString",Ah="Polygon",Ch="Text",Rh={Point:function(t,n,i,r,e){var o,s=i.getImage(),a=i.getText();e&&(t=e,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=bo)return;var u=t.getBuilder(i.getZIndex(),Th);u.setImageStyle(s,o),u.drawPoint(n,r)}if(a&&a.getText()){var c=t.getBuilder(i.getZIndex(),Ch);c.setTextStyle(a,o),c.drawText(n,r)}},LineString:function(t,n,i,r,e){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Eh);s.setFillStrokeStyle(null,o),s.drawLineString(n,r)}var a=i.getText();if(a&&a.getText()){var u=(e||t).getBuilder(i.getZIndex(),Ch);u.setTextStyle(a),u.drawText(n,r)}},Polygon:function(t,n,i,r,e){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Ah);a.setFillStrokeStyle(o,s),a.drawPolygon(n,r)}var u=i.getText();if(u&&u.getText()){var c=(e||t).getBuilder(i.getZIndex(),Ch);c.setTextStyle(u),c.drawText(n,r)}},MultiPoint:function(t,n,i,r,e){var o,s=i.getImage(),a=i.getText();e&&(t=e,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=bo)return;var u=t.getBuilder(i.getZIndex(),Th);u.setImageStyle(s,o),u.drawMultiPoint(n,r)}if(a&&a.getText()){var c=(e||t).getBuilder(i.getZIndex(),Ch);c.setTextStyle(a,o),c.drawText(n,r)}},MultiLineString:function(t,n,i,r,e){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Eh);s.setFillStrokeStyle(null,o),s.drawMultiLineString(n,r)}var a=i.getText();if(a&&a.getText()){var u=(e||t).getBuilder(i.getZIndex(),Ch);u.setTextStyle(a),u.drawText(n,r)}},MultiPolygon:function(t,n,i,r,e){var o=i.getFill(),s=i.getStroke();if(s||o){var a=t.getBuilder(i.getZIndex(),Ah);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(n,r)}var u=i.getText();if(u&&u.getText()){var c=(e||t).getBuilder(i.getZIndex(),Ch);c.setTextStyle(u),c.drawText(n,r)}},GeometryCollection:function(t,n,i,r,e){var o,s,a=n.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,Rh[a[o].getType()])(t,a[o],i,r,e)}},Circle:function(t,n,i,r,e){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),_h);a.setFillStrokeStyle(o,s),a.drawCircle(n,r)}var u=i.getText();if(u&&u.getText()){var c=(e||t).getBuilder(i.getZIndex(),Ch);c.setTextStyle(u),c.drawText(n,r)}}};function Ph(t,n){return parseInt(o(t),10)-parseInt(o(n),10)}function Ih(t,n){var i=Nh(t,n);return i*i}function Nh(t,n){return.5*t/n}function zh(t,n,i,r,e,o,s){var a=!1,u=i.getImage();if(u){var c=u.getImageState();c==bo||c==go?u.unlistenImageChange(e):(c==mo&&u.load(),c=u.getImageState(),u.listenImageChange(e),a=!0)}return function(t,n,i,r,e,o){var s=i.getGeometryFunction()(n);if(!s)return;var a=s.simplifyTransformed(r,e);if(i.getRenderer())Fh(t,a,i,n);else{(0,Rh[a.getType()])(t,a,i,n,o)}}(t,n,i,r,o,s),a}function Fh(t,n,i,r){if(n.getType()!=Pt.GEOMETRY_COLLECTION)t.getBuilder(i.getZIndex(),Oh).drawCustom(n,r,i.getRenderer(),i.getHitDetectionRenderer());else for(var e=n.getGeometries(),o=0,s=e.length;o<s;++o)Fh(t,e[o],i,r)}function Lh(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var n,i=t.inversePixelTransform[0],r=t.frameState,e=Qt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),o=Ih(r.viewState.resolution,i),s=Nr();return s&&(n=Er(s,r.viewState.projection)),new Mh(t.context,i,r.extent,e,r.viewState.rotation,o,n)}var Gh,Dh={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Uh={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0};function qh(t,n,i,r,e){t.beginPath(),t.moveTo(0,0),t.lineTo(n,i),t.lineTo(r,e),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(n,r)+1,Math.max(i,e)),t.restore()}function Bh(t,n){return Math.abs(t[4*n]-210)>2||Math.abs(t[4*n+3]-191.25)>2}function Wh(t,n,i,r){var e=Cr(i,n,t),o=xr(n,r,i),s=n.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||_n(u,e)){var c=xr(t,o,e)/o;isFinite(c)&&c>0&&(o/=c)}return o}function Vh(t,n,i,r){var e=Hn(i),o=Wh(t,n,e,r);return(!isFinite(o)||o<=0)&&Bn(i,(function(i){return o=Wh(t,n,i,r),isFinite(o)&&o>0})),o}function Xh(t,n,i,r,e,o,s,a,u,c,h,f){var l=Oo(Math.round(i*t),Math.round(i*n));if(f||E(l,Dh),0===u.length)return l.canvas;function v(t){return Math.round(t*i)/i}l.scale(i,i),l.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,n,i){Fn(d,t.extent)}));var p=ti(d),y=Yn(d),m=Oo(Math.round(i*p/r),Math.round(i*y/r));f||E(m,Dh);var w=i/r;u.forEach((function(t,n,i){var r=t.extent[0]-d[0],e=-(t.extent[3]-d[3]),o=ti(t.extent),s=Yn(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,c,c,t.image.width-2*c,t.image.height-2*c,r*w,e*w,o*w,s*w)}));var b=$n(s);return a.getTriangles().forEach((function(t,n,e){var s=t.source,a=t.target,u=s[0][0],c=s[0][1],h=s[1][0],p=s[1][1],y=s[2][0],w=s[2][1],g=v((a[0][0]-b[0])/o),x=v(-(a[0][1]-b[1])/o),j=v((a[1][0]-b[0])/o),S=v(-(a[1][1]-b[1])/o),k=v((a[2][0]-b[0])/o),M=v(-(a[2][1]-b[1])/o),_=u,O=c;u=0,c=0;var T=di([[h-=_,p-=O,0,0,j-g],[y-=_,w-=O,0,0,k-g],[0,0,h,p,S-x],[0,0,y,w,M-x]]);if(T){if(l.save(),l.beginPath(),function(){if(void 0===Gh){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",qh(t,4,5,4,0),qh(t,4,5,0,5);var n=t.getImageData(0,0,3,3).data;Gh=Bh(n,0)||Bh(n,4)||Bh(n,8)}return Gh}()||!f){l.moveTo(j,S);for(var E=g-j,A=x-S,C=0;C<4;C++)l.lineTo(j+v((C+1)*E/4),S+v(C*A/3)),3!=C&&l.lineTo(j+v((C+1)*E/4),S+v((C+1)*A/3));l.lineTo(k,M)}else l.moveTo(j,S),l.lineTo(g,x),l.lineTo(k,M);l.clip(),l.transform(T[0],T[2],T[1],T[3],g,x),l.translate(d[0]-_,d[3]-O),l.scale(r/i,-r/i),l.drawImage(m.canvas,0,0),l.restore()}})),h&&(l.save(),l.globalCompositeOperation="source-over",l.strokeStyle="black",l.lineWidth=1,a.getTriangles().forEach((function(t,n,i){var r=t.target,e=(r[0][0]-b[0])/o,s=-(r[0][1]-b[1])/o,a=(r[1][0]-b[0])/o,u=-(r[1][1]-b[1])/o,c=(r[2][0]-b[0])/o,h=-(r[2][1]-b[1])/o;l.beginPath(),l.moveTo(a,u),l.lineTo(e,s),l.lineTo(c,h),l.closePath(),l.stroke()})),l.restore()),l.canvas}var Hh=[0,0,0],Jh=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.Ti=t.resolutions,Mt(S(this.Ti,(function(t,n){return n-t}),!0),17),!t.origins)for(var i=0,r=this.Ti.length-1;i<r;++i)if(n){if(this.Ti[i]/this.Ti[i+1]!==n){n=void 0;break}}else n=this.Ti[i]/this.Ti[i+1];this.Oi=n,this.maxZoom=this.Ti.length-1,this.ko=void 0!==t.origin?t.origin:null,this.Mo=null,void 0!==t.origins&&(this.Mo=t.origins,Mt(this.Mo.length==this.Ti.length,20));var e=t.extent;void 0===e||this.ko||this.Mo||(this.ko=$n(e)),Mt(!this.ko&&this.Mo||this.ko&&!this.Mo,18),this._o=null,void 0!==t.tileSizes&&(this._o=t.tileSizes,Mt(this._o.length==this.Ti.length,19)),this.Oo=void 0!==t.tileSize?t.tileSize:this._o?null:Ga,Mt(!this.Oo&&this._o||this.Oo&&!this._o,22),this.st=void 0!==e?e:null,this.To=null,this.Eo=[0,0],this.Ao=[0,0,0,0],void 0!==t.sizes?this.To=t.sizes.map((function(t,n){var i=new nh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(e){var r=this.getTileRangeForExtentAndZ(e,n);i.minX=Math.max(r.minX,i.minX),i.maxX=Math.min(r.maxX,i.maxX),i.minY=Math.max(r.minY,i.minY),i.maxY=Math.min(r.maxY,i.maxY)}return i}),this):e&&this.Co(e)}return t.prototype.forEachTileCoord=function(t,n,i){for(var r=this.getTileRangeForExtentAndZ(t,n),e=r.minX,o=r.maxX;e<=o;++e)for(var s=r.minY,a=r.maxY;s<=a;++s)i([n,e,s])},t.prototype.forEachTileCoordParentTileRange=function(t,n,i,r){var e,o,s=null,a=t[0]-1;for(2===this.Oi?(e=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);a>=this.minZoom;){if(n(a,2===this.Oi?th(e=Math.floor(e/2),e,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.st},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.ko?this.ko:this.Mo[t]},t.prototype.getResolution=function(t){return this.Ti[t]},t.prototype.getResolutions=function(){return this.Ti},t.prototype.getTileCoordChildTileRange=function(t,n,i){if(t[0]<this.maxZoom){if(2===this.Oi){var r=2*t[1],e=2*t[2];return th(r,r+1,e,e+1,n)}var o=this.getTileCoordExtent(t,i||this.Ao);return this.getTileRangeForExtentAndZ(o,t[0]+1,n)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,n,i){if(n>this.maxZoom||n<this.minZoom)return null;var r=t[0],e=t[1],o=t[2];if(n===r)return th(e,o,e,o,i);if(this.Oi){var s=Math.pow(this.Oi,n-r),a=Math.floor(e*s),u=Math.floor(o*s);return n<r?th(a,a,u,u,i):th(a,Math.floor(s*(e+1))-1,u,Math.floor(s*(o+1))-1,i)}var c=this.getTileCoordExtent(t,this.Ao);return this.getTileRangeForExtentAndZ(c,n,i)},t.prototype.getTileRangeExtent=function(t,n,i){var r=this.getOrigin(t),e=this.getResolution(t),o=uu(this.getTileSize(t),this.Eo),s=r[0]+n.minX*o[0]*e,a=r[0]+(n.maxX+1)*o[0]*e;return Cn(s,r[1]+n.minY*o[1]*e,a,r[1]+(n.maxY+1)*o[1]*e,i)},t.prototype.getTileRangeForExtentAndZ=function(t,n,i){var r=Hh;this.Ro(t[0],t[3],n,!1,r);var e=r[1],o=r[2];return this.Ro(t[2],t[1],n,!0,r),th(e,r[1],o,r[2],i)},t.prototype.getTileCoordCenter=function(t){var n=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=uu(this.getTileSize(t[0]),this.Eo);return[n[0]+(t[1]+.5)*r[0]*i,n[1]-(t[2]+.5)*r[1]*i]},t.prototype.getTileCoordExtent=function(t,n){var i=this.getOrigin(t[0]),r=this.getResolution(t[0]),e=uu(this.getTileSize(t[0]),this.Eo),o=i[0]+t[1]*e[0]*r,s=i[1]-(t[2]+1)*e[1]*r;return Cn(o,s,o+e[0]*r,s+e[1]*r,n)},t.prototype.getTileCoordForCoordAndResolution=function(t,n,i){return this.Po(t[0],t[1],n,!1,i)},t.prototype.Po=function(t,n,i,r,e){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),u=uu(this.getTileSize(o),this.Eo),c=s*(t-a[0])/i/u[0],h=s*(a[1]-n)/i/u[1];return r?(c=ji(c,5)-1,h=ji(h,5)-1):(c=xi(c,5),h=xi(h,5)),Wc(o,c,h,e)},t.prototype.Ro=function(t,n,i,r,e){var o=this.getOrigin(i),s=this.getResolution(i),a=uu(this.getTileSize(i),this.Eo),u=(t-o[0])/s/a[0],c=(o[1]-n)/s/a[1];return r?(u=ji(u,5)-1,c=ji(c,5)-1):(u=xi(u,5),c=xi(c,5)),Wc(i,u,c,e)},t.prototype.getTileCoordForCoordAndZ=function(t,n,i){return this.Ro(t[0],t[1],n,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.Ti[t[0]]},t.prototype.getTileSize=function(t){return this.Oo?this.Oo:this._o[t]},t.prototype.getFullTileRange=function(t){return this.To?this.To[t]:this.st?this.getTileRangeForExtentAndZ(this.st,t):null},t.prototype.getZForResolution=function(t,n){return ci(m(this.Ti,t,n||0),this.minZoom,this.maxZoom)},t.prototype.Co=function(t){for(var n=this.Ti.length,i=new Array(n),r=this.minZoom;r<n;++r)i[r]=this.getTileRangeForExtentAndZ(t,r);this.To=i},t}();function Kh(t){var n=t.getDefaultTileGrid();return n||(n=tf(t),t.setDefaultTileGrid(n)),n}function Yh(t,n,i){var r=n[0],e=t.getTileCoordCenter(n),o=nf(i);if(_n(o,e))return n;var s=ti(o),a=Math.ceil((o[0]-e[0])/s);return e[0]+=s*a,t.getTileCoordForCoordAndZ(e,r)}function Zh(t,n,i,r){var e=void 0!==r?r:dn,o=Qh(t,n,i);return new Jh({extent:t,origin:Jn(t,e),resolutions:o,tileSize:i})}function $h(t){var n=t||{},i=n.extent||gr("EPSG:3857").getExtent(),r={extent:i,minZoom:n.minZoom,tileSize:n.tileSize,resolutions:Qh(i,n.maxZoom,n.tileSize,n.maxResolution)};return new Jh(r)}function Qh(t,n,i,r){for(var e=void 0!==n?n:42,o=Yn(t),s=ti(t),a=uu(void 0!==i?i:Ga),u=r>0?r:Math.max(s/a[0],o/a[1]),c=e+1,h=new Array(c),f=0;f<c;++f)h[f]=u/Math.pow(2,f);return h}function tf(t,n,i,r){return Zh(nf(t),n,i,r)}function nf(t){var n=(t=gr(t)).getExtent();if(!n){var i=180*Ft[Gt.DEGREES]/t.getMetersPerUnit();n=Cn(-i,-i,i,i)}return n}function rf(t,n){var i=/\{z\}/g,r=/\{x\}/g,e=/\{y\}/g,o=/\{-y\}/g;return function(s,a,u){return s?t.replace(i,s[0].toString()).replace(r,s[1].toString()).replace(e,s[2].toString()).replace(o,(function(){var t=s[0],i=n.getFullTileRange(t);return Mt(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function ef(t,n){for(var i=t.length,r=new Array(i),e=0;e<i;++e)r[e]=rf(t[e],n);return of(r)}function of(t){return 1===t.length?t[0]:function(n,i,r){if(n){var e=mi(Kc(n),t.length);return t[e](n,i,r)}}}function sf(t,n,i){}function af(t){var n=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var r=i[1].charCodeAt(0),e=i[2].charCodeAt(0),o=void 0;for(o=r;o<=e;++o)n.push(t.replace(i[0],String.fromCharCode(o)));return n}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)n.push(t.replace(i[0],a.toString()));return n}return n.push(t),n}function uf(t,n){var i=[];Object.keys(n).forEach((function(t){null!==n[t]&&void 0!==n[t]&&i.push(t+"="+encodeURIComponent(n[t]))}));var r=i.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var cf,hf=34962,ff=34963,lf=35044,vf=35048,df=5126,pf=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function yf(t,n){for(var i=E({preserveDrawingBuffer:!0,antialias:!Bt},n),r=pf.length,e=0;e<r;++e)try{var o=t.getContext(pf[e],i);if(o)return o}catch(t){}return null}var mf="http://www.w3.org/2001/XMLSchema-instance";function wf(t,n){return qf().createElementNS(t,n)}function bf(t,n){return gf(t,n,[]).join("")}function gf(t,n,i){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n?i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)gf(r,n,i)}return i}function xf(t){return"documentElement"in t}function jf(t,n,i){return t.getAttributeNS(n,i)||""}function Sf(t){return(new DOMParser).parseFromString(t,"application/xml")}function kf(t,n){return function(i,r){var e=t.call(void 0!==n?n:this,i,r);void 0!==e&&b(r[r.length-1],e)}}function Mf(t,n){return function(i,r){var e=t.call(void 0!==n?n:this,i,r);void 0!==e&&r[r.length-1].push(e)}}function _f(t,n){return function(i,r){var e=t.call(void 0!==n?n:this,i,r);void 0!==e&&(r[r.length-1]=e)}}function Of(t,n,i){return function(r,e){var o=t.call(void 0!==i?i:this,r,e);if(void 0!==o){var s=e[e.length-1],a=void 0!==n?n:r.localName,u=void 0;a in s?u=s[a]:(u=[],s[a]=u),u.push(o)}}}function Tf(t,n,i){return function(r,e){var o=t.call(void 0!==i?i:this,r,e);void 0!==o&&(e[e.length-1][void 0!==n?n:r.localName]=o)}}function Ef(t,n){return function(i,r,e){t.call(void 0!==n?n:this,i,r,e),e[e.length-1].node.appendChild(i)}}function Af(t,n){var i,r;return function(n,e,o){if(void 0===i){i={};var s={};s[n.localName]=t,i[n.namespaceURI]=s,r=Cf(n.localName)}Ff(i,r,e,o)}}function Cf(t,n){var i=t;return function(t,r,e){var o=r[r.length-1].node,s=i;return void 0===s&&(s=e),wf(void 0!==n?n:o.namespaceURI,s)}}var Rf=Cf();function Pf(t,n){for(var i=n.length,r=new Array(i),e=0;e<i;++e)r[e]=t[n[e]];return r}function If(t,n,i){var r,e,o=void 0!==i?i:{};for(r=0,e=t.length;r<e;++r)o[t[r]]=n;return o}function Nf(t,n,i,r){var e;for(e=n.firstElementChild;e;e=e.nextElementSibling){var o=t[e.namespaceURI];if(void 0!==o){var s=o[e.localName];void 0!==s&&s.call(r,e,i)}}}function zf(t,n,i,r,e){return r.push(t),Nf(n,i,r,e),r.pop()}function Ff(t,n,i,r,e,o){for(var s,a,u=(void 0!==e?e:i).length,c=0;c<u;++c)void 0!==(s=i[c])&&void 0!==(a=n.call(void 0!==o?o:this,s,r,void 0!==e?e[c]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,r)}function Lf(t,n,i,r,e,o,s){return e.push(t),Ff(n,i,r,e,o,s),e.pop()}var Gf=void 0;function Df(){return void 0===Gf&&"undefined"!=typeof XMLSerializer&&(Gf=new XMLSerializer),Gf}var Uf=void 0;function qf(){return void 0===Uf&&"undefined"!=typeof document&&(Uf=document.implementation.createDocument("","",null)),Uf}var Bf=lf;function Wf(t){switch(t){case hf:return Float32Array;case ff:return Uint32Array;default:return Float32Array}}var Vf=function(){function t(t,n){this.array=null,this.type=t,Mt(t===hf||t===ff,62),this.usage=void 0!==n?n:Bf}return t.prototype.ofSize=function(t){this.array=new(Wf(this.type))(t)},t.prototype.fromArray=function(t){var n=Wf(this.type);this.array=n.from?n.from(t):new n(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(Wf(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}(),Xf="webglcontextlost",Hf="webglcontextrestored",Jf=function(){function t(t){this.Io=t.webGlContext;var n=this.Io;this.No=t.scaleRatio||1,this.zo=n.createTexture(),this.Fo=null,this.Lo=n.createFramebuffer();var i=n.createShader(n.VERTEX_SHADER);n.shaderSource(i,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),n.compileShader(i);var r=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(r,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),n.compileShader(r),this.Go=n.createProgram(),n.attachShader(this.Go,i),n.attachShader(this.Go,r),n.linkProgram(this.Go),this.Do=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,this.Do),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),n.STATIC_DRAW),this.Uo=n.getAttribLocation(this.Go,"a_position"),this.qo=n.getUniformLocation(this.Go,"u_screenSize"),this.Bo=n.getUniformLocation(this.Go,"u_opacity"),this.Wo=n.getUniformLocation(this.Go,"u_image"),this.Vo=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(i){this.Vo.push({value:t.uniforms[i],location:n.getUniformLocation(this.Go,i)})}.bind(this))}return t.prototype.getGL=function(){return this.Io},t.prototype.init=function(t){var n=this.getGL(),i=[n.drawingBufferWidth*this.No,n.drawingBufferHeight*this.No];if(n.bindFramebuffer(n.FRAMEBUFFER,this.getFrameBuffer()),n.viewport(0,0,i[0],i[1]),!this.Fo||this.Fo[0]!==i[0]||this.Fo[1]!==i[1]){this.Fo=i;var r=n.RGBA,e=n.RGBA,o=n.UNSIGNED_BYTE;n.bindTexture(n.TEXTURE_2D,this.zo),n.texImage2D(n.TEXTURE_2D,0,r,i[0],i[1],0,e,o,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.zo,0)}},t.prototype.apply=function(t,n,i,r){var e=this.getGL(),s=t.size;if(e.bindFramebuffer(e.FRAMEBUFFER,n?n.getFrameBuffer():null),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.zo),!n){var a=o(e.canvas);if(!t.renderTargets[a]){var u=e.getContextAttributes();u&&u.preserveDrawingBuffer&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.renderTargets[a]=!0}}e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),e.bindBuffer(e.ARRAY_BUFFER,this.Do),e.useProgram(this.Go),e.enableVertexAttribArray(this.Uo),e.vertexAttribPointer(this.Uo,2,e.FLOAT,!1,0,0),e.uniform2f(this.qo,s[0],s[1]),e.uniform1i(this.Wo,0);var c=t.layerStatesArray[t.layerIndex].opacity;e.uniform1f(this.Bo,c),this.applyUniforms(t),i&&i(e,t),e.drawArrays(e.TRIANGLES,0,6),r&&r(e,t)},t.prototype.getFrameBuffer=function(){return this.Lo},t.prototype.applyUniforms=function(t){var n,i=this.getGL(),r=1;this.Vo.forEach((function(e){if((n="function"==typeof e.value?e.value(t):e.value)instanceof HTMLCanvasElement||n instanceof ImageData)e.texture||(e.texture=i.createTexture()),i.activeTexture(i["TEXTURE".concat(r)]),i.bindTexture(i.TEXTURE_2D,e.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),n instanceof ImageData?i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,n.width,n.height,0,i.UNSIGNED_BYTE,new Uint8Array(n.data)):i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),i.uniform1i(e.location,r++);else if(Array.isArray(n))switch(n.length){case 2:return void i.uniform2f(e.location,n[0],n[1]);case 3:return void i.uniform3f(e.location,n[0],n[1],n[2]);case 4:return void i.uniform4f(e.location,n[0],n[1],n[2],n[3]);default:return}else"number"==typeof n&&i.uniform1f(e.location,n)}))},t}();function Kf(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Yf(t,n){return t[0]=n[0],t[1]=n[1],t[4]=n[2],t[5]=n[3],t[12]=n[4],t[13]=n[5],t}var Zf=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$f="u_projectionMatrix",Qf="u_offsetScaleMatrix",tl="u_offsetRotateMatrix",nl="u_time",il="u_zoom",rl="u_resolution",el={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:df},ol={};function sl(t){return"shared/"+t}var al=0;function ul(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];n+=r.size*cl(r.type)}return n}function cl(t){switch(t){case el.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case el.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case el.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case el.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var hl=function(t){function n(n){var i,r=t.call(this)||this,e=n||{};r.Xo=r.handleWebGLContextLost.bind(r),r.Ho=r.handleWebGLContextRestored.bind(r),r.Jo=e.canvasCacheKey?sl(e.canvasCacheKey):(i="unique/"+al,al+=1,i),r.Ut=function(t){var n=ol[t];if(!n){var i=document.createElement("canvas");i.style.position="absolute",i.style.left="0",n={users:0,canvas:i},ol[t]=n}return n.users+=1,n.canvas}(r.Jo),r.Io=yf(r.Ut),r.Ko={},r.Yo={},r.Zo=null,r.Ut.addEventListener(Xf,r.Xo),r.Ut.addEventListener(Hf,r.Ho),r.$o=[1,0,0,1,0,0],r.Qo=[1,0,0,1,0,0],r.ts=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.ns={},r.rs={},r.Vo=[],e.uniforms&&r.setUniforms(e.uniforms);var o=r.getGL();return r.es=e.postProcesses?e.postProcesses.map((function(t){return new Jf({webGlContext:o,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new Jf({webGlContext:o})],r.os=null,r.de=Date.now(),r}return Zf(n,t),n.prototype.setUniforms=function(t){for(var n in this.Vo=[],t)this.Vo.push({name:n,value:t[n]});this.ns={}},n.prototype.canvasCacheKeyMatches=function(t){return this.Jo===sl(t)},n.prototype.getExtension=function(t){if(t in this.Yo)return this.Yo[t];var n=this.Io.getExtension(t);return this.Yo[t]=n,n},n.prototype.bindBuffer=function(t){var n=this.getGL(),i=o(t),r=this.Ko[i];r||(r={buffer:t,webGlBuffer:n.createBuffer()},this.Ko[i]=r);n.bindBuffer(t.getType(),r.webGlBuffer)},n.prototype.flushBufferData=function(t){var n=this.getGL();this.bindBuffer(t),n.bufferData(t.getType(),t.getArray(),t.getUsage())},n.prototype.deleteBuffer=function(t){var n=this.getGL(),i=o(t),r=this.Ko[i];r&&!n.isContextLost()&&n.deleteBuffer(r.webGlBuffer),delete this.Ko[i]},n.prototype.disposeInternal=function(){this.Ut.removeEventListener(Xf,this.Xo),this.Ut.removeEventListener(Hf,this.Ho),function(t){var n=ol[t];if(n&&(n.users-=1,!(n.users>0))){var i=yf(n.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete ol[t]}}(this.Jo),delete this.Io,delete this.Ut},n.prototype.prepareDraw=function(t,n){var i=this.getGL(),r=this.getCanvas(),e=t.size,o=t.pixelRatio;r.width=e[0]*o,r.height=e[1]*o,r.style.width=e[0]+"px",r.style.height=e[1]+"px",i.useProgram(this.Zo);for(var s=this.es.length-1;s>=0;s--)this.es[s].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,n?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.Zo),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.prepareDrawToRenderTarget=function(t,n,i){var r=this.getGL(),e=n.getSize();r.bindFramebuffer(r.FRAMEBUFFER,n.getFramebuffer()),r.viewport(0,0,e[0],e[1]),r.bindTexture(r.TEXTURE_2D,n.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.Zo),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.drawElements=function(t,n){var i=this.getGL();this.getExtension("OES_element_index_uint");var r=i.UNSIGNED_INT,e=n-t,o=4*t;i.drawElements(i.TRIANGLES,e,r,o)},n.prototype.finalizeDraw=function(t,n,i){for(var r=0,e=this.es.length;r<e;r++)r===e-1?this.es[r].apply(t,null,n,i):this.es[r].apply(t,this.es[r+1])},n.prototype.getCanvas=function(){return this.Ut},n.prototype.getGL=function(){return this.Io},n.prototype.applyFrameState=function(t){var n=t.size,i=t.viewState.rotation,r=$t(this.Qo);on(r,2/n[0],2/n[1]);var e=$t(this.$o);0!==i&&en(e,-i),this.setUniformMatrixValue(Qf,Yf(this.ts,r)),this.setUniformMatrixValue(tl,Yf(this.ts,e)),this.setUniformFloatValue(nl,.001*(Date.now()-this.de)),this.setUniformFloatValue(il,t.viewState.zoom),this.setUniformFloatValue(rl,t.viewState.resolution)},n.prototype.applyUniforms=function(t){var n,i=this.getGL(),r=0;this.Vo.forEach(function(e){if((n="function"==typeof e.value?e.value(t):e.value)instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof ImageData)e.texture||(e.prevValue=void 0,e.texture=i.createTexture()),i.activeTexture(i["TEXTURE".concat(r)]),i.bindTexture(i.TEXTURE_2D,e.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(!(n instanceof HTMLImageElement)||n.complete)&&e.prevValue!==n&&(e.prevValue=n,i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n)),i.uniform1i(this.getUniformLocation(e.name),r++);else if(Array.isArray(n)&&6===n.length)this.setUniformMatrixValue(e.name,Yf(this.ts,n));else if(Array.isArray(n)&&n.length<=4)switch(n.length){case 2:return void i.uniform2f(this.getUniformLocation(e.name),n[0],n[1]);case 3:return void i.uniform3f(this.getUniformLocation(e.name),n[0],n[1],n[2]);case 4:return void i.uniform4f(this.getUniformLocation(e.name),n[0],n[1],n[2],n[3]);default:return}else"number"==typeof n&&i.uniform1f(this.getUniformLocation(e.name),n)}.bind(this))},n.prototype.useProgram=function(t){return t!=this.Zo&&(this.getGL().useProgram(t),this.Zo=t,this.ns={},this.rs={},!0)},n.prototype.compileShader=function(t,n){var i=this.getGL(),r=i.createShader(n);return i.shaderSource(r,t),i.compileShader(r),r},n.prototype.getProgram=function(t,n){var i=this.getGL(),r=this.compileShader(t,i.FRAGMENT_SHADER),e=this.compileShader(n,i.VERTEX_SHADER),o=i.createProgram();if(i.attachShader(o,r),i.attachShader(o,e),i.linkProgram(o),!i.getShaderParameter(r,i.COMPILE_STATUS)){var s="Fragment shader compliation failed: ".concat(i.getShaderInfoLog(r));throw new Error(s)}if(i.deleteShader(r),!i.getShaderParameter(e,i.COMPILE_STATUS)){s="Vertex shader compilation failed: ".concat(i.getShaderInfoLog(e));throw new Error(s)}if(i.deleteShader(e),!i.getProgramParameter(o,i.LINK_STATUS)){s="GL program linking failed: ".concat(i.getShaderInfoLog(e));throw new Error(s)}return o},n.prototype.getUniformLocation=function(t){return void 0===this.ns[t]&&(this.ns[t]=this.getGL().getUniformLocation(this.Zo,t)),this.ns[t]},n.prototype.getAttributeLocation=function(t){return void 0===this.rs[t]&&(this.rs[t]=this.getGL().getAttribLocation(this.Zo,t)),this.rs[t]},n.prototype.makeProjectionTransform=function(t,n){var i=t.size,r=t.viewState.rotation,e=t.viewState.resolution,o=t.viewState.center;return $t(n),un(n,0,0,2/(e*i[0]),2/(e*i[1]),-r,-o[0],-o[1]),n},n.prototype.setUniformFloatValue=function(t,n){this.getGL().uniform1f(this.getUniformLocation(t),n)},n.prototype.setUniformFloatVec4=function(t,n){this.getGL().uniform4fv(this.getUniformLocation(t),n)},n.prototype.setUniformMatrixValue=function(t,n){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,n)},n.prototype.ss=function(t,n,i,r,e){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,n,i,!1,r,e))},n.prototype.enableAttributes=function(t){for(var n=ul(t),i=0,r=0;r<t.length;r++){var e=t[r];this.ss(e.name,e.size,e.type||df,n,i),i+=e.size*cl(e.type)}},n.prototype.handleWebGLContextLost=function(){A(this.Ko),this.Zo=null},n.prototype.handleWebGLContextRestored=function(){},n.prototype.createTexture=function(t,n,i){var r=this.getGL(),e=i||r.createTexture(),o=r.RGBA,s=r.RGBA,a=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,e),n?r.texImage2D(r.TEXTURE_2D,0,o,s,a,n):r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,s,a,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e},n}(v),fl=function(){function t(t,n){this.name=t,this.data=n,this.us=null}return t.prototype.getTexture=function(t){if(!this.us){var n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.us=n}return this.us},t}(),ll=new Uint8Array(4),vl=function(){function t(t,n){this.cs=t;var i=t.getGL();this.us=i.createTexture(),this.hs=i.createFramebuffer(),this.fs=n||[1,1],this.B=new Uint8Array(0),this.ls=!0,this.vs()}return t.prototype.setSize=function(t){x(t,this.fs)||(this.fs[0]=t[0],this.fs[1]=t[1],this.vs())},t.prototype.getSize=function(){return this.fs},t.prototype.clearCachedData=function(){this.ls=!0},t.prototype.readAll=function(){if(this.ls){var t=this.fs,n=this.cs.getGL();n.bindFramebuffer(n.FRAMEBUFFER,this.hs),n.readPixels(0,0,t[0],t[1],n.RGBA,n.UNSIGNED_BYTE,this.B),this.ls=!1}return this.B},t.prototype.readPixel=function(t,n){if(t<0||n<0||t>this.fs[0]||n>=this.fs[1])return ll[0]=0,ll[1]=0,ll[2]=0,ll[3]=0,ll;this.readAll();var i=Math.floor(t)+(this.fs[1]-Math.floor(n)-1)*this.fs[0];return ll[0]=this.B[4*i],ll[1]=this.B[4*i+1],ll[2]=this.B[4*i+2],ll[3]=this.B[4*i+3],ll},t.prototype.getTexture=function(){return this.us},t.prototype.getFramebuffer=function(){return this.hs},t.prototype.vs=function(){var t=this.fs,n=this.cs.getGL();this.us=this.cs.createTexture(t,null,this.us),n.bindFramebuffer(n.FRAMEBUFFER,this.hs),n.viewport(0,0,t[0],t[1]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.us,0),this.B=new Uint8Array(t[0]*t[1]*4)},t}(),dl=!0,pl=function(){function t(t,n,i,r,e,o){this.ds=t,this.ps=n;var s={},a=Ar(this.ps,this.ds);this.ys=function(t){var n=t[0]+"/"+t[1];return s[n]||(s[n]=a(t)),s[n]},this.ws=r,this.bs=e*e,this.gs=[],this.xs=!1,this.Ss=this.ds.canWrapX()&&!!r&&!!this.ds.getExtent()&&ti(r)==ti(this.ds.getExtent()),this.ks=this.ds.getExtent()?ti(this.ds.getExtent()):null,this.Ms=this.ps.getExtent()?ti(this.ps.getExtent()):null;var u=$n(i),c=Qn(i),h=Xn(i),f=Vn(i),l=this.ys(u),v=this.ys(c),d=this.ys(h),p=this.ys(f),y=10+(o?Math.max(0,Math.ceil(fi(Wn(i)/(o*o*256*256)))):0);if(this._s(u,c,h,f,l,v,d,p,y),this.xs){var m=1/0;this.gs.forEach((function(t,n,i){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.gs.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.ks/2){var n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-m>this.ks/2&&(n[0][0]-=this.ks),n[1][0]-m>this.ks/2&&(n[1][0]-=this.ks),n[2][0]-m>this.ks/2&&(n[2][0]-=this.ks);var i=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-i<this.ks/2&&(t.source=n)}}.bind(this))}s={}}return t.prototype.Os=function(t,n,i,r,e,o){this.gs.push({source:[r,e,o],target:[t,n,i]})},t.prototype._s=function(t,n,i,r,e,o,s,a,u){var c=jn([e,o,s,a]),h=this.ks?ti(c)/this.ks:null,f=this.ks,l=this.ds.canWrapX()&&h>.5&&h<1,v=!1;if(u>0){if(this.ps.isGlobal()&&this.Ms)v=ti(jn([t,n,i,r]))/this.Ms>.25||v;!l&&this.ds.isGlobal()&&h&&(v=h>.25||v)}if(!(!v&&this.ws&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3]))||ni(c,this.ws)){var d=0;if(!(v||isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)v=!0;else if(1!=(d=(isFinite(e[0])&&isFinite(e[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!=d&&4!=d&&8!=d)return;if(u>0){if(!v){var p=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.ys(p),m=void 0;if(l)m=(mi(e[0],f)+mi(s[0],f))/2-mi(y[0],f);else m=(e[0]+s[0])/2-y[0];var w=(e[1]+s[1])/2-y[1];v=m*m+w*w>this.bs}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var b=[(n[0]+i[0])/2,(n[1]+i[1])/2],g=this.ys(b),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],j=this.ys(x);this._s(t,n,b,x,e,o,g,j,u-1),this._s(x,b,i,r,j,g,s,a,u-1)}else{var S=[(t[0]+n[0])/2,(t[1]+n[1])/2],k=this.ys(S),M=[(i[0]+r[0])/2,(i[1]+r[1])/2],_=this.ys(M);this._s(t,S,M,r,e,k,_,a,u-1),this._s(S,n,i,M,k,o,s,_,u-1)}return}}if(l){if(!this.Ss)return;this.xs=!0}0==(11&d)&&this.Os(t,i,r,e,s,a),0==(14&d)&&this.Os(t,i,n,e,s,o),d&&(0==(13&d)&&this.Os(n,r,t,o,a,e),0==(7&d)&&this.Os(n,r,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.gs.forEach((function(n,i,r){var e=n.source;Ln(t,e[0]),Ln(t,e[1]),Ln(t,e[2])})),t},t.prototype.getTriangles=function(){return this.gs},t}(),yl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ml=function(t){function n(n,i,r,e,o,s,a,u,c,h,f,l){var v=t.call(this,o,lt,{interpolate:!!l})||this;v.Ts=void 0!==f&&f,v.Rt=a,v.Es=u,v.Ut=null,v.As=i,v.Cs=e,v.Rs=s||o,v.Ps=[],v.Is=null,v.Ns=0;var d=e.getTileCoordExtent(v.Rs),p=v.Cs.getExtent(),y=v.As.getExtent(),m=p?Zn(d,p):d;if(0===Wn(m))return v.state=yt,v;var w=n.getExtent();w&&(y=y?Zn(y,w):w);var b=e.getResolution(v.Rs[0]),g=Vh(n,r,m,b);if(!isFinite(g)||g<=0)return v.state=yt,v;var x=void 0!==h?h:.5;if(v.zs=new pl(n,r,m,y,g*x,b),0===v.zs.getTriangles().length)return v.state=yt,v;v.Ns=i.getZForResolution(g);var j=v.zs.calculateSourceExtent();if(y&&(n.canWrapX()?(j[1]=ci(j[1],y[1],y[3]),j[3]=ci(j[3],y[1],y[3])):j=Zn(j,y)),Wn(j)){for(var S=i.getTileRangeForExtentAndZ(j,v.Ns),k=S.minX;k<=S.maxX;k++)for(var M=S.minY;M<=S.maxY;M++){var _=c(v.Ns,k,M,a);_&&v.Ps.push(_)}0===v.Ps.length&&(v.state=yt)}else v.state=yt;return v}return yl(n,t),n.prototype.getImage=function(){return this.Ut},n.prototype.Fs=function(){var t=[];if(this.Ps.forEach(function(n,i,r){n&&n.getState()==dt&&t.push({extent:this.As.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.Ps.length=0,0===t.length)this.state=pt;else{var n=this.Rs[0],i=this.Cs.getTileSize(n),r="number"==typeof i?i:i[0],e="number"==typeof i?i:i[1],o=this.Cs.getResolution(n),s=this.As.getResolution(this.Ns),a=this.Cs.getTileCoordExtent(this.Rs);this.Ut=Xh(r,e,this.Rt,s,this.As.getExtent(),o,a,this.zs,t,this.Es,this.Ts,this.interpolate),this.state=dt}this.changed()},n.prototype.load=function(){if(this.state==lt){this.state=vt,this.changed();var t=0;this.Is=[],this.Ps.forEach(function(n,i,r){var e=n.getState();if(e==lt||e==vt){t++;var o=Y(n,N,(function(i){var r=n.getState();r!=dt&&r!=pt&&r!=yt||($(o),0===--t&&(this.Ls(),this.Fs()))}),this);this.Is.push(o)}}.bind(this)),0===t?setTimeout(this.Fs.bind(this),0):this.Ps.forEach((function(t,n,i){t.getState()==lt&&t.load()}))}},n.prototype.Ls=function(){this.Is.forEach($),this.Is=null},n}(jt),wl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function bl(t,n,i){var r=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}function gl(t,n,i,r,e,o){var s,a,u=t.getGL();i instanceof Float32Array?(s=u.FLOAT,t.getExtension("OES_texture_float"),a=null!==t.getExtension("OES_texture_float_linear")):(s=u.UNSIGNED_BYTE,a=!0);bl(u,n,o&&a);var c,h=i.byteLength/r[1],f=1;switch(h%8==0?f=8:h%4==0?f=4:h%2==0&&(f=2),e){case 1:c=u.LUMINANCE;break;case 2:c=u.LUMINANCE_ALPHA;break;case 3:c=u.RGB;break;case 4:c=u.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(e))}var l=u.getParameter(u.UNPACK_ALIGNMENT);u.pixelStorei(u.UNPACK_ALIGNMENT,f),u.texImage2D(u.TEXTURE_2D,0,c,r[0],r[1],0,c,s,i),u.pixelStorei(u.UNPACK_ALIGNMENT,l)}var xl=null;var jl=function(t){function n(n){var i=t.call(this)||this;i.tile,i.textures=[],i.hr=i.hr.bind(i),i.size=uu(n.grid.getTileSize(n.tile.tileCoord[0])),i.Gs=n.tilePixelRatio||1,i.Es=n.gutter||0,i.bandCount=NaN,i.cs=n.helper;var r=new Vf(hf,lf);return r.fromArray([0,1,1,1,1,0,0,0]),i.cs.flushBufferData(r),i.coords=r,i.setTile(n.tile),i}return wl(n,t),n.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(N,this.hr),this.tile=t,this.textures.length=0,this.loaded=t.getState()===dt,this.loaded)this.Ds();else{if(t instanceof No){var n=t.getImage();n instanceof Image&&!n.crossOrigin&&(n.crossOrigin="anonymous")}t.addEventListener(N,this.hr)}},n.prototype.Ds=function(){var t=this.cs,n=t.getGL(),i=this.tile;if(i instanceof No||i instanceof ml){var r=i.getImage();if(0!==this.Es){var e=this.Gs*this.Es,o=Math.round(r.width-2*e),s=Math.round(r.height-2*e),a=Oo(o,s);i.interpolate||E(a,Dh),a.drawImage(r,e,e,o,s,0,0,o,s),r=a.canvas}var u=n.createTexture();return this.textures.push(u),this.bandCount=4,void function(t,n,i,r){bl(t,n,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(n,u,r,i.interpolate)}var c=[this.size[0]*this.Gs,this.size[1]*this.Gs],h=i.getData(),f=h instanceof Float32Array,l=c[0]*c[1],v=f?Float32Array:Uint8Array,d=v.BYTES_PER_ELEMENT,p=h.byteLength/c[1];this.bandCount=Math.floor(p/d/c[0]);var y=Math.ceil(this.bandCount/4);if(1===y){u=n.createTexture();return this.textures.push(u),void gl(t,u,h,c,this.bandCount,i.interpolate)}for(var m=new Array(y),w=0;w<y;++w){u=n.createTexture();this.textures.push(u);var b=w<y-1?4:this.bandCount%4;m[w]=new v(l*b)}for(var g=0,x=0,j=c[0]*this.bandCount,S=0;S<c[1];++S){for(var k=0;k<j;++k){var M=h[x+k],_=Math.floor(g/this.bandCount),O=k%this.bandCount;(T=m[w=Math.floor(O/4)])[_*(b=T.length/l)+O%4]=M,++g}x+=p/d}for(w=0;w<y;++w){var T;gl(t,u=this.textures[w],T=m[w],c,b=T.length/l,i.interpolate)}},n.prototype.hr=function(){this.tile.getState()===dt&&(this.loaded=!0,this.Ds(),this.dispatchEvent(N))},n.prototype.disposeInternal=function(){var t=this.cs.getGL();this.cs.deleteBuffer(this.coords);for(var n=0;n<this.textures.length;++n)t.deleteTexture(this.textures[n]);this.tile.removeEventListener(N,this.hr)},n.prototype.getPixelData=function(t,n){if(!this.loaded)return null;if(t=Math.floor(this.Gs*t),n=Math.floor(this.Gs*n),this.tile instanceof kt){var i=this.tile.getData(),r=Math.floor(this.Gs*this.size[0]);if(i instanceof DataView){var e=i.byteLength/(this.size[0]*this.size[1]),o=n*r*e+t*e,s=i.buffer.slice(o,o+e);return new DataView(s)}var a=n*r*this.bandCount+t*this.bandCount;return i.slice(a,a+this.bandCount)}var u,c;xl||((u=document.createElement("canvas")).width=1,u.height=1,xl=u.getContext("2d")),xl.clearRect(0,0,1,1);var h=this.tile.getImage();try{xl.drawImage(h,t,n,1,1,0,0,1,1),c=xl.getImageData(0,0,1,1).data}catch(t){return null}return c},n}(I),Sl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kl=function(t){function n(n){var i=t.call(this)||this;return i.ready=!0,i.Us=i.qs.bind(i),i.Bs=n,i.declutterExecutorGroup=null,i}return Sl(n,t),n.prototype.getFeatures=function(t){return r()},n.prototype.getData=function(t){return null},n.prototype.prepareFrame=function(t){return r()},n.prototype.renderFrame=function(t,n){return r()},n.prototype.loadedTileCallback=function(t,n,i){t[n]||(t[n]={}),t[n][i.tileCoord.toString()]=i},n.prototype.createLoadedTileFinder=function(t,n,i){return function(r,e){var o=this.loadedTileCallback.bind(this,i,r);return t.forEachLoadedTile(n,r,e,o)}.bind(this)},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){},n.prototype.getDataAtPixel=function(t,n,i){return null},n.prototype.getLayer=function(){return this.Bs},n.prototype.handleFontsChanged=function(){},n.prototype.qs=function(t){t.target.getState()===bo&&this.renderIfReadyAndVisible()},n.prototype.loadImage=function(t){var n=t.getState();return n!=bo&&n!=go&&t.addEventListener(N,this.Us),n==mo&&(t.load(),n=t.getState()),n==bo},n.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==ys&&t.changed()},n.prototype.disposeInternal=function(){delete this.Bs,t.prototype.disposeInternal.call(this)},n}(it),Ml=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_l="GENERATE_BUFFERS",Ol=function(t){function n(n,i){var r=t.call(this,n)||this,e=i||{};return r.Ws=[1,0,0,1,0,0],r.Vs=null,r.Xs=e.postProcesses,r.Vo=e.uniforms,r.helper,n.addChangeListener(os,r.removeHelper.bind(r)),r.dispatchPreComposeEvent=r.dispatchPreComposeEvent.bind(r),r.dispatchPostComposeEvent=r.dispatchPostComposeEvent.bind(r),r}return Ml(n,t),n.prototype.dispatchPreComposeEvent=function(t,n){var i=this.getLayer();if(i.hasListener(fs)){var r=new Ms(fs,void 0,n,t);i.dispatchEvent(r)}},n.prototype.dispatchPostComposeEvent=function(t,n){var i=this.getLayer();if(i.hasListener(ls)){var r=new Ms(ls,void 0,n,t);i.dispatchEvent(r)}},n.prototype.reset=function(t){this.Vo=t.uniforms,this.helper&&this.helper.setUniforms(this.Vo)},n.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},n.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var i=!0,r=-1,e=void 0,o=0,s=t.layerStatesArray.length;o<s;o++){var a=t.layerStatesArray[o].layer,u=a.getRenderer();if(u instanceof n){var c=a.getClassName();if((i||c!==e)&&(r+=1,i=!1),e=c,u===this)break}else i=!0}var h="map/"+t.mapId+"/group/"+r;this.helper&&this.helper.canvasCacheKeyMatches(h)||(this.removeHelper(),this.helper=new hl({postProcesses:this.Xs,uniforms:this.Vo,canvasCacheKey:h}),e&&(this.helper.getCanvas().className=e),this.afterHelperCreated())}return this.prepareFrameInternal(t)},n.prototype.afterHelperCreated=function(){},n.prototype.prepareFrameInternal=function(t){return!0},n.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},n.prototype.Hs=function(t,n,i){var r=this.getLayer();if(r.hasListener(t)){un(this.Ws,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);var e=new Ms(t,this.Ws,i,n);r.dispatchEvent(e)}},n.prototype.preRender=function(t,n){this.Hs(cs,t,n)},n.prototype.postRender=function(t,n){this.Hs(hs,t,n)},n.prototype.getDataAtPixel=function(t,n,i){var r=rn([n.pixelRatio,0,0,n.pixelRatio,0,0],t.slice()),e=this.helper.getGL();if(!e)return null;var o=this.getLayer().getExtent();if(o&&!_n(o,rn(n.pixelToCoordinateTransform,t.slice())))return null;var s=e.getContextAttributes();if(!s||!s.preserveDrawingBuffer)return new Uint8Array;var a,u=Math.round(r[0]),c=Math.round(r[1]),h=this.Vs;if(!h){var f=document.createElement("canvas");f.width=1,f.height=1,h=f.getContext("2d"),this.Vs=h}h.clearRect(0,0,1,1);try{h.drawImage(e.canvas,u,c,1,1,0,0,1,1),a=h.getImageData(0,0,1,1).data}catch(t){return a}return 0===a[3]?null:a},n}(kl),Tl=[],El={vertexPosition:0,indexPosition:0};function Al(t,n,i,r,e){t[n+0]=i,t[n+1]=r,t[n+2]=e}function Cl(t,n){var i=n||[],r=256,e=255;return i[0]=Math.floor(t/r/r/r)/e,i[1]=Math.floor(t/r/r)%r/e,i[2]=Math.floor(t/r)%r/e,i[3]=t%r/e,i}function Rl(t){var n=0,i=256,r=255;return n+=Math.round(t[0]*i*i*i*r),n+=Math.round(t[1]*i*i*r),n+=Math.round(t[2]*i*r),n+=Math.round(t[3]*r)}var Pl=Ol,Il=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nl={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},zl={TEXTURE_COORD:"a_textureCoord"},Fl=[{name:zl.TEXTURE_COORD,size:2,type:el.FLOAT}],Ll={};function Gl(t){return 2*(1-1/(t+1))-1}function Dl(t,n,i){i in t||(t[i]=[]),t[i].push(n)}function Ul(t,n){var i=t.layerStatesArray[t.layerIndex];i.extent&&(n=Zn(n,Gr(i.extent,t.viewState.projection)));var r=i.layer.getRenderSource();if(!r.getWrapX()){var e=r.getTileGridForProjection(t.viewState.projection).getExtent();e&&(n=Zn(n,e))}return n}function ql(t,n){return"".concat(t.getKey(),",").concat(Xc(n))}var Bl=function(t){function n(n,i){var r=t.call(this,n,{uniforms:i.uniforms})||this;r.renderComplete=!1,r.Js=[1,0,0,1,0,0],r.Ks=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.Ys=new nh(0,0,0,0),r.Zs=Wc(0,0,0),r.$s=[0,0],r.Qs,r.ta=i.vertexShader,r.na=i.fragmentShader,r.ia=new Vf(ff,lf),r.ia.fromArray([0,1,3,1,2,3]);var e=void 0!==i.cacheSize?i.cacheSize:512;return r.ra=new Bc(e),r.ea=i.paletteTextures||[],r.Ji=null,r}return Il(n,t),n.prototype.reset=function(n){t.prototype.reset.call(this,{uniforms:n.uniforms}),this.ta=n.vertexShader,this.na=n.fragmentShader,this.ea=n.paletteTextures||[],this.helper&&(this.Qs=this.helper.getProgram(this.na,this.ta))},n.prototype.afterHelperCreated=function(){this.Qs=this.helper.getProgram(this.na,this.ta),this.helper.flushBufferData(this.ia)},n.prototype.oa=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==dt||i==yt||i==pt&&!r},n.prototype.prepareFrameInternal=function(t){var n=this.getLayer().getRenderSource();return!!n&&(!ii(Ul(t,t.extent))&&n.getState()===ys)},n.prototype.enqueueTiles=function(t,n,i,r){var e=t.viewState,s=this.getLayer(),a=s.getRenderSource(),u=a.getTileGridForProjection(e.projection),c=a.getTilePixelRatio(t.pixelRatio),h=a.getGutterForProjection(e.projection),f=o(a);f in t.wantedTiles||(t.wantedTiles[f]={});for(var l=t.wantedTiles[f],v=this.ra,d=Math.max(i-s.getPreload(),u.getMinZoom(),s.getMinZoom()),p=i;p>=d;--p)for(var y=u.getTileRangeForExtentAndZ(n,p,this.Ys),m=u.getResolution(p),w=y.minX;w<=y.maxX;++w)for(var b=y.minY;b<=y.maxY;++b){var g=Wc(p,w,b,this.Zs),x=ql(a,g),j=void 0,S=void 0;if(v.containsKey(x)&&(S=(j=v.get(x)).tile),!j||j.tile.key!==a.getKey())if(S=a.getTile(p,w,b,t.pixelRatio,e.projection),j)if(this.oa(S))j.setTile(S);else{var k=S.getInterimTile();j.setTile(k)}else j=new jl({tile:S,grid:u,helper:this.helper,tilePixelRatio:c,gutter:h}),v.set(x,j);Dl(r,j,p);var M=S.getKey();l[M]=!0,S.getState()===lt&&(t.tileQueue.isKeyQueued(M)||t.tileQueue.enqueue([S,f,u.getTileCoordCenter(g),m]))}},n.prototype.renderFrame=function(t){this.Ji=t,this.renderComplete=!0;var n=this.helper.getGL();this.preRender(n,t);var i=t.viewState,r=this.getLayer().getRenderSource(),e=r.getTileGridForProjection(i.projection),s=Ul(t,t.extent),a=e.getZForResolution(i.resolution,r.zDirection),u={};if(t.nextExtent){var c=e.getZForResolution(i.nextResolution,r.zDirection),h=Ul(t,t.nextExtent);this.enqueueTiles(t,h,c,u)}this.enqueueTiles(t,s,a,u);for(var f={},l=o(this),v=t.time,d=!1,y=u[a],m=0,w=y.length;m<w;++m){var b=(z=(K=y[m]).tile).tileCoord;if(K.loaded){if(1===(F=z.getAlpha(l,v))){z.endTransition(l);continue}d=!0,f[L=Xc(b)]=F}if(this.renderComplete=!1,!this.sa(e,b,a+1,u))for(var g=e.getMinZoom(),x=a-1;x>=g;--x){if(this.sa(e,b,x,u))break}}this.helper.useProgram(this.Qs),this.helper.prepareDraw(t,!d);for(var j=Object.keys(u).map(Number).sort(p),S=i.center[0],k=i.center[1],M=0,_=j.length;M<_;++M){var O=j[M],T=e.getResolution(O),E=uu(e.getTileSize(O),this.$s),A=e.getOrigin(O),C=(S-A[0])/(E[0]*T),R=(A[1]-k)/(E[1]*T),P=i.resolution/T,I=Gl(O),N=u[O];for(m=0,w=N.length;m<w;++m){if((K=N[m]).loaded){var z,F,L=Xc(b=(z=K.tile).tileCoord),G=b[1],D=b[2];un(this.Js,0,0,2/(t.size[0]*P/E[0]),-2/(t.size[1]*P/E[1]),i.rotation,-(C-G),-(R-D)),this.helper.setUniformMatrixValue(Nl.TILE_TRANSFORM,Yf(this.Ks,this.Js)),this.helper.bindBuffer(K.coords),this.helper.bindBuffer(this.ia),this.helper.enableAttributes(Fl);for(var U=0;U<K.textures.length;){var q="TEXTURE"+U,B="".concat(Nl.TILE_TEXTURE_ARRAY,"[").concat(U,"]");n.activeTexture(n[q]),n.bindTexture(n.TEXTURE_2D,K.textures[U]),n.uniform1i(this.helper.getUniformLocation(B),U),++U}for(var W=0;W<this.ea.length;++W){var V=this.ea[W];n.activeTexture(n["TEXTURE"+U]);var X=V.getTexture(n);n.bindTexture(n.TEXTURE_2D,X),n.uniform1i(this.helper.getUniformLocation(V.name),U),++U}(F=L in f?f[L]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(Nl.TRANSITION_ALPHA,F),this.helper.setUniformFloatValue(Nl.DEPTH,I),this.helper.setUniformFloatValue(Nl.TEXTURE_PIXEL_WIDTH,E[0]),this.helper.setUniformFloatValue(Nl.TEXTURE_PIXEL_HEIGHT,E[1]),this.helper.setUniformFloatValue(Nl.TEXTURE_RESOLUTION,T),this.helper.setUniformFloatValue(Nl.TEXTURE_ORIGIN_X,A[0]+G*E[0]*T),this.helper.setUniformFloatValue(Nl.TEXTURE_ORIGIN_Y,A[1]-D*E[1]*T),this.helper.setUniformFloatVec4(Nl.RENDER_EXTENT,s),this.helper.setUniformFloatValue(Nl.RESOLUTION,i.resolution),this.helper.setUniformFloatValue(Nl.ZOOM,i.zoom),this.helper.drawElements(0,this.ia.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var H=this.helper.getCanvas(),J=this.ra;J.canExpireCache();){var K;(K=J.pop()).dispose()}return t.postRenderFunctions.push((function(t,n){r.expireCache(n.viewState.projection,Ll)})),this.postRender(n,t),H},n.prototype.getData=function(t){if(!this.helper.getGL())return null;var n=this.Ji;if(!n)return null;var i=this.getLayer(),r=rn(n.pixelToCoordinateTransform,t.slice()),e=n.viewState,o=i.getExtent();if(o&&!_n(Gr(o,e.projection),r))return null;var s=i.getRenderSource(),a=s.getTileGridForProjection(e.projection);if(!s.getWrapX()){var u=a.getExtent();if(u&&!_n(u,r))return null}for(var c=this.ra,h=a.getZForResolution(e.resolution);h>=a.getMinZoom();--h){var f=a.getTileCoordForCoordAndZ(r,h),l=ql(s,f);if(c.containsKey(l)){var v=c.get(l);if(v.loaded){var d=a.getOrigin(h),p=uu(a.getTileSize(h)),y=a.getResolution(h),m=(r[0]-d[0])/y-f[1]*p[0],w=(d[1]-r[1])/y-f[2]*p[1];return v.getPixelData(m,w)}}}return null},n.prototype.sa=function(t,n,i,r){var e=t.getTileRangeForTileCoordAndZ(n,i,this.Ys);if(!e)return!1;for(var o=!0,s=this.ra,a=this.getLayer().getRenderSource(),u=e.minX;u<=e.maxX;++u)for(var c=e.minY;c<=e.maxY;++c){var h=ql(a,[i,u,c]),f=!1;if(s.containsKey(h)){var l=s.get(h);l.loaded&&(Dl(r,l,i),f=!0)}f||(o=!1)}return o},n.prototype.removeHelper=function(){if(this.helper){var n=this.ra;n.forEach((function(t){return t.dispose()})),n.clear()}t.prototype.removeHelper.call(this)},n.prototype.disposeInternal=function(){var n=this.helper;n&&(n.getGL().deleteProgram(this.Qs),delete this.Qs,n.deleteBuffer(this.ia));t.prototype.disposeInternal.call(this),delete this.ia,delete this.ra,delete this.Ji},n}(Pl),Wl=1,Vl=2,Xl=4,Hl=8,Jl=16,Kl=31,Yl=0,Zl={};function $l(t){if("number"==typeof t)return Wl;if("boolean"==typeof t)return Hl;if("string"==typeof t)return Vo(t)?Xl|Vl:Vl;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?Xl|Jl:Jl;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(n)));var i=Zl[n[0]];if(void 0===i)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return i.getReturnType(n.slice(1))}function Ql(t){return fi(t)%1==0}function tv(t){var n=t.toString();return-1===n.indexOf(".")?n+".0":n}function nv(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(tv).join(", "),")")}function iv(t){var n=qo(t).slice();return n.length<4&&n.push(1),nv(n.map((function(t,n){return n<3?t/255:t})))}function rv(t,n){return void 0===t.stringLiteralsMap[n]&&(t.stringLiteralsMap[n]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[n]}function ev(t,n){return tv(rv(t,n))}function ov(t,n,i){if(Array.isArray(n)&&"string"==typeof n[0]){var r=Zl[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return r.toGlsl(t,n.slice(1),i)}var e=$l(n);if((e&Wl)>0)return tv(n);if((e&Hl)>0)return n.toString();if((e&Vl)>0&&(void 0===i||i==Vl))return ev(t,n.toString());if((e&Xl)>0&&(void 0===i||i==Xl))return iv(n);if((e&Jl)>0)return nv(n);throw new Error("Unexpected expression ".concat(n," (expected type ").concat(i,")"))}function sv(t){if(!($l(t)&Wl))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function av(t){for(var n=0;n<t.length;n++)sv(t[n])}function uv(t){if(!($l(t)&Vl))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function cv(t){if(!($l(t)&Hl))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function hv(t,n){if(t.length!==n)throw new Error("Exactly ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function fv(t,n){if(t.length<n)throw new Error("At least ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function lv(t,n){if(t.length>n)throw new Error("At most ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function vv(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function dv(t,n){if(!Ql(n))throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function pv(t){return"u_var_"+t}Zl.get={getReturnType:function(t){return Kl},toGlsl:function(t,n){hv(n,1),uv(n[0]);var i=n[0].toString();return-1===t.attributes.indexOf(i)&&t.attributes.push(i),(t.inFragmentShader?"v_":"a_")+i}},Zl.var={getReturnType:function(t){return Kl},toGlsl:function(t,n){hv(n,1),uv(n[0]);var i=n[0].toString();return-1===t.variables.indexOf(i)&&t.variables.push(i),pv(i)}};var yv="u_paletteTextures";Zl.palette={getReturnType:function(t){return Xl},toGlsl:function(t,n){hv(n,2),sv(n[0]);var i=ov(t,n[0]),r=n[1];if(!Array.isArray(r))throw new Error("The second argument of palette must be an array");for(var e=r.length,o=new Uint8Array(4*e),s=0;s<e;s++){var a=r[s],u=void 0;if("string"==typeof a)u=Uo(a);else{if(!Array.isArray(a))throw new Error("The second argument of palette must be an array of strings or colors");var c=a.length;if(4===c)u=a;else{if(3!==c)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(c));u=[a[0],a[1],a[2],1]}}var h=4*s;o[h]=u[0],o[h+1]=u[1],o[h+2]=u[2],o[h+3]=255*u[3]}t.paletteTextures||(t.paletteTextures=[]);var f="".concat(yv,"[").concat(t.paletteTextures.length,"]"),l=new fl(f,o);return t.paletteTextures.push(l),"texture2D(".concat(f,", vec2((").concat(i," + 0.5) / ").concat(e,".0, 0.5))")}};var mv="getBandValue";function wv(t){return{getReturnType:function(t){return Hl},toGlsl:function(n,i){hv(i,2);for(var r=Kl,e=0;e<i.length;e++)r&=$l(i[e]);if(r===Yl)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(i)," instead"));return r&=~Xl,"(".concat(ov(n,i[0],r)," ").concat(t," ").concat(ov(n,i[1],r),")")}}}function bv(t){return{getReturnType:function(t){return Hl},toGlsl:function(n,i){fv(i,2);for(var r=0;r<i.length;r++)cv(i[r]);var e="";return e=i.map((function(t){return ov(n,t)})).join(" ".concat(t," ")),e="(".concat(e,")")}}}Zl.band={getReturnType:function(t){return Wl},toGlsl:function(t,n){fv(n,1),lv(n,3);var i=n[0];if(!(mv in t.functions)){for(var r="",e=t.bandCount||1,o=0;o<e;o++){var s=Math.floor(o/4),a=o%4;a===e-1&&1===a&&(a=3);var u="".concat(Nl.TILE_TEXTURE_ARRAY,"[").concat(s,"]");r+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(u,", v_textureCoord + vec2(dx, dy))[").concat(a,"];\n }\n ")}t.functions.getBandValue="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(Nl.TEXTURE_PIXEL_WIDTH,";\n float dy = yOffset / ").concat(Nl.TEXTURE_PIXEL_HEIGHT,";\n ").concat(r,"\n }\n ")}var c=ov(t,i),h=ov(t,n[1]||0),f=ov(t,n[2]||0);return"".concat(mv,"(").concat(c,", ").concat(h,", ").concat(f,")")}},Zl.time={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,0),"u_time"}},Zl.zoom={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,0),"u_zoom"}},Zl.resolution={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,0),"u_resolution"}},Zl["*"]={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," * ").concat(ov(t,n[1]),")")}},Zl["/"]={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," / ").concat(ov(t,n[1]),")")}},Zl["+"]={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," + ").concat(ov(t,n[1]),")")}},Zl["-"]={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," - ").concat(ov(t,n[1]),")")}},Zl.clamp={getReturnType:function(t){return Wl},toGlsl:function(t,n){hv(n,3),av(n);var i=ov(t,n[1]),r=ov(t,n[2]);return"clamp(".concat(ov(t,n[0]),", ").concat(i,", ").concat(r,")")}},Zl["%"]={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,2),av(n),"mod(".concat(ov(t,n[0]),", ").concat(ov(t,n[1]),")")}},Zl["^"]={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,2),av(n),"pow(".concat(ov(t,n[0]),", ").concat(ov(t,n[1]),")")}},Zl.abs={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,1),av(n),"abs(".concat(ov(t,n[0]),")")}},Zl.floor={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,1),av(n),"floor(".concat(ov(t,n[0]),")")}},Zl.round={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,1),av(n),"floor(".concat(ov(t,n[0])," + 0.5)")}},Zl.ceil={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,1),av(n),"ceil(".concat(ov(t,n[0]),")")}},Zl.sin={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,1),av(n),"sin(".concat(ov(t,n[0]),")")}},Zl.cos={getReturnType:function(t){return Wl},toGlsl:function(t,n){return hv(n,1),av(n),"cos(".concat(ov(t,n[0]),")")}},Zl.atan={getReturnType:function(t){return Wl},toGlsl:function(t,n){return fv(n,1),lv(n,2),av(n),2===n.length?"atan(".concat(ov(t,n[0]),", ").concat(ov(t,n[1]),")"):"atan(".concat(ov(t,n[0]),")")}},Zl[">"]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," > ").concat(ov(t,n[1]),")")}},Zl[">="]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," >= ").concat(ov(t,n[1]),")")}},Zl["<"]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," < ").concat(ov(t,n[1]),")")}},Zl["<="]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,2),av(n),"(".concat(ov(t,n[0])," <= ").concat(ov(t,n[1]),")")}},Zl["=="]=wv("=="),Zl["!="]=wv("!="),Zl["!"]={getReturnType:function(t){return Hl},toGlsl:function(t,n){return hv(n,1),cv(n[0]),"(!".concat(ov(t,n[0]),")")}},Zl.all=bv("&&"),Zl.any=bv("||"),Zl.between={getReturnType:function(t){return Hl},toGlsl:function(t,n){hv(n,3),av(n);var i=ov(t,n[1]),r=ov(t,n[2]),e=ov(t,n[0]);return"(".concat(e," >= ").concat(i," && ").concat(e," <= ").concat(r,")")}},Zl.array={getReturnType:function(t){return Jl},toGlsl:function(t,n){fv(n,2),lv(n,4),av(n);var i=n.map((function(n){return ov(t,n,Wl)}));return"vec".concat(n.length,"(").concat(i.join(", "),")")}},Zl.color={getReturnType:function(t){return Xl},toGlsl:function(t,n){fv(n,3),lv(n,4),av(n);var i=n;3===n.length&&i.push(1);var r=n.map((function(n,i){return ov(t,n,Wl)+(i<3?" / 255.0":"")}));return"vec".concat(n.length,"(").concat(r.join(", "),")")}},Zl.interpolate={getReturnType:function(t){for(var n=Xl|Wl,i=3;i<t.length;i+=2)n&=$l(t[i]);return n},toGlsl:function(t,n,i){vv(n),fv(n,6);var r,e=n[0];switch(e[0]){case"linear":r=1;break;case"exponential":r=e[1];break;default:r=null}if(!r)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(e)));var o=void 0!==i?i:Kl,s=Zl.interpolate.getReturnType(n)&o;dv(n,s);for(var a=ov(t,n[1]),u=tv(r),c="",h=2;h<n.length-2;h+=2){var f=ov(t,n[h]),l=c||ov(t,n[h+1],s),v=ov(t,n[h+2]),d=ov(t,n[h+3],s);c="mix(".concat(l,", ").concat(d,", pow(clamp((").concat(a," - ").concat(f,") / (").concat(v," - ").concat(f,"), 0.0, 1.0), ").concat(u,"))")}return c}},Zl.match={getReturnType:function(t){for(var n=Kl,i=2;i<t.length;i+=2)n&=$l(t[i]);return n&=$l(t[t.length-1])},toGlsl:function(t,n,i){vv(n),fv(n,4);var r=void 0!==i?i:Kl,e=Zl.match.getReturnType(n)&r;dv(n,e);for(var o=ov(t,n[0]),s=ov(t,n[n.length-1],e),a=null,u=n.length-3;u>=1;u-=2){var c=ov(t,n[u]),h=ov(t,n[u+1],e);a="(".concat(o," == ").concat(c," ? ").concat(h," : ").concat(a||s,")")}return a}},Zl.case={getReturnType:function(t){for(var n=Kl,i=1;i<t.length;i+=2)n&=$l(t[i]);return n&=$l(t[t.length-1])},toGlsl:function(t,n,i){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(n),fv(n,3);var r=void 0!==i?i:Kl,e=Zl.case.getReturnType(n)&r;dv(n,e);for(var o=0;o<n.length-1;o+=2)cv(n[o]);var s=ov(t,n[n.length-1],e),a=null;for(o=n.length-3;o>=0;o-=2){var u=ov(t,n[o]),c=ov(t,n[o+1],e);a="(".concat(u," ? ").concat(c," : ").concat(a||s,")")}return a}};var gv=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,n,i){return this.varyings.push({name:t,type:n,expression:i}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var n=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",i=this.attributes,r=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(i.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(n,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var n=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(n,"\n}")},t}();function xv(t){var n=t.symbol,i=void 0!==n.size?n.size:1,r=n.color||"white",e=n.textureCoord||[0,0,1,1],o=n.offset||[0,0],s=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,u={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},c=ov(u,i,Jl|Wl),h=ov(u,o,Jl),f=ov(u,e,Jl),l=ov(u,a,Wl),v={inFragmentShader:!0,variables:u.variables,attributes:[],stringLiteralsMap:u.stringLiteralsMap,functions:{}},d=ov(v,r,Xl),p=ov(v,s,Wl),y="1.0",m="vec2(".concat(ov(v,i,Jl|Wl),").x");switch(n.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./".concat(m,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var w="(v_quadCoord*2.-1.)",b="(atan(".concat(w,".x,").concat(w,".y))");y="(1.0-smoothstep(.5-3./".concat(m,",.5,cos(floor(.5+").concat(b,"/2.094395102)*2.094395102-").concat(b,")*length(").concat(w,")))");break;default:throw new Error("Unexpected symbol type: "+n.symbolType)}var g=(new gv).setSizeExpression("vec2(".concat(c,")")).setRotationExpression(l).setSymbolOffsetExpression(h).setTextureCoordinateExpression(f).setSymbolRotateWithView(!!n.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(p," * ").concat(y,")"));if(t.filter){var x=ov(v,t.filter,Hl);g.setFragmentDiscardExpression("!".concat(x))}var j={};if(v.variables.forEach((function(n){var i=pv(n);g.addUniform("float ".concat(i)),j[i]=function(){if(!t.variables||void 0===t.variables[n])throw new Error("The following variable is missing from the style: ".concat(n));var i=t.variables[n];return"string"==typeof i&&(i=rv(u,i)),void 0!==i?i:-9999999}})),"image"===n.symbolType&&n.src){var S=new Image;S.crossOrigin=void 0===n.crossOrigin?"anonymous":n.crossOrigin,S.src=n.src,g.addUniform("sampler2D u_texture").setColorExpression(g.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),j.u_texture=S}return v.attributes.forEach((function(t){-1===u.attributes.indexOf(t)&&u.attributes.push(t),g.addVarying("v_".concat(t),"float","a_".concat(t))})),u.attributes.forEach((function(t){g.addAttribute("float a_".concat(t))})),{builder:g,attributes:u.attributes.map((function(t){return{name:t,callback:function(n,i){var r=i[t];return"string"==typeof r&&(r=rv(u,r)),void 0!==r?r:-9999999}}})),uniforms:j}}var jv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sv=function(t){function n(n){var i=t.call(this,{extent:n.extent,origin:n.origin,origins:n.origins,resolutions:n.resolutions,tileSize:n.tileSize,tileSizes:n.tileSizes,sizes:n.sizes})||this;return i.aa=n.matrixIds,i}return jv(n,t),n.prototype.getMatrixId=function(t){return this.aa[t]},n.prototype.getMatrixIds=function(){return this.aa},n}(Jh),kv=Sv;function Mv(t,n,i){var r=[],e=[],o=[],s=[],a=[],u=void 0!==i?i:[],c=gr(t.SupportedCRS),h=c.getMetersPerUnit(),f="ne"==c.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,n){return n.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(n){if(!(u.length>0)||g(u,(function(i){return n.Identifier==i.TileMatrix||-1===n.Identifier.indexOf(":")&&t.Identifier+":"+n.Identifier===i.TileMatrix}))){e.push(n.Identifier);var i=28e-5*n.ScaleDenominator/h,c=n.TileWidth,l=n.TileHeight;f?o.push([n.TopLeftCorner[1],n.TopLeftCorner[0]]):o.push(n.TopLeftCorner),r.push(i),s.push(c==l?c:[c,l]),a.push([n.MatrixWidth,n.MatrixHeight])}})),new Sv({extent:n,origins:o,resolutions:r,matrixIds:e,tileSizes:s,sizes:a})}var _v=function(){function t(t){this.ua=t.opacity,this.ca=t.rotateWithView,this.Dr=t.rotation,this.ha=t.scale,this.fa=uu(t.scale),this.la=t.displacement}return t.prototype.clone=function(){var n=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.ua},t.prototype.getRotateWithView=function(){return this.ca},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.ha},t.prototype.getScaleArray=function(){return this.fa},t.prototype.getDisplacement=function(){return this.la},t.prototype.getAnchor=function(){return r()},t.prototype.getImage=function(t){return r()},t.prototype.getHitDetectionImage=function(){return r()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return r()},t.prototype.getImageSize=function(){return r()},t.prototype.getOrigin=function(){return r()},t.prototype.getSize=function(){return r()},t.prototype.setDisplacement=function(t){this.la=t},t.prototype.setOpacity=function(t){this.ua=t},t.prototype.setRotateWithView=function(t){this.ca=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.ha=t,this.fa=uu(t)},t.prototype.listenImageChange=function(t){r()},t.prototype.load=function(){r()},t.prototype.unlistenImageChange=function(t){r()},t}(),Ov=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tv=function(t){function n(n){var i=this,r=void 0!==n.rotateWithView&&n.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==n.rotation?n.rotation:0,scale:void 0!==n.scale?n.scale:1,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this).Ut=void 0,i.va=null,i.da=void 0!==n.fill?n.fill:null,i.ko=[0,0],i.Jt=n.points,i.pa=void 0!==n.radius?n.radius:n.radius1,i.ya=n.radius2,i.Kt=void 0!==n.angle?n.angle:0,i.ma=void 0!==n.stroke?n.stroke:null,i.fs=null,i.wa=null,i.render(),i}return Ov(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},n.prototype.getAnchor=function(){var t=this.fs;if(!t)return null;var n=this.getDisplacement();return[t[0]/2-n[0],t[1]/2+n[1]]},n.prototype.getAngle=function(){return this.Kt},n.prototype.getFill=function(){return this.da},n.prototype.getHitDetectionImage=function(){return this.va||this.ba(this.wa),this.va},n.prototype.getImage=function(t){var n=this.Ut[t];if(!n){var i=this.wa,r=Oo(i.size*t,i.size*t);this.ga(i,r,t),n=r.canvas,this.Ut[t]=n}return n},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.fs},n.prototype.getImageState=function(){return bo},n.prototype.getOrigin=function(){return this.ko},n.prototype.getPoints=function(){return this.Jt},n.prototype.getRadius=function(){return this.pa},n.prototype.getRadius2=function(){return this.ya},n.prototype.getSize=function(){return this.fs},n.prototype.getStroke=function(){return this.ma},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.xa=function(t,n,i){if(0===n||this.Jt===1/0||"bevel"!==t&&"miter"!==t)return n;var r=this.pa,e=void 0===this.ya?r:this.ya;if(r<e){var o=r;r=e,e=o}var s=void 0===this.ya?this.Jt:2*this.Jt,a=2*Math.PI/s,u=e*Math.sin(a),c=r-Math.sqrt(e*e-u*u),h=Math.sqrt(u*u+c*c),f=h/u;if("miter"===t&&f<=i)return f*n;var l=n/2/f,v=n/2*(c/h),d=Math.sqrt((r+l)*(r+l)+v*v)-r;if(void 0===this.ya||"bevel"===t)return 2*d;var p=r*Math.sin(a),y=e-Math.sqrt(r*r-p*p),m=Math.sqrt(p*p+y*y)/p;if(m<=i){var w=m*n/2-e-r;return 2*Math.max(d,w)}return 2*d},n.prototype.createRenderOptions=function(){var t,n=Ds,i=0,r=null,e=0,o=0;this.ma&&(null===(t=this.ma.getColor())&&(t=qs),t=ah(t),void 0===(o=this.ma.getWidth())&&(o=1),r=this.ma.getLineDash(),e=this.ma.getLineDashOffset(),void 0===(n=this.ma.getLineJoin())&&(n=Ds),void 0===(i=this.ma.getMiterLimit())&&(i=Us));var s=this.xa(n,o,i),a=Math.max(this.pa,this.ya||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:r,lineDashOffset:e,lineJoin:n,miterLimit:i}},n.prototype.render=function(){this.wa=this.createRenderOptions();var t=this.wa.size;this.Ut={},this.fs=[t,t]},n.prototype.ga=function(t,n,i){if(n.scale(i,i),n.translate(t.size/2,t.size/2),this.ja(n),this.da){var r=this.da.getColor();null===r&&(r=Fs),n.fillStyle=ah(r),n.fill()}this.ma&&(n.strokeStyle=t.strokeStyle,n.lineWidth=t.strokeWidth,n.setLineDash&&t.lineDash&&(n.setLineDash(t.lineDash),n.lineDashOffset=t.lineDashOffset),n.lineJoin=t.lineJoin,n.miterLimit=t.miterLimit,n.stroke())},n.prototype.ba=function(t){if(this.da){var n=this.da.getColor(),i=0;if("string"==typeof n&&(n=qo(n)),null===n?i=1:Array.isArray(n)&&(i=4===n.length?n[3]:1),0===i){var r=Oo(t.size,t.size);this.va=r.canvas,this.Sa(t,r)}}this.va||(this.va=this.getImage(1))},n.prototype.ja=function(t){var n=this.Jt,i=this.pa;if(n===1/0)t.arc(0,0,i,0,2*Math.PI);else{var r=void 0===this.ya?i:this.ya;void 0!==this.ya&&(n*=2);for(var e=this.Kt-Math.PI/2,o=2*Math.PI/n,s=0;s<n;s++){var a=e+s*o,u=s%2==0?i:r;t.lineTo(u*Math.cos(a),u*Math.sin(a))}t.closePath()}},n.prototype.Sa=function(t,n){n.translate(t.size/2,t.size/2),this.ja(n),n.fillStyle=Fs,n.fill(),this.ma&&(n.strokeStyle=t.strokeStyle,n.lineWidth=t.strokeWidth,t.lineDash&&(n.setLineDash(t.lineDash),n.lineDashOffset=t.lineDashOffset),n.lineJoin=t.lineJoin,n.miterLimit=t.miterLimit,n.stroke())},n}(_v),Ev=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Av=function(t){function n(n){var i=n||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Ev(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},n.prototype.setRadius=function(t){this.pa=t,this.render()},n}(Tv),Cv=function(){function t(t){var n=t||{};this.ka=void 0!==n.color?n.color:null}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0})},t.prototype.getColor=function(){return this.ka},t.prototype.setColor=function(t){this.ka=t},t}(),Rv="fraction",Pv="pixels",Iv="bottom-left",Nv="bottom-right",zv="top-left",Fv="top-right",Lv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gv=null,Dv=function(t){function n(n,i,r,e,o,s){var a=t.call(this)||this;return a.Ma=null,a.Nt=n||new Image,null!==e&&(a.Nt.crossOrigin=e),a.Ut={},a.ka=s,a.zt=null,a._a=o,a.fs=r,a.Pt=i,a.Oa,a}return Lv(n,t),n.prototype.Ta=function(){if(void 0===this.Oa&&this._a===bo){Gv||(Gv=Oo(1,1)),Gv.drawImage(this.Nt,0,0);try{Gv.getImageData(0,0,1,1),this.Oa=!1}catch(t){Gv=null,this.Oa=!0}}return!0===this.Oa},n.prototype.Ea=function(){this.dispatchEvent(N)},n.prototype.Lt=function(){this._a=go,this.Gt(),this.Ea()},n.prototype.Dt=function(){this._a=bo,this.fs?(this.Nt.width=this.fs[0],this.Nt.height=this.fs[1]):this.fs=[this.Nt.width,this.Nt.height],this.Gt(),this.Ea()},n.prototype.getImage=function(t){return this.Aa(t),this.Ut[t]?this.Ut[t]:this.Nt},n.prototype.getPixelRatio=function(t){return this.Aa(t),this.Ut[t]?t:1},n.prototype.getImageState=function(){return this._a},n.prototype.getHitDetectionImage=function(){if(!this.Ma)if(this.Ta()){var t=this.fs[0],n=this.fs[1],i=Oo(t,n);i.fillRect(0,0,t,n),this.Ma=i.canvas}else this.Ma=this.Nt;return this.Ma},n.prototype.getSize=function(){return this.fs},n.prototype.getSrc=function(){return this.Pt},n.prototype.load=function(){if(this._a==mo){this._a=wo;try{this.Nt.src=this.Pt}catch(t){this.Lt()}this.zt=So(this.Nt,this.Dt.bind(this),this.Lt.bind(this))}},n.prototype.Aa=function(t){if(this.ka&&!this.Ut[t]&&this._a===bo){var n=document.createElement("canvas");this.Ut[t]=n,n.width=Math.ceil(this.Nt.width*t),n.height=Math.ceil(this.Nt.height*t);var i=n.getContext("2d");if(i.scale(t,t),i.drawImage(this.Nt,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.Ta())i.fillStyle=Go(this.ka),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.Nt,0,0);else{for(var r=i.getImageData(0,0,n.width,n.height),e=r.data,o=this.ka[0]/255,s=this.ka[1]/255,a=this.ka[2]/255,u=this.ka[3],c=0,h=e.length;c<h;c+=4)e[c]*=o,e[c+1]*=s,e[c+2]*=a,e[c+3]*=u;i.putImageData(r,0,0)}}},n.prototype.Gt=function(){this.zt&&(this.zt(),this.zt=null)},n}(I);function Uv(t,n,i,r,e,o){var s=Ko.get(n,r,o);return s||(s=new Dv(t,n,i,r,e,o),Ko.set(n,r,o,s)),s}var qv=Dv,Bv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wv=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.opacity?r.opacity:1,s=void 0!==r.rotation?r.rotation:0,a=void 0!==r.scale?r.scale:1,u=void 0!==r.rotateWithView&&r.rotateWithView;(i=t.call(this,{opacity:e,rotation:s,scale:a,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:u})||this).je=void 0!==r.anchor?r.anchor:[.5,.5],i.Ca=null,i.Ra=void 0!==r.anchorOrigin?r.anchorOrigin:zv,i.Pa=void 0!==r.anchorXUnits?r.anchorXUnits:Rv,i.Ia=void 0!==r.anchorYUnits?r.anchorYUnits:Rv,i.Bt=void 0!==r.crossOrigin?r.crossOrigin:null;var c=void 0!==r.img?r.img:null;i.Na=r.imgSize;var h=r.src;Mt(!(void 0!==h&&c),4),Mt(!c||c&&i.Na,5),void 0!==h&&0!==h.length||!c||(h=c.src||o(c)),Mt(void 0!==h&&h.length>0,6);var f=void 0!==r.src?mo:bo;return i.ka=void 0!==r.color?qo(r.color):null,i.za=Uv(c,h,void 0!==i.Na?i.Na:null,i.Bt,f,i.ka),i.Fa=void 0!==r.offset?r.offset:[0,0],i.La=void 0!==r.offsetOrigin?r.offsetOrigin:zv,i.ko=null,i.fs=void 0!==r.size?r.size:null,i}return Bv(n,t),n.prototype.clone=function(){var t=this.getScale();return new n({anchor:this.je.slice(),anchorOrigin:this.Ra,anchorXUnits:this.Pa,anchorYUnits:this.Ia,color:this.ka&&this.ka.slice?this.ka.slice():this.ka||void 0,crossOrigin:this.Bt,imgSize:this.Na,offset:this.Fa.slice(),offsetOrigin:this.La,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.fs?this.fs.slice():void 0,src:this.getSrc()})},n.prototype.getAnchor=function(){var t=this.Ca;if(!t){t=this.je;var n=this.getSize();if(this.Pa==Rv||this.Ia==Rv){if(!n)return null;t=this.je.slice(),this.Pa==Rv&&(t[0]*=n[0]),this.Ia==Rv&&(t[1]*=n[1])}if(this.Ra!=zv){if(!n)return null;t===this.je&&(t=this.je.slice()),this.Ra!=Fv&&this.Ra!=Nv||(t[0]=-t[0]+n[0]),this.Ra!=Iv&&this.Ra!=Nv||(t[1]=-t[1]+n[1])}this.Ca=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},n.prototype.setAnchor=function(t){this.je=t,this.Ca=null},n.prototype.getColor=function(){return this.ka},n.prototype.getImage=function(t){return this.za.getImage(t)},n.prototype.getPixelRatio=function(t){return this.za.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.za.getSize()},n.prototype.getImageState=function(){return this.za.getImageState()},n.prototype.getHitDetectionImage=function(){return this.za.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this.ko)return this.ko;var t=this.Fa;if(this.La!=zv){var n=this.getSize(),i=this.za.getSize();if(!n||!i)return null;t=t.slice(),this.La!=Fv&&this.La!=Nv||(t[0]=i[0]-n[0]-t[0]),this.La!=Iv&&this.La!=Nv||(t[1]=i[1]-n[1]-t[1])}return this.ko=t,this.ko},n.prototype.getSrc=function(){return this.za.getSrc()},n.prototype.getSize=function(){return this.fs?this.fs:this.za.getSize()},n.prototype.listenImageChange=function(t){this.za.addEventListener(N,t)},n.prototype.load=function(){this.za.load()},n.prototype.unlistenImageChange=function(t){this.za.removeEventListener(N,t)},n}(_v),Vv=function(){function t(t){var n=t||{};this.ka=void 0!==n.color?n.color:null,this.Ga=n.lineCap,this.Da=void 0!==n.lineDash?n.lineDash:null,this.Ua=n.lineDashOffset,this.qa=n.lineJoin,this.Ba=n.miterLimit,this.Wa=n.width}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.ka},t.prototype.getLineCap=function(){return this.Ga},t.prototype.getLineDash=function(){return this.Da},t.prototype.getLineDashOffset=function(){return this.Ua},t.prototype.getLineJoin=function(){return this.qa},t.prototype.getMiterLimit=function(){return this.Ba},t.prototype.getWidth=function(){return this.Wa},t.prototype.setColor=function(t){this.ka=t},t.prototype.setLineCap=function(t){this.Ga=t},t.prototype.setLineDash=function(t){this.Da=t},t.prototype.setLineDashOffset=function(t){this.Ua=t},t.prototype.setLineJoin=function(t){this.qa=t},t.prototype.setMiterLimit=function(t){this.Ba=t},t.prototype.setWidth=function(t){this.Wa=t},t}();function Xv(t){return(Xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Hv=function(){function t(t){var n=t||{};this.$r=null,this.Va=$v,void 0!==n.geometry&&this.setGeometry(n.geometry),this.da=void 0!==n.fill?n.fill:null,this.Nt=void 0!==n.image?n.image:null,this.cn=void 0!==n.renderer?n.renderer:null,this.Xa=void 0!==n.hitDetectionRenderer?n.hitDetectionRenderer:null,this.ma=void 0!==n.stroke?n.stroke:null,this.oo=void 0!==n.text?n.text:null,this.Ha=n.zIndex}return t.prototype.clone=function(){var n=this.getGeometry();return n&&"object"===Xv(n)&&(n=n.clone()),new t({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.cn},t.prototype.setRenderer=function(t){this.cn=t},t.prototype.setHitDetectionRenderer=function(t){this.Xa=t},t.prototype.getHitDetectionRenderer=function(){return this.Xa},t.prototype.getGeometry=function(){return this.$r},t.prototype.getGeometryFunction=function(){return this.Va},t.prototype.getFill=function(){return this.da},t.prototype.setFill=function(t){this.da=t},t.prototype.getImage=function(){return this.Nt},t.prototype.setImage=function(t){this.Nt=t},t.prototype.getStroke=function(){return this.ma},t.prototype.setStroke=function(t){this.ma=t},t.prototype.getText=function(){return this.oo},t.prototype.setText=function(t){this.oo=t},t.prototype.getZIndex=function(){return this.Ha},t.prototype.setGeometry=function(t){"function"==typeof t?this.Va=t:"string"==typeof t?this.Va=function(n){return n.get(t)}:t?void 0!==t&&(this.Va=function(){return t}):this.Va=$v,this.$r=t},t.prototype.setZIndex=function(t){this.Ha=t},t}();function Jv(t){var n;if("function"==typeof t)n=t;else{var i;if(Array.isArray(t))i=t;else Mt("function"==typeof t.getZIndex,41),i=[t];n=function(){return i}}return n}var Kv=null;function Yv(t,n){if(!Kv){var i=new Cv({color:"rgba(255,255,255,0.4)"}),r=new Vv({color:"#3399CC",width:1.25});Kv=[new Hv({image:new Av({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return Kv}function Zv(){var t={},n=[255,255,255,1],i=[0,153,255,1];return t[Pt.POLYGON]=[new Hv({fill:new Cv({color:[255,255,255,.5]})})],t[Pt.MULTI_POLYGON]=t[Pt.POLYGON],t[Pt.LINE_STRING]=[new Hv({stroke:new Vv({color:n,width:5})}),new Hv({stroke:new Vv({color:i,width:3})})],t[Pt.MULTI_LINE_STRING]=t[Pt.LINE_STRING],t[Pt.CIRCLE]=t[Pt.POLYGON].concat(t[Pt.LINE_STRING]),t[Pt.POINT]=[new Hv({image:new Av({radius:6,fill:new Cv({color:i}),stroke:new Vv({color:n,width:1.5})}),zIndex:1/0})],t[Pt.MULTI_POINT]=t[Pt.POINT],t[Pt.GEOMETRY_COLLECTION]=t[Pt.POLYGON].concat(t[Pt.LINE_STRING],t[Pt.POINT]),t}function $v(t){return t.getGeometry()}var Qv=Hv,td="point",nd="line",id=function(){function t(t){var n=t||{};this.Ja=n.font,this.Dr=n.rotation,this.ca=n.rotateWithView,this.ha=n.scale,this.fa=uu(void 0!==n.scale?n.scale:1),this.oo=n.text,this.Ka=n.textAlign,this.Ya=n.textBaseline,this.da=void 0!==n.fill?n.fill:new Cv({color:"#333"}),this.Za=void 0!==n.maxAngle?n.maxAngle:Math.PI/4,this.$a=void 0!==n.placement?n.placement:td,this.Qa=!!n.overflow,this.ma=void 0!==n.stroke?n.stroke:null,this.tu=void 0!==n.offsetX?n.offsetX:0,this.nu=void 0!==n.offsetY?n.offsetY:0,this.iu=n.backgroundFill?n.backgroundFill:null,this.ru=n.backgroundStroke?n.backgroundStroke:null,this.Ei=void 0===n.padding?null:n.padding}return t.prototype.clone=function(){var n=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.Qa},t.prototype.getFont=function(){return this.Ja},t.prototype.getMaxAngle=function(){return this.Za},t.prototype.getPlacement=function(){return this.$a},t.prototype.getOffsetX=function(){return this.tu},t.prototype.getOffsetY=function(){return this.nu},t.prototype.getFill=function(){return this.da},t.prototype.getRotateWithView=function(){return this.ca},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.ha},t.prototype.getScaleArray=function(){return this.fa},t.prototype.getStroke=function(){return this.ma},t.prototype.getText=function(){return this.oo},t.prototype.getTextAlign=function(){return this.Ka},t.prototype.getTextBaseline=function(){return this.Ya},t.prototype.getBackgroundFill=function(){return this.iu},t.prototype.getBackgroundStroke=function(){return this.ru},t.prototype.getPadding=function(){return this.Ei},t.prototype.setOverflow=function(t){this.Qa=t},t.prototype.setFont=function(t){this.Ja=t},t.prototype.setMaxAngle=function(t){this.Za=t},t.prototype.setOffsetX=function(t){this.tu=t},t.prototype.setOffsetY=function(t){this.nu=t},t.prototype.setPlacement=function(t){this.$a=t},t.prototype.setRotateWithView=function(t){this.ca=t},t.prototype.setFill=function(t){this.da=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.ha=t,this.fa=uu(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.ma=t},t.prototype.setText=function(t){this.oo=t},t.prototype.setTextAlign=function(t){this.Ka=t},t.prototype.setTextBaseline=function(t){this.Ya=t},t.prototype.setBackgroundFill=function(t){this.iu=t},t.prototype.setBackgroundStroke=function(t){this.ru=t},t.prototype.setPadding=function(t){this.Ei=t},t}(),rd=function(){function t(t){this.eu,this.ou,this.su,this.au=void 0===t||t,this.uu=0}return t.prototype.insertItem=function(t){var n={prev:void 0,next:void 0,data:t},i=this.su;if(i){var r=i.next;n.prev=i,n.next=r,i.next=n,r&&(r.prev=n),i===this.ou&&(this.ou=n)}else this.eu=n,this.ou=n,this.au&&(n.next=n,n.prev=n);this.su=n,this.uu++},t.prototype.removeItem=function(){var t=this.su;if(t){var n=t.next,i=t.prev;n&&(n.prev=i),i&&(i.next=n),this.su=n||i,this.eu===this.ou?(this.su=void 0,this.eu=void 0,this.ou=void 0):this.eu===t?this.eu=this.su:this.ou===t&&(this.ou=i?this.su.prev:this.su),this.uu--}},t.prototype.firstItem=function(){if(this.su=this.eu,this.su)return this.su.data},t.prototype.lastItem=function(){if(this.su=this.ou,this.su)return this.su.data},t.prototype.nextItem=function(){if(this.su&&this.su.next)return this.su=this.su.next,this.su.data},t.prototype.getNextItem=function(){if(this.su&&this.su.next)return this.su.next.data},t.prototype.prevItem=function(){if(this.su&&this.su.prev)return this.su=this.su.prev,this.su.data},t.prototype.getPrevItem=function(){if(this.su&&this.su.prev)return this.su.prev.data},t.prototype.getCurrItem=function(){if(this.su)return this.su.data},t.prototype.setFirstItem=function(){this.au&&this.su&&(this.eu=this.su,this.ou=this.su.prev)},t.prototype.concat=function(t){if(t.su){if(this.su){var n=this.su.next;this.su.next=t.eu,t.eu.prev=this.su,n.prev=t.ou,t.ou.next=n,this.uu+=t.uu}else this.su=t.su,this.eu=t.eu,this.ou=t.ou,this.uu=t.uu;t.su=void 0,t.eu=void 0,t.ou=void 0,t.uu=0}},t.prototype.getLength=function(){return this.uu},t}(),ed=i(72),od=function(){function t(t){this.cu=new ed(t),this.hu={}}return t.prototype.insert=function(t,n){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:n};this.cu.insert(i),this.hu[o(n)]=i},t.prototype.load=function(t,n){for(var i=new Array(n.length),r=0,e=n.length;r<e;r++){var s=t[r],a=n[r],u={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:a};i[r]=u,this.hu[o(a)]=u}this.cu.load(i)},t.prototype.remove=function(t){var n=o(t),i=this.hu[n];return delete this.hu[n],null!==this.cu.remove(i)},t.prototype.update=function(t,n){var i=this.hu[o(n)];Nn([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(n),this.insert(t,n))},t.prototype.getAll=function(){return this.cu.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.cu.search(n).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.fu(this.getAll(),t)},t.prototype.forEachInExtent=function(t,n){return this.fu(this.getInExtent(t),n)},t.prototype.fu=function(t,n){for(var i,r=0,e=t.length;r<e;r++)if(i=n(t[r]))return i;return i},t.prototype.isEmpty=function(){return R(this.hu)},t.prototype.clear=function(){this.cu.clear(),this.hu={}},t.prototype.getExtent=function(t){var n=this.cu.toJSON();return Cn(n.minX,n.minY,n.maxX,n.maxY,t)},t.prototype.concat=function(t){for(var n in this.cu.load(t.cu.all()),t.hu)this.hu[n]=t.hu[n]},t}(),sd="tileloadstart",ad="tileloadend",ud="tileloaderror",cd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function hd(t){return t?Array.isArray(t)?function(n){return t}:"function"==typeof t?t:function(n){return[t]}:null}var fd=function(t){function n(n){var i=t.call(this)||this;i.projection=gr(n.projection),i.lu=hd(n.attributions),i.vu=void 0===n.attributionsCollapsible||n.attributionsCollapsible,i.loading=!1,i.rn=void 0!==n.state?n.state:ys,i.du=void 0!==n.wrapX&&n.wrapX,i.pu=!!n.interpolate,i.viewResolver=null,i.viewRejector=null;var r=i;return i.yu=new Promise((function(t,n){r.viewResolver=t,r.viewRejector=n})),i}return cd(n,t),n.prototype.getAttributions=function(){return this.lu},n.prototype.getAttributionsCollapsible=function(){return this.vu},n.prototype.getProjection=function(){return this.projection},n.prototype.getResolutions=function(){return r()},n.prototype.getView=function(){return this.yu},n.prototype.getState=function(){return this.rn},n.prototype.getWrapX=function(){return this.du},n.prototype.getInterpolate=function(){return this.pu},n.prototype.refresh=function(){this.changed()},n.prototype.setAttributions=function(t){this.lu=hd(t),this.changed()},n.prototype.setState=function(t){this.rn=t,this.changed()},n}(ot),ld=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vd=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:n.projection,state:n.state,wrapX:n.wrapX,interpolate:n.interpolate})||this;i.on,i.once,i.un,i.mu=void 0!==n.opaque&&n.opaque,i.Gs=void 0!==n.tilePixelRatio?n.tilePixelRatio:1,i.tileGrid=void 0!==n.tileGrid?n.tileGrid:null;return i.tileGrid&&uu(i.tileGrid.getTileSize(i.tileGrid.getMinZoom()),[256,256]),i.tileCache=new $c(n.cacheSize||0),i.tmpSize=[0,0],i.Pe=n.key||"",i.tileOptions={transition:n.transition,interpolate:n.interpolate},i.zDirection=n.zDirection?n.zDirection:0,i}return ld(n,t),n.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);i&&i.expireCache(n)},n.prototype.forEachLoadedTile=function(t,n,i,r){var e=this.getTileCacheForProjection(t);if(!e)return!1;for(var o,s,a,u=!0,c=i.minX;c<=i.maxX;++c)for(var h=i.minY;h<=i.maxY;++h)s=Vc(n,c,h),a=!1,e.containsKey(s)&&(a=(o=e.get(s)).getState()===dt)&&(a=!1!==r(o)),a||(u=!1);return u},n.prototype.getGutterForProjection=function(t){return 0},n.prototype.getKey=function(){return this.Pe},n.prototype.setKey=function(t){this.Pe!==t&&(this.Pe=t,this.changed())},n.prototype.getOpaque=function(t){return this.mu},n.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},n.prototype.getTile=function(t,n,i,e,o){return r()},n.prototype.getTileGrid=function(){return this.tileGrid},n.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Kh(t)},n.prototype.getTileCacheForProjection=function(t){return Mt(Tr(this.getProjection(),t),68),this.tileCache},n.prototype.getTilePixelRatio=function(t){return this.Gs},n.prototype.getTilePixelSize=function(t,n,i){var r=this.getTileGridForProjection(i),e=this.getTilePixelRatio(n),o=uu(r.getTileSize(t),this.tmpSize);return 1==e?o:au(o,e,this.tmpSize)},n.prototype.getTileCoordForTileUrlFunction=function(t,n){var i=void 0!==n?n:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=Yh(r,t,i)),Yc(t,r)?t:null},n.prototype.clear=function(){this.tileCache.clear()},n.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},n.prototype.updateCacheSize=function(t,n){var i=this.getTileCacheForProjection(n);t>i.highWaterMark&&(i.highWaterMark=t)},n.prototype.useTile=function(t,n,i,r){},n}(fd),dd=function(t){function n(n,i){var r=t.call(this,n)||this;return r.tile=i,r}return ld(n,t),n}(f),pd=vd,yd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),md=function(t){function n(i){var r=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,interpolate:i.interpolate,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return r.wu=r.tileUrlFunction===n.prototype.tileUrlFunction,r.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(r.tileUrlFunction=i.tileUrlFunction),r.urls=null,i.urls?r.setUrls(i.urls):i.url&&r.setUrl(i.url),r.bu={},r}return yd(n,t),n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var n,i=t.target,r=o(i),e=i.getState();e==vt?(this.bu[r]=!0,n=sd):r in this.bu&&(delete this.bu[r],n=e==pt?ud:e==dt?ad:void 0),null!=n&&this.dispatchEvent(new dd(n,i))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,n){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==n?this.setKey(n):this.changed()},n.prototype.setUrl=function(t){var n=af(t);this.urls=n,this.setUrls(n)},n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.wu?this.setTileUrlFunction(ef(t,this.tileGrid),n):this.setKey(n)},n.prototype.tileUrlFunction=function(t,n,i){},n.prototype.useTile=function(t,n,i){var r=Vc(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(pd),wd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function bd(t,n){t.getImage().src=n}var gd=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:bd,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,interpolate:r,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).crossOrigin=void 0!==n.crossOrigin?n.crossOrigin:null,i.tileClass=void 0!==n.tileClass?n.tileClass:No,i.tileCacheForProjection={},i.tileGridForProjection={},i.gu=n.reprojectionErrorThreshold,i.xu=!1,i}return wd(n,t),n.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?n:{}),this.tileCacheForProjection){var e=this.tileCacheForProjection[r];e.expireCache(e==i?n:{})}},n.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Tr(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){var n=t.prototype.getKey.call(this);return this.getInterpolate()||(n+=":disable-interpolation"),n},n.prototype.getOpaque=function(n){return!(this.getProjection()&&n&&!Tr(this.getProjection(),n))&&t.prototype.getOpaque.call(this,n)},n.prototype.getTileGridForProjection=function(t){var n=this.getProjection();if(!this.tileGrid||n&&!Tr(n,t)){var i=o(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Kh(t)),this.tileGridForProjection[i]}return this.tileGrid},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();if(!n||Tr(n,t))return this.tileCache;var i=o(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new $c(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},n.prototype.ju=function(t,n,i,r,e,o){var s=[t,n,i],a=this.getTileCoordForTileUrlFunction(s,e),u=a?this.tileUrlFunction(a,r,e):void 0,c=new this.tileClass(s,void 0!==u?lt:yt,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(N,this.handleTileChange.bind(this)),c},n.prototype.getTile=function(t,n,i,r,e){var o=this.getProjection();if(o&&e&&!Tr(o,e)){var s=this.getTileCacheForProjection(e),a=[t,n,i],u=void 0,c=Xc(a);s.containsKey(c)&&(u=s.get(c));var h=this.getKey();if(u&&u.key==h)return u;var f=this.getTileGridForProjection(o),l=this.getTileGridForProjection(e),v=this.getTileCoordForTileUrlFunction(a,e),d=new ml(o,f,e,l,a,v,this.getTilePixelRatio(r),this.getGutter(),function(t,n,i,r){return this.getTileInternal(t,n,i,r,o)}.bind(this),this.gu,this.xu,this.getInterpolate());return d.key=h,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(c,d)):s.set(c,d),d}return this.getTileInternal(t,n,i,r,o||e)},n.prototype.getTileInternal=function(t,n,i,r,e){var o=null,s=Vc(t,n,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.ju(t,n,i,r,e,a),u.getState()==lt?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.ju(t,n,i,r,e,a),this.tileCache.set(s,o);return o},n.prototype.setRenderReprojectionEdges=function(t){if(this.xu!=t){for(var n in this.xu=t,this.tileCacheForProjection)this.tileCacheForProjection[n].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,n){var i=gr(t);if(i){var r=o(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}},n}(md),xd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function jd(t){var n,i,r=t[0],e=new Array(r),o=1<<r-1;for(n=0;n<r;++n)i=48,t[1]&o&&(i+=1),t[2]&o&&(i+=2),e[n]=String.fromCharCode(i),o>>=1;return e.join("")}for(var Sd=function(t){function n(n){var i=this,r=void 0!==n.hidpi&&n.hidpi,e=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(e=n.interpolate),(i=t.call(this,{cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:e,opaque:!0,projection:gr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:ps,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Su=r,i.ku=void 0!==n.culture?n.culture:"en-us",i.Mu=void 0!==n.maxZoom?n.maxZoom:-1,i._u=n.key,i.Ou=n.imagerySet,mh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.Ou+"?uriScheme=https&include=ImageryProviders&key="+i._u+"&c="+i.ku,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return xd(n,t),n.prototype.getApiKey=function(){return this._u},n.prototype.getImagerySet=function(){return this.Ou},n.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var n=t.resourceSets[0].resources[0],i=-1==this.Mu?n.zoomMax:this.Mu,r=nf(this.getProjection()),e=this.Su?2:1,o=n.imageWidth==n.imageHeight?n.imageWidth/e:[n.imageWidth/e,n.imageHeight/e],s=$h({extent:r,minZoom:n.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=s;var a=this.ku,u=this.Su;if(this.tileUrlFunction=of(n.imageUrlSubdomains.map((function(t){var i=[0,0,0],r=n.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,n,e){if(t){Wc(t[0],t[1],t[2],i);var o=r;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",jd(i))}}}))),n.imageryProviders){var c=Er(gr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,e=this.getTileGrid(),o=e.getZForResolution(r.resolution,this.zDirection),s=e.getTileCoordForCoordAndZ(r.center,o)[0];return n.imageryProviders.map((function(n){for(var r=!1,e=n.coverageAreas,o=0,a=e.length;o<a;++o){var u=e[o];if(s>=u.zoomMin&&s<=u.zoomMax){var h=u.bbox;if(ni(si([h[1],h[0],h[3],h[2]],c),t.extent)){r=!0;break}}}r&&i.push(n.attribution)})),i.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),i}.bind(this))}this.setState(ys)}else this.setState(ms)},n}(gd),kd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Md=function(t){function n(n){var i=n||{},r=void 0===i.imageSmoothing||i.imageSmoothing;void 0!==i.interpolate&&(r=i.interpolate);var e=void 0!==i.projection?i.projection:"EPSG:3857",o=void 0!==i.tileGrid?i.tileGrid:$h({extent:nf(e),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,interpolate:r,opaque:i.opaque,projection:e,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:o,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 kd(n,t),n}(gd),_d=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Od=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,maxZoom:void 0!==n.maxZoom?n.maxZoom:18,minZoom:n.minZoom,projection:n.projection,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection})||this;return i.Tu=n.account,i.Eu=n.map||"",i.Au=n.config||{},i.Cu={},i.Ru(),i}return _d(n,t),n.prototype.getConfig=function(){return this.Au},n.prototype.updateConfig=function(t){E(this.Au,t),this.Ru()},n.prototype.setConfig=function(t){this.Au=t||{},this.Ru()},n.prototype.Ru=function(){var t=JSON.stringify(this.Au);if(this.Cu[t])this.Pu(this.Cu[t]);else{var n="https://"+this.Tu+".carto.com/api/v1/map";this.Eu&&(n+="/named/"+this.Eu);var i=new XMLHttpRequest;i.addEventListener("load",this.Iu.bind(this,t)),i.addEventListener("error",this.Nu.bind(this)),i.open("POST",n),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.Au))}},n.prototype.Iu=function(t,n){var i=n.target;if(!i.status||i.status>=200&&i.status<300){var r=void 0;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState(ms)}this.Pu(r),this.Cu[t]=r,this.setState(ys)}else this.setState(ms)},n.prototype.Nu=function(t){this.setState(ms)},n.prototype.Pu=function(t){var n="https://"+t.cdn_url.https+"/"+this.Tu+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(n)},n}(Md),Td="addfeature",Ed="changefeature",Ad="clear",Cd="removefeature",Rd="featuresloadstart",Pd="featuresloadend",Id="featuresloaderror",Nd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zd=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.feature=i,e.features=r,e}return Nd(n,t),n}(f),Fd=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:ys,wrapX:void 0===r.wrapX||r.wrapX})||this).on,i.once,i.un,i.q=_,i.Fe=r.format,i.zu=void 0===r.overlaps||r.overlaps,i.Ge=r.url,void 0!==r.loader?i.q=r.loader:void 0!==i.Ge&&(Mt(i.Fe,7),i.q=dh(i.Ge,i.Fe)),i.Fu=void 0!==r.strategy?r.strategy:ph;var e,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.Lu=s?new od:null,i.Gu=new od,i.Du=0,i.Uu={},i.qu={},i.Bu={},i.Wu={},i.Vu=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(e=r.features).getArray()),s||void 0!==e||(e=new ft(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==e&&i.Xu(e),i}return Nd(n,t),n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var n=o(t);if(this.Hu(n,t)){this.Ju(n,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.Lu&&this.Lu.insert(r,t)}else this.Uu[n]=t;this.dispatchEvent(new zd(Td,t))}else this.Vu&&this.Vu.remove(t)},n.prototype.Ju=function(t,n){this.Wu[t]=[Y(n,N,this.Ku,this),Y(n,l,this.Ku,this)]},n.prototype.Hu=function(t,n){var i=!0,r=n.getId();return void 0!==r&&(r.toString()in this.qu?i=!1:this.qu[r.toString()]=n),i&&(Mt(!(t in this.Bu),30),this.Bu[t]=n),i},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var n=[],i=[],r=[],e=0,s=t.length;e<s;e++){var a=o(c=t[e]);this.Hu(a,c)&&i.push(c)}e=0;for(var u=i.length;e<u;e++){var c;a=o(c=i[e]);this.Ju(a,c);var h=c.getGeometry();if(h){var f=h.getExtent();n.push(f),r.push(c)}else this.Uu[a]=c}if(this.Lu&&this.Lu.load(n,r),this.hasListener(Td)){e=0;for(var l=i.length;e<l;e++)this.dispatchEvent(new zd(Td,i[e]))}},n.prototype.Xu=function(t){var n=!1;this.addEventListener(Td,(function(i){n||(n=!0,t.push(i.feature),n=!1)})),this.addEventListener(Cd,(function(i){n||(n=!0,t.remove(i.feature),n=!1)})),t.addEventListener(st,function(t){n||(n=!0,this.addFeature(t.element),n=!1)}.bind(this)),t.addEventListener(at,function(t){n||(n=!0,this.removeFeature(t.element),n=!1)}.bind(this)),this.Vu=t},n.prototype.clear=function(t){if(t){for(var n in this.Wu){this.Wu[n].forEach($)}this.Vu||(this.Wu={},this.qu={},this.Bu={})}else if(this.Lu){var i=function(t){this.removeFeatureInternal(t)}.bind(this);for(var r in this.Lu.forEach(i),this.Uu)this.removeFeatureInternal(this.Uu[r])}this.Vu&&this.Vu.clear(),this.Lu&&this.Lu.clear(),this.Uu={};var e=new zd(Ad);this.dispatchEvent(e),this.changed()},n.prototype.forEachFeature=function(t){if(this.Lu)return this.Lu.forEach(t);this.Vu&&this.Vu.forEach(t)},n.prototype.forEachFeatureAtCoordinateDirect=function(t,n){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?n(i):void 0}))},n.prototype.forEachFeatureInExtent=function(t,n){if(this.Lu)return this.Lu.forEachInExtent(t,n);this.Vu&&this.Vu.forEach(n)},n.prototype.forEachFeatureIntersectingExtent=function(t,n){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var r=n(i);if(r)return r}}))},n.prototype.getFeaturesCollection=function(){return this.Vu},n.prototype.getFeatures=function(){var t;return this.Vu?t=this.Vu.getArray().slice(0):this.Lu&&(t=this.Lu.getAll(),R(this.Uu)||b(t,C(this.Uu))),t},n.prototype.getFeaturesAtCoordinate=function(t){var n=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){n.push(t)})),n},n.prototype.getFeaturesInExtent=function(t){return this.Lu?this.Lu.getInExtent(t):this.Vu?this.Vu.getArray().slice(0):[]},n.prototype.getClosestFeatureToCoordinate=function(t,n){var i=t[0],r=t[1],e=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],u=n||k;return this.Lu.forEachInExtent(a,(function(t){if(u(t)){var n=t.getGeometry(),c=s;if((s=n.closestPointXY(i,r,o,s))<c){e=t;var h=Math.sqrt(s);a[0]=i-h,a[1]=r-h,a[2]=i+h,a[3]=r+h}}})),e},n.prototype.getExtent=function(t){return this.Lu.getExtent(t)},n.prototype.getFeatureById=function(t){var n=this.qu[t.toString()];return void 0!==n?n:null},n.prototype.getFeatureByUid=function(t){var n=this.Bu[t];return void 0!==n?n:null},n.prototype.getFormat=function(){return this.Fe},n.prototype.getOverlaps=function(){return this.zu},n.prototype.getUrl=function(){return this.Ge},n.prototype.Ku=function(t){var n=t.target,i=o(n),r=n.getGeometry();if(r){var e=r.getExtent();i in this.Uu?(delete this.Uu[i],this.Lu&&this.Lu.insert(e,n)):this.Lu&&this.Lu.update(e,n)}else i in this.Uu||(this.Lu&&this.Lu.remove(n),this.Uu[i]=n);var s=n.getId();if(void 0!==s){var a=s.toString();this.qu[a]!==n&&(this.Yu(n),this.qu[a]=n)}else this.Yu(n),this.Bu[i]=n;this.changed(),this.dispatchEvent(new zd(Ed,n))},n.prototype.hasFeature=function(t){var n=t.getId();return void 0!==n?n in this.qu:o(t)in this.Bu},n.prototype.isEmpty=function(){return this.Lu?this.Lu.isEmpty()&&R(this.Uu):!this.Vu||0===this.Vu.getLength()},n.prototype.loadFeatures=function(t,n,i){for(var r=this.Gu,e=this.Fu(t,n,i),o=function(t,o){var a=e[t];r.forEachInExtent(a,(function(t){return On(t.extent,a)}))||(++s.Du,s.dispatchEvent(new zd(Rd)),s.q.call(s,a,n,i,function(t){--this.Du,this.dispatchEvent(new zd(Pd,void 0,t))}.bind(s),function(){--this.Du,this.dispatchEvent(new zd(Id))}.bind(s)),r.insert(a,{extent:a.slice()}))},s=this,a=0,u=e.length;a<u;++a)o(a);this.loading=!(this.q.length<4)&&this.Du>0},n.prototype.refresh=function(){this.clear(!0),this.Gu.clear(),t.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var n,i=this.Gu;i.forEachInExtent(t,(function(i){if(Nn(i.extent,t))return n=i,!0})),n&&i.remove(n)},n.prototype.removeFeature=function(t){if(t){var n=o(t);n in this.Uu?delete this.Uu[n]:this.Lu&&this.Lu.remove(t),this.removeFeatureInternal(t)&&this.changed()}},n.prototype.removeFeatureInternal=function(t){var n=o(t),i=this.Wu[n];if(i){i.forEach($),delete this.Wu[n];var r=t.getId();return void 0!==r&&delete this.qu[r.toString()],delete this.Bu[n],this.dispatchEvent(new zd(Cd,t)),t}},n.prototype.Yu=function(t){var n=!1;for(var i in this.qu)if(this.qu[i]===t){delete this.qu[i],n=!0;break}return n},n.prototype.setLoader=function(t){this.q=t},n.prototype.setUrl=function(t){Mt(this.Fe,7),this.Ge=t,this.setLoader(dh(t,this.Fe))},n}(fd),Ld=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gd=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,wrapX:n.wrapX})||this;return i.resolution=void 0,i.distance=void 0!==n.distance?n.distance:20,i.minDistance=n.minDistance||0,i.interpolationRatio=0,i.features=[],i.geometryFunction=n.geometryFunction||function(t){var n=t.getGeometry();return Mt(n.getType()==Pt.POINT,10),n},i.Zu=n.createCluster,i.source=null,i.$u=i.refresh.bind(i),i.updateDistance(i.distance,i.minDistance),i.setSource(n.source||null),i}return Ld(n,t),n.prototype.clear=function(n){this.features.length=0,t.prototype.clear.call(this,n)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,n,i){this.source.loadFeatures(t,n,i),n!==this.resolution&&(this.resolution=n,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(N,this.$u),this.source=t,t&&t.addEventListener(N,this.$u),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,n){var i=0===t?0:Math.min(n,t)/t,r=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=n,this.interpolationRatio=i,r&&this.refresh()},n.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],n=this.distance*this.resolution,i=this.source.getFeatures(),r={},e=0,s=i.length;e<s;e++){var a=i[e];if(!(o(a)in r)){var u=this.geometryFunction(a);if(u){Pn(u.getCoordinates(),t),Sn(t,n,t);var c=this.source.getFeaturesInExtent(t).filter((function(t){var n=o(t);return!(n in r)&&(r[n]=!0,!0)}));this.features.push(this.createCluster(c,t))}}}},n.prototype.createCluster=function(t,n){for(var i=[0,0],r=t.length-1;r>=0;--r){var e=this.geometryFunction(t[r]);e?Ki(i,e.getCoordinates()):t.splice(r,1)}ir(i,1/t.length);var o=Hn(n),s=this.interpolationRatio,a=new Te([i[0]*(1-s)+o[0]*s,i[1]*(1-s)+o[1]*s]);return this.Zu?this.Zu(a,t):new Tt({geometry:a,features:t})},n}(Fd),Dd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ud=function(t){function n(n){var i=this,r=void 0===n.projection?"EPSG:3857":n.projection,e=n.tileGrid;return void 0===e&&r&&(e=$h({extent:nf(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize})),(i=t.call(this,{cacheSize:.1,attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:r,tileGrid:e,opaque:n.opaque,state:n.state,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate})||this).bu={},i.q=n.loader,i.hr=i.hr.bind(i),i.bandCount=void 0===n.bandCount?4:n.bandCount,i}return Dd(n,t),n.prototype.setLoader=function(t){this.q=t},n.prototype.getTile=function(t,n,i,r,e){var o=Vc(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=this.q;var a=new kt(E({tileCoord:[t,n,i],loader:function(){return T((function(){return s(t,n,i)}))}},this.tileOptions));return a.key=this.getKey(),a.addEventListener(N,this.hr),this.tileCache.set(o,a),a},n.prototype.hr=function(t){var n,i=t.target,r=o(i),e=i.getState();e==vt?(this.bu[r]=!0,n=sd):r in this.bu&&(delete this.bu[r],n=e==pt?ud:e==dt?ad:void 0),n&&this.dispatchEvent(new dd(n,i))},n}(pd),qd=new ArrayBuffer(4),Bd=new Float32Array(qd),Wd=new Uint32Array(qd),Vd=new Uint32Array(512),Xd=new Uint32Array(512),Hd=0;Hd<256;++Hd){var Jd=Hd-127;Jd<-27?(Vd[Hd]=0,Vd[256|Hd]=32768,Xd[Hd]=24,Xd[256|Hd]=24):Jd<-14?(Vd[Hd]=1024>>-Jd-14,Vd[256|Hd]=1024>>-Jd-14|32768,Xd[Hd]=-Jd-1,Xd[256|Hd]=-Jd-1):Jd<=15?(Vd[Hd]=Jd+15<<10,Vd[256|Hd]=Jd+15<<10|32768,Xd[Hd]=13,Xd[256|Hd]=13):Jd<128?(Vd[Hd]=31744,Vd[256|Hd]=64512,Xd[Hd]=24,Xd[256|Hd]=24):(Vd[Hd]=31744,Vd[256|Hd]=64512,Xd[Hd]=13,Xd[256|Hd]=13)}var Kd=new Uint32Array(2048),Yd=new Uint32Array(64),Zd=new Uint32Array(64);Kd[0]=0;for(var $d=1;$d<1024;++$d){for(var Qd=$d<<13,tp=0;0==(8388608&Qd);)tp-=8388608,Qd<<=1;Qd&=-8388609,tp+=947912704,Kd[$d]=Qd|tp}for(var np=1024;np<2048;++np)Kd[np]=939524096+(np-1024<<13);Yd[0]=0;for(var ip=1;ip<31;++ip)Yd[ip]=ip<<23;Yd[31]=1199570944,Yd[32]=2147483648;for(var rp=33;rp<63;++rp)Yd[rp]=2147483648+(rp-32<<23);Yd[63]=3347054592,Zd[0]=0;for(var ep=1;ep<64;++ep)Zd[ep]=32===ep?0:1024;function op(t){var n=t>>10;return Wd[0]=Kd[Zd[n]+(1023&t)]+Yd[n],Bd[0]}var sp=Reflect.getPrototypeOf(Uint8Array).prototype,ap=Reflect.getOwnPropertyDescriptor(sp,Symbol.toStringTag).get;function up(t){return void 0!==ap.call(t)}var cp=Object.prototype.toString;function hp(t){return!!ArrayBuffer.isView(t)&&(!up(t)&&"[object DataView]"===cp.call(t))}function fp(t,n){if(!hp(t))throw new TypeError("First argument to getFloat16 function must be a DataView");for(var i=arguments.length,r=new Array(i>2?i-2:0),e=2;e<i;e++)r[e-2]=arguments[e];return op(t.getUint16.apply(t,[n].concat(r)))}var lp=i(802),vp=i(51),dp=i(150);function pp(t,n){for(var i,r=t.width,e=t.height,o=new Uint8Array(r*e*3),s=0,a=0;s<t.length;++s,a+=3)i=256-t[s]/n*256,o[a]=i,o[a+1]=i,o[a+2]=i;return o}function yp(t,n){for(var i,r=t.width,e=t.height,o=new Uint8Array(r*e*3),s=0,a=0;s<t.length;++s,a+=3)i=t[s]/n*256,o[a]=i,o[a+1]=i,o[a+2]=i;return o}function mp(t,n){for(var i=t.width,r=t.height,e=new Uint8Array(i*r*3),o=n.length/3,s=n.length/3*2,a=0,u=0;a<t.length;++a,u+=3){var c=t[a];e[u]=n[c]/65536*256,e[u+1]=n[c+o]/65536*256,e[u+2]=n[c+s]/65536*256}return e}function wp(t){for(var n=t.width,i=t.height,r=new Uint8Array(n*i*3),e=0,o=0;e<t.length;e+=4,o+=3){var s=t[e],a=t[e+1],u=t[e+2],c=t[e+3];r[o]=(255-s)/256*255*((255-c)/256),r[o+1]=(255-a)/256*255*((255-c)/256),r[o+2]=(255-u)/256*255*((255-c)/256)}return r}function bp(t){for(var n=t.width,i=t.height,r=new Uint8ClampedArray(n*i*3),e=0,o=0;e<t.length;e+=3,o+=3){var s=t[e],a=t[e+1],u=t[e+2];r[o]=s+1.402*(u-128),r[o+1]=s-.34414*(a-128)-.71414*(u-128),r[o+2]=s+1.772*(a-128)}return r}function gp(t){for(var n=t.width,i=t.height,r=new Uint8Array(n*i*3),e=0,o=0;e<t.length;e+=3,o+=3){var s=(t[e+0]+16)/116,a=(t[e+1]<<24>>24)/500+s,u=s-(t[e+2]<<24>>24)/200,c=void 0,h=void 0,f=void 0;h=-.9689*(a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+1.8758*(s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+.0415*(u=1.08883*(u*u*u>.008856?u*u*u:(u-16/116)/7.787)),f=.0557*a+-.204*s+1.057*u,c=(c=3.2406*a+-1.5372*s+-.4986*u)>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,h=h>.0031308?1.055*Math.pow(h,1/2.4)-.055:12.92*h,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:12.92*f,r[o]=255*Math.max(0,Math.min(1,c)),r[o+1]=255*Math.max(0,Math.min(1,h)),r[o+2]=255*Math.max(0,Math.min(1,f))}return r}function xp(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function jp(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){xp(o,r,e,s,a,"next",t)}function a(t){xp(o,r,e,s,a,"throw",t)}s(void 0)}))}}var Sp=new Map;function kp(t,n){Array.isArray(t)||(t=[t]),t.forEach((function(t){return Sp.set(t,n)}))}function Mp(t){return _p.apply(this,arguments)}function _p(){return(_p=jp(regeneratorRuntime.mark((function t(n){var i,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Sp.get(n.Compression)){t.next=3;break}throw new Error("Unknown compression method identifier: ".concat(n.Compression));case 3:return t.next=5,i();case 5:return r=t.sent,t.abrupt("return",new r(n));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Op(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(n*i*r)}function Tp(t,n,i,r,e){var o=n/r,s=i/e;return t.map((function(t){for(var a=Op(t,r,e),u=0;u<e;++u)for(var c=Math.min(Math.round(s*u),i-1),h=0;h<r;++h){var f=Math.min(Math.round(o*h),n-1),l=t[c*n+f];a[u*r+h]=l}return a}))}function Ep(t,n,i){return(1-i)*t+i*n}function Ap(t,n,i,r,e){var o=n/r,s=i/e;return t.map((function(t){for(var a=Op(t,r,e),u=0;u<e;++u)for(var c=s*u,h=Math.floor(c),f=Math.min(Math.ceil(c),i-1),l=0;l<r;++l){var v=o*l,d=v%1,p=Math.floor(v),y=Math.min(Math.ceil(v),n-1),m=t[h*n+p],w=t[h*n+y],b=t[f*n+p],g=t[f*n+y],x=Ep(Ep(m,w,d),Ep(b,g,d),c%1);a[u*r+l]=x}return a}))}function Cp(t,n,i,r,e){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(o.toLowerCase()){case"nearest":return Tp(t,n,i,r,e);case"bilinear":case"linear":return Ap(t,n,i,r,e);default:throw new Error("Unsupported resampling method: '".concat(o,"'"))}}function Rp(t,n,i,r,e,o){for(var s=n/r,a=i/e,u=Op(t,r,e,o),c=0;c<e;++c)for(var h=Math.min(Math.round(a*c),i-1),f=0;f<r;++f)for(var l=Math.min(Math.round(s*f),n-1),v=0;v<o;++v){var d=t[h*n*o+l*o+v];u[c*r*o+f*o+v]=d}return u}function Pp(t,n,i,r,e,o){for(var s=n/r,a=i/e,u=Op(t,r,e,o),c=0;c<e;++c)for(var h=a*c,f=Math.floor(h),l=Math.min(Math.ceil(h),i-1),v=0;v<r;++v)for(var d=s*v,p=d%1,y=Math.floor(d),m=Math.min(Math.ceil(d),n-1),w=0;w<o;++w){var b=t[f*n*o+y*o+w],g=t[f*n*o+m*o+w],x=t[l*n*o+y*o+w],j=t[l*n*o+m*o+w],S=Ep(Ep(b,g,p),Ep(x,j,p),h%1);u[c*r*o+v*o+w]=S}return u}function Ip(t,n,i,r,e,o){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(s.toLowerCase()){case"nearest":return Rp(t,n,i,r,e,o);case"bilinear":case"linear":return Pp(t,n,i,r,e,o);default:throw new Error("Unsupported resampling method: '".concat(s,"'"))}}function Np(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return zp(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return zp(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zp(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=t[i];return r}function Fp(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Lp(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){Fp(o,r,e,s,a,"next",t)}function a(t){Fp(o,r,e,s,a,"throw",t)}s(void 0)}))}}function Gp(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Dp(t,n,i){for(var r=0,e=n;e<i;++e)r+=t[e];return r}function Up(t,n,i){switch(t){case 1:if(n<=8)return new Uint8Array(i);if(n<=16)return new Uint16Array(i);if(n<=32)return new Uint32Array(i);break;case 2:if(8===n)return new Int8Array(i);if(16===n)return new Int16Array(i);if(32===n)return new Int32Array(i);break;case 3:switch(n){case 16:case 32:return new Float32Array(i);case 64:return new Float64Array(i)}}throw Error("Unsupported data format/bitsPerSample")}function qp(t,n){return(1!==t&&2!==t||!(n<=32)||n%8!=0)&&(3!==t||16!==n&&32!==n&&64!==n)}function Bp(t,n,i,r,e,o,s){var a=new DataView(t),u=2===i?1:r,c=Up(n,e,2===i?s*o:s*o*r),h=parseInt("1".repeat(e),2);if(1===n){var f=o*(1===i?r*e:e);0!=(7&f)&&(f=f+7&-8);for(var l=0;l<s;++l)for(var v=l*f,d=0;d<o;++d)for(var p=v+d*u*e,y=0;y<u;++y){var m=p+y*e,w=(l*o+d)*u+y,b=Math.floor(m/8),g=m%8;if(g+e<=8)c[w]=a.getUint8(b)>>8-e-g&h;else if(g+e<=16)c[w]=a.getUint16(b)>>16-e-g&h;else if(g+e<=24){var x=a.getUint16(b)<<8|a.getUint8(b+2);c[w]=x>>24-e-g&h}else c[w]=a.getUint32(b)>>32-e-g&h}}return c.buffer}kp([void 0,1],(function(){return i.e(226).then(i.bind(i,966)).then((function(t){return t.default}))})),kp(5,(function(){return i.e(611).then(i.bind(i,611)).then((function(t){return t.default}))})),kp(6,(function(){throw new Error("old style JPEG compression is not supported.")})),kp(7,(function(){return i.e(382).then(i.bind(i,382)).then((function(t){return t.default}))})),kp([8,32946],(function(){return Promise.all([i.e(247),i.e(356)]).then(i.bind(i,356)).then((function(t){return t.default}))})),kp(32773,(function(){return i.e(395).then(i.bind(i,395)).then((function(t){return t.default}))})),kp(34887,(function(){return Promise.all([i.e(247),i.e(54)]).then(i.bind(i,54)).then((function(t){return t.default}))})),kp(50001,(function(){return i.e(629).then(i.bind(i,629)).then((function(t){return t.default}))}));var Wp=function(){function t(n,i,r,e,o,s){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.fileDirectory=n,this.geoKeys=i,this.dataView=r,this.littleEndian=e,this.tiles=o?{}:null,this.isTiled=!n.StripOffsets;var a=n.PlanarConfiguration;if(this.planarConfiguration=void 0===a?1:a,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=s}var n,i,r,e,o,s,a;return n=t,(i=[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBlockWidth",value:function(){return this.getTileWidth()}},{key:"getBlockHeight",value:function(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}},{key:"getBytesPerPixel",value:function(){for(var t=0,n=0;n<this.fileDirectory.BitsPerSample.length;++n)t+=this.getSampleByteSize(n);return t}},{key:"getSampleByteSize",value:function(t){if(t>=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(t," is out of range."));return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}},{key:"getReaderForSample",value:function(t){var n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(n){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(t,n){return fp(this,t,n)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getSampleFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}},{key:"getBitsPerSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[t]}},{key:"getArrayForSample",value:function(t,n){return Up(this.getSampleFormat(t),this.getBitsPerSample(t),n)}},{key:"getTileOrStrip",value:(a=Lp(regeneratorRuntime.mark((function t(n,i,r,e,o){var s,a,u,c,h,f,l,v,d=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight()),c=this.tiles,1===this.planarConfiguration?u=i*s+n:2===this.planarConfiguration&&(u=r*s*a+i*s+n),this.isTiled?(h=this.fileDirectory.TileOffsets[u],f=this.fileDirectory.TileByteCounts[u]):(h=this.fileDirectory.StripOffsets[u],f=this.fileDirectory.StripByteCounts[u]),t.next=7,this.source.fetch([{offset:h,length:f}],o);case 7:return l=t.sent[0],null!==c&&c[u]?v=c[u]:(v=Lp(regeneratorRuntime.mark((function t(){var n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.decode(d.fileDirectory,l);case 2:return n=t.sent,r=d.getSampleFormat(),o=d.getBitsPerSample(),qp(r,o)&&(n=Bp(n,r,d.planarConfiguration,d.getSamplesPerPixel(),o,d.getTileWidth(),d.getBlockHeight(i))),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t)})))(),null!==c&&(c[u]=v)),t.t0=n,t.t1=i,t.t2=r,t.next=14,v;case 14:return t.t3=t.sent,t.abrupt("return",{x:t.t0,y:t.t1,sample:t.t2,data:t.t3});case 16:case"end":return t.stop()}}),t,this)}))),function(t,n,i,r,e){return a.apply(this,arguments)})},{key:"_readRaster",value:(s=Lp(regeneratorRuntime.mark((function t(n,i,r,e,o,s,a,u,c){var h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O,T,E,A=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(h=this.getTileWidth(),f=this.getTileHeight(),l=this.getWidth(),v=this.getHeight(),d=Math.max(Math.floor(n[0]/h),0),p=Math.min(Math.ceil(n[2]/h),Math.ceil(l/h)),y=Math.max(Math.floor(n[1]/f),0),m=Math.min(Math.ceil(n[3]/f),Math.ceil(v/f)),w=n[2]-n[0],b=this.getBytesPerPixel(),g=[],x=[],j=0;j<i.length;++j)1===this.planarConfiguration?g.push(Dp(this.fileDirectory.BitsPerSample,0,i[j])/8):g.push(0),x.push(this.getReaderForSample(i[j]));for(S=[],k=this.littleEndian,M=y;M<m;++M)for(_=d;_<p;++_)for(O=function(t){var s=t,a=i[t];2===A.planarConfiguration&&(b=A.getSampleByteSize(t));var u=A.getTileOrStrip(_,M,a,o,c);S.push(u),u.then((function(t){for(var o=t.data,a=new DataView(o),u=A.getBlockHeight(t.y),c=t.y*f,d=t.x*h,p=c+u,y=(t.x+1)*h,m=x[s],j=Math.min(u,u-(p-n[3]),v-c),S=Math.min(h,h-(y-n[2]),l-d),M=Math.max(0,n[1]-c);M<j;++M)for(var _=Math.max(0,n[0]-d);_<S;++_){var O=(M*h+_)*b,T=m.call(a,O+g[s],k),E=void 0;e?(E=(M+c-n[1])*w*i.length+(_+d-n[0])*i.length+s,r[E]=T):(E=(M+c-n[1])*w+_+d-n[0],r[s][E]=T)}}))},T=0;T<i.length;++T)O(T);return t.next=18,Promise.all(S);case 18:if(!(s&&n[2]-n[0]!==s||a&&n[3]-n[1]!==a)){t.next=23;break}return(E=e?Ip(r,n[2]-n[0],n[3]-n[1],s,a,i.length,u):Cp(r,n[2]-n[0],n[3]-n[1],s,a,u)).width=s,E.height=a,t.abrupt("return",E);case 23:return r.width=s||n[2]-n[0],r.height=a||n[3]-n[1],t.abrupt("return",r);case 26:case"end":return t.stop()}}),t,this)}))),function(t,n,i,r,e,o,a,u,c){return s.apply(this,arguments)})},{key:"readRasters",value:(o=Lp(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=O.length>0&&void 0!==O[0]?O[0]:{},i=n.window,r=n.samples,e=void 0===r?[]:r,o=n.interleave,s=n.pool,a=void 0===s?null:s,u=n.width,c=n.height,h=n.resampleMethod,f=n.fillValue,l=n.signal,!((v=i||[0,0,this.getWidth(),this.getHeight()])[0]>v[2]||v[1]>v[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if(d=v[2]-v[0],p=v[3]-v[1],y=d*p,m=this.getSamplesPerPixel(),e&&e.length){t.next=12;break}for(w=0;w<m;++w)e.push(w);t.next=19;break;case 12:b=0;case 13:if(!(b<e.length)){t.next=19;break}if(!(e[b]>=m)){t.next=16;break}return t.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(e[b],"'."))));case 16:++b,t.next=13;break;case 19:if(o)x=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,j=Math.max.apply(null,this.fileDirectory.BitsPerSample),g=Up(x,j,y*e.length),f&&g.fill(f);else for(g=[],S=0;S<e.length;++S)k=this.getArrayForSample(e[S],y),Array.isArray(f)&&S<f.length?k.fill(f[S]):f&&!Array.isArray(f)&&k.fill(f),g.push(k);if(t.t0=a,t.t0){t.next=25;break}return t.next=24,Mp(this.fileDirectory);case 24:t.t0=t.sent;case 25:return M=t.t0,t.next=28,this._readRaster(v,e,g,o,M,u,c,h,l);case 28:return _=t.sent,t.abrupt("return",_);case 30:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"readRGB",value:(e=Lp(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O,T=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=T.length>0&&void 0!==T[0]?T[0]:{},i=n.window,r=n.interleave,e=void 0===r||r,o=n.pool,s=void 0===o?null:o,a=n.width,u=n.height,c=n.resampleMethod,h=n.enableAlpha,f=void 0!==h&&h,l=n.signal,!((v=i||[0,0,this.getWidth(),this.getHeight()])[0]>v[2]||v[1]>v[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if((d=this.fileDirectory.PhotometricInterpretation)!==dp.Ie.RGB){t.next=9;break}if(p=[0,1,2],this.fileDirectory.ExtraSamples!==dp.pd.Unspecified&&f)for(p=[],y=0;y<this.fileDirectory.BitsPerSample.length;y+=1)p.push(y);return t.abrupt("return",this.readRasters({window:i,interleave:e,samples:p,pool:s,width:a,height:u,resampleMethod:c,signal:l}));case 9:t.t0=d,t.next=t.t0===dp.Ie.WhiteIsZero||t.t0===dp.Ie.BlackIsZero||t.t0===dp.Ie.Palette?12:t.t0===dp.Ie.CMYK?14:t.t0===dp.Ie.YCbCr||t.t0===dp.Ie.CIELab?16:18;break;case 12:return m=[0],t.abrupt("break",19);case 14:return m=[0,1,2,3],t.abrupt("break",19);case 16:return m=[0,1,2],t.abrupt("break",19);case 18:throw new Error("Invalid or unsupported photometric interpretation.");case 19:return w={window:v,interleave:!0,samples:m,pool:s,width:a,height:u,resampleMethod:c,signal:l},b=this.fileDirectory,t.next=23,this.readRasters(w);case 23:g=t.sent,x=Math.pow(2,this.fileDirectory.BitsPerSample[0]),t.t1=d,t.next=t.t1===dp.Ie.WhiteIsZero?28:t.t1===dp.Ie.BlackIsZero?30:t.t1===dp.Ie.Palette?32:t.t1===dp.Ie.CMYK?34:t.t1===dp.Ie.YCbCr?36:t.t1===dp.Ie.CIELab?38:40;break;case 28:return j=pp(g,x),t.abrupt("break",41);case 30:return j=yp(g,x),t.abrupt("break",41);case 32:return j=mp(g,b.ColorMap),t.abrupt("break",41);case 34:return j=wp(g),t.abrupt("break",41);case 36:return j=bp(g),t.abrupt("break",41);case 38:return j=gp(g),t.abrupt("break",41);case 40:throw new Error("Unsupported photometric interpretation.");case 41:if(!e){for(S=new Uint8Array(j.length/3),k=new Uint8Array(j.length/3),M=new Uint8Array(j.length/3),_=0,O=0;_<j.length;_+=3,++O)S[O]=j[_],k[O]=j[_+1],M[O]=j[_+2];j=[S,k,M]}return j.width=g.width,j.height=g.height,t.abrupt("return",j);case 45:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTiePoints",value:function(){if(!this.fileDirectory.ModelTiepoint)return[];for(var t=[],n=0;n<this.fileDirectory.ModelTiepoint.length;n+=6)t.push({i:this.fileDirectory.ModelTiepoint[n],j:this.fileDirectory.ModelTiepoint[n+1],k:this.fileDirectory.ModelTiepoint[n+2],x:this.fileDirectory.ModelTiepoint[n+3],y:this.fileDirectory.ModelTiepoint[n+4],z:this.fileDirectory.ModelTiepoint[n+5]});return t}},{key:"getGDALMetadata",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n={};if(!this.fileDirectory.GDAL_METADATA)return null;var i=this.fileDirectory.GDAL_METADATA,r=vp(i,"Item");r=null===t?r.filter((function(t){return void 0===lp(t,"sample")})):r.filter((function(n){return Number(lp(n,"sample"))===t}));for(var e=0;e<r.length;++e){var o=r[e];n[lp(o,"name")]=o.inner}return n}},{key:"getGDALNoData",value:function(){if(!this.fileDirectory.GDAL_NODATA)return null;var t=this.fileDirectory.GDAL_NODATA;return Number(t.substring(0,t.length-1))}},{key:"getOrigin",value:function(){var t=this.fileDirectory.ModelTiepoint,n=this.fileDirectory.ModelTransformation;if(t&&6===t.length)return[t[3],t[4],t[5]];if(n)return[n[3],n[7],n[11]];throw new Error("The image does not have an affine transformation.")}},{key:"getResolution",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(i)return[i[0],i[5],i[10]];if(t){var r=t.getResolution(),e=Np(r,3),o=e[0],s=e[1],a=e[2];return[o*t.getWidth()/this.getWidth(),s*t.getHeight()/this.getHeight(),a*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var t=this.getOrigin(),n=this.getResolution(),i=t[0],r=t[1],e=i+n[0]*this.getWidth(),o=r+n[1]*this.getHeight();return[Math.min(i,e),Math.min(r,o),Math.max(i,e),Math.max(r,o)]}}])&&Gp(n.prototype,i),r&&Gp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Vp(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Xp=function(){function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this._dataView=new DataView(n)}var n,i,r;return n=t,(i=[{key:"buffer",get:function(){return this._dataView.buffer}},{key:"getUint64",value:function(t,n){var i,r=this.getUint32(t,n),e=this.getUint32(t+4,n);if(n){if(i=r+Math.pow(2,32)*e,!Number.isSafeInteger(i))throw new Error("".concat(i," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}if(i=Math.pow(2,32)*r+e,!Number.isSafeInteger(i))throw new Error("".concat(i," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}},{key:"getInt64",value:function(t,n){for(var i=0,r=(128&this._dataView.getUint8(t+(n?7:0)))>0,e=!0,o=0;o<8;o++){var s=this._dataView.getUint8(t+(n?o:7-o));r&&(e?0!==s&&(s=255&~(s-1),e=!1):s=255&~s),i+=s*Math.pow(256,o)}return r&&(i=-i),i}},{key:"getUint8",value:function(t,n){return this._dataView.getUint8(t,n)}},{key:"getInt8",value:function(t,n){return this._dataView.getInt8(t,n)}},{key:"getUint16",value:function(t,n){return this._dataView.getUint16(t,n)}},{key:"getInt16",value:function(t,n){return this._dataView.getInt16(t,n)}},{key:"getUint32",value:function(t,n){return this._dataView.getUint32(t,n)}},{key:"getInt32",value:function(t,n){return this._dataView.getInt32(t,n)}},{key:"getFloat16",value:function(t,n){return fp(this._dataView,t,n)}},{key:"getFloat32",value:function(t,n){return this._dataView.getFloat32(t,n)}},{key:"getFloat64",value:function(t,n){return this._dataView.getFloat64(t,n)}}])&&Vp(n.prototype,i),r&&Vp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Hp(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Jp=function(){function t(n,i,r,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this._dataView=new DataView(n),this._sliceOffset=i,this._littleEndian=r,this._bigTiff=e}var n,i,r;return n=t,(i=[{key:"sliceOffset",get:function(){return this._sliceOffset}},{key:"sliceTop",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:"littleEndian",get:function(){return this._littleEndian}},{key:"bigTiff",get:function(){return this._bigTiff}},{key:"buffer",get:function(){return this._dataView.buffer}},{key:"covers",value:function(t,n){return this.sliceOffset<=t&&this.sliceTop>=t+n}},{key:"readUint8",value:function(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(t){var n,i=this.readUint32(t),r=this.readUint32(t+4);if(this._littleEndian){if(n=i+Math.pow(2,32)*r,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}if(n=Math.pow(2,32)*i+r,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}},{key:"readInt64",value:function(t){for(var n=0,i=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0,r=!0,e=0;e<8;e++){var o=this._dataView.getUint8(t+(this._littleEndian?e:7-e));i&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),n+=o*Math.pow(256,e)}return i&&(n=-n),n}},{key:"readOffset",value:function(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}])&&Hp(n.prototype,i),r&&Hp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Kp(t){return $p(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Qp(t)||Zp()}function Yp(t,n){return $p(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||Qp(t,n)||Zp()}function Zp(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $p(t){if(Array.isArray(t))return t}function Qp(t,n){if(t){if("string"==typeof t)return ty(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ty(t,n):void 0}}function ty(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=t[i];return r}var ny="\r\n\r\n";function iy(t){if(void 0!==Object.fromEntries)return Object.fromEntries(t);var n,i={},r=function(t,n){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=Qp(t))||n&&t&&"number"==typeof t.length){i&&(t=i);var r=0,e=function(){};return{s:e,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var e=Yp(n.value,2),o=e[0],s=e[1];i[o.toLowerCase()]=s}}catch(t){r.e(t)}finally{r.f()}return i}function ry(t){return iy(t.split("\r\n").map((function(t){var n=t.split(":").map((function(t){return t.trim()}));return n[0]=n[0].toLowerCase(),n})))}function ey(t){var n,i,r;if(t){var e=Yp(t.match(/bytes (\d+)-(\d+)\/(\d+)/),4);n=e[1],i=e[2],r=e[3],n=parseInt(n,10),i=parseInt(i,10),r=parseInt(r,10)}return{start:n,end:i,total:r}}function oy(t,n){for(var i=null,r=new TextDecoder("ascii"),e=[],o="--".concat(n),s="".concat(o,"--"),a=0;a<10;++a){r.decode(new Uint8Array(t,a,o.length))===o&&(i=a)}if(null===i)throw new Error("Could not find initial boundary");for(;i<t.byteLength;){var u=r.decode(new Uint8Array(t,i,Math.min(o.length+1024,t.byteLength-i)));if(0===u.length||u.startsWith(s))break;if(!u.startsWith(o))throw new Error("Part does not start with boundary");var c=u.substr(o.length+2);if(0===c.length)break;var h=c.indexOf(ny),f=ry(c.substr(0,h)),l=ey(f["content-range"]),v=l.start,d=l.end,p=l.total,y=i+o.length+h+ny.length,m=parseInt(d,10)+1-parseInt(v,10);e.push({headers:f,data:t.slice(y,y+m),offset:v,length:m,fileSize:p}),i=y+m+4}return e}function sy(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function ay(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){sy(o,r,e,s,a,"next",t)}function a(t){sy(o,r,e,s,a,"throw",t)}s(void 0)}))}}function uy(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var cy=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,i,r,e,o,s;return n=t,(i=[{key:"fetch",value:(s=ay(regeneratorRuntime.mark((function t(n){var i,r=this,e=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.length>1&&void 0!==e[1]?e[1]:void 0,t.abrupt("return",Promise.all(n.map((function(t){return r.fetchSlice(t,i)}))));case 2:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)})},{key:"fetchSlice",value:(o=ay(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("fetching of slice ".concat(n," not possible, not implemented"));case 1:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})},{key:"fileSize",get:function(){return null}},{key:"close",value:(e=ay(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})}])&&uy(n.prototype,i),r&&uy(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),hy=i(875);function fy(t){return(fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ly(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function vy(t,n,i){return n&&ly(t.prototype,n),i&&ly(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function dy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function py(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&jy(t,n)}function yy(t){var n=xy();return function(){var i,r=Sy(t);if(n){var e=Sy(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return my(this,i)}}function my(t,n){if(n&&("object"===fy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return wy(t)}function wy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function by(t){var n="function"==typeof Map?new Map:void 0;return(by=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return gy(t,arguments,Sy(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),jy(r,t)})(t)}function gy(t,n,i){return(gy=xy()?Reflect.construct:function(t,n,i){var r=[null];r.push.apply(r,n);var e=new(Function.bind.apply(t,r));return i&&jy(e,i.prototype),e}).apply(null,arguments)}function xy(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function jy(t,n){return(jy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Sy(t){return(Sy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ky(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function My(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){ky(o,r,e,s,a,"next",t)}function a(t){ky(o,r,e,s,a,"throw",t)}s(void 0)}))}}function _y(t){return Oy.apply(this,arguments)}function Oy(){return(Oy=My(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,n)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ty(t,n){var i=Array.isArray(t)?t:Array.from(t),r=Array.isArray(n)?n:Array.from(n);return i.map((function(t,n){return[t,r[n]]}))}var Ey=function(t){py(i,t);var n=yy(i);function i(t){var r;return dy(this,i),r=n.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(wy(r),i),r.name="AbortError",r}return vy(i)}(by(Error)),Ay=function(t){py(i,t);var n=yy(i);function i(t,r){var e;return dy(this,i),(e=n.call(this,r)).errors=t,e.message=r,e.name="AggregateError",e}return vy(i)}(by(Error));function Cy(t){return(Cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ry(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||Iy(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(t,n){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=Iy(t))||n&&t&&"number"==typeof t.length){i&&(t=i);var r=0,e=function(){};return{s:e,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function Iy(t,n){if(t){if("string"==typeof t)return Ny(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ny(t,n):void 0}}function Ny(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=t[i];return r}function zy(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Fy(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){zy(o,r,e,s,a,"next",t)}function a(t){zy(o,r,e,s,a,"throw",t)}s(void 0)}))}}function Ly(t,n){return(Ly=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Gy(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,r=Uy(t);if(n){var e=Uy(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return Dy(this,i)}}function Dy(t,n){if(n&&("object"===Cy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Uy(t){return(Uy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function By(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wy(t,n,i){return n&&By(t.prototype,n),i&&By(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}var Vy=function(){function t(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;qy(this,t),this.offset=n,this.length=i,this.data=r}return Wy(t,[{key:"top",get:function(){return this.offset+this.length}}]),t}(),Xy=Wy((function t(n,i,r){qy(this,t),this.offset=n,this.length=i,this.blockIds=r})),Hy=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&Ly(t,n)}(r,t);var n,i=Gy(r);function r(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e.blockSize,s=void 0===o?65536:o,a=e.cacheSize,u=void 0===a?100:a;return qy(this,r),(n=i.call(this)).source=t,n.blockSize=s,n.blockCache=new hy({max:u}),n.blockRequests=new Map,n.blockIdsToFetch=new Set,n}return Wy(r,[{key:"fileSize",get:function(){return this.source.fileSize}},{key:"fetch",value:(n=Fy(regeneratorRuntime.mark((function t(n,i){var r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O,T,E,A,C,R,P,I,N,z,F,L,G,D;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Map,e=new Map,o=new Set,s=Py(n);try{for(s.s();!(a=s.n()).done;)for(u=a.value,c=u.offset,h=u.length,f=c+h,null!==(l=this.fileSize)&&(f=Math.min(f,l)),v=Math.floor(c/this.blockSize)*this.blockSize,d=v;d<f;d+=this.blockSize)p=Math.floor(d/this.blockSize),this.blockCache.has(p)?r.set(p,this.blockCache.get(p)):this.blockRequests.has(p)?e.set(p,this.blockRequests.get(p)):(this.blockIdsToFetch.has(p)||this.blockIdsToFetch.add(p),o.add(p))}catch(t){s.e(t)}finally{s.f()}return t.next=7,_y();case 7:this.fetchBlocks(i),y=Py(o),t.prev=9,y.s();case 11:if((m=y.n()).done){t.next=26;break}if(w=m.value,b=this.blockRequests.get(w),g=this.blockCache.get(w),!b){t.next=19;break}e.set(w,b),t.next=24;break;case 19:if(!g){t.next=23;break}r.set(w,g),t.next=24;break;case 23:throw new Error("Block ".concat(w," is not in the block requests"));case 24:t.next=11;break;case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(9),y.e(t.t0);case 31:return t.prev=31,y.f(),t.finish(31);case 34:return t.next=36,Promise.allSettled(Array.from(e.values()));case 36:if(!(x=t.sent).some((function(t){return"rejected"===t.status}))){t.next=65;break}j=new Set,S=Py(Ty(e.keys(),x));try{for(S.s();!(k=S.n()).done;)M=Ry(k.value,2),_=M[0],O=M[1],T=O.rejected,E=O.reason,T&&"AbortError"===E.name&&E.signal!==i&&(this.blockIdsToFetch.add(_),j.add(_))}catch(t){S.e(t)}finally{S.f()}if(!(this.blockIdsToFetch.length>0)){t.next=65;break}this.fetchBlocks(i),A=Py(j),t.prev=44,A.s();case 46:if((C=A.n()).done){t.next=54;break}if(R=C.value,P=this.blockRequests.get(R)){t.next=51;break}throw new Error("Block ".concat(R," is not in the block requests"));case 51:e.set(R,P);case 52:t.next=46;break;case 54:t.next=59;break;case 56:t.prev=56,t.t1=t.catch(44),A.e(t.t1);case 59:return t.prev=59,A.f(),t.finish(59);case 62:return t.next=64,Promise.allSettled(Array.from(e.values()));case 64:x=t.sent;case 65:if(!x.some((function(t){return"rejected"===t.status}))){t.next=69;break}if(!i||!i.aborted){t.next=68;break}throw new Ey("Request was aborted");case 68:throw new Ay(x.filter((function(t){return"rejected"===t.status})).map((function(t){return t.reason})),"Request failed");case 69:I=x.map((function(t){return t.value})),N=new Map(Ty(Array.from(e.keys()),I)),z=Py(r);try{for(z.s();!(F=z.n()).done;)L=Ry(F.value,2),G=L[0],D=L[1],N.set(G,D)}catch(t){z.e(t)}finally{z.f()}return t.abrupt("return",this.readSliceData(n,N));case 74:case"end":return t.stop()}}),t,this,[[9,28,31,34],[44,56,59,62]])}))),function(t,i){return n.apply(this,arguments)})},{key:"fetchBlocks",value:function(t){var n=this;this.blockIdsToFetch.size>0&&function(){for(var i=n.groupBlocks(n.blockIdsToFetch),r=n.source.fetch(i,t),e=function(e){var o,s=Py(i[e].blockIds);try{var a=function(){var i=o.value,s=Fy(regeneratorRuntime.mark((function o(){var s,a,u,c,h,f;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,r;case 3:return o.t0=e,s=o.sent[o.t0],a=i*n.blockSize,u=a-s.offset,c=Math.min(u+n.blockSize,s.data.byteLength),h=s.data.slice(u,c),f=new Vy(a,h.byteLength,h),n.blockCache.set(i,f),o.abrupt("return",f);case 14:throw o.prev=14,o.t1=o.catch(0),"AbortError"===o.t1.name&&(o.t1.signal=t),o.t1;case 18:return o.prev=18,n.blockRequests.delete(i),o.finish(18);case 21:case"end":return o.stop()}}),o,null,[[0,14,18,21]])})))();n.blockRequests.set(i,s)};for(s.s();!(o=s.n()).done;)a()}catch(t){s.e(t)}finally{s.f()}},o=0;o<i.length;++o)e(o);n.blockIdsToFetch.clear()}()}},{key:"groupBlocks",value:function(t){var n=Array.from(t).sort((function(t,n){return t-n}));if(0===n.length)return[];var i,r=[],e=null,o=[],s=Py(n);try{for(s.s();!(i=s.n()).done;){var a=i.value;null===e||e+1===a?(r.push(a),e=a):(o.push(new Xy(r[0]*this.blockSize,r.length*this.blockSize,r)),r=[a],e=a)}}catch(t){s.e(t)}finally{s.f()}return o.push(new Xy(r[0]*this.blockSize,r.length*this.blockSize,r)),o}},{key:"readSliceData",value:function(t,n){var i=this;return t.map((function(t){for(var r=t.offset+t.length,e=Math.floor(t.offset/i.blockSize),o=Math.floor((t.offset+t.length)/i.blockSize),s=new ArrayBuffer(t.length),a=new Uint8Array(s),u=e;u<=o;++u){var c=n.get(u),h=c.offset-t.offset,f=0,l=0,v=void 0;h<0?f=-h:h>0&&(l=h),v=c.top-r<0?c.length-f:r-c.offset-f;var d=new Uint8Array(c.data,f,v);a.set(d,l)}return s}))}}]),r}(cy);function Jy(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Ky(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){Jy(o,r,e,s,a,"next",t)}function a(t){Jy(o,r,e,s,a,"throw",t)}s(void 0)}))}}function Yy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Zy(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $y(t,n,i){return n&&Zy(t.prototype,n),i&&Zy(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}var Qy=function(){function t(){Yy(this,t)}var n;return $y(t,[{key:"ok",get:function(){return this.status>=200&&this.status<=299}},{key:"status",get:function(){throw new Error("not implemented")}},{key:"getHeader",value:function(t){throw new Error("not implemented")}},{key:"getData",value:(n=Ky(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("not implemented");case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})}]),t}(),tm=function(){function t(n){Yy(this,t),this.url=n}var n;return $y(t,[{key:"request",value:(n=Ky(regeneratorRuntime.mark((function t(){var n,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw(n=i.length>0&&void 0!==i[0]?i[0]:{}).headers,n.credentials,n.signal,new Error("request is not implemented");case 2:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})}]),t}();function nm(t){return(nm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function im(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function rm(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){im(o,r,e,s,a,"next",t)}function a(t){im(o,r,e,s,a,"throw",t)}s(void 0)}))}}function em(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function om(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function sm(t,n,i){return n&&om(t.prototype,n),i&&om(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function am(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&um(t,n)}function um(t,n){return(um=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function cm(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,r=fm(t);if(n){var e=fm(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return hm(this,i)}}function hm(t,n){if(n&&("object"===nm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fm(t){return(fm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lm=function(t){am(r,t);var n,i=cm(r);function r(t){var n;return em(this,r),(n=i.call(this)).response=t,n}return sm(r,[{key:"status",get:function(){return this.response.status}},{key:"getHeader",value:function(t){return this.response.headers.get(t)}},{key:"getData",value:(n=rm(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.response.arrayBuffer){t.next=6;break}return t.next=3,this.response.arrayBuffer();case 3:t.t0=t.sent,t.next=9;break;case 6:return t.next=8,this.response.buffer();case 8:t.t0=t.sent.buffer;case 9:return n=t.t0,t.abrupt("return",n);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(Qy),vm=function(t){am(r,t);var n,i=cm(r);function r(t,n){var e;return em(this,r),(e=i.call(this,t)).credentials=n,e}return sm(r,[{key:"request",value:(n=rm(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:{},i=n.headers,r=n.credentials,e=n.signal,t.next=3,fetch(this.url,{headers:i,credentials:r,signal:e});case 3:return o=t.sent,t.abrupt("return",new lm(o));case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(tm);function dm(t){return(dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pm(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return ym(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ym(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ym(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=t[i];return r}function mm(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function wm(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){mm(o,r,e,s,a,"next",t)}function a(t){mm(o,r,e,s,a,"throw",t)}s(void 0)}))}}function bm(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function gm(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xm(t,n,i){return n&&gm(t.prototype,n),i&&gm(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function jm(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&Sm(t,n)}function Sm(t,n){return(Sm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function km(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,r=_m(t);if(n){var e=_m(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return Mm(this,i)}}function Mm(t,n){if(n&&("object"===dm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _m(t){return(_m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Om=function(t){jm(r,t);var n,i=km(r);function r(t,n){var e;return bm(this,r),(e=i.call(this)).xhr=t,e.data=n,e}return xm(r,[{key:"status",get:function(){return this.xhr.status}},{key:"getHeader",value:function(t){return this.xhr.getResponseHeader(t)}},{key:"getData",value:(n=wm(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.data);case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(Qy),Tm=function(t){jm(r,t);var n,i=km(r);function r(){return bm(this,r),i.apply(this,arguments)}return xm(r,[{key:"constructRequest",value:function(t,n){var i=this;return new Promise((function(r,e){var o=new XMLHttpRequest;o.open("GET",i.url),o.responseType="arraybuffer";for(var s=0,a=Object.entries(t);s<a.length;s++){var u=pm(a[s],2),c=u[0],h=u[1];o.setRequestHeader(c,h)}o.onload=function(){var t=o.response;r(new Om(o,t))},o.onerror=e,o.onabort=function(){return e(new Ey("Request aborted"))},o.send(),n&&(n.aborted&&o.abort(),n.addEventListener("abort",(function(){return o.abort()})))}))}},{key:"request",value:(n=wm(regeneratorRuntime.mark((function t(){var n,i,r,e,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>0&&void 0!==o[0]?o[0]:{},i=n.headers,r=n.signal,t.next=3,this.constructRequest(i,r);case 3:return e=t.sent,t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(tm),Em=i(752),Am=i(640),Cm=i(630);function Rm(t){return(Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pm(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,r)}return i}function Im(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Pm(Object(i),!0).forEach((function(n){Nm(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Pm(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}function Nm(t,n,i){return n in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function zm(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Fm(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){zm(o,r,e,s,a,"next",t)}function a(t){zm(o,r,e,s,a,"throw",t)}s(void 0)}))}}function Lm(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Gm(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Dm(t,n,i){return n&&Gm(t.prototype,n),i&&Gm(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function Um(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&qm(t,n)}function qm(t,n){return(qm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Bm(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,r=Vm(t);if(n){var e=Vm(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return Wm(this,i)}}function Wm(t,n){if(n&&("object"===Rm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Vm(t){return(Vm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xm=function(t){Um(r,t);var n,i=Bm(r);function r(t,n){var e;return Lm(this,r),(e=i.call(this)).response=t,e.dataPromise=n,e}return Dm(r,[{key:"status",get:function(){return this.response.statusCode}},{key:"getHeader",value:function(t){return this.response.headers[t]}},{key:"getData",value:(n=Fm(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dataPromise;case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(Qy),Hm=function(t){Um(r,t);var n,i=Bm(r);function r(t){var n;return Lm(this,r),(n=i.call(this,t)).parsedUrl=Cm.parse(n.url),n.httpApi="http:"===n.parsedUrl.protocol?Em:Am,n}return Dm(r,[{key:"constructRequest",value:function(t,n){var i=this;return new Promise((function(r,e){var o=i.httpApi.get(Im(Im({},i.parsedUrl),{},{headers:t}),(function(t){var n=new Promise((function(n){var i=[];t.on("data",(function(t){i.push(t)})),t.on("end",(function(){var t=Buffer.concat(i).buffer;n(t)})),t.on("error",e)}));r(new Xm(t,n))}));o.on("error",e),n&&(n.aborted&&o.destroy(new Ey("Request aborted")),n.addEventListener("abort",(function(){return o.destroy(new Ey("Request aborted"))})))}))}},{key:"request",value:(n=Fm(regeneratorRuntime.mark((function t(){var n,i,r,e,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>0&&void 0!==o[0]?o[0]:{},i=n.headers,r=n.signal,t.next=3,this.constructRequest(i,r);case 3:return e=t.sent,t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(tm);function Jm(t){return(Jm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Km=["headers","credentials","maxRanges","allowFullFile"],Ym=["headers","maxRanges","allowFullFile"],Zm=["headers","maxRanges","allowFullFile"],$m=["forceXHR"];function Qm(t,n){if(null==t)return{};var i,r,e=function(t,n){if(null==t)return{};var i,r,e={},o=Object.keys(t);for(r=0;r<o.length;r++)i=o[r],n.indexOf(i)>=0||(e[i]=t[i]);return e}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)i=o[r],n.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}return e}function tw(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,r)}return i}function nw(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tw(Object(i),!0).forEach((function(n){iw(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tw(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}function iw(t,n,i){return n in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function rw(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function ew(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){rw(o,r,e,s,a,"next",t)}function a(t){rw(o,r,e,s,a,"throw",t)}s(void 0)}))}}function ow(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function sw(t,n){return(sw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function aw(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,r=cw(t);if(n){var e=cw(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return uw(this,i)}}function uw(t,n){if(n&&("object"===Jm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function cw(t){return(cw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hw=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&sw(t,n)}(u,t);var n,i,r,e,o,s,a=aw(u);function u(t,n,i,r){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,u),(e=a.call(this)).client=t,e.headers=n,e.maxRanges=i,e.allowFullFile=r,e._fileSize=null,e}return n=u,(i=[{key:"fetch",value:(s=ew(regeneratorRuntime.mark((function t(n,i){var r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.maxRanges>=n.length)){t.next=4;break}return t.abrupt("return",this.fetchSlices(n,i));case 4:this.maxRanges>0&&n.length;case 5:return t.abrupt("return",Promise.all(n.map((function(t){return r.fetchSlice(t,i)}))));case 6:case"end":return t.stop()}}),t,this)}))),function(t,n){return s.apply(this,arguments)})},{key:"fetchSlices",value:(o=ew(regeneratorRuntime.mark((function t(n,i){var r,e,o,s,a,u,c,h,f,l,v,d,p=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.request({headers:nw(nw({},this.headers),{},{Range:"bytes=".concat(n.map((function(t){var n=t.offset,i=t.length;return"".concat(n,"-").concat(n+i)})).join(","))}),signal:i});case 2:if((r=t.sent).ok){t.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==r.status){t.next=32;break}if(y=r.getHeader("content-type"),m=void 0,m=Kp(y.split(";").map((function(t){return t.trim()}))),e={type:m[0],params:iy(m.slice(1).map((function(t){return t.split("=")})))},o=e.params,"multipart/byteranges"!==e.type){t.next=18;break}return t.t0=oy,t.next=13,r.getData();case 13:return t.t1=t.sent,t.t2=o.boundary,s=(0,t.t0)(t.t1,t.t2),this._fileSize=s[0].fileSize||null,t.abrupt("return",s);case 18:return t.next=20,r.getData();case 20:if(a=t.sent,u=ey(r.getHeader("content-range")),c=u.start,h=u.end,f=u.total,this._fileSize=f||null,l=[{data:a,offset:c,length:h-c}],!(n.length>1)){t.next=29;break}return t.next=27,Promise.all(n.slice(1).map((function(t){return p.fetchSlice(t,i)})));case 27:return v=t.sent,t.abrupt("return",l.concat(v));case 29:return t.abrupt("return",l);case 32:if(this.allowFullFile){t.next=34;break}throw new Error("Server responded with full file");case 34:return t.next=36,r.getData();case 36:return d=t.sent,this._fileSize=d.byteLength,t.abrupt("return",[{data:d,offset:0,length:d.byteLength}]);case 39:case"end":return t.stop()}var y,m}),t,this)}))),function(t,n){return o.apply(this,arguments)})},{key:"fetchSlice",value:(e=ew(regeneratorRuntime.mark((function t(n,i){var r,e,o,s,a,u,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.offset,e=n.length,t.next=3,this.client.request({headers:nw(nw({},this.headers),{},{Range:"bytes=".concat(r,"-").concat(r+e)}),signal:i});case 3:if((o=t.sent).ok){t.next=8;break}throw new Error("Error fetching data.");case 8:if(206!==o.status){t.next=17;break}return t.next=11,o.getData();case 11:return s=t.sent,a=ey(o.getHeader("content-range")),u=a.total,this._fileSize=u||null,t.abrupt("return",{data:s,offset:r,length:e});case 17:if(this.allowFullFile){t.next=19;break}throw new Error("Server responded with full file");case 19:return t.next=21,o.getData();case 21:return c=t.sent,this._fileSize=c.byteLength,t.abrupt("return",{data:c,offset:0,length:c.byteLength});case 24:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"fileSize",get:function(){return this._fileSize}}])&&ow(n.prototype,i),r&&ow(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(cy);function fw(t,n){var i=n.blockSize,r=n.cacheSize;return null===i?t:new Hy(t,i,r)}function lw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.headers,r=void 0===i?{}:i,e=n.credentials,o=n.maxRanges,s=void 0===o?0:o,a=n.allowFullFile,u=void 0!==a&&a,c=Qm(n,Km),h=new vm(t,e),f=new hw(h,r,s,u);return fw(f,c)}function vw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.headers,r=void 0===i?{}:i,e=n.maxRanges,o=void 0===e?0:e,s=n.allowFullFile,a=void 0!==s&&s,u=Qm(n,Ym),c=new Tm(t),h=new hw(c,r,o,a);return fw(h,u)}function dw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.headers,r=void 0===i?{}:i,e=n.maxRanges,o=void 0===e?0:e,s=n.allowFullFile,a=void 0!==s&&s,u=Qm(n,Zm),c=new Hm(t),h=new hw(c,r,o,a);return fw(h,u)}function pw(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.forceXHR,r=void 0!==i&&i,e=Qm(n,$m);return"function"!=typeof fetch||r?"undefined"!=typeof XMLHttpRequest?vw(t,e):dw(t,e):lw(t,e)}function yw(t){return(yw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mw(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,r)}return i}function ww(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?mw(Object(i),!0).forEach((function(n){bw(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):mw(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}function bw(t,n,i){return n in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function gw(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return xw(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xw(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xw(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=t[i];return r}function jw(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Sw(t){return function(){var n=this,i=arguments;return new Promise((function(r,e){var o=t.apply(n,i);function s(t){jw(o,r,e,s,a,"next",t)}function a(t){jw(o,r,e,s,a,"throw",t)}s(void 0)}))}}function kw(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&Aw(t,n)}function Mw(t){var n=Ew();return function(){var i,r=Cw(t);if(n){var e=Cw(this).constructor;i=Reflect.construct(r,arguments,e)}else i=r.apply(this,arguments);return _w(this,i)}}function _w(t,n){if(n&&("object"===yw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ow(t){var n="function"==typeof Map?new Map:void 0;return(Ow=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return Tw(t,arguments,Cw(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Aw(r,t)})(t)}function Tw(t,n,i){return(Tw=Ew()?Reflect.construct:function(t,n,i){var r=[null];r.push.apply(r,n);var e=new(Function.bind.apply(t,r));return i&&Aw(e,i.prototype),e}).apply(null,arguments)}function Ew(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Aw(t,n){return(Aw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Cw(t){return(Cw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Rw(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Pw(t,n,i){return n&&Rw(t.prototype,n),i&&Rw(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function Iw(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Nw(t){switch(t){case dp.sf.BYTE:case dp.sf.ASCII:case dp.sf.SBYTE:case dp.sf.UNDEFINED:return 1;case dp.sf.SHORT:case dp.sf.SSHORT:return 2;case dp.sf.LONG:case dp.sf.SLONG:case dp.sf.FLOAT:case dp.sf.IFD:return 4;case dp.sf.RATIONAL:case dp.sf.SRATIONAL:case dp.sf.DOUBLE:case dp.sf.LONG8:case dp.sf.SLONG8:case dp.sf.IFD8:return 8;default:throw new RangeError("Invalid field type: ".concat(t))}}function zw(t){var n=t.GeoKeyDirectory;if(!n)return null;for(var i={},r=4;r<=4*n[3];r+=4){var e=dp.P1[n[r]],o=n[r+1]?dp.L[n[r+1]]:null,s=n[r+2],a=n[r+3],u=null;if(o){if(null==(u=t[o]))throw new Error("Could not get value of geoKey '".concat(e,"'."));"string"==typeof u?u=u.substring(a,a+s-1):u.subarray&&(u=u.subarray(a,a+s),1===s&&(u=u[0]))}else u=a;i[e]=u}return i}function Fw(t,n,i,r){var e=null,o=null,s=Nw(n);switch(n){case dp.sf.BYTE:case dp.sf.ASCII:case dp.sf.UNDEFINED:e=new Uint8Array(i),o=t.readUint8;break;case dp.sf.SBYTE:e=new Int8Array(i),o=t.readInt8;break;case dp.sf.SHORT:e=new Uint16Array(i),o=t.readUint16;break;case dp.sf.SSHORT:e=new Int16Array(i),o=t.readInt16;break;case dp.sf.LONG:case dp.sf.IFD:e=new Uint32Array(i),o=t.readUint32;break;case dp.sf.SLONG:e=new Int32Array(i),o=t.readInt32;break;case dp.sf.LONG8:case dp.sf.IFD8:e=new Array(i),o=t.readUint64;break;case dp.sf.SLONG8:e=new Array(i),o=t.readInt64;break;case dp.sf.RATIONAL:e=new Uint32Array(2*i),o=t.readUint32;break;case dp.sf.SRATIONAL:e=new Int32Array(2*i),o=t.readInt32;break;case dp.sf.FLOAT:e=new Float32Array(i),o=t.readFloat32;break;case dp.sf.DOUBLE:e=new Float64Array(i),o=t.readFloat64;break;default:throw new RangeError("Invalid field type: ".concat(n))}if(n!==dp.sf.RATIONAL&&n!==dp.sf.SRATIONAL)for(var a=0;a<i;++a)e[a]=o.call(t,r+a*s);else for(var u=0;u<i;u+=2)e[u]=o.call(t,r+u*s),e[u+1]=o.call(t,r+(u*s+4));return n===dp.sf.ASCII?new TextDecoder("utf-8").decode(e):e}var Lw=Pw((function t(n,i,r){Iw(this,t),this.fileDirectory=n,this.geoKeyDirectory=i,this.nextIFDByteOffset=r})),Gw=function(t){kw(i,t);var n=Mw(i);function i(t){var r;return Iw(this,i),(r=n.call(this,"No image at index ".concat(t))).index=t,r}return Pw(i)}(Ow(Error)),Dw=function(){function t(){Iw(this,t)}var n;return Pw(t,[{key:"readRasters",value:(n=Sw(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x,j,S,k,M,_,O,T,E,A,C,R,P,I,N,z,F,L,G,D=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=D.length>0&&void 0!==D[0]?D[0]:{},i=n.window,r=n.width,e=n.height,o=n.resX,s=n.resY,a=n.bbox,t.next=5,this.getImage();case 5:return u=t.sent,c=u,t.next=9,this.getImageCount();case 9:if(h=t.sent,f=u.getBoundingBox(),!i||!a){t.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!r&&!e){t.next=24;break}if(i&&(l=u.getOrigin(),v=gw(l,2),d=v[0],p=v[1],y=u.getResolution(),m=gw(y,2),w=m[0],b=m[1],a=[d+i[0]*w,p+i[1]*b,d+i[2]*w,p+i[3]*b]),g=a||f,!r){t.next=20;break}if(!o){t.next=19;break}throw new Error("Both width and resX passed");case 19:o=(g[2]-g[0])/r;case 20:if(!e){t.next=24;break}if(!s){t.next=23;break}throw new Error("Both width and resY passed");case 23:s=(g[3]-g[1])/e;case 24:if(!o&&!s){t.next=48;break}x=[],j=0;case 27:if(!(j<h)){t.next=36;break}return t.next=30,this.getImage(j);case 30:S=t.sent,k=S.fileDirectory,M=k.SubfileType,_=k.NewSubfileType,(0===j||2===M||1&_)&&x.push(S);case 33:++j,t.next=27;break;case 36:x.sort((function(t,n){return t.getWidth()-n.getWidth()})),O=0;case 38:if(!(O<x.length)){t.next=48;break}if(T=x[O],E=(f[2]-f[0])/T.getWidth(),A=(f[3]-f[1])/T.getHeight(),c=T,!(o&&o>E||s&&s>A)){t.next=45;break}return t.abrupt("break",48);case 45:++O,t.next=38;break;case 48:return C=i,a&&(R=u.getOrigin(),P=gw(R,2),I=P[0],N=P[1],z=c.getResolution(u),F=gw(z,2),L=F[0],G=F[1],C=[Math.round((a[0]-I)/L),Math.round((a[1]-N)/G),Math.round((a[2]-I)/L),Math.round((a[3]-N)/G)],C=[Math.min(C[0],C[2]),Math.min(C[1],C[3]),Math.max(C[0],C[2]),Math.max(C[1],C[3])]),t.abrupt("return",c.readRasters(ww(ww({},n),{},{window:C})));case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),t}(),Uw=function(t){kw(c,t);var n,i,r,e,o,s,a,u=Mw(c);function c(t,n,i,r){var e,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return Iw(this,c),(e=u.call(this)).source=t,e.littleEndian=n,e.bigTiff=i,e.firstIFDOffset=r,e.cache=o.cache||!1,e.ifdRequests=[],e.ghostValues=null,e}return Pw(c,[{key:"getSlice",value:(a=Sw(regeneratorRuntime.mark((function t(n,i){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.bigTiff?4048:1024,t.t0=Jp,t.next=4,this.source.fetch([{offset:n,length:void 0!==i?i:r}]);case 4:return t.t1=t.sent[0],t.t2=n,t.t3=this.littleEndian,t.t4=this.bigTiff,t.abrupt("return",new t.t0(t.t1,t.t2,t.t3,t.t4));case 9:case"end":return t.stop()}}),t,this)}))),function(t,n){return a.apply(this,arguments)})},{key:"parseFileDirectoryAt",value:(s=Sw(regeneratorRuntime.mark((function t(n){var i,r,e,o,s,a,u,c,h,f,l,v,d,p,y,m,w,b,g,x;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.bigTiff?20:12,r=this.bigTiff?8:2,t.next=4,this.getSlice(n);case 4:if(e=t.sent,o=this.bigTiff?e.readUint64(n):e.readUint16(n),s=o*i+(this.bigTiff?16:6),e.covers(n,s)){t.next=11;break}return t.next=10,this.getSlice(n,s);case 10:e=t.sent;case 11:a={},u=n+(this.bigTiff?8:2),c=0;case 14:if(!(c<o)){t.next=41;break}if(h=e.readUint16(u),f=e.readUint16(u+2),l=this.bigTiff?e.readUint64(u+4):e.readUint32(u+4),v=void 0,d=void 0,p=Nw(f),y=u+(this.bigTiff?12:8),!(p*l<=(this.bigTiff?8:4))){t.next=26;break}v=Fw(e,f,l,y),t.next=36;break;case 26:if(m=e.readOffset(y),w=Nw(f)*l,!e.covers(m,w)){t.next=32;break}v=Fw(e,f,l,m),t.next=36;break;case 32:return t.next=34,this.getSlice(m,w);case 34:b=t.sent,v=Fw(b,f,l,m);case 36:d=1===l&&-1===dp.It.indexOf(h)&&f!==dp.sf.RATIONAL&&f!==dp.sf.SRATIONAL?v[0]:v,a[dp.L[h]]=d;case 38:u+=i,++c,t.next=14;break;case 41:return g=zw(a),x=e.readOffset(n+r+i*o),t.abrupt("return",new Lw(a,g,x));case 44:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"requestIFD",value:(o=Sw(regeneratorRuntime.mark((function t(n){var i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.ifdRequests[n]){t.next=4;break}return t.abrupt("return",this.ifdRequests[n]);case 4:if(0!==n){t.next=9;break}return this.ifdRequests[n]=this.parseFileDirectoryAt(this.firstIFDOffset),t.abrupt("return",this.ifdRequests[n]);case 9:if(this.ifdRequests[n-1]){t.next=19;break}t.prev=10,this.ifdRequests[n-1]=this.requestIFD(n-1),t.next=19;break;case 14:if(t.prev=14,t.t0=t.catch(10),!(t.t0 instanceof Gw)){t.next=18;break}throw new Gw(n);case 18:throw t.t0;case 19:return this.ifdRequests[n]=Sw(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.ifdRequests[n-1];case 2:if(0!==(r=t.sent).nextIFDByteOffset){t.next=5;break}throw new Gw(n);case 5:return t.abrupt("return",i.parseFileDirectoryAt(r.nextIFDByteOffset));case 6:case"end":return t.stop()}}),t)})))(),t.abrupt("return",this.ifdRequests[n]);case 21:case"end":return t.stop()}}),t,this,[[10,14]])}))),function(t){return o.apply(this,arguments)})},{key:"getImage",value:(e=Sw(regeneratorRuntime.mark((function t(){var n,i,r=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>0&&void 0!==r[0]?r[0]:0,t.next=3,this.requestIFD(n);case 3:return i=t.sent,t.abrupt("return",new Wp(i.fileDirectory,i.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getImageCount",value:(r=Sw(regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,i=!0;case 2:if(!i){t.next=18;break}return t.prev=3,t.next=6,this.requestIFD(n);case 6:++n,t.next=16;break;case 9:if(t.prev=9,t.t0=t.catch(3),!(t.t0 instanceof Gw)){t.next=15;break}i=!1,t.next=16;break;case 15:throw t.t0;case 16:t.next=2;break;case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(){return r.apply(this,arguments)})},{key:"getGhostValues",value:(i=Sw(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u,c=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.bigTiff?16:8,!this.ghostValues){t.next=3;break}return t.abrupt("return",this.ghostValues);case 3:return r=(i="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,t.next=7,this.getSlice(n,r);case 7:if(e=t.sent,i!==Fw(e,dp.sf.ASCII,i.length,n)){t.next=19;break}if(o=Fw(e,dp.sf.ASCII,r,n),s=o.split("\n")[0],!((a=Number(s.split("=")[1].split(" ")[0])+s.length)>r)){t.next=16;break}return t.next=15,this.getSlice(n,a);case 15:e=t.sent;case 16:u=Fw(e,dp.sf.ASCII,a,n),this.ghostValues={},u.split("\n").filter((function(t){return t.length>0})).map((function(t){return t.split("=")})).forEach((function(t){var n=gw(t,2),i=n[0],r=n[1];c.ghostValues[i]=r}));case 19:return t.abrupt("return",this.ghostValues);case 20:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"close",value:function(){return"function"==typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:(n=Sw(regeneratorRuntime.mark((function t(n,i,r){var e,o,s,a,u,h,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.fetch([{offset:0,length:1024}],r);case 2:if(e=t.sent[0],o=new Xp(e),18761!==(s=o.getUint16(0,0))){t.next=9;break}a=!0,t.next=14;break;case 9:if(19789!==s){t.next=13;break}a=!1,t.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(u=o.getUint16(2,a))){t.next=19;break}h=!1,t.next=27;break;case 19:if(43!==u){t.next=26;break}if(h=!0,8===o.getUint16(4,a)){t.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:t.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return f=h?o.getUint64(8,a):o.getUint32(4,a),t.abrupt("return",new c(n,a,h,f,i));case 29:case"end":return t.stop()}}),t)}))),function(t,i,r){return n.apply(this,arguments)})}]),c}(Dw),qw=function(t){kw(o,t);var n,i,r,e=Mw(o);function o(t,n){var i;return Iw(this,o),(i=e.call(this)).mainFile=t,i.overviewFiles=n,i.imageFiles=[t].concat(n),i.fileDirectoriesPerFile=null,i.fileDirectoriesPerFileParsing=null,i.imageCount=null,i}return Pw(o,[{key:"parseFileDirectoriesPerFile",value:(r=Sw(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(t){return t.parseFileDirectoryAt(t.firstIFDOffset)}))),t.next=3,Promise.all(n);case 3:return this.fileDirectoriesPerFile=t.sent,t.abrupt("return",this.fileDirectoriesPerFile);case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getImage",value:(i=Sw(regeneratorRuntime.mark((function t(){var n,i,r,e,o,s,a,u=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:0,t.next=3,this.getImageCount();case 3:return t.next=5,this.parseFileDirectoriesPerFile();case 5:i=0,r=0,e=0;case 8:if(!(e<this.imageFiles.length)){t.next=26;break}o=this.imageFiles[e],s=0;case 11:if(!(s<this.imageCounts[e])){t.next=22;break}if(n!==i){t.next=17;break}return t.next=15,o.requestIFD(r);case 15:return a=t.sent,t.abrupt("return",new Wp(a.fileDirectory,a.geoKeyDirectory,o.dataView,o.littleEndian,o.cache,o.source));case 17:i++,r++;case 19:s++,t.next=11;break;case 22:r=0;case 23:e++,t.next=8;break;case 26:throw new RangeError("Invalid image index");case 27:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getImageCount",value:(n=Sw(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===this.imageCount){t.next=2;break}return t.abrupt("return",this.imageCount);case 2:return n=[this.mainFile.getImageCount()].concat(this.overviewFiles.map((function(t){return t.getImageCount()}))),t.next=5,Promise.all(n);case 5:return this.imageCounts=t.sent,this.imageCount=this.imageCounts.reduce((function(t,n){return t+n}),0),t.abrupt("return",this.imageCount);case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),o}(Dw);function Bw(){return(Bw=Sw(regeneratorRuntime.mark((function t(n){var i,r,e=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.length>1&&void 0!==e[1]?e[1]:{},r=e.length>2?e[2]:void 0,t.abrupt("return",Uw.fromSource(pw(n,i),r));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ww(){return(Ww=Sw(regeneratorRuntime.mark((function t(n){var i,r,e,o,s,a=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:[],r=a.length>2&&void 0!==a[2]?a[2]:{},e=a.length>3?a[3]:void 0,t.next=5,Uw.fromSource(pw(n,r),e);case 5:return o=t.sent,t.next=8,Promise.all(i.map((function(t){return Uw.fromSource(pw(t,r))})));case 8:return s=t.sent,t.abrupt("return",new qw(o,s));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Vw(t,n,i,r,e,o,s){try{var a=t[o](s),u=a.value}catch(t){return void i(t)}a.done?n(u):Promise.resolve(u).then(r,e)}function Xw(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Hw(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Jw,Kw="undefined"!=typeof navigator&&navigator.hardwareConcurrency||2,Yw=function(){function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kw,e=arguments.length>1?arguments[1]:void 0;Xw(this,t),this.workers=null,this._awaitingDecoder=null,this.size=r,this.messageId=0,r&&(this._awaitingDecoder=e?Promise.resolve(e):new Promise((function(t){i.e(231).then(i.bind(i,231)).then((function(n){t(n.create)}))})),this._awaitingDecoder.then((function(t){n._awaitingDecoder=null,n.workers=[];for(var i=0;i<r;i++)n.workers.push({worker:t(),idle:!0})})))}var n,r,e,o,s;return n=t,(r=[{key:"decode",value:(o=regeneratorRuntime.mark((function t(n,i){var r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._awaitingDecoder){t.next=3;break}return t.next=3,this._awaitingDecoder;case 3:return t.abrupt("return",0===this.size?Mp(n).then((function(t){return t.decode(n,i)})):new Promise((function(t){var e=r.workers.find((function(t){return t.idle}))||r.workers[Math.floor(Math.random()*r.size)];e.idle=!1;var o=r.messageId++;e.worker.addEventListener("message",(function n(i){i.data.id===o&&(e.idle=!0,t(i.data.decoded),e.worker.removeEventListener("message",n))})),e.worker.postMessage({fileDirectory:n,buffer:i,id:o},[i])})));case 4:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,n=arguments;return new Promise((function(i,r){var e=o.apply(t,n);function s(t){Vw(e,i,r,s,a,"next",t)}function a(t){Vw(e,i,r,s,a,"throw",t)}s(void 0)}))},function(t,n){return s.apply(this,arguments)})},{key:"destroy",value:function(){this.workers&&(this.workers.forEach((function(t){t.worker.terminate()})),this.workers=null)}}])&&Hw(n.prototype,r),e&&Hw(n,e),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Zw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$w="STATISTICS_MAXIMUM",Qw="STATISTICS_MINIMUM";function tb(t){try{return t.getBoundingBox()}catch(i){var n=t.fileDirectory;return[0,0,n.ImageWidth,n.ImageLength]}}function nb(t){try{return t.getOrigin().slice(0,2)}catch(n){return[0,t.fileDirectory.ImageLength]}}function ib(t,n){try{return t.getResolution(n)[0]}catch(i){return n.fileDirectory.ImageWidth/t.fileDirectory.ImageWidth}}function rb(t){var n=t.geoKeys;if(!n)return null;if(n.ProjectedCSTypeGeoKey){if(!(r=gr(i="EPSG:"+n.ProjectedCSTypeGeoKey)))(e=zt(n.ProjLinearUnitsGeoKey))&&(r=new ui({code:i,units:e}));return r}if(n.GeographicTypeGeoKey){var i,r,e;if(!(r=gr(i="EPSG:"+n.GeographicTypeGeoKey)))(e=zt(n.GeogAngularUnitsGeoKey))&&(r=new ui({code:i,units:e}));return r}return null}function eb(t){return t.getImageCount().then((function(n){for(var i=new Array(n),r=0;r<n;++r)i[r]=t.getImage(r);return Promise.all(i)}))}function ob(t,n){return(t.overviews?function(t){return Ww.apply(this,arguments)}(t.url,t.overviews,n):function(t){return Bw.apply(this,arguments)}(t.url,n)).then(eb)}function sb(t,n,i,r,e){if(Array.isArray(t)){var o=t.length;if(!Array.isArray(n)||o!=n.length){var s=new Error(r);throw e(s),s}for(var a=0;a<o;++a)sb(t[a],n[a],i,r,e)}else if(n=n,Math.abs(t-n)>i*t)throw new Error(r)}function ab(t){return t instanceof Int8Array?-128:t instanceof Int16Array?-32768:t instanceof Int32Array?-2147483648:t instanceof Float32Array?12e-39:0}function ub(t){return t instanceof Int8Array?127:t instanceof Uint8Array||t instanceof Uint8ClampedArray?255:t instanceof Int16Array?32767:t instanceof Uint16Array?65535:t instanceof Int32Array?2147483647:t instanceof Uint32Array?4294967295:t instanceof Float32Array?34e37:255}var cb=function(t){function n(n){var i=t.call(this,{state:ps,tileGrid:null,projection:null,opaque:n.opaque,transition:n.transition,interpolate:!1!==n.interpolate,wrapX:n.wrapX})||this;i.Qu=n.sources;var r=i.Qu.length;i.tc=n.sourceOptions,i.ic=new Array(r),i.rc=new Array(r),i.ec,i.oc,i.sc,i.ac=!1!==n.normalize,i.uc=!1,i.W=null,i.cc=n.convertToRGB?"readRGB":"readRasters",i.setKey(i.Qu.map((function(t){return t.url})).join(","));for(var e=i,o=new Array(r),s=0;s<r;++s)o[s]=ob(i.Qu[s],i.tc);return Promise.all(o).then((function(t){e.hc(t)})).catch((function(t){console.error(t),e.W=t,e.setState(ms)})),i}return Zw(n,t),n.prototype.getError=function(){return this.W},n.prototype.hc=function(t){for(var n,i,r,e,o=new Array(t.length),s=new Array(t.length),a=new Array(t.length),u=0,c=t.length,h=function(c){var h=t[c],l=h.length,v=void 0,d=void 0,p=new Array(l),y=new Array(l);s[c]=new Array(l),a[c]=new Array(l);for(var m=0;m<l;++m){var w=h[m],b=w.getGDALNoData();a[c][m]=w.getGDALMetadata(0),s[c][m]=null===b?NaN:b;var g=f.Qu[c].bands;o[c]=g?g.length:w.getSamplesPerPixel();var x=l-(m+1);v||(v=tb(w)),d||(d=nb(w)),y[x]=ib(w,h[0]),p[x]=[w.getTileWidth(),w.getTileHeight()]}if(n?Zn(n,v,n):n=v,i){var j="Origin mismatch for source ".concat(c,", got [").concat(d,"] but expected [").concat(i,"]");sb(i,d,0,j,f.viewRejector)}else i=d;if(e){e.length-u>y.length&&(u=e.length-y.length);var S=e[e.length-1]/y[y.length-1];f.rc[c]=S;var k=y.map((function(t){return t*S}));j="Resolution mismatch for source ".concat(c,", got [").concat(k,"] but expected [").concat(e,"]");sb(e.slice(u,e.length),k,.02,j,f.viewRejector)}else e=y,f.rc[c]=1;r?sb(r.slice(u,r.length),p,0,"Tile size mismatch for source ".concat(c),f.viewRejector):r=p,f.ic[c]=h.reverse()},f=this,l=0;l<c;++l)h(l);for(var v=0,d=this.ic.length;v<d;++v)for(var p=this.ic[v];p.length<e.length;)p.unshift(void 0);if(!this.getProjection()){var y=t[0];for(v=y.length-1;v>=0;--v){var m=rb(y[v]);if(m){this.projection=m;break}}}this.ec=o,this.oc=s,this.sc=a;t:for(l=0;l<c;++l){if(void 0!==this.Qu[l].nodata){this.uc=!0;break}var w=s[l],b=this.Qu[l].bands;if(b){for(v=0;v<b.length;++v)if(!isNaN(w[b[v]-1])){this.uc=!0;break t}}else for(var g=0;g<w.length;++g)if(!isNaN(w[g])){this.uc=!0;break t}}var x=this.uc?1:0;this.bandCount=o.reduce((function(t,n){return t+=n}),0)+x;var j=new Jh({extent:n,minZoom:u,origin:i,resolutions:e,tileSizes:r});this.tileGrid=j,this.setLoader(this.fc.bind(this)),this.setState(ys),this.viewResolver({projection:this.projection,resolutions:e,center:zr(Hn(n),this.projection),extent:Lr(n,this.projection),zoom:0})},n.prototype.fc=function(t,n,i){for(var r=uu(this.tileGrid.getTileSize(t)),e=this.ic.length,o=new Array(e),s=this.uc,a=this.bandCount,u=this.ec,c=this.oc,h=this.Qu,f=function(e){var s=h[e],a=l.rc[e],u=[Math.round(n*(r[0]*a)),Math.round(i*(r[1]*a)),Math.round((n+1)*(r[0]*a)),Math.round((i+1)*(r[1]*a))],f=l.ic[e][t],v=void 0;s.bands&&(v=s.bands.map((function(t){return t-1})));var d=void 0;d=isNaN(s.nodata)?v?v.map((function(t){return c[e][t]})):c[e]:s.nodata,o[e]=f[l.cc]({window:u,width:r[0],height:r[1],samples:v,fillValue:d,pool:(Jw||(Jw=new Yw),Jw),interleave:!1})},l=this,v=0;v<e;++v)f(v);var d=r[0]*r[1],p=d*a,y=this.ac,m=this.sc;return Promise.all(o).then((function(t){var n;n=y?new Uint8Array(p):new Float32Array(p);for(var i=0,r=0;r<d;++r){for(var o=s,a=0;a<e;++a){var f=h[a],l=f.min,v=f.max,w=void 0,b=void 0;if(y){var g=m[a][0];void 0===l&&(l=g&&Qw in g?parseFloat(g.STATISTICS_MINIMUM):ab(t[a][0])),void 0===v&&(v=g&&$w in g?parseFloat(g.STATISTICS_MAXIMUM):ub(t[a][0])),b=-l*(w=255/(v-l))}for(var x=0;x<u[a];++x){var j=t[a][x][r],S=void 0;if(S=y?ci(w*j+b,0,255):j,s){var k=f.nodata;if(void 0===k){var M=void 0;M=f.bands?f.bands[x]-1:x,k=c[a][M]}j!==k&&(o=!1,n[i]=S)}else n[i]=S;i++}}s&&(o||(n[i]=255),i++)}return n}))},n}(Ud);cb.prototype.getView;var hb=cb,fb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lb="default",vb="truncated",db=function(t){function n(n,i,r,e,o,s,a){var u=t.call(this,i,r,e,o,s,a)||this;return u.lc=null,u.Oo=n,u}return fb(n,t),n.prototype.getImage=function(){if(this.lc)return this.lc;var n=t.prototype.getImage.call(this);if(this.state==dt){var i=this.Oo;if(n.width==i[0]&&n.height==i[1])return this.lc=n,n;var r=Oo(i[0],i[1]);return r.drawImage(n,0,0),this.lc=r.canvas,r.canvas}return n},n}(No),pb=function(t){function n(n){var i=this,r=n,e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.size,s=void 0!==r.tierSizeCalculation?r.tierSizeCalculation:lb,a=r.tilePixelRatio||1,u=o[0],c=o[1],h=[],f=r.tileSize||Ga,l=f*a;switch(s){case lb:for(;u>l||c>l;)h.push([Math.ceil(u/l),Math.ceil(c/l)]),l+=l;break;case vb:for(var v=u,d=c;v>l||d>l;)h.push([Math.ceil(v/l),Math.ceil(d/l)]),v>>=1,d>>=1;break;default:Mt(!1,53)}h.push([1,1]),h.reverse();for(var p=[a],y=[0],m=1,w=h.length;m<w;m++)p.push(a<<m),y.push(h[m-1][0]*h[m-1][1]+y[m-1]);p.reverse();var b=new Jh({tileSize:f,extent:r.extent||[0,-c,u,0],resolutions:p}),g=r.url;g&&-1==g.indexOf("{TileGroup}")&&-1==g.indexOf("{tileIndex}")&&(g+="{TileGroup}/{z}-{x}-{y}.jpg");var x=af(g),j=f*a;var S=of(x.map((function(t){return function(n,i,r){if(n){var e=n[0],o=n[1],s=n[2],a=o+s*h[e][0],u={z:e,x:o,y:s,tileIndex:a,TileGroup:"TileGroup"+((a+y[e])/j|0)};return t.replace(/\{(\w+?)\}/g,(function(t,n){return u[n]}))}}}))),k=db.bind(null,uu(f*a));(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,tilePixelRatio:a,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:k,tileGrid:b,tileUrlFunction:S,transition:r.transition})||this).zDirection=r.zDirection;var M=S(b.getTileCoordForCoordAndResolution(Hn(b.getExtent()),p[p.length-1]),1,null),_=new Image;return _.addEventListener("error",function(){j=f,this.changed()}.bind(i)),_.src=M,i}return fb(n,t),n}(gd),yb=function(t,n,i){if(i||2===arguments.length)for(var r,e=0,o=n.length;e<o;e++)!r&&e in n||(r||(r=Array.prototype.slice.call(n,0,e)),r[e]=n[e]);return t.concat(r||Array.prototype.slice.call(n))},mb="version1",wb="version2",bb="version3",gb={};gb[mb]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},gb[wb]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},gb[bb]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},gb.none={none:{supports:[],formats:[],qualities:[]}};var xb=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,jb=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,Sb=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;var kb={};kb[mb]=function(t){var n=t.getComplianceLevelSupportedFeatures();return void 0===n&&(n=gb[mb].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:n.supports,formats:yb(yb([],n.formats,!0),[void 0===t.imageInfo.formats?[]:t.imageInfo.formats],!1),qualities:yb(yb([],n.qualities,!0),[void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities],!1),resolutions:t.imageInfo.scale_factors,tileSize:void 0!==t.imageInfo.tile_width?void 0!==t.imageInfo.tile_height?[t.imageInfo.tile_width,t.imageInfo.tile_height]:[t.imageInfo.tile_width,t.imageInfo.tile_width]:null!=t.imageInfo.tile_height?[t.imageInfo.tile_height,t.imageInfo.tile_height]:void 0}},kb[wb]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,r=i&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],e=i&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=i&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:yb(yb([],n.supports,!0),r,!0),formats:yb(yb([],n.formats,!0),e,!0),qualities:yb(yb([],n.qualities,!0),o,!0)}},kb[bb]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=void 0===t.imageInfo.extraFormats?n.formats:yb(yb([],n.formats,!0),t.imageInfo.extraFormats,!0),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return y(["jpg","png","gif"],t)})).reduce((function(t,n){return void 0===t&&y(i,n)?n:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?n.supports:yb(yb([],n.supports,!0),t.imageInfo.extraFeatures,!0),formats:i,qualities:void 0===t.imageInfo.extraQualities?n.qualities:yb(yb([],n.qualities,!0),t.imageInfo.extraQualities,!0),preferredFormat:r}};var Mb=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var n=0;n<t.length;n++)switch(t[n]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return mb;case"http://iiif.io/api/image/2/context.json":return wb;case"http://iiif.io/api/image/3/context.json":return bb;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(mb)&&this.imageInfo.identifier)return mb}Mt(!1,61)}},t.prototype.getComplianceLevelEntryFromProfile=function(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case mb:if(xb.test(this.imageInfo.profile))return this.imageInfo.profile;break;case bb:if(Sb.test(this.imageInfo.profile))return this.imageInfo.profile;break;case wb:if("string"==typeof this.imageInfo.profile&&jb.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&"string"==typeof this.imageInfo.profile[0]&&jb.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var n=this.getComplianceLevelEntryFromProfile(t);if(void 0!==n){var i=n.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),n=this.getComplianceLevelFromProfile(t);return void 0===n?gb.none.none:gb[t][n]}},t.prototype.getTileSourceOptions=function(t){var n=t||{},i=this.getImageApiVersion();if(void 0!==i){var r=void 0===i?void 0:kb[i](this);if(void 0!==r)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==n.format&&y(r.formats,n.format)?n.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:n.quality&&y(r.qualities,n.quality)?n.quality:y(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,n){return n-t})):void 0,tileSize:r.tileSize}}},t}(),_b=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Ob(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Tb=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.url||"";o+=o.lastIndexOf("/")===o.length-1||""===o?"":"/";var s=r.version||wb,a=r.sizes||[],u=r.size;Mt(null!=u&&Array.isArray(u)&&2==u.length&&!isNaN(u[0])&&u[0]>0&&!isNaN(u[1])&&u[1]>0,60);var c,h,f,l=u[0],v=u[1],d=r.tileSize,p=r.tilePixelRatio||1,m=r.format||"jpg",w=r.quality||(r.version==mb?"native":"default"),b=r.resolutions||[],g=r.supports||[],x=r.extent||[0,-v,l,0],j=null!=a&&Array.isArray(a)&&a.length>0,S=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),k=null!=g&&Array.isArray(g)&&(y(g,"regionByPx")||y(g,"regionByPct"))&&(y(g,"sizeByWh")||y(g,"sizeByH")||y(g,"sizeByW")||y(g,"sizeByPct"));if(b.sort((function(t,n){return n-t})),S||k)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(c=d,h=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(c=d[0],h=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(c=d[0],h=d[1]):null==d[0]&&Number.isInteger(d[1])&&(c=d[1],h=d[1])))),void 0!==c&&void 0!==h||(c=Ga,h=Ga),0==b.length)for(var M=f=Math.max(Math.ceil(Math.log(l/c)/Math.LN2),Math.ceil(Math.log(v/h)/Math.LN2));M>=0;M--)b.push(Math.pow(2,M));else{var _=Math.max.apply(Math,b);f=Math.round(Math.log(_)/Math.LN2)}else if(c=l,h=v,b=[],j){a.sort((function(t,n){return t[0]-n[0]})),f=-1;var O=[];for(M=0;M<a.length;M++){var T=l/a[M][0];b.length>0&&b[b.length-1]==T?O.push(M):(b.push(T),f++)}if(O.length>0)for(M=0;M<O.length;M++)a.splice(O[M]-M,1)}else b.push(1),a.push([l,v]),f=0;var E=new Jh({tileSize:[c,h],extent:x,origin:$n(x),resolutions:b}),A=db.bind(null,uu(d||256).map((function(t){return t*p})));return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,state:r.state,tileClass:A,tileGrid:E,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:function(t,n,i){var r,e,u=t[0];if(!(u>f)){var d=t[1],p=t[2],x=b[u];if(!(void 0===d||void 0===p||void 0===x||d<0||Math.ceil(l/x/c)<=d||p<0||Math.ceil(v/x/h)<=p)){if(k||S){var M=d*c*x,_=p*h*x,O=c*x,T=h*x,E=c,A=h;if(M+O>l&&(O=l-M),_+T>v&&(T=v-_),M+c*x>l&&(E=Math.floor((l-M+x-1)/x)),_+h*x>v&&(A=Math.floor((v-_+x-1)/x)),0==M&&O==l&&0==_&&T==v)r="full";else if(!k||y(g,"regionByPx"))r=M+","+_+","+O+","+T;else if(y(g,"regionByPct")){r="pct:"+Ob(M/l*100)+","+Ob(_/v*100)+","+Ob(O/l*100)+","+Ob(T/v*100)}s!=bb||k&&!y(g,"sizeByWh")?!k||y(g,"sizeByW")?e=E+",":y(g,"sizeByH")?e=","+A:y(g,"sizeByWh")?e=E+","+A:y(g,"sizeByPct")&&(e="pct:"+Ob(100/x)):e=E+","+A}else if(r="full",j){var C=a[u][0],R=a[u][1];e=s==bb?C==l&&R==v?"max":C+","+R:C==l?"full":C+","}else e=s==bb?"max":"full";return o+r+"/"+e+"/0/"+w+"."+m}}},transition:r.transition})||this).zDirection=r.zDirection,i}return _b(n,t),n}(gd),Eb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ab=function(t){function n(n,i,r,e,o,s,a){var u=this,c=n.getExtent(),h=i.getExtent(),f=h?Zn(r,h):r,l=Wh(n,i,Hn(f),e),v=new pl(n,i,f,c,.5*l,e),d=s(v.calculateSourceExtent(),l,o),p=d?mo:xo,y=d?d.getPixelRatio():1;return(u=t.call(this,r,e,y,p)||this).ps=i,u.ws=c,u.zs=v,u.wi=e,u.vc=r,u.dc=d,u.yc=y,u.pu=a,u.Ut=null,u.mc=null,u}return Eb(n,t),n.prototype.disposeInternal=function(){this.state==wo&&this.wc(),t.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.Ut},n.prototype.getProjection=function(){return this.ps},n.prototype.Fs=function(){var t=this.dc.getState();if(t==bo){var n=ti(this.vc)/this.wi,i=Yn(this.vc)/this.wi;this.Ut=Xh(n,i,this.yc,this.dc.getResolution(),this.ws,this.wi,this.vc,this.zs,[{extent:this.dc.getExtent(),image:this.dc.getImage()}],0,void 0,this.pu)}this.state=t,this.changed()},n.prototype.load=function(){if(this.state==mo){this.state=wo,this.changed();var t=this.dc.getState();t==bo||t==go?this.Fs():(this.mc=Y(this.dc,N,(function(t){var n=this.dc.getState();n!=bo&&n!=go||(this.wc(),this.Fs())}),this),this.dc.load())}},n.prototype.wc=function(){$(this.mc),this.mc=null},n}(yo),Cb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rb="imageloadstart",Pb="imageloadend",Ib="imageloaderror",Nb=function(t){function n(n,i){var r=t.call(this,n)||this;return r.image=i,r}return Cb(n,t),n}(f);function zb(t,n){t.getImage().src=n}var Fb=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,projection:n.projection,state:n.state,interpolate:r})||this).on,i.once,i.un,i.Ti=void 0!==n.resolutions?n.resolutions:null,i.bc=null,i.gc=0,i}return Cb(n,t),n.prototype.getResolutions=function(){return this.Ti},n.prototype.findNearestResolution=function(t){if(this.Ti){var n=m(this.Ti,t,0);t=this.Ti[n]}return t},n.prototype.getImage=function(t,n,i,r){var e=this.getProjection();if(e&&r&&!Tr(e,r)){if(this.bc){if(this.gc==this.getRevision()&&Tr(this.bc.getProjection(),r)&&this.bc.getResolution()==n&&Nn(this.bc.getExtent(),t))return this.bc;this.bc.dispose(),this.bc=null}return this.bc=new Ab(e,r,t,n,i,function(t,n,i){return this.getImageInternal(t,n,i,e)}.bind(this),this.getInterpolate()),this.gc=this.getRevision(),this.bc}return e&&(r=e),this.getImageInternal(t,n,i,r)},n.prototype.getImageInternal=function(t,n,i,e){return r()},n.prototype.handleImageChange=function(t){var n,i=t.target;switch(i.getState()){case wo:this.loading=!0,n=Rb;break;case bo:this.loading=!1,n=Pb;break;case go:this.loading=!1,n=Ib;break;default:return}this.hasListener(n)&&this.dispatchEvent(new Nb(n,i))},n}(fd),Lb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gb=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Su=void 0===r.hidpi||r.hidpi,i.Ge=r.url,i.Ft=void 0!==r.imageLoadFunction?r.imageLoadFunction:zb,i.xc=r.params||{},i.Nt=null,i.jc=[0,0],i.Sc=0,i.kc=void 0!==r.ratio?r.ratio:1.5,i}return Lb(n,t),n.prototype.getParams=function(){return this.xc},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Ge)return null;n=this.findNearestResolution(n),i=this.Su?i:1;var e=this.Nt;if(e&&this.Sc==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&On(e.getExtent(),t))return e;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};E(o,this.xc);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.kc){var u=this.kc*ti(t)/2,c=this.kc*Yn(t)/2;t[0]=s-u,t[1]=a-c,t[2]=s+u,t[3]=a+c}var h=n/i,f=Math.ceil(ti(t)/h),l=Math.ceil(Yn(t)/h);t[0]=s-h*f/2,t[2]=s+h*f/2,t[1]=a-h*l/2,t[3]=a+h*l/2,this.jc[0]=f,this.jc[1]=l;var v=this.Mc(t,this.jc,i,r,o);return this.Nt=new ko(t,n,i,v,this.Bt,this.Ft),this.Sc=this.getRevision(),this.Nt.addEventListener(N,this.handleImageChange.bind(this)),this.Nt},n.prototype.getImageLoadFunction=function(){return this.Ft},n.prototype.Mc=function(t,n,i,r,e){var o=r.getCode().split(/:(?=\d+$)/).pop();e.SIZE=n[0]+","+n[1],e.BBOX=t.join(","),e.BBOXSR=o,e.IMAGESR=o,e.DPI=Math.round(90*i);var s=this.Ge,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&Mt(!1,50),uf(a,e)},n.prototype.getUrl=function(){return this.Ge},n.prototype.setImageLoadFunction=function(t){this.Nt=null,this.Ft=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Ge&&(this.Ge=t,this.Nt=null,this.changed())},n.prototype.updateParams=function(t){E(this.xc,t),this.Nt=null,this.changed()},n}(Fb),Db=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ub=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions,state:r.state})||this)._c=r.canvasFunction,i.Ut=null,i.Sc=0,i.kc=void 0!==r.ratio?r.ratio:1.5,i}return Db(n,t),n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n);var e=this.Ut;if(e&&this.Sc==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&On(e.getExtent(),t))return e;ei(t=t.slice(),this.kc);var o=[ti(t)/n*i,Yn(t)/n*i],s=this._c.call(this,t,n,i,o,r);return s&&(e=new _o(t,n,i,s)),this.Ut=e,this.Sc=this.getRevision(),e},n}(Fb),qb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Bb=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{interpolate:r,projection:n.projection,resolutions:n.resolutions})||this).Bt=void 0!==n.crossOrigin?n.crossOrigin:null,i.Oc=void 0!==n.displayDpi?n.displayDpi:96,i.xc=n.params||{},i.Ge=n.url,i.Ft=void 0!==n.imageLoadFunction?n.imageLoadFunction:zb,i.Su=void 0===n.hidpi||n.hidpi,i.dt=void 0!==n.metersPerUnit?n.metersPerUnit:1,i.kc=void 0!==n.ratio?n.ratio:1,i.Tc=void 0!==n.useOverlay&&n.useOverlay,i.Nt=null,i.Sc=0,i}return qb(n,t),n.prototype.getParams=function(){return this.xc},n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n),i=this.Su?i:1;var e=this.Nt;if(e&&this.Sc==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&On(e.getExtent(),t))return e;1!=this.kc&&ei(t=t.slice(),this.kc);var o=[ti(t)/n*i,Yn(t)/n*i];if(void 0!==this.Ge){var s=this.getUrl(this.Ge,this.xc,t,o,r);(e=new ko(t,n,i,s,this.Bt,this.Ft)).addEventListener(N,this.handleImageChange.bind(this))}else e=null;return this.Nt=e,this.Sc=this.getRevision(),e},n.prototype.getImageLoadFunction=function(){return this.Ft},n.prototype.updateParams=function(t){E(this.xc,t),this.changed()},n.prototype.getUrl=function(t,n,i,r,e){var o=function(t,n,i,r){var e=ti(t),o=Yn(t),s=n[0],a=n[1],u=.0254/r;return a*e>s*o?e*i/(s*u):o*i/(a*u)}(i,r,this.dt,this.Oc),s=Hn(i),a={OPERATION:this.Tc?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.Oc,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return E(a,n),uf(t,a)},n.prototype.setImageLoadFunction=function(t){this.Nt=null,this.Ft=t,this.changed()},n}(Fb),Wb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vb=function(t){function n(n){var i=this,r=void 0!==n.crossOrigin?n.crossOrigin:null,e=void 0!==n.imageLoadFunction?n.imageLoadFunction:zb,o=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(o=n.interpolate),(i=t.call(this,{attributions:n.attributions,interpolate:o,projection:gr(n.projection)})||this).Ge=n.url,i.Ec=n.imageExtent,i.Nt=new ko(i.Ec,void 0,1,i.Ge,r,e),i.jc=n.imageSize?n.imageSize:null,i.Nt.addEventListener(N,i.handleImageChange.bind(i)),i}return Wb(n,t),n.prototype.getImageExtent=function(){return this.Ec},n.prototype.getImageInternal=function(t,n,i,r){return ni(t,this.Nt.getExtent())?this.Nt:null},n.prototype.getUrl=function(){return this.Ge},n.prototype.handleImageChange=function(n){if(this.Nt.getState()==bo){var i=this.Nt.getExtent(),r=this.Nt.getImage(),e=void 0,o=void 0;this.jc?(e=this.jc[0],o=this.jc[1]):(e=r.width,o=r.height);var s=ti(i),a=Yn(i),u=s/e,c=a/o,h=e,f=o;if(u>c?h=Math.round(s/c):f=Math.round(a/u),h!==e||f!==o){var l=Oo(h,f);this.getInterpolate()||E(l,Dh);var v=l.canvas;l.drawImage(r,0,0,e,o,0,0,v.width,v.height),this.Nt.setImage(v)}}t.prototype.handleImageChange.call(this,n)},n}(Fb),Xb="1.3.0",Hb="carmentaserver",Jb="geoserver",Kb="mapserver",Yb="qgis",Zb=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$b=[101,101],Qb=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Ge=r.url,i.Ft=void 0!==r.imageLoadFunction?r.imageLoadFunction:zb,i.xc=r.params||{},i.Ac=!0,i.Cc(),i.Rc=r.serverType,i.Su=void 0===r.hidpi||r.hidpi,i.Nt=null,i.jc=[0,0],i.Sc=0,i.kc=void 0!==r.ratio?r.ratio:1.5,i}return Zb(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){if(void 0!==this.Ge){var e=gr(i),o=this.getProjection();o&&o!==e&&(n=Wh(o,e,t,n),t=Cr(t,e,o));var s=Kn(t,n,0,$b),a={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xc.LAYERS};E(a,this.xc,r);var u=xi((t[0]-s[0])/n,4),c=xi((s[3]-t[1])/n,4);return a[this.Ac?"I":"X"]=u,a[this.Ac?"J":"Y"]=c,this.Mc(s,$b,1,o||e,a)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.Ge){var i={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xc.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return E(i,n),uf(this.Ge,i)}},n.prototype.getParams=function(){return this.xc},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Ge)return null;n=this.findNearestResolution(n),1==i||this.Su&&void 0!==this.Rc||(i=1);var e=n/i,o=Hn(t),s=Kn(o,e,0,[ji(ti(t)/e,4),ji(Yn(t)/e,4)]),a=Kn(o,e,0,[ji(this.kc*ti(t)/e,4),ji(this.kc*Yn(t)/e,4)]),u=this.Nt;if(u&&this.Sc==this.getRevision()&&u.getResolution()==n&&u.getPixelRatio()==i&&On(u.getExtent(),s))return u;var c={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};E(c,this.xc),this.jc[0]=gi(ti(a)/e,4),this.jc[1]=gi(Yn(a)/e,4);var h=this.Mc(a,this.jc,i,r,c);return this.Nt=new ko(a,n,i,h,this.Bt,this.Ft),this.Sc=this.getRevision(),this.Nt.addEventListener(N,this.handleImageChange.bind(this)),this.Nt},n.prototype.getImageLoadFunction=function(){return this.Ft},n.prototype.Mc=function(t,n,i,r,e){if(Mt(void 0!==this.Ge,9),e[this.Ac?"CRS":"SRS"]=r.getCode(),"STYLES"in this.xc||(e.STYLES=""),1!=i)switch(this.Rc){case Jb:var o=90*i+.5|0;"FORMAT_OPTIONS"in e?e.FORMAT_OPTIONS+=";dpi:"+o:e.FORMAT_OPTIONS="dpi:"+o;break;case Kb:e.MAP_RESOLUTION=90*i;break;case Hb:case Yb:e.DPI=90*i;break;default:Mt(!1,8)}e.WIDTH=n[0],e.HEIGHT=n[1];var s,a=r.getAxisOrientation();return s=this.Ac&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,e.BBOX=s.join(","),uf(this.Ge,e)},n.prototype.getUrl=function(){return this.Ge},n.prototype.setImageLoadFunction=function(t){this.Nt=null,this.Ft=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Ge&&(this.Ge=t,this.Nt=null,this.changed())},n.prototype.updateParams=function(t){E(this.xc,t),this.Cc(),this.Nt=null,this.changed()},n.prototype.Cc=function(){var t=this.xc.VERSION||Xb;this.Ac=Ji(t,"1.3")>=0},n}(Fb),tg={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},ng={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function ig(t,n){for(var i,r,e=0;e<t.length;++e){var o=t[e];if("item"===o.rel){if(o.type===n){i=o.href;break}tg[o.type]?r=o.href:r||0!==o.type.indexOf("image/")||(r=o.href)}}if(!i){if(!r)throw new Error('Could not find "item" link');i=r}return i}function rg(t,n,i){for(var r,e,o={},s=0;s<t.length;++s){var a=t[s];if(o[a.type]=a.href,"item"===a.rel){if(a.type===n){r=a.href;break}ng[a.type]&&(e=a.href)}}if(!r&&i)for(s=0;s<i.length;++s){var u=i[s];if(o[u]){r=o[u];break}}if(!r){if(!e)throw new Error('Could not find "item" link');r=e}return r}function eg(t,n,i,r){var e=t.projection;if(!e&&!(e=gr(n.crs)))throw new Error("Unsupported CRS: ".concat(n.crs));for(var o="en"!==e.getAxisOrientation().substr(0,2),s=n.tileMatrices,a={},u=0;u<s.length;++u){var c=s[u];a[c.id]=c}var h={},f=[];if(r)for(u=0;u<r.length;++u){var l=(b=r[u]).tileMatrix;f.push(l),h[l]=b}else for(u=0;u<s.length;++u){l=s[u].id;f.push(l)}var v=f.length,d=new Array(v),p=new Array(v),y=new Array(v),m=new Array(v),w=[-1/0,-1/0,1/0,1/0];for(u=0;u<v;++u){l=f[u];var b,g=(c=a[l]).pointOfOrigin;if(d[u]=o?[g[1],g[0]]:g,p[u]=c.cellSize,y[u]=[c.matrixWidth,c.matrixHeight],m[u]=[c.tileWidth,c.tileHeight],b=h[l]){var x=c.cellSize*c.tileWidth,j=d[u][0]+b.minTileCol*x,S=d[u][0]+(b.maxTileCol+1)*x,k=c.cellSize*c.tileHeight,M=void 0,_=void 0;"bottomLeft"===c.cornerOfOrigin?(M=d[u][1]+b.minTileRow*k,_=d[u][1]+(b.maxTileRow+1)*k):(M=d[u][1]-(b.maxTileRow+1)*k,_=d[u][1]-b.minTileRow*k),Zn(w,[j,M,S,_],w)}}var O=new Jh({origins:d,resolutions:p,sizes:y,tileSizes:m,extent:r?w:void 0}),T=t.context,A=t.url;return{grid:O,urlTemplate:i,urlFunction:function(t,n,e){if(t){var o=f[t[0]],s=a[o],u="bottomLeft"===s.cornerOfOrigin,c={tileMatrix:o,tileCol:t[1],tileRow:u?-t[2]-1:t[2]};if(r){var l=h[s.id];if(c.tileCol<l.minTileCol||c.tileCol>l.maxTileCol||c.tileRow<l.minTileRow||c.tileRow>l.maxTileRow)return}E(c,T);var v=i.replace(/\{(\w+?)\}/g,(function(t,n){return c[n]}));return jh(A,v)}}}}function og(t){return xh(t.url).then((function(n){return function(t,n){var i,r=n.tileMatrixSetLimits;if("map"===n.dataType)i=ig(n.links,t.mediaType);else{if("vector"!==n.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');i=rg(n.links,t.mediaType,t.supportedMediaTypes)}if(n.tileMatrixSet)return eg(t,n.tileMatrixSet,i,r);var e=n.links.find((function(t){return"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===t.rel}));if(!e)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");var o=e.href;return xh(jh(t.url,o)).then((function(n){return eg(t,n,i,r)}))}(t,n)}))}var sg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ag=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:ps,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this,og({url:n.url,projection:i.getProjection(),mediaType:n.mediaType,context:n.context||null}).then(i.Pc.bind(i)).catch(i.Ic.bind(i)),i}return sg(n,t),n.prototype.Pc=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState(ys)},n.prototype.Ic=function(t){console.error(t),this.setState(ms)},n}(gd),ug=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cg=function(t){function n(n){var i=this,r=n.projection||"EPSG:3857",e=n.extent||nf(r),o=n.tileGrid||$h({extent:e,maxResolution:n.maxResolution,maxZoom:void 0!==n.maxZoom?n.maxZoom:22,minZoom:n.minZoom,tileSize:n.tileSize||512});return(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,interpolate:!0,opaque:!1,projection:r,state:n.state,tileGrid:o,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:hg,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:void 0===n.zDirection?1:n.zDirection})||this).Fe=n.format?n.format:null,i.sourceTileCache=new $c(i.tileCache.highWaterMark),i.zu=null==n.overlaps||n.overlaps,i.tileClass=n.tileClass?n.tileClass:sh,i.Nc={},i}return ug(n,t),n.prototype.getFeaturesInExtent=function(t){var n=[],i=this.tileCache;if(0===i.getCount())return n;var r=Jc(i.peekFirstKey())[0],e=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===r&&i.getState()===dt)for(var o=i.getSourceTiles(),s=0,a=o.length;s<a;++s){var u=o[s],c=u.tileCoord;if(ni(t,e.getTileCoordExtent(c))){var h=u.getFeatures();if(h)for(var f=0,l=h.length;f<l;++f){var v=h[f],d=v.getGeometry();ni(t,d.getExtent())&&n.push(v)}}}})),n},n.prototype.getOverlaps=function(){return this.zu},n.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},n.prototype.expireCache=function(n,i){var r=this.getTileCacheForProjection(n),e=Object.keys(i).reduce((function(t,n){var i=Hc(n);if(r.containsKey(i))for(var e=r.get(i).sourceTiles,o=0,s=e.length;o<s;++o)t[e[o].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,n,i),this.sourceTileCache.expireCache(e)},n.prototype.getSourceTiles=function(t,n,i){var r=this;if(i.getState()===lt){i.setState(vt);var e=i.wrappedTileCoord,o=this.getTileGridForProjection(n),s=o.getTileCoordExtent(e),a=e[0],u=o.getResolution(a);Sn(s,-u,s);var c=this.tileGrid,h=c.getExtent();h&&Zn(s,h,s);var f=c.getZForResolution(u,1);c.forEachTileCoord(s,f,(function(e){var o=r.tileUrlFunction(e,t,n),s=r.sourceTileCache.containsKey(o)?r.sourceTileCache.get(o):new r.tileClass(e,o?lt:yt,o,r.Fe,r.tileLoadFunction);i.sourceTiles.push(s);var a=s.getState();if(a<dt){s.addEventListener(N,(function t(n){r.handleTileChange(n);var e=s.getState();if(e===dt||e===pt){var o=s.getKey();o in i.errorTileKeys?s.getState()===dt&&delete i.errorTileKeys[o]:i.loadingSourceTiles--,e===pt?i.errorTileKeys[o]=!0:s.removeEventListener(N,t),0===i.loadingSourceTiles&&i.setState(R(i.errorTileKeys)?dt:pt)}})),i.loadingSourceTiles++}a===lt&&(s.extent=c.getTileCoordExtent(e),s.projection=n,s.resolution=c.getResolution(e[0]),r.sourceTileCache.set(o,s),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===pt}))?pt:dt)}return i.sourceTiles},n.prototype.getTile=function(t,n,i,r,e){var o,s=Vc(t,n,i),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var u=[t,n,i],c=this.getTileCoordForTileUrlFunction(u,e),h=this.getTileGrid().getExtent(),f=this.getTileGridForProjection(e);if(c&&h){var l=f.getTileCoordExtent(c);Sn(l,-f.getResolution(t),l),ni(h,l)||(c=null)}var v=!0;if(null!==c){var d=this.tileGrid,p=f.getResolution(t),y=d.getZForResolution(p,1),m=f.getTileCoordExtent(c);Sn(m,-p,m),d.forEachTileCoord(m,y,function(t){v=v&&!this.tileUrlFunction(t,r,e)}.bind(this))}var w=new eh(u,v?yt:lt,c,this.getSourceTiles.bind(this,r,e));return w.key=a,o?(w.interimTile=o,w.refreshInterimChain(),this.tileCache.replace(s,w)):this.tileCache.set(s,w),w},n.prototype.getTileGridForProjection=function(t){var n=t.getCode(),i=this.Nc[n];if(!i){var r=this.tileGrid;i=tf(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.Nc[n]=i}return i},n.prototype.getTilePixelRatio=function(t){return t},n.prototype.getTilePixelSize=function(t,n,i){var r=uu(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(r[0]*n),Math.round(r[1]*n)]},n.prototype.updateCacheSize=function(n,i){t.prototype.updateCacheSize.call(this,2*n,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},n}(md);function hg(t,n){t.setLoader((function(i,r,e){vh(n,t.getFormat(),i,r,e,t.onLoad.bind(t),t.onError.bind(t))}))}var fg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lg=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,format:n.format,overlaps:n.overlaps,projection:n.projection,tileClass:n.tileClass,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection,state:ps})||this;return og({url:n.url,projection:i.getProjection(),mediaType:n.mediaType,supportedMediaTypes:n.format.supportedMediaTypes,context:n.context||null}).then(i.Pc.bind(i)).catch(i.Ic.bind(i)),i}return fg(n,t),n.prototype.Pc=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState(ys)},n.prototype.Ic=function(t){console.error(t),this.setState(ms)},n}(cg),vg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dg='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',pg=function(t){function n(n){var i,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate),i=void 0!==r.attributions?r.attributions:[dg];var o=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",s=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:o,interpolate:e,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,opaque:void 0===r.opaque||r.opaque,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:s,wrapX:r.wrapX,zDirection:r.zDirection})||this}return vg(n,t),n}(Md),yg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mg=function(t){function n(n){var i=n||{};return t.call(this,i)||this}return yg(n,t),n}(gs),wg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bg=null;var gg,xg=function(t){function n(n){var i=t.call(this,n)||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.Vs=null,i.frameState=null,i}return wg(n,t),n.prototype.getImageData=function(t,n,i){var r,e;bg||((r=document.createElement("canvas")).width=1,r.height=1,bg=r.getContext("2d")),bg.clearRect(0,0,1,1);try{bg.drawImage(t,n,i,1,1,0,0,1,1),e=bg.getImageData(0,0,1,1).data}catch(t){return null}return e},n.prototype.getBackground=function(t){var n=this.getLayer().getBackground();return"function"==typeof n&&(n=n(t.viewState.resolution)),n||void 0},n.prototype.useContainer=function(t,n,i,r){var e,o,s=this.getLayer().getClassName();t&&t.className===s&&""===t.style.opacity&&1===i&&(!r||t.style.backgroundColor&&x(qo(t.style.backgroundColor),qo(r)))&&((u=t.firstElementChild)instanceof HTMLCanvasElement&&(o=u.getContext("2d")));if(o&&o.canvas.style.transform===n?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(e=document.createElement("div")).className=s;var a=e.style;a.position="absolute",a.width="100%",a.height="100%",r&&(a.backgroundColor=r);var u=(o=Oo()).canvas;e.appendChild(u),(a=u.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=e,this.context=o}},n.prototype.clipUnrotated=function(t,n,i){var r=$n(i),e=Qn(i),o=Xn(i),s=Vn(i);rn(n.coordinateToPixelTransform,r),rn(n.coordinateToPixelTransform,e),rn(n.coordinateToPixelTransform,o),rn(n.coordinateToPixelTransform,s);var a=this.inversePixelTransform;rn(a,r),rn(a,e),rn(a,o),rn(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(e[0]),Math.round(e[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},n.prototype.Hs=function(t,n,i){var r=this.getLayer();if(r.hasListener(t)){var e=new Ms(t,this.inversePixelTransform,i,n);r.dispatchEvent(e)}},n.prototype.preRender=function(t,n){this.frameState=n,this.Hs(cs,t,n)},n.prototype.postRender=function(t,n){this.Hs(hs,t,n)},n.prototype.getRenderTransform=function(t,n,i,r,e,o,s){var a=e/2,u=o/2,c=r/n,h=-c,f=-t[0]+s,l=-t[1];return un(this.tempTransform,a,u,c,h,-i,f,l)},n.prototype.getDataAtPixel=function(t,n,i){var r=rn(this.inversePixelTransform,t.slice()),e=this.context,o=this.getLayer().getExtent();if(o&&!_n(o,rn(n.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(r[0]),u=Math.round(r[1]),c=this.Vs;if(!c){var h=document.createElement("canvas");h.width=1,h.height=1,c=h.getContext("2d"),this.Vs=c}c.clearRect(0,0,1,1);try{c.drawImage(e.canvas,a,u,1,1,0,0,1,1),s=c.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.Vs=null,new Uint8Array):s}return 0===s[3]?null:s},n.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},n}(kl),jg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sg=function(t){function n(n){var i=t.call(this,n)||this;return i.Nt=null,i}return jg(n,t),n.prototype.getImage=function(){return this.Nt?this.Nt.getImage():null},n.prototype.prepareFrame=function(t){var n=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,r=t.viewState,e=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==n.extent&&(a=Zn(a,Gr(n.extent,r.projection))),!s[za]&&!s[Fa]&&!ii(a))if(o){var u=r.projection,c=o.getImage(a,e,i,u);c&&(this.loadImage(c)?this.Nt=c:c.getState()===xo&&(this.Nt=null))}else this.Nt=null;return!!this.Nt},n.prototype.getData=function(t){var n=this.frameState;if(!n)return null;var i=this.getLayer(),r=rn(n.pixelToCoordinateTransform,t.slice()),e=i.getExtent();if(e&&!_n(e,r))return null;var o=this.Nt.getExtent(),s=this.Nt.getImage(),a=ti(o),u=Math.floor(s.width*((r[0]-o[0])/a));if(u<0||u>=s.width)return null;var c=Yn(o),h=Math.floor(s.height*((o[3]-r[1])/c));return h<0||h>=s.height?null:this.getImageData(s,u,h)},n.prototype.renderFrame=function(t,n){var i=this.Nt,r=i.getExtent(),e=i.getResolution(),o=i.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,c=u.center,h=u.resolution,f=t.size,l=a*e/(h*o),v=Math.round(f[0]*a),d=Math.round(f[1]*a),p=u.rotation;if(p){var y=Math.round(Math.sqrt(v*v+d*d));v=y,d=y}un(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-v/2,-d/2),cn(this.inversePixelTransform,this.pixelTransform);var m=fn(this.pixelTransform);this.useContainer(n,m,s.opacity,this.getBackground(t));var w=this.context,b=w.canvas;b.width!=v||b.height!=d?(b.width=v,b.height=d):this.containerReused||w.clearRect(0,0,v,d);var g=!1,x=!0;if(s.extent){var j=Gr(s.extent,u.projection);(g=(x=ni(j,t.extent))&&!On(j,t.extent))&&this.clipUnrotated(w,t,j)}var S=i.getImage(),k=un(this.tempTransform,v/2,d/2,l,l,0,o*(r[0]-c[0])/e,o*(c[1]-r[3])/e);this.renderedResolution=e*a/o;var M=S.width*k[0],_=S.height*k[3];if(this.getLayer().getSource().getInterpolate()||E(w,Dh),this.preRender(w,t),x&&M>=.5&&_>=.5){var O=k[4],T=k[5],A=s.opacity,C=void 0;1!==A&&(C=w.globalAlpha,w.globalAlpha=A),w.drawImage(S,0,0,+S.width,+S.height,Math.round(O),Math.round(T),Math.round(M),Math.round(_)),1!==A&&(w.globalAlpha=C)}return this.postRender(w,t),g&&w.restore(),E(w,Uh),m!==b.style.transform&&(b.style.transform=m),this.container},n}(xg),kg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mg=function(t){function n(n){return t.call(this,n)||this}return kg(n,t),n.prototype.createRenderer=function(){return new Sg(this)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}(mg),_g="preload",Og="useInterimTilesOnError",Tg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Eg=function(t){function n(n){var i=this,r=n||{},e=E({},r);return delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,i.setPreload(void 0!==r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return Tg(n,t),n.prototype.getPreload=function(){return this.get(_g)},n.prototype.setPreload=function(t){this.set(_g,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(Og)},n.prototype.setUseInterimTilesOnError=function(t){this.set(Og,t)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}(gs),Ag=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cg=function(t){function n(n){var i=t.call(this,n)||this;return i.extentChanged=!0,i.zc=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.Fc=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.Lc=new nh(0,0,0,0),i}return Ag(n,t),n.prototype.isDrawableTile=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==dt||i==yt||i==pt&&!r},n.prototype.getTile=function(t,n,i,r){var e=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,n,i,e,o);return a.getState()==pt&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.Fc=!0):a.setState(dt)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},n.prototype.getData=function(t){var n=this.frameState;if(!n)return null;var i=this.getLayer(),r=rn(n.pixelToCoordinateTransform,t.slice()),e=i.getExtent();if(e&&!_n(e,r))return null;for(var o=n.pixelRatio,s=n.viewState.projection,a=n.viewState,u=i.getRenderSource(),c=u.getTileGridForProjection(a.projection),h=u.getTilePixelRatio(n.pixelRatio),f=c.getZForResolution(a.resolution);f>=c.getMinZoom();--f){var l=c.getTileCoordForCoordAndZ(r,f),v=u.getTile(f,l[1],l[2],o,s);if(!(v instanceof No||v instanceof ml))return null;if(v.getState()===dt){var d=c.getOrigin(f),p=uu(c.getTileSize(f)),y=c.getResolution(f),m=Math.floor(h*((r[0]-d[0])/y-l[1]*p[0])),w=Math.floor(h*((d[1]-r[1])/y-l[2]*p[1]));return this.getImageData(v.getImage(),m,w)}}return null},n.prototype.loadedTileCallback=function(n,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,n,i,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,e=r.projection,s=r.resolution,a=r.center,u=r.rotation,c=t.pixelRatio,h=this.getLayer(),f=h.getSource(),l=f.getRevision(),v=f.getTileGridForProjection(e),d=v.getZForResolution(s,f.zDirection),y=v.getResolution(d),m=t.extent,w=i.extent&&Gr(i.extent,e);w&&(m=Zn(m,Gr(i.extent,e)));var b=f.getTilePixelRatio(c),g=Math.round(t.size[0]*b),x=Math.round(t.size[1]*b);if(u){var j=Math.round(Math.sqrt(g*g+x*x));g=j,x=j}var S=y*g/2/b,k=y*x/2/b,M=[a[0]-S,a[1]-k,a[0]+S,a[1]+k],_=v.getTileRangeForExtentAndZ(m,d),O={};O[d]={};var T=this.createLoadedTileFinder(f,e,O),A=this.tmpExtent,C=this.Lc;this.Fc=!1;for(var R=_.minX;R<=_.maxX;++R)for(var P=_.minY;P<=_.maxY;++P){var I=this.getTile(d,R,P,t);if(this.isDrawableTile(I)){var N=o(this);if(I.getState()==dt){O[d][I.tileCoord.toString()]=I;var z=I.inTransition(N);this.Fc||!z&&-1!==this.renderedTiles.indexOf(I)||(this.Fc=!0)}if(1===I.getAlpha(N,t.time))continue}var F=v.getTileCoordChildTileRange(I.tileCoord,C,A),L=!1;F&&(L=T(d+1,F)),L||v.forEachTileCoordParentTileRange(I.tileCoord,T,C,A)}var G=y/s;un(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/b,1/b,u,-g/2,-x/2);var D=fn(this.pixelTransform);this.useContainer(n,D,i.opacity,this.getBackground(t));var U=this.context,q=U.canvas;cn(this.inversePixelTransform,this.pixelTransform),un(this.tempTransform,g/2,x/2,G,G,0,-g/2,-x/2),q.width!=g||q.height!=x?(q.width=g,q.height=x):this.containerReused||U.clearRect(0,0,g,x),w&&this.clipUnrotated(U,t,w),f.getInterpolate()||E(U,Dh),this.preRender(U,t),this.renderedTiles.length=0;var B,W,V,X=Object.keys(O).map(Number);X.sort(p),1!==i.opacity||this.containerReused&&!f.getOpaque(t.viewState.projection)?(B=[],W=[]):X=X.reverse();for(var H=X.length-1;H>=0;--H){var J=X[H],K=f.getTilePixelSize(J,c,e),Y=v.getResolution(J)/y,Z=K[0]*Y*G,$=K[1]*Y*G,Q=v.getTileCoordForCoordAndZ($n(M),J),tt=v.getTileCoordExtent(Q),nt=rn(this.tempTransform,[b*(tt[0]-M[0])/y,b*(M[3]-tt[3])/y]),it=b*f.getGutterForProjection(e),rt=O[J];for(var et in rt){var ot=(I=rt[et]).tileCoord,st=Q[1]-ot[1],at=Math.round(nt[0]-(st-1)*Z),ut=Q[2]-ot[2],ct=Math.round(nt[1]-(ut-1)*$),ht=at-(R=Math.round(nt[0]-st*Z)),ft=ct-(P=Math.round(nt[1]-ut*$)),lt=d===J,vt=!1;if(!(z=lt&&1!==I.getAlpha(o(this),t.time)))if(B){V=[R,P,R+ht,P,R+ht,P+ft,R,P+ft];for(var pt=0,yt=B.length;pt<yt;++pt)if(d!==J&&J<W[pt]){var mt=B[pt];ni([R,P,R+ht,P+ft],[mt[0],mt[3],mt[4],mt[7]])&&(vt||(U.save(),vt=!0),U.beginPath(),U.moveTo(V[0],V[1]),U.lineTo(V[2],V[3]),U.lineTo(V[4],V[5]),U.lineTo(V[6],V[7]),U.moveTo(mt[6],mt[7]),U.lineTo(mt[4],mt[5]),U.lineTo(mt[2],mt[3]),U.lineTo(mt[0],mt[1]),U.clip())}B.push(V),W.push(J)}else U.clearRect(R,P,ht,ft);this.drawTileImage(I,t,R,P,ht,ft,it,lt),B&&!z?(vt&&U.restore(),this.renderedTiles.unshift(I)):this.renderedTiles.push(I),this.updateUsedTiles(t.usedTiles,f,I)}}this.renderedRevision=l,this.renderedResolution=y,this.extentChanged=!this.zc||!Nn(this.zc,M),this.zc=M,this.renderedPixelRatio=c,this.renderedProjection=e,this.manageTilePyramid(t,f,v,c,e,m,d,h.getPreload()),this.scheduleExpireCache(t,f),this.postRender(U,t),i.extent&&U.restore(),E(U,Uh),D!==q.style.transform&&(q.style.transform=D);var wt=Ns(i.opacity),bt=this.container;return wt!==bt.style.opacity&&(bt.style.opacity=wt),this.container},n.prototype.drawTileImage=function(t,n,i,r,e,s,a,u){var c=this.getTileImage(t);if(c){var h=o(this),f=u?t.getAlpha(h,n.time):1,l=f!==this.context.globalAlpha;l&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,r,e,s),l&&this.context.restore(),1!==f?n.animate=!0:u&&t.endTransition(h)}},n.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},n.prototype.getTileImage=function(t){return t.getImage()},n.prototype.scheduleExpireCache=function(t,n){if(n.canExpireCache()){var i=function(t,n,i){var r=o(t);r in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,n);t.postRenderFunctions.push(i)}},n.prototype.updateUsedTiles=function(t,n,i){var r=o(n);r in t||(t[r]={}),t[r][i.getKey()]=!0},n.prototype.manageTilePyramid=function(t,n,i,r,e,s,a,u,c){var h=o(n);h in t.wantedTiles||(t.wantedTiles[h]={});var f,l,v,d,p,y,m=t.wantedTiles[h],w=t.tileQueue,b=0;for(y=i.getMinZoom();y<=a;++y)for(l=i.getTileRangeForExtentAndZ(s,y,l),v=i.getResolution(y),d=l.minX;d<=l.maxX;++d)for(p=l.minY;p<=l.maxY;++p)a-y<=u?(++b,(f=n.getTile(y,d,p,r,e)).getState()==lt&&(m[f.getKey()]=!0,w.isKeyQueued(f.getKey())||w.enqueue([f,h,i.getTileCoordCenter(f.tileCoord),v])),void 0!==c&&c(f)):n.useTile(y,d,p,e);n.updateCacheSize(b,e)},n}(xg),Rg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pg=function(t){function n(n){return t.call(this,n)||this}return Rg(n,t),n.prototype.createRenderer=function(){return new Cg(this)},n}(Eg),Ig=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ng=!0;try{new ImageData(10,10)}catch(t){Ng=!1}function zg(t,n,i){if(Ng)return new ImageData(t,n,i);gg||(gg=document.createElement("canvas").getContext("2d"));var r=gg.createImageData(n,i);return r.data.set(t),r}function Fg(t){var n=!0;try{new ImageData(10,10)}catch(t){n=!1}function i(t,i,r){return n?new ImageData(t,i,r):{data:t,width:i,height:r}}return function(n){var r=n.buffers,e=n.meta,o=n.imageOps,s=n.width,a=n.height,u=r.length,c=r[0].byteLength;if(o){for(var h=new Array(u),f=0;f<u;++f)h[f]=i(new Uint8ClampedArray(r[f]),s,a);return t(h,e).data.buffer}var l=new Uint8ClampedArray(c),v=new Array(u),d=new Array(u);for(f=0;f<u;++f)v[f]=new Uint8ClampedArray(r[f]),d[f]=[0,0,0,0];for(var p=0;p<c;p+=4){for(var y=0;y<u;++y){var m=v[y];d[y][0]=m[p],d[y][1]=m[p+1],d[y][2]=m[p+2],d[y][3]=m[p+3]}var w=t(d,e);l[p]=w[0],l[p+1]=w[1],l[p+2]=w[2],l[p+3]=w[3]}return l.buffer}}function Lg(t,n){var i=Object.keys(t.lib||{}).map((function(n){return"var "+n+" = "+t.lib[n].toString()+";"})).concat(["var __minion__ = ("+Fg.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker("undefined"==typeof Blob?"data:text/javascript;base64,"+Buffer.from(i.join("\n"),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",n),r}var Gg=function(t){function n(n){var i,r=t.call(this)||this;r._imageOps=!!n.imageOps,i=0===n.threads?0:r._imageOps?1:n.threads||1;var e=new Array(i);if(i)for(var o=0;o<i;++o)e[o]=Lg(n,r._onWorkerMessage.bind(r,o));else e[0]=function(t,n){var i=Fg(t.operation),r=!1;return{postMessage:function(t){setTimeout((function(){r||n({data:{buffer:i(t),meta:t.meta}})}),0)},terminate:function(){r=!0}}}(n,r._onWorkerMessage.bind(r,0));return r._workers=e,r._queue=[],r._maxQueueLength=n.queue||1/0,r._running=0,r._dataLookup={},r._job=null,r}return Ig(n,t),n.prototype.process=function(t,n,i){this._enqueue({inputs:t,meta:n,callback:i}),this._dispatch()},n.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},n.prototype._dispatch=function(){if(!this._running&&0!==this._queue.length){var t=this._queue.shift();this._job=t;var n=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),e=this._workers.length;if(this._running=e,1!==e)for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/e),a=0;a<e;++a){for(var u=a*s,c=[],h=0,f=r.length;h<f;++h)c.push(r[h].slice(u,u+s));this._workers[a].postMessage({buffers:c,meta:t.meta,imageOps:this._imageOps,width:n,height:i},c)}else this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:n,height:i},r)}},n.prototype._onWorkerMessage=function(t,n){this.disposed||(this._dataLookup[t]=n.data,--this._running,0===this._running&&this._resolveJob())},n.prototype._resolveJob=function(){var t,n,i=this._job,r=this._workers.length;if(1===r)t=new Uint8ClampedArray(this._dataLookup[0].buffer),n=this._dataLookup[0].meta;else{var e=i.inputs[0].data.length;t=new Uint8ClampedArray(e),n=new Array(r);for(var o=4*Math.ceil(e/4/r),s=0;s<r;++s){var a=this._dataLookup[s].buffer,u=s*o;t.set(new Uint8ClampedArray(a),u),n[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},i.callback(null,zg(t,i.inputs[0].width,i.inputs[0].height),n),this._dispatch()},n.prototype.disposeInternal=function(){for(var t=0;t<this._workers.length;++t)this._workers[t].terminate();this._workers.length=0},n}(v),Dg="beforeoperations",Ug="afteroperations",qg="pixel",Bg="image",Wg=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.extent=i.extent,e.resolution=i.viewState.resolution/i.pixelRatio,e.data=r,e}return Ig(n,t),n}(f),Vg=function(t){function n(n){var i=t.call(this,{projection:null})||this;i.on,i.once,i.un,i.Gc=null,i.Dc=void 0!==n.operationType?n.operationType:qg,i.Uc=void 0!==n.threads?n.threads:1,i.qc=function(t){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=Jg(t[r]);return i}(n.sources);for(var r,e=i.changed.bind(i),s=0,a=i.qc.length;s<a;++s)i.qc[s].addEventListener(N,e);return i.cr=new Ia((function(){return 1}),i.changed.bind(i)),i.Bc,i.Wc=null,i.Sc,i.Ji={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],declutterTree:null,extent:null,index:0,layerIndex:0,layerStatesArray:(r=i.qc,r.map((function(t){return t.getLayerState()}))),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:i.cr,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:o(i),renderTargets:{}},i.setAttributions((function(t){for(var i=[],r=0,e=n.sources.length;r<e;++r){var o=n.sources[r],s=(o instanceof fd?o:o.getSource()).getAttributions();if("function"==typeof s){var a=s(t);i.push.apply(i,a)}}return 0!==i.length?i:null})),void 0!==n.operation&&i.setOperation(n.operation,n.lib),i}return Ig(n,t),n.prototype.setOperation=function(t,n){this.Gc&&this.Gc.dispose(),this.Gc=new Gg({operation:t,imageOps:this.Dc===Bg,queue:1,lib:n,threads:this.Uc}),this.changed()},n.prototype.Vc=function(t,n,i){var r=E({},this.Ji);r.viewState=E({},r.viewState);var e=Hn(t);r.extent=t.slice(),r.size[0]=Math.round(ti(t)/n),r.size[1]=Math.round(Yn(t)/n),r.time=Date.now();var o=r.viewState;return o.center=e,o.projection=i,o.resolution=n,r},n.prototype.Xc=function(){for(var t=!0,n=0,i=this.qc.length;n<i;++n)if(this.qc[n].getSource().getState()!==ys){t=!1;break}return t},n.prototype.getImage=function(t,n,i,r){if(!this.Xc())return null;var e=this.Vc(t,n,r);if(this.Bc=e,this.Wc){var o=this.Wc.getResolution(),s=this.Wc.getExtent();n===o&&Nn(t,s)||(this.Wc=null)}return this.Wc&&this.getRevision()===this.Sc||this.Hc(),e.tileQueue.loadMoreTiles(16,16),e.animate&&requestAnimationFrame(this.changed.bind(this)),this.Wc},n.prototype.Hc=function(){for(var t=this.Bc,n=this.qc.length,i=new Array(n),r=0;r<n;++r){t.layerIndex=r;var e=Hg(this.qc[r],t);if(!e)return;i[r]=e}var o={};this.dispatchEvent(new Wg(Dg,t,o)),this.Gc.process(i,o,this.Jc.bind(this,t))},n.prototype.Jc=function(t,n,i,r){if(!n&&i){var e=t.extent,o=t.viewState.resolution;if(o===this.Bc.viewState.resolution&&Nn(e,this.Bc.extent)){var s;if(this.Wc)s=this.Wc.getImage().getContext("2d");else s=Oo(Math.round(ti(e)/o),Math.round(Yn(e)/o)),this.Wc=new _o(e,o,1,s.canvas);s.putImageData(i,0,0),this.changed(),this.Sc=this.getRevision(),this.dispatchEvent(new Wg(Ug,t,r)),t.animate&&requestAnimationFrame(this.changed.bind(this))}}},n.prototype.disposeInternal=function(){this.Gc&&this.Gc.dispose(),t.prototype.disposeInternal.call(this)},n}(Fb);Vg.prototype.dispose;var Xg=null;function Hg(t,n){var i=t.getRenderer();if(!i)throw new Error("Unsupported layer type: "+t);if(!i.prepareFrame(n))return null;var r=n.size[0],e=n.size[1];if(0===r||0===e)return null;var o,s=i.renderFrame(n,null);if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===r&&o.height===e)return o.getContext("2d").getImageData(0,0,r,e)}if(Xg){var a=Xg.canvas;a.width!==r||a.height!==e?Xg=Oo(r,e):Xg.clearRect(0,0,r,e)}else Xg=Oo(r,e);return Xg.drawImage(o,0,0,r,e),Xg.getImageData(0,0,r,e)}function Jg(t){var n;return t instanceof fd?t instanceof pd?n=new Pg({source:t}):t instanceof Fb&&(n=new Mg({source:t})):n=t,n}var Kg=Vg,Yg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zg=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',dg],$g={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},Qg={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},tx=function(t){function n(n){var i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var r=n.layer.indexOf("-"),e=-1==r?n.layer:n.layer.slice(0,r),o=Qg[e],s=$g[n.layer],a=void 0!==n.url?n.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+n.layer+"/{z}/{x}/{y}."+s.extension;return t.call(this,{attributions:Zg,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:i,maxZoom:null!=n.maxZoom?n.maxZoom:o.maxZoom,minZoom:null!=n.minZoom?n.minZoom:o.minZoom,opaque:s.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Yg(n,t),n}(Md),nx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ix=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).xc=r.params||{},i.Su=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.setKey(i.Kc()),i}return nx(n,t),n.prototype.Kc=function(){var t=0,n=[];for(var i in this.xc)n[t++]=i+"-"+this.xc[i];return n.join("/")},n.prototype.getParams=function(){return this.xc},n.prototype.Mc=function(t,n,i,r,e,o){var s=this.urls;if(s){var a,u=e.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=n[0]+","+n[1],o.BBOX=i.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[mi(Kc(t),s.length)];return uf(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},n.prototype.getTilePixelRatio=function(t){return this.Su?t:1},n.prototype.updateParams=function(t){E(this.xc,t),this.setKey(this.Kc())},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this.Su||(n=1);var e=r.getTileCoordExtent(t,this.Ao),o=uu(r.getTileSize(t[0]),this.tmpSize);1!=n&&(o=au(o,n,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return E(s,this.xc),this.Mc(t,o,e,n,i,s)}},n}(gd),rx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ex=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,n){var r=t.getTileCoord()[0],e=uu(i.tileGrid.getTileSize(r)),o=Oo(e[0],e[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,e[0]+.5,e[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,e[0]/2,e[1]/2,e[0]),o.fillText(n,e[0]/2,e[1]/2,e[0]),t.setImage(o.canvas)}})||this}return rx(n,t),n}(Md),ox=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sx=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;if(void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:gr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:ps,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Yc=null,i.Oo=n.tileSize,n.url)if(n.jsonp)mh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var e=new XMLHttpRequest;e.addEventListener("load",i.Zc.bind(i)),e.addEventListener("error",i.$c.bind(i)),e.open("GET",n.url),e.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):Mt(!1,51);return i}return ox(n,t),n.prototype.Zc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.$c=function(t){this.handleTileJSONError()},n.prototype.getTileJSON=function(){return this.Yc},n.prototype.handleTileJSONResponse=function(t){var n,i=gr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Er(i,r);n=si(t.bounds,e)}var o=nf(r),s=t.minzoom||0,a=$h({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.Oo});if(this.tileGrid=a,this.tileUrlFunction=ef(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var u=void 0!==n?n:o;this.setAttributions((function(n){return ni(u,n.extent)?[t.attribution]:null}))}this.Yc=t,this.setState(ys)},n.prototype.handleTileJSONError=function(){this.setState(ms)},n}(gd),ax=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ux=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.params||{},s=!("TRANSPARENT"in o)||o.TRANSPARENT;return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,opaque:!s,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).Es=void 0!==r.gutter?r.gutter:0,i.xc=o,i.Ac=!0,i.Rc=r.serverType,i.Su=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.Cc(),i.setKey(i.Kc()),i}return ax(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){var e=gr(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(e));var a=s.getZForResolution(n,this.zDirection),u=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=u[0])){var c=s.getResolution(u[0]),h=s.getTileCoordExtent(u,this.Ao),f=uu(s.getTileSize(u[0]),this.tmpSize),l=this.Es;0!==l&&(f=ou(f,l,this.tmpSize),h=Sn(h,c*l,h)),o&&o!==e&&(c=Wh(o,e,t,c),h=Rr(h,e,o),t=Cr(t,e,o));var v={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xc.LAYERS};E(v,this.xc,r);var d=Math.floor((t[0]-h[0])/c),p=Math.floor((h[3]-t[1])/c);return v[this.Ac?"I":"X"]=d,v[this.Ac?"J":"Y"]=p,this.Mc(u,f,h,1,o||e,v)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xc.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return E(i,n),uf(this.urls[0],i)}},n.prototype.getGutter=function(){return this.Es},n.prototype.getParams=function(){return this.xc},n.prototype.Mc=function(t,n,i,r,e,o){var s=this.urls;if(s){if(o.WIDTH=n[0],o.HEIGHT=n[1],o[this.Ac?"CRS":"SRS"]=e.getCode(),"STYLES"in this.xc||(o.STYLES=""),1!=r)switch(this.Rc){case Jb:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case Kb:o.MAP_RESOLUTION=90*r;break;case Hb:case Yb:o.DPI=90*r;break;default:Mt(!1,52)}var u,c=e.getAxisOrientation(),h=i;if(this.Ac&&"ne"==c.substr(0,2)){var f=void 0;f=i[0],h[0]=i[1],h[1]=f,f=i[2],h[2]=i[3],h[3]=f}if(o.BBOX=h.join(","),1==s.length)u=s[0];else u=s[mi(Kc(t),s.length)];return uf(u,o)}},n.prototype.getTilePixelRatio=function(t){return this.Su&&void 0!==this.Rc?t:1},n.prototype.Kc=function(){var t=0,n=[];for(var i in this.xc)n[t++]=i+"-"+this.xc[i];return n.join("/")},n.prototype.updateParams=function(t){E(this.xc,t),this.Cc(),this.setKey(this.Kc())},n.prototype.Cc=function(){var t=this.xc.VERSION||Xb;this.Ac=Ji(t,"1.3")>=0},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this.Su&&void 0!==this.Rc||(n=1);var e=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.Ao),s=uu(r.getTileSize(t[0]),this.tmpSize),a=this.Es;0!==a&&(s=ou(s,a,this.tmpSize),o=Sn(o,e*a,o)),1!=n&&(s=au(s,n,this.tmpSize));var u={SERVICE:"WMS",VERSION:Xb,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return E(u,this.xc),this.Mc(t,s,o,n,i,u)}},n}(gd),cx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hx=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i)||this;return a.Pt=r,a.st=e,a.Qc=o,a.th=null,a.nh=null,a.B=null,a.ih=s,a}return cx(n,t),n.prototype.getImage=function(){return null},n.prototype.getData=function(t){if(!this.th||!this.nh)return null;var n=(t[0]-this.st[0])/(this.st[2]-this.st[0]),i=(t[1]-this.st[1])/(this.st[3]-this.st[1]),r=this.th[Math.floor((1-i)*this.th.length)];if("string"!=typeof r)return null;var e=r.charCodeAt(Math.floor(n*r.length));e>=93&&e--,e>=35&&e--;var o=null;if((e-=32)in this.nh){var s=this.nh[e];o=this.B&&s in this.B?this.B[s]:s}return o},n.prototype.forDataAtCoordinate=function(t,n,i){this.state==yt&&!0===i?(this.state=lt,Z(this,N,(function(i){n(this.getData(t))}),this),this.rh()):!0===i?setTimeout(function(){n(this.getData(t))}.bind(this),0):n(this.getData(t))},n.prototype.getKey=function(){return this.Pt},n.prototype.Ic=function(){this.state=pt,this.changed()},n.prototype.qt=function(t){this.th=t.grid,this.nh=t.keys,this.B=t.data,this.state=dt,this.changed()},n.prototype.rh=function(){if(this.state==lt)if(this.state=vt,this.ih)mh(this.Pt,this.qt.bind(this),this.Ic.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.Zc.bind(this)),t.addEventListener("error",this.$c.bind(this)),t.open("GET",this.Pt),t.send()}},n.prototype.Zc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.Ic()}this.qt(i)}else this.Ic()},n.prototype.$c=function(t){this.Ic()},n.prototype.load=function(){this.Qc?this.rh():this.setState(yt)},n}(jt),fx=function(t){function n(n){var i=t.call(this,{projection:gr("EPSG:3857"),state:ps,zDirection:n.zDirection})||this;if(i.Qc=void 0===n.preemptive||n.preemptive,i.eh=sf,i.oh=void 0,i.ih=n.jsonp||!1,n.url)if(i.ih)mh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var r=new XMLHttpRequest;r.addEventListener("load",i.Zc.bind(i)),r.addEventListener("error",i.$c.bind(i)),r.open("GET",n.url),r.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):Mt(!1,51);return i}return cx(n,t),n.prototype.Zc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.$c=function(t){this.handleTileJSONError()},n.prototype.getTemplate=function(){return this.oh},n.prototype.forDataAtCoordinateAndResolution=function(t,n,i,r){if(this.tileGrid){var e=this.tileGrid.getZForResolution(n,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,e);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,i,r)}else!0===r?setTimeout((function(){i(null)}),0):i(null)},n.prototype.handleTileJSONError=function(){this.setState(ms)},n.prototype.handleTileJSONResponse=function(t){var n,i=gr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Er(i,r);n=si(t.bounds,e)}var o=nf(r),s=t.minzoom||0,a=$h({extent:o,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=a,this.oh=t.template;var u=t.grids;if(u){if(this.eh=ef(u,a),void 0!==t.attribution){var c=void 0!==n?n:o;this.setAttributions((function(n){return ni(c,n.extent)?[t.attribution]:null}))}this.setState(ys)}else this.setState(ms)},n.prototype.getTile=function(t,n,i,r,e){var o=Vc(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,n,i],a=this.getTileCoordForTileUrlFunction(s,e),u=this.eh(a,r,e),c=new hx(s,void 0!==u?lt:yt,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(s),this.Qc,this.ih);return this.tileCache.set(o,c),c},n.prototype.useTile=function(t,n,i){var r=Vc(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(pd),lx="KVP",vx="REST",dx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),px=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(r=n.interpolate);var e=void 0!==n.requestEncoding?n.requestEncoding:lx,o=n.tileGrid,s=n.urls;return void 0===s&&void 0!==n.url&&(s=af(n.url)),(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:o,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,urls:s,wrapX:void 0!==n.wrapX&&n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).sh=void 0!==n.version?n.version:"1.0.0",i.Fe=void 0!==n.format?n.format:"image/jpeg",i.ah=void 0!==n.dimensions?n.dimensions:{},i.Bs=n.layer,i.uh=n.matrixSet,i.K=n.style,i.hh=e,i.setKey(i.fh()),s&&s.length>0&&(i.tileUrlFunction=of(s.map(i.createFromWMTSTemplate.bind(i)))),i}return dx(n,t),n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.setTileUrlFunction(of(t.map(this.createFromWMTSTemplate.bind(this))),n)},n.prototype.getDimensions=function(){return this.ah},n.prototype.getFormat=function(){return this.Fe},n.prototype.getLayer=function(){return this.Bs},n.prototype.getMatrixSet=function(){return this.uh},n.prototype.getRequestEncoding=function(){return this.hh},n.prototype.getStyle=function(){return this.K},n.prototype.getVersion=function(){return this.sh},n.prototype.fh=function(){var t=0,n=[];for(var i in this.ah)n[t++]=i+"-"+this.ah[i];return n.join("/")},n.prototype.updateDimensions=function(t){E(this.ah,t),this.setKey(this.fh())},n.prototype.createFromWMTSTemplate=function(t){var n=this.hh,i={layer:this.Bs,style:this.K,tilematrixset:this.uh};n==lx&&E(i,{Service:"WMTS",Request:"GetTile",Version:this.sh,Format:this.Fe}),t=n==lx?uf(t,i):t.replace(/\{(\w+?)\}/g,(function(t,n){return n.toLowerCase()in i?i[n.toLowerCase()]:t}));var r=this.tileGrid,e=this.ah;return function(i,o,s){if(i){var a={TileMatrix:r.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};E(a,e);var u=t;return u=n==lx?uf(u,a):u.replace(/\{(\w+?)\}/g,(function(t,n){return a[n]}))}}},n}(gd);var yx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mx="renderOrder",wx=function(t){function n(n){var i=this,r=n||{},e=E({},r);return delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,(i=t.call(this,e)||this).lh=void 0!==r.declutter&&r.declutter,i.dh=void 0!==r.renderBuffer?r.renderBuffer:100,i.K=null,i.tt=void 0,i.setStyle(r.style),i.ph=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,i.yh=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,i}return yx(n,t),n.prototype.getDeclutter=function(){return this.lh},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderBuffer=function(){return this.dh},n.prototype.getRenderOrder=function(){return this.get(mx)},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.getUpdateWhileAnimating=function(){return this.ph},n.prototype.getUpdateWhileInteracting=function(){return this.yh},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new ed(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(mx,t)},n.prototype.setStyle=function(t){this.K=void 0!==t?t:Yv,this.tt=null===t?void 0:Jv(this.K),this.changed()},n}(gs);var bx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gx=function(t){function n(n,i){var r=this,e=i.uniforms||{},s=[1,0,0,1,0,0];e[$f]=s,(r=t.call(this,n,{uniforms:e,postProcesses:i.postProcesses})||this).ready=!1,r.mh=-1,r.wh=new Vf(hf,vf),r.bh=new Vf(hf,vf),r.gh=new Vf(ff,vf),r.ta=i.vertexShader,r.na=i.fragmentShader,r.Qs,r.xh=!(!i.hitFragmentShader||!i.hitVertexShader),r.jh=i.hitVertexShader,r.Sh=i.hitFragmentShader,r.kh;var a=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:el.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:el.FLOAT},{name:"a_index",size:1,type:el.FLOAT}].concat(a),r.hitDetectionAttributes=[{name:"a_position",size:2,type:el.FLOAT},{name:"a_index",size:1,type:el.FLOAT},{name:"a_hitColor",size:4,type:el.FLOAT},{name:"a_featureUid",size:1,type:el.FLOAT}].concat(a),r.customAttributes=i.attributes?i.attributes:[],r.Ki=[1/0,1/0,-1/0,-1/0],r.Mh=s,r._h=[1,0,0,1,0,0],r.Oh=[1,0,0,1,0,0],r.Th=new Float32Array(0),r.Eh=new Float32Array(0),r.Ah,r.Ch=0,r.Rh=function(){var t='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),r.Rh.addEventListener("message",function(t){var n=t.data;if(n.type===_l){var i=n.projectionTransform;n.hitDetection?(this.bh.fromArrayBuffer(n.vertexBuffer),this.helper.flushBufferData(this.bh)):(this.wh.fromArrayBuffer(n.vertexBuffer),this.helper.flushBufferData(this.wh)),this.gh.fromArrayBuffer(n.indexBuffer),this.helper.flushBufferData(this.gh),this._h=i,cn(this.Oh,this._h),n.hitDetection?this.Eh=new Float32Array(t.data.renderInstructions):(this.Th=new Float32Array(t.data.renderInstructions),n.generateBuffersRun===this.Ch&&(this.ready=!0)),this.getLayer().changed()}}.bind(r)),r.Ph={},r.Ih=0;var u=r.getLayer().getSource();return r.Nh=[Y(u,Td,r.zh,r),Y(u,Ed,r.Fh,r),Y(u,Cd,r.Lh,r),Y(u,Ad,r.Gh,r)],u.forEachFeature(function(t){this.Ph[o(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.Ih++}.bind(r)),r}return bx(n,t),n.prototype.afterHelperCreated=function(){this.Qs=this.helper.getProgram(this.na,this.ta),this.xh&&(this.kh=this.helper.getProgram(this.Sh,this.jh),this.Ah=new vl(this.helper))},n.prototype.zh=function(t){var n=t.feature;this.Ph[o(n)]={feature:n,properties:n.getProperties(),geometry:n.getGeometry()},this.Ih++},n.prototype.Fh=function(t){var n=t.feature;this.Ph[o(n)]={feature:n,properties:n.getProperties(),geometry:n.getGeometry()}},n.prototype.Lh=function(t){var n=t.feature;delete this.Ph[o(n)],this.Ih--},n.prototype.Gh=function(){this.Ph={},this.Ih=0},n.prototype.renderFrame=function(t){var n=this.helper.getGL();this.preRender(n,t);var i=this.gh.getSize();this.helper.drawElements(0,i),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var r=this.helper.getCanvas();return this.xh&&(this.renderHitDetection(t),this.Ah.clearCachedData()),this.postRender(n,t),r},n.prototype.prepareFrameInternal=function(t){var n=this.getLayer(),i=n.getSource(),r=t.viewState,e=!t.viewHints[za]&&!t.viewHints[Fa],o=!Nn(this.Ki,t.extent),s=this.mh<i.getRevision();if(s&&(this.mh=i.getRevision()),e&&(o||s)){var a=r.projection,u=r.resolution,c=n instanceof wx?n.getRenderBuffer():0,h=Sn(t.extent,c*u);i.loadFeatures(h,u,a),this.Dh(t),this.Ki=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.Mh),Qt(this.Mh,this.Oh),this.helper.useProgram(this.Qs),this.helper.prepareDraw(t),this.helper.bindBuffer(this.wh),this.helper.bindBuffer(this.gh),this.helper.enableAttributes(this.attributes),!0},n.prototype.Dh=function(t){var n=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,n);var i,r,e=(2+this.customAttributes.length)*this.Ih;if(this.Th&&this.Th.length===e||(this.Th=new Float32Array(e)),this.xh){var o=(7+this.customAttributes.length)*this.Ih;this.Eh&&this.Eh.length===o||(this.Eh=new Float32Array(o))}var s,a=[],u=[],c=0,h=0;for(var f in this.Ph)if((r=(i=this.Ph[f]).geometry)&&r.getType()===Pt.POINT){a[0]=r.getFlatCoordinates()[0],a[1]=r.getFlatCoordinates()[1],rn(n,a),s=Cl(h+6,u),this.Th[c++]=a[0],this.Th[c++]=a[1],this.xh&&(this.Eh[h++]=a[0],this.Eh[h++]=a[1],this.Eh[h++]=s[0],this.Eh[h++]=s[1],this.Eh[h++]=s[2],this.Eh[h++]=s[3],this.Eh[h++]=Number(f));for(var l=void 0,v=0;v<this.customAttributes.length;v++)l=this.customAttributes[v].callback(i.feature,i.properties),this.Th[c++]=l,this.xh&&(this.Eh[h++]=l)}var d={type:_l,renderInstructions:this.Th.buffer,customAttributesCount:this.customAttributes.length};if(d.projectionTransform=n,d.generateBuffersRun=++this.Ch,this.ready=!1,this.Rh.postMessage(d,[this.Th.buffer]),this.Th=null,this.xh){var p={type:_l,renderInstructions:this.Eh.buffer,customAttributesCount:5+this.customAttributes.length};p.projectionTransform=n,p.hitDetection=!0,this.Rh.postMessage(p,[this.Eh.buffer]),this.Eh=null}},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){if(Mt(this.xh,66),this.Eh){var o=rn(n.coordinateToPixelTransform,t.slice()),s=this.Ah.readPixel(o[0]/2,o[1]/2),a=Rl([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),u=this.Eh[a],c=Math.floor(u).toString(),h=this.getLayer().getSource().getFeatureByUid(c);return h?r(h,this.getLayer(),null):void 0}},n.prototype.renderHitDetection=function(t){if(this.bh.getSize()){this.Ah.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.kh),this.helper.prepareDrawToRenderTarget(t,this.Ah,!0),this.helper.bindBuffer(this.bh),this.helper.bindBuffer(this.gh),this.helper.enableAttributes(this.hitDetectionAttributes);var n=this.gh.getSize();this.helper.drawElements(0,n)}},n.prototype.disposeInternal=function(){this.Rh.terminate(),this.Bs=null,this.Nh.forEach((function(t){$(t)})),this.Nh=null,t.prototype.disposeInternal.call(this)},n}(Pl),xx={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},jx=[xx.FILL],Sx=[xx.STROKE],kx=[xx.BEGIN_PATH],Mx=[xx.CLOSE_PATH],_x=xx,Ox=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tx=function(t){function n(n,i,r,e){var o=t.call(this)||this;return o.tolerance=n,o.maxExtent=i,o.pixelRatio=e,o.maxLineWidth=0,o.resolution=r,o.Uh=null,o.qh=null,o.Bh=null,o.instructions=[],o.coordinates=[],o.Wh=[],o.hitDetectionInstructions=[],o.state={},o}return Ox(n,t),n.prototype.applyPixelRatio=function(t){var n=this.pixelRatio;return 1==n?t:t.map((function(t){return t*n}))},n.prototype.appendFlatPointCoordinates=function(t,n){for(var i=this.getBufferedMaxExtent(),r=this.Wh,e=this.coordinates,o=e.length,s=0,a=t.length;s<a;s+=n)r[0]=t[s],r[1]=t[s+1],_n(i,r)&&(e[o++]=r[0],e[o++]=r[1]);return o},n.prototype.appendFlatLineCoordinates=function(t,n,i,r,e,o){var s=this.coordinates,a=s.length,u=this.getBufferedMaxExtent();o&&(n+=r);var c,h,f,l=t[n],v=t[n+1],d=this.Wh,p=!0;for(c=n+r;c<i;c+=r)d[0]=t[c],d[1]=t[c+1],(f=En(u,d))!==h?(p&&(s[a++]=l,s[a++]=v,p=!1),s[a++]=d[0],s[a++]=d[1]):f===mn?(s[a++]=d[0],s[a++]=d[1],p=!1):p=!0,l=d[0],v=d[1],h=f;return(e&&p||c===n+r)&&(s[a++]=l,s[a++]=v),a},n.prototype.Vh=function(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var a=i[o],u=this.appendFlatLineCoordinates(t,n,a,r,!1,!1);e.push(u),n=a}return n},n.prototype.drawCustom=function(t,n,i,r){this.beginGeometry(t,n);var e,o,s,a,u,c=t.getType(),h=t.getStride(),f=this.coordinates.length;switch(c){case Pt.MULTI_POLYGON:e=t.getOrientedFlatCoordinates(),a=[];var l=t.getEndss();u=0;for(var v=0,d=l.length;v<d;++v){var p=[];u=this.Vh(e,u,l[v],h,p),a.push(p)}this.instructions.push([_x.CUSTOM,f,a,t,i,xe]),this.hitDetectionInstructions.push([_x.CUSTOM,f,a,t,r||i,xe]);break;case Pt.POLYGON:case Pt.MULTI_LINE_STRING:s=[],e=c==Pt.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.Vh(e,0,t.getEnds(),h,s),this.instructions.push([_x.CUSTOM,f,s,t,i,ge]),this.hitDetectionInstructions.push([_x.CUSTOM,f,s,t,r||i,ge]);break;case Pt.LINE_STRING:case Pt.CIRCLE:e=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(e,0,e.length,h,!1,!1),this.instructions.push([_x.CUSTOM,f,o,t,i,be]),this.hitDetectionInstructions.push([_x.CUSTOM,f,o,t,r||i,be]);break;case Pt.MULTI_POINT:e=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(e,h))>f&&(this.instructions.push([_x.CUSTOM,f,o,t,i,be]),this.hitDetectionInstructions.push([_x.CUSTOM,f,o,t,r||i,be]));break;case Pt.POINT:e=t.getFlatCoordinates(),this.coordinates.push(e[0],e[1]),o=this.coordinates.length,this.instructions.push([_x.CUSTOM,f,o,t,i]),this.hitDetectionInstructions.push([_x.CUSTOM,f,o,t,r||i])}this.endGeometry(n)},n.prototype.beginGeometry=function(t,n){this.Uh=[_x.BEGIN_GEOMETRY,n,0,t],this.instructions.push(this.Uh),this.qh=[_x.BEGIN_GEOMETRY,n,0,t],this.hitDetectionInstructions.push(this.qh)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t,n=this.hitDetectionInstructions;n.reverse();var i,r,e=n.length,o=-1;for(t=0;t<e;++t)(r=(i=n[t])[0])==_x.END_GEOMETRY?o=t:r==_x.BEGIN_GEOMETRY&&(i[2]=t,w(this.hitDetectionInstructions,o,t),o=-1)},n.prototype.setFillStrokeStyle=function(t,n){var i=this.state;if(t){var r=t.getColor();i.fillStyle=ah(r||Fs)}else i.fillStyle=void 0;if(n){var e=n.getColor();i.strokeStyle=ah(e||qs);var o=n.getLineCap();i.lineCap=void 0!==o?o:Ls;var s=n.getLineDash();i.lineDash=s?s.slice():Gs;var a=n.getLineDashOffset();i.lineDashOffset=a||0;var u=n.getLineJoin();i.lineJoin=void 0!==u?u:Ds;var c=n.getWidth();i.lineWidth=void 0!==c?c:1;var h=n.getMiterLimit();i.miterLimit=void 0!==h?h:Us,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.Bh=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},n.prototype.createFill=function(t){var n=t.fillStyle,i=[_x.SET_FILL_STYLE,n];return"string"!=typeof n&&i.push(!0),i},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[_x.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,n){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(n.call(this,t)),t.currentFillStyle=i)},n.prototype.updateStrokeStyle=function(t,n){var i=t.strokeStyle,r=t.lineCap,e=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||e!=t.currentLineDash&&!x(t.currentLineDash,e)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==i&&n.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=e,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},n.prototype.endGeometry=function(t){this.Uh[2]=this.instructions.length,this.Uh=null,this.qh[2]=this.hitDetectionInstructions.length,this.qh=null;var n=[_x.END_GEOMETRY,t];this.instructions.push(n),this.hitDetectionInstructions.push(n)},n.prototype.getBufferedMaxExtent=function(){if(!this.Bh&&(this.Bh=kn(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Sn(this.Bh,t,this.Bh)}return this.Bh},n}(Sh),Ex=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ax=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.Ma=null,o.Nt=null,o.Xh=void 0,o.Hh=void 0,o.Jh=void 0,o.Kh=void 0,o.ua=void 0,o.Yh=void 0,o.Zh=void 0,o.ca=void 0,o.Dr=void 0,o.ha=void 0,o.Wa=void 0,o.$h=void 0,o}return Ex(n,t),n.prototype.drawPoint=function(t,n){if(this.Nt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([_x.DRAW_IMAGE,e,o,this.Nt,this.Hh*this.Xh,this.Jh*this.Xh,Math.ceil(this.Kh*this.Xh),this.ua,this.Yh,this.Zh,this.ca,this.Dr,[this.ha[0]*this.pixelRatio/this.Xh,this.ha[1]*this.pixelRatio/this.Xh],Math.ceil(this.Wa*this.Xh),this.$h]),this.hitDetectionInstructions.push([_x.DRAW_IMAGE,e,o,this.Ma,this.Hh,this.Jh,this.Kh,this.ua,this.Yh,this.Zh,this.ca,this.Dr,this.ha,this.Wa,this.$h]),this.endGeometry(n)}},n.prototype.drawMultiPoint=function(t,n){if(this.Nt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([_x.DRAW_IMAGE,e,o,this.Nt,this.Hh*this.Xh,this.Jh*this.Xh,Math.ceil(this.Kh*this.Xh),this.ua,this.Yh,this.Zh,this.ca,this.Dr,[this.ha[0]*this.pixelRatio/this.Xh,this.ha[1]*this.pixelRatio/this.Xh],Math.ceil(this.Wa*this.Xh),this.$h]),this.hitDetectionInstructions.push([_x.DRAW_IMAGE,e,o,this.Ma,this.Hh,this.Jh,this.Kh,this.ua,this.Yh,this.Zh,this.ca,this.Dr,this.ha,this.Wa,this.$h]),this.endGeometry(n)}},n.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.Hh=void 0,this.Jh=void 0,this.Ma=null,this.Nt=null,this.Xh=void 0,this.Kh=void 0,this.ha=void 0,this.ua=void 0,this.Yh=void 0,this.Zh=void 0,this.ca=void 0,this.Dr=void 0,this.Wa=void 0,t.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,n){var i=t.getAnchor(),r=t.getSize(),e=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.Xh=t.getPixelRatio(this.pixelRatio),this.Hh=i[0],this.Jh=i[1],this.Ma=e,this.Nt=o,this.Kh=r[1],this.ua=t.getOpacity(),this.Yh=s[0]*this.Xh,this.Zh=s[1]*this.Xh,this.ca=t.getRotateWithView(),this.Dr=t.getRotation(),this.ha=t.getScaleArray(),this.Wa=r[0],this.$h=n},n}(Tx),Cx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rx=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return Cx(n,t),n.prototype.Qh=function(t,n,i,r){var e=this.coordinates.length,o=this.appendFlatLineCoordinates(t,n,i,r,!1,!1),s=[_x.MOVE_TO_LINE_TO,e,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},n.prototype.drawLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([_x.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Gs,0],kx);var o=t.getFlatCoordinates(),s=t.getStride();this.Qh(o,0,o.length,s),this.hitDetectionInstructions.push(Sx),this.endGeometry(n)}},n.prototype.drawMultiLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([_x.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],kx);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,c=0,h=o.length;c<h;++c)u=this.Qh(s,u,o[c],a);this.hitDetectionInstructions.push(Sx),this.endGeometry(n)}},n.prototype.finish=function(){var n=this.state;return null!=n.lastStroke&&n.lastStroke!=this.coordinates.length&&this.instructions.push(Sx),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},n.prototype.applyStroke=function(n){null!=n.lastStroke&&n.lastStroke!=this.coordinates.length&&(this.instructions.push(Sx),n.lastStroke=this.coordinates.length),n.lastStroke=0,t.prototype.applyStroke.call(this,n),this.instructions.push(kx)},n}(Tx),Px=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ix=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return Px(n,t),n.prototype.tf=function(t,n,i,r){var e=this.state,o=void 0!==e.fillStyle,s=void 0!==e.strokeStyle,a=i.length;this.instructions.push(kx),this.hitDetectionInstructions.push(kx);for(var u=0;u<a;++u){var c=i[u],h=this.coordinates.length,f=this.appendFlatLineCoordinates(t,n,c,r,!0,!s),l=[_x.MOVE_TO_LINE_TO,h,f];this.instructions.push(l),this.hitDetectionInstructions.push(l),s&&(this.instructions.push(Mx),this.hitDetectionInstructions.push(Mx)),n=c}return o&&(this.instructions.push(jx),this.hitDetectionInstructions.push(jx)),s&&(this.instructions.push(Sx),this.hitDetectionInstructions.push(Sx)),n},n.prototype.drawCircle=function(t,n){var i=this.state,r=i.fillStyle,e=i.strokeStyle;if(void 0!==r||void 0!==e){this.nf(),this.beginGeometry(t,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_x.SET_FILL_STYLE,Fs]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_x.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 u=[_x.CIRCLE,a];this.instructions.push(kx,u),this.hitDetectionInstructions.push(kx,u),void 0!==i.fillStyle&&(this.instructions.push(jx),this.hitDetectionInstructions.push(jx)),void 0!==i.strokeStyle&&(this.instructions.push(Sx),this.hitDetectionInstructions.push(Sx)),this.endGeometry(n)}},n.prototype.drawPolygon=function(t,n){var i=this.state,r=i.fillStyle,e=i.strokeStyle;if(void 0!==r||void 0!==e){this.nf(),this.beginGeometry(t,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_x.SET_FILL_STYLE,Fs]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_x.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.tf(s,0,o,a),this.endGeometry(n)}},n.prototype.drawMultiPolygon=function(t,n){var i=this.state,r=i.fillStyle,e=i.strokeStyle;if(void 0!==r||void 0!==e){this.nf(),this.beginGeometry(t,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_x.SET_FILL_STYLE,Fs]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_x.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(),u=0,c=0,h=o.length;c<h;++c)u=this.tf(s,u,o[c],a);this.endGeometry(n)}},n.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var n=this.tolerance;if(0!==n)for(var i=this.coordinates,r=0,e=i.length;r<e;++r)i[r]=pe(i[r],n);return t.prototype.finish.call(this)},n.prototype.nf=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},n}(Tx);function Nx(t,n,i,r,e){var o,s,a,u,c,h,f,l,v,d=i,p=i,y=0,m=0,w=i;for(o=i;o<r;o+=e){var b=n[o],g=n[o+1];void 0!==u&&(l=b-u,v=g-c,a=Math.sqrt(l*l+v*v),void 0!==h&&(m+=s,Math.acos((h*l+f*v)/(s*a))>t&&(m>y&&(y=m,d=w,p=o),m=0,w=o-e)),s=a,h=l,f=v),u=b,c=g}return(m+=a)>y?[w,o]:[d,p]}var zx=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Lx=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.if=null,o.oo="",o.so=0,o.ao=0,o.uo=void 0,o.co=0,o.fo=null,o.fillStates={},o.lo=null,o.strokeStates={},o.vo={},o.textStates={},o.rf="",o.ef="",o.af="",o.$h=void 0,o}return zx(n,t),n.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},n.prototype.drawText=function(t,n){var i=this.fo,r=this.lo,e=this.vo;if(""!==this.oo&&e&&(i||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,c=t.getStride();if(e.placement!==nd||a!=Pt.LINE_STRING&&a!=Pt.MULTI_LINE_STRING&&a!=Pt.POLYGON&&a!=Pt.MULTI_POLYGON){var h=e.overflow?null:[];switch(a){case Pt.POINT:case Pt.MULTI_POINT:u=t.getFlatCoordinates();break;case Pt.LINE_STRING:u=t.getFlatMidpoint();break;case Pt.CIRCLE:u=t.getCenter();break;case Pt.MULTI_LINE_STRING:u=t.getFlatMidpoints(),c=2;break;case Pt.POLYGON:u=t.getFlatInteriorPoint(),e.overflow||h.push(u[2]/this.resolution),c=3;break;case Pt.MULTI_POLYGON:var f=t.getFlatInteriorPoints();u=[];for(j=0,S=f.length;j<S;j+=3)e.overflow||h.push(f[j+2]/this.resolution),u.push(f[j],f[j+1]);if(0===u.length)return;c=2}if((A=this.appendFlatPointCoordinates(u,c))===s)return;if(h&&(A-s)/2!=u.length/c){var l=s/2;h=h.filter((function(t,n){var i=o[2*(l+n)]===u[n*c]&&o[2*(l+n)+1]===u[n*c+1];return i||--l,i}))}this.uf(),(e.backgroundFill||e.backgroundStroke)&&(this.setFillStrokeStyle(e.backgroundFill,e.backgroundStroke),e.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),e.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,n);var v=e.padding;if(v!=Vs&&(e.scale[0]<0||e.scale[1]<0)){var d=e.padding[0],p=e.padding[1],y=e.padding[2],m=e.padding[3];e.scale[0]<0&&(p=-p,m=-m),e.scale[1]<0&&(d=-d,y=-y),v=[d,p,y,m]}var w=this.pixelRatio;this.instructions.push([_x.DRAW_IMAGE,s,A,null,NaN,NaN,NaN,1,0,0,this.uo,this.co,[1,1],NaN,this.$h,v==Vs?Vs:v.map((function(t){return t*w})),!!e.backgroundFill,!!e.backgroundStroke,this.oo,this.rf,this.af,this.ef,this.so,this.ao,h]);var b=1/w;this.hitDetectionInstructions.push([_x.DRAW_IMAGE,s,A,null,NaN,NaN,NaN,1,0,0,this.uo,this.co,[b,b],NaN,this.$h,v,!!e.backgroundFill,!!e.backgroundStroke,this.oo,this.rf,this.af,this.ef,this.so,this.ao,h]),this.endGeometry(n)}else{if(!ni(this.getBufferedMaxExtent(),t.getExtent()))return;var g=void 0;if(u=t.getFlatCoordinates(),a==Pt.LINE_STRING)g=[u.length];else if(a==Pt.MULTI_LINE_STRING)g=t.getEnds();else if(a==Pt.POLYGON)g=t.getEnds().slice(0,1);else if(a==Pt.MULTI_POLYGON){var x=t.getEndss();g=[];for(var j=0,S=x.length;j<S;++j)g.push(x[j][0])}this.beginGeometry(t,n);for(var k=e.textAlign,M=0,_=void 0,O=0,T=g.length;O<T;++O){if(null==k){var E=Nx(e.maxAngle,u,M,g[O],c);M=E[0],_=E[1]}else _=g[O];for(var j=M;j<_;j+=c)o.push(u[j],u[j+1]);var A=o.length;M=g[O],this.cf(s,A),s=A}this.endGeometry(n)}}},n.prototype.uf=function(){var t=this.lo,n=this.vo,i=this.fo,r=this.af;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var e=this.rf;e in this.textStates||(this.textStates[e]={font:n.font,textAlign:n.textAlign||Bs,textBaseline:n.textBaseline||Ws,scale:n.scale});var o=this.ef;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},n.prototype.cf=function(t,n){var i=this.lo,r=this.vo,e=this.af,o=this.rf,s=this.ef;this.uf();var a=this.pixelRatio,u=Fx[r.textBaseline],c=this.ao*a,h=this.oo,f=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([_x.DRAW_CHARS,t,n,u,r.overflow,s,r.maxAngle,a,c,e,f*a,h,o,1]),this.hitDetectionInstructions.push([_x.DRAW_CHARS,t,n,u,r.overflow,s,r.maxAngle,1,c,e,f,h,o,1/a])},n.prototype.setTextStyle=function(t,n){var i,r,e;if(t){var s=t.getFill();s?((r=this.fo)||(r={},this.fo=r),r.fillStyle=ah(s.getColor()||Fs)):(r=null,this.fo=r);var a=t.getStroke();if(a){(e=this.lo)||(e={},this.lo=e);var u=a.getLineDash(),c=a.getLineDashOffset(),h=a.getWidth(),f=a.getMiterLimit();e.lineCap=a.getLineCap()||Ls,e.lineDash=u?u.slice():Gs,e.lineDashOffset=void 0===c?0:c,e.lineJoin=a.getLineJoin()||Ds,e.lineWidth=void 0===h?1:h,e.miterLimit=void 0===f?Us:f,e.strokeStyle=ah(a.getColor()||qs)}else e=null,this.lo=e;i=this.vo;var l=t.getFont()||zs;$s(l);var v=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||Ws,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Vs,i.scale=void 0===v?[1,1]:v;var d=t.getOffsetX(),p=t.getOffsetY(),y=t.getRotateWithView(),m=t.getRotation();this.oo=t.getText()||"",this.so=void 0===d?0:d,this.ao=void 0===p?0:p,this.uo=void 0!==y&&y,this.co=void 0===m?0:m,this.af=e?("string"==typeof e.strokeStyle?e.strokeStyle:o(e.strokeStyle))+e.lineCap+e.lineDashOffset+"|"+e.lineWidth+e.lineJoin+e.miterLimit+"["+e.lineDash.join()+"]":"",this.rf=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.ef=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+o(r.fillStyle):""}else this.oo="";this.$h=n},n}(Tx),Gx={Circle:Ix,Default:Tx,Image:Ax,LineString:Rx,Polygon:Ix,Text:Lx},Dx=function(){function t(t,n,i,r){this.hf=t,this.ff=n,this.Rt=r,this.lf=i,this.vf={}}return t.prototype.finish=function(){var t={};for(var n in this.vf){t[n]=t[n]||{};var i=this.vf[n];for(var r in i){var e=i[r].finish();t[n][r]=e}}return t},t.prototype.getBuilder=function(t,n){var i=void 0!==t?t.toString():"0",r=this.vf[i];void 0===r&&(r={},this.vf[i]=r);var e=r[n];void 0===e&&(e=new(0,Gx[n])(this.hf,this.ff,this.lf,this.Rt),r[n]=e);return e},t}();function Ux(t,n,i,r,e,o,s,a,u,c,h,f){var l=t[n],v=t[n+1],d=0,p=0,y=0,m=0;function w(){d=l,p=v,l=t[n+=r],v=t[n+1],m+=y,y=Math.sqrt((l-d)*(l-d)+(v-p)*(v-p))}do{w()}while(n<i-r&&m+y<o);for(var b=0===y?0:(o-m)/y,g=wi(d,l,b),x=wi(p,v,b),j=n-r,S=m,k=o+a*u(c,e,h);n<i-r&&m+y<k;)w();var M,_=wi(d,l,b=0===y?0:(k-m)/y),O=wi(p,v,b);if(f){var T=[g,x,_,O];Vr(T,0,4,2,f,T,T),M=T[0]>T[2]}else M=g>_;var E,A=Math.PI,C=[],R=j+r===n;if(y=0,m=S,l=t[n=j],v=t[n+1],R){w(),E=Math.atan2(v-p,l-d),M&&(E+=E>0?-A:A);var P=(_+g)/2,I=(O+x)/2;return C[0]=[P,I,(k-o)/2,E,e],C}for(var N=0,z=e.length;N<z;){w();var F=Math.atan2(v-p,l-d);if(M&&(F+=F>0?-A:A),void 0!==E){var L=F-E;if(L+=L>A?-2*A:L<-A?2*A:0,Math.abs(L)>s)return null}E=F;for(var G=N,D=0;N<z;++N){var U=a*u(c,e[M?z-N-1:N],h);if(n+r<i&&m+y<o+D+U/2)break;D+=U}if(N!==G){var q=M?e.substring(z-G,z-N):e.substring(G,N);P=wi(d,l,b=0===y?0:(o+D/2-m)/y),I=wi(p,v,b);C.push([P,I,D/2,F,q]),o+=D}}return C}function qx(t,n,i,r){for(var e=t[n],o=t[n+1],s=0,a=n+r;a<i;a+=r){var u=t[a],c=t[a+1];s+=Math.sqrt((u-e)*(u-e)+(c-o)*(c-o)),e=u,o=c}return s}var Bx=[1/0,1/0,-1/0,-1/0],Wx=[],Vx=[],Xx=[],Hx=[];function Jx(t){return t[3].declutterBox}var Kx=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 Yx(t,n){return"start"!==n&&"end"!==n||Kx.test(t)||(n="start"===n?"left":"right"),Fx[n]}function Zx(t,n,i){return i>0&&t.push("\n",""),t.push(n,""),t}var $x=function(){function t(t,n,i,r){this.overlaps=i,this.pixelRatio=n,this.resolution=t,this.df,this.instructions=r.instructions,this.coordinates=r.coordinates,this.pf={},this.yf=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.do=null,this.De=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.mf={},this.if={}}return t.prototype.createLabel=function(t,n,i,r){var e=t+n+i+r;if(this.if[e])return this.if[e];var o=r?this.strokeStates[r]:null,s=i?this.fillStates[i]:null,a=this.textStates[n],u=this.pixelRatio,c=[a.scale[0]*u,a.scale[1]*u],h=Array.isArray(t),f=Yx(h?t[0]:t,a.textAlign||Bs),l=r&&o.lineWidth?o.lineWidth:0,v=h?t:t.split("\n").reduce(Zx,[]),d=ra(a,v),p=d.width,y=d.height,m=d.widths,w=d.heights,b=d.lineWidths,g=p+l,x=[],j=(g+2)*c[0],S=(y+l)*c[1],k={width:j<0?Math.floor(j):Math.ceil(j),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:x};(1==c[0]&&1==c[1]||x.push("scale",c),r)&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",l),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),(Ht?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)));i&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var M,_=.5-f,O=f*g+_*l,T=[],E=[],A=0,C=0,R=0,P=0,I=0,N=v.length;I<N;I+=2){var z=v[I];if("\n"!==z){var F=v[I+1]||a.font;F!==M&&(r&&T.push("font",F),i&&E.push("font",F),M=F),A=Math.max(A,w[R]);var L=[z,O+_*m[R]+f*(m[R]-b[P]),.5*(l+A)+C];O+=m[R],r&&T.push("strokeText",L),i&&E.push("fillText",L),++R}else C+=A,A=0,O=f*g+_*l,++P}return Array.prototype.push.apply(x,T),Array.prototype.push.apply(x,E),this.if[e]=k,k},t.prototype.wf=function(t,n,i,r,e,o,s){t.beginPath(),t.moveTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,e),t.lineTo.apply(t,n),o&&(this.df=o[2],this.da(t)),s&&(this.bf(t,s),t.stroke())},t.prototype.gf=function(t,n,i,r,e,o,s,a,u,c,h,f,l,v,d,p){var y,m=i-(s*=f[0]),w=r-(a*=f[1]),b=e+u>t?t-u:e,g=o+c>n?n-c:o,x=v[3]+b*f[0]+v[1],j=v[0]+g*f[1]+v[2],S=m-v[3],k=w-v[0];return(d||0!==h)&&(Wx[0]=S,Hx[0]=S,Wx[1]=k,Vx[1]=k,Vx[0]=S+x,Xx[0]=Vx[0],Xx[1]=k+j,Hx[1]=Xx[1]),0!==h?(rn(y=un([1,0,0,1,0,0],i,r,1,1,h,-i,-r),Wx),rn(y,Vx),rn(y,Xx),rn(y,Hx),Cn(Math.min(Wx[0],Vx[0],Xx[0],Hx[0]),Math.min(Wx[1],Vx[1],Xx[1],Hx[1]),Math.max(Wx[0],Vx[0],Xx[0],Hx[0]),Math.max(Wx[1],Vx[1],Xx[1],Hx[1]),Bx)):Cn(Math.min(S,S+x),Math.min(k,k+j),Math.max(S,S+x),Math.max(k,k+j),Bx),l&&(m=Math.round(m),w=Math.round(w)),{drawImageX:m,drawImageY:w,drawImageW:b,drawImageH:g,originX:u,originY:c,declutterBox:{minX:Bx[0],minY:Bx[1],maxX:Bx[2],maxY:Bx[3],value:p},canvasTransform:y,scale:f}},t.prototype.xf=function(t,n,i,r,e,o,s){var a=!(!o&&!s),u=r.declutterBox,c=t.canvas,h=s?s[2]*r.scale[0]/2:0;return u.minX-h<=c.width/n&&u.maxX+h>=0&&u.minY-h<=c.height/n&&u.maxY+h>=0&&(a&&this.wf(t,Wx,Vx,Xx,Hx,o,s),ea(t,r.canvasTransform,e,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.da=function(t){if(this.df){var n=rn(this.yf,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),t.rotate(this.De)}t.fill(),this.df&&t.restore()},t.prototype.bf=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},t.prototype.jf=function(t,n,i,r){var e=this.textStates[n],o=this.createLabel(t,n,r,i),s=this.strokeStates[i],a=this.pixelRatio,u=Yx(Array.isArray(t)?t[0]:t,e.textAlign||Bs),c=Fx[e.textBaseline||Ws],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*e.scale[0])+2*(.5-u)*h,anchorY:c*o.height/a+2*(.5-c)*h}},t.prototype.Sf=function(t,n,i,r,e,o,s,a){var u;this.do&&x(i,this.yf)?u=this.do:(this.do||(this.do=[]),u=Wr(this.coordinates,0,this.coordinates.length,2,i,this.do),nn(this.yf,i));for(var c,h,f,l,v,d,p,y,m,w,b,g,j,S,k,M,_=0,O=r.length,T=0,E=0,A=0,C=null,R=null,P=this.pf,I=this.De,N=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},F=this.instructions!=r||this.overlaps?0:200;_<O;){var L=r[_];switch(L[0]){case _x.BEGIN_GEOMETRY:j=L[1],M=L[3],j.getGeometry()?void 0===s||ni(s,M.getExtent())?++_:_=L[2]+1:_=L[2];break;case _x.BEGIN_PATH:E>F&&(this.da(t),E=0),A>F&&(t.stroke(),A=0),E||A||(t.beginPath(),l=NaN,v=NaN),++_;break;case _x.CIRCLE:var G=u[T=L[1]],D=u[T+1],U=u[T+2]-G,q=u[T+3]-D,B=Math.sqrt(U*U+q*q);t.moveTo(G+B,D),t.arc(G,D,B,0,2*Math.PI,!0),++_;break;case _x.CLOSE_PATH:t.closePath(),++_;break;case _x.CUSTOM:T=L[1],c=L[2];var W=L[3],V=L[4],X=6==L.length?L[5]:void 0;z.geometry=W,z.feature=j,_ in P||(P[_]=[]);var H=P[_];X?X(u,T,c,2,H):(H[0]=u[T],H[1]=u[T+1],H.length=2),V(H,z),++_;break;case _x.DRAW_IMAGE:T=L[1],c=L[2],y=L[3],h=L[4],f=L[5];var J=L[6],K=L[7],Y=L[8],Z=L[9],$=L[10],Q=L[11],tt=L[12],nt=L[13],it=L[14];if(!y&&L.length>=19){m=L[18],w=L[19],b=L[20],g=L[21];var rt=this.jf(m,w,b,g);y=rt.label,L[3]=y;var et=L[22];h=(rt.anchorX-et)*this.pixelRatio,L[4]=h;var ot=L[23];f=(rt.anchorY-ot)*this.pixelRatio,L[5]=f,J=y.height,L[6]=J,nt=y.width,L[13]=nt}var st=void 0;L.length>24&&(st=L[24]);var at=void 0,ut=void 0,ct=void 0;L.length>16?(at=L[15],ut=L[16],ct=L[17]):(at=Vs,ut=!1,ct=!1),$&&N?Q+=I:$||N||(Q-=I);for(var ht=0;T<c;T+=2)if(!(st&&st[ht++]<nt/this.pixelRatio)){var ft=[t,n,y,Lt=this.gf(y.width,y.height,u[T],u[T+1],nt,J,h,f,Y,Z,Q,tt,e,at,ut||ct,j),K,ut?C:null,ct?R:null],lt=void 0,vt=void 0;if(a&&it){var dt=c-T;if(!it[dt]){it[dt]=ft;continue}if(lt=it[dt],delete it[dt],vt=Jx(lt),a.collides(vt))continue}a&&a.collides(Lt.declutterBox)||(lt&&(a&&a.insert(vt),this.xf.apply(this,lt)),a&&a.insert(Lt.declutterBox),this.xf.apply(this,ft))}++_;break;case _x.DRAW_CHARS:var pt=L[1],yt=L[2],mt=L[3],wt=L[4];g=L[5];var bt=L[6],gt=L[7],xt=L[8];b=L[9];var jt=L[10];m=L[11],w=L[12];var St=[L[13],L[13]],kt=this.textStates[w],Mt=kt.font,_t=[kt.scale[0]*gt,kt.scale[1]*gt],Ot=void 0;Mt in this.mf?Ot=this.mf[Mt]:(Ot={},this.mf[Mt]=Ot);var Tt=qx(u,pt,yt,2),Et=Math.abs(_t[0])*ia(Mt,m,Ot);if(wt||Et<=Tt){var At=this.textStates[w].textAlign,Ct=Ux(u,pt,yt,2,m,(Tt-Et)*Fx[At],bt,Math.abs(_t[0]),ia,Mt,Ot,N?0:this.De);t:if(Ct){var Rt=[],Pt=void 0,It=void 0,Nt=void 0,zt=void 0,Ft=void 0;if(b)for(Pt=0,It=Ct.length;Pt<It;++Pt){Nt=(Ft=Ct[Pt])[4],zt=this.createLabel(Nt,w,"",b),h=Ft[2]+(_t[0]<0?-jt:jt),f=mt*zt.height+2*(.5-mt)*jt*_t[1]/_t[0]-xt;var Lt=this.gf(zt.width,zt.height,Ft[0],Ft[1],zt.width,zt.height,h,f,0,0,Ft[3],St,!1,Vs,!1,j);if(a&&a.collides(Lt.declutterBox))break t;Rt.push([t,n,zt,Lt,1,null,null])}if(g)for(Pt=0,It=Ct.length;Pt<It;++Pt){Nt=(Ft=Ct[Pt])[4],zt=this.createLabel(Nt,w,g,""),h=Ft[2],f=mt*zt.height-xt;Lt=this.gf(zt.width,zt.height,Ft[0],Ft[1],zt.width,zt.height,h,f,0,0,Ft[3],St,!1,Vs,!1,j);if(a&&a.collides(Lt.declutterBox))break t;Rt.push([t,n,zt,Lt,1,null,null])}a&&a.load(Rt.map(Jx));for(var Gt=0,Dt=Rt.length;Gt<Dt;++Gt)this.xf.apply(this,Rt[Gt])}}++_;break;case _x.END_GEOMETRY:if(void 0!==o){var Ut=o(j=L[1],M);if(Ut)return Ut}++_;break;case _x.FILL:F?E++:this.da(t),++_;break;case _x.MOVE_TO_LINE_TO:for(T=L[1],c=L[2],S=u[T],p=(k=u[T+1])+.5|0,(d=S+.5|0)===l&&p===v||(t.moveTo(S,k),l=d,v=p),T+=2;T<c;T+=2)d=(S=u[T])+.5|0,p=(k=u[T+1])+.5|0,T!=c-2&&d===l&&p===v||(t.lineTo(S,k),l=d,v=p);++_;break;case _x.SET_FILL_STYLE:C=L,this.df=L[2],E&&(this.da(t),E=0,A&&(t.stroke(),A=0)),t.fillStyle=L[1],++_;break;case _x.SET_STROKE_STYLE:R=L,A&&(t.stroke(),A=0),this.bf(t,L),++_;break;case _x.STROKE:F?A++:t.stroke(),++_;break;default:++_}}E&&this.da(t),A&&t.stroke()},t.prototype.execute=function(t,n,i,r,e,o){this.De=r,this.Sf(t,n,i,this.instructions,e,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,n,i,r,e){return this.De=i,this.Sf(t,1,n,this.hitDetectionInstructions,!0,r,e)},t}(),Qx=[Ah,_h,Eh,Th,Ch,Oh],tj=function(){function t(t,n,i,r,e,o){this.ff=t,this.zu=r,this.Rt=i,this.lf=n,this.dh=o,this.kf={},this.Mf=null,this._f=[1,0,0,1,0,0],this.Of(e)}return t.prototype.clip=function(t,n){var i=this.getClipCoords(n);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.Of=function(t){for(var n in t){var i=this.kf[n];void 0===i&&(i={},this.kf[n]=i);var r=t[n];for(var e in r){var o=r[e];i[e]=new $x(this.lf,this.Rt,this.zu,o)}}},t.prototype.hasExecutors=function(t){for(var n in this.kf)for(var i=this.kf[n],r=0,e=t.length;r<e;++r)if(t[r]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o){var s=2*(r=Math.round(r))+1,a=un(this._f,r+.5,r+.5,1/n,-1/n,-i,-t[0],-t[1]),u=!this.Mf;u&&(this.Mf=Oo(s,s));var c,h=this.Mf;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):u||h.clearRect(0,0,s,s),void 0!==this.dh&&(Ln(c=[1/0,1/0,-1/0,-1/0],t),Sn(c,n*(this.dh+r),c));var f,l=ij(r);function v(t,n){for(var i=h.getImageData(0,0,s,s).data,a=0,u=l.length;a<u;a++)if(i[l[a]]>0){if(!o||f!==Th&&f!==Ch||-1!==o.indexOf(t)){var c=(l[a]-3)/4,v=r-c%s,d=r-(c/s|0),p=e(t,n,v*v+d*d);if(p)return p}h.clearRect(0,0,s,s);break}}var d,y,m,w,b,g=Object.keys(this.kf).map(Number);for(g.sort(p),d=g.length-1;d>=0;--d){var x=g[d].toString();for(m=this.kf[x],y=Qx.length-1;y>=0;--y)if(void 0!==(w=m[f=Qx[y]])&&(b=w.executeHitDetection(h,a,i,v,c)))return b}},t.prototype.getClipCoords=function(t){var n=this.ff;if(!n)return null;var i=n[0],r=n[1],e=n[2],o=n[3],s=[i,r,i,o,e,o,e,r];return Wr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return R(this.kf)},t.prototype.execute=function(t,n,i,r,e,o,s){var a=Object.keys(this.kf).map(Number);a.sort(p),this.ff&&(t.save(),this.clip(t,i));var u,c,h,f,l,v,d=o||Qx;for(s&&a.reverse(),u=0,c=a.length;u<c;++u){var y=a[u].toString();for(l=this.kf[y],h=0,f=d.length;h<f;++h){void 0!==(v=l[d[h]])&&v.execute(t,n,i,r,e,s)}}this.ff&&t.restore()},t}(),nj={};function ij(t){if(void 0!==nj[t])return nj[t];for(var n=2*t+1,i=t*t,r=new Array(i+1),e=0;e<=t;++e)for(var o=0;o<=t;++o){var s=e*e+o*o;if(s>i)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+e)*n+(t+o))+3),e>0&&a.push(4*((t-e)*n+(t+o))+3),o>0&&(a.push(4*((t+e)*n+(t-o))+3),e>0&&a.push(4*((t-e)*n+(t-o))+3))}for(var u=[],c=(e=0,r.length);e<c;++e)r[e]&&u.push.apply(u,r[e]);return nj[t]=u,u}var rj=tj,ej=.5;function oj(t,n,i,r,e,o,s){var a=Oo(t[0]*ej,t[1]*ej);a.imageSmoothingEnabled=!1;for(var u=a.canvas,c=new Mh(a,ej,e,null,s),h=i.length,f=Math.floor(16777215/h),l={},v=1;v<=h;++v){var d=i[v-1],y=d.getStyleFunction()||r;if(r){var m=y(d,o);if(m){Array.isArray(m)||(m=[m]);for(var w="#"+("000000"+(v*f).toString(16)).slice(-6),b=0,g=m.length;b<g;++b){var x=m[b],j=x.getGeometryFunction()(d);if(j&&ni(e,j.getExtent())){var S=x.clone(),k=S.getFill();k&&k.setColor(w);var M=S.getStroke();M&&(M.setColor(w),M.setLineDash(null)),S.setText(void 0);var _=x.getImage();if(_&&0!==_.getOpacity()){var O=_.getImageSize();if(!O)continue;var T=Oo(O[0],O[1],void 0,{alpha:!1}),E=T.canvas;T.fillStyle=w,T.fillRect(0,0,E.width,E.height),S.setImage(new Wv({img:E,imgSize:O,anchor:_.getAnchor(),anchorXUnits:Pv,anchorYUnits:Pv,offset:_.getOrigin(),opacity:1,size:_.getSize(),scale:_.getScale(),rotation:_.getRotation(),rotateWithView:_.getRotateWithView()}))}var A=S.getZIndex()||0;(P=l[A])||(P={},l[A]=P,P[Pt.POLYGON]=[],P[Pt.CIRCLE]=[],P[Pt.LINE_STRING]=[],P[Pt.POINT]=[]),P[j.getType().replace("Multi","")].push(j,S)}}}}}for(var C=Object.keys(l).map(Number).sort(p),R=(v=0,C.length);v<R;++v){var P=l[C[v]];for(var I in P){var N=P[I];for(b=0,g=N.length;b<g;b+=2){c.setStyle(N[b+1]);for(var z=0,F=n.length;z<F;++z)c.setTransform(n[z]),c.drawGeometry(N[b])}}}return a.getImageData(0,0,u.width,u.height)}function sj(t,n,i){var r=[];if(i){var e=Math.floor(Math.round(t[0])*ej),o=Math.floor(Math.round(t[1])*ej),s=4*(ci(e,0,i.width-1)+ci(o,0,i.height-1)*i.width),a=i.data[s],u=i.data[s+1],c=i.data[s+2]+256*(u+256*a),h=Math.floor(16777215/n.length);c&&c%h==0&&r.push(n[c/h-1])}return r}var aj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uj=function(t){function n(n){var i=t.call(this,n)||this;return i.Tf=i.Ef.bind(i),i.Af,i.Cf=!1,i.Rf=null,i.Pf=null,i.Sc=-1,i.If=NaN,i.zc=[1/0,1/0,-1/0,-1/0],i.Nf=[1/0,1/0,-1/0,-1/0],i.zf,i.Ff=null,i.Lf=null,i.Gf=null,i.Df=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return aj(n,t),n.prototype.renderWorlds=function(t,n,i){var r=n.extent,e=n.viewState,o=e.center,s=e.resolution,a=e.projection,u=e.rotation,c=a.getExtent(),h=this.getLayer().getSource(),f=n.pixelRatio,l=n.viewHints,v=!(l[za]||l[Fa]),d=this.context,p=Math.round(n.size[0]*f),y=Math.round(n.size[1]*f),m=h.getWrapX()&&a.canWrapX(),w=m?ti(c):null,b=m?Math.ceil((r[2]-c[2])/w)+1:1,g=m?Math.floor((r[0]-c[0])/w):0;do{var x=this.getRenderTransform(o,s,u,f,p,y,g*w);t.execute(d,1,x,u,v,void 0,i)}while(++g<b)},n.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},n.prototype.renderFrame=function(t,n){var i=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];sn(this.pixelTransform,1/i,1/i),cn(this.inversePixelTransform,this.pixelTransform);var e=fn(this.pixelTransform);this.useContainer(n,e,r.opacity,this.getBackground(t));var o=this.context,s=o.canvas,a=this.Df,u=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!u||u.isEmpty()))return null;var c=Math.round(t.size[0]*i),h=Math.round(t.size[1]*i);s.width!=c||s.height!=h?(s.width=c,s.height=h,s.style.transform!==e&&(s.style.transform=e)):this.containerReused||o.clearRect(0,0,c,h),this.preRender(o,t);var f=t.viewState,l=f.projection,v=!1,d=!0;if(r.extent&&this.clipping){var p=Gr(r.extent,l);(v=(d=ni(p,t.extent))&&!On(p,t.extent))&&this.clipUnrotated(o,t,p)}d&&this.renderWorlds(a,t),v&&o.restore(),this.postRender(o,t);var y=Ns(r.opacity),m=this.container;return y!==m.style.opacity&&(m.style.opacity=y),this.zf!==f.rotation&&(this.zf=f.rotation,this.Rf=null),this.container},n.prototype.getFeatures=function(t){return new Promise(function(n){if(!this.Rf&&!this.Af){var i=[this.context.canvas.width,this.context.canvas.height];rn(this.pixelTransform,i);var r=this.Ff,e=this.If,o=this.zf,s=this.Lf,a=this.Nf,u=this.getLayer(),c=[],h=i[0]*ej,f=i[1]*ej;c.push(this.getRenderTransform(r,e,o,ej,h,f,0).slice());var l=u.getSource(),v=s.getExtent();if(l.getWrapX()&&s.canWrapX()&&!On(v,a)){for(var d=a[0],p=ti(v),y=0,m=void 0;d<v[0];)m=p*--y,c.push(this.getRenderTransform(r,e,o,ej,h,f,m).slice()),d+=p;for(y=0,d=a[2];d>v[2];)m=p*++y,c.push(this.getRenderTransform(r,e,o,ej,h,f,m).slice()),d-=p}this.Rf=oj(i,c,this.Pf,u.getStyleFunction(),a,e,o)}n(sj(t,this.Pf,this.Rf))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){var s=this;if(this.Df){var a,u=n.viewState.resolution,c=n.viewState.rotation,h=this.getLayer(),f={},l=function(t,n,i){var s=o(t),a=f[s];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return f[s]=!0,e.splice(e.lastIndexOf(a),1),r(t,h,n);a.geometry=n,a.distanceSq=i}}else{if(0===i)return f[s]=!0,r(t,h,n);e.push(f[s]={feature:t,layer:h,geometry:n,distanceSq:i,callback:r})}},v=[this.Df];return this.declutterExecutorGroup&&v.push(this.declutterExecutorGroup),v.some((function(r){return a=r.forEachFeatureAtCoordinate(t,u,c,i,l,r===s.declutterExecutorGroup&&n.declutterTree?n.declutterTree.all().map((function(t){return t.value})):null)})),a}},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.Df&&t.changed()},n.prototype.Ef=function(t){this.renderIfReadyAndVisible()},n.prototype.prepareFrame=function(t){var n=this.getLayer(),i=n.getSource();if(!i)return!1;var r=t.viewHints[za],e=t.viewHints[Fa],o=n.getUpdateWhileAnimating(),s=n.getUpdateWhileInteracting();if(!this.Cf&&!o&&r||!s&&e)return this.Af=!0,!0;this.Af=!1;var a=t.extent,u=t.viewState,c=u.projection,h=u.resolution,f=t.pixelRatio,l=n.getRevision(),v=n.getRenderBuffer(),d=n.getRenderOrder();void 0===d&&(d=Ph);var p=u.center.slice(),y=Sn(a,v*h),m=y.slice(),w=[y.slice()],b=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!On(b,t.extent)){var g=ti(b),j=Math.max(ti(y)/2,g);y[0]=b[0]-j,y[2]=b[2]+j,ar(p,c);var S=ai(w[0],c);S[0]<b[0]&&S[2]<b[2]?w.push([S[0]+g,S[1],S[2]+g,S[3]]):S[0]>b[0]&&S[2]>b[2]&&w.push([S[0]-g,S[1],S[2]-g,S[3]])}if(!this.Cf&&this.If==h&&this.Sc==l&&this.Gf==d&&On(this.Nf,y))return x(this.zc,m)||(this.Rf=null,this.zc=m),this.Ff=p,this.replayGroupChanged=!1,!0;this.Df=null,this.Cf=!1;var k,M=new Dx(Nh(h,f),y,h,f);this.getLayer().getDeclutter()&&(k=new Dx(Nh(h,f),y,h,f));var _,O=Nr();if(O){for(var T=0,E=w.length;T<E;++T){var A=Lr(w[T],c);i.loadFeatures(A,Dr(h,c),O)}_=Er(O,c)}else for(T=0,E=w.length;T<E;++T)i.loadFeatures(w[T],h,c);var C=Ih(h,f),R=function(t){var i,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(i=r(t,h)),i){var e=this.renderFeature(t,C,i,M,_,k);this.Cf=this.Cf||e}}.bind(this),P=Lr(y,c),I=i.getFeaturesInExtent(P);d&&I.sort(d);for(T=0,E=I.length;T<E;++T)R(I[T]);this.Pf=I;var N=M.finish(),z=new rj(y,h,f,i.getOverlaps(),N,n.getRenderBuffer());return k&&(this.declutterExecutorGroup=new rj(y,h,f,i.getOverlaps(),k.finish(),n.getRenderBuffer())),this.If=h,this.Sc=l,this.Gf=d,this.zc=m,this.Nf=y,this.Ff=p,this.Lf=c,this.Df=z,this.Rf=null,this.replayGroupChanged=!0,!0},n.prototype.renderFeature=function(t,n,i,r,e,o){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var a=0,u=i.length;a<u;++a)s=zh(r,t,i[a],n,this.Tf,e,o)||s;else s=zh(r,t,i,n,this.Tf,e,o);return s},n}(xg),cj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hj=function(t){function n(n){var i=t.call(this,n)||this;return i.Uf=new uj(n),i.qf=n.getImageRatio(),i.Bf=[1,0,0,1,0,0],i.Wf=null,i}return cj(n,t),n.prototype.disposeInternal=function(){this.Uf.dispose(),t.prototype.disposeInternal.call(this)},n.prototype.getFeatures=function(t){if(!this.Uf)return new Promise((function(t){return t([])}));var n=rn(this.Bf,rn(this.Wf,t.slice()));return this.Uf.getFeatures(n)},n.prototype.handleFontsChanged=function(){this.Uf.handleFontsChanged()},n.prototype.prepareFrame=function(t){var n=t.pixelRatio,i=t.viewState,r=i.resolution,e=t.viewHints,o=this.Uf,s=t.extent;1!==this.qf&&ei(s=s.slice(0),this.qf);var a=ti(s)/r,u=Yn(s)/r;if(!e[za]&&!e[Fa]&&!ii(s)){o.useContainer(null,null,1);var c=o.context,h=E({},t,{declutterTree:new ed(9),extent:s,size:[a,u],viewState:E({},t.viewState,{rotation:0})}),f=!0,l=new _o(s,r,n,c.canvas,(function(t){o.prepareFrame(h)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(h,null)&&(o.renderDeclutter(h),f=!1),t())}));l.addEventListener(N,function(){if(l.getState()===bo){this.Nt=f?null:l;var t=l.getResolution(),r=l.getPixelRatio(),e=t*n/r;this.renderedResolution=e,this.Bf=un(this.Bf,a/2,u/2,1/e,-1/e,0,-i.center[0],-i.center[1])}}.bind(this)),l.load()}return this.Nt&&(this.Wf=t.pixelToCoordinateTransform.slice()),!!this.Nt},n.prototype.preRender=function(){},n.prototype.postRender=function(){},n.prototype.renderDeclutter=function(){},n.prototype.forEachFeatureAtCoordinate=function(n,i,r,e,o){return this.Uf?this.Uf.forEachFeatureAtCoordinate(n,i,r,e,o):t.prototype.forEachFeatureAtCoordinate.call(this,n,i,r,e,o)},n}(Sg),fj="image",lj="hybrid",vj="vector",dj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pj={image:[Ah,_h,Eh,Th,Ch],hybrid:[Ah,Eh],vector:[]},yj={hybrid:[Th,Ch,Oh],vector:[Ah,_h,Eh,Th,Ch,Oh]},mj=function(t){function n(n){var i=t.call(this,n)||this;return i.Tf=i.Ef.bind(i),i.Cf=!1,i.Vf,i.Wf=null,i.zf,i.Xf=[1,0,0,1,0,0],i}return dj(n,t),n.prototype.prepareTile=function(t,n,i){var r,e=t.getState();return e!==dt&&e!==pt||(this.Hf(t,n,i),this.Jf(t)&&(r=!0)),r},n.prototype.getTile=function(n,i,r,e){var o=e.pixelRatio,s=e.viewState,a=s.resolution,u=s.projection,c=this.getLayer(),h=c.getSource().getTile(n,i,r,o,u),f=e.viewHints,l=!(f[za]||f[Fa]);return!l&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,u)&&(l||Date.now()-e.time<8)&&c.getRenderMode()!==vj&&this.Kf(h,e),t.prototype.getTile.call(this,n,i,r,e)},n.prototype.isDrawableTile=function(n){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,n)&&(i.getRenderMode()===vj?o(i)in n.executorGroups:n.hasContext(i))},n.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},n.prototype.prepareFrame=function(n){var i=this.getLayer().getRevision();return this.Vf!=i&&(this.renderedTiles.length=0),this.Vf=i,t.prototype.prepareFrame.call(this,n)},n.prototype.Hf=function(t,n,i){var r=this.getLayer(),e=r.getRevision(),s=r.getRenderOrder()||null,a=t.wantedResolution,u=t.getReplayState(r);if(u.dirty||u.renderedResolution!==a||u.renderedRevision!=e||u.renderedRenderOrder!=s){var c=r.getSource(),h=r.getDeclutter(),f=c.getTileGrid(),l=c.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),v=c.getSourceTiles(n,i,t),d=o(r);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],h&&(t.declutterExecutorGroups[d]=[]);for(var p=function(i,e){var o=v[i];if(o.getState()!=dt)return"continue";var p=o.tileCoord,m=f.getTileCoordExtent(p),w=Zn(l,m),b=Sn(w,r.getRenderBuffer()*a,y.tmpExtent),g=Nn(m,w)?null:b;u.dirty=!1;var x=new Dx(0,b,a,n),j=h?new Dx(0,w,a,n):void 0,S=Ih(a,n),k=function(t){var n,i=t.getStyleFunction()||r.getStyleFunction();if(i&&(n=i(t,a)),n){var e=this.renderFeature(t,S,n,x,j);this.Cf=this.Cf||e,u.dirty=u.dirty||e}},M=o.getFeatures();s&&s!==u.renderedRenderOrder&&M.sort(s);for(var _=0,O=M.length;_<O;++_){var T=M[_];g&&!ni(g,T.getGeometry().getExtent())||k.call(y,T)}var E=x.finish(),A=r.getRenderMode()!==vj&&h&&1===v.length?null:w,C=new rj(A,a,n,c.getOverlaps(),E,r.getRenderBuffer());if(t.executorGroups[d].push(C),j){var R=new rj(null,a,n,c.getOverlaps(),j.finish(),r.getRenderBuffer());t.declutterExecutorGroups[d].push(R)}},y=this,m=0,w=v.length;m<w;++m)p(m);u.renderedRevision=e,u.renderedRenderOrder=s,u.renderedResolution=a}},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){var s=n.viewState.resolution,a=n.viewState.rotation;i=null==i?0:i;var u=this.getLayer(),c=u.getSource().getTileGridForProjection(n.viewState.projection),h=jn([t]);Sn(h,s*i,h);for(var f,l={},v=function(t,n,i){var s=t.getId();void 0===s&&(s=o(t));var a=l[s];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return l[s]=!0,e.splice(e.lastIndexOf(a),1),r(t,u,n);a.geometry=n,a.distanceSq=i}}else{if(0===i)return l[s]=!0,r(t,u,n);e.push(l[s]={feature:t,layer:u,geometry:n,distanceSq:i,callback:r})}},d=this.renderedTiles,p=function(r,e){var l=d[r];if(!ni(c.getTileCoordExtent(l.wrappedTileCoord),h))return"continue";var p=o(u),y=[l.executorGroups[p]],m=l.declutterExecutorGroups[p];m&&y.push(m),y.some((function(r){for(var e=r===m?n.declutterTree.all().map((function(t){return t.value})):null,o=0,u=r.length;o<u;++o){var c=r[o];if(f=c.forEachFeatureAtCoordinate(t,s,a,i,v,e))return!0}}))},y=0,m=d.length;!f&&y<m;++y)p(y);return f},n.prototype.getFeatures=function(t){return new Promise(function(n,i){for(var r,e=this.getLayer(),s=o(e),a=e.getSource(),u=this.renderedProjection,c=u.getExtent(),h=this.renderedResolution,f=a.getTileGridForProjection(u),l=rn(this.Wf,t.slice()),v=f.getTileCoordForCoordAndResolution(l,h),d=0,p=this.renderedTiles.length;d<p;++d)if(v.toString()===this.renderedTiles[d].tileCoord.toString()){if((r=this.renderedTiles[d]).getState()===dt){var y=f.getTileCoordExtent(r.tileCoord);a.getWrapX()&&u.canWrapX()&&!On(c,y)&&ar(l,u);break}r=void 0}if(!r||r.loadingSourceTiles>0)n([]);else{var m=$n(f.getTileCoordExtent(r.wrappedTileCoord)),w=[(l[0]-m[0])/h,(m[1]-l[1])/h],b=r.getSourceTiles().reduce((function(t,n){return t.concat(n.getFeatures())}),[]),g=r.hitDetectionImageData[s];if(!g&&!this.Af){var x=uu(f.getTileSize(f.getZForResolution(h))),j=this.zf;g=oj(x,[this.getRenderTransform(f.getTileCoordCenter(r.wrappedTileCoord),h,0,ej,x[0]*ej,x[1]*ej,0)],b,e.getStyleFunction(),f.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(e).renderedResolution,j),r.hitDetectionImageData[s]=g}n(sj(w,b,g))}}.bind(this))},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.Vf&&t.changed()},n.prototype.Ef=function(t){this.renderIfReadyAndVisible()},n.prototype.renderDeclutter=function(t){var n=this.context,i=n.globalAlpha;n.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,e=!(r[za]||r[Fa]),s=this.renderedTiles,a=0,u=s.length;a<u;++a){var c=s[a],h=c.declutterExecutorGroups[o(this.getLayer())];if(h)for(var f=h.length-1;f>=0;--f)h[f].execute(this.context,1,this.getTileRenderTransform(c,t),t.viewState.rotation,e,void 0,t.declutterTree)}n.globalAlpha=i},n.prototype.getTileRenderTransform=function(t,n){var i=n.pixelRatio,r=n.viewState,e=r.center,o=r.resolution,s=r.rotation,a=n.size,u=Math.round(a[0]*i),c=Math.round(a[1]*i),h=this.getLayer().getSource().getTileGridForProjection(n.viewState.projection),f=t.tileCoord,l=h.getTileCoordExtent(t.wrappedTileCoord),v=h.getTileCoordExtent(f,this.tmpExtent)[0]-l[0];return Qt(on(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(e,o,s,i,u,c,v))},n.prototype.renderFrame=function(n,i){var r=n.viewHints,e=!(r[za]||r[Fa]);t.prototype.renderFrame.call(this,n,i),this.Wf=n.pixelToCoordinateTransform.slice(),this.zf=n.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),u=this.context,c=u.globalAlpha;u.globalAlpha=s.getOpacity();for(var h=yj[a],f=n.viewState,l=f.rotation,v=s.getSource(),d=v.getTileGridForProjection(f.projection).getZForResolution(f.resolution,v.zDirection),p=this.renderedTiles,y=[],m=[],w=p.length-1;w>=0;--w){var b=p[w],g=b.executorGroups[o(s)].filter((function(t){return t.hasExecutors(h)}));if(0!==g.length){for(var x=this.getTileRenderTransform(b,n),j=b.tileCoord[0],S=!1,k=g[0].getClipCoords(x),M=0,_=y.length;M<_;++M)if(d!==j&&j<m[M]){var O=y[M];ni([k[0],k[3],k[4],k[7]],[O[0],O[3],O[4],O[7]])&&(S||(u.save(),S=!0),u.beginPath(),u.moveTo(k[0],k[1]),u.lineTo(k[2],k[3]),u.lineTo(k[4],k[5]),u.lineTo(k[6],k[7]),u.moveTo(O[6],O[7]),u.lineTo(O[4],O[5]),u.lineTo(O[2],O[3]),u.lineTo(O[0],O[1]),u.clip())}y.push(k),m.push(j);for(var T=0,E=g.length;T<E;++T){g[T].execute(u,1,x,l,e,h)}S&&u.restore()}}return u.globalAlpha=c,this.container},n.prototype.renderFeature=function(t,n,i,r,e){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var s=0,a=i.length;s<a;++s)o=zh(r,t,i[s],n,this.Tf,void 0,e)||o;else o=zh(r,t,i,n,this.Tf,void 0,e);return o},n.prototype.Jf=function(t){var n=this.getLayer();if(n.getRenderMode()===vj)return!1;var i=t.getReplayState(n),r=n.getRevision(),e=t.wantedResolution;return i.renderedTileResolution!==e||i.renderedTileRevision!==r},n.prototype.Kf=function(t,n){var i=this.getLayer(),r=t.getReplayState(i),e=i.getRevision(),s=t.executorGroups[o(i)];r.renderedTileRevision=e;var a=t.wrappedTileCoord,u=a[0],c=i.getSource(),h=n.pixelRatio,f=n.viewState.projection,l=c.getTileGridForProjection(f),v=l.getResolution(t.tileCoord[0]),d=n.pixelRatio/t.wantedResolution*v,p=l.getResolution(u),y=t.getContext(i);h=Math.round(Math.max(h,d/h));var m=c.getTilePixelSize(u,h,f);y.canvas.width=m[0],y.canvas.height=m[1];var w=h/d;if(1!==w){var b=$t(this.Xf);on(b,w,w),y.setTransform.apply(y,b)}var g=l.getTileCoordExtent(a,this.tmpExtent),x=d/p,j=$t(this.Xf);on(j,x,-x),an(j,-g[0],-g[3]);for(var S=0,k=s.length;S<k;++S){s[S].execute(y,w,j,0,!0,pj[i.getRenderMode()])}r.renderedTileResolution=t.wantedResolution},n}(Cg),wj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bj=function(t){function n(n,i){var r=t.call(this)||this;return i&&!Array.isArray(n[0])?r.setFlatCoordinates(i,n):r.setCoordinates(n,i),r}return wj(n,t),n.prototype.appendPoint=function(t){this.flatCoordinates?b(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){if(r<Mn(this.getExtent(),t,n))return r;for(var e=this.flatCoordinates,o=this.stride,s=0,a=e.length;s<a;s+=o){var u=vi(t,n,e[s],e[s+1]);if(u<r){r=u;for(var c=0;c<o;++c)i[c]=e[s+c];i.length=o}}return r},n.prototype.getCoordinates=function(){return be(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getPoint=function(t){var n=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||n<=t?null:new Te(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},n.prototype.getPoints=function(){for(var t=this.flatCoordinates,n=this.layout,i=this.stride,r=[],e=0,o=t.length;e<o;e+=i){var s=new Te(t.slice(e,e+i),n);r.push(s)}return r},n.prototype.getType=function(){return Pt.MULTI_POINT},n.prototype.intersectsExtent=function(t){for(var n=this.flatCoordinates,i=this.stride,r=0,e=n.length;r<e;r+=i){if(Tn(t,n[r],n[r+1]))return!0}return!1},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ce(this.flatCoordinates,0,t,this.stride),this.changed()},n}(te);function gj(t,n,i,r,e,o,s){var a,u,c=(i-n)/r;if(1===c)a=n;else if(2===c)a=n,u=e;else if(0!==c){for(var h=t[n],f=t[n+1],l=0,v=[0],p=n+r;p<i;p+=r){var y=t[p],m=t[p+1];l+=Math.sqrt((y-h)*(y-h)+(m-f)*(m-f)),v.push(l),h=y,f=m}var w=e*l,b=d(v,w);b<0?(u=(w-v[-b-2])/(v[-b-1]-v[-b-2]),a=n+(-b-2)*r):a=n+b*r}var g=s>1?s:2,x=o||new Array(g);for(p=0;p<g;++p)x[p]=void 0===a?NaN:void 0===u?t[a+p]:wi(t[a+p],t[a+r+p],u);return x}function xj(t,n,i,r,e,o){if(i==n)return null;var s;if(e<t[n+r-1])return o?((s=t.slice(n,n+r))[r-1]=e,s):null;if(t[i-1]<e)return o?((s=t.slice(i-r,i))[r-1]=e,s):null;if(e==t[n+r-1])return t.slice(n,n+r);for(var a=n/r,u=i/r;a<u;){var c=a+u>>1;e<t[(c+1)*r-1]?u=c:a=c+1}var h=t[a*r-1];if(e==h)return t.slice((a-1)*r,(a-1)*r+r);var f=(e-h)/(t[(a+1)*r-1]-h);s=[];for(var l=0;l<r-1;++l)s.push(wi(t[(a-1)*r+l],t[a*r+l],f));return s.push(e),s}function jj(t,n,i,r,e,o,s){if(s)return xj(t,n,i[i.length-1],r,e,o);var a;if(e<t[r-1])return o?((a=t.slice(0,r))[r-1]=e,a):null;if(t[t.length-1]<e)return o?((a=t.slice(t.length-r))[r-1]=e,a):null;for(var u=0,c=i.length;u<c;++u){var h=i[u];if(n!=h){if(e<t[n+r-1])return null;if(e<=t[h-1])return xj(t,n,h,r,e,!1);n=h}}return null}var Sj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kj=function(t){function n(n,i){var r=t.call(this)||this;return r.Yf=null,r.Zf=-1,r.wt=-1,r.bt=-1,void 0===i||Array.isArray(n[0])?r.setCoordinates(n,i):r.setFlatCoordinates(i,n),r}return Sj(n,t),n.prototype.appendCoordinate=function(t){this.flatCoordinates?b(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){return r<Mn(this.getExtent(),t,n)?r:(this.bt!=this.getRevision()&&(this.wt=Math.sqrt(ie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.bt=this.getRevision()),oe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.wt,!1,t,n,i,r))},n.prototype.forEachSegment=function(t){return Ne(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinateAtM=function(t,n){if(this.layout!=Ct&&this.layout!=Rt)return null;var i=void 0!==n&&n;return xj(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},n.prototype.getCoordinates=function(){return be(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getCoordinateAt=function(t,n){return gj(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,this.stride)},n.prototype.getLength=function(){return qx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getFlatMidpoint=function(){return this.Zf!=this.getRevision()&&(this.Yf=this.getCoordinateAt(.5,this.Yf),this.Zf=this.getRevision()),this.Yf},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=le(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new n(i,Et)},n.prototype.getType=function(){return Pt.LINE_STRING},n.prototype.intersectsExtent=function(t){return ze(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ce(this.flatCoordinates,0,t,this.stride),this.changed()},n}(te),Mj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_j=function(t){function n(n,i,r){var e=t.call(this)||this;if(e.gt=[],e.wt=-1,e.bt=-1,Array.isArray(n[0]))e.setCoordinates(n,i);else if(void 0!==i&&r)e.setFlatCoordinates(i,n),e.gt=r;else{for(var o=e.getLayout(),s=n,a=[],u=[],c=0,h=s.length;c<h;++c){var f=s[c];0===c&&(o=f.getLayout()),b(a,f.getFlatCoordinates()),u.push(a.length)}e.setFlatCoordinates(o,a),e.gt=u}return e}return Mj(n,t),n.prototype.appendLineString=function(t){this.flatCoordinates?b(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.gt.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout,this.gt.slice());return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){return r<Mn(this.getExtent(),t,n)?r:(this.bt!=this.getRevision()&&(this.wt=Math.sqrt(re(this.flatCoordinates,0,this.gt,this.stride,0)),this.bt=this.getRevision()),se(this.flatCoordinates,0,this.gt,this.stride,this.wt,!1,t,n,i,r))},n.prototype.getCoordinateAtM=function(t,n,i){if(this.layout!=Ct&&this.layout!=Rt||0===this.flatCoordinates.length)return null;var r=void 0!==n&&n,e=void 0!==i&&i;return jj(this.flatCoordinates,0,this.gt,this.stride,t,r,e)},n.prototype.getCoordinates=function(){return ge(this.flatCoordinates,0,this.gt,this.stride)},n.prototype.getEnds=function(){return this.gt},n.prototype.getLineString=function(t){return t<0||this.gt.length<=t?null:new kj(this.flatCoordinates.slice(0===t?0:this.gt[t-1],this.gt[t]),this.layout)},n.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,n=this.gt,i=this.layout,r=[],e=0,o=0,s=n.length;o<s;++o){var a=n[o],u=new kj(t.slice(e,a),i);r.push(u),e=a}return r},n.prototype.getFlatMidpoints=function(){for(var t=[],n=this.flatCoordinates,i=0,r=this.gt,e=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];b(t,gj(n,i,a,e,.5)),i=a}return t},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=ve(this.flatCoordinates,0,this.gt,this.stride,t,i,0,r),new n(i,Et,r)},n.prototype.getType=function(){return Pt.MULTI_LINE_STRING},n.prototype.intersectsExtent=function(t){return Fe(this.flatCoordinates,0,this.gt,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=he(this.flatCoordinates,0,t,this.stride,this.gt);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},n}(te);function Oj(t,n,i,r){for(var e=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=i.length;s<a;++s){var u=i[s];o=In(t,n,u[0],r),e.push((o[0]+o[2])/2,(o[1]+o[3])/2),n=u[u.length-1]}return e}var Tj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ej=function(t){function n(n,i,r){var e=t.call(this)||this;if(e.$f=[],e.Qf=-1,e.tl=null,e.wt=-1,e.bt=-1,e.St=-1,e.kt=null,!r&&!Array.isArray(n[0])){for(var o=e.getLayout(),s=n,a=[],u=[],c=0,h=s.length;c<h;++c){var f=s[c];0===c&&(o=f.getLayout());for(var l=a.length,v=f.getEnds(),d=0,p=v.length;d<p;++d)v[d]+=l;b(a,f.getFlatCoordinates()),u.push(v)}i=o,n=a,r=u}return void 0!==i&&r?(e.setFlatCoordinates(i,n),e.$f=r):e.setCoordinates(n,i),e}return Tj(n,t),n.prototype.appendPolygon=function(t){var n;if(this.flatCoordinates){var i=this.flatCoordinates.length;b(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,e=(n=t.getEnds().slice()).length;r<e;++r)n[r]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),n=t.getEnds().slice(),this.$f.push();this.$f.push(n),this.changed()},n.prototype.clone=function(){for(var t=this.$f.length,i=new Array(t),r=0;r<t;++r)i[r]=this.$f[r].slice();var e=new n(this.flatCoordinates.slice(),this.layout,i);return e.applyProperties(this),e},n.prototype.closestPointXY=function(t,n,i,r){return r<Mn(this.getExtent(),t,n)?r:(this.bt!=this.getRevision()&&(this.wt=Math.sqrt(ee(this.flatCoordinates,0,this.$f,this.stride,0)),this.bt=this.getRevision()),ae(this.getOrientedFlatCoordinates(),0,this.$f,this.stride,this.wt,!0,t,n,i,r))},n.prototype.containsXY=function(t,n){return Re(this.getOrientedFlatCoordinates(),0,this.$f,this.stride,t,n)},n.prototype.getArea=function(){return ke(this.getOrientedFlatCoordinates(),0,this.$f,this.stride)},n.prototype.getCoordinates=function(t){var n;return void 0!==t?Xe(n=this.getOrientedFlatCoordinates().slice(),0,this.$f,this.stride,t):n=this.flatCoordinates,xe(n,0,this.$f,this.stride)},n.prototype.getEndss=function(){return this.$f},n.prototype.getFlatInteriorPoints=function(){if(this.Qf!=this.getRevision()){var t=Oj(this.flatCoordinates,0,this.$f,this.stride);this.tl=Ie(this.getOrientedFlatCoordinates(),0,this.$f,this.stride,t),this.Qf=this.getRevision()}return this.tl},n.prototype.getInteriorPoints=function(){return new bj(this.getFlatInteriorPoints().slice(),Ct)},n.prototype.getOrientedFlatCoordinates=function(){if(this.St!=this.getRevision()){var t=this.flatCoordinates;We(t,0,this.$f,this.stride)?this.kt=t:(this.kt=t.slice(),this.kt.length=Xe(this.kt,0,this.$f,this.stride)),this.St=this.getRevision()}return this.kt},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=we(this.flatCoordinates,0,this.$f,this.stride,Math.sqrt(t),i,0,r),new n(i,Et,r)},n.prototype.getPolygon=function(t){if(t<0||this.$f.length<=t)return null;var n;if(0===t)n=0;else{var i=this.$f[t-1];n=i[i.length-1]}var r=this.$f[t].slice(),e=r[r.length-1];if(0!==n)for(var o=0,s=r.length;o<s;++o)r[o]-=n;return new Ye(this.flatCoordinates.slice(n,e),this.layout,r)},n.prototype.getPolygons=function(){for(var t=this.layout,n=this.flatCoordinates,i=this.$f,r=[],e=0,o=0,s=i.length;o<s;++o){var a=i[o].slice(),u=a[a.length-1];if(0!==e)for(var c=0,h=a.length;c<h;++c)a[c]-=e;var f=new Ye(n.slice(e,u),t,a);r.push(f),e=u}return r},n.prototype.getType=function(){return Pt.MULTI_POLYGON},n.prototype.intersectsExtent=function(t){return De(this.getOrientedFlatCoordinates(),0,this.$f,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=fe(this.flatCoordinates,0,t,this.stride,this.$f);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},n}(te),Aj=[1,0,0,1,0,0],Cj=function(){function t(t,n,i,r,e){this.styleFunction,this.st,this.V=e,this.nl=t,this.il=n,this.tl=null,this.rl=null,this.gt=i,this.el=r}return t.prototype.get=function(t){return this.el[t]},t.prototype.getExtent=function(){return this.st||(this.st=this.nl===Pt.POINT?Pn(this.il):In(this.il,0,this.il.length,2)),this.st},t.prototype.getFlatInteriorPoint=function(){if(!this.tl){var t=Hn(this.getExtent());this.tl=Pe(this.il,0,this.gt,2,t,0)}return this.tl},t.prototype.getFlatInteriorPoints=function(){if(!this.tl){var t=Oj(this.il,0,this.gt,2);this.tl=Ie(this.il,0,this.gt,2,t)}return this.tl},t.prototype.getFlatMidpoint=function(){return this.rl||(this.rl=gj(this.il,0,this.il.length,2,.5)),this.rl},t.prototype.getFlatMidpoints=function(){if(!this.rl){this.rl=[];for(var t=this.il,n=0,i=this.gt,r=0,e=i.length;r<e;++r){var o=i[r],s=gj(t,n,o,2,.5);b(this.rl,s),n=o}}return this.rl},t.prototype.getId=function(){return this.V},t.prototype.getOrientedFlatCoordinates=function(){return this.il},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,n){return this},t.prototype.getProperties=function(){return this.el},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.nl},t.prototype.transform=function(t){var n=(t=gr(t)).getExtent(),i=t.getWorldExtent();if(n&&i){var r=Yn(i)/Yn(n);un(Aj,i[0],i[3],r,-r,0,0,0),Wr(this.il,0,this.il.length,2,Aj,this.il)}},t.prototype.getEnds=function(){return this.gt},t}();function Rj(t){var n=t.getType();switch(n){case Pt.POINT:return new Te(t.getFlatCoordinates());case Pt.MULTI_POINT:return new bj(t.getFlatCoordinates(),Et);case Pt.LINE_STRING:return new kj(t.getFlatCoordinates(),Et);case Pt.MULTI_LINE_STRING:return new _j(t.getFlatCoordinates(),Et,t.getEnds());case Pt.POLYGON:var i=t.getFlatCoordinates(),r=t.getEnds(),e=He(i,r);return e.length>1?new Ej(i,Et,e):new Ye(i,Et,r);default:throw new Error("Invalid geometry type:"+n)}}Cj.prototype.getEndss=Cj.prototype.getEnds,Cj.prototype.getFlatCoordinates=Cj.prototype.getOrientedFlatCoordinates;var Pj=Cj;var Ij=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nj=function(t){function n(n){return t.call(this,n)||this}return Ij(n,t),n.prototype.createRenderer=function(){return new uj(this)},n}(wx);function zj(t,n,i){for(var r,e,o,s,a,u,c=[],h=t(0),f=t(1),l=n(h),v=n(f),d=[f,h],p=[v,l],y=[1,0],m={},w=1e5;--w>0&&y.length>0;)o=y.pop(),h=d.pop(),l=p.pop(),(u=o.toString())in m||(c.push(l[0],l[1]),m[u]=!0),s=y.pop(),f=d.pop(),v=p.pop(),li((e=n(r=t(a=(o+s)/2)))[0],e[1],l[0],l[1],v[0],v[1])<i?(c.push(v[0],v[1]),m[u=s.toString()]=!0):(y.push(s,a,a,o),p.push(v,e,e,l),d.push(f,r,r,h));return c}function Fj(t,n,i,r,e){return zj((function(r){return[t,n+(i-n)*r]}),Ar(gr("EPSG:4326"),r),e)}function Lj(t,n,i,r,e){return zj((function(r){return[n+(i-n)*r,t]}),Ar(gr("EPSG:4326"),r),e)}var Gj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dj=new Vv({color:"rgba(0,0,0,0.2)"}),Uj=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],qj=function(t){function n(n){var i=this,r=n||{},e=E({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},r);return delete e.maxLines,delete e.strokeStyle,delete e.targetSize,delete e.showLabels,delete e.lonLabelFormatter,delete e.latLabelFormatter,delete e.lonLabelPosition,delete e.latLabelPosition,delete e.lonLabelStyle,delete e.latLabelStyle,delete e.intervals,(i=t.call(this,e)||this).di=null,i.sl=1/0,i.al=1/0,i.ul=-1/0,i.cl=-1/0,i.hl=1/0,i.fl=1/0,i.ll=-1/0,i.vl=-1/0,i.dl=void 0!==r.targetSize?r.targetSize:100,i.pl=void 0!==r.maxLines?r.maxLines:100,i.yl=[],i.ml=[],i.wl=void 0!==r.strokeStyle?r.strokeStyle:Dj,i.bl=void 0,i.gl=void 0,i.xl=null,i.jl=null,i.Sl=null,i.kl=null,i.Ml=null,i._l=null,i.Ol=null,r.showLabels&&(i.Tl=null==r.lonLabelFormatter?$i.bind(i,"EW"):r.lonLabelFormatter,i.El=null==r.latLabelFormatter?$i.bind(i,"NS"):r.latLabelFormatter,i.Al=null==r.lonLabelPosition?0:r.lonLabelPosition,i.Cl=null==r.latLabelPosition?1:r.latLabelPosition,i.Rl=new Qv({text:void 0!==r.lonLabelStyle?r.lonLabelStyle.clone():new id({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Cv({color:"rgba(0,0,0,1)"}),stroke:new Vv({color:"rgba(255,255,255,1)",width:3})})}),i.Pl=function(t){var n=t.get("graticule_label");return this.Rl.getText().setText(n),this.Rl}.bind(i),i.Il=new Qv({text:void 0!==r.latLabelStyle?r.latLabelStyle.clone():new id({font:"12px Calibri,sans-serif",textAlign:"right",fill:new Cv({color:"rgba(0,0,0,1)"}),stroke:new Vv({color:"rgba(255,255,255,1)",width:3})})}),i.Nl=function(t){var n=t.get("graticule_label");return this.Il.getText().setText(n),this.Il}.bind(i),i._l=[],i.Ol=[],i.addEventListener(hs,i.zl.bind(i))),i.Fl=void 0!==r.intervals?r.intervals:Uj,i.setSource(new Fd({loader:i.loaderFunction.bind(i),strategy:i.strategyFunction.bind(i),features:new ft,overlaps:!1,useSpatialIndex:!1,wrapX:r.wrapX})),i.Ll=[],i.Gl=new Qv({stroke:i.wl}),i.Dl=null,i.zc=null,i.If=null,i.setRenderOrder(null),i}return Gj(n,t),n.prototype.strategyFunction=function(t,n){var i=t.slice();return this.di&&this.getSource().getWrapX()&&ai(i,this.di),this.Dl&&(zn(this.Dl,i,n)?i=this.Dl.slice():this.getSource().removeLoadedExtent(this.Dl)),[i]},n.prototype.loaderFunction=function(t,n,i){this.Dl=t;var r=this.getSource(),e=Zn(this.getExtent()||[-1/0,-1/0,1/0,1/0],t);if(!(this.zc&&Nn(this.zc,e)&&this.If===n||(this.zc=e,this.If=n,ii(e)))){var o=Hn(e),s=n*n/4;(!this.di||!Tr(this.di,i))&&this.Ul(i),this.ql(e,o,n,s);var a,u=this.yl.length+this.ml.length;for(this._l&&(u+=this.yl.length),this.Ol&&(u+=this.ml.length);u>this.Ll.length;)a=new Tt,this.Ll.push(a);var c=r.getFeaturesCollection();c.clear();var h,f,l=0;for(h=0,f=this.yl.length;h<f;++h)(a=this.Ll[l++]).setGeometry(this.yl[h]),a.setStyle(this.Gl),c.push(a);for(h=0,f=this.ml.length;h<f;++h)(a=this.Ll[l++]).setGeometry(this.ml[h]),a.setStyle(this.Gl),c.push(a)}},n.prototype.Bl=function(t,n,i,r,e,o){var s=this.Wl(t,n,i,r,o);if(ni(s.getExtent(),e)){if(this._l){var a=this.Tl(t);o in this._l?this._l[o].text=a:this._l[o]={geom:new Te([]),text:a}}this.yl[o++]=s}return o},n.prototype.Vl=function(t,n,i,r,e,o){var s=this.Xl(t,n,i,r,o);if(ni(s.getExtent(),e)){if(this.Ol){var a=this.El(t);o in this.Ol?this.Ol[o].text=a:this.Ol[o]={geom:new Te([]),text:a}}this.ml[o++]=s}return o},n.prototype.zl=function(t){var n=t.frameState.viewState.rotation,i=t.frameState.viewState.resolution,r=t.frameState.size,e=t.frameState.extent,o=Hn(e),s=e;if(n){var a=r[0]*i,u=r[1]*i;s=[o[0]-a/2,o[1]-u/2,o[0]+a/2,o[1]+u/2]}var c=0,h=0,f=this.Cl<.5,l=this.di.getExtent(),v=ti(l);this.getSource().getWrapX()&&this.di.canWrapX()&&!On(l,e)&&(c=Math.floor((e[0]-l[0])/v),h=Math.ceil((e[2]-l[2])/v),f=f!==Math.abs(n)>Math.PI/2);for(var d=Lh(t),p=c;p<=h;++p){var y=this.yl.length+this.ml.length,m=void 0,w=void 0,b=void 0,g=void 0;if(this._l)for(w=0,b=this._l.length;w<b;++w){var x=this.yl[w];if(n||0!==p)(j=x.clone()).translate(p*v,0),j.rotate(-n,o),(g=this.Hl(j,s,w)).rotate(n,o);else g=this.Hl(x,e,w);(m=this.Ll[y++]).setGeometry(g),m.set("graticule_label",this._l[w].text),d.drawFeature(m,this.Pl(m))}if(this.Ol&&(p===c&&f||p===h&&!f))for(w=0,b=this.ml.length;w<b;++w){var j;x=this.ml[w];if(n||0!==p)(j=x.clone()).translate(p*v,0),j.rotate(-n,o),(g=this.Jl(j,s,w)).rotate(n,o);else g=this.Jl(x,e,w);(m=this.Ll[y++]).setGeometry(g),m.set("graticule_label",this.Ol[w].text),d.drawFeature(m,this.Nl(m))}}},n.prototype.ql=function(t,n,i,r){var e=this.Kl(i);if(-1==e)return this.yl.length=0,this.ml.length=0,this._l&&(this._l.length=0),void(this.Ol&&(this.Ol.length=0));var o=!1,s=this.di.getExtent(),a=ti(s);this.getSource().getWrapX()&&this.di.canWrapX()&&!On(s,t)&&(ti(t)>=a?(t[0]=s[0],t[2]=s[2]):o=!0);var u=[ci(n[0],this.ll,this.hl),ci(n[1],this.vl,this.fl)],c=this.gl(u);isNaN(c[1])&&(c[1]=Math.abs(this.sl)>=Math.abs(this.ul)?this.sl:this.ul);var h,f,l,v,d=ci(c[0],this.cl,this.al),p=ci(c[1],this.ul,this.sl),y=this.pl,m=t;o||(m=[ci(t[0],this.ll,this.hl),ci(t[1],this.vl,this.fl),ci(t[2],this.ll,this.hl),ci(t[3],this.vl,this.fl)]);var w=si(m,this.gl,void 0,8),b=w[3],g=w[2],x=w[1],j=w[0];if(o||(_n(m,this.jl)&&(j=this.cl,x=this.ul),_n(m,this.Sl)&&(g=this.al,x=this.ul),_n(m,this.kl)&&(j=this.cl,b=this.sl),_n(m,this.Ml)&&(g=this.al,b=this.sl),b=ci(b,p,this.sl),g=ci(g,d,this.al),x=ci(x,this.ul,p),j=ci(j,this.cl,d)),v=ci(d=Math.floor(d/e)*e,this.cl,this.al),f=this.Bl(v,x,b,r,t,0),h=0,o)for(;(v-=e)>=j&&h++<y;)f=this.Bl(v,x,b,r,t,f);else for(;v!=this.cl&&h++<y;)v=Math.max(v-e,this.cl),f=this.Bl(v,x,b,r,t,f);if(v=ci(d,this.cl,this.al),h=0,o)for(;(v+=e)<=g&&h++<y;)f=this.Bl(v,x,b,r,t,f);else for(;v!=this.al&&h++<y;)v=Math.min(v+e,this.al),f=this.Bl(v,x,b,r,t,f);for(this.yl.length=f,this._l&&(this._l.length=f),l=ci(p=Math.floor(p/e)*e,this.ul,this.sl),f=this.Vl(l,j,g,r,t,0),h=0;l!=this.ul&&h++<y;)l=Math.max(l-e,this.ul),f=this.Vl(l,j,g,r,t,f);for(l=ci(p,this.ul,this.sl),h=0;l!=this.sl&&h++<y;)l=Math.min(l+e,this.sl),f=this.Vl(l,j,g,r,t,f);this.ml.length=f,this.Ol&&(this.Ol.length=f)},n.prototype.Kl=function(t){for(var n=this.xl[0],i=this.xl[1],r=-1,e=Math.pow(this.dl*t,2),o=[],s=[],a=0,u=this.Fl.length;a<u;++a){var c=ci(this.Fl[a]/2,0,90),h=ci(i,-90+c,90-c);if(o[0]=n-c,o[1]=h-c,s[0]=n+c,s[1]=h+c,this.bl(o,o),this.bl(s,s),Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)<=e)break;r=this.Fl[a]}return r},n.prototype.Wl=function(t,n,i,r,e){var o=Fj(t,n,i,this.di,r),s=this.yl[e];return s?(s.setFlatCoordinates(Et,o),s.changed()):(s=new kj(o,Et),this.yl[e]=s),s},n.prototype.Hl=function(t,n,i){var r=t.getFlatCoordinates(),e=1,o=r.length-1;r[e]>r[o]&&(e=o,o=1);var s=Math.max(n[1],r[e]),a=Math.min(n[3],r[o]),u=ci(n[1]+Math.abs(n[1]-n[3])*this.Al,s,a),c=[r[e-1]+(r[o-1]-r[e-1])*(u-r[e])/(r[o]-r[e]),u],h=this._l[i].geom;return h.setCoordinates(c),h},n.prototype.getMeridians=function(){return this.yl},n.prototype.Xl=function(t,n,i,r,e){var o=Lj(t,n,i,this.di,r),s=this.ml[e];return s?(s.setFlatCoordinates(Et,o),s.changed()):s=new kj(o,Et),s},n.prototype.Jl=function(t,n,i){var r=t.getFlatCoordinates(),e=0,o=r.length-2;r[e]>r[o]&&(e=o,o=0);var s=Math.max(n[0],r[e]),a=Math.min(n[2],r[o]),u=ci(n[0]+Math.abs(n[0]-n[2])*this.Cl,s,a),c=[u,r[e+1]+(r[o+1]-r[e+1])*(u-r[e])/(r[o]-r[e])],h=this.Ol[i].geom;return h.setCoordinates(c),h},n.prototype.getParallels=function(){return this.ml},n.prototype.Ul=function(t){var n=gr("EPSG:4326"),i=t.getWorldExtent();this.sl=i[3],this.al=i[2],this.ul=i[1],this.cl=i[0];var r=Ar(t,n);if(this.cl<this.al)this.gl=r;else{var e=this.cl+this.al/2;this.al+=360,this.gl=function(t,n,i){for(var o=i||2,s=r(t,n,o),a=0,u=s.length;a<u;a+=o)s[a]<e&&(s[a]+=360);return s}}this.bl=Ar(n,t);var o=si([this.cl,this.ul,this.al,this.sl],this.bl,void 0,8);this.ll=o[0],this.hl=o[2],this.vl=o[1],this.fl=o[3],this.jl=this.bl([this.cl,this.ul]),this.Sl=this.bl([this.al,this.ul]),this.kl=this.bl([this.cl,this.sl]),this.Ml=this.bl([this.al,this.sl]),this.xl=this.gl(Hn(t.getExtent())),isNaN(this.xl[1])&&(this.xl[1]=Math.abs(this.sl)>=Math.abs(this.ul)?this.sl:this.ul),this.di=t},n}(Nj),Bj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wj="blur",Vj="gradient",Xj="radius",Hj=["#00f","#0ff","#0f0","#ff0","#f00"];var Jj=function(t){function n(n){var i=this,r=n||{},e=E({},r);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,(i=t.call(this,e)||this).Yl=null,i.addChangeListener(Vj,i.Zl),i.setGradient(r.gradient?r.gradient:Hj),i.setBlur(void 0!==r.blur?r.blur:15),i.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return i.$l="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return Bj(n,t),n.prototype.getBlur=function(){return this.get(Wj)},n.prototype.getGradient=function(){return this.get(Vj)},n.prototype.getRadius=function(){return this.get(Xj)},n.prototype.Zl=function(){this.Yl=function(t){for(var n=1,i=256,r=Oo(n,i),e=r.createLinearGradient(0,0,n,i),o=1/(t.length-1),s=0,a=t.length;s<a;++s)e.addColorStop(s*o,t[s]);return r.fillStyle=e,r.fillRect(0,0,n,i),r.canvas}(this.getGradient())},n.prototype.setBlur=function(t){this.set(Wj,t)},n.prototype.setGradient=function(t){this.set(Vj,t)},n.prototype.setRadius=function(t){this.set(Xj,t)},n.prototype.createRenderer=function(){return new gx(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var n=this.$l(t);return void 0!==n?ci(n,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Xj)+this.get(Wj))}.bind(this),u_blurSlope:function(){return this.get(Xj)/Math.max(1,this.get(Wj))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.Yl}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},n.prototype.renderDeclutter=function(){},n}(wx),Kj=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,n){var i;if(n){var r=n.dataProjection?gr(n.dataProjection):this.readProjection(t);n.extent&&r&&r.getUnits()===Gt.TILE_PIXELS&&(r=gr(r)).setWorldExtent(n.extent),i={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return E({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return r()},t.prototype.readFeature=function(t,n){return r()},t.prototype.readFeatures=function(t,n){return r()},t.prototype.readGeometry=function(t,n){return r()},t.prototype.readProjection=function(t){return r()},t.prototype.writeFeature=function(t,n){return r()},t.prototype.writeFeatures=function(t,n){return r()},t.prototype.writeGeometry=function(t,n){return r()},t}();function Yj(t,n,i){var r,e=i?gr(i.featureProjection):null,o=i?gr(i.dataProjection):null;if(r=e&&o&&!Tr(e,o)?(n?t.clone():t).transform(n?e:o,n?o:e):t,n&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);r===t&&(r=t.clone()),r.applyTransform((function(t){for(var n=0,i=t.length;n<i;++n)t[n]=Math.round(t[n]*s)/s;return t}))}return r}function Zj(t,n){var i=n?gr(n.featureProjection):null,r=n?gr(n.dataProjection):null;return i&&r&&!Tr(i,r)?Rr(t,r,i):t}var $j=i(98),Qj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function tS(t,n,i){if(3===t){var r={keys:[],values:[],features:[]},e=i.readVarint()+i.pos;i.readFields(nS,r,e),r.length=r.features.length,r.length&&(n[r.name]=r)}}function nS(t,n,i){if(15===t)n.version=i.readVarint();else if(1===t)n.name=i.readString();else if(5===t)n.extent=i.readVarint();else if(2===t)n.features.push(i.pos);else if(3===t)n.keys.push(i.readString());else if(4===t){for(var r=null,e=i.readVarint()+i.pos;i.pos<e;)r=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;n.values.push(r)}}function iS(t,n,i){if(1==t)n.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos<r;){var e=n.layer.keys[i.readVarint()],o=n.layer.values[i.readVarint()];n.properties[e]=o}else 3==t?n.type=i.readVarint():4==t&&(n.geometry=i.pos)}function rS(t,n,i){t.pos=n.features[i];var r=t.readVarint()+t.pos,e={layer:n,type:0,properties:{}};return t.readFields(iS,e,r),e}var eS=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=new ui({code:"",units:Gt.TILE_PIXELS}),i.Ql=r.featureClass?r.featureClass:Pj,i.H=r.geometryName,i.tv=r.layerName?r.layerName:"layer",i.qc=r.layers?r.layers:null,i.nv=r.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Qj(n,t),n.prototype.iv=function(t,n,i,r){t.pos=n.geometry;for(var e=t.readVarint()+t.pos,o=1,s=0,a=0,u=0,c=0,h=0;t.pos<e;){if(!s){var f=t.readVarint();o=7&f,s=f>>3}s--,1===o||2===o?(a+=t.readSVarint(),u+=t.readSVarint(),1===o&&c>h&&(r.push(c),h=c),i.push(a,u),c+=2):7===o?c>h&&(i.push(i[h],i[h+1]),c+=2):Mt(!1,59)}c>h&&(r.push(c),h=c)},n.prototype.rv=function(t,n,i){var r,e=n.type;if(0===e)return null;var o,s=n.properties;this.nv?(o=s[this.nv],delete s[this.nv]):o=n.id,s[this.tv]=n.layer.name;var a=[],u=[];this.iv(t,n,a,u);var c=function(t,n){var i;1===t?i=1===n?Pt.POINT:Pt.MULTI_POINT:2===t?i=1===n?Pt.LINE_STRING:Pt.MULTI_LINE_STRING:3===t&&(i=Pt.POLYGON);return i}(e,u.length);if(this.Ql===Pj)(r=new this.Ql(c,a,u,s,o)).transform(i.dataProjection);else{var h=void 0;if(c==Pt.POLYGON){var f=He(a,u);h=f.length>1?new Ej(a,Et,f):new Ye(a,Et,u)}else h=c===Pt.POINT?new Te(a,Et):c===Pt.LINE_STRING?new kj(a,Et):c===Pt.POLYGON?new Ye(a,Et,u):c===Pt.MULTI_POINT?new bj(a,Et):c===Pt.MULTI_LINE_STRING?new _j(a,Et,u):null;r=new(0,this.Ql),this.H&&r.setGeometryName(this.H);var l=Yj(h,!1,i);r.setGeometry(l),void 0!==o&&r.setId(o),r.setProperties(s,!0)}return r},n.prototype.getType=function(){return uh},n.prototype.readFeatures=function(t,n){var i=this.qc,r=this.adaptOptions(n),e=gr(r.dataProjection);e.setWorldExtent(r.extent),r.dataProjection=e;var o=new $j(t),s=o.readFields(tS,{}),a=[];for(var u in s)if(!i||-1!=i.indexOf(u)){var c=s[u],h=c?[0,0,c.extent,c.extent]:null;e.setExtent(h);for(var f=0,l=c.length;f<l;++f){var v=rS(o,c,f),d=this.rv(o,v,r);null!==d&&a.push(d)}}return a},n.prototype.readProjection=function(t){return this.dataProjection},n.prototype.setLayers=function(t){this.qc=t},n}(Kj),oS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sS=function(t){function n(n){var i=this,r=n||{},e=E({},r);delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,r.renderMode===fj&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),r.renderMode=void 0);var o=r.renderMode||lj;return Mt(o==lj||o==vj,28),i.ev=o,i.setPreload(r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i.getBackground,i.setBackground,i}return oS(n,t),n.prototype.createRenderer=function(){return new mj(this)},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderMode=function(){return this.ev},n.prototype.getPreload=function(){return this.get(_g)},n.prototype.getUseInterimTilesOnError=function(){return this.get(Og)},n.prototype.setPreload=function(t){this.set(_g,t)},n.prototype.setUseInterimTilesOnError=function(t){this.set(Og,t)},n}(wx),aS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function uS(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].clone());return n}var cS=function(t){function n(n){var i=t.call(this)||this;return i.ov=n||null,i.sv=[],i.av(),i}return aS(n,t),n.prototype.uv=function(){this.sv.forEach($),this.sv.length=0},n.prototype.av=function(){if(this.ov)for(var t=0,n=this.ov.length;t<n;++t)this.sv.push(Y(this.ov[t],N,this.changed,this))},n.prototype.clone=function(){var t=new n(null);return t.setGeometries(this.ov),t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){if(r<Mn(this.getExtent(),t,n))return r;for(var e=this.ov,o=0,s=e.length;o<s;++o)r=e[o].closestPointXY(t,n,i,r);return r},n.prototype.containsXY=function(t,n){for(var i=this.ov,r=0,e=i.length;r<e;++r)if(i[r].containsXY(t,n))return!0;return!1},n.prototype.computeExtent=function(t){Rn(t);for(var n=this.ov,i=0,r=n.length;i<r;++i)Fn(t,n[i].getExtent());return t},n.prototype.getGeometries=function(){return uS(this.ov)},n.prototype.getGeometriesArray=function(){return this.ov},n.prototype.getGeometriesArrayRecursive=function(){for(var t=[],n=this.ov,i=0,r=n.length;i<r;++i)n[i].getType()===this.getType()?t=t.concat(n[i].getGeometriesArrayRecursive()):t.push(n[i]);return t},n.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],r=this.ov,e=!1,o=0,s=r.length;o<s;++o){var a=r[o],u=a.getSimplifiedGeometry(t);i.push(u),u!==a&&(e=!0)}if(e){var c=new n(null);return c.setGeometriesArray(i),c}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},n.prototype.getType=function(){return Pt.GEOMETRY_COLLECTION},n.prototype.intersectsExtent=function(t){for(var n=this.ov,i=0,r=n.length;i<r;++i)if(n[i].intersectsExtent(t))return!0;return!1},n.prototype.isEmpty=function(){return 0===this.ov.length},n.prototype.rotate=function(t,n){for(var i=this.ov,r=0,e=i.length;r<e;++r)i[r].rotate(t,n);this.changed()},n.prototype.scale=function(t,n,i){var r=i;r||(r=Hn(this.getExtent()));for(var e=this.ov,o=0,s=e.length;o<s;++o)e[o].scale(t,n,r);this.changed()},n.prototype.setGeometries=function(t){this.setGeometriesArray(uS(t))},n.prototype.setGeometriesArray=function(t){this.uv(),this.ov=t,this.av(),this.changed()},n.prototype.applyTransform=function(t){for(var n=this.ov,i=0,r=n.length;i<r;++i)n[i].applyTransform(t);this.changed()},n.prototype.translate=function(t,n){for(var i=this.ov,r=0,e=i.length;r<e;++r)i[r].translate(t,n);this.changed()},n.prototype.disposeInternal=function(){this.uv(),t.prototype.disposeInternal.call(this)},n}(Yr),hS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function fS(t){if("string"==typeof t){var n=JSON.parse(t);return n||null}return null!==t?t:null}var lS=function(t){function n(){return t.call(this)||this}return hS(n,t),n.prototype.getType=function(){return ch},n.prototype.readFeature=function(t,n){return this.readFeatureFromObject(fS(t),this.getReadOptions(t,n))},n.prototype.readFeatures=function(t,n){return this.readFeaturesFromObject(fS(t),this.getReadOptions(t,n))},n.prototype.readFeatureFromObject=function(t,n){return r()},n.prototype.readFeaturesFromObject=function(t,n){return r()},n.prototype.readGeometry=function(t,n){return this.readGeometryFromObject(fS(t),this.getReadOptions(t,n))},n.prototype.readGeometryFromObject=function(t,n){return r()},n.prototype.readProjection=function(t){return this.readProjectionFromObject(fS(t))},n.prototype.readProjectionFromObject=function(t){return r()},n.prototype.writeFeature=function(t,n){return JSON.stringify(this.writeFeatureObject(t,n))},n.prototype.writeFeatureObject=function(t,n){return r()},n.prototype.writeFeatures=function(t,n){return JSON.stringify(this.writeFeaturesObject(t,n))},n.prototype.writeFeaturesObject=function(t,n){return r()},n.prototype.writeGeometry=function(t,n){return JSON.stringify(this.writeGeometryObject(t,n))},n.prototype.writeGeometryObject=function(t,n){return r()},n}(Kj),vS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function dS(t,n){if(!t)return null;var i;switch(t.type){case Pt.POINT:i=function(t){return new Te(t.coordinates)}(t);break;case Pt.LINE_STRING:i=function(t){return new kj(t.coordinates)}(t);break;case Pt.POLYGON:i=function(t){return new Ye(t.coordinates)}(t);break;case Pt.MULTI_POINT:i=function(t){return new bj(t.coordinates)}(t);break;case Pt.MULTI_LINE_STRING:i=function(t){return new _j(t.coordinates)}(t);break;case Pt.MULTI_POLYGON:i=function(t){return new Ej(t.coordinates)}(t);break;case Pt.GEOMETRY_COLLECTION:i=function(t,n){var i=t.geometries.map((function(t){return dS(t,n)}));return new cS(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Yj(i,!1,n)}function pS(t,n){var i,r=(t=Yj(t,!0,n)).getType();switch(r){case Pt.POINT:i=function(t,n){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Pt.LINE_STRING:i=function(t,n){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Pt.POLYGON:i=function(t,n){var i;n&&(i=n.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,n);break;case Pt.MULTI_POINT:i=function(t,n){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Pt.MULTI_LINE_STRING:i=function(t,n){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Pt.MULTI_POLYGON:i=function(t,n){var i;n&&(i=n.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,n);break;case Pt.GEOMETRY_COLLECTION:i=function(t,n){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=E({},n);return delete i.featureProjection,pS(t,i)}))}}(t,n);break;case Pt.CIRCLE:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return i}var yS=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).dataProjection=gr(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(i.defaultFeatureProjection=gr(r.featureProjection)),i.H=r.geometryName,i.cv=r.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return vS(n,t),n.prototype.readFeatureFromObject=function(t,n){var i=null,r=dS((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,n),e=new Tt;return this.H?e.setGeometryName(this.H):this.cv&&"geometry_name"in i!==void 0&&e.setGeometryName(i.geometry_name),e.setGeometry(r),"id"in i&&e.setId(i.id),i.properties&&e.setProperties(i.properties,!0),e},n.prototype.readFeaturesFromObject=function(t,n){var i=null;if("FeatureCollection"===t.type){i=[];for(var r=t.features,e=0,o=r.length;e<o;++e)i.push(this.readFeatureFromObject(r[e],n))}else i=[this.readFeatureFromObject(t,n)];return i},n.prototype.readGeometryFromObject=function(t,n){return dS(t,n)},n.prototype.readProjectionFromObject=function(t){var n,i=t.crs;return i?"name"==i.type?n=gr(i.properties.name):"EPSG"===i.type?n=gr("EPSG:"+i.properties.code):Mt(!1,36):n=this.dataProjection,n},n.prototype.writeFeatureObject=function(t,n){n=this.adaptOptions(n);var i={type:"Feature",geometry:null,properties:null},r=t.getId();if(void 0!==r&&(i.id=r),!t.hasProperties())return i;var e=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=pS(o,n),delete e[t.getGeometryName()]),R(e)||(i.properties=e),i},n.prototype.writeFeaturesObject=function(t,n){n=this.adaptOptions(n);for(var i=[],r=0,e=t.length;r<e;++r)i.push(this.writeFeatureObject(t[r],n));return{type:"FeatureCollection",features:i}},n.prototype.writeGeometryObject=function(t,n){return pS(t,this.adaptOptions(n))},n}(lS),mS=i(63);function wS(t){return function(t){if(Array.isArray(t))return IS(t)}(t)||bS(t)||PS(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bS(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function gS(t,n){return jS(t)||function(t,n){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var r,e,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(r=i.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,e=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw e}}return o}(t,n)||PS(t,n)||xS()}function xS(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jS(t){if(Array.isArray(t))return t}function SS(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function kS(t,n,i){return n&&SS(t.prototype,n),i&&SS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function MS(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function _S(t,n){if(n&&("object"===NS(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function OS(t){var n="function"==typeof Map?new Map:void 0;return(OS=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return TS(t,arguments,CS(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),AS(r,t)})(t)}function TS(t,n,i){return(TS=ES()?Reflect.construct:function(t,n,i){var r=[null];r.push.apply(r,n);var e=new(Function.bind.apply(t,r));return i&&AS(e,i.prototype),e}).apply(null,arguments)}function ES(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function AS(t,n){return(AS=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function CS(t){return(CS=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function RS(t,n){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=PS(t))||n&&t&&"number"==typeof t.length){i&&(t=i);var r=0,e=function(){};return{s:e,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function PS(t,n){if(t){if("string"==typeof t)return IS(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?IS(t,n):void 0}}function IS(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=t[i];return r}function NS(t){return(NS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var zS={$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"}}}},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"}},"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"],"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 with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement 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. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"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.",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"}}},"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`.",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"}}},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"}}},"+":{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"}}},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"}}}},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",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"}},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"}},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"}},"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"}},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"}},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"},"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"}},"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"}},"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"}},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."}}};var FS="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function LS(t){var n={exports:{}};return t(n,n.exports),n.exports}var GS=LS((function(t,n){!function(i){var r=n&&!n.nodeType&&n,e=t&&!t.nodeType&&t,o="object"==NS(FS)&&FS;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,u=2147483647,c=36,h=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function y(t){throw RangeError(v[t])}function m(t,n){for(var i=t.length,r=[];i--;)r[i]=n(t[i]);return r}function w(t,n){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+m((t=t.replace(l,".")).split("."),n).join(".")}function b(t){for(var n,i,r=[],e=0,o=t.length;e<o;)(n=t.charCodeAt(e++))>=55296&&n<=56319&&e<o?56320==(64512&(i=t.charCodeAt(e++)))?r.push(((1023&n)<<10)+(1023&i)+65536):(r.push(n),e--):r.push(n);return r}function g(t){return m(t,(function(t){var n="";return t>65535&&(n+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+=p(t)})).join("")}function x(t,n){return t+22+75*(t<26)-((0!=n)<<5)}function j(t,n,i){var r=0;for(t=i?d(t/700):t>>1,t+=d(t/n);t>455;r+=c)t=d(t/35);return d(r+36*t/(t+38))}function S(t){var n,i,r,e,o,s,a,h,f,l,v,p=[],m=t.length,w=0,b=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),r=0;r<i;++r)t.charCodeAt(r)>=128&&y("not-basic"),p.push(t.charCodeAt(r));for(e=i>0?i+1:0;e<m;){for(o=w,s=1,a=c;e>=m&&y("invalid-input"),((h=(v=t.charCodeAt(e++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||h>d((u-w)/s))&&y("overflow"),w+=h*s,!(h<(f=a<=x?1:a>=x+26?26:a-x));a+=c)s>d(u/(l=c-f))&&y("overflow"),s*=l;x=j(w-o,n=p.length+1,0==o),d(w/n)>u-b&&y("overflow"),b+=d(w/n),w%=n,p.splice(w++,0,b)}return g(p)}function k(t){var n,i,r,e,o,s,a,h,f,l,v,m,w,g,S,k=[];for(m=(t=b(t)).length,n=128,i=0,o=72,s=0;s<m;++s)(v=t[s])<128&&k.push(p(v));for(r=e=k.length,e&&k.push("-");r<m;){for(a=u,s=0;s<m;++s)(v=t[s])>=n&&v<a&&(a=v);for(a-n>d((u-i)/(w=r+1))&&y("overflow"),i+=(a-n)*w,n=a,s=0;s<m;++s)if((v=t[s])<n&&++i>u&&y("overflow"),v==n){for(h=i,f=c;!(h<(l=f<=o?1:f>=o+26?26:f-o));f+=c)S=h-l,g=c-l,k.push(p(x(l+S%g,0))),h=d(S/g);k.push(p(x(h,0))),o=j(i,w,r==e),i=0,++r}++i,++n}return k.join("")}if(s={version:"1.3.2",ucs2:{decode:b,encode:g},decode:S,encode:k,toASCII:function(t){return w(t,(function(t){return f.test(t)?"xn--"+k(t):t}))},toUnicode:function(t){return w(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},r&&e)if(t.exports==r)e.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else i.punycode=s}(FS)})),DS=function(t){return"string"==typeof t},US=function(t){return"object"===NS(t)&&null!==t},qS=function(t){return null===t},BS=function(t){return null==t};function WS(t,n){return Object.prototype.hasOwnProperty.call(t,n)}var VS=function(t,n,i,r){n=n||"&",i=i||"=";var e={};if("string"!=typeof t||0===t.length)return e;var o=/\+/g;t=t.split(n);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u<a;++u){var c,h,f,l,v=t[u].replace(o,"%20"),d=v.indexOf(i);d>=0?(c=v.substr(0,d),h=v.substr(d+1)):(c=v,h=""),f=decodeURIComponent(c),l=decodeURIComponent(h),WS(e,f)?Array.isArray(e[f])?e[f].push(l):e[f]=[e[f],l]:e[f]=l}return e},XS=function(t){switch(NS(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},HS=function(t,n,i,r){return n=n||"&",i=i||"=",null===t&&(t=void 0),"object"===NS(t)?Object.keys(t).map((function(r){var e=encodeURIComponent(XS(r))+i;return Array.isArray(t[r])?t[r].map((function(t){return e+encodeURIComponent(XS(t))})).join(n):e+encodeURIComponent(XS(t[r]))})).join(n):r?encodeURIComponent(XS(r))+i+encodeURIComponent(XS(t)):""},JS=LS((function(t,n){n.decode=n.parse=VS,n.encode=n.stringify=HS}));function KS(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var YS=/^([a-z0-9.+-]+:)/i,ZS=/:[0-9]*$/,$S=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,QS=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),tk=["'"].concat(QS),nk=["%","/","?",";","#"].concat(tk),ik=["/","?","#"],rk=/^[+a-z0-9A-Z_-]{0,63}$/,ek=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ok={javascript:!0,"javascript:":!0},sk={javascript:!0,"javascript:":!0},ak={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function uk(t,n,i){if(t&&US(t)&&t instanceof KS)return t;var r=new KS;return r.parse(t,n,i),r}KS.prototype.parse=function(t,n,i){if(!DS(t))throw new TypeError("Parameter 'url' must be a string, not "+NS(t));var r=t.indexOf("?"),e=-1!==r&&r<t.indexOf("#")?"?":"#",o=t.split(e);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(e);if(s=s.trim(),!i&&1===t.split("#").length){var a=$S.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=n?JS.parse(this.search.substr(1)):this.search.substr(1)):n&&(this.search="",this.query={}),this}var u=YS.exec(s);if(u){var c=(u=u[0]).toLowerCase();this.protocol=c,s=s.substr(u.length)}if(i||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var h="//"===s.substr(0,2);!h||u&&sk[u]||(s=s.substr(2),this.slashes=!0)}if(!sk[u]&&(h||u&&!ak[u])){for(var f,l,v=-1,d=0;d<ik.length;d++){-1!==(p=s.indexOf(ik[d]))&&(-1===v||p<v)&&(v=p)}-1!==(l=-1===v?s.lastIndexOf("@"):s.lastIndexOf("@",v))&&(f=s.slice(0,l),s=s.slice(l+1),this.auth=decodeURIComponent(f)),v=-1;for(d=0;d<nk.length;d++){var p;-1!==(p=s.indexOf(nk[d]))&&(-1===v||p<v)&&(v=p)}-1===v&&(v=s.length),this.host=s.slice(0,v),s=s.slice(v),this.parseHost(),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y)for(var m=this.hostname.split(/\./),w=(d=0,m.length);d<w;d++){var b=m[d];if(b&&!b.match(rk)){for(var g="",x=0,j=b.length;x<j;x++)b.charCodeAt(x)>127?g+="x":g+=b[x];if(!g.match(rk)){var S=m.slice(0,d),k=m.slice(d+1),M=b.match(ek);M&&(S.push(M[1]),k.unshift(M[2])),k.length&&(s="/"+k.join(".")+s),this.hostname=S.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=GS.toASCII(this.hostname));var _=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+_,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!ok[c])for(d=0,w=tk.length;d<w;d++){var T=tk[d];if(-1!==s.indexOf(T)){var E=encodeURIComponent(T);E===T&&(E=escape(T)),s=s.split(T).join(E)}}var A=s.indexOf("#");-1!==A&&(this.hash=s.substr(A),s=s.slice(0,A));var C=s.indexOf("?");if(-1!==C?(this.search=s.substr(C),this.query=s.substr(C+1),n&&(this.query=JS.parse(this.query)),s=s.slice(0,C)):n&&(this.search="",this.query={}),s&&(this.pathname=s),ak[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var R=this.search||"";this.path=_+R}return this.href=this.format(),this},KS.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var n=this.protocol||"",i=this.pathname||"",r=this.hash||"",e=!1,o="";this.host?e=t+this.host:this.hostname&&(e=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(e+=":"+this.port)),this.query&&US(this.query)&&Object.keys(this.query).length&&(o=JS.stringify(this.query));var s=this.search||o&&"?"+o||"";return n&&":"!==n.substr(-1)&&(n+=":"),this.slashes||(!n||ak[n])&&!1!==e?(e="//"+(e||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):e||(e=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),n+e+(i=i.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+r},KS.prototype.resolve=function(t){return this.resolveObject(uk(t,!1,!0)).format()},KS.prototype.resolveObject=function(t){if(DS(t)){var n=new KS;n.parse(t,!1,!0),t=n}for(var i=new KS,r=Object.keys(this),e=0;e<r.length;e++){var o=r[e];i[o]=this[o]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];"protocol"!==u&&(i[u]=t[u])}return ak[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!ak[t.protocol]){for(var c=Object.keys(t),h=0;h<c.length;h++){var f=c[h];i[f]=t[f]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||sk[t.protocol])i.pathname=t.pathname;else{for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==l[0]&&l.unshift(""),l.length<2&&l.unshift(""),i.pathname=l.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var v=i.pathname||"",d=i.search||"";i.path=v+d}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var p=i.pathname&&"/"===i.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),m=y||p||i.host&&t.pathname,w=m,b=i.pathname&&i.pathname.split("/")||[],g=(l=t.pathname&&t.pathname.split("/")||[],i.protocol&&!ak[i.protocol]);if(g&&(i.hostname="",i.port=null,i.host&&(""===b[0]?b[0]=i.host:b.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===l[0]?l[0]=t.host:l.unshift(t.host)),t.host=null),m=m&&(""===l[0]||""===b[0])),y)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,b=l;else if(l.length)b||(b=[]),b.pop(),b=b.concat(l),i.search=t.search,i.query=t.query;else if(!BS(t.search)){if(g)i.hostname=i.host=b.shift(),(M=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=M.shift(),i.host=i.hostname=M.shift());return i.search=t.search,i.query=t.query,qS(i.pathname)&&qS(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!b.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var x=b.slice(-1)[0],j=(i.host||t.host||b.length>1)&&("."===x||".."===x)||""===x,S=0,k=b.length;k>=0;k--)"."===(x=b[k])?b.splice(k,1):".."===x?(b.splice(k,1),S++):S&&(b.splice(k,1),S--);if(!m&&!w)for(;S--;S)b.unshift("..");!m||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),j&&"/"!==b.join("/").substr(-1)&&b.push("");var M,_=""===b[0]||b[0]&&"/"===b[0].charAt(0);g&&(i.hostname=i.host=_?"":b.length?b.shift():"",(M=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=M.shift(),i.host=i.hostname=M.shift()));return(m=m||i.host&&b.length)&&!_&&b.unshift(""),b.length?i.pathname=b.join("/"):(i.pathname=null,i.path=null),qS(i.pathname)&&qS(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},KS.prototype.parseHost=function(){var t=this.host,n=ZS.exec(t);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(this.hostname=t)};function ck(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var e=0,o=i;e<o.length;e++){var s=o[e];for(var a in s)t[a]=s[a]}return t}var hk=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&AS(t,n)}(e,t);var n,i,r=(n=e,i=ES(),function(){var t,r=CS(n);if(i){var e=CS(this).constructor;t=Reflect.construct(r,arguments,e)}else t=r.apply(this,arguments);return _S(this,t)});function e(t,n){var i;return MS(this,e),(i=r.call(this,n)).message=n,i.key=t,i}return kS(e)}(OS(Error)),fk=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];MS(this,t),this.parent=n,this.bindings={};var r,e=RS(i);try{for(e.s();!(r=e.n()).done;){var o=gS(r.value,2),s=o[0],a=o[1];this.bindings[s]=a}}catch(t){e.e(t)}finally{e.f()}}return kS(t,[{key:"concat",value:function(n){return new t(this,n)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}]),t}(),lk={kind:"null"},vk={kind:"number"},dk={kind:"string"},pk={kind:"boolean"},yk={kind:"color"},mk={kind:"object"},wk={kind:"value"},bk={kind:"collator"},gk={kind:"formatted"},xk={kind:"resolvedImage"};function jk(t,n){return{kind:"array",itemType:t,N:n}}function Sk(t){if("array"===t.kind){var n=Sk(t.itemType);return"number"==typeof t.N?"array<".concat(n,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(n,">")}return t.kind}var kk=[lk,vk,dk,pk,yk,gk,mk,jk(wk),xk];function Mk(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!Mk(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind){var i,r=RS(kk);try{for(r.s();!(i=r.n()).done;){if(!Mk(i.value,n))return null}}catch(t){r.e(t)}finally{r.f()}}}return"Expected ".concat(Sk(t)," but found ").concat(Sk(n)," instead.")}function _k(t,n){return n.some((function(n){return n.kind===t.kind}))}function Ok(t,n){return n.some((function(n){return"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"===NS(t):n===NS(t)}))}var Tk=LS((function(t,n){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 r(t){return(t=Math.round(t))<0?0:t>255?255:t}function e(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function s(t){return"%"===t[t.length-1]?e(parseFloat(t)/100):e(parseFloat(t))}function a(t,n,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(n-t)*i*6:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t}try{n.parseCSSColor=function(t){var n,e=t.replace(/ /g,"").toLowerCase();if(e in i)return i[e].slice();if("#"===e[0])return 4===e.length?(n=parseInt(e.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===e.length&&(n=parseInt(e.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var u=e.indexOf("("),c=e.indexOf(")");if(-1!==u&&c+1===e.length){var h=e.substr(0,u),f=e.substr(u+1,c-(u+1)).split(","),l=1;switch(h){case"rgba":if(4!==f.length)return null;l=s(f.pop());case"rgb":return 3!==f.length?null:[o(f[0]),o(f[1]),o(f[2]),l];case"hsla":if(4!==f.length)return null;l=s(f.pop());case"hsl":if(3!==f.length)return null;var v=(parseFloat(f[0])%360+360)%360/360,d=s(f[1]),p=s(f[2]),y=p<=.5?p*(d+1):p+d-p*d,m=2*p-y;return[r(255*a(m,y,v+1/3)),r(255*a(m,y,v)),r(255*a(m,y,v-1/3)),l];default:return null}}return null}}catch(t){}})),Ek=function(){function t(n,i,r){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;MS(this,t),this.r=n,this.g=i,this.b=r,this.a=e}return kS(t,[{key:"toString",value:function(){var t=gS(this.toArray(),4),n=t[0],i=t[1],r=t[2],e=t[3];return"rgba(".concat(Math.round(n),",").concat(Math.round(i),",").concat(Math.round(r),",").concat(e,")")}},{key:"toArray",value:function(){var t=this.r,n=this.g,i=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*t/r,255*n/r,255*i/r,r]}}],[{key:"parse",value:function(n){if(n){if(n instanceof t)return n;if("string"==typeof n){var i=Tk.parseCSSColor(n);if(i)return new t(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3])}}}}]),t}();Ek.black=new Ek(0,0,0,1),Ek.white=new Ek(1,1,1,1),Ek.transparent=new Ek(0,0,0,0),Ek.red=new Ek(1,0,0,1),Ek.blue=new Ek(0,0,1,1);var Ak=function(){function t(n,i,r){MS(this,t),this.sensitivity=n?i?"variant":"case":i?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}return kS(t,[{key:"compare",value:function(t,n){return this.collator.compare(t,n)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}]),t}(),Ck=kS((function t(n,i,r,e,o){MS(this,t),this.text=n,this.image=i,this.scale=r,this.fontStack=e,this.textColor=o})),Rk=function(){function t(n){MS(this,t),this.sections=n}return kS(t,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")}},{key:"serialize",value:function(){var t,n=["format"],i=RS(this.sections);try{for(i.s();!(t=i.n()).done;){var r=t.value;if(r.image)n.push(["image",r.image.name]);else{n.push(r.text);var e={};r.fontStack&&(e["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(e["font-scale"]=r.scale),r.textColor&&(e["text-color"]=["rgba"].concat(r.textColor.toArray())),n.push(e)}}}catch(t){i.e(t)}finally{i.f()}return n}}],[{key:"fromString",value:function(n){return new t([new Ck(n,null,null,null,null)])}},{key:"factory",value:function(n){return n instanceof t?n:t.fromString(n)}}]),t}(),Pk=function(){function t(n){MS(this,t),this.name=n.name,this.available=n.available}return kS(t,[{key:"toString",value:function(){return this.name}},{key:"serialize",value:function(){return["image",this.name]}}],[{key:"fromString",value:function(n){return n?new t({name:n,available:!1}):null}}]),t}();function Ik(t,n,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value [".concat([t,n,i,r].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function Nk(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 Ek)return!0;if(t instanceof Ak)return!0;if(t instanceof Rk)return!0;if(t instanceof Pk)return!0;if(Array.isArray(t)){var n,i=RS(t);try{for(i.s();!(n=i.n()).done;){if(!Nk(n.value))return!1}}catch(t){i.e(t)}finally{i.f()}return!0}if("object"===NS(t)){for(var r in t)if(!Nk(t[r]))return!1;return!0}return!1}function zk(t){if(null===t)return lk;if("string"==typeof t)return dk;if("boolean"==typeof t)return pk;if("number"==typeof t)return vk;if(t instanceof Ek)return yk;if(t instanceof Ak)return bk;if(t instanceof Rk)return gk;if(t instanceof Pk)return xk;if(Array.isArray(t)){var n,i,r=t.length,e=RS(t);try{for(e.s();!(i=e.n()).done;){var o=zk(i.value);if(n){if(n===o)continue;n=wk;break}n=o}}catch(t){e.e(t)}finally{e.f()}return jk(n||wk,r)}return mk}function Fk(t){var n=NS(t);return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof Ek||t instanceof Rk||t instanceof Pk?t.toString():JSON.stringify(t)}var Lk=function(){function t(n,i){MS(this,t),this.type=n,this.value=i}return kS(t,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Ek?["rgba"].concat(this.value.toArray()):this.value instanceof Rk?this.value.serialize():this.value}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("'literal' expression requires exactly one argument, but found ".concat(n.length-1," instead."));if(!Nk(n[1]))return i.error("invalid value");var r=n[1],e=zk(r),o=i.expectedType;return"array"!==e.kind||0!==e.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(e=o),new t(e,r)}}]),t}(),Gk=function(){function t(n){MS(this,t),this.name="ExpressionEvaluationError",this.message=n}return kS(t,[{key:"toJSON",value:function(){return this.message}}]),t}(),Dk={string:dk,number:vk,boolean:pk,object:mk},Uk=function(){function t(n,i){MS(this,t),this.type=n,this.args=i}return kS(t,[{key:"evaluate",value:function(t){for(var n=0;n<this.args.length;n++){var i=this.args[n].evaluate(t);if(!Mk(this.type,zk(i)))return i;if(n===this.args.length-1)throw new Gk("Expected value to be of type ".concat(Sk(this.type),", but found ").concat(Sk(zk(i))," instead."))}return null}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t=this.type,n=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){n.push(i.kind);var r=t.N;("number"==typeof r||this.args.length>1)&&n.push(r)}}return n.concat(this.args.map((function(t){return t.serialize()})))}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expected at least one argument.");var r,e=1,o=n[0];if("array"===o){var s,a;if(n.length>2){var u=n[1];if("string"!=typeof u||!(u in Dk)||"object"===u)return i.error('The item type argument of "array" must be one of string, number, boolean',1);s=Dk[u],e++}else s=wk;if(n.length>3){if(null!==n[2]&&("number"!=typeof n[2]||n[2]<0||n[2]!==Math.floor(n[2])))return i.error('The length argument to "array" must be a positive integer literal',2);a=n[2],e++}r=jk(s,a)}else r=Dk[o];for(var c=[];e<n.length;e++){var h=i.parse(n[e],e,wk);if(!h)return null;c.push(h)}return new t(r,c)}}]),t}(),qk=function(){function t(n){MS(this,t),this.type=gk,this.sections=n}return kS(t,[{key:"evaluate",value:function(t){return new Rk(this.sections.map((function(n){var i=n.content.evaluate(t);return zk(i)===xk?new Ck("",i,null,null,null):new Ck(Fk(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)})))}},{key:"eachChild",value:function(t){var n,i=RS(this.sections);try{for(i.s();!(n=i.n()).done;){var r=n.value;t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}}catch(t){i.e(t)}finally{i.f()}}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t,n=["format"],i=RS(this.sections);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.push(r.content.serialize());var e={};r.scale&&(e["font-scale"]=r.scale.serialize()),r.font&&(e["text-font"]=r.font.serialize()),r.textColor&&(e["text-color"]=r.textColor.serialize()),n.push(e)}}catch(t){i.e(t)}finally{i.f()}return n}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expected at least one argument.");var r=n[1];if(!Array.isArray(r)&&"object"===NS(r))return i.error("First argument must be an image or text section.");for(var e=[],o=!1,s=1;s<=n.length-1;++s){var a=n[s];if(o&&"object"===NS(a)&&!Array.isArray(a)){o=!1;var u=null;if(a["font-scale"]&&!(u=i.parse(a["font-scale"],1,vk)))return null;var c=null;if(a["text-font"]&&!(c=i.parse(a["text-font"],1,jk(dk))))return null;var h=null;if(a["text-color"]&&!(h=i.parse(a["text-color"],1,yk)))return null;var f=e[e.length-1];f.scale=u,f.font=c,f.textColor=h}else{var l=i.parse(n[s],1,wk);if(!l)return null;var v=l.type.kind;if("string"!==v&&"value"!==v&&"null"!==v&&"resolvedImage"!==v)return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,e.push({content:l,scale:null,font:null,textColor:null})}}return new t(e)}}]),t}(),Bk=function(){function t(n){MS(this,t),this.type=xk,this.input=n}return kS(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t),i=Pk.fromString(n);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(n)>-1),i}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["image",this.input.serialize()]}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("Expected two arguments.");var r=i.parse(n[1],1,dk);return r?new t(r):i.error("No image name provided.")}}]),t}(),Wk={"to-boolean":pk,"to-color":yk,"to-number":vk,"to-string":dk},Vk=function(){function t(n,i){MS(this,t),this.type=n,this.args=i}return kS(t,[{key:"evaluate",value:function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){var n,i,r,e=RS(this.args);try{for(e.s();!(r=e.n()).done;){if(n=r.value.evaluate(t),i=null,n instanceof Ek)return n;if("string"==typeof n){var o=t.parseColor(n);if(o)return o}else if(Array.isArray(n)&&!(i=n.length<3||n.length>4?"Invalid rbga value ".concat(JSON.stringify(n),": expected an array containing either three or four numeric values."):Ik(n[0],n[1],n[2],n[3])))return new Ek(n[0]/255,n[1]/255,n[2]/255,n[3])}}catch(t){e.e(t)}finally{e.f()}throw new Gk(i||"Could not parse color from value '".concat("string"==typeof n?n:String(JSON.stringify(n)),"'"))}if("number"===this.type.kind){var s,a=null,u=RS(this.args);try{for(u.s();!(s=u.n()).done;){if(null===(a=s.value.evaluate(t)))return 0;var c=Number(a);if(!isNaN(c))return c}}catch(t){u.e(t)}finally{u.f()}throw new Gk("Could not convert ".concat(JSON.stringify(a)," to number."))}return"formatted"===this.type.kind?Rk.fromString(Fk(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Pk.fromString(Fk(this.args[0].evaluate(t))):Fk(this.args[0].evaluate(t))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new qk([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Bk(this.args[0]).serialize();var t=["to-".concat(this.type.kind)];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expected at least one argument.");var r=n[0];if(("to-boolean"===r||"to-string"===r)&&2!==n.length)return i.error("Expected one argument.");for(var e=Wk[r],o=[],s=1;s<n.length;s++){var a=i.parse(n[s],s,wk);if(!a)return null;o.push(a)}return new t(e,o)}}]),t}(),Xk=["Unknown","Point","LineString","Polygon"],Hk=function(){function t(){MS(this,t),this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}return kS(t,[{key:"id",value:function(){return this.feature&&"id"in this.feature?this.feature.id:null}},{key:"geometryType",value:function(){return this.feature?"number"==typeof this.feature.type?Xk[this.feature.type]:this.feature.type:null}},{key:"geometry",value:function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}},{key:"canonicalID",value:function(){return this.canonical}},{key:"properties",value:function(){return this.feature&&this.feature.properties||{}}},{key:"parseColor",value:function(t){var n=this._parseColorCache[t];return n||(n=this._parseColorCache[t]=Ek.parse(t)),n}}]),t}(),Jk=function(){function t(n,i,r,e){MS(this,t),this.name=n,this.type=i,this._evaluate=r,this.args=e}return kS(t,[{key:"evaluate",value:function(t){return this._evaluate(t,this.args)}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))}}],[{key:"parse",value:function(n,i){var r=n[0],e=t.definitions[r];if(!e)return i.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0);var o,s=Array.isArray(e)?e[0]:e.type,a=Array.isArray(e)?[[e[1],e[2]]]:e.overloads,u=a.filter((function(t){var i=gS(t,1)[0];return!Array.isArray(i)||i.length===n.length-1})),c=null,h=RS(u);try{for(h.s();!(o=h.n()).done;){var f=gS(o.value,2),l=f[0],v=f[1];c=new wM(i.registry,i.path,null,i.scope);for(var d=[],p=!1,y=1;y<n.length;y++){var m=n[y],w=Array.isArray(l)?l[y-1]:l.type,b=c.parse(m,1+d.length,w);if(!b){p=!0;break}d.push(b)}if(!p)if(Array.isArray(l)&&l.length!==d.length)c.error("Expected ".concat(l.length," arguments, but found ").concat(d.length," instead."));else{for(var g=0;g<d.length;g++){var x=Array.isArray(l)?l[g]:l.type,j=d[g];c.concat(g+1).checkSubtype(x,j.type)}if(0===c.errors.length)return new t(r,s,v,d)}}}catch(t){h.e(t)}finally{h.f()}if(1===u.length){var S;(S=i.errors).push.apply(S,wS(c.errors))}else{for(var k=(u.length?u:a).map((function(t){var n,i=gS(t,1)[0];return n=i,Array.isArray(n)?"(".concat(n.map(Sk).join(", "),")"):"(".concat(Sk(n.type),"...)")})).join(" | "),M=[],_=1;_<n.length;_++){var O=i.parse(n[_],1+M.length);if(!O)return null;M.push(Sk(O.type))}i.error("Expected arguments of type ".concat(k,", but found (").concat(M.join(", "),") instead."))}return null}},{key:"register",value:function(n,i){for(var r in t.definitions=i,i)n[r]=t}}]),t}();var Kk=function(){function t(n,i,r){MS(this,t),this.type=bk,this.locale=r,this.caseSensitive=n,this.diacriticSensitive=i}return kS(t,[{key:"evaluate",value:function(t){return new Ak(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}},{key:"eachChild",value:function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("Expected one argument.");var r=n[1];if("object"!==NS(r)||Array.isArray(r))return i.error("Collator options argument must be an object.");var e=i.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,pk);if(!e)return null;var o=i.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,pk);if(!o)return null;var s=null;return r.locale&&!(s=i.parse(r.locale,1,dk))?null:new t(e,o,s)}}]),t}(),Yk=8192;function Zk(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function $k(t,n){return!(t[0]<=n[0])&&(!(t[2]>=n[2])&&(!(t[1]<=n[1])&&!(t[3]>=n[3])))}function Qk(t,n){var i,r=(180+t[0])/360,e=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),o=Math.pow(2,n.z);return[Math.round(r*o*Yk),Math.round(e*o*Yk)]}function tM(t,n,i){var r=t[0]-n[0],e=t[1]-n[1],o=t[0]-i[0],s=t[1]-i[1];return r*s-o*e==0&&r*o<=0&&e*s<=0}function nM(t,n,i){return n[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-n[0])*(t[1]-n[1])/(i[1]-n[1])+n[0]}function iM(t,n){for(var i=!1,r=0,e=n.length;r<e;r++)for(var o=n[r],s=0,a=o.length;s<a-1;s++){if(tM(t,o[s],o[s+1]))return!1;nM(t,o[s],o[s+1])&&(i=!i)}return i}function rM(t,n){for(var i=0;i<n.length;i++)if(iM(t,n[i]))return!0;return!1}function eM(t,n,i,r){var e=t[0]-i[0],o=t[1]-i[1],s=n[0]-i[0],a=n[1]-i[1],u=r[0]-i[0],c=r[1]-i[1],h=e*c-u*o,f=s*c-u*a;return h>0&&f<0||h<0&&f>0}function oM(t,n,i){var r,e,o,s,a,u,c,h,f,l=RS(i);try{for(l.s();!(r=l.n()).done;)for(var v=r.value,d=0;d<v.length-1;++d)if(e=t,o=n,s=v[d],a=v[d+1],u=void 0,c=void 0,h=void 0,f=void 0,h=[o[0]-e[0],o[1]-e[1]],f=[a[0]-s[0],a[1]-s[1]],0!=(u=f)[0]*(c=h)[1]-u[1]*c[0]&&eM(e,o,s,a)&&eM(s,a,e,o))return!0}catch(t){l.e(t)}finally{l.f()}return!1}function sM(t,n){for(var i=0;i<t.length;++i)if(!iM(t[i],n))return!1;for(var r=0;r<t.length-1;++r)if(oM(t[r],t[r+1],n))return!1;return!0}function aM(t,n){for(var i=0;i<n.length;i++)if(sM(t,n[i]))return!0;return!1}function uM(t,n,i){for(var r=[],e=0;e<t.length;e++){for(var o=[],s=0;s<t[e].length;s++){var a=Qk(t[e][s],i);Zk(n,a),o.push(a)}r.push(o)}return r}function cM(t,n,i){for(var r=[],e=0;e<t.length;e++){var o=uM(t[e],n,i);r.push(o)}return r}function hM(t,n,i,r){if(t[0]<i[0]||t[0]>i[2]){var e=.5*r,o=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===o&&(o=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=o}Zk(n,t)}function fM(t,n,i,r){var e,o=Math.pow(2,r.z)*Yk,s=[r.x*Yk,r.y*Yk],a=[],u=RS(t);try{for(u.s();!(e=u.n()).done;){var c,h=RS(e.value);try{for(h.s();!(c=h.n()).done;){var f=c.value,l=[f.x+s[0],f.y+s[1]];hM(l,n,i,o),a.push(l)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){u.e(t)}finally{u.f()}return a}function lM(t,n,i,r){var e,o=Math.pow(2,r.z)*Yk,s=[r.x*Yk,r.y*Yk],a=[],u=RS(t);try{for(u.s();!(e=u.n()).done;){var c,h=e.value,f=[],l=RS(h);try{for(l.s();!(c=l.n()).done;){var v=c.value,d=[v.x+s[0],v.y+s[1]];Zk(n,d),f.push(d)}}catch(t){l.e(t)}finally{l.f()}a.push(f)}}catch(t){u.e(t)}finally{u.f()}if(n[2]-n[0]<=o/2){!function(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}(n);var p,y=RS(a);try{for(y.s();!(p=y.n()).done;){var m,w=RS(p.value);try{for(w.s();!(m=w.n()).done;){hM(m.value,n,i,o)}}catch(t){w.e(t)}finally{w.f()}}}catch(t){y.e(t)}finally{y.f()}}return a}var vM=function(){function t(n,i){MS(this,t),this.type=pk,this.geojson=n,this.geometries=i}return kS(t,[{key:"evaluate",value:function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],e=t.canonicalID();if("Polygon"===n.type){var o=uM(n.coordinates,r,e),s=fM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var a,u=RS(s);try{for(u.s();!(a=u.n()).done;)if(!iM(a.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===n.type){var c=cM(n.coordinates,r,e),h=fM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var f,l=RS(h);try{for(l.s();!(f=l.n()).done;)if(!rM(f.value,c))return!1}catch(t){l.e(t)}finally{l.f()}}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],e=t.canonicalID();if("Polygon"===n.type){var o=uM(n.coordinates,r,e),s=lM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var a,u=RS(s);try{for(u.s();!(a=u.n()).done;)if(!sM(a.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===n.type){var c=cM(n.coordinates,r,e),h=lM(t.geometry(),i,r,e);if(!$k(i,r))return!1;var f,l=RS(h);try{for(l.s();!(f=l.n()).done;)if(!aM(f.value,c))return!1}catch(t){l.e(t)}finally{l.f()}}return!0}(t,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("'within' expression requires exactly one argument, but found ".concat(n.length-1," instead."));if(Nk(n[1])){var r=n[1];if("FeatureCollection"===r.type)for(var e=0;e<r.features.length;++e){var o=r.features[e].geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new t(r,r.features[e].geometry)}else if("Feature"===r.type){var s=r.geometry.type;if("Polygon"===s||"MultiPolygon"===s)return new t(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new t(r,r)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}}]),t}();function dM(t){if(t instanceof Jk){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 vM)return!1;var n=!0;return t.eachChild((function(t){n&&!dM(t)&&(n=!1)})),n}function pM(t){if(t instanceof Jk&&"feature-state"===t.name)return!1;var n=!0;return t.eachChild((function(t){n&&!pM(t)&&(n=!1)})),n}function yM(t,n){if(t instanceof Jk&&n.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!yM(t,n)&&(i=!1)})),i}var mM=function(){function t(n,i){MS(this,t),this.type=i.type,this.name=n,this.boundExpression=i}return kS(t,[{key:"evaluate",value:function(t){return this.boundExpression.evaluate(t)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(n,i){if(2!==n.length||"string"!=typeof n[1])return i.error("'var' expression requires exactly one string literal argument.");var r=n[1];return i.scope.has(r)?new t(r,i.scope.get(r)):i.error('Unknown variable "'.concat(r,'". Make sure "').concat(r,'" has been bound in an enclosing "let" expression before using it.'),1)}}]),t}(),wM=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fk,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];MS(this,t),this.registry=n,this.path=i,this.key=i.map((function(t){return"[".concat(t,"]")})).join(""),this.scope=e,this.errors=o,this.expectedType=r}return kS(t,[{key:"parse",value:function(t,n,i,r){var e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return n?this.concat(n,i,r)._parse(t,e):this._parse(t,e)}},{key:"_parse",value:function(t,n){function i(t,n,i){return"assert"===i?new Uk(n,[t]):"coerce"===i?new Vk(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found ".concat(NS(r),' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;var e=this.registry[r];if(e){var o=e.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=i(o,s,n.typeAnnotation||"coerce");else o=i(o,s,n.typeAnnotation||"assert")}if(!(o instanceof Lk)&&"resolvedImage"!==o.type.kind&&bM(o)){var u=new Hk;try{o=new Lk(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"===NS(t)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(NS(t)," instead."))}},{key:"concat",value:function(n,i,r){var e="number"==typeof n?this.path.concat(n):this.path,o=r?this.scope.concat(r):this.scope;return new t(this.registry,e,i||null,o,this.errors)}},{key:"error",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var e="".concat(this.key).concat(i.map((function(t){return"[".concat(t,"]")})).join(""));this.errors.push(new hk(e,t))}},{key:"checkSubtype",value:function(t,n){var i=Mk(t,n);return i&&this.error(i),i}}]),t}();function bM(t){if(t instanceof mM)return bM(t.boundExpression);if(t instanceof Jk&&"error"===t.name)return!1;if(t instanceof Kk)return!1;if(t instanceof vM)return!1;var n=t instanceof Vk||t instanceof Uk,i=!0;return t.eachChild((function(t){i=n?i&&bM(t):i&&t instanceof Lk})),!!i&&(dM(t)&&yM(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function gM(t,n){for(var i,r,e=t.length-1,o=0,s=e,a=0;o<=s;)if(i=t[a=Math.floor((o+s)/2)],r=t[a+1],i<=n){if(a===e||n<r)return a;o=a+1}else{if(!(i>n))throw new Gk("Input is not a number.");s=a-1}return 0}var xM=function(){function t(n,i,r){MS(this,t),this.type=n,this.input=i,this.labels=[],this.outputs=[];var e,o=RS(r);try{for(o.s();!(e=o.n()).done;){var s=gS(e.value,2),a=s[0],u=s[1];this.labels.push(a),this.outputs.push(u)}}catch(t){o.e(t)}finally{o.f()}}return kS(t,[{key:"evaluate",value:function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;return r>=n[e-1]?i[e-1].evaluate(t):i[gM(n,r)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var n,i=RS(this.outputs);try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(t){i.e(t)}finally{i.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){for(var t=["step",this.input.serialize()],n=0;n<this.labels.length;n++)n>0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t}}],[{key:"parse",value:function(n,i){if(n.length-1<4)return i.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if((n.length-1)%2!=0)return i.error("Expected an even number of arguments.");var r=i.parse(n[1],1,vk);if(!r)return null;var e=[],o=null;i.expectedType&&"value"!==i.expectedType.kind&&(o=i.expectedType);for(var s=1;s<n.length;s+=2){var a=1===s?-1/0:n[s],u=n[s+1],c=s,h=s+1;if("number"!=typeof a)return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(e.length&&e[e.length-1][0]>=a)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);var f=i.parse(u,h,o);if(!f)return null;o=o||f.type,e.push([a,f])}return new t(o,r,e)}}]),t}(),jM=SM;function SM(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}function kM(t,n,i){return t*(1-i)+n*i}SM.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},SM.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},SM.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},SM.prototype.solveCurveX=function(t,n){var i,r,e,o,s;for(void 0===n&&(n=1e-6),e=t,s=0;s<8;s++){if(o=this.sampleCurveX(e)-t,Math.abs(o)<n)return e;var a=this.sampleCurveDerivativeX(e);if(Math.abs(a)<1e-6)break;e-=o/a}if((e=t)<(i=0))return i;if(e>(r=1))return r;for(;i<r;){if(o=this.sampleCurveX(e),Math.abs(o-t)<n)return e;t>o?i=e:r=e,e=.5*(r-i)+i}return e},SM.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var MM=Object.freeze({__proto__:null,number:kM,color:function(t,n,i){return new Ek(kM(t.r,n.r,i),kM(t.g,n.g,i),kM(t.b,n.b,i),kM(t.a,n.a,i))},array:function(t,n,i){return t.map((function(t,r){return kM(t,n[r],i)}))}}),_M=.95047,OM=1.08883,TM=4/29,EM=6/29,AM=3*EM*EM,CM=Math.PI/180,RM=180/Math.PI;function PM(t){return t>.008856451679035631?Math.pow(t,1/3):t/AM+TM}function IM(t){return t>EM?t*t*t:AM*(t-TM)}function NM(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function zM(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function FM(t){var n=zM(t.r),i=zM(t.g),r=zM(t.b),e=PM((.4124564*n+.3575761*i+.1804375*r)/_M),o=PM((.2126729*n+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(e-o),b:200*(o-PM((.0193339*n+.119192*i+.9503041*r)/OM)),alpha:t.a}}function LM(t){var n=(t.l+16)/116,i=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*IM(n),i=_M*IM(i),r=OM*IM(r),new Ek(NM(3.2404542*i-1.5371385*n-.4985314*r),NM(-.969266*i+1.8760108*n+.041556*r),NM(.0556434*i-.2040259*n+1.0572252*r),t.alpha)}function GM(t,n,i){var r=n-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var DM={forward:FM,reverse:LM,interpolate:function(t,n,i){return{l:kM(t.l,n.l,i),a:kM(t.a,n.a,i),b:kM(t.b,n.b,i),alpha:kM(t.alpha,n.alpha,i)}}},UM={forward:function(t){var n=FM(t),i=n.l,r=n.a,e=n.b,o=Math.atan2(e,r)*RM;return{h:o<0?o+360:o,c:Math.sqrt(r*r+e*e),l:i,alpha:t.a}},reverse:function(t){var n=t.h*CM,i=t.c;return LM({l:t.l,a:Math.cos(n)*i,b:Math.sin(n)*i,alpha:t.alpha})},interpolate:function(t,n,i){return{h:GM(t.h,n.h,i),c:kM(t.c,n.c,i),l:kM(t.l,n.l,i),alpha:kM(t.alpha,n.alpha,i)}}},qM=function(){function t(n,i,r,e,o){MS(this,t),this.type=n,this.operator=i,this.interpolation=r,this.input=e,this.labels=[],this.outputs=[];var s,a=RS(o);try{for(a.s();!(s=a.n()).done;){var u=gS(s.value,2),c=u[0],h=u[1];this.labels.push(c),this.outputs.push(h)}}catch(t){a.e(t)}finally{a.f()}}return kS(t,[{key:"evaluate",value:function(n){var i=this.labels,r=this.outputs;if(1===i.length)return r[0].evaluate(n);var e=this.input.evaluate(n);if(e<=i[0])return r[0].evaluate(n);var o=i.length;if(e>=i[o-1])return r[o-1].evaluate(n);var s=gM(i,e),a=i[s],u=i[s+1],c=t.interpolationFactor(this.interpolation,e,a,u),h=r[s].evaluate(n),f=r[s+1].evaluate(n);return"interpolate"===this.operator?MM[this.type.kind.toLowerCase()](h,f,c):"interpolate-hcl"===this.operator?UM.reverse(UM.interpolate(UM.forward(h),UM.forward(f),c)):DM.reverse(DM.interpolate(DM.forward(h),DM.forward(f),c))}},{key:"eachChild",value:function(t){t(this.input);var n,i=RS(this.outputs);try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(t){i.e(t)}finally{i.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var n=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)n.push(this.labels[i],this.outputs[i].serialize());return n}}],[{key:"interpolationFactor",value:function(t,n,i,r){var e=0;if("exponential"===t.name)e=BM(n,t.base,i,r);else if("linear"===t.name)e=BM(n,1,i,r);else if("cubic-bezier"===t.name){var o=t.controlPoints;e=new jM(o[0],o[1],o[2],o[3]).solve(BM(n,1,i,r))}return e}},{key:"parse",value:function(n,i){var r,e=jS(r=n)||bS(r)||PS(r)||xS(),o=e[0],s=e[1],a=e[2],u=e.slice(3);if(!Array.isArray(s)||0===s.length)return i.error("Expected an interpolation type expression.",1);if("linear"===s[0])s={name:"linear"};else if("exponential"===s[0]){var c=s[1];if("number"!=typeof c)return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:c}}else{if("cubic-bezier"!==s[0])return i.error("Unknown interpolation type ".concat(String(s[0])),1,0);var h=s.slice(1);if(4!==h.length||h.some((function(t){return"number"!=typeof t||t<0||t>1})))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:h}}if(n.length-1<4)return i.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if((n.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(!(a=i.parse(a,2,vk)))return null;var f=[],l=null;"interpolate-hcl"===o||"interpolate-lab"===o?l=yk:i.expectedType&&"value"!==i.expectedType.kind&&(l=i.expectedType);for(var v=0;v<u.length;v+=2){var d=u[v],p=u[v+1],y=v+3,m=v+4;if("number"!=typeof d)return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',y);if(f.length&&f[f.length-1][0]>=d)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',y);var w=i.parse(p,m,l);if(!w)return null;l=l||w.type,f.push([d,w])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new t(l,o,s,a,f):i.error("Type ".concat(Sk(l)," is not interpolatable."))}}]),t}();function BM(t,n,i,r){var e=r-i,o=t-i;return 0===e?0:1===n?o/e:(Math.pow(n,o)-1)/(Math.pow(n,e)-1)}var WM=function(){function t(n,i){MS(this,t),this.type=n,this.args=i}return kS(t,[{key:"evaluate",value:function(t){var n,i,r=null,e=0,o=RS(this.args);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(e++,(r=s.evaluate(t))&&r instanceof Pk&&!r.available&&(n||(n=r.name),r=null,e===this.args.length&&(r=n)),null!==r)break}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t=["coalesce"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(n.length<2)return i.error("Expectected at least one argument.");var r=null,e=i.expectedType;e&&"value"!==e.kind&&(r=e);var o,s=[],a=RS(n.slice(1));try{for(a.s();!(o=a.n()).done;){var u=o.value,c=i.parse(u,1+s.length,r,void 0,{typeAnnotation:"omit"});if(!c)return null;r=r||c.type,s.push(c)}}catch(t){a.e(t)}finally{a.f()}return new t(e&&s.some((function(t){return Mk(e,t.type)}))?wk:r,s)}}]),t}(),VM=function(){function t(n,i){MS(this,t),this.type=i.type,this.bindings=[].concat(n),this.result=i}return kS(t,[{key:"evaluate",value:function(t){return this.result.evaluate(t)}},{key:"eachChild",value:function(t){var n,i=RS(this.bindings);try{for(i.s();!(n=i.n()).done;){t(n.value[1])}}catch(t){i.e(t)}finally{i.f()}t(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var t,n=["let"],i=RS(this.bindings);try{for(i.s();!(t=i.n()).done;){var r=gS(t.value,2),e=r[0],o=r[1];n.push(e,o.serialize())}}catch(t){i.e(t)}finally{i.f()}return n.push(this.result.serialize()),n}}],[{key:"parse",value:function(n,i){if(n.length<4)return i.error("Expected at least 3 arguments, but found ".concat(n.length-1," instead."));for(var r=[],e=1;e<n.length-1;e+=2){var o=n[e];if("string"!=typeof o)return i.error("Expected string, but found ".concat(NS(o)," instead."),e);if(/[^a-zA-Z0-9_]/.test(o))return i.error("Variable names must contain only alphanumeric characters or '_'.",e);var s=i.parse(n[e+1],e+1);if(!s)return null;r.push([o,s])}var a=i.parse(n[n.length-1],n.length-1,i.expectedType,r);return a?new t(r,a):null}}]),t}(),XM=function(){function t(n,i,r){MS(this,t),this.type=n,this.index=i,this.input=r}return kS(t,[{key:"evaluate",value:function(t){var n=this.index.evaluate(t),i=this.input.evaluate(t);if(n<0)throw new Gk("Array index out of bounds: ".concat(n," < 0."));if(n>=i.length)throw new Gk("Array index out of bounds: ".concat(n," > ").concat(i.length-1,"."));if(n!==Math.floor(n))throw new Gk("Array index must be an integer, but found ".concat(n," instead."));return i[n]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(n,i){if(3!==n.length)return i.error("Expected 2 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,vk),e=i.parse(n[2],2,jk(i.expectedType||wk));return r&&e?new t(e.type.itemType,r,e):null}}]),t}(),HM=function(){function t(n,i){MS(this,t),this.type=pk,this.needle=n,this.haystack=i}return kS(t,[{key:"evaluate",value:function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Ok(n,["boolean","string","number","null"]))throw new Gk("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(zk(n))," instead."));if(!Ok(i,["string","array"]))throw new Gk("Expected second argument to be of type array or string, but found ".concat(Sk(zk(i))," instead."));return i.indexOf(n)>=0}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(n,i){if(3!==n.length)return i.error("Expected 2 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,wk),e=i.parse(n[2],2,wk);return r&&e?_k(r.type,[pk,dk,vk,lk,wk])?new t(r,e):i.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(r.type)," instead")):null}}]),t}(),JM=function(){function t(n,i,r){MS(this,t),this.type=vk,this.needle=n,this.haystack=i,this.fromIndex=r}return kS(t,[{key:"evaluate",value:function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Ok(n,["boolean","string","number","null"]))throw new Gk("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(zk(n))," instead."));if(!Ok(i,["string","array"]))throw new Gk("Expected second argument to be of type array or string, but found ".concat(Sk(zk(i))," instead."));if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(n,r)}return i.indexOf(n)}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(n,i){if(n.length<=2||n.length>=5)return i.error("Expected 3 or 4 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,wk),e=i.parse(n[2],2,wk);if(!r||!e)return null;if(!_k(r.type,[pk,dk,vk,lk,wk]))return i.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Sk(r.type)," instead"));if(4===n.length){var o=i.parse(n[3],3,vk);return o?new t(r,e,o):null}return new t(r,e)}}]),t}(),KM=function(){function t(n,i,r,e,o,s){MS(this,t),this.inputType=n,this.type=i,this.input=r,this.cases=e,this.outputs=o,this.otherwise=s}return kS(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t);return(zk(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t,n=this,i=["match",this.input.serialize()],r=[],e={},o=RS(Object.keys(this.cases).sort());try{for(o.s();!(t=o.n()).done;){var s=t.value,a=e[this.cases[s]];void 0===a?(e[this.cases[s]]=r.length,r.push([this.cases[s],[s]])):r[a][1].push(s)}}catch(t){o.e(t)}finally{o.f()}for(var u=function(t){return"number"===n.inputType.kind?Number(t):t},c=0,h=r;c<h.length;c++){var f=gS(h[c],2),l=f[0],v=f[1];1===v.length?i.push(u(v[0])):i.push(v.map(u)),i.push(this.outputs[l].serialize())}return i.push(this.otherwise.serialize()),i}}],[{key:"parse",value:function(n,i){if(n.length<5)return i.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if(n.length%2!=1)return i.error("Expected an even number of arguments.");var r,e;i.expectedType&&"value"!==i.expectedType.kind&&(e=i.expectedType);for(var o={},s=[],a=2;a<n.length-1;a+=2){var u=n[a],c=n[a+1];Array.isArray(u)||(u=[u]);var h=i.concat(a);if(0===u.length)return h.error("Expected at least one branch label.");var f,l=RS(u);try{for(l.s();!(f=l.n()).done;){var v=f.value;if("number"!=typeof v&&"string"!=typeof v)return h.error("Branch labels must be numbers or strings.");if("number"==typeof v&&Math.abs(v)>Number.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof v&&Math.floor(v)!==v)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,zk(v)))return null}else r=zk(v);if(void 0!==o[String(v)])return h.error("Branch labels must be unique.");o[String(v)]=s.length}}catch(t){l.e(t)}finally{l.f()}var d=i.parse(c,a,e);if(!d)return null;e=e||d.type,s.push(d)}var p=i.parse(n[1],1,wk);if(!p)return null;var y=i.parse(n[n.length-1],n.length-1,e);return y?"value"!==p.type.kind&&i.concat(1).checkSubtype(r,p.type)?null:new t(r,e,p,o,s,y):null}}]),t}(),YM=function(){function t(n,i,r){MS(this,t),this.type=n,this.branches=i,this.otherwise=r}return kS(t,[{key:"evaluate",value:function(t){var n,i=RS(this.branches);try{for(i.s();!(n=i.n()).done;){var r=gS(n.value,2),e=r[0],o=r[1];if(e.evaluate(t))return o.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var n,i=RS(this.branches);try{for(i.s();!(n=i.n()).done;){var r=gS(n.value,2),e=r[0],o=r[1];t(e),t(o)}}catch(t){i.e(t)}finally{i.f()}t(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every((function(t){var n=gS(t,2);n[0];return n[1].outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t=["case"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(n.length<4)return i.error("Expected at least 3 arguments, but found only ".concat(n.length-1,"."));if(n.length%2!=0)return i.error("Expected an odd number of arguments.");var r;i.expectedType&&"value"!==i.expectedType.kind&&(r=i.expectedType);for(var e=[],o=1;o<n.length-1;o+=2){var s=i.parse(n[o],o,pk);if(!s)return null;var a=i.parse(n[o+1],o+1,r);if(!a)return null;e.push([s,a]),r=r||a.type}var u=i.parse(n[n.length-1],n.length-1,r);return u?new t(r,e,u):null}}]),t}(),ZM=function(){function t(n,i,r,e){MS(this,t),this.type=n,this.input=i,this.beginIndex=r,this.endIndex=e}return kS(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Ok(n,["string","array"]))throw new Gk("Expected first argument to be of type array or string, but found ".concat(Sk(zk(n))," instead."));if(this.endIndex){var r=this.endIndex.evaluate(t);return n.slice(i,r)}return n.slice(i)}},{key:"eachChild",value:function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}],[{key:"parse",value:function(n,i){if(n.length<=2||n.length>=5)return i.error("Expected 3 or 4 arguments, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1,wk),e=i.parse(n[2],2,vk);if(!r||!e)return null;if(!_k(r.type,[jk(wk),dk,wk]))return i.error("Expected first argument to be of type array or string, but found ".concat(Sk(r.type)," instead"));if(4===n.length){var o=i.parse(n[3],3,vk);return o?new t(r.type,r,e,o):null}return new t(r.type,r,e)}}]),t}();function $M(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function QM(t,n,i,r){return 0===r.compare(n,i)}function t_(t,n,i){var r="=="!==t&&"!="!==t;return function(){function e(t,n,i){MS(this,e),this.type=pk,this.lhs=t,this.rhs=n,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}return kS(e,[{key:"evaluate",value:function(e){var o=this.lhs.evaluate(e),s=this.rhs.evaluate(e);if(r&&this.hasUntypedArgument){var a=zk(o),u=zk(s);if(a.kind!==u.kind||"string"!==a.kind&&"number"!==a.kind)throw new Gk('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(a.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!r&&this.hasUntypedArgument){var c=zk(o),h=zk(s);if("string"!==c.kind||"string"!==h.kind)return n(e,o,s)}return this.collator?i(e,o,s,this.collator.evaluate(e)):n(e,o,s)}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var n=[t];return this.eachChild((function(t){n.push(t.serialize())})),n}}],[{key:"parse",value:function(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");var i=t[0],o=n.parse(t[1],1,wk);if(!o)return null;if(!$M(i,o.type))return n.concat(1).error('"'.concat(i,"\" comparisons are not supported for type '").concat(Sk(o.type),"'."));var s=n.parse(t[2],2,wk);if(!s)return null;if(!$M(i,s.type))return n.concat(2).error('"'.concat(i,"\" comparisons are not supported for type '").concat(Sk(s.type),"'."));if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot compare types '".concat(Sk(o.type),"' and '").concat(Sk(s.type),"'."));r&&("value"===o.type.kind&&"value"!==s.type.kind?o=new Uk(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new Uk(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot use collator to compare non-string types.");if(!(a=n.parse(t[3],3,bk)))return null}return new e(o,s,a)}}]),e}()}var n_=t_("==",(function(t,n,i){return n===i}),QM),i_=t_("!=",(function(t,n,i){return n!==i}),(function(t,n,i,r){return!QM(0,n,i,r)})),r_=t_("<",(function(t,n,i){return n<i}),(function(t,n,i,r){return r.compare(n,i)<0})),e_=t_(">",(function(t,n,i){return n>i}),(function(t,n,i,r){return r.compare(n,i)>0})),o_=t_("<=",(function(t,n,i){return n<=i}),(function(t,n,i,r){return r.compare(n,i)<=0})),s_=t_(">=",(function(t,n,i){return n>=i}),(function(t,n,i,r){return r.compare(n,i)>=0})),a_=function(){function t(n,i,r,e,o){MS(this,t),this.type=dk,this.number=n,this.locale=i,this.currency=r,this.minFractionDigits=e,this.maxFractionDigits=o}return kS(t,[{key:"evaluate",value:function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}},{key:"eachChild",value:function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}],[{key:"parse",value:function(n,i){if(3!==n.length)return i.error("Expected two arguments.");var r=i.parse(n[1],1,vk);if(!r)return null;var e=n[2];if("object"!==NS(e)||Array.isArray(e))return i.error("NumberFormat options argument must be an object.");var o=null;if(e.locale&&!(o=i.parse(e.locale,1,dk)))return null;var s=null;if(e.currency&&!(s=i.parse(e.currency,1,dk)))return null;var a=null;if(e["min-fraction-digits"]&&!(a=i.parse(e["min-fraction-digits"],1,vk)))return null;var u=null;return e["max-fraction-digits"]&&!(u=i.parse(e["max-fraction-digits"],1,vk))?null:new t(r,o,s,a,u)}}]),t}(),u_={"==":n_,"!=":i_,">":e_,"<":r_,">=":s_,"<=":o_,array:Uk,at:XM,boolean:Uk,case:YM,coalesce:WM,collator:Kk,format:qk,image:Bk,in:HM,"index-of":JM,interpolate:qM,"interpolate-hcl":qM,"interpolate-lab":qM,length:function(){function t(n){MS(this,t),this.type=vk,this.input=n}return kS(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Gk("Expected value to be of type string or array, but found ".concat(Sk(zk(n))," instead."))}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["length"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,i){if(2!==n.length)return i.error("Expected 1 argument, but found ".concat(n.length-1," instead."));var r=i.parse(n[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?i.error("Expected argument of type string or array, but found ".concat(Sk(r.type)," instead.")):new t(r):null}}]),t}(),let:VM,literal:Lk,match:KM,number:Uk,"number-format":a_,object:Uk,slice:ZM,step:xM,string:Uk,"to-boolean":Vk,"to-color":Vk,"to-number":Vk,"to-string":Vk,var:mM,within:vM};function c_(t,n){var i=gS(n,4),r=i[0],e=i[1],o=i[2],s=i[3];r=r.evaluate(t),e=e.evaluate(t),o=o.evaluate(t);var a=s?s.evaluate(t):1,u=Ik(r,e,o,a);if(u)throw new Gk(u);return new Ek(r/255*a,e/255*a,o/255*a,a)}function h_(t,n){return t in n}function f_(t,n){var i=n[t];return void 0===i?null:i}function l_(t){return{type:t}}function v_(t){return{result:"success",value:t}}function d_(t){return{result:"error",value:t}}function p_(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function y_(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function m_(t){return!!t.expression&&t.expression.interpolated}function w_(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":NS(t)}function b_(t){return"object"===NS(t)&&null!==t&&!Array.isArray(t)}Jk.register(u_,{error:[{kind:"error"},[dk],function(t,n){var i=gS(n,1)[0];throw new Gk(i.evaluate(t))}],typeof:[dk,[wk],function(t,n){return Sk(zk(gS(n,1)[0].evaluate(t)))}],"to-rgba":[jk(vk,4),[yk],function(t,n){return gS(n,1)[0].evaluate(t).toArray()}],rgb:[yk,[vk,vk,vk],c_],rgba:[yk,[vk,vk,vk,vk],c_],has:{type:pk,overloads:[[[dk],function(t,n){return h_(gS(n,1)[0].evaluate(t),t.properties())}],[[dk,mk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return h_(r.evaluate(t),e.evaluate(t))}]]},get:{type:wk,overloads:[[[dk],function(t,n){return f_(gS(n,1)[0].evaluate(t),t.properties())}],[[dk,mk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return f_(r.evaluate(t),e.evaluate(t))}]]},"feature-state":[wk,[dk],function(t,n){return f_(gS(n,1)[0].evaluate(t),t.featureState||{})}],properties:[mk,[],function(t){return t.properties()}],"geometry-type":[dk,[],function(t){return t.geometryType()}],id:[wk,[],function(t){return t.id()}],zoom:[vk,[],function(t){return t.globals.zoom}],"heatmap-density":[vk,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[vk,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[vk,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[wk,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[vk,l_(vk),function(t,n){var i,r=0,e=RS(n);try{for(e.s();!(i=e.n()).done;){r+=i.value.evaluate(t)}}catch(t){e.e(t)}finally{e.f()}return r}],"*":[vk,l_(vk),function(t,n){var i,r=1,e=RS(n);try{for(e.s();!(i=e.n()).done;){r*=i.value.evaluate(t)}}catch(t){e.e(t)}finally{e.f()}return r}],"-":{type:vk,overloads:[[[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)-e.evaluate(t)}],[[vk],function(t,n){return-gS(n,1)[0].evaluate(t)}]]},"/":[vk,[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)/e.evaluate(t)}],"%":[vk,[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)%e.evaluate(t)}],ln2:[vk,[],function(){return Math.LN2}],pi:[vk,[],function(){return Math.PI}],e:[vk,[],function(){return Math.E}],"^":[vk,[vk,vk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return Math.pow(r.evaluate(t),e.evaluate(t))}],sqrt:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.sqrt(i.evaluate(t))}],log10:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.log(i.evaluate(t))}],log2:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.sin(i.evaluate(t))}],cos:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.cos(i.evaluate(t))}],tan:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.tan(i.evaluate(t))}],asin:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.asin(i.evaluate(t))}],acos:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.acos(i.evaluate(t))}],atan:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.atan(i.evaluate(t))}],min:[vk,l_(vk),function(t,n){return Math.min.apply(Math,wS(n.map((function(n){return n.evaluate(t)}))))}],max:[vk,l_(vk),function(t,n){return Math.max.apply(Math,wS(n.map((function(n){return n.evaluate(t)}))))}],abs:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.abs(i.evaluate(t))}],round:[vk,[vk],function(t,n){var i=gS(n,1)[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.floor(i.evaluate(t))}],ceil:[vk,[vk],function(t,n){var i=gS(n,1)[0];return Math.ceil(i.evaluate(t))}],"filter-==":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return t.properties()[r.value]===e.value}],"filter-id-==":[pk,[wk],function(t,n){var i=gS(n,1)[0];return t.id()===i.value}],"filter-type-==":[pk,[dk],function(t,n){var i=gS(n,1)[0];return t.geometryType()===i.value}],"filter-<":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o<s}],"filter-id-<":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r<e}],"filter->":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o>s}],"filter-id->":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r>e}],"filter-<=":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o<=s}],"filter-id-<=":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r<=e}],"filter->=":[pk,[dk,wk],function(t,n){var i=gS(n,2),r=i[0],e=i[1],o=t.properties()[r.value],s=e.value;return NS(o)===NS(s)&&o>=s}],"filter-id->=":[pk,[wk],function(t,n){var i=gS(n,1)[0],r=t.id(),e=i.value;return NS(r)===NS(e)&&r>=e}],"filter-has":[pk,[wk],function(t,n){return gS(n,1)[0].value in t.properties()}],"filter-has-id":[pk,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[pk,[jk(dk)],function(t,n){return gS(n,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[pk,[jk(wk)],function(t,n){return gS(n,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[pk,[dk,jk(wk)],function(t,n){var i=gS(n,2),r=i[0];return i[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[pk,[dk,jk(wk)],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return function(t,n,i,r){for(;i<=r;){var e=i+r>>1;if(n[e]===t)return!0;n[e]>t?r=e-1:i=e+1}return!1}(t.properties()[r.value],e.value,0,e.value.length-1)}],all:{type:pk,overloads:[[[pk,pk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)&&e.evaluate(t)}],[l_(pk),function(t,n){var i,r=RS(n);try{for(r.s();!(i=r.n()).done;){if(!i.value.evaluate(t))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}]]},any:{type:pk,overloads:[[[pk,pk],function(t,n){var i=gS(n,2),r=i[0],e=i[1];return r.evaluate(t)||e.evaluate(t)}],[l_(pk),function(t,n){var i,r=RS(n);try{for(r.s();!(i=r.n()).done;){if(i.value.evaluate(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}]]},"!":[pk,[pk],function(t,n){return!gS(n,1)[0].evaluate(t)}],"is-supported-script":[pk,[dk],function(t,n){var i=gS(n,1)[0],r=t.globals&&t.globals.isSupportedScript;return!r||r(i.evaluate(t))}],upcase:[dk,[dk],function(t,n){return gS(n,1)[0].evaluate(t).toUpperCase()}],downcase:[dk,[dk],function(t,n){return gS(n,1)[0].evaluate(t).toLowerCase()}],concat:[dk,l_(wk),function(t,n){return n.map((function(n){return Fk(n.evaluate(t))})).join("")}],"resolved-locale":[dk,[bk],function(t,n){return gS(n,1)[0].evaluate(t).resolvedLocale()}]});var g_=function(){function t(n,i){var r;MS(this,t),this.expression=n,this._warningHistory={},this._evaluator=new Hk,this._defaultValue=i?"color"===(r=i).type&&b_(r.default)?new Ek(0,0,0,0):"color"===r.type?Ek.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=i&&"enum"===i.type?i.values:null}return kS(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,i,r,e,o){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}},{key:"evaluate",value:function(t,n,i,r,e,o){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Gk("Expected value to be one of ".concat(Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}]),t}();function x_(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in u_}function j_(t,n){var i=new wM(u_,[],n?function(t){var n={color:yk,string:dk,number:vk,enum:dk,boolean:pk,formatted:gk,resolvedImage:xk};if("array"===t.type)return jk(n[t.value]||wk,t.length);return n[t.type]}(n):void 0),r=i.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?v_(new g_(r,n)):d_(i.errors)}var S_=function(){function t(n,i){MS(this,t),this.kind=n,this._styleExpression=i,this.isStateDependent="constant"!==n&&!pM(i.expression)}return kS(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)}},{key:"evaluate",value:function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)}}]),t}(),k_=function(){function t(n,i,r,e){MS(this,t),this.kind=n,this.zoomStops=r,this._styleExpression=i,this.isStateDependent="camera"!==n&&!pM(i.expression),this.interpolationType=e}return kS(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)}},{key:"evaluate",value:function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)}},{key:"interpolationFactor",value:function(t,n,i){return this.interpolationType?qM.interpolationFactor(this.interpolationType,t,n,i):0}}]),t}();function M_(t,n){if("error"===(t=j_(t,n)).result)return t;var i=t.value.expression,r=dM(i);if(!r&&!p_(n))return d_([new hk("","data expressions not supported")]);var e=yM(i,["zoom"]);if(!e&&!y_(n))return d_([new hk("","zoom expressions not supported")]);var o=__(i);if(!o&&!e)return d_([new hk("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof hk)return d_([o]);if(o instanceof qM&&!m_(n))return d_([new hk("",'"interpolate" expressions cannot be used with this property')]);if(!o)return v_(new S_(r?"constant":"source",t.value));var s=o instanceof qM?o.interpolation:void 0;return v_(new k_(r?"camera":"composite",t.value,o.labels,s))}function __(t){var n=null;if(t instanceof VM)n=__(t.result);else if(t instanceof WM){var i,r=RS(t.args);try{for(r.s();!(i=r.n()).done;){var e=i.value;if(n=__(e))break}}catch(t){r.e(t)}finally{r.f()}}else(t instanceof xM||t instanceof qM)&&t.input instanceof Jk&&"zoom"===t.input.name&&(n=t);return n instanceof hk||t.eachChild((function(t){var i=__(t);i instanceof hk?n=i:!n&&i?n=new hk("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new hk("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}function O_(t){return"object"===NS(t)?["literal",t]:t}function T_(t,n){var i=t.stops;if(!i)return function(t,n){var i=["get",t.property];if(void 0===t.default)return"string"===n.type?["string",i]:i;if("enum"===n.type)return["match",i,Object.keys(n.values),i,t.default];var r=["color"===n.type?"to-color":n.type,i,O_(t.default)];return"array"===n.type&&r.splice(1,0,n.value,n.length||null),r}(t,n);var r=i&&"object"===NS(i[0][0]),e=r||void 0!==t.property,o=r||!e;return i=i.map((function(t){return!e&&n.tokens&&"string"==typeof t[1]?[t[0],N_(t[1])]:[t[0],O_(t[1])]})),r?function(t,n,i){for(var r={},e={},o=[],s=0;s<i.length;s++){var a=i[s],u=a[0].zoom;void 0===r[u]&&(r[u]={zoom:u,type:t.type,property:t.property,default:t.default},e[u]=[],o.push(u)),e[u].push([a[0].value,a[1]])}if("exponential"===I_({},n)){var c,h=[E_(t),["linear"],["zoom"]],f=RS(o);try{for(f.s();!(c=f.n()).done;){var l=c.value;P_(h,l,C_(r[l],n,e[l]),!1)}}catch(t){f.e(t)}finally{f.f()}return h}var v,d=["step",["zoom"]],p=RS(o);try{for(p.s();!(v=p.n()).done;){var y=v.value;P_(d,y,C_(r[y],n,e[y]),!0)}}catch(t){p.e(t)}finally{p.f()}return R_(d),d}(t,n,i):o?function(t,n,i){var r,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["zoom"],o=I_(t,n),s=!1;if("interval"===o)r=["step",e],s=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'.concat(o,'"'));var a=void 0!==t.base?t.base:1;r=[E_(t),1===a?["linear"]:["exponential",a],e]}var u,c=RS(i);try{for(c.s();!(u=c.n()).done;){var h=u.value;P_(r,h[0],h[1],s)}}catch(t){c.e(t)}finally{c.f()}return R_(r),r}(t,n,i):C_(t,n,i)}function E_(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function A_(t,n){var i,r,e=O_((i=t.default,r=n.default,void 0!==i?i:void 0!==r?r:void 0));return void 0===e&&"resolvedImage"===n.type?"":e}function C_(t,n,i){var r=I_(t,n),e=["get",t.property];if("categorical"===r&&"boolean"==typeof i[0][0]){var o,s=["case"],a=RS(i);try{for(a.s();!(o=a.n()).done;){var u=o.value;s.push(["==",e,u[0]],u[1])}}catch(t){a.e(t)}finally{a.f()}return s.push(A_(t,n)),s}if("categorical"===r){var c,h=["match",e],f=RS(i);try{for(f.s();!(c=f.n()).done;){var l=c.value;P_(h,l[0],l[1],!1)}}catch(t){f.e(t)}finally{f.f()}return h.push(A_(t,n)),h}if("interval"===r){var v,d=["step",["number",e]],p=RS(i);try{for(p.s();!(v=p.n()).done;){var y=v.value;P_(d,y[0],y[1],!0)}}catch(t){p.e(t)}finally{p.f()}return R_(d),void 0===t.default?d:["case",["==",["typeof",e],"number"],d,O_(t.default)]}if("exponential"===r){var m,w=void 0!==t.base?t.base:1,b=[E_(t),1===w?["linear"]:["exponential",w],["number",e]],g=RS(i);try{for(g.s();!(m=g.n()).done;){var x=m.value;P_(b,x[0],x[1],!1)}}catch(t){g.e(t)}finally{g.f()}return void 0===t.default?b:["case",["==",["typeof",e],"number"],b,O_(t.default)]}throw new Error("Unknown property function type ".concat(r))}function R_(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function P_(t,n,i,r){t.length>3&&n===t[t.length-2]||(r&&2===t.length||t.push(n),t.push(i))}function I_(t,n){return t.type?t.type:n.expression.interpolated?"exponential":"interval"}function N_(t){for(var n=["concat"],i=/{([^{}]+)}/g,r=0,e=i.exec(t);null!==e;e=i.exec(t)){var o=t.slice(r,i.lastIndex-e[0].length);r=i.lastIndex,o.length>0&&n.push(o),n.push(["get",e[1]])}if(1===n.length)return t;if(r<t.length)n.push(t.slice(r));else if(2===n.length)return["to-string",n[1]];return n}function z_(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":var n,i=RS(t.slice(1));try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!z_(r)&&"boolean"!=typeof r)return!1}}catch(t){i.e(t)}finally{i.f()}return!0;default:return!0}}var F_={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function L_(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};z_(t)||(t=U_(t));var n=j_(t,F_);if("error"===n.result)throw new Error(n.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return{filter:function(t,i,r){return n.value.evaluate(t,i,{},r)},needGeometry:D_(t)}}function G_(t,n){return t<n?-1:t>n?1:0}function D_(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var n=1;n<t.length;n++)if(D_(t[n]))return!0;return!1}function U_(t){if(!t)return!0;var n,i=t[0];return t.length<=1?"any"!==i:"=="===i?q_(t[1],t[2],"=="):"!="===i?V_(q_(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?q_(t[1],t[2],i):"any"===i?(n=t.slice(1),["any"].concat(n.map(U_))):"all"===i?["all"].concat(t.slice(1).map(U_)):"none"===i?["all"].concat(t.slice(1).map(U_).map(V_)):"in"===i?B_(t[1],t.slice(2)):"!in"===i?V_(B_(t[1],t.slice(2))):"has"===i?W_(t[1]):"!has"===i?V_(W_(t[1])):"within"!==i||t}function q_(t,n,i){switch(t){case"$type":return["filter-type-".concat(i),n];case"$id":return["filter-id-".concat(i),n];default:return["filter-".concat(i),t,n]}}function B_(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((function(t){return NS(t)!==NS(n[0])}))?["filter-in-large",t,["literal",n.sort(G_)]]:["filter-in-small",t,["literal",n]]}}function W_(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function V_(t){return["!",t]}var X_=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function H_(t,n){var i={};for(var r in t)"ref"!==r&&(i[r]=t[r]);return X_.forEach((function(t){t in n&&(i[t]=n[t])})),i}var J_=kS((function t(n,i,r,e){MS(this,t),this.message=(n?"".concat(n,": "):"")+r,e&&(this.identifier=e),null!=i&&i.hv&&(this.line=i.hv)})),K_=kS((function t(n){MS(this,t),this.error=n,this.message=n.message;var i=n.message.match(/line (\d+)/);this.line=i?parseInt(i[1],10):0}));function Y_(t){var n=t.key,i=t.value;return i?[new J_(n,i,"constants have been deprecated as of v8")]:[]}function Z_(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function $_(t){if(Array.isArray(t))return t.map($_);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var i in t)n[i]=$_(t[i]);return n}return Z_(t)}function Q_(t){var n=t.key,i=t.value,r=t.valueSpec||{},e=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],u=w_(i);if("object"!==u)return[new J_(n,i,"object expected, ".concat(u," found"))];for(var c in i){var h=c.split(".")[0],f=r[h]||r["*"],l=void 0;if(e[h])l=e[h];else if(r[h])l=wO;else if(e["*"])l=e["*"];else{if(!r["*"]){a.push(new J_(n,i[c],'unknown property "'.concat(c,'"')));continue}l=wO}a=a.concat(l({key:(n?"".concat(n,"."):n)+c,value:i[c],valueSpec:f,style:o,styleSpec:s,object:i,objectKey:c},i))}for(var v in r)e[v]||r[v].required&&void 0===r[v].default&&void 0===i[v]&&a.push(new J_(n,i,'missing required property "'.concat(v,'"')));return a}function tO(t){var n=t.value,i=t.valueSpec,r=t.style,e=t.styleSpec,o=t.key,s=t.arrayElementValidator||wO;if("array"!==w_(n))return[new J_(o,n,"array expected, ".concat(w_(n)," found"))];if(i.length&&n.length!==i.length)return[new J_(o,n,"array length ".concat(i.length," expected, length ").concat(n.length," found"))];if(i["min-length"]&&n.length<i["min-length"])return[new J_(o,n,"array length at least ".concat(i["min-length"]," expected, length ").concat(n.length," found"))];var a={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum};e.$version<7&&(a.function=i.function),"object"===w_(i.value)&&(a=i.value);for(var u=[],c=0;c<n.length;c++)u=u.concat(s({array:n,arrayIndex:c,value:n[c],valueSpec:a,style:r,styleSpec:e,key:"".concat(o,"[").concat(c,"]")}));return u}function nO(t){var n=t.key,i=t.value,r=t.valueSpec,e=w_(i);if("number"===e&&i!=i&&(e="NaN"),"number"!==e)return[new J_(n,i,"number expected, ".concat(e," found"))];if("minimum"in r){var o=r.minimum;if("array"===w_(r.minimum)){var s=t.arrayIndex;o=r.minimum[s]}if(i<o)return[new J_(n,i,"".concat(i," is less than the minimum value ").concat(o))]}if("maximum"in r){var a=r.maximum;if("array"===w_(r.maximum)){var u=t.arrayIndex;a=r.maximum[u]}if(i>a)return[new J_(n,i,"".concat(i," is greater than the maximum value ").concat(a))]}return[]}function iO(t){var n,i,r,e=t.valueSpec,o=Z_(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,u=!a,c="array"===w_(t.value.stops)&&"array"===w_(t.value.stops[0])&&"object"===w_(t.value.stops[0][0]),h=Q_({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new J_(t.key,t.value,'identity function may not have a "stops" property')];var n=[],i=t.value;n=n.concat(tO({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===w_(i)&&0===i.length&&n.push(new J_(t.key,i,"array must have at least one stop"));return n},default:function(t){return wO({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&h.push(new J_(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||h.push(new J_(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!m_(t.valueSpec)&&h.push(new J_(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!p_(t.valueSpec)?h.push(new J_(t.key,t.value,"property functions not supported")):a&&!y_(t.valueSpec)&&h.push(new J_(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||h.push(new J_(t.key,t.value,'"property" property is required')),h;function f(t){var n=[],o=t.value,a=t.key;if("array"!==w_(o))return[new J_(a,o,"array expected, ".concat(w_(o)," found"))];if(2!==o.length)return[new J_(a,o,"array length 2 expected, length ".concat(o.length," found"))];if(c){if("object"!==w_(o[0]))return[new J_(a,o,"object expected, ".concat(w_(o[0])," found"))];if(void 0===o[0].zoom)return[new J_(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new J_(a,o,"object stop key must have value")];if(r&&r>Z_(o[0].zoom))return[new J_(a,o[0].zoom,"stop zoom values must appear in ascending order")];Z_(o[0].zoom)!==r&&(r=Z_(o[0].zoom),i=void 0,s={}),n=n.concat(Q_({key:"".concat(a,"[0]"),value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:nO,value:l}}))}else n=n.concat(l({key:"".concat(a,"[0]"),value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return x_($_(o[1]))?n.concat([new J_("".concat(a,"[1]"),o[1],"expressions are not allowed in function stops.")]):n.concat(wO({key:"".concat(a,"[1]"),value:o[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function l(t,r){var a=w_(t.value),u=Z_(t.value),c=null!==t.value?t.value:r;if(n){if(a!==n)return[new J_(t.key,c,"".concat(a," stop domain type must match previous stop domain type ").concat(n))]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new J_(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var h="number expected, ".concat(a," found");return p_(e)&&void 0===o&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new J_(t.key,c,h)]}return"categorical"!==o||"number"!==a||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===a&&void 0!==i&&u<i?[new J_(t.key,c,"stop domain values must appear in ascending order")]:(i=u,"categorical"===o&&u in s?[new J_(t.key,c,"stop domain values must be unique")]:(s[u]=!0,[])):[new J_(t.key,c,"integer expected, found ".concat(u))]}}function rO(t){var n=("property"===t.expressionContext?M_:j_)($_(t.value),t.valueSpec);if("error"===n.result)return n.value.map((function(n){return new J_("".concat(t.key).concat(n.key),t.value,n.message)}));var i=n.value.expression||n.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new J_(t.key,t.value,'Invalid data expression for "'.concat(t.propertyKey,'". Output values must be contained as literals within the expression.'))];if("property"===t.expressionContext&&"layout"===t.propertyType&&!pM(i))return[new J_(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!pM(i))return[new J_(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!yM(i,["zoom","feature-state"]))return[new J_(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!dM(i))return[new J_(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function eO(t){var n=t.key,i=t.value,r=t.valueSpec,e=[];return Array.isArray(r.values)?-1===r.values.indexOf(Z_(i))&&e.push(new J_(n,i,"expected one of [".concat(r.values.join(", "),"], ").concat(JSON.stringify(i)," found"))):-1===Object.keys(r.values).indexOf(Z_(i))&&e.push(new J_(n,i,"expected one of [".concat(Object.keys(r.values).join(", "),"], ").concat(JSON.stringify(i)," found"))),e}function oO(t){return z_($_(t.value))?rO(ck({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):sO(t)}function sO(t){var n=t.value,i=t.key;if("array"!==w_(n))return[new J_(i,n,"array expected, ".concat(w_(n)," found"))];var r,e=t.styleSpec,o=[];if(n.length<1)return[new J_(i,n,"filter array must have at least 1 element")];switch(o=o.concat(eO({key:"".concat(i,"[0]"),value:n[0],valueSpec:e.filter_operator,style:t.style,styleSpec:t.styleSpec})),Z_(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===Z_(n[1])&&o.push(new J_(i,n,'"$type" cannot be use with operator "'.concat(n[0],'"')));case"==":case"!=":3!==n.length&&o.push(new J_(i,n,'filter array for operator "'.concat(n[0],'" must have 3 elements')));case"in":case"!in":n.length>=2&&"string"!==(r=w_(n[1]))&&o.push(new J_("".concat(i,"[1]"),n[1],"string expected, ".concat(r," found")));for(var s=2;s<n.length;s++)r=w_(n[s]),"$type"===Z_(n[1])?o=o.concat(eO({key:"".concat(i,"[").concat(s,"]"),value:n[s],valueSpec:e.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&o.push(new J_("".concat(i,"[").concat(s,"]"),n[s],"string, number, or boolean expected, ".concat(r," found")));break;case"any":case"all":case"none":for(var a=1;a<n.length;a++)o=o.concat(sO({key:"".concat(i,"[").concat(a,"]"),value:n[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":r=w_(n[1]),2!==n.length?o.push(new J_(i,n,'filter array for "'.concat(n[0],'" operator must have 2 elements'))):"string"!==r&&o.push(new J_("".concat(i,"[1]"),n[1],"string expected, ".concat(r," found")));break;case"within":r=w_(n[1]),2!==n.length?o.push(new J_(i,n,'filter array for "'.concat(n[0],'" operator must have 2 elements'))):"object"!==r&&o.push(new J_("".concat(i,"[1]"),n[1],"object expected, ".concat(r," found")))}return o}function aO(t,n){var i=t.key,r=t.style,e=t.styleSpec,o=t.value,s=t.objectKey,a=e["".concat(n,"_").concat(t.layerType)];if(!a)return[];var u=s.match(/^(.*)-transition$/);if("paint"===n&&u&&a[u[1]]&&a[u[1]].transition)return wO({key:i,value:o,valueSpec:e.transition,style:r,styleSpec:e});var c,h=t.valueSpec||a[s];if(!h)return[new J_(i,o,'unknown property "'.concat(s,'"'))];if("string"===w_(o)&&p_(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new J_(i,o,'"'.concat(s,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(c[1])," }`."))];var f=[];return"symbol"===t.layerType&&("text-field"===s&&r&&!r.glyphs&&f.push(new J_(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&b_($_(o))&&"identity"===Z_(o.type)&&f.push(new J_(i,o,'"text-font" does not support identity functions'))),f.concat(wO({key:t.key,value:o,valueSpec:h,style:r,styleSpec:e,expressionContext:"property",propertyType:n,propertyKey:s}))}function uO(t){return aO(t,"paint")}function cO(t){return aO(t,"layout")}function hO(t){var n=[],i=t.value,r=t.key,e=t.style,o=t.styleSpec;i.type||i.ref||n.push(new J_(r,i,'either "type" or "ref" is required'));var s,a=Z_(i.type),u=Z_(i.ref);if(i.id)for(var c=Z_(i.id),h=0;h<t.arrayIndex;h++){var f=e.layers[h];Z_(f.id)===c&&n.push(new J_(r,i.id,'duplicate layer id "'.concat(i.id,'", previously used at line ').concat(f.id.hv)))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach((function(t){t in i&&n.push(new J_(r,i[t],'"'.concat(t,'" is prohibited for ref layers')))})),e.layers.forEach((function(t){Z_(t.id)===u&&(s=t)})),s?s.ref?n.push(new J_(r,i.ref,"ref cannot reference another ref layer")):a=Z_(s.type):n.push(new J_(r,i.ref,'ref layer "'.concat(u,'" not found')));else if("background"!==a&&"sky"!==a)if(i.source){var l=e.sources&&e.sources[i.source],v=l&&Z_(l.type);l?"vector"===v&&"raster"===a?n.push(new J_(r,i.source,'layer "'.concat(i.id,'" requires a raster source'))):"raster"===v&&"raster"!==a?n.push(new J_(r,i.source,'layer "'.concat(i.id,'" requires a vector source'))):"vector"!==v||i["source-layer"]?"raster-dem"===v&&"hillshade"!==a?n.push(new J_(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!i.paint||!i.paint["line-gradient"]||"geojson"===v&&l.lineMetrics||n.push(new J_(r,i,'layer "'.concat(i.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):n.push(new J_(r,i,'layer "'.concat(i.id,'" must specify a "source-layer"'))):n.push(new J_(r,i.source,'source "'.concat(i.source,'" not found')))}else n.push(new J_(r,i,'missing required property "source"'));return n=n.concat(Q_({key:r,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return wO({key:"".concat(r,".type"),value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:oO,layout:function(t){return Q_({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return cO(ck({layerType:a},t))}}})},paint:function(t){return Q_({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return uO(ck({layerType:a},t))}}})}}}))}function fO(t){var n=t.value,i=t.key,r=w_(n);return"string"!==r?[new J_(i,n,"string expected, ".concat(r," found"))]:[]}var lO={promoteId:function(t){var n=t.key,i=t.value;if("string"===w_(i))return fO({key:n,value:i});var r=[];for(var e in i)r.push.apply(r,wS(fO({key:"".concat(n,".").concat(e),value:i[e]})));return r}};function vO(t){var n=t.value,i=t.key,r=t.styleSpec,e=t.style;if(!n.type)return[new J_(i,n,'"type" is required')];var o,s=Z_(n.type);switch(s){case"vector":case"raster":case"raster-dem":return o=Q_({key:i,value:n,valueSpec:r["source_".concat(s.replace("-","_"))],style:t.style,styleSpec:r,objectElementValidators:lO});case"geojson":if(o=Q_({key:i,value:n,valueSpec:r.source_geojson,style:e,styleSpec:r,objectElementValidators:lO}),n.cluster)for(var a in n.clusterProperties){var u,c,h=gS(n.clusterProperties[a],2),f=h[0],l=h[1],v="string"==typeof f?[f,["accumulated"],["get",a]]:f;(u=o).push.apply(u,wS(rO({key:"".concat(i,".").concat(a,".map"),value:l,expressionContext:"cluster-map"}))),(c=o).push.apply(c,wS(rO({key:"".concat(i,".").concat(a,".reduce"),value:v,expressionContext:"cluster-reduce"})))}return o;case"video":return Q_({key:i,value:n,valueSpec:r.source_video,style:e,styleSpec:r});case"image":return Q_({key:i,value:n,valueSpec:r.source_image,style:e,styleSpec:r});case"canvas":return[new J_(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return eO({key:"".concat(i,".type"),value:n.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:e,styleSpec:r})}}function dO(t){var n=t.value,i=t.styleSpec,r=i.light,e=t.style,o=[],s=w_(n);if(void 0===n)return o;if("object"!==s)return o=o.concat([new J_("light",n,"object expected, ".concat(s," found"))]);for(var a in n){var u=a.match(/^(.*)-transition$/);o=u&&r[u[1]]&&r[u[1]].transition?o.concat(wO({key:a,value:n[a],valueSpec:i.transition,style:e,styleSpec:i})):r[a]?o.concat(wO({key:a,value:n[a],valueSpec:r[a],style:e,styleSpec:i})):o.concat([new J_(a,n[a],'unknown property "'.concat(a,'"'))])}return o}function pO(t){var n=t.value,i=t.key,r=t.style,e=t.styleSpec,o=e.terrain,s=[],a=w_(n);if(void 0===n)return s;if("object"!==a)return s=s.concat([new J_("terrain",n,"object expected, ".concat(a," found"))]);for(var u in n){var c=u.match(/^(.*)-transition$/);s=c&&o[c[1]]&&o[c[1]].transition?s.concat(wO({key:u,value:n[u],valueSpec:e.transition,style:r,styleSpec:e})):o[u]?s.concat(wO({key:u,value:n[u],valueSpec:o[u],style:r,styleSpec:e})):s.concat([new J_(u,n[u],'unknown property "'.concat(u,'"'))])}if(n.source){var h=r.sources&&r.sources[n.source],f=h&&Z_(h.type);h?"raster-dem"!==f&&s.push(new J_(i,n.source,"terrain cannot be used with a source of type ".concat(f,', it only be used with a "raster-dem" source type'))):s.push(new J_(i,n.source,'source "'.concat(n.source,'" not found')))}else s.push(new J_(i,n,'terrain is missing required property "source"'));return s}function yO(t){var n=t.value,i=t.style,r=t.styleSpec,e=r.fog,o=[],s=w_(n);if(void 0===n)return o;if("object"!==s)return o=o.concat([new J_("fog",n,"object expected, ".concat(s," found"))]);for(var a in n){var u=a.match(/^(.*)-transition$/);o=u&&e[u[1]]&&e[u[1]].transition?o.concat(wO({key:a,value:n[a],valueSpec:r.transition,style:i,styleSpec:r})):e[a]?o.concat(wO({key:a,value:n[a],valueSpec:e[a],style:i,styleSpec:r})):o.concat([new J_(a,n[a],'unknown property "'.concat(a,'"'))])}return o}var mO={"*":function(){return[]},array:tO,boolean:function(t){var n=t.value,i=t.key,r=w_(n);return"boolean"!==r?[new J_(i,n,"boolean expected, ".concat(r," found"))]:[]},number:nO,color:function(t){var n=t.key,i=t.value,r=w_(i);return"string"!==r?[new J_(n,i,"color expected, ".concat(r," found"))]:null===Tk.parseCSSColor(i)?[new J_(n,i,'color expected, "'.concat(i,'" found'))]:[]},constants:Y_,enum:eO,filter:oO,function:iO,layer:hO,object:Q_,source:vO,light:dO,terrain:pO,fog:yO,string:fO,formatted:function(t){return 0===fO(t).length?[]:rO(t)},resolvedImage:function(t){return 0===fO(t).length?[]:rO(t)}};function wO(t){var n=t.value,i=t.valueSpec,r=t.styleSpec;return i.expression&&b_(Z_(n))?iO(t):i.expression&&x_($_(n))?rO(t):i.type&&mO[i.type]?mO[i.type](t):Q_(ck({},t,{valueSpec:i.type?r[i.type]:i}))}function bO(t){var n=t.value,i=t.key,r=fO(t);return r.length||(-1===n.indexOf("{fontstack}")&&r.push(new J_(i,n,'"glyphs" url must include a "{fontstack}" token')),-1===n.indexOf("{range}")&&r.push(new J_(i,n,'"glyphs" url must include a "{range}" token'))),r}function gO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zS,i=[];return i=i.concat(wO({key:"",value:t,valueSpec:n.$root,styleSpec:n,style:t,objectElementValidators:{glyphs:bO,"*":function(){return[]}}})),t.constants&&(i=i.concat(Y_({key:"constants",value:t.constants,style:t,styleSpec:n}))),xO(i)}function xO(t){return[].concat(t).sort((function(t,n){return t.line-n.line}))}function jO(t){return function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return xO(t.apply(this,i))}}gO.source=jO(vO),gO.light=jO(dO),gO.terrain=jO(pO),gO.fog=jO(yO),gO.layer=jO(hO),gO.filter=jO(oO),gO.paintProperty=jO(uO),gO.layoutProperty=jO(cO);var SO=LS((function(t,n){var i=function(){var t=function(t,n,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=n);return i},n=[1,12],i=[1,13],r=[1,9],e=[1,10],o=[1,11],s=[1,14],a=[1,15],u=[14,18,22,24],c=[18,22],h=[22,24],f={trace:function(){},yy:{},fv:{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},lv:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},vv:[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,n,i,r,e,o,s){var a=o.length-1;switch(e){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.$.hv=this._$.first_line;break;case 2:this.$=new Number(t),this.$.hv=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.hv=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.hv=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"hv",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"hv",{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.$,"hv",{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:n,5:6,6:i,7:3,8:r,9:4,10:e,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(u,[2,7]),t(u,[2,8]),t(u,[2,9]),t(u,[2,10]),t(u,[2,11]),t(u,[2,12]),t(u,[2,3]),t(u,[2,4]),t(u,[2,5]),t([14,18,21,22,24],[2,1]),t(u,[2,2]),{3:20,4:n,18:[1,17],19:18,20:19},{3:5,4:n,5:6,6:i,7:3,8:r,9:4,10:e,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(u,[2,13]),{18:[1,24],22:[1,25]},t(c,[2,16]),{21:[1,26]},t(u,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(u,[2,14]),{3:20,4:n,20:29},{3:5,4:n,5:6,6:i,7:3,8:r,9:4,10:e,11:o,13:30,15:7,16:8,17:s,23:a},t(u,[2,19]),{3:5,4:n,5:6,6:i,7:3,8:r,9:4,10:e,11:o,13:31,15:7,16:8,17:s,23:a},t(c,[2,17]),t(c,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,n){if(!n.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var n=this,i=[0],r=[null],e=[],o=this.table,s="",a=0,u=0,c=2,h=1,f=e.slice.call(arguments,1),l=Object.create(this.lexer),v={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(v.yy[d]=this.yy[d]);l.setInput(t,v.yy),v.yy.lexer=l,v.yy.parser=this,void 0===l.yylloc&&(l.yylloc={});var p=l.yylloc;e.push(p);var y=l.options&&l.options.ranges;function m(){var t;return"number"!=typeof(t=l.lex()||h)&&(t=n.fv[t]||t),t}"function"==typeof v.yy.parseError?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var w,b,g,x,j,S,k,M,_={};;){if(b=i[i.length-1],this.defaultActions[b]?g=this.defaultActions[b]:(null==w&&(w=m()),g=o[b]&&o[b][w]),void 0===g||!g.length||!g[0]){var O="";for(j in M=[],o[b])this.lv[j]&&j>c&&M.push("'"+this.lv[j]+"'");O=l.showPosition?"Parse error on line "+(a+1)+":\n"+l.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.lv[w]||w)+"'":"Parse error on line "+(a+1)+": Unexpected "+(w==h?"end of input":"'"+(this.lv[w]||w)+"'"),this.parseError(O,{text:l.match,token:this.lv[w]||w,line:l.yylineno,loc:p,expected:M})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+w);switch(g[0]){case 1:i.push(w),r.push(l.yytext),e.push(l.yylloc),i.push(g[1]),w=null,u=l.yyleng,s=l.yytext,a=l.yylineno,p=l.yylloc;break;case 2:if(S=this.vv[g[1]][1],_.$=r[r.length-S],_._$={first_line:e[e.length-(S||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(S||1)].first_column,last_column:e[e.length-1].last_column},y&&(_._$.range=[e[e.length-(S||1)].range[0],e[e.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,u,a,v.yy,g[1],r,e].concat(f))))return x;S&&(i=i.slice(0,-1*S*2),r=r.slice(0,-1*S),e=e.slice(0,-1*S)),i.push(this.vv[g[1]][0]),r.push(_.$),e.push(_._$),k=o[i[i.length-2]][i[i.length-1]],i.push(k);break;case 3:return!0}}return!0}},l={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(t,n){return this.yy=n||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 n=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var r=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 e=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===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-n]),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(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},test_match:function(t,n){var i,r,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in e)this[o]=e[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,n,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),o=0;o<e.length;o++)if((i=this._input.match(this.rules[e[o]]))&&(!n||i[0].length>n[0].length)){if(n=i,r=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,e[o])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,e[r]))&&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,n,i,r){switch(i){case 0:break;case 1:return 6;case 2:return n.yytext=n.yytext.substr(1,n.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 v(){this.yy={}}return f.lexer=l,v.prototype=f,f.Parser=v,new v}();n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)}}));function kO(t){if(t instanceof String||"string"==typeof t||t instanceof Buffer)try{return SO.parse(t.toString())}catch(t){throw new K_(t)}return t}function MO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zS,i=t;try{i=kO(i)}catch(t){return[t]}return gO(i,n)}new Set(["vector","raster","raster-dem"]);var _O=x_,OO=M_,TO=T_,EO=b_;MO.parsed=MO,MO.latest=MO;var AO="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r<e;++r){var o=arguments[r];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s])}return i};function CO(t){return t*Math.PI/180}var RO=function(){for(var t=[],n=78271.51696402048;t.length<=24;n/=2)t.push(n);return t}();function PO(t,n){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,n);var i=document.createElement("canvas");return i.width=t,i.height=n,i}var IO,NO=Array(256).join(" ");function zO(t,n){if(n>=.05){for(var i="",r=t.split("\n"),e=NO.slice(0,Math.round(n/.1)),o=0,s=r.length;o<s;++o)o>0&&(i+="\n"),i+=r[o].split("").join(e);return i}return t}function FO(){return IO||(IO=PO(1,1).getContext("2d")),IO}function LO(t,n){return FO().measureText(t).width+(t.length-1)*n}var GO={};function DO(t,n,i,r){if(-1!==t.indexOf("\n")){for(var e=t.split("\n"),o=[],s=0,a=e.length;s<a;++s)o.push(DO(e[s],n,i,r));return o.join("\n")}var u=i+","+n+","+t+","+r,c=GO[u];if(!c){var h=t.split(" ");if(h.length>1){var f=FO();f.font=n;var l=f.measureText("M").width*i,v="";for(o=[],s=0,a=h.length;s<a;++s){var d=h[s],p=v+(v?" ":"")+d;LO(p,r)<=l?v=p:(v&&o.push(v),v=d)}v&&o.push(v);for(s=0,a=o.length;s<a&&a>1;++s){var y=o[s];if(LO(y,r)<.35*l){var m=s>0?LO(o[s-1],r):1/0,w=s<a-1?LO(o[s+1],r):1/0;o.splice(s,1),a-=1,m<w?(o[s-1]+=" "+y,s-=1):o[s]=y+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var b=o[s],g=o[s+1];if(LO(b,r)>.7*l&&LO(g,r)<.6*l){var x=b.split(" "),j=x.pop();LO(j,r)<.2*l&&(o[s]=x.join(" "),o[s+1]=j+" "+g),a-=1}}c=o.join("\n")}else c=t;c=zO(c,r),GO[u]=c}return c}function UO(t){return(UO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Hs&&Y(Hs,F,(function(){GO={}}));var qO,BO,WO=EO,VO=TO,XO=_O,HO=OO,JO={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},KO={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]},YO={},ZO={zoom:0};function $O(t,n,i,r,e,o){var s=t.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});var a=o[s];if(!a[i]){var u=(t[n]||YO)[i],c=zS["".concat(n,"_").concat(t.type)][i];void 0===u&&(u=c.default);var h=XO(u);if(!h&&WO(u)&&(u=VO(u,c),h=!0),h){var f=function(t,n){var i=HO(t,n);if("error"===i.result)throw new Error(i.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return i.value}(u,c);a[i]=f.evaluate.bind(f)}else"color"==c.type&&(u=Ek.parse(u)),a[i]=function(){return u}}return ZO.zoom=r,a[i](ZO,e)}var QO=!1;function tT(t,n){if(t){if(!QO&&(0===t.a||0===n))return;var i=t.a;return n=void 0===n?1:n,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*n+")"}return t}var nT=/^([^]*)\{(.*)\}([^]*)$/;function iT(t,n){var i;do{if(i=t.match(nT)){var r=n[i[2]]||"";t=i[1]+r+i[3]}}while(i);return t}var rT=!1;function eT(t,n,i,r,e,o,s){if(void 0===r&&(r=RO),"string"==typeof n&&(n=JSON.parse(n)),8!=n.version)throw new Error("glStyle version 8 required.");var a,u;if(o)if("undefined"!=typeof Image){var c=new Image;c.crossOrigin="anonymous",c.onload=function(){a=c,u=[c.width,c.height],t.changed(),c.onload=null},c.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,u=[a.width,a.height])}))}for(var f,l=function(t){t=t.slice();for(var n=Object.create(null),i=0;i<t.length;i++)n[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=H_(t[r],n[t[r].ref]));return t}(n.layers),v={},d=[],p={},y={},m={},w={},b=0,g=l.length;b<g;++b){var x=l[b],j=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(j)){var S=x["source-layer"];if(!f){f=x.source;var k=n.sources[f];if(!k)throw new Error('Source "'.concat(f,'" is not defined'));var M=k.type;if("vector"!==M&&"geojson"!==M)throw new Error('Source "'.concat(f,'" is not of type "vector" or "geojson", but "').concat(M,'"'))}var _=v[S];_||(_=[],v[S]=_),_.push({layer:x,index:b}),d.push(j)}}var O=new Vv,T=new Cv,E=[],A=function(t,n){var i=t.getProperties(),o=v[i.layer];if(o){var c=r.indexOf(n);-1==c&&(c=function(t,n){for(var i=0,r=n.length;i<r;++i)if(n[i]<t&&i+1<r){var e=n[i]/n[i+1];return i+Math.log(n[i]/t)/Math.log(e)}return r-1}(n,r));for(var h,f=JO[t.getGeometry().getType()],l={properties:i,type:f},d=-1,b=function(r,v){var b=o[r],g=b.layer,x=g.id,j=g.layout||YO,S=g.paint||YO;if("none"===j.visibility||"minzoom"in g&&c<g.minzoom||"maxzoom"in g&&c>=g.maxzoom)return"continue";var k=g.filter;if(!k||function(t,n,i,r,e){return e||console.warn("No filterCache provided to evaluateFilter()"),t in e||(e[t]=L_(n).filter),ZO.zoom=r,e[t](ZO,i)}(x,k,l,c,w)){h=g;var M=void 0,_=void 0,A=void 0,C=void 0,R=void 0,P=void 0,I=b.index;if(3==f&&("fill"==g.type||"fill-extrusion"==g.type))if(_=$O(g,"paint",g.type+"-opacity",c,l,m),g.type+"-pattern"in S){var N=$O(g,"paint",g.type+"-pattern",c,l,m);if(N){var z="string"==typeof N?iT(N,i):N.toString();if(a&&e&&e[z]){++d,(P=E[d])&&P.getFill()&&!P.getStroke()&&!P.getText()||(P=new Qv({fill:new Cv}),E[d]=P),A=P.getFill(),P.setZIndex(I);var F=y[dt=z+"."+_];if(!F){var L=e[z],G=PO(L.width,L.height),D=G.getContext("2d");D.globalAlpha=_,D.drawImage(a,L.x,L.y,L.width,L.height,0,0,L.width,L.height),F=D.createPattern(G,"repeat"),y[dt]=F}A.setColor(F)}}}else M=tT($O(g,"paint",g.type+"-color",c,l,m),_),g.type+"-outline-color"in S&&(R=tT($O(g,"paint",g.type+"-outline-color",c,l,m),_)),R||(R=M),(M||R)&&(++d,(!(P=E[d])||M&&!P.getFill()||!M&&P.getFill()||R&&!P.getStroke()||!R&&P.getStroke()||P.getText())&&(P=new Qv({fill:M?new Cv:void 0,stroke:R?new Vv:void 0}),E[d]=P),M&&(A=P.getFill()).setColor(M),R&&((C=P.getStroke()).setColor(R),C.setWidth(.5)),P.setZIndex(I));if(1!=f&&"line"==g.type){M=!("line-pattern"in S)&&"line-color"in S?tT($O(g,"paint","line-color",c,l,m),$O(g,"paint","line-opacity",c,l,m)):void 0;var U=$O(g,"paint","line-width",c,l,m);M&&U>0&&(++d,(P=E[d])&&P.getStroke()&&!P.getFill()&&!P.getText()||(P=new Qv({stroke:new Vv}),E[d]=P),(C=P.getStroke()).setLineCap($O(g,"layout","line-cap",c,l,m)),C.setLineJoin($O(g,"layout","line-join",c,l,m)),C.setMiterLimit($O(g,"layout","line-miter-limit",c,l,m)),C.setColor(M),C.setWidth(U),C.setLineDash(S["line-dasharray"]?$O(g,"paint","line-dasharray",c,l,m).map((function(t){return t*U})):null),P.setZIndex(I))}var q=!1,B=null,W=0,V=void 0,X=void 0,H=void 0;if((1==f||2==f)&&"icon-image"in j){var J=$O(g,"layout","icon-image",c,l,m);if(J){V="string"==typeof J?iT(J,i):J.toString();var K=void 0;if(a&&e&&e[V]){var Y=$O(g,"layout","icon-rotation-alignment",c,l,m);if(2==f){var Z=t.getGeometry();if(Z.getFlatMidpoint||Z.getFlatMidpoints){var $=Z.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/n,2),Math.pow(($[3]-$[1])/n,2)))>150){var Q="MultiLineString"===Z.getType()?Z.getFlatMidpoints():Z.getFlatMidpoint();if(BO||(BO=new Pj("Point",qO=[NaN,NaN],[],{},null)),K=BO,qO[0]=Q[0],qO[1]=Q[1],"line"===(Rt=$O(g,"layout","symbol-placement",c,l,m))&&"map"===Y)for(var tt=Z.getStride(),nt=Z.getFlatCoordinates(),it=0,rt=nt.length-tt;it<rt;it+=tt){var et=nt[it],ot=nt[it+1],st=nt[it+tt],at=nt[it+tt+1],ut=Math.min(et,st),ct=Math.min(ot,at),ht=Math.max(et,st),ft=Math.max(ot,at);if(Q[0]>=ut&&Q[0]<=ht&&Q[1]>=ct&&Q[1]<=ft){W=Math.atan2(ot-at,st-et);break}}}}}if(2!==f||K){var lt=$O(g,"layout","icon-size",c,l,m),vt=void 0!==S["icon-color"]?$O(g,"paint","icon-color",c,l,m):null;if(!vt||0!==vt.a){var dt=V+"."+lt;if(null!==vt&&(dt+="."+vt),!(X=p[dt])){var pt=e[V];X=new Wv({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:a,imgSize:u,size:[pt.width,pt.height],offset:[pt.x,pt.y],rotateWithView:"map"===Y,scale:lt/pt.pixelRatio,displacement:"icon-offset"in j?$O(g,"layout","icon-offset",c,l,m).map((function(t){return-t*pt.pixelRatio})):void 0}),p[dt]=X}}X&&(++d,(P=E[d])&&P.getImage()&&!P.getFill()&&!P.getStroke()||(P=new Qv,E[d]=P),P.setGeometry(K),X.setRotation(W+CO($O(g,"layout","icon-rotate",c,l,m))),X.setOpacity($O(g,"paint","icon-opacity",c,l,m)),X.setAnchor(KO[$O(g,"layout","icon-anchor",c,l,m)]),P.setImage(X),B=P.getText(),P.setText(void 0),P.setZIndex(I),q=!0,H=!1)}else H=!0}}}if(1==f&&"circle"===g.type){++d,(P=E[d])&&P.getImage()&&!P.getFill()&&!P.getStroke()||(P=new Qv,E[d]=P);var yt="circle-radius"in S?$O(g,"paint","circle-radius",c,l,m):5,mt=tT($O(g,"paint","circle-stroke-color",c,l,m),$O(g,"paint","circle-stroke-opacity",c,l,m)),wt=tT($O(g,"paint","circle-color",c,l,m),$O(g,"paint","circle-opacity",c,l,m)),bt=$O(g,"paint","circle-stroke-width",c,l,m),gt=yt+"."+mt+"."+wt+"."+bt;(X=p[gt])||(X=new Av({radius:yt,stroke:mt&&bt>0?new Vv({width:bt,color:mt}):void 0,fill:wt?new Cv({color:wt}):void 0}),p[gt]=X),P.setImage(X),B=P.getText(),P.setText(void 0),P.setGeometry(void 0),P.setZIndex(I),q=!0}var xt,jt,St,kt,Mt=void 0,_t=void 0;if("text-field"in j){jt=Math.round($O(g,"layout","text-size",c,l,m));var Ot=$O(g,"layout","text-font",c,l,m);xt=$O(g,"layout","text-line-height",c,l,m),_t=mS(s?s(Ot):Ot,jt,xt),St=$O(g,"layout","text-letter-spacing",c,l,m),kt=$O(g,"layout","text-max-width",c,l,m);var Tt=$O(g,"layout","text-field",c,l,m);Mt="object"===UO(Tt)&&Tt.sections?1===Tt.sections.length?Tt.toString():Tt.sections.reduce((function(t,n,i){var r=n.fontStack?n.fontStack.split(","):Ot,e=mS(s?s(r):r,jt*(n.scale||1),xt),o=n.text;if("\n"===o)return t.push("\n",""),t;if(2!=f){for(var a=0,u=(o=DO(o,e,kt,St).split("\n")).length;a<u;++a)a>0&&t.push("\n",""),t.push(o[a],e);return t}t.push(zO(o,St),e)}),[]):iT(Tt,i).trim(),_=$O(g,"paint","text-opacity",c,l,m)}if(Mt&&_&&!H){q||(++d,(P=E[d])&&P.getText()&&!P.getFill()&&!P.getStroke()||(P=new Qv,E[d]=P),P.setImage(void 0),P.setGeometry(void 0)),P.getText()||P.setText(B||new id({padding:[2,2,2,2]})),B=P.getText();var Et=j["text-transform"];"uppercase"==Et?Mt=Array.isArray(Mt)?Mt.map((function(t,n){return n%2?t:t.toUpperCase()})):Mt.toUpperCase():"lowercase"==Et&&(Mt=Array.isArray(Mt)?Mt.map((function(t,n){return n%2?t:t.toLowerCase()})):Mt.toLowerCase());var At=Array.isArray(Mt)?Mt:2==f?zO(Mt,St):DO(Mt,_t,kt,St);B.setText(At),B.setFont(_t),B.setRotation(CO($O(g,"layout","text-rotate",c,l,m)));var Ct=$O(g,"layout","text-anchor",c,l,m),Rt=q||1==f?"point":$O(g,"layout","symbol-placement",c,l,m);B.setPlacement(Rt),B.setOverflow("point"===Rt);var Pt=$O(g,"paint","text-halo-width",c,l,m),It=$O(g,"layout","text-offset",c,l,m),Nt=$O(g,"paint","text-translate",c,l,m),zt=0,Ft=0;if("point"==Rt){var Lt="center";-1!==Ct.indexOf("left")?(Lt="left",Ft=Pt):-1!==Ct.indexOf("right")&&(Lt="right",Ft=-Pt),B.setTextAlign(Lt);var Gt=$O(g,"layout","text-rotation-alignment",c,l,m);B.setRotateWithView("map"==Gt)}else B.setMaxAngle(CO($O(g,"layout","text-max-angle",c,l,m))*Mt.length/At.length),B.setTextAlign(),B.setRotateWithView(!1);var Dt="middle";0==Ct.indexOf("bottom")?(Dt="bottom",zt=-Pt-.5*(xt-1)*jt):0==Ct.indexOf("top")&&(Dt="top",zt=Pt+.5*(xt-1)*jt),B.setTextBaseline(Dt),B.setOffsetX(It[0]*jt+Ft+Nt[0]),B.setOffsetY(It[1]*jt+zt+Nt[1]),T.setColor(tT($O(g,"paint","text-color",c,l,m),_)),B.setFill(T);var Ut=tT($O(g,"paint","text-halo-color",c,l,m),_);if(Ut){O.setColor(Ut),Pt*=2;var qt=.5*jt;O.setWidth(Pt<=qt?Pt:qt),B.setStroke(O)}else B.setStroke(void 0);var Bt=$O(g,"layout","text-padding",c,l,m),Wt=B.getPadding();Bt!==Wt[0]&&(Wt[0]=Bt,Wt[1]=Bt,Wt[2]=Bt,Wt[3]=Bt),P.setZIndex(I)}}},g=0,x=o.length;g<x;++g)b(g);return d>-1?(E.length=d+1,rT&&("function"==typeof t.set?t.set("mapbox-layer",h):t.getProperties()["mapbox-layer"]=h),E):void 0}};return t.setStyle(A),t.set("mapbox-source",f),t.set("mapbox-layers",d),A}var oT=i(338);function sT(t){return(sT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var aT,uT={},cT=/font-family: ?([^;]*);/,hT=/("|')/g;function fT(t){if(!aT){aT={};for(var n=document.styleSheets,i=0,r=n.length;i<r;++i){var e=n[i];try{var o=e.rules||e.cssRules;if(o)for(var s=0,a=o.length;s<a;++s){var u=o[s];if(5==u.type){var c=u.cssText.match(cT);aT[c[1].replace(hT,"")]=!0}}}catch(t){}}}return t in aT}var lT={},vT=oT.getNames();function dT(t){var n=t.toString();if(n in lT)return t;for(var i=t.map((function(t){var n=mS(t,1).split(" ");return[n.slice(3).join(" ").replace(/"/g,""),n[1]+n[0]]})),r=0,e=i.length;r<e;++r){var o=i[r],s=o[0];if(!fT(s)&&-1!==vT.indexOf(s)){var a="https://fonts.googleapis.com/css?family="+s.replace(/ /g,"+")+":"+o[1];if(!document.querySelector('link[href="'+a+'"]')){var u=document.createElement("link");u.href=a,u.rel="stylesheet",document.head.appendChild(u)}}}return lT[n]=!0,t}var pT=/^(.*)(\?.*)$/;function yT(t,n){return n&&0===t.indexOf(".")&&(t=n+t),t}function mT(t,n,i){var r=(t=yT(t,n)).match(pT);return r?r[1]+i+(r.length>2?r[2]:""):t+i}function wT(t,n,i,r,e){return new Promise((function(o,s){if("object"!=sT(n)&&(n=JSON.parse(n)),8!=n.version)return s(new Error("glStyle version 8 required."));if(!(t instanceof Nj||t instanceof sS))return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,u,c;function h(){c||n.sprite&&!a?c?(t.setStyle(c),o()):s(new Error("Something went wrong trying to apply style.")):(c=eT(t,n,i,e,a,u,dT),t.getStyle()?o():s(new Error("Nothing to show for source [".concat(i,"]"))))}if(n.sprite){var f=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",l=mT(n.sprite,r,f+".json");fetch(l,{credentials:"same-origin"}).then((function(t){return t.ok||""===f?t:(l=mT(n.sprite,r,".json"),fetch(l,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();s(new Error("Problem fetching sprite from ".concat(l,": ").concat(t.statusText)))})).then((function(t){if(void 0===t)return s(new Error("No sprites found."));a=t,u=mT(n.sprite,r,f+".png"),h()})).catch((function(t){s(new Error("Sprites cannot be loaded: ".concat(l,": ").concat(t.message)))}))}else h()}))}var bT={};function gT(t,n){var i={id:n.id,type:n.type},r={};function e(e){var o=n.layout||{},s=n.paint||{};i.paint=s;var a,u,c="function"==typeof t.getSource?t.getSource().getTileGrid().getZForResolution(e):t.getView().getZoom(),h="function"==typeof t.getTargetElement?t.getTargetElement():void 0;if(void 0!==s["background-color"]&&(a=$O(i,"paint","background-color",c,bT,r),h&&(h.style.background=Ek.parse(a).toString())),void 0!==s["background-opacity"]&&(u=$O(i,"paint","background-opacity",c,bT,r),h&&(h.style.opacity=u)),"none"!=o.visibility)return tT(a,u);h&&(h.style.backgroundColor="",h.style.opacity="")}if("function"==typeof t.getTargetElement)t.getTargetElement()&&e(),t.on(["change:resolution","change:target"],e);else{if("function"!=typeof t.setBackground)throw new Error("Unable to apply background.");t.setBackground(e)}}function xT(t){var n=t.bounds;if(n){var i=Or([n[0],n[1]]),r=Or([n[2],n[3]]);return[i[0],i[1],r[0],r[1]]}}function jT(t,n){t=AO({},t);var i=[n,JSON.stringify(t)].toString(),r=uT[i];return r||(r=new sx({url:t.tiles?void 0:n,tileJSON:t.tiles?t:void 0}),uT[i]=r),new Promise((function(t){var i=r.on("change",(function(){var e=r.getState();if("ready"===e){var o=r.getTileJSON(),s=Array.isArray(o.tiles)?o.tiles:[o.tiles];if(n)for(var a=0,u=s.length;a<u;++a)s[a]=decodeURI(new URL(s[a],n).href);var c=r.getTileGrid(),h=xT(o),f=o.minzoom||0,l=o.maxzoom||22,v=r.get("ol-source");void 0===v&&(v=new cg({attributions:r.getAttributions(),format:new eS,tileGrid:new Jh({origin:c.getOrigin(0),extent:h||c.getExtent(),minZoom:f,resolutions:RO.slice(0,l+1),tileSize:512}),urls:s}),r.set("ol-source",v)),nt(i),t(v)}else"error"===e&&(r.set("ol-source",null),nt(i),t(void 0))}));"ready"===r.getState()&&r.changed()}))}new yS;var ST=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kT="https://api.mapbox.com";function MT(t){var n="mapbox://";return 0!==t.indexOf(n)?"":t.slice(n.length)}function _T(t,n,i){var r=MT(t);if(!r)return decodeURI(new URL(t,i).href);var e="sprites/";if(0!==r.indexOf(e))throw new Error("unexpected sprites url: ".concat(t));var o=r.slice(e.length);return"".concat(kT,"/styles/v1/").concat(o,"/sprite?access_token=").concat(n)}function OT(t,n,i){var r=MT(t);if(!r)return decodeURI(new URL(t,i).href);var e="fonts/";if(0!==r.indexOf(e))throw new Error("unexpected fonts url: ".concat(t));var o=r.slice(e.length);return"".concat(kT,"/fonts/v1/").concat(o,"/0-255.pbf?access_token=").concat(n)}function TT(t,n){var i=MT(t);if(!i)return decodeURI(new URL(t,location.href).href);var r="styles/";if(0!==i.indexOf(r))throw new Error("unexpected style url: ".concat(t));var e=i.slice(r.length);return"".concat(kT,"/styles/v1/").concat(e,"?&access_token=").concat(n)}function ET(t,n,i,r){var e=new URL(t,r),o=MT(t);return o?"https://{a-d}.tiles.mapbox.com/v4/".concat(o,"/{z}/{x}/{y}.vector.pbf?access_token=").concat(n):n?(e.searchParams.set(i,n),decodeURI(e.href)):decodeURI(e.href)}var AT=function(t){function n(n){var i=t.call(this,z)||this;return i.error=n,i}return ST(n,t),n}(f),CT="vector",RT=function(t){function n(n){var i=this,r=!("declutter"in n)||n.declutter,e=new cg({state:ps,format:new eS});((i=t.call(this,{source:e,background:n.background,declutter:r,className:n.className,opacity:n.opacity,visible:n.visible,zIndex:n.zIndex,minResolution:n.minResolution,maxResolution:n.maxResolution,minZoom:n.minZoom,maxZoom:n.maxZoom,renderOrder:n.renderOrder,renderBuffer:n.renderBuffer,renderMode:n.renderMode,map:n.map,updateWhileAnimating:n.updateWhileAnimating,updateWhileInteracting:n.updateWhileInteracting,preload:n.preload,useInterimTilesOnError:n.useInterimTilesOnError,properties:n.properties})||this).dv=void 0===n.maxResolution&&void 0===n.minZoom,i.sourceId=n.source,i.layers=n.layers,n.accessToken)?i.accessToken=n.accessToken:new URL(n.styleUrl,location.href).searchParams.forEach((function(t,n){i.accessToken=t,i.pv=n}));return i.fetchStyle(n.styleUrl),i}return ST(n,t),n.prototype.fetchStyle=function(t){var n=this,i=TT(t,this.accessToken);fetch(i).then((function(t){if(!t.ok)throw new Error("unexpected response when fetching style: ".concat(t.status));return t.json()})).then((function(t){n.onStyleLoad(t,i.startsWith("data:")?location.href:i)})).catch((function(t){n.handleError(t)}))},n.prototype.onStyleLoad=function(t,n){var i,r,e=this;if(this.layers){for(var o={},s=0;s<t.layers.length;++s){var a=t.layers[s];a.source&&(o[a.id]=a.source)}var u=void 0;for(s=0;s<this.layers.length;++s){var c=o[this.layers[s]];if(!c)return void this.handleError(new Error("could not find source for ".concat(this.layers[s])));if(u){if(u!==c)return void this.handleError(new Error("layers can only use a single source, found ".concat(u," and ").concat(c)))}else u=c}i=u,r=this.layers}else i=this.sourceId,r=i;r||(i=Object.keys(t.sources)[0],r=i),t.sprite&&(t.sprite=_T(t.sprite,this.accessToken,n)),t.glyphs&&(t.glyphs=OT(t.glyphs,this.accessToken,n));var h=t.sources[i];if(h.type===CT){var f=this.getSource();h.url&&0===h.url.indexOf("mapbox://")?(f.setUrl(ET(h.url,this.accessToken,this.pv,n)),wT(this,t,r).then((function(){e.configureSource(f,t)})).catch((function(t){e.handleError(t)}))):(h.tiles&&(h.tiles=h.tiles.map((function(t){return ET(t,e.accessToken,e.pv,n)}))),jT(h,h.url?ET(h.url,this.accessToken,this.pv,n):void 0).then((function(n){wT(e,t,r).then((function(){e.configureSource(n,t)})).catch((function(i){e.configureSource(n,t),e.handleError(i)}))})))}else this.handleError(new Error("only works for vector sources, found ".concat(h.type)))},n.prototype.configureSource=function(t,n){var i,r=this.getSource();if(t!==r&&(r.setAttributions(t.getAttributions()),r.setTileUrlFunction(t.getTileUrlFunction()),r.setTileLoadFunction(t.getTileLoadFunction()),r.tileGrid=t.tileGrid),void 0===this.getBackground()&&(i=this,n.layers.some((function(t){if("background"==t.type)return gT(i,t),!0}))),this.dv){var e=r.getTileGrid();this.setMaxResolution(e.getResolution(e.getMinZoom()))}r.setState(ys)},n.prototype.handleError=function(t){this.dispatchEvent(new AT(t)),this.getSource().setState(ms)},n}(sS),PT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),IT=function(t){function n(n){var i=this,r=n||{},e=E({},r);return delete e.imageRatio,(i=t.call(this,e)||this).yv=void 0!==r.imageRatio?r.imageRatio:1,i}return PT(n,t),n.prototype.getImageRatio=function(){return this.yv},n.prototype.createRenderer=function(){return new hj(this)},n}(wx),NT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zT=function(t){function n(n){var i=this,r=E({},n);return(i=t.call(this,r)||this).mv=xv(n.style),i.wv=n.style.variables||{},i.bv=!!n.disableHitDetection,i}return NT(n,t),n.prototype.createRenderer=function(){return new gx(this,{vertexShader:this.mv.builder.getSymbolVertexShader(),fragmentShader:this.mv.builder.getSymbolFragmentShader(),hitVertexShader:!this.bv&&this.mv.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.bv&&this.mv.builder.getSymbolFragmentShader(!0),uniforms:this.mv.uniforms,attributes:this.mv.attributes})},n.prototype.updateStyleVariables=function(t){E(this.wv,t),this.changed()},n}(gs),FT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function LT(t,n){var i="\n attribute vec2 ".concat(zl.TEXTURE_COORD,";\n uniform mat4 ").concat(Nl.TILE_TRANSFORM,";\n uniform float ").concat(Nl.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(Nl.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(Nl.TEXTURE_RESOLUTION,";\n uniform float ").concat(Nl.TEXTURE_ORIGIN_X,";\n uniform float ").concat(Nl.TEXTURE_ORIGIN_Y,";\n uniform float ").concat(Nl.DEPTH,";\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ").concat(zl.TEXTURE_COORD,";\n v_mapCoord = vec2(\n ").concat(Nl.TEXTURE_ORIGIN_X," + ").concat(Nl.TEXTURE_RESOLUTION," * ").concat(Nl.TEXTURE_PIXEL_WIDTH," * v_textureCoord[0],\n ").concat(Nl.TEXTURE_ORIGIN_Y," - ").concat(Nl.TEXTURE_RESOLUTION," * ").concat(Nl.TEXTURE_PIXEL_HEIGHT," * v_textureCoord[1]\n );\n gl_Position = ").concat(Nl.TILE_TRANSFORM," * vec4(").concat(zl.TEXTURE_COORD,", ").concat(Nl.DEPTH,", 1.0);\n }\n "),r={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:n},e=[];if(void 0!==t.color){var o=ov(r,t.color,Xl);e.push("color = ".concat(o,";"))}if(void 0!==t.contrast){var s=ov(r,t.contrast,Wl);e.push("color.rgb = clamp((".concat(s," + 1.0) * color.rgb - (").concat(s," / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.exposure){var a=ov(r,t.exposure,Wl);e.push("color.rgb = clamp((".concat(a," + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.saturation){var u=ov(r,t.saturation,Wl);e.push("\n float saturation = ".concat(u," + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n "))}if(void 0!==t.gamma){var c=ov(r,t.gamma,Wl);e.push("color.rgb = pow(color.rgb, vec3(1.0 / ".concat(c,"));"))}if(void 0!==t.brightness){var h=ov(r,t.brightness,Wl);e.push("color.rgb = clamp(color.rgb + ".concat(h,", vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}var f={},l=r.variables.length;if(l>1&&!t.variables)throw new Error("Missing variables in style (expected ".concat(r.variables,")"));for(var v=function(n){var i=r.variables[n];if(!(i in t.variables))throw new Error("Missing '".concat(i,"' in style variables"));var e=pv(i);f[e]=function(){var n=t.variables[i];return"string"==typeof n&&(n=rv(r,n)),void 0!==n?n:-9999999}},d=0;d<l;++d)v(d);var p=Object.keys(f).map((function(t){return"uniform float ".concat(t,";")})),y=Math.ceil(n/4);p.push("uniform sampler2D ".concat(Nl.TILE_TEXTURE_ARRAY,"[").concat(y,"];")),r.paletteTextures&&p.push("uniform sampler2D ".concat(yv,"[").concat(r.paletteTextures.length,"];"));var m=Object.keys(r.functions).map((function(t){return r.functions[t]}));return{vertexShader:i,fragmentShader:"\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n uniform vec4 ".concat(Nl.RENDER_EXTENT,";\n uniform float ").concat(Nl.TRANSITION_ALPHA,";\n uniform float ").concat(Nl.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(Nl.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(Nl.RESOLUTION,";\n uniform float ").concat(Nl.ZOOM,";\n\n ").concat(p.join("\n"),"\n\n ").concat(m.join("\n"),"\n\n void main() {\n if (\n v_mapCoord[0] < ").concat(Nl.RENDER_EXTENT,"[0] ||\n v_mapCoord[1] < ").concat(Nl.RENDER_EXTENT,"[1] ||\n v_mapCoord[0] > ").concat(Nl.RENDER_EXTENT,"[2] ||\n v_mapCoord[1] > ").concat(Nl.RENDER_EXTENT,"[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(").concat(Nl.TILE_TEXTURE_ARRAY,"[0], v_textureCoord);\n\n ").concat(e.join("\n"),"\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ").concat(Nl.TRANSITION_ALPHA,";\n }"),uniforms:f,paletteTextures:r.paletteTextures}}var GT=function(t){function n(n){var i=this,r=n?E({},n):{},e=r.style||{};delete r.style;var o=r.cacheSize;return delete r.cacheSize,(i=t.call(this,r)||this).gv=r.sources,i.xv=null,i.If=NaN,i.K=e,i.$t=o,i.wv=i.K.variables||{},i.addChangeListener(es,i.jv),i}return FT(n,t),n.prototype.getSources=function(t,n){var i=this.getSource();return this.gv?"function"==typeof this.gv?this.gv(t,n):this.gv:i?[i]:[]},n.prototype.getRenderSource=function(){return this.xv||this.getSource()},n.prototype.getSourceState=function(){var t=this.getRenderSource();return t?t.getState():ds},n.prototype.jv=function(){this.getSource()&&this.setStyle(this.K)},n.prototype.Sv=function(){var t=this.getSource();return t&&"bandCount"in t?t.bandCount:4},n.prototype.createRenderer=function(){var t=LT(this.K,this.Sv());return new Bl(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.$t,paletteTextures:t.paletteTextures})},n.prototype.renderSources=function(t,n){for(var i,r=this.getRenderer(),e=0,o=n.length;e<o;++e)this.xv=n[e],r.prepareFrame(t)&&(i=r.renderFrame(t));return i},n.prototype.render=function(t,n){var i=this;this.rendered=!0;for(var r=t.viewState,e=this.getSources(t.extent,r.resolution),o=!0,s=function(t,n){var r=e[t],s=r.getState();if(s==ps){r.addEventListener("change",(function t(){r.getState()==ys&&(r.removeEventListener("change",t),i.changed())}))}o=o&&s==ys},a=0,u=e.length;a<u;++a)s(a);var c=this.renderSources(t,e);if(this.getRenderer().renderComplete&&o)return this.If=r.resolution,c;if(this.If>.5*r.resolution){var h=this.getSources(t.extent,this.If).filter((function(t){return!e.includes(t)}));if(h.length>0)return this.renderSources(t,h)}return c},n.prototype.setStyle=function(t){this.wv=t.variables||{},this.K=t;var n=LT(this.K,this.Sv());this.getRenderer().reset({vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms,paletteTextures:n.paletteTextures}),this.changed()},n.prototype.updateStyleVariables=function(t){E(this.wv,t),this.changed()},n}(Eg);GT.prototype.dispose;var DT=GT,UT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qT="addfeatures",BT=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.features=r,o.file=i,o.projection=e,o}return UT(n,t),n}(f),WT=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{handleEvent:k})||this).on,i.once,i.un,i.kv=!1,i.Mv=[];for(var e=r.formatConstructors?r.formatConstructors:[],o=0,s=e.length;o<s;++o){var a=e[o];"function"==typeof a&&(a=new a),i.Mv.push(a),i.kv=i.kv||a.getType()===uh}return i.di=r.projection?gr(r.projection):null,i._v=null,i.Ov=r.source||null,i.target=r.target?r.target:null,i}return UT(n,t),n.prototype.Tv=function(t,n){var i,r=n.target.result,e=this.getMap(),o=this.di;o||(o=e.getView().getProjection());for(var s=this.Mv,a=0,u=s.length;a<u;++a){var c=s[a],h=r;this.kv&&c.getType()!==uh&&(void 0===i&&(i=(new TextDecoder).decode(r)),h=i);var f=this.Ev(c,h,{featureProjection:o});if(f&&f.length>0){this.Ov&&(this.Ov.clear(),this.Ov.addFeatures(f)),this.dispatchEvent(new BT(qT,t,f,o));break}}},n.prototype.Av=function(){var t=this.getMap();if(t){var n=this.target?this.target:t.getViewport();this._v=[Y(n,B,this.handleDrop,this),Y(n,U,this.handleStop,this),Y(n,q,this.handleStop,this),Y(n,B,this.handleStop,this)]}},n.prototype.setActive=function(n){!this.getActive()&&n&&this.Av(),this.getActive()&&!n&&this.Cv(),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Cv(),t.prototype.setMap.call(this,n),this.getActive()&&this.Av()},n.prototype.Ev=function(t,n,i){try{return t.readFeatures(n,i)}catch(t){return null}},n.prototype.Cv=function(){this._v&&(this._v.forEach($),this._v=null)},n.prototype.handleDrop=function(t){for(var n=t.dataTransfer.files,i=0,r=n.length;i<r;++i){var e=n.item(i),o=new FileReader;o.addEventListener(X,this.Tv.bind(this,e)),this.kv?o.readAsArrayBuffer(e):o.readAsText(e)}},n.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},n}(_u),VT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),XT=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).Kr=r.condition?r.condition:qu,i.Zr=void 0,i.Rv=void 0,i.Oe=0,i.Lr=void 0!==r.duration?r.duration:400,i}return VT(n,t),n.prototype.handleDragEvent=function(t){if(Wu(t)){var n=t.map,i=n.getSize(),r=t.pixel,e=r[0]-i[0]/2,o=i[1]/2-r[1],s=Math.atan2(o,e),a=Math.sqrt(e*e+o*o),u=n.getView();if(void 0!==this.Zr){var c=this.Zr-s;u.adjustRotationInternal(c)}this.Zr=s,void 0!==this.Rv&&u.adjustResolutionInternal(this.Rv/a),void 0!==this.Rv&&(this.Oe=this.Rv/a),this.Rv=a}},n.prototype.handleUpEvent=function(t){if(!Wu(t))return!0;var n=t.map.getView(),i=this.Oe>1?1:-1;return n.endInteraction(this.Lr,i),this.Oe=0,!1},n.prototype.handleDownEvent=function(t){return!!Wu(t)&&(!!this.Kr(t)&&(t.map.getView().beginInteraction(),this.Zr=void 0,this.Rv=void 0,!0))},n}(Cu),HT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),JT=function(t){function n(n,i,r){var e=t.call(this)||this;if(void 0!==r&&void 0===i)e.setFlatCoordinates(r,n);else{var o=i||0;e.setCenterAndRadius(n,o,r)}return e}return HT(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=t-e[0],s=n-e[1],a=o*o+s*s;if(a<r){if(0===a)for(var u=0;u<this.stride;++u)i[u]=e[u];else{var c=this.getRadius()/Math.sqrt(a);i[0]=e[0]+c*o,i[1]=e[1]+c*s;for(u=2;u<this.stride;++u)i[u]=e[u]}return i.length=this.stride,a}return r},n.prototype.containsXY=function(t,n){var i=this.flatCoordinates,r=t-i[0],e=n-i[1];return r*r+e*e<=this.Pv()},n.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.computeExtent=function(t){var n=this.flatCoordinates,i=n[this.stride]-n[0];return Cn(n[0]-i,n[1]-i,n[0]+i,n[1]+i,t)},n.prototype.getRadius=function(){return Math.sqrt(this.Pv())},n.prototype.Pv=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],n=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+n*n},n.prototype.getType=function(){return Pt.CIRCLE},n.prototype.intersectsExtent=function(t){if(ni(t,this.getExtent())){var n=this.getCenter();return t[0]<=n[0]&&t[2]>=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Bn(t,this.intersectsCoordinate.bind(this)))}return!1},n.prototype.setCenter=function(t){var n=this.stride,i=this.flatCoordinates[n]-this.flatCoordinates[0],r=t.slice();r[n]=r[0]+i;for(var e=1;e<n;++e)r[n+e]=t[e];this.setFlatCoordinates(this.layout,r),this.changed()},n.prototype.setCenterAndRadius=function(t,n,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,e=ue(r,0,t,this.stride);r[e++]=r[0]+n;for(var o=1,s=this.stride;o<s;++o)r[e++]=r[o];r.length=e,this.changed()},n.prototype.getCoordinates=function(){return null},n.prototype.setCoordinates=function(t,n){},n.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},n.prototype.rotate=function(t,n){var i=this.getCenter(),r=this.getStride();this.setCenter(Vr(i,0,i.length,r,t,n,i)),this.changed()},n.prototype.translate=function(t,n){var i=this.getCenter(),r=this.getStride();this.setCenter(Hr(i,0,i.length,r,t,n,i)),this.changed()},n}(te);JT.prototype.transform;var KT=JT,YT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZT="Point",$T="LineString",QT="Polygon",tE="Circle",nE="drawstart",iE="drawend",rE="drawabort",eE=function(t){function n(n,i){var r=t.call(this,n)||this;return r.feature=i,r}return YT(n,t),n}(f);var oE=function(t){function n(n){var i=this,r=n;r.stopDown||(r.stopDown=M),(i=t.call(this,r)||this).on,i.once,i.un,i.Iv=!1,i.Nv=null,i.zv,i.Fv,i.Lv,i.Gv=!1,i.Ov=n.source?n.source:null,i.Le=n.features?n.features:null,i.Dv=n.snapTolerance?n.snapTolerance:12,i.nl=n.type,i.ye=function(t){switch(t){case Pt.POINT:case Pt.MULTI_POINT:return ZT;case Pt.LINE_STRING:case Pt.MULTI_LINE_STRING:return $T;case Pt.POLYGON:case Pt.MULTI_POLYGON:return QT;case Pt.CIRCLE:return tE;default:throw new Error("Invalid type: "+t)}}(i.nl),i.Uv=!!n.stopClick,i.qv=n.minPoints?n.minPoints:i.ye===QT?3:2,i.Bv=i.ye===tE?2:n.maxPoints?n.maxPoints:1/0,i.Wv=n.finishCondition?n.finishCondition:k;var e,o=n.geometryFunction;if(!o){var s,a=i.ye;if(a===tE)o=function(t,n,i){var r=n||new KT([NaN,NaN]),e=Fr(t[0],i),o=rr(e,Fr(t[t.length-1],i));r.setCenterAndRadius(e,Math.sqrt(o));var s=Nr();return s&&r.transform(i,s),r};else a===ZT?s=Te:a===$T?s=kj:a===QT&&(s=Ye),o=function(t,n,i){return n?a===QT?t[0].length?n.setCoordinates([t[0].concat([t[0][0]])]):n.setCoordinates([]):n.setCoordinates(t):n=new s(t),n}}return i.Va=o,i.Vv=void 0!==n.dragVertexDelay?n.dragVertexDelay:500,i.Xv=null,i.Hv=null,i.Jv=null,i.Kv=null,i.Yv=null,i.Zv=null,i.$v=n.clickTolerance?n.clickTolerance*n.clickTolerance:36,i.Qv=new Nj({source:new Fd({useSpatialIndex:!1,wrapX:!!n.wrapX&&n.wrapX}),style:n.style?n.style:(e=Zv(),function(t,n){return e[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.H=n.geometryName,i.Kr=n.condition?n.condition:Uu,i.td,n.freehand?i.td=Fu:i.td=n.freehandCondition?n.freehandCondition:qu,i.addChangeListener(ju,i.rd),i}return YT(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),this.rd()},n.prototype.getOverlay=function(){return this.Qv},n.prototype.handleEvent=function(n){n.originalEvent.type===L&&n.originalEvent.preventDefault(),this.Gv=this.ye!==ZT&&this.td(n);var i=n.type===pa.POINTERMOVE,r=!0;!this.Gv&&this.Fv&&n.type===pa.POINTERDRAG&&(Date.now()-this.Fv>=this.Vv?(this.Nv=n.pixel,this.Iv=!this.Gv,i=!0):this.Fv=void 0,this.Iv&&void 0!==this.zv&&(clearTimeout(this.zv),this.zv=void 0));return this.Gv&&n.type===pa.POINTERDRAG&&null!==this.Hv?(this.ed(n.coordinate),r=!1):this.Gv&&n.type===pa.POINTERDOWN?r=!1:i&&this.getPointerCount()<2?(r=n.type===pa.POINTERMOVE)&&this.Gv?(this.Jn(n),this.Iv&&n.originalEvent.preventDefault()):("mouse"===n.originalEvent.pointerType||n.type===pa.POINTERDRAG&&void 0===this.zv)&&this.Jn(n):n.type===pa.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,n)&&r},n.prototype.handleDownEvent=function(t){return this.Iv=!this.Gv,this.Gv?(this.Nv=t.pixel,this.Xv||this.od(t.coordinate),!0):this.Kr(t)?(this.Fv=Date.now(),this.zv=setTimeout(function(){this.Jn(new da(pa.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.Vv),this.Nv=t.pixel,!0):(this.Fv=void 0,!1)},n.prototype.handleUpEvent=function(t){var n=!0;if(0===this.getPointerCount())if(this.zv&&(clearTimeout(this.zv),this.zv=void 0),this.Jn(t),this.Iv){var i=!this.Xv;i&&this.od(t.coordinate),!i&&this.Gv?this.finishDrawing():this.Gv||i&&this.ye!==ZT||(this.sd(t.pixel)?this.Wv(t)&&this.finishDrawing():this.ed(t.coordinate)),n=!1}else this.Gv&&this.abortDrawing();return!n&&this.Uv&&t.preventDefault(),n},n.prototype.Jn=function(t){if(this.Lv=t.originalEvent.pointerType,this.Nv&&(!this.Gv&&this.Iv||this.Gv&&!this.Iv)){var n=this.Nv,i=t.pixel,r=n[0]-i[0],e=n[1]-i[1],o=r*r+e*e;if(this.Iv=this.Gv?o>this.$v:o<=this.$v,!this.Iv)return}this.Xv?this.ad(t.coordinate):this.ud(t.coordinate.slice())},n.prototype.sd=function(t){var n=!1;if(this.Hv){var i=!1,r=[this.Xv],e=this.ye;if(e===ZT)n=!0;else if(e===tE)n=2===this.Kv.length;else if(e===$T)i=this.Kv.length>this.qv;else if(e===QT){var o=this.Kv;i=o[0].length>this.qv,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),a=0,u=r.length;a<u;a++){var c=r[a],h=s.getPixelFromCoordinate(c),f=t[0]-h[0],l=t[1]-h[1],v=this.Gv?1:this.Dv;if(n=Math.sqrt(f*f+l*l)<=v){this.Xv=c;break}}}return n},n.prototype.ud=function(t){this.Jv?this.Jv.getGeometry().setCoordinates(t):(this.Jv=new Tt(new Te(t)),this.hd())},n.prototype.fd=function(t){this.Yv||(this.Yv=new Tt);var n=t.getLinearRing(0),i=this.Yv.getGeometry();i?(i.setFlatCoordinates(n.getLayout(),n.getFlatCoordinates()),i.changed()):(i=new kj(n.getFlatCoordinates(),n.getLayout()),this.Yv.setGeometry(i))},n.prototype.od=function(t){var n=this.getMap().getView().getProjection();this.Xv=t,this.ye===ZT?this.Kv=t.slice():this.ye===QT?(this.Kv=[[t.slice(),t.slice()]],this.Zv=this.Kv[0]):this.Kv=[t.slice(),t.slice()],this.Zv&&(this.Yv=new Tt(new kj(this.Zv)));var i=this.Va(this.Kv,void 0,n);this.Hv=new Tt,this.H&&this.Hv.setGeometryName(this.H),this.Hv.setGeometry(i),this.hd(),this.dispatchEvent(new eE(nE,this.Hv))},n.prototype.ad=function(t){var n,i,r=this.getMap(),e=this.Hv.getGeometry(),o=r.getView().getProjection();(this.ye===ZT?i=this.Kv:this.ye===QT?(i=(n=this.Kv[0])[n.length-1],this.sd(r.getPixelFromCoordinate(t))&&(t=this.Xv.slice())):i=(n=this.Kv)[n.length-1],i[0]=t[0],i[1]=t[1],this.Va(this.Kv,e,o),this.Jv)&&this.Jv.getGeometry().setCoordinates(t);if(e.getType()===Pt.POLYGON&&this.ye!==QT)this.fd(e);else if(this.Zv){this.Yv.getGeometry().setCoordinates(this.Zv)}this.hd()},n.prototype.ed=function(t){var n,i,r=this.Hv.getGeometry(),e=this.getMap().getView().getProjection(),o=this.ye;o===$T||o===tE?(this.Xv=t.slice(),(i=this.Kv).length>=this.Bv&&(this.Gv?i.pop():n=!0),i.push(t.slice()),this.Va(i,r,e)):o===QT&&((i=this.Kv[0]).length>=this.Bv&&(this.Gv?i.pop():n=!0),i.push(t.slice()),n&&(this.Xv=i[0]),this.Va(this.Kv,r,e)),this.ud(t.slice()),this.hd(),n&&this.finishDrawing()},n.prototype.removeLastPoint=function(){if(this.Hv){var t,n=this.Hv.getGeometry(),i=this.getMap().getView().getProjection(),r=this.ye;if(r===$T||r===tE){if((t=this.Kv).splice(-2,1),t.length>=2){this.Xv=t[t.length-2].slice();var e=this.Xv.slice();t[t.length-1]=e,this.ud(e)}this.Va(t,n,i),n.getType()===Pt.POLYGON&&this.Yv&&this.fd(n)}else if(r===QT){(t=this.Kv[0]).splice(-2,1);var o=this.Yv.getGeometry();if(t.length>=2){e=t[t.length-2].slice();t[t.length-1]=e,this.ud(e)}o.setCoordinates(t),this.Va(this.Kv,n,i)}1===t.length&&this.abortDrawing(),this.hd()}},n.prototype.finishDrawing=function(){var t=this.ld();if(t){var n=this.Kv,i=t.getGeometry(),r=this.getMap().getView().getProjection();this.ye===$T?(n.pop(),this.Va(n,i,r)):this.ye===QT&&(n[0].pop(),this.Va(n,i,r),n=i.getCoordinates()),this.nl===Pt.MULTI_POINT?t.setGeometry(new bj([n])):this.nl===Pt.MULTI_LINE_STRING?t.setGeometry(new _j([n])):this.nl===Pt.MULTI_POLYGON&&t.setGeometry(new Ej([n])),this.dispatchEvent(new eE(iE,t)),this.Le&&this.Le.push(t),this.Ov&&this.Ov.addFeature(t)}},n.prototype.ld=function(){this.Xv=null;var t=this.Hv;return this.Hv=null,this.Jv=null,this.Yv=null,this.Qv.getSource().clear(!0),t},n.prototype.abortDrawing=function(){var t=this.ld();t&&this.dispatchEvent(new eE(rE,t))},n.prototype.appendCoordinates=function(t){var n,i=this.ye,r=!this.Hv;if(r&&this.od(t[0]),i===$T||i===tE)n=this.Kv;else{if(i!==QT)return;n=this.Kv&&this.Kv.length?this.Kv[0]:[]}r&&n.shift(),n.pop();for(var e=0;e<t.length;e++)this.ed(t[e]);var o=t[t.length-1];this.ed(o),this.ad(o)},n.prototype.extend=function(t){var n=t.getGeometry();this.Hv=t,this.Kv=n.getCoordinates();var i=this.Kv[this.Kv.length-1];this.Xv=i.slice(),this.Kv.push(i.slice()),this.Jv=new Tt(new Te(i)),this.hd(),this.dispatchEvent(new eE(nE,this.Hv))},n.prototype.hd=function(){var t=[];this.Hv&&t.push(this.Hv),this.Yv&&t.push(this.Yv),this.Jv&&t.push(this.Jv);var n=this.Qv.getSource();n.clear(!0),n.addFeatures(t)},n.prototype.rd=function(){var t=this.getMap(),n=this.getActive();t&&n||this.abortDrawing(),this.Qv.setMap(n?t:null)},n}(Cu),sE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),aE="extentchanged",uE=function(t){function n(n){var i=t.call(this,aE)||this;return i.extent=n,i}return sE(n,t),n}(f);function cE(){var t=Zv();return function(n,i){return t[Pt.POINT]}}function hE(t){return function(n){return jn([t,n])}}function fE(t,n){return t[0]==n[0]?function(i){return jn([t,[i[0],n[1]]])}:t[1]==n[1]?function(i){return jn([t,[n[0],i[1]]])}:null}var lE=function(t){function n(n){var i,r=this,e=n||{};return(r=t.call(this,e)||this).on,r.once,r.un,r.Kr=e.condition?e.condition:Fu,r.st=null,r.vd=null,r.dd=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.yd=!1,r.md=null,r.wd=null,n||(n={}),r.bd=new Nj({source:new Fd({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.boxStyle?n.boxStyle:(i=Zv(),function(t,n){return i[Pt.POLYGON]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.gd=new Nj({source:new Fd({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.pointerStyle?n.pointerStyle:cE(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.extent&&r.setExtent(n.extent),r}return sE(n,t),n.prototype.xd=function(t,n){var i=n.getCoordinateFromPixelInternal(t),r=this.getExtentInternal();if(r){var e=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(r);e.sort((function(t,n){return or(i,t)-or(i,n)}));var o=e[0],s=Zi(i,o),a=n.getPixelFromCoordinateInternal(s);if(er(t,a)<=this.dd){var u=n.getPixelFromCoordinateInternal(o[0]),c=n.getPixelFromCoordinateInternal(o[1]),h=rr(a,u),f=rr(a,c),l=Math.sqrt(Math.min(h,f));return this.yd=l<=this.dd,this.yd&&(s=h>f?o[1]:o[0]),s}}return null},n.prototype.Jn=function(t){var n=t.pixel,i=t.map,r=this.xd(n,i);r||(r=i.getCoordinateFromPixelInternal(n)),this.jd(r)},n.prototype.Sd=function(t){var n=this.md;return n?t?n.setGeometry($e(t)):n.setGeometry(void 0):(n=new Tt(t?$e(t):{}),this.md=n,this.bd.getSource().addFeature(n)),n},n.prototype.jd=function(t){var n=this.wd;n?n.getGeometry().setCoordinates(t):(n=new Tt(new Te(t)),this.wd=n,this.gd.getSource().addFeature(n));return n},n.prototype.handleEvent=function(n){return!n.originalEvent||!this.Kr(n)||(n.type!=pa.POINTERMOVE||this.handlingDownUpSequence||this.Jn(n),t.prototype.handleEvent.call(this,n),!1)},n.prototype.handleDownEvent=function(t){var n=t.pixel,i=t.map,r=this.getExtentInternal(),e=this.xd(n,i),o=function(t){var n=null,i=null;return t[0]==r[0]?n=r[2]:t[0]==r[2]&&(n=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==n&&null!==i?[n,i]:null};if(e&&r){var s=e[0]==r[0]||e[0]==r[2]?e[0]:null,a=e[1]==r[1]||e[1]==r[3]?e[1]:null;null!==s&&null!==a?this.vd=hE(o(e)):null!==s?this.vd=fE(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.vd=fE(o([r[0],a]),o([r[2],a])))}else e=i.getCoordinateFromPixelInternal(n),this.setExtent([e[0],e[1],e[0],e[1]]),this.vd=hE(e);return!0},n.prototype.handleDragEvent=function(t){if(this.vd){var n=t.coordinate;this.setExtent(this.vd(n)),this.jd(n)}},n.prototype.handleUpEvent=function(t){this.vd=null;var n=this.getExtentInternal();return n&&0!==Wn(n)||this.setExtent(null),!1},n.prototype.setMap=function(n){this.bd.setMap(n),this.gd.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getExtent=function(){return Lr(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.st},n.prototype.setExtent=function(t){this.st=t||null,this.Sd(t),this.dispatchEvent(new uE(this.st))},n}(Cu);function vE(t){return(vE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var dE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pE=[0,0,0,0],yE=[],mE="modifystart",wE="modifyend",bE=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.features=i,e.mapBrowserEvent=r,e}return dE(n,t),n}(f);function gE(t,n){return t.index-n.index}function xE(t,n,i){var r=n.geometry;if(r.getType()===Pt.CIRCLE){var e=r;if(1===n.index){var o=Nr();o&&(e=e.clone().transform(o,i));var s=rr(e.getCenter(),Fr(t,i)),a=Math.sqrt(s)-e.getRadius();return a*a}}var u=Fr(t,i);return yE[0]=Fr(n.segment[0],i),yE[1]=Fr(n.segment[1],i),or(u,yE)}function jE(t,n,i){var r=n.geometry;if(r.getType()===Pt.CIRCLE&&1===n.index){var e=r,o=Nr();return o&&(e=e.clone().transform(o,i)),zr(e.getClosestPoint(Fr(t,i)),i)}var s=Fr(t,i);return yE[0]=Fr(n.segment[0],i),yE[1]=Fr(n.segment[1],i),zr(Zi(s,yE),i)}var SE=function(t){function n(n){var i,r,e=t.call(this,n)||this;if(e.on,e.once,e.un,e.kd=e.Ku.bind(e),e.Kr=n.condition?n.condition:Vu,e.Md=function(t){return Pu(t)&&Du(t)},e._d=n.deleteCondition?n.deleteCondition:e.Md,e.Od=n.insertVertexCondition?n.insertVertexCondition:Fu,e.wd=null,e.Td=null,e.Ed=[0,0],e.Ad=!1,e.Cd=null,e.Rd=new od,e.dd=void 0!==n.pixelTolerance?n.pixelTolerance:10,e.yd=!1,e.Pd=!1,e.Id=[],e.Qv=new Nj({source:new Fd({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.style?n.style:(i=Zv(),function(t,n){return i[Pt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.Nd={Point:e.zd.bind(e),LineString:e.Fd.bind(e),LinearRing:e.Fd.bind(e),Polygon:e.Ld.bind(e),MultiPoint:e.Gd.bind(e),MultiLineString:e.Dd.bind(e),MultiPolygon:e.Ud.bind(e),Circle:e.qd.bind(e),GeometryCollection:e.Bd.bind(e)},e.Ov=null,e.Wd=null,n.features?r=n.features:n.source&&(e.Ov=n.source,r=new ft(e.Ov.getFeatures()),e.Ov.addEventListener(Td,e.Vd.bind(e)),e.Ov.addEventListener(Cd,e.Xd.bind(e))),!r)throw new Error("The modify interaction requires features, a source or a layer");return n.hitDetection&&(e.Wd=n.hitDetection),e.Le=r,e.Le.forEach(e.Hd.bind(e)),e.Le.addEventListener(st,e.Jd.bind(e)),e.Le.addEventListener(at,e.Kd.bind(e)),e.Yd=null,e.Br=[0,0],e.Zd=void 0===n.snapToPointer?!e.Wd:n.snapToPointer,e}return dE(n,t),n.prototype.Hd=function(t){var n=t.getGeometry();if(n){var i=this.Nd[n.getType()];i&&i(t,n)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.$d(this.Ed,r),t.addEventListener(N,this.kd)},n.prototype.Qd=function(t,n){if(!this.Cd){this.Cd=new ft;for(var i=this.Cd.getArray(),r=0,e=n.length;r<e;++r)for(var o=n[r],s=0,a=o.length;s<a;++s){var u=o[s].feature;u&&-1===i.indexOf(u)&&this.Cd.push(u)}0===this.Cd.getLength()?this.Cd=null:this.dispatchEvent(new bE(mE,this.Cd,t))}},n.prototype.tp=function(t){this.np(t),this.wd&&0===this.Le.getLength()&&(this.Qv.getSource().removeFeature(this.wd),this.wd=null),t.removeEventListener(N,this.kd)},n.prototype.np=function(t){var n=this.Rd,i=[];n.forEach((function(n){t===n.feature&&i.push(n)}));for(var r=i.length-1;r>=0;--r){for(var e=i[r],o=this.Id.length-1;o>=0;--o)this.Id[o][0]===e&&this.Id.splice(o,1);n.remove(e)}},n.prototype.setActive=function(n){this.wd&&!n&&(this.Qv.getSource().removeFeature(this.wd),this.wd=null),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Qv.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getOverlay=function(){return this.Qv},n.prototype.Vd=function(t){t.feature&&this.Le.push(t.feature)},n.prototype.Xd=function(t){t.feature&&this.Le.remove(t.feature)},n.prototype.Jd=function(t){this.Hd(t.element)},n.prototype.Ku=function(t){if(!this.Pd){var n=t.target;this.tp(n),this.Hd(n)}},n.prototype.Kd=function(t){var n=t.element;this.tp(n)},n.prototype.zd=function(t,n){var i=n.getCoordinates(),r={feature:t,geometry:n,segment:[i,i]};this.Rd.insert(n.getExtent(),r)},n.prototype.Gd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r){var o=i[r],s={feature:t,geometry:n,depth:[r],index:r,segment:[o,o]};this.Rd.insert(n.getExtent(),s)}},n.prototype.Fd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length-1;r<e;++r){var o=i.slice(r,r+2),s={feature:t,geometry:n,index:r,segment:o};this.Rd.insert(jn(o),s)}},n.prototype.Dd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),c={feature:t,geometry:n,depth:[r],index:s,segment:u};this.Rd.insert(jn(u),c)}},n.prototype.Ld=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),c={feature:t,geometry:n,depth:[r],index:s,segment:u};this.Rd.insert(jn(u),c)}},n.prototype.Ud=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var u=o[s],c=0,h=u.length-1;c<h;++c){var f=u.slice(c,c+2),l={feature:t,geometry:n,depth:[s,r],index:c,segment:f};this.Rd.insert(jn(f),l)}},n.prototype.qd=function(t,n){var i=n.getCenter(),r={feature:t,geometry:n,index:0,segment:[i,i]},e={feature:t,geometry:n,index:1,segment:[i,i]},o=[r,e];r.featureSegments=o,e.featureSegments=o,this.Rd.insert(Pn(i),r);var s=n,a=Nr();if(a&&this.getMap()){var u=this.getMap().getView().getProjection();s=Qe(s=s.clone().transform(a,u)).transform(u,a)}this.Rd.insert(s.getExtent(),e)},n.prototype.Bd=function(t,n){for(var i=n.getGeometriesArray(),r=0;r<i.length;++r){var e=i[r];(0,this.Nd[e.getType()])(t,e)}},n.prototype.ip=function(t,n,i){var r=this.wd;r?r.getGeometry().setCoordinates(t):(r=new Tt(new Te(t)),this.wd=r,this.Qv.getSource().addFeature(r));return r.set("features",n),r.set("geometries",i),r},n.prototype.handleEvent=function(n){return!n.originalEvent||(this.Yd=n,n.map.getView().getInteracting()||n.type!=pa.POINTERMOVE||this.handlingDownUpSequence||this.Jn(n),this.wd&&this._d(n)&&(i=!(n.type!=pa.SINGLECLICK||!this.Ad)||this.removePoint()),n.type==pa.SINGLECLICK&&(this.Ad=!1),t.prototype.handleEvent.call(this,n)&&!i);var i},n.prototype.handleDragEvent=function(t){this.Ad=!1,this.Qd(t,this.Id);for(var n=[t.coordinate[0]+this.Br[0],t.coordinate[1]+this.Br[1]],i=[],r=[],e=0,o=this.Id.length;e<o;++e){var s=this.Id[e],a=s[0],u=a.feature;-1===i.indexOf(u)&&i.push(u);var c=a.geometry;-1===r.indexOf(c)&&r.push(c);for(var h=a.depth,f=void 0,l=a.segment,v=s[1];n.length<c.getStride();)n.push(l[v][n.length]);switch(c.getType()){case Pt.POINT:f=n,l[0]=n,l[1]=n;break;case Pt.MULTI_POINT:(f=c.getCoordinates())[a.index]=n,l[0]=n,l[1]=n;break;case Pt.LINE_STRING:(f=c.getCoordinates())[a.index+v]=n,l[v]=n;break;case Pt.MULTI_LINE_STRING:case Pt.POLYGON:(f=c.getCoordinates())[h[0]][a.index+v]=n,l[v]=n;break;case Pt.MULTI_POLYGON:(f=c.getCoordinates())[h[1]][h[0]][a.index+v]=n,l[v]=n;break;case Pt.CIRCLE:if(l[0]=n,l[1]=n,0===a.index)this.Pd=!0,c.setCenter(n),this.Pd=!1;else{this.Pd=!0;var d=t.map.getView().getProjection(),p=er(Fr(c.getCenter(),d),Fr(n,d)),y=Nr();if(y){var m=c.clone().transform(y,d);m.setRadius(p),p=m.transform(d,y).getRadius()}c.setRadius(p),this.Pd=!1}}f&&this.rp(c,f)}this.ip(n,i,r)},n.prototype.handleDownEvent=function(t){if(!this.Kr(t))return!1;var n=t.coordinate;this.$d(t.pixel,t.map,n),this.Id.length=0,this.Cd=null;var i=this.wd;if(i){var r=t.map.getView().getProjection(),e=[],s=i.getGeometry().getCoordinates(),a=jn([s]),u=this.Rd.getInExtent(a),c={};u.sort(gE);for(var h=0,f=u.length;h<f;++h){var l=u[h],v=l.segment,d=o(l.geometry),p=l.depth;if(p&&(d+="-"+p.join("-")),c[d]||(c[d]=new Array(2)),l.geometry.getType()!==Pt.CIRCLE||1!==l.index)if(!tr(v[0],s)||c[d][0])if(!tr(v[1],s)||c[d][1])o(v)in this.Td&&!c[d][0]&&!c[d][1]&&this.Od(t)&&e.push(l);else{if((l.geometry.getType()===Pt.LINE_STRING||l.geometry.getType()===Pt.MULTI_LINE_STRING)&&c[d][0]&&0===c[d][0].index)continue;this.Id.push([l,1]),c[d][1]=l}else this.Id.push([l,0]),c[d][0]=l;else tr(jE(n,l,r),s)&&!c[d][0]&&(this.Id.push([l,0]),c[d][0]=l)}e.length&&this.Qd(t,[e]);for(var y=e.length-1;y>=0;--y)this.ep(e[y],s)}return!!this.wd},n.prototype.handleUpEvent=function(t){for(var n=this.Id.length-1;n>=0;--n){var i=this.Id[n][0],r=i.geometry;if(r.getType()===Pt.CIRCLE){var e=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=e,o.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.Rd.update(Pn(e),o);var a=r,u=Nr();if(u){var c=t.map.getView().getProjection();a=Qe(a=a.clone().transform(u,c)).transform(c,u)}this.Rd.update(a.getExtent(),s)}else this.Rd.update(jn(i.segment),i)}return this.Cd&&(this.dispatchEvent(new bE(wE,this.Cd,t)),this.Cd=null),!1},n.prototype.Jn=function(t){this.Ed=t.pixel,this.$d(t.pixel,t.map,t.coordinate)},n.prototype.$d=function(t,n,i){var r,e,s=this,a=i||n.getCoordinateFromPixel(t),u=n.getView().getProjection();if(this.Wd){var c="object"===vE(this.Wd)?function(t){return t===s.Wd}:void 0;n.forEachFeatureAtPixel(t,(function(t,n,i){if((i=i||t.getGeometry()).getType()===Pt.POINT&&y(s.Le.getArray(),t)){e=i;var o=i.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:i,segment:[o,o]}]}return!0}),{layerFilter:c})}if(!r){var h=Lr(Sn(Gr(Pn(a,pE),u),n.getView().getResolution()*this.dd,pE),u);r=this.Rd.getInExtent(h)}if(r&&r.length>0){var f=r.sort((function(t,n){return xE(a,t,u)-xE(a,n,u)}))[0],l=f.segment,v=jE(a,f,u),d=n.getPixelFromCoordinate(v),p=er(t,d);if(e||p<=this.dd){var m={};if(m[o(l)]=!0,this.Zd||(this.Br[0]=v[0]-a[0],this.Br[1]=v[1]-a[1]),f.geometry.getType()===Pt.CIRCLE&&1===f.index)this.yd=!0,this.ip(v,[f.feature],[f.geometry]);else{var w=n.getPixelFromCoordinate(l[0]),b=n.getPixelFromCoordinate(l[1]),g=rr(d,w),x=rr(d,b);p=Math.sqrt(Math.min(g,x)),this.yd=p<=this.dd,this.yd&&(v=g>x?l[1]:l[0]),this.ip(v,[f.feature],[f.geometry]);var j={};j[o(f.geometry)]=!0;for(var S=1,k=r.length;S<k;++S){var M=r[S].segment;if(!(tr(l[0],M[0])&&tr(l[1],M[1])||tr(l[0],M[1])&&tr(l[1],M[0])))break;var _=o(r[S].geometry);_ in j||(j[_]=!0,m[o(M)]=!0)}}return void(this.Td=m)}}this.wd&&(this.Qv.getSource().removeFeature(this.wd),this.wd=null)},n.prototype.ep=function(t,n){for(var i,r=t.segment,e=t.feature,o=t.geometry,s=t.depth,a=t.index;n.length<o.getStride();)n.push(0);switch(o.getType()){case Pt.MULTI_LINE_STRING:case Pt.POLYGON:(i=o.getCoordinates())[s[0]].splice(a+1,0,n);break;case Pt.MULTI_POLYGON:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,n);break;case Pt.LINE_STRING:(i=o.getCoordinates()).splice(a+1,0,n);break;default:return}this.rp(o,i);var u=this.Rd;u.remove(t),this.op(o,a,s,1);var c={segment:[r[0],n],feature:e,geometry:o,depth:s,index:a};u.insert(jn(c.segment),c),this.Id.push([c,1]);var h={segment:[n,r[1]],feature:e,geometry:o,depth:s,index:a+1};u.insert(jn(h.segment),h),this.Id.push([h,0]),this.Ad=!0},n.prototype.removePoint=function(){if(this.Yd&&this.Yd.type!=pa.POINTERDRAG){var t=this.Yd;this.Qd(t,this.Id);var n=this.sp();return this.Cd&&this.dispatchEvent(new bE(wE,this.Cd,t)),this.Cd=null,n}return!1},n.prototype.sp=function(){var t,n,i,r,e,s,a,u,c,h,f,l=this.Id,v={},d=!1;for(e=l.length-1;e>=0;--e)f=o((h=(i=l[e])[0]).feature),h.depth&&(f+="-"+h.depth.join("-")),f in v||(v[f]={}),0===i[1]?(v[f].right=h,v[f].index=h.index):1==i[1]&&(v[f].left=h,v[f].index=h.index+1);for(f in v){switch(c=v[f].right,a=v[f].left,(u=(s=v[f].index)-1)<0&&(u=0),t=n=(r=(h=void 0!==a?a:c).geometry).getCoordinates(),d=!1,r.getType()){case Pt.MULTI_LINE_STRING:n[h.depth[0]].length>2&&(n[h.depth[0]].splice(s,1),d=!0);break;case Pt.LINE_STRING:n.length>2&&(n.splice(s,1),d=!0);break;case Pt.MULTI_POLYGON:t=t[h.depth[1]];case Pt.POLYGON:(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),u=t.length-1))}if(d){this.rp(r,n);var p=[];if(void 0!==a&&(this.Rd.remove(a),p.push(a.segment[0])),void 0!==c&&(this.Rd.remove(c),p.push(c.segment[1])),void 0!==a&&void 0!==c){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:u,segment:p};this.Rd.insert(jn(y.segment),y)}this.op(r,s,h.depth,-1),this.wd&&(this.Qv.getSource().removeFeature(this.wd),this.wd=null),l.length=0}}return d},n.prototype.rp=function(t,n){this.Pd=!0,t.setCoordinates(n),this.Pd=!1},n.prototype.op=function(t,n,i,r){this.Rd.forEachInExtent(t.getExtent(),(function(e){e.geometry===t&&(void 0===i||void 0===e.depth||x(e.depth,i))&&e.index>n&&(e.index+=r)}))},n}(Cu),kE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ME="select",_E=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.selected=i,o.deselected=r,o.mapBrowserEvent=e,o}return kE(n,t),n}(f),OE={};var TE=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r,e,o=n||{};if(i.ap=i.Hd.bind(i),i.up=i.tp.bind(i),i.Kr=o.condition?o.condition:Du,i.cp=o.addCondition?o.addCondition:Gu,i.hp=o.removeCondition?o.removeCondition:Gu,i.fp=o.toggleCondition?o.toggleCondition:qu,i.lp=!!o.multi&&o.multi,i.vp=o.filter?o.filter:k,i.dp=o.hitTolerance?o.hitTolerance:0,i.K=void 0!==o.style?o.style:(b((r=Zv())[Pt.POLYGON],r[Pt.LINE_STRING]),b(r[Pt.GEOMETRY_COLLECTION],r[Pt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.Le=o.features||new ft,o.layers)if("function"==typeof o.layers)e=o.layers;else{var s=o.layers;e=function(t){return y(s,t)}}else e=k;return i.pp=e,i.yp={},i}return kE(n,t),n.prototype.mp=function(t,n){this.yp[o(t)]=n},n.prototype.getFeatures=function(){return this.Le},n.prototype.getHitTolerance=function(){return this.dp},n.prototype.getLayer=function(t){return this.yp[o(t)]},n.prototype.setHitTolerance=function(t){this.dp=t},n.prototype.setMap=function(n){this.getMap()&&this.K&&this.Le.forEach(this.wp.bind(this)),t.prototype.setMap.call(this,n),n?(this.Le.addEventListener(st,this.ap),this.Le.addEventListener(at,this.up),this.K&&this.Le.forEach(this.bp.bind(this))):(this.Le.removeEventListener(st,this.ap),this.Le.removeEventListener(at,this.up))},n.prototype.Hd=function(t){var n=t.element;if(this.K&&this.bp(n),!this.getLayer(n)){var i=this.getMap().getAllLayers().find((function(t){if(t instanceof Nj&&t.getSource()&&t.getSource().hasFeature(n))return t}));i&&this.mp(n,i)}},n.prototype.tp=function(t){var n=t.element;this.K&&this.wp(n)},n.prototype.getStyle=function(){return this.K},n.prototype.bp=function(t){var n=o(t);n in OE||(OE[n]=t.getStyle()),t.setStyle(this.K)},n.prototype.wp=function(t){for(var i=this.getMap().getInteractions().getArray(),r=i.length-1;r>=0;--r){var e=i[r];if(e!==this&&e instanceof n&&e.getStyle()&&-1!==e.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(e.getStyle())}var s=o(t);t.setStyle(OE[s]),delete OE[s]},n.prototype.gp=function(t){delete this.yp[o(t)]},n.prototype.handleEvent=function(t){if(!this.Kr(t))return!0;var n=this.cp(t),i=this.hp(t),r=this.fp(t),e=!n&&!i&&!r,o=t.map,s=this.getFeatures(),a=[],u=[];if(e){A(this.yp),o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.vp(t,n))return this.mp(t,n),u.push(t),!this.lp}.bind(this),{layerFilter:this.pp,hitTolerance:this.dp});for(var c=s.getLength()-1;c>=0;--c){var h=s.item(c),f=u.indexOf(h);f>-1?u.splice(f,1):(s.remove(h),a.push(h))}0!==u.length&&s.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.vp(t,e))return!n&&!r||y(s.getArray(),t)?(i||r)&&y(s.getArray(),t)&&(a.push(t),this.gp(t)):(this.mp(t,e),u.push(t)),!this.lp}.bind(this),{layerFilter:this.pp,hitTolerance:this.dp});for(var l=a.length-1;l>=0;--l)s.remove(a[l]);s.extend(u)}return(u.length>0||a.length>0)&&this.dispatchEvent(new _E(ME,u,a,t)),!0},n}(_u),EE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function AE(t){return t.feature?t.feature:t.element?t.element:void 0}var CE=[],RE=function(t){function n(n){var i=this,r=n||{},e=r;return e.handleDownEvent||(e.handleDownEvent=k),e.stopDown||(e.stopDown=M),(i=t.call(this,e)||this).Ov=r.source?r.source:null,i.xp=void 0===r.vertex||r.vertex,i.jp=void 0===r.edge||r.edge,i.Le=r.features?r.features:null,i.Sp=[],i.kp={},i.Mp={},i._p={},i.dd=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.Rd=new od,i.Op={Point:i.Tp.bind(i),LineString:i.Ep.bind(i),LinearRing:i.Ep.bind(i),Polygon:i.Ap.bind(i),MultiPoint:i.Cp.bind(i),MultiLineString:i.Rp.bind(i),MultiPolygon:i.Pp.bind(i),GeometryCollection:i.Ip.bind(i),Circle:i.Np.bind(i)},i}return EE(n,t),n.prototype.addFeature=function(t,n){var i=void 0===n||n,r=o(t),e=t.getGeometry();if(e){var s=this.Op[e.getType()];if(s){this.Mp[r]=e.getExtent([1/0,1/0,-1/0,-1/0]);var a=[];if(s(a,e),1===a.length)this.Rd.insert(jn(a[0]),{feature:t,segment:a[0]});else if(a.length>1){var u=a.map((function(t){return jn(t)})),c=a.map((function(n){return{feature:t,segment:n}}));this.Rd.load(u,c)}}}i&&(this.kp[r]=Y(t,N,this.Ku,this))},n.prototype.zp=function(t){this.addFeature(t)},n.prototype.Fp=function(t){this.removeFeature(t)},n.prototype.Lp=function(){var t;return this.Le?t=this.Le:this.Ov&&(t=this.Ov.getFeatures()),t},n.prototype.handleEvent=function(n){var i=this.snapTo(n.pixel,n.coordinate,n.map);return i&&(n.coordinate=i.vertex.slice(0,2),n.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,n)},n.prototype.Jd=function(t){var n=AE(t);this.addFeature(n)},n.prototype.Kd=function(t){var n=AE(t);this.removeFeature(n)},n.prototype.Ku=function(t){var n=t.target;if(this.handlingDownUpSequence){var i=o(n);i in this._p||(this._p[i]=n)}else this.Gp(n)},n.prototype.handleUpEvent=function(t){var n=C(this._p);return n.length&&(n.forEach(this.Gp.bind(this)),this._p={}),!1},n.prototype.removeFeature=function(t,n){var i=void 0===n||n,r=o(t),e=this.Mp[r];if(e){var s=this.Rd,a=[];s.forEachInExtent(e,(function(n){t===n.feature&&a.push(n)}));for(var u=a.length-1;u>=0;--u)s.remove(a[u])}i&&($(this.kp[r]),delete this.kp[r])},n.prototype.setMap=function(n){var i=this.getMap(),r=this.Sp,e=this.Lp();i&&(r.forEach($),r.length=0,e.forEach(this.Fp.bind(this))),t.prototype.setMap.call(this,n),n&&(this.Le?r.push(Y(this.Le,st,this.Jd,this),Y(this.Le,at,this.Kd,this)):this.Ov&&r.push(Y(this.Ov,Td,this.Jd,this),Y(this.Ov,Cd,this.Kd,this)),e.forEach(this.zp.bind(this)))},n.prototype.snapTo=function(t,n,i){var r=jn([i.getCoordinateFromPixel([t[0]-this.dd,t[1]+this.dd]),i.getCoordinateFromPixel([t[0]+this.dd,t[1]-this.dd])]),e=this.Rd.getInExtent(r),o=e.length;if(0===o)return null;var s,a=i.getView().getProjection(),u=Fr(n,a),c=1/0,h=this.dd*this.dd,f=function(){if(s){var n=i.getPixelFromCoordinate(s);if(rr(t,n)<=h)return{vertex:s,vertexPixel:[Math.round(n[0]),Math.round(n[1])]}}return null};if(this.xp){for(var l=0;l<o;++l){(v=e[l]).feature.getGeometry().getType()!==Pt.CIRCLE&&v.segment.forEach((function(t){var n=Fr(t,a),i=rr(u,n);i<c&&(s=t,c=i)}))}if(x=f())return x}if(this.jp){for(l=0;l<o;++l){var v,d=null;if((v=e[l]).feature.getGeometry().getType()===Pt.CIRCLE){var p=v.feature.getGeometry(),y=Nr();y&&(p=p.clone().transform(y,a)),d=zr(Yi(u,p),a)}else{var m=v.segment,w=m[0],b=m[1];b&&(CE[0]=Fr(w,a),CE[1]=Fr(b,a),d=Zi(u,CE))}if(d){var g=rr(u,d);g<c&&(s=d,c=g)}}var x;if(x=f())return x}return null},n.prototype.Gp=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},n.prototype.Np=function(t,n){var i=this.getMap().getView().getProjection(),r=n,e=Nr();e&&(r=r.clone().transform(e,i));var o=Qe(r);e&&o.transform(i,e);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a<u;++a)t.push(s.slice(a,a+2))},n.prototype.Ip=function(t,n){for(var i=n.getGeometriesArray(),r=0;r<i.length;++r){var e=this.Op[i[r].getType()];e&&e(t,i[r])}},n.prototype.Ep=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length-1;r<e;++r)t.push(i.slice(r,r+2))},n.prototype.Rp=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},n.prototype.Cp=function(t,n){n.getCoordinates().forEach((function(n){t.push([n])}))},n.prototype.Pp=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var u=o[s],c=0,h=u.length-1;c<h;++c)t.push(u.slice(c,c+2))},n.prototype.Tp=function(t,n){t.push([n.getCoordinates()])},n.prototype.Ap=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},n}(Cu),PE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),IE="translatestart",NE="translating",zE="translateend",FE=function(t){function n(n,i,r,e,o){var s=t.call(this,n)||this;return s.features=i,s.coordinate=r,s.startCoordinate=e,s.mapBrowserEvent=o,s}return PE(n,t),n}(f),LE=function(t){function n(n){var i,r=this,e=n||{};if((r=t.call(this,e)||this).on,r.once,r.un,r.Dp=null,r.Up=null,r.Le=void 0!==e.features?e.features:null,e.layers&&!r.Le)if("function"==typeof e.layers)i=e.layers;else{var o=e.layers;i=function(t){return y(o,t)}}else i=k;return r.pp=i,r.vp=e.filter&&!r.Le?e.filter:k,r.dp=e.hitTolerance?e.hitTolerance:0,r.Kr=e.condition?e.condition:Fu,r.qp=null,r.addChangeListener(ju,r.Bp),r}return PE(n,t),n.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.Kr(t))return!1;if(this.qp=this.Wp(t.pixel,t.map),!this.Dp&&this.qp){this.Up=t.coordinate,this.Dp=t.coordinate,this.handleMoveEvent(t);var n=this.Le||new ft([this.qp]);return this.dispatchEvent(new FE(IE,n,t.coordinate,this.Up,t)),!0}return!1},n.prototype.handleUpEvent=function(t){if(this.Dp){this.Dp=null,this.handleMoveEvent(t);var n=this.Le||new ft([this.qp]);return this.dispatchEvent(new FE(zE,n,t.coordinate,this.Up,t)),this.Up=null,!0}return!1},n.prototype.handleDragEvent=function(t){if(this.Dp){var n=t.coordinate,i=n[0]-this.Dp[0],r=n[1]-this.Dp[1],e=this.Le||new ft([this.qp]);e.forEach((function(t){var n=t.getGeometry();n.translate(i,r),t.setGeometry(n)})),this.Dp=n,this.dispatchEvent(new FE(NE,e,n,this.Up,t))}},n.prototype.handleMoveEvent=function(t){var n=t.map.getViewport();this.Wp(t.pixel,t.map)?(n.classList.remove(this.Dp?"ol-grab":"ol-grabbing"),n.classList.add(this.Dp?"ol-grabbing":"ol-grab")):n.classList.remove("ol-grab","ol-grabbing")},n.prototype.Wp=function(t,n){return n.forEachFeatureAtPixel(t,function(t,n){if(this.vp(t,n)&&(!this.Le||y(this.Le.getArray(),t)))return t}.bind(this),{layerFilter:this.pp,hitTolerance:this.dp})},n.prototype.getHitTolerance=function(){return this.dp},n.prototype.setHitTolerance=function(t){this.dp=t},n.prototype.setMap=function(n){var i=this.getMap();t.prototype.setMap.call(this,n),this.rd(i)},n.prototype.Bp=function(){this.rd(null)},n.prototype.rd=function(t){var n=this.getMap(),i=this.getActive();n&&i||(n=n||t)&&n.getViewport().classList.remove("ol-grab","ol-grabbing")},n}(Cu);function GE(t,n,i,r,e,o){var s,a;void 0!==e?(s=e,a=void 0!==o?o:0):(s=[],a=0);for(var u=n;u<i;){var c=t[u++];s[a++]=t[u++],s[a++]=c;for(var h=2;h<r;++h)s[a++]=t[u++]}return s.length=a,s}var DE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),UE={};UE[Pt.POINT]=function(t){var n;n=void 0!==t.m&&void 0!==t.z?new Te([t.x,t.y,t.z,t.m],Rt):void 0!==t.z?new Te([t.x,t.y,t.z],At):void 0!==t.m?new Te([t.x,t.y,t.m],Ct):new Te([t.x,t.y]);return n},UE[Pt.LINE_STRING]=function(t){var n=WE(t);return new kj(t.paths[0],n)},UE[Pt.POLYGON]=function(t){var n=WE(t);return new Ye(t.rings,n)},UE[Pt.MULTI_POINT]=function(t){var n=WE(t);return new bj(t.points,n)},UE[Pt.MULTI_LINE_STRING]=function(t){var n=WE(t);return new _j(t.paths,n)},UE[Pt.MULTI_POLYGON]=function(t){var n=WE(t);return new Ej(t.rings,n)};var qE={};function BE(t,n){var i,r,e;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)e=Pt.POINT;else if(t.points)e=Pt.MULTI_POINT;else if(t.paths){e=1===t.paths.length?Pt.LINE_STRING:Pt.MULTI_LINE_STRING}else if(t.rings){var o=t,s=WE(o),a=function(t,n){var i,r,e=[],o=[],s=[];for(i=0,r=t.length;i<r;++i){e.length=0,ce(e,0,t[i],n.length),qe(e,0,e.length,n.length)?o.push([t[i]]):s.push(t[i])}for(;s.length;){var a=s.shift(),u=!1;for(i=o.length-1;i>=0;i--){var c=o[i][0];if(On(new _e(c).getExtent(),new _e(a).getExtent())){o[i].push(a),u=!0;break}}u||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(e=Pt.POLYGON,t=E({},t,((i={}).rings=a[0],i))):(e=Pt.MULTI_POLYGON,t=E({},t,((r={}).rings=a,r)))}return Yj((0,UE[e])(t),!1,n)}function WE(t){var n=Et;return!0===t.hasZ&&!0===t.hasM?n=Rt:!0===t.hasZ?n=At:!0===t.hasM&&(n=Ct),n}function VE(t){var n=t.getLayout();return{hasZ:n===At||n===Rt,hasM:n===Ct||n===Rt}}function XE(t,n){return(0,qE[t.getType()])(Yj(t,!0,n),n)}qE[Pt.POINT]=function(t,n){var i,r=t.getCoordinates(),e=t.getLayout();e===At?i={x:r[0],y:r[1],z:r[2]}:e===Ct?i={x:r[0],y:r[1],m:r[2]}:e===Rt?i={x:r[0],y:r[1],z:r[2],m:r[3]}:e===Et?i={x:r[0],y:r[1]}:Mt(!1,34);return i},qE[Pt.LINE_STRING]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},qE[Pt.POLYGON]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},qE[Pt.MULTI_POINT]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},qE[Pt.MULTI_LINE_STRING]=function(t,n){var i=VE(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},qE[Pt.MULTI_POLYGON]=function(t,n){for(var i=VE(t),r=t.getCoordinates(!1),e=[],o=0;o<r.length;o++)for(var s=r[o].length-1;s>=0;s--)e.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:e}};var HE=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).H=r.geometryName,i}return DE(n,t),n.prototype.readFeatureFromObject=function(t,n,i){var r=t,e=BE(r.geometry,n),o=new Tt;if(this.H&&o.setGeometryName(this.H),o.setGeometry(e),r.attributes){o.setProperties(r.attributes,!0);var s=r.attributes[i];void 0!==s&&o.setId(s)}return o},n.prototype.readFeaturesFromObject=function(t,n){var i=n||{};if(t.features){for(var r=[],e=t.features,o=0,s=e.length;o<s;++o)r.push(this.readFeatureFromObject(e[o],i,t.objectIdFieldName));return r}return[this.readFeatureFromObject(t,i)]},n.prototype.readGeometryFromObject=function(t,n){return BE(t,n)},n.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?gr("EPSG:"+t.spatialReference.wkid):null},n.prototype.writeGeometryObject=function(t,n){return XE(t,this.adaptOptions(n))},n.prototype.writeFeatureObject=function(t,n){n=this.adaptOptions(n);var i={};if(!t.hasProperties())return i.attributes={},i;var r=t.getProperties(),e=t.getGeometry();if(e){i.geometry=XE(e,n);var o=n&&(n.dataProjection||n.featureProjection);o&&(i.geometry.spatialReference={wkid:Number(gr(o).getCode().split(":").pop())}),delete r[t.getGeometryName()]}return R(r)?i.attributes={}:i.attributes=r,i},n.prototype.writeFeaturesObject=function(t,n){n=this.adaptOptions(n);for(var i=[],r=0,e=t.length;r<e;++r)i.push(this.writeFeatureObject(t[r],n));return{features:i}},n}(lS),JE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),KE=function(t){function n(){var n=t.call(this)||this;return n.Vp=Df(),n}return JE(n,t),n.prototype.getType=function(){return fh},n.prototype.readFeature=function(t,n){if(t){if("string"==typeof t){var i=Sf(t);return this.readFeatureFromDocument(i,n)}return xf(t)?this.readFeatureFromDocument(t,n):this.readFeatureFromNode(t,n)}return null},n.prototype.readFeatureFromDocument=function(t,n){var i=this.readFeaturesFromDocument(t,n);return i.length>0?i[0]:null},n.prototype.readFeatureFromNode=function(t,n){return null},n.prototype.readFeatures=function(t,n){if(t){if("string"==typeof t){var i=Sf(t);return this.readFeaturesFromDocument(i,n)}return xf(t)?this.readFeaturesFromDocument(t,n):this.readFeaturesFromNode(t,n)}return[]},n.prototype.readFeaturesFromDocument=function(t,n){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&b(i,this.readFeaturesFromNode(r,n));return i},n.prototype.readFeaturesFromNode=function(t,n){return r()},n.prototype.readGeometry=function(t,n){if(t){if("string"==typeof t){var i=Sf(t);return this.readGeometryFromDocument(i,n)}return xf(t)?this.readGeometryFromDocument(t,n):this.readGeometryFromNode(t,n)}return null},n.prototype.readGeometryFromDocument=function(t,n){return null},n.prototype.readGeometryFromNode=function(t,n){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readProjectionFromDocument(n)}return xf(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){var i=this.writeFeatureNode(t,n);return this.Vp.serializeToString(i)},n.prototype.writeFeatureNode=function(t,n){return null},n.prototype.writeFeatures=function(t,n){var i=this.writeFeaturesNode(t,n);return this.Vp.serializeToString(i)},n.prototype.writeFeaturesNode=function(t,n){return null},n.prototype.writeGeometry=function(t,n){var i=this.writeGeometryNode(t,n);return this.Vp.serializeToString(i)},n.prototype.writeGeometryNode=function(t,n){return null},n}(Kj),YE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZE="http://www.opengis.net/gml",$E=/^[\s\xa0]*$/,QE=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.featureType=r.featureType,i.featureNS=r.featureNS,i.srsName=r.srsName,i.schemaLocation="",i.FEATURE_COLLECTION_PARSERS={},i.FEATURE_COLLECTION_PARSERS[i.namespace]={featureMember:Mf(i.readFeaturesInternal),featureMembers:_f(i.readFeaturesInternal)},i.supportedMediaTypes=["application/gml+xml"],i}return YE(n,t),n.prototype.readFeaturesInternal=function(t,n){var i=t.localName,r=null;if("FeatureCollection"==i)r=zf([],this.FEATURE_COLLECTION_PARSERS,t,n,this);else if("featureMembers"==i||"featureMember"==i||"member"==i){var e=n[0],o=e.featureType,s=e.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,u=t.childNodes.length;a<u;++a){var c=t.childNodes[a];if(1===c.nodeType){var h=c.nodeName.split(":").pop();if(-1===o.indexOf(h)){var f="",l=0,v=c.namespaceURI;for(var d in s){if(s[d]===v){f=d;break}++l}f||(s[f="p"+l]=v),o.push(f+":"+h)}}}"featureMember"!=i&&(e.featureType=o,e.featureNS=s)}if("string"==typeof s){var p=s;(s={}).p0=p}var y={},m=Array.isArray(o)?o:[o];for(var w in s){var b={};for(a=0,u=m.length;a<u;++a){(-1===m[a].indexOf(":")?"p0":m[a].split(":")[0])===w&&(b[m[a].split(":").pop()]="featureMembers"==i?Mf(this.readFeatureElement,this):_f(this.readFeatureElement,this))}y[s[w]]=b}r=zf("featureMember"==i||"member"==i?void 0:[],y,t,n)}return null===r&&(r=[]),r},n.prototype.readGeometryOrExtent=function(t,n){var i=n[0];return i.srsName=t.firstElementChild.getAttribute("srsName"),i.srsDimension=t.firstElementChild.getAttribute("srsDimension"),zf(null,this.GEOMETRY_PARSERS,t,n,this)},n.prototype.readExtentElement=function(t,n){var i=n[0],r=this.readGeometryOrExtent(t,n);return r?Zj(r,i):void 0},n.prototype.readGeometryElement=function(t,n){var i=n[0],r=this.readGeometryOrExtent(t,n);return r?Yj(r,!1,i):void 0},n.prototype.readFeatureElementInternal=function(t,n,i){for(var r,e={},o=t.firstElementChild;o;o=o.nextElementSibling){var s=void 0,a=o.localName;0===o.childNodes.length||1===o.childNodes.length&&(3===o.firstChild.nodeType||4===o.firstChild.nodeType)?(s=bf(o,!1),$E.test(s)&&(s=void 0)):(i&&(s="boundedBy"===a?this.readExtentElement(o,n):this.readGeometryElement(o,n)),s?"boundedBy"!==a&&(r=a):s=this.readFeatureElementInternal(o,n,!1)),e[a]?(e[a]instanceof Array||(e[a]=[e[a]]),e[a].push(s)):e[a]=s;var u=o.attributes.length;if(u>0){e[a]={Xp:e[a]};for(var c=0;c<u;c++){var h=o.attributes[c].name;e[a][h]=o.attributes[c].value}}}if(i){var f=new Tt(e);r&&f.setGeometryName(r);var l=t.getAttribute("fid")||jf(t,this.namespace,"id");return l&&f.setId(l),f}return e},n.prototype.readFeatureElement=function(t,n){return this.readFeatureElementInternal(t,n,!0)},n.prototype.readPoint=function(t,n){var i=this.readFlatCoordinatesFromNode(t,n);if(i)return new Te(i,At)},n.prototype.readMultiPoint=function(t,n){var i=zf([],this.MULTIPOINT_PARSERS,t,n,this);return i?new bj(i):void 0},n.prototype.readMultiLineString=function(t,n){var i=zf([],this.MULTILINESTRING_PARSERS,t,n,this);if(i)return new _j(i)},n.prototype.readMultiPolygon=function(t,n){var i=zf([],this.MULTIPOLYGON_PARSERS,t,n,this);if(i)return new Ej(i)},n.prototype.pointMemberParser=function(t,n){Nf(this.POINTMEMBER_PARSERS,t,n,this)},n.prototype.lineStringMemberParser=function(t,n){Nf(this.LINESTRINGMEMBER_PARSERS,t,n,this)},n.prototype.polygonMemberParser=function(t,n){Nf(this.POLYGONMEMBER_PARSERS,t,n,this)},n.prototype.readLineString=function(t,n){var i=this.readFlatCoordinatesFromNode(t,n);return i?new kj(i,At):void 0},n.prototype.readFlatLinearRing=function(t,n){var i=zf(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,n,this);return i||void 0},n.prototype.readLinearRing=function(t,n){var i=this.readFlatCoordinatesFromNode(t,n);if(i)return new _e(i,At)},n.prototype.readPolygon=function(t,n){var i=zf([null],this.FLAT_LINEAR_RINGS_PARSERS,t,n,this);if(i&&i[0]){var r,e=i[0],o=[e.length],s=void 0;for(s=1,r=i.length;s<r;++s)b(e,i[s]),o.push(e.length);return new Ye(e,At,o)}},n.prototype.readFlatCoordinatesFromNode=function(t,n){return zf(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,n,this)},n.prototype.readGeometryFromNode=function(t,n){var i=this.readGeometryElement(t,[this.getReadOptions(t,n||{})]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){var i={featureType:this.featureType,featureNS:this.featureNS};return n&&E(i,this.getReadOptions(t,n)),this.readFeaturesInternal(t,[i])||[]},n.prototype.readProjectionFromNode=function(t){return gr(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},n}(KE);QE.prototype.namespace=ZE,QE.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},QE.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},QE.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},QE.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:Mf(QE.prototype.pointMemberParser),pointMembers:Mf(QE.prototype.pointMemberParser)}},QE.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:Mf(QE.prototype.lineStringMemberParser),lineStringMembers:Mf(QE.prototype.lineStringMemberParser)}},QE.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:Mf(QE.prototype.polygonMemberParser),polygonMembers:Mf(QE.prototype.polygonMemberParser)}},QE.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:Mf(QE.prototype.readFlatCoordinatesFromNode)}},QE.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:Mf(QE.prototype.readLineString)}},QE.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:Mf(QE.prototype.readPolygon)}},QE.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:_f(QE.prototype.readFlatLinearRing)}};var tA=QE;function nA(t){return iA(bf(t,!1))}function iA(t){var n=/^\s*(true|1)|(false|0)\s*$/.exec(t);return n?void 0!==n[1]||!1:void 0}function rA(t){var n=bf(t,!1),i=Date.parse(n);return isNaN(i)?void 0:i/1e3}function eA(t){return oA(bf(t,!1))}function oA(t){var n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return n?parseFloat(n[1]):void 0}function sA(t){return aA(bf(t,!1))}function aA(t){var n=/^\s*(\d+)\s*$/.exec(t);return n?parseInt(n[1],10):void 0}function uA(t){return bf(t,!1).trim()}function cA(t,n){dA(t,n?"1":"0")}function hA(t,n){t.appendChild(qf().createCDATASection(n))}function fA(t,n){var i=new Date(1e3*n),r=i.getUTCFullYear()+"-"+Hi(i.getUTCMonth()+1,2)+"-"+Hi(i.getUTCDate(),2)+"T"+Hi(i.getUTCHours(),2)+":"+Hi(i.getUTCMinutes(),2)+":"+Hi(i.getUTCSeconds(),2)+"Z";t.appendChild(qf().createTextNode(r))}function lA(t,n){var i=n.toPrecision();t.appendChild(qf().createTextNode(i))}function vA(t,n){var i=n.toString();t.appendChild(qf().createTextNode(i))}function dA(t,n){t.appendChild(qf().createTextNode(n))}var pA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yA={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},mA=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).FEATURE_COLLECTION_PARSERS[ZE].featureMember=Mf(i.readFeaturesInternal),i.schemaLocation=r.schemaLocation?r.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",i}return pA(n,t),n.prototype.readFlatCoordinates=function(t,n){var i=bf(t,!1).replace(/^\s*|\s*$/g,""),r=n[0].srsName,e="enu";if(r){var o=gr(r);o&&(e=o.getAxisOrientation())}for(var s=i.trim().split(/\s+/),a=[],u=0,c=s.length;u<c;u++){var h=s[u].split(/,+/),f=parseFloat(h[0]),l=parseFloat(h[1]),v=3===h.length?parseFloat(h[2]):0;"en"===e.substr(0,2)?a.push(f,l,v):a.push(l,f,v)}return a},n.prototype.readBox=function(t,n){var i=zf([null],this.Hp,t,n,this);return Cn(i[1][0],i[1][1],i[1][3],i[1][4])},n.prototype.innerBoundaryIsParser=function(t,n){var i=zf(void 0,this.RING_PARSERS,t,n,this);i&&n[n.length-1].push(i)},n.prototype.outerBoundaryIsParser=function(t,n){var i=zf(void 0,this.RING_PARSERS,t,n,this);i&&(n[n.length-1][0]=i)},n.prototype.Jp=function(t,n,i){var r,e=n[n.length-1],o=e.multiSurface,s=e.surface,a=e.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"MultiLineString"===r&&!0===a&&(r="MultiCurve"),wf("http://www.opengis.net/gml",r)},n.prototype.writeFeatureElement=function(t,n,i){var r=n.getId();r&&t.setAttribute("fid",r);var e=i[i.length-1],o=e.featureNS,s=n.getGeometryName();e.serializers||(e.serializers={},e.serializers[o]={});var a=[],u=[];if(n.hasProperties()){var c=n.getProperties();for(var h in c){var f=c[h];null!==f&&(a.push(h),u.push(f),h==s||"function"==typeof f.getSimplifiedGeometry?h in e.serializers[o]||(e.serializers[o][h]=Ef(this.writeGeometryElement,this)):h in e.serializers[o]||(e.serializers[o][h]=Ef(dA)))}}var l=E({},e);l.node=t,Lf(l,e.serializers,Cf(void 0,o),u,i,a)},n.prototype.writeCurveOrLineString=function(t,n,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var e=this.Kp(t.namespaceURI);t.appendChild(e),this.Yp(e,n,i)}else if("Curve"===t.nodeName){var o=wf(t.namespaceURI,"segments");t.appendChild(o),this.Zp(o,n,i)}},n.prototype.writeLineStringOrCurveMember=function(t,n,i){var r=this.Jp(n,i);r&&(t.appendChild(r),this.writeCurveOrLineString(r,n,i))},n.prototype.writeMultiCurveOrLineString=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=n.getLineStrings();Lf({node:t,hasZ:e,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.$p,a,i,void 0,this)},n.prototype.writeGeometryElement=function(t,n,i){var r,e=i[i.length-1],o=E({},e);o.node=t,r=Array.isArray(n)?Zj(n,e):Yj(n,!0,e),Lf(o,this.GEOMETRY_SERIALIZERS,this.Jp,[r],i,void 0,this)},n.prototype.Kp=function(t){var n=wf(t,"coordinates");return n.setAttribute("decimal","."),n.setAttribute("cs",","),n.setAttribute("ts"," "),n},n.prototype.Yp=function(t,n,i){for(var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=n.getCoordinates(),a=s.length,u=new Array(a),c=0;c<a;++c){var h=s[c];u[c]=this.Qp(h,o,e)}dA(t,u.join(" "))},n.prototype.Zp=function(t,n,i){var r=wf(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString(r,n,i)},n.prototype.writeSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=n.getLinearRings();Lf({node:t,hasZ:e,srsName:o},this.RING_SERIALIZERS,this.ty,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=wf(t.namespaceURI,"patches");t.appendChild(a),this.ny(a,n,i)}},n.prototype.ty=function(t,n,i){var r=n[n.length-1],e=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),wf(e.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},n.prototype.ny=function(t,n,i){var r=wf(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)},n.prototype.writeRing=function(t,n,i){var r=wf(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing(r,n,i)},n.prototype.Qp=function(t,n,i){var r="enu";n&&(r=gr(n).getAxisOrientation());var e="en"===r.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];i&&(e+=","+(t[2]||0));return e},n.prototype.writePoint=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=this.Kp(t.namespaceURI);t.appendChild(s);var a=n.getCoordinates();dA(s,this.Qp(a,o,e))},n.prototype.writeMultiPoint=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=n.getPoints();Lf({node:t,hasZ:e,srsName:o},this.POINTMEMBER_SERIALIZERS,Cf("pointMember"),s,i,void 0,this)},n.prototype.writePointMember=function(t,n,i){var r=wf(t.namespaceURI,"Point");t.appendChild(r),this.writePoint(r,n,i)},n.prototype.writeLinearRing=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=this.Kp(t.namespaceURI);t.appendChild(e),this.Yp(e,n,i)},n.prototype.writeMultiSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=n.getPolygons();Lf({node:t,hasZ:e,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.$p,a,i,void 0,this)},n.prototype.writeSurfaceOrPolygonMember=function(t,n,i){var r=this.Jp(n,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))},n.prototype.writeEnvelope=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=[n[0]+" "+n[1],n[2]+" "+n[3]];Lf({node:t},this.ENVELOPE_SERIALIZERS,Rf,e,i,["lowerCorner","upperCorner"],this)},n.prototype.$p=function(t,n,i){var r=n[n.length-1].node;return wf("http://www.opengis.net/gml",yA[r.nodeName])},n}(tA);mA.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:_f(mA.prototype.readFlatCoordinates)}},mA.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:mA.prototype.innerBoundaryIsParser,outerBoundaryIs:mA.prototype.outerBoundaryIsParser}},mA.prototype.Hp={"http://www.opengis.net/gml":{coordinates:Mf(mA.prototype.readFlatCoordinates)}},mA.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:_f(tA.prototype.readPoint),MultiPoint:_f(tA.prototype.readMultiPoint),LineString:_f(tA.prototype.readLineString),MultiLineString:_f(tA.prototype.readMultiLineString),LinearRing:_f(tA.prototype.readLinearRing),Polygon:_f(tA.prototype.readPolygon),MultiPolygon:_f(tA.prototype.readMultiPolygon),Box:_f(mA.prototype.readBox)}},mA.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:Ef(mA.prototype.writeCurveOrLineString),MultiCurve:Ef(mA.prototype.writeMultiCurveOrLineString),Point:Ef(mA.prototype.writePoint),MultiPoint:Ef(mA.prototype.writeMultiPoint),LineString:Ef(mA.prototype.writeCurveOrLineString),MultiLineString:Ef(mA.prototype.writeMultiCurveOrLineString),LinearRing:Ef(mA.prototype.writeLinearRing),Polygon:Ef(mA.prototype.writeSurfaceOrPolygon),MultiPolygon:Ef(mA.prototype.writeMultiSurfaceOrPolygon),Surface:Ef(mA.prototype.writeSurfaceOrPolygon),MultiSurface:Ef(mA.prototype.writeMultiSurfaceOrPolygon),Envelope:Ef(mA.prototype.writeEnvelope)}},mA.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:Ef(mA.prototype.writeLineStringOrCurveMember),curveMember:Ef(mA.prototype.writeLineStringOrCurveMember)}},mA.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:Ef(mA.prototype.writeRing),innerBoundaryIs:Ef(mA.prototype.writeRing)}},mA.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:Ef(mA.prototype.writePointMember)}},mA.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:Ef(mA.prototype.writeSurfaceOrPolygonMember),polygonMember:Ef(mA.prototype.writeSurfaceOrPolygonMember)}},mA.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:Ef(dA),upperCorner:Ef(dA)}};var wA=mA,bA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gA={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},xA=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).iy=void 0!==r.surface&&r.surface,i.ey=void 0!==r.curve&&r.curve,i.oy=void 0===r.multiCurve||r.multiCurve,i.sy=void 0===r.multiSurface||r.multiSurface,i.schemaLocation=r.schemaLocation?r.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",i.hasZ=void 0!==r.hasZ&&r.hasZ,i}return bA(n,t),n.prototype.readMultiCurve=function(t,n){var i=zf([],this.MULTICURVE_PARSERS,t,n,this);return i?new _j(i):void 0},n.prototype.readMultiSurface=function(t,n){var i=zf([],this.MULTISURFACE_PARSERS,t,n,this);if(i)return new Ej(i)},n.prototype.curveMemberParser=function(t,n){Nf(this.CURVEMEMBER_PARSERS,t,n,this)},n.prototype.surfaceMemberParser=function(t,n){Nf(this.SURFACEMEMBER_PARSERS,t,n,this)},n.prototype.readPatch=function(t,n){return zf([null],this.PATCHES_PARSERS,t,n,this)},n.prototype.readSegment=function(t,n){return zf([null],this.SEGMENTS_PARSERS,t,n,this)},n.prototype.readPolygonPatch=function(t,n){return zf([null],this.FLAT_LINEAR_RINGS_PARSERS,t,n,this)},n.prototype.readLineStringSegment=function(t,n){return zf([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,n,this)},n.prototype.interiorParser=function(t,n){var i=zf(void 0,this.RING_PARSERS,t,n,this);i&&n[n.length-1].push(i)},n.prototype.exteriorParser=function(t,n){var i=zf(void 0,this.RING_PARSERS,t,n,this);i&&(n[n.length-1][0]=i)},n.prototype.readSurface=function(t,n){var i=zf([null],this.SURFACE_PARSERS,t,n,this);if(i&&i[0]){var r,e=i[0],o=[e.length],s=void 0;for(s=1,r=i.length;s<r;++s)b(e,i[s]),o.push(e.length);return new Ye(e,At,o)}},n.prototype.readCurve=function(t,n){var i=zf([null],this.CURVE_PARSERS,t,n,this);return i?new kj(i,At):void 0},n.prototype.readEnvelope=function(t,n){var i=zf([null],this.ENVELOPE_PARSERS,t,n,this);return Cn(i[1][0],i[1][1],i[2][0],i[2][1])},n.prototype.readFlatPos=function(t,n){for(var i,r=bf(t,!1),e=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];i=e.exec(r);)o.push(parseFloat(i[1])),r=r.substr(i[0].length);if(""===r){var s=n[0].srsName,a="enu";if(s)a=gr(s).getAxisOrientation();if("neu"===a){var u,c=void 0;for(c=0,u=o.length;c<u;c+=3){var h=o[c],f=o[c+1];o[c]=f,o[c+1]=h}}var l=o.length;if(2==l&&o.push(0),0!==l)return o}},n.prototype.readFlatPosList=function(t,n){var i=bf(t,!1).replace(/^\s*|\s*$/g,""),r=n[0],e=r.srsName,o=r.srsDimension,s="enu";e&&(s=gr(e).getAxisOrientation());var a,u,c,h=i.split(/\s+/),f=2;t.getAttribute("srsDimension")?f=aA(t.getAttribute("srsDimension")):t.getAttribute("dimension")?f=aA(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?f=aA(t.parentNode.getAttribute("srsDimension")):o&&(f=aA(o));for(var l=[],v=0,d=h.length;v<d;v+=f)a=parseFloat(h[v]),u=parseFloat(h[v+1]),c=3===f?parseFloat(h[v+2]):0,"en"===s.substr(0,2)?l.push(a,u,c):l.push(u,a,c);return l},n.prototype.uy=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=e?"3":"2";t.setAttribute("srsDimension",o);var s=r.srsName,a="enu";s&&(a=gr(s).getAxisOrientation());var u,c=n.getCoordinates();(u="en"===a.substr(0,2)?c[0]+" "+c[1]:c[1]+" "+c[0],e)&&(u+=" "+(c[2]||0));dA(t,u)},n.prototype.Qp=function(t,n,i){var r="enu";n&&(r=gr(n).getAxisOrientation());var e="en"===r.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];i&&(e+=" "+(t[2]||0));return e},n.prototype.hy=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=e?"3":"2";t.setAttribute("srsDimension",o);for(var s,a=r.srsName,u=n.getCoordinates(),c=u.length,h=new Array(c),f=0;f<c;++f)s=u[f],h[f]=this.Qp(s,a,e);dA(t,h.join(" "))},n.prototype.writePoint=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=wf(t.namespaceURI,"pos");t.appendChild(e),this.uy(e,n,i)},n.prototype.writeEnvelope=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=[n[0]+" "+n[1],n[2]+" "+n[3]];Lf({node:t},this.ENVELOPE_SERIALIZERS,Rf,e,i,["lowerCorner","upperCorner"],this)},n.prototype.writeLinearRing=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=wf(t.namespaceURI,"posList");t.appendChild(e),this.hy(e,n,i)},n.prototype.ty=function(t,n,i){var r=n[n.length-1],e=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),wf(e.namespaceURI,void 0!==o?"interior":"exterior")},n.prototype.writeSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=n.getLinearRings();Lf({node:t,hasZ:e,srsName:o},this.RING_SERIALIZERS,this.ty,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=wf(t.namespaceURI,"patches");t.appendChild(a),this.ny(a,n,i)}},n.prototype.writeCurveOrLineString=function(t,n,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var e=wf(t.namespaceURI,"posList");t.appendChild(e),this.hy(e,n,i)}else if("Curve"===t.nodeName){var o=wf(t.namespaceURI,"segments");t.appendChild(o),this.Zp(o,n,i)}},n.prototype.writeMultiSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=n.getPolygons();Lf({node:t,hasZ:e,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.$p,a,i,void 0,this)},n.prototype.writeMultiPoint=function(t,n,i){var r=i[i.length-1],e=r.srsName,o=r.hasZ;e&&t.setAttribute("srsName",e);var s=n.getPoints();Lf({node:t,hasZ:o,srsName:e},this.POINTMEMBER_SERIALIZERS,Cf("pointMember"),s,i,void 0,this)},n.prototype.writeMultiCurveOrLineString=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=n.getLineStrings();Lf({node:t,hasZ:e,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.$p,a,i,void 0,this)},n.prototype.writeRing=function(t,n,i){var r=wf(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing(r,n,i)},n.prototype.writeSurfaceOrPolygonMember=function(t,n,i){var r=this.Jp(n,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))},n.prototype.writePointMember=function(t,n,i){var r=wf(t.namespaceURI,"Point");t.appendChild(r),this.writePoint(r,n,i)},n.prototype.writeLineStringOrCurveMember=function(t,n,i){var r=this.Jp(n,i);r&&(t.appendChild(r),this.writeCurveOrLineString(r,n,i))},n.prototype.ny=function(t,n,i){var r=wf(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)},n.prototype.Zp=function(t,n,i){var r=wf(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString(r,n,i)},n.prototype.writeGeometryElement=function(t,n,i){var r,e=i[i.length-1],o=E({},e);o.node=t,r=Array.isArray(n)?Zj(n,e):Yj(n,!0,e),Lf(o,this.GEOMETRY_SERIALIZERS,this.Jp,[r],i,void 0,this)},n.prototype.writeFeatureElement=function(t,n,i){var r=n.getId();r&&t.setAttribute("fid",r);var e=i[i.length-1],o=e.featureNS,s=n.getGeometryName();e.serializers||(e.serializers={},e.serializers[o]={});var a=[],u=[];if(n.hasProperties()){var c=n.getProperties();for(var h in c){var f=c[h];null!==f&&(a.push(h),u.push(f),h==s||"function"==typeof f.getSimplifiedGeometry?h in e.serializers[o]||(e.serializers[o][h]=Ef(this.writeGeometryElement,this)):h in e.serializers[o]||(e.serializers[o][h]=Ef(dA)))}}var l=E({},e);l.node=t,Lf(l,e.serializers,Cf(void 0,o),u,i,a)},n.prototype.ly=function(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s={};s[o]={},s[o][e]=Ef(this.writeFeatureElement,this);var a=E({},r);a.node=t,Lf(a,s,Cf(e,o),n,i)},n.prototype.$p=function(t,n,i){var r=n[n.length-1].node;return wf(this.namespace,gA[r.nodeName])},n.prototype.Jp=function(t,n,i){var r,e=n[n.length-1],o=e.multiSurface,s=e.surface,a=e.curve,u=e.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"LineString"===r&&!0===a?r="Curve":"MultiLineString"===r&&!0===u&&(r="MultiCurve"),wf(this.namespace,r)},n.prototype.writeGeometryNode=function(t,n){n=this.adaptOptions(n);var i=wf(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.ey,surface:this.iy,multiSurface:this.sy,multiCurve:this.oy};return n&&E(r,n),this.writeGeometryElement(i,t,[r]),i},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=wf(this.namespace,"featureMembers");i.setAttributeNS(mf,"xsi:schemaLocation",this.schemaLocation);var r={srsName:this.srsName,hasZ:this.hasZ,curve:this.ey,surface:this.iy,multiSurface:this.sy,multiCurve:this.oy,featureNS:this.featureNS,featureType:this.featureType};return n&&E(r,n),this.ly(i,t,[r]),i},n}(tA);xA.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:_f(xA.prototype.readFlatPos),posList:_f(xA.prototype.readFlatPosList),coordinates:_f(wA.prototype.readFlatCoordinates)}},xA.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:xA.prototype.interiorParser,exterior:xA.prototype.exteriorParser}},xA.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:_f(tA.prototype.readPoint),MultiPoint:_f(tA.prototype.readMultiPoint),LineString:_f(tA.prototype.readLineString),MultiLineString:_f(tA.prototype.readMultiLineString),LinearRing:_f(tA.prototype.readLinearRing),Polygon:_f(tA.prototype.readPolygon),MultiPolygon:_f(tA.prototype.readMultiPolygon),Surface:_f(xA.prototype.readSurface),MultiSurface:_f(xA.prototype.readMultiSurface),Curve:_f(xA.prototype.readCurve),MultiCurve:_f(xA.prototype.readMultiCurve),Envelope:_f(xA.prototype.readEnvelope)}},xA.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:Mf(xA.prototype.curveMemberParser),curveMembers:Mf(xA.prototype.curveMemberParser)}},xA.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:Mf(xA.prototype.surfaceMemberParser),surfaceMembers:Mf(xA.prototype.surfaceMemberParser)}},xA.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:Mf(tA.prototype.readLineString),Curve:Mf(xA.prototype.readCurve)}},xA.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:Mf(tA.prototype.readPolygon),Surface:Mf(xA.prototype.readSurface)}},xA.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:_f(xA.prototype.readPatch)}},xA.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:_f(xA.prototype.readSegment)}},xA.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:Mf(xA.prototype.readFlatPosList),upperCorner:Mf(xA.prototype.readFlatPosList)}},xA.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:_f(xA.prototype.readPolygonPatch)}},xA.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:_f(xA.prototype.readLineStringSegment)}},xA.prototype.writeFeatures,xA.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:Ef(xA.prototype.writeRing),interior:Ef(xA.prototype.writeRing)}},xA.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:Ef(dA),upperCorner:Ef(dA)}},xA.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:Ef(xA.prototype.writeSurfaceOrPolygonMember),polygonMember:Ef(xA.prototype.writeSurfaceOrPolygonMember)}},xA.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:Ef(xA.prototype.writePointMember)}},xA.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:Ef(xA.prototype.writeLineStringOrCurveMember),curveMember:Ef(xA.prototype.writeLineStringOrCurveMember)}},xA.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:Ef(xA.prototype.writeCurveOrLineString),MultiCurve:Ef(xA.prototype.writeMultiCurveOrLineString),Point:Ef(xA.prototype.writePoint),MultiPoint:Ef(xA.prototype.writeMultiPoint),LineString:Ef(xA.prototype.writeCurveOrLineString),MultiLineString:Ef(xA.prototype.writeMultiCurveOrLineString),LinearRing:Ef(xA.prototype.writeLinearRing),Polygon:Ef(xA.prototype.writeSurfaceOrPolygon),MultiPolygon:Ef(xA.prototype.writeMultiSurfaceOrPolygon),Surface:Ef(xA.prototype.writeSurfaceOrPolygon),MultiSurface:Ef(xA.prototype.writeMultiSurfaceOrPolygon),Envelope:Ef(xA.prototype.writeEnvelope)}};var jA=xA,SA=jA;SA.prototype.writeFeatures,SA.prototype.writeFeaturesNode;var kA=SA,MA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_A=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).schemaLocation=r.schemaLocation?r.schemaLocation:i.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd",i}return MA(n,t),n}(jA);_A.prototype.namespace="http://www.opengis.net/gml/3.2",_A.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:_f(jA.prototype.readFlatPos),posList:_f(jA.prototype.readFlatPosList),coordinates:_f(wA.prototype.readFlatCoordinates)}},_A.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:jA.prototype.interiorParser,exterior:jA.prototype.exteriorParser}},_A.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:_f(tA.prototype.readPoint),MultiPoint:_f(tA.prototype.readMultiPoint),LineString:_f(tA.prototype.readLineString),MultiLineString:_f(tA.prototype.readMultiLineString),LinearRing:_f(tA.prototype.readLinearRing),Polygon:_f(tA.prototype.readPolygon),MultiPolygon:_f(tA.prototype.readMultiPolygon),Surface:_f(_A.prototype.readSurface),MultiSurface:_f(jA.prototype.readMultiSurface),Curve:_f(_A.prototype.readCurve),MultiCurve:_f(jA.prototype.readMultiCurve),Envelope:_f(_A.prototype.readEnvelope)}},_A.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:Mf(jA.prototype.curveMemberParser),curveMembers:Mf(jA.prototype.curveMemberParser)}},_A.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:Mf(jA.prototype.surfaceMemberParser),surfaceMembers:Mf(jA.prototype.surfaceMemberParser)}},_A.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:Mf(tA.prototype.readLineString),Curve:Mf(jA.prototype.readCurve)}},_A.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:Mf(tA.prototype.readPolygon),Surface:Mf(jA.prototype.readSurface)}},_A.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:_f(jA.prototype.readPatch)}},_A.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:_f(jA.prototype.readSegment)}},_A.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:Mf(jA.prototype.readFlatPosList),upperCorner:Mf(jA.prototype.readFlatPosList)}},_A.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:_f(jA.prototype.readPolygonPatch)}},_A.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:_f(jA.prototype.readLineStringSegment)}},_A.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:Mf(tA.prototype.pointMemberParser),pointMembers:Mf(tA.prototype.pointMemberParser)}},_A.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:Mf(tA.prototype.lineStringMemberParser),lineStringMembers:Mf(tA.prototype.lineStringMemberParser)}},_A.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:Mf(tA.prototype.polygonMemberParser),polygonMembers:Mf(tA.prototype.polygonMemberParser)}},_A.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:Mf(tA.prototype.readFlatCoordinatesFromNode)}},_A.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:Mf(tA.prototype.readLineString)}},_A.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:Mf(tA.prototype.readPolygon)}},_A.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:_f(tA.prototype.readFlatLinearRing)}},_A.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:Ef(jA.prototype.writeRing),interior:Ef(jA.prototype.writeRing)}},_A.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:Ef(dA),upperCorner:Ef(dA)}},_A.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:Ef(jA.prototype.writeSurfaceOrPolygonMember),polygonMember:Ef(jA.prototype.writeSurfaceOrPolygonMember)}},_A.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:Ef(jA.prototype.writePointMember)}},_A.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:Ef(jA.prototype.writeLineStringOrCurveMember),curveMember:Ef(jA.prototype.writeLineStringOrCurveMember)}},_A.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:Ef(jA.prototype.writeCurveOrLineString),MultiCurve:Ef(jA.prototype.writeMultiCurveOrLineString),Point:Ef(_A.prototype.writePoint),MultiPoint:Ef(jA.prototype.writeMultiPoint),LineString:Ef(jA.prototype.writeCurveOrLineString),MultiLineString:Ef(jA.prototype.writeMultiCurveOrLineString),LinearRing:Ef(jA.prototype.writeLinearRing),Polygon:Ef(jA.prototype.writeSurfaceOrPolygon),MultiPolygon:Ef(jA.prototype.writeMultiSurfaceOrPolygon),Surface:Ef(jA.prototype.writeSurfaceOrPolygon),MultiSurface:Ef(jA.prototype.writeMultiSurfaceOrPolygon),Envelope:Ef(jA.prototype.writeEnvelope)}};var OA=_A,TA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),EA=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],AA={rte:eC,trk:oC,wpt:sC},CA=If(EA,{rte:Mf(eC),trk:Mf(oC),wpt:Mf(sC)}),RA=If(EA,{text:Tf(uA,"linkText"),type:Tf(uA,"linkType")}),PA=If(EA,{rte:Ef((function(t,n,i){var r=i[0],e=n.getProperties(),o={node:t};o.properties=e;var s=n.getGeometry();if(s.getType()==Pt.LINE_STRING){var a=Yj(s,!0,r);o.geometryLayout=a.getLayout(),e.rtept=a.getCoordinates()}var u=i[i.length-1].node,c=BA[u.namespaceURI],h=Pf(e,c);Lf(o,WA,Rf,h,i,c)})),trk:Ef((function(t,n,i){var r=i[0],e=n.getProperties(),o={node:t};o.properties=e;var s=n.getGeometry();if(s.getType()==Pt.MULTI_LINE_STRING){var a=Yj(s,!0,r);e.trkseg=a.getLineStrings()}var u=i[i.length-1].node,c=XA[u.namespaceURI],h=Pf(e,c);Lf(o,HA,Rf,h,i,c)})),wpt:Ef((function(t,n,i){var r=i[0],e=i[i.length-1];e.properties=n.getProperties();var o=n.getGeometry();if(o.getType()==Pt.POINT){var s=Yj(o,!0,r);e.geometryLayout=s.getLayout(),uC(t,s.getCoordinates(),i)}}))}),IA=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=gr("EPSG:4326"),i.vy=r.readExtensions,i}return TA(n,t),n.prototype.py=function(t){t||(t=[]);for(var n=0,i=t.length;n<i;++n){var r=t[n];if(this.vy){var e=r.get("extensionsNode_")||null;this.vy(r,e)}r.set("extensionsNode_",void 0)}},n.prototype.readFeatureFromNode=function(t,n){if(!y(EA,t.namespaceURI))return null;var i=AA[t.localName];if(!i)return null;var r=i(t,[this.getReadOptions(t,n)]);return r?(this.py([r]),r):null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(EA,t.namespaceURI))return[];if("gpx"==t.localName){var i=zf([],CA,t,[this.getReadOptions(t,n)]);return i?(this.py(i),i):[]}return[]},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=wf("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",mf),i.setAttributeNS(mf,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),Lf({node:i},PA,QA,t,[n]),i},n}(KE),NA=If(EA,{name:Tf(uA),cmt:Tf(uA),desc:Tf(uA),src:Tf(uA),link:iC,number:Tf(sA),extensions:rC,type:Tf(uA),rtept:function(t,n){var i=zf({},zA,t,n);if(i){var r=n[n.length-1],e=r.flatCoordinates,o=r.layoutOptions;tC(e,o,t,i)}}}),zA=If(EA,{ele:Tf(eA),time:Tf(rA)}),FA=If(EA,{name:Tf(uA),cmt:Tf(uA),desc:Tf(uA),src:Tf(uA),link:iC,number:Tf(sA),type:Tf(uA),extensions:rC,trkseg:function(t,n){var i=n[n.length-1];Nf(LA,t,n);var r=i.flatCoordinates;i.ends.push(r.length)}}),LA=If(EA,{trkpt:function(t,n){var i=zf({},GA,t,n);if(i){var r=n[n.length-1],e=r.flatCoordinates,o=r.layoutOptions;tC(e,o,t,i)}}}),GA=If(EA,{ele:Tf(eA),time:Tf(rA)}),DA=If(EA,{ele:Tf(eA),time:Tf(rA),magvar:Tf(eA),geoidheight:Tf(eA),name:Tf(uA),cmt:Tf(uA),desc:Tf(uA),src:Tf(uA),link:iC,sym:Tf(uA),type:Tf(uA),fix:Tf(uA),sat:Tf(sA),hdop:Tf(eA),vdop:Tf(eA),pdop:Tf(eA),ageofdgpsdata:Tf(eA),dgpsid:Tf(sA),extensions:rC}),UA=["text","type"],qA=If(EA,{text:Ef(dA),type:Ef(dA)}),BA=If(EA,["name","cmt","desc","src","link","number","type","rtept"]),WA=If(EA,{name:Ef(dA),cmt:Ef(dA),desc:Ef(dA),src:Ef(dA),link:Ef(aC),number:Ef(vA),type:Ef(dA),rtept:Af(Ef(uC))}),VA=If(EA,["ele","time"]),XA=If(EA,["name","cmt","desc","src","link","number","type","trkseg"]),HA=If(EA,{name:Ef(dA),cmt:Ef(dA),desc:Ef(dA),src:Ef(dA),link:Ef(aC),number:Ef(vA),type:Ef(dA),trkseg:Af(Ef((function(t,n,i){var r={node:t};r.geometryLayout=n.getLayout(),r.properties={},Lf(r,KA,JA,n.getCoordinates(),i)})))}),JA=Cf("trkpt"),KA=If(EA,{trkpt:Ef(uC)}),YA=If(EA,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),ZA=If(EA,{ele:Ef(lA),time:Ef(fA),magvar:Ef(lA),geoidheight:Ef(lA),name:Ef(dA),cmt:Ef(dA),desc:Ef(dA),src:Ef(dA),link:Ef(aC),sym:Ef(dA),type:Ef(dA),fix:Ef(dA),sat:Ef(vA),hdop:Ef(lA),vdop:Ef(lA),pdop:Ef(lA),ageofdgpsdata:Ef(lA),dgpsid:Ef(vA)}),$A={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function QA(t,n,i){var r=t.getGeometry();if(r){var e=$A[r.getType()];if(e)return wf(n[n.length-1].node.namespaceURI,e)}}function tC(t,n,i,r){return t.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in r?(t.push(r.ele),delete r.ele,n.hasZ=!0):t.push(0),"time"in r?(t.push(r.time),delete r.time,n.hasM=!0):t.push(0),t}function nC(t,n,i){var r=Et,e=2;if(t.hasZ&&t.hasM?(r=Rt,e=4):t.hasZ?(r=At,e=3):t.hasM&&(r=Ct,e=3),4!==e){for(var o=0,s=n.length/4;o<s;o++)n[o*e]=n[4*o],n[o*e+1]=n[4*o+1],t.hasZ&&(n[o*e+2]=n[4*o+2]),t.hasM&&(n[o*e+2]=n[4*o+3]);if(n.length=n.length/4*e,i)for(o=0,s=i.length;o<s;o++)i[o]=i[o]/4*e}return r}function iC(t,n){var i=n[n.length-1],r=t.getAttribute("href");null!==r&&(i.link=r),Nf(RA,t,n)}function rC(t,n){n[n.length-1].my=t}function eC(t,n){var i=n[0],r=zf({flatCoordinates:[],layoutOptions:{}},NA,t,n);if(r){var e=r.flatCoordinates;delete r.flatCoordinates;var o=r.layoutOptions;delete r.layoutOptions;var s=nC(o,e),a=new kj(e,s);Yj(a,!1,i);var u=new Tt(a);return u.setProperties(r,!0),u}}function oC(t,n){var i=n[0],r=zf({flatCoordinates:[],ends:[],layoutOptions:{}},FA,t,n);if(r){var e=r.flatCoordinates;delete r.flatCoordinates;var o=r.ends;delete r.ends;var s=r.layoutOptions;delete r.layoutOptions;var a=nC(s,e,o),u=new _j(e,a,o);Yj(u,!1,i);var c=new Tt(u);return c.setProperties(r,!0),c}}function sC(t,n){var i=n[0],r=zf({},DA,t,n);if(r){var e={},o=tC([],e,t,r),s=nC(e,o),a=new Te(o,s);Yj(a,!1,i);var u=new Tt(a);return u.setProperties(r,!0),u}}function aC(t,n,i){t.setAttribute("href",n);var r=i[i.length-1].properties,e=[r.linkText,r.linkType];Lf({node:t},qA,Rf,e,i,UA)}function uC(t,n,i){var r=i[i.length-1],e=r.node.namespaceURI,o=r.properties;switch(t.setAttributeNS(null,"lat",String(n[1])),t.setAttributeNS(null,"lon",String(n[0])),r.geometryLayout){case Rt:0!==n[3]&&(o.time=n[3]);case At:0!==n[2]&&(o.ele=n[2]);break;case Ct:0!==n[2]&&(o.time=n[2])}var s="rtept"==t.nodeName?VA[e]:YA[e],a=Pf(o,s);Lf({node:t,properties:o},ZA,Rf,a,i,s)}var cC=IA,hC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function fC(t){return"string"==typeof t?t:""}var lC=function(t){function n(){return t.call(this)||this}return hC(n,t),n.prototype.getType=function(){return hh},n.prototype.readFeature=function(t,n){return this.readFeatureFromText(fC(t),this.adaptOptions(n))},n.prototype.readFeatureFromText=function(t,n){return r()},n.prototype.readFeatures=function(t,n){return this.readFeaturesFromText(fC(t),this.adaptOptions(n))},n.prototype.readFeaturesFromText=function(t,n){return r()},n.prototype.readGeometry=function(t,n){return this.readGeometryFromText(fC(t),this.adaptOptions(n))},n.prototype.readGeometryFromText=function(t,n){return r()},n.prototype.readProjection=function(t){return this.readProjectionFromText(fC(t))},n.prototype.readProjectionFromText=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){return this.writeFeatureText(t,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){return r()},n.prototype.writeFeatures=function(t,n){return this.writeFeaturesText(t,this.adaptOptions(n))},n.prototype.writeFeaturesText=function(t,n){return r()},n.prototype.writeGeometry=function(t,n){return this.writeGeometryText(t,this.adaptOptions(n))},n.prototype.writeGeometryText=function(t,n){return r()},n}(Kj),vC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dC="barometric",pC="gps",yC="none",mC=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,wC=/^H.([A-Z]{3}).*?:(.*)/,bC=/^HFDTE(\d{2})(\d{2})(\d{2})/,gC=/\r\n|\r|\n/,xC=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=gr("EPSG:4326"),i.wy=r.altitudeMode?r.altitudeMode:yC,i}return vC(n,t),n.prototype.readFeatureFromText=function(t,n){var i,r,e=this.wy,o=t.split(gC),s={},a=[],u=2e3,c=0,h=1,f=-1;for(i=0,r=o.length;i<r;++i){var l=o[i],v=void 0;if("B"==l.charAt(0)){if(v=mC.exec(l)){var d=parseInt(v[1],10),p=parseInt(v[2],10),y=parseInt(v[3],10),m=parseInt(v[4],10)+parseInt(v[5],10)/6e4;"S"==v[6]&&(m=-m);var w=parseInt(v[7],10)+parseInt(v[8],10)/6e4;if("W"==v[9]&&(w=-w),a.push(w,m),e!=yC){var b=void 0;b=e==pC?parseInt(v[11],10):e==dC?parseInt(v[12],10):0,a.push(b)}var g=Date.UTC(u,c,h,d,p,y);g<f&&(g=Date.UTC(u,c,h+1,d,p,y)),a.push(g/1e3),f=g}}else"H"==l.charAt(0)&&((v=bC.exec(l))?(h=parseInt(v[1],10),c=parseInt(v[2],10)-1,u=2e3+parseInt(v[3],10)):(v=wC.exec(l))&&(s[v[1]]=v[2].trim()))}if(0===a.length)return null;var x=new kj(a,e==yC?Ct:Rt),j=new Tt(Yj(x,!1,n));return j.setProperties(s,!0),j},n.prototype.readFeaturesFromText=function(t,n){var i=this.readFeatureFromText(t,n);return i?[i]:[]},n}(lC);function jC(t){return(jC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var SC,kC,MC,_C,OC,TC,EC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),AC=["http://www.google.com/kml/ext/2.2"],CC=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],RC={fraction:Rv,pixels:Pv,insetPixels:Pv},PC=If(CC,{ExtendedData:AR,Region:CR,MultiGeometry:Tf(xR,"geometry"),LineString:Tf(wR,"geometry"),LinearRing:Tf(bR,"geometry"),Point:Tf(jR,"geometry"),Polygon:Tf(kR,"geometry"),Style:Tf(_R),StyleMap:function(t,n){var i=eR.call(this,t,n);if(!i)return;var r=n[n.length-1];Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:Mt(!1,38)},address:Tf(uA),description:Tf(uA),name:Tf(uA),open:Tf(nA),phoneNumber:Tf(uA),styleUrl:Tf(nR),visibility:Tf(nA)},If(AC,{MultiTrack:Tf((function(t,n){var i=zf([],fR,t,n);if(!i)return;return new _j(i)}),"geometry"),Track:Tf(vR,"geometry")})),IC=If(CC,{ExtendedData:AR,Region:CR,Link:function(t,n){Nf(NC,t,n)},address:Tf(uA),description:Tf(uA),name:Tf(uA),open:Tf(nA),phoneNumber:Tf(uA),visibility:Tf(nA)}),NC=If(CC,{href:Tf(tR)}),zC=If(CC,{LatLonAltBox:function(t,n){var i=zf({},IR,t,n);if(!i)return;var r=n[n.length-1],e=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];r.extent=e,r.altitudeMode=i.altitudeMode,r.minAltitude=parseFloat(i.minAltitude),r.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,n){var i=zf({},NR,t,n);if(!i)return;var r=n[n.length-1];r.minLodPixels=parseFloat(i.minLodPixels),r.maxLodPixels=parseFloat(i.maxLodPixels),r.minFadeExtent=parseFloat(i.minFadeExtent),r.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),FC=If(CC,["Document","Placemark"]),LC=If(CC,{Document:Ef((function(t,n,i){Lf({node:t},DR,UR,n,i,void 0,this)})),Placemark:Ef(fP)}),GC=null;var DC,UC=null;var qC,BC=null;var WC=null;var VC=null;var XC,HC=null;function JC(t){return 32/Math.min(t[0],t[1])}function KC(t){return t}var YC=function(t){function n(n){var i=t.call(this)||this,r=n||{};return HC||(GC=new Cv({color:SC=[255,255,255,1]}),TC="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",UC=new Wv({anchor:kC=[20,2],anchorOrigin:Iv,anchorXUnits:MC=Pv,anchorYUnits:_C=Pv,crossOrigin:"anonymous",rotation:0,scale:JC(OC=[64,64]),size:OC,src:TC}),DC="NO_IMAGE",BC=new Vv({color:SC,width:1}),qC=new Vv({color:[51,51,51,1],width:2}),WC=new id({font:"bold 16px Helvetica",fill:GC,stroke:qC,scale:.8}),VC=new Qv({fill:GC,image:UC,text:WC,stroke:BC,zIndex:0}),HC=[VC]),i.dataProjection=gr("EPSG:4326"),i.gy=r.defaultStyle?r.defaultStyle:HC,i.xy=void 0===r.extractStyles||r.extractStyles,i.jy=void 0===r.writeStyles||r.writeStyles,i.Sy={},i.ky=void 0===r.showPointNames||r.showPointNames,i.Bt=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",i.My=r.iconUrlFunction?r.iconUrlFunction:KC,i.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],i}return EC(n,t),n.prototype._y=function(t,n){var i=zf([],If(CC,{Document:kf(this._y,this),Folder:kf(this._y,this),Placemark:Mf(this.Oy,this),Style:this.Ty.bind(this),StyleMap:this.Ey.bind(this)}),t,n,this);return i||void 0},n.prototype.Oy=function(t,n){var i=zf({geometry:null},PC,t,n,this);if(i){var r=new Tt,e=t.getAttribute("id");null!==e&&r.setId(e);var o=n[0],s=i.geometry;if(s&&Yj(s,!1,o),r.setGeometry(s),delete i.geometry,this.xy){var a=function(t,n,i,r,e){return function(o,s){var a=e,u="",c=[];if(a){var h=o.getGeometry();if(h)if(h instanceof cS)a=(c=h.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===Pt.POINT||n===Pt.MULTI_POINT}))).length>0;else{var f=h.getType();a=f===Pt.POINT||f===Pt.MULTI_POINT}}a&&(u=o.get("name"),(a=a&&!!u)&&u.search(/&[^&]+;/)>-1&&(XC||(XC=document.createElement("textarea")),XC.innerHTML=u,u=XC.value));var l=i;if(t?l=t:n&&(l=ZC(n,i,r)),a){var v=function(t,n){var i=[0,0],r="start",e=t.getImage();if(e){var o=e.getSize();if(o&&2==o.length){var s=e.getScaleArray(),a=e.getAnchor();i[0]=s[0]*(o[0]-a[0]),i[1]=s[1]*(o[1]/2-a[1]),r="left"}}var u=t.getText();u?((u=u.clone()).setFont(u.getFont()||WC.getFont()),u.setScale(u.getScale()||WC.getScale()),u.setFill(u.getFill()||WC.getFill()),u.setStroke(u.getStroke()||qC)):u=WC.clone();return u.setText(n),u.setOffsetX(i[0]),u.setOffsetY(i[1]),u.setTextAlign(r),new Qv({image:e,text:u})}(l[0],u);return c.length>0?(v.setGeometry(new cS(c)),[v,new Qv({geometry:l[0].getGeometry(),image:null,fill:l[0].getFill(),stroke:l[0].getStroke(),text:null})].concat(l.slice(1))):v}return l}}(i.Style,i.styleUrl,this.gy,this.Sy,this.ky);r.setStyle(a)}return delete i.Style,r.setProperties(i,!0),r}},n.prototype.Ty=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=_R.call(this,t,n);if(r){var e=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Sy[e]=r}}},n.prototype.Ey=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=eR.call(this,t,n);if(r){var e,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Sy[e]=r}}},n.prototype.readFeatureFromNode=function(t,n){if(!y(CC,t.namespaceURI))return null;var i=this.Oy(t,[this.getReadOptions(t,n)]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(CC,t.namespaceURI))return[];var i,r=t.localName;if("Document"==r||"Folder"==r)return(i=this._y(t,[this.getReadOptions(t,n)]))||[];if("Placemark"==r){var e=this.Oy(t,[this.getReadOptions(t,n)]);return e?[e]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,n);s&&b(i,s)}return i}return[]},n.prototype.readName=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readNameFromDocument(n)}return xf(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},n.prototype.readNameFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(n);if(i)return i}},n.prototype.readNameFromNode=function(t){for(var n=t.firstElementChild;n;n=n.nextElementSibling)if(y(CC,n.namespaceURI)&&"name"==n.localName)return uA(n);for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;if(y(CC,n.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var r=this.readNameFromNode(n);if(r)return r}}},n.prototype.readNetworkLinks=function(t){var n=[];if("string"==typeof t){var i=Sf(t);b(n,this.readNetworkLinksFromDocument(i))}else xf(t)?b(n,this.readNetworkLinksFromDocument(t)):b(n,this.readNetworkLinksFromNode(t));return n},n.prototype.readNetworkLinksFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&b(n,this.readNetworkLinksFromNode(i));return n},n.prototype.readNetworkLinksFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(CC,i.namespaceURI)&&"NetworkLink"==i.localName){var r=zf({},IC,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(CC,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||b(n,this.readNetworkLinksFromNode(i))}return n},n.prototype.readRegion=function(t){var n=[];if("string"==typeof t){var i=Sf(t);b(n,this.readRegionFromDocument(i))}else xf(t)?b(n,this.readRegionFromDocument(t)):b(n,this.readRegionFromNode(t));return n},n.prototype.readRegionFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&b(n,this.readRegionFromNode(i));return n},n.prototype.readRegionFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(CC,i.namespaceURI)&&"Region"==i.localName){var r=zf({},zC,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(CC,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||b(n,this.readRegionFromNode(i))}return n},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=wf(CC[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",AC[0]),i.setAttributeNS(r,"xmlns:xsi",mf),i.setAttributeNS(mf,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var e={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=FC[i.namespaceURI],a=Pf(o,s);return Lf(e,LC,Rf,a,[n],s,this),i},n}(KE);function ZC(t,n,i){return Array.isArray(t)?t:"string"==typeof t?ZC(i[t],n,i):n}function $C(t){var n=bf(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(n);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function QC(t){var n=bf(t,!1),i=[];n=n.replace(/\s*,\s*/g,",");for(var r,e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=e.exec(n);){var o=parseFloat(r[1]),s=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;i.push(o,s,a),n=n.substr(r[0].length)}if(""===n)return i}function tR(t){var n=bf(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function nR(t){var n=bf(t,!1).trim().replace(/^(?!.*#)/,"#"),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function iR(t){return eA(t)}var rR=If(CC,{Pair:function(t,n){var i=zf({},RR,t,n,this);if(!i)return;var r=i.key;if(r&&"normal"==r){var e=i.styleUrl;e&&(n[n.length-1]=e);var o=i.Style;o&&(n[n.length-1]=o)}}});function eR(t,n){return zf(void 0,rR,t,n,this)}var oR=If(CC,{Icon:Tf((function(t,n){var i=zf({},dR,t,n);return i||null})),color:Tf($C),heading:Tf(eA),hotSpot:Tf((function(t){var n,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return n="insetPixels"!==i?"insetPixels"!==r?Iv:zv:"insetPixels"!==r?Nv:Fv,{x:parseFloat(t.getAttribute("x")),xunits:RC[i],y:parseFloat(t.getAttribute("y")),yunits:RC[r],origin:n}})),scale:Tf(iR)});var sR=If(CC,{color:Tf($C),scale:Tf(iR)});var aR=If(CC,{color:Tf($C),width:Tf(eA)});var uR=If(CC,{color:Tf($C),fill:Tf(nA),outline:Tf(nA)});var cR=If(CC,{coordinates:_f(QC)});function hR(t,n){return zf(null,cR,t,n)}var fR=If(AC,{Track:Mf(vR)});var lR=If(CC,{when:function(t,n){var i=n[n.length-1].whens,r=bf(t,!1),e=Date.parse(r);i.push(isNaN(e)?0:e)}},If(AC,{coord:function(t,n){var i=n[n.length-1].coordinates,r=bf(t,!1),e=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(e){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=parseFloat(e[3]);i.push([o,s,a])}else i.push([])}}));function vR(t,n){var i=zf({coordinates:[],whens:[]},lR,t,n);if(i){for(var r=[],e=i.coordinates,o=i.whens,s=0,a=Math.min(e.length,o.length);s<a;++s)3==e[s].length&&r.push(e[s][0],e[s][1],e[s][2],o[s]);return new kj(r,Rt)}}var dR=If(CC,{href:Tf(tR)},If(AC,{x:Tf(eA),y:Tf(eA),w:Tf(eA),h:Tf(eA)}));var pR=If(CC,{coordinates:_f(QC)});function yR(t,n){return zf(null,pR,t,n)}var mR=If(CC,{extrude:Tf(nA),tessellate:Tf(nA),altitudeMode:Tf(uA)});function wR(t,n){var i=zf({},mR,t,n),r=yR(t,n);if(r){var e=new kj(r,At);return e.setProperties(i,!0),e}}function bR(t,n){var i=zf({},mR,t,n),r=yR(t,n);if(r){var e=new Ye(r,At,[r.length]);return e.setProperties(i,!0),e}}var gR=If(CC,{LineString:Mf(wR),LinearRing:Mf(bR),MultiGeometry:Mf(xR),Point:Mf(jR),Polygon:Mf(kR)});function xR(t,n){var i,r=zf([],gR,t,n);if(!r)return null;if(0===r.length)return new cS(r);for(var e=!0,o=r[0].getType(),s=1,a=r.length;s<a;++s)if(r[s].getType()!=o){e=!1;break}if(e){var u=void 0,c=void 0;if(o==Pt.POINT){var h=r[0];u=h.getLayout(),c=h.getFlatCoordinates();for(s=1,a=r.length;s<a;++s)b(c,r[s].getFlatCoordinates());OR(i=new bj(c,u),r)}else o==Pt.LINE_STRING?OR(i=new _j(r),r):o==Pt.POLYGON?OR(i=new Ej(r),r):o==Pt.GEOMETRY_COLLECTION?i=new cS(r):Mt(!1,37)}else i=new cS(r);return i}function jR(t,n){var i=zf({},mR,t,n),r=yR(t,n);if(r){var e=new Te(r,At);return e.setProperties(i,!0),e}}var SR=If(CC,{innerBoundaryIs:function(t,n){var i=zf([],zR,t,n);if(i.length>0){var r=n[n.length-1];r.push.apply(r,i)}},outerBoundaryIs:function(t,n){var i=zf(void 0,FR,t,n);if(i){n[n.length-1][0]=i}}});function kR(t,n){var i=zf({},mR,t,n),r=zf([null],SR,t,n);if(r&&r[0]){for(var e=r[0],o=[e.length],s=1,a=r.length;s<a;++s)b(e,r[s]),o.push(e.length);var u=new Ye(e,At,o);return u.setProperties(i,!0),u}}var MR=If(CC,{IconStyle:function(t,n){var i=zf({},oR,t,n);if(i){var r,e,o,s,a=n[n.length-1],u="Icon"in i?i.Icon:{},c=!("Icon"in i)||Object.keys(u).length>0,h=u.href;h?r=h:c&&(r=TC);var f,l=Iv,v=i.hotSpot;v?(e=[v.x,v.y],o=v.xunits,s=v.yunits,l=v.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(/pushpin/.test(r)?(e=kC,o=MC,s=_C):/arrow-reverse/.test(r)?(e=[54,42],o=MC,s=_C):/paddle/.test(r)&&(e=[32,1],o=MC,s=_C));var d,p=u.x,y=u.y;void 0!==p&&void 0!==y&&(f=[p,y]);var m,w=u.w,b=u.h;void 0!==w&&void 0!==b&&(d=[w,b]);var g=i.heading;void 0!==g&&(m=yi(g));var x=i.scale,j=i.color;if(c){r==TC&&(d=OC);var S=new Wv({anchor:e,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.Bt,offset:f,offsetOrigin:Iv,rotation:m,scale:x,size:d,src:this.My(r),color:j}),k=S.getScaleArray()[0],M=S.getSize();if(null===M){var _=S.getImageState();if(_===mo||_===wo){S.listenImageChange((function t(){var n=S.getImageState();if(n!==mo&&n!==wo){var i=S.getSize();if(i&&2==i.length){var r=JC(i);S.setScale(k*r)}S.unlistenImageChange(t)}})),_===mo&&S.load()}}else if(2==M.length){var O=JC(M);S.setScale(k*O)}a.imageStyle=S}else a.imageStyle=DC}},LabelStyle:function(t,n){var i=zf({},sR,t,n);if(i){var r=n[n.length-1],e=new id({fill:new Cv({color:"color"in i?i.color:SC}),scale:i.scale});r.textStyle=e}},LineStyle:function(t,n){var i=zf({},aR,t,n);if(i){var r=n[n.length-1],e=new Vv({color:"color"in i?i.color:SC,width:"width"in i?i.width:1});r.strokeStyle=e}},PolyStyle:function(t,n){var i=zf({},uR,t,n);if(i){var r=n[n.length-1],e=new Cv({color:"color"in i?i.color:SC});r.fillStyle=e;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function _R(t,n){var i=zf({},MR,t,n,this);if(!i)return null;var r,e="fillStyle"in i?i.fillStyle:GC,o=i.fill;void 0===o||o||(e=null),"imageStyle"in i?i.imageStyle!=DC&&(r=i.imageStyle):r=UC;var s="textStyle"in i?i.textStyle:WC,a="strokeStyle"in i?i.strokeStyle:BC,u=i.outline;return void 0===u||u?[new Qv({fill:e,image:r,stroke:a,text:s,zIndex:void 0})]:[new Qv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return i===Pt.GEOMETRY_COLLECTION?new cS(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n!==Pt.POLYGON&&n!==Pt.MULTI_POLYGON}))):i!==Pt.POLYGON&&i!==Pt.MULTI_POLYGON?n:void 0},fill:e,image:r,stroke:a,text:s,zIndex:void 0}),new Qv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return i===Pt.GEOMETRY_COLLECTION?new cS(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===Pt.POLYGON||n===Pt.MULTI_POLYGON}))):i===Pt.POLYGON||i===Pt.MULTI_POLYGON?n:void 0},fill:e,stroke:null,zIndex:void 0})]}function OR(t,n){var i,r,e,o=n.length,s=new Array(n.length),a=new Array(n.length),u=new Array(n.length);i=!1,r=!1,e=!1;for(var c=0;c<o;++c){var h=n[c];s[c]=h.get("extrude"),a[c]=h.get("tessellate"),u[c]=h.get("altitudeMode"),i=i||void 0!==s[c],r=r||void 0!==a[c],e=e||u[c]}i&&t.set("extrude",s),r&&t.set("tessellate",a),e&&t.set("altitudeMode",u)}var TR=If(CC,{displayName:Tf(uA),value:Tf(uA)});var ER=If(CC,{Data:function(t,n){var i=t.getAttribute("name");Nf(TR,t,n);var r=n[n.length-1];i&&r.displayName?r[i]={value:r.value,displayName:r.displayName,toString:function(){return r.value}}:null!==i?r[i]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,n){Nf(PR,t,n)}});function AR(t,n){Nf(ER,t,n)}function CR(t,n){Nf(zC,t,n)}var RR=If(CC,{Style:Tf(_R),key:Tf(uA),styleUrl:Tf(nR)});var PR=If(CC,{SimpleData:function(t,n){var i=t.getAttribute("name");if(null!==i){var r=uA(t);n[n.length-1][i]=r}}});var IR=If(CC,{altitudeMode:Tf(uA),minAltitude:Tf(eA),maxAltitude:Tf(eA),north:Tf(eA),south:Tf(eA),east:Tf(eA),west:Tf(eA)});var NR=If(CC,{minLodPixels:Tf(eA),maxLodPixels:Tf(eA),minFadeExtent:Tf(eA),maxFadeExtent:Tf(eA)});var zR=If(CC,{LinearRing:Mf(hR)});var FR=If(CC,{LinearRing:_f(hR)});function LR(t,n){for(var i=qo(n),r=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],e=0;e<4;++e){var o=Math.floor(r[e]).toString(16);r[e]=1==o.length?"0"+o:o}dA(t,r.join(""))}var GR=If(CC,{Data:Ef((function(t,n,i){t.setAttribute("name",n.name);var r={node:t},e=n.value;"object"==jC(e)?(null!==e&&e.displayName&&Lf(r,GR,Rf,[e.displayName],i,["displayName"]),null!==e&&e.value&&Lf(r,GR,Rf,[e.value],i,["value"])):Lf(r,GR,Rf,[e],i,["value"])})),value:Ef((function(t,n){dA(t,n)})),displayName:Ef((function(t,n){hA(t,n)}))});var DR=If(CC,{Placemark:Ef(fP)}),UR=function(t,n,i){return wf(n[n.length-1].node.namespaceURI,"Placemark")};var qR=Cf("Data");var BR=If(CC,["href"],If(AC,["x","y","w","h"])),WR=If(CC,{href:Ef(dA)},If(AC,{x:Ef(lA),y:Ef(lA),w:Ef(lA),h:Ef(lA)})),VR=function(t,n,i){return wf(AC[0],"gx:"+i)};var XR=If(CC,["scale","heading","Icon","color","hotSpot"]),HR=If(CC,{Icon:Ef((function(t,n,i){var r={node:t},e=i[i.length-1].node,o=BR[e.namespaceURI],s=Pf(n,o);Lf(r,WR,Rf,s,i,o),s=Pf(n,o=BR[AC[0]]),Lf(r,WR,VR,s,i,o)})),color:Ef(LR),heading:Ef(lA),hotSpot:Ef((function(t,n){t.setAttribute("x",String(n.x)),t.setAttribute("y",String(n.y)),t.setAttribute("xunits",n.xunits),t.setAttribute("yunits",n.yunits)})),scale:Ef(xP)});var JR=If(CC,["color","scale"]),KR=If(CC,{color:Ef(LR),scale:Ef(xP)});var YR=If(CC,["color","width"]),ZR=If(CC,{color:Ef(LR),width:Ef(lA)});var $R={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},QR=function(t,n,i){if(t)return wf(n[n.length-1].node.namespaceURI,$R[t.getType()])},tP=Cf("Point"),nP=Cf("LineString"),iP=Cf("LinearRing"),rP=Cf("Polygon"),eP=If(CC,{LineString:Ef(dP),Point:Ef(dP),Polygon:Ef(bP),GeometryCollection:Ef(oP)});function oP(t,n,i){var r,e={node:t},o=n.getType(),s=[];o===Pt.GEOMETRY_COLLECTION?(n.getGeometriesArrayRecursive().forEach((function(t){var n=t.getType();n===Pt.MULTI_POINT?s=s.concat(t.getPoints()):n===Pt.MULTI_LINE_STRING?s=s.concat(t.getLineStrings()):n===Pt.MULTI_POLYGON?s=s.concat(t.getPolygons()):n===Pt.POINT||n===Pt.LINE_STRING||n===Pt.POLYGON?s.push(t):Mt(!1,39)})),r=QR):o===Pt.MULTI_POINT?(s=n.getPoints(),r=tP):o===Pt.MULTI_LINE_STRING?(s=n.getLineStrings(),r=nP):o===Pt.MULTI_POLYGON?(s=n.getPolygons(),r=rP):Mt(!1,39),Lf(e,eP,r,s,i)}var sP=If(CC,{LinearRing:Ef(dP)});function aP(t,n,i){Lf({node:t},sP,iP,[n],i)}var uP=If(CC,{ExtendedData:Ef((function(t,n,i){for(var r={node:t},e=n.names,o=n.values,s=e.length,a=0;a<s;a++)Lf(r,GR,qR,[{name:e[a],value:o[a]}],i)})),MultiGeometry:Ef(oP),LineString:Ef(dP),LinearRing:Ef(dP),Point:Ef(dP),Polygon:Ef(bP),Style:Ef((function(t,n,i){var r={node:t},e={};if(n.pointStyles.length){var o=n.pointStyles[0].getText();o&&(e.LabelStyle=o);var s=n.pointStyles[0].getImage();s&&"function"==typeof s.getSrc&&(e.IconStyle=s)}if(n.lineStyles.length){(a=n.lineStyles[0].getStroke())&&(e.LineStyle=a)}if(n.polyStyles.length){var a;(a=n.polyStyles[0].getStroke())&&!e.LineStyle&&(e.LineStyle=a),e.PolyStyle=n.polyStyles[0]}var u=i[i.length-1].node,c=jP[u.namespaceURI],h=Pf(e,c);Lf(r,SP,Rf,h,i,c)})),address:Ef(dA),description:Ef(dA),name:Ef(dA),open:Ef(cA),phoneNumber:Ef(dA),styleUrl:Ef(dA),visibility:Ef(cA)}),cP=If(CC,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),hP=Cf("ExtendedData");function fP(t,n,i){var r={node:t};n.getId()&&t.setAttribute("id",n.getId());var e=n.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[n.getGeometryName()]=1;var s=Object.keys(e||{}).sort().filter((function(t){return!o[t]})),a=n.getStyleFunction();if(a){var u=a(n,0);if(u){var c=Array.isArray(u)?u:[u],h=c;if(n.getGeometry()&&(h=c.filter((function(t){var i=t.getGeometryFunction()(n);if(i){var r=i.getType();return r===Pt.GEOMETRY_COLLECTION?i.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===Pt.POINT||n===Pt.MULTI_POINT})).length:r===Pt.POINT||r===Pt.MULTI_POINT}}))),this.jy){var f=c,l=c;n.getGeometry()&&(f=c.filter((function(t){var i=t.getGeometryFunction()(n);if(i){var r=i.getType();return r===Pt.GEOMETRY_COLLECTION?i.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===Pt.LINE_STRING||n===Pt.MULTI_LINE_STRING})).length:r===Pt.LINE_STRING||r===Pt.MULTI_LINE_STRING}})),l=c.filter((function(t){var i=t.getGeometryFunction()(n);if(i){var r=i.getType();return r===Pt.GEOMETRY_COLLECTION?i.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===Pt.POLYGON||n===Pt.MULTI_POLYGON})).length:r===Pt.POLYGON||r===Pt.MULTI_POLYGON}}))),e.Style={pointStyles:h,lineStyles:f,polyStyles:l}}if(h.length&&void 0===e.name){var v=h[0].getText();v&&(e.name=v.getText())}}}var d=i[i.length-1].node,p=cP[d.namespaceURI],y=Pf(e,p);if(Lf(r,uP,Rf,y,i,p),s.length>0){var m=Pf(e,s);Lf(r,uP,hP,[{names:s,values:m}],i)}var w=i[0],b=n.getGeometry();b&&(b=Yj(b,!0,w)),Lf(r,uP,QR,[b],i)}var lP=If(CC,["extrude","tessellate","altitudeMode","coordinates"]),vP=If(CC,{extrude:Ef(cA),tessellate:Ef(cA),altitudeMode:Ef(dA),coordinates:Ef((function(t,n,i){var r,e=i[i.length-1],o=e.layout,s=e.stride;o==Et||o==Ct?r=2:o==At||o==Rt?r=3:Mt(!1,34);var a=n.length,u="";if(a>0){u+=n[0];for(var c=1;c<r;++c)u+=","+n[c];for(var h=s;h<a;h+=s){u+=" "+n[h];for(c=1;c<r;++c)u+=","+n[h+c]}}dA(t,u)}))});function dP(t,n,i){var r=n.getFlatCoordinates(),e={node:t};e.layout=n.getLayout(),e.stride=n.getStride();var o=n.getProperties();o.coordinates=r;var s=i[i.length-1].node,a=lP[s.namespaceURI],u=Pf(o,a);Lf(e,vP,Rf,u,i,a)}var pP=If(CC,["color","fill","outline"]),yP=If(CC,{outerBoundaryIs:Ef(aP),innerBoundaryIs:Ef(aP)}),mP=Cf("innerBoundaryIs"),wP=Cf("outerBoundaryIs");function bP(t,n,i){var r=n.getLinearRings(),e=r.shift(),o={node:t};Lf(o,yP,mP,r,i),Lf(o,yP,wP,[e],i)}var gP=If(CC,{color:Ef(LR),fill:Ef(cA),outline:Ef(cA)});function xP(t,n){lA(t,Math.round(1e6*n)/1e6)}var jP=If(CC,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),SP=If(CC,{IconStyle:Ef((function(t,n,i){var r={node:t},e={},o=n.getSrc(),s=n.getSize(),a=n.getImageSize(),u={href:o};if(s){u.w=s[0],u.h=s[1];var c=n.getAnchor(),h=n.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(u.x=h[0],u.y=a[1]-(h[1]+s[1])),c&&(c[0]!==s[0]/2||c[1]!==s[1]/2)){var f={x:c[0],xunits:Pv,y:s[1]-c[1],yunits:Pv};e.hotSpot=f}}e.Icon=u;var l=n.getScaleArray()[0],v=s;null===v&&(v=OC),2==v.length&&(l/=JC(v)),1!==l&&(e.scale=l);var d=n.getRotation();0!==d&&(e.heading=d);var p=n.getColor();p&&(e.color=p);var y=i[i.length-1].node,m=XR[y.namespaceURI],w=Pf(e,m);Lf(r,HR,Rf,w,i,m)})),LabelStyle:Ef((function(t,n,i){var r={node:t},e={},o=n.getFill();o&&(e.color=o.getColor());var s=n.getScale();s&&1!==s&&(e.scale=s);var a=i[i.length-1].node,u=JR[a.namespaceURI],c=Pf(e,u);Lf(r,KR,Rf,c,i,u)})),LineStyle:Ef((function(t,n,i){var r={node:t},e={color:n.getColor(),width:Number(n.getWidth())||1},o=i[i.length-1].node,s=YR[o.namespaceURI],a=Pf(e,s);Lf(r,ZR,Rf,a,i,s)})),PolyStyle:Ef((function(t,n,i){var r={node:t},e=n.getFill(),o=n.getStroke(),s={color:e?e.getColor():void 0,fill:!!e&&void 0,outline:!!o&&void 0},a=i[i.length-1].node,u=pP[a.namespaceURI],c=Pf(s,u);Lf(r,gP,Rf,c,i,u)}))});var kP=YC,MP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_P=[null],OP=If(_P,{nd:function(t,n){n[n.length-1].ndrefs.push(t.getAttribute("ref"))},tag:CP}),TP=If(_P,{node:function(t,n){var i=n[0],r=n[n.length-1],e=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];r.nodes[e]=o;var s=zf({tags:{}},AP,t,n);if(!R(s.tags)){var a=new Te(o);Yj(a,!1,i);var u=new Tt(a);void 0!==e&&u.setId(e),u.setProperties(s.tags,!0),r.features.push(u)}},way:function(t,n){var i=zf({id:t.getAttribute("id"),ndrefs:[],tags:{}},OP,t,n);n[n.length-1].ways.push(i)}}),EP=function(t){function n(){var n=t.call(this)||this;return n.dataProjection=gr("EPSG:4326"),n}return MP(n,t),n.prototype.readFeaturesFromNode=function(t,n){var i=this.getReadOptions(t,n);if("osm"==t.localName){for(var r=zf({nodes:{},ways:[],features:[]},TP,t,[i]),e=0;e<r.ways.length;e++){for(var o=r.ways[e],s=[],a=0,u=o.ndrefs.length;a<u;a++){b(s,r.nodes[o.ndrefs[a]])}var c=void 0;Yj(c=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new Ye(s,Et,[s.length]):new kj(s,Et),!1,i);var h=new Tt(c);void 0!==o.id&&h.setId(o.id),h.setProperties(o.tags,!0),r.features.push(h)}if(r.features)return r.features}return[]},n}(KE),AP=If(_P,{tag:CP});function CP(t,n){n[n.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}var RP=EP,PP=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readFromDocument(n)}return xf(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFromNode(n);return null},t.prototype.readFromNode=function(t){},t}();function IP(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var NP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zP=[null,"http://www.opengis.net/ows/1.1"],FP=If(zP,{ServiceIdentification:Tf((function(t,n){return zf({},YP,t,n)})),ServiceProvider:Tf((function(t,n){return zf({},ZP,t,n)})),OperationsMetadata:Tf((function(t,n){return zf({},XP,t,n)}))}),LP=function(t){function n(){return t.call(this)||this}return NP(n,t),n.prototype.readFromNode=function(t){var n=zf({},FP,t,[]);return n||null},n}(PP),GP=If(zP,{DeliveryPoint:Tf(uA),City:Tf(uA),AdministrativeArea:Tf(uA),PostalCode:Tf(uA),Country:Tf(uA),ElectronicMailAddress:Tf(uA)}),DP=If(zP,{Value:Of((function(t,n){return uA(t)}))}),UP=If(zP,{AllowedValues:Tf((function(t,n){return zf({},DP,t,n)}))}),qP=If(zP,{Phone:Tf((function(t,n){return zf({},HP,t,n)})),Address:Tf((function(t,n){return zf({},GP,t,n)}))}),BP=If(zP,{HTTP:Tf((function(t,n){return zf({},WP,t,n)}))}),WP=If(zP,{Get:Of((function(t,n){var i=IP(t);if(!i)return;return zf({href:i},JP,t,n)})),Post:void 0}),VP=If(zP,{DCP:Tf((function(t,n){return zf({},BP,t,n)}))}),XP=If(zP,{Operation:function(t,n){var i=t.getAttribute("name"),r=zf({},VP,t,n);if(!r)return;n[n.length-1][i]=r}}),HP=If(zP,{Voice:Tf(uA),Facsimile:Tf(uA)}),JP=If(zP,{Constraint:Of((function(t,n){var i=t.getAttribute("name");if(!i)return;return zf({name:i},UP,t,n)}))}),KP=If(zP,{IndividualName:Tf(uA),PositionName:Tf(uA),ContactInfo:Tf((function(t,n){return zf({},qP,t,n)}))}),YP=If(zP,{Abstract:Tf(uA),AccessConstraints:Tf(uA),Fees:Tf(uA),Title:Tf(uA),ServiceTypeVersion:Tf(uA),ServiceType:Tf(uA)}),ZP=If(zP,{ProviderName:Tf(uA),ProviderSite:Tf(IP),ServiceContact:Tf((function(t,n){return zf({},KP,t,n)}))});var $P=LP,QP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function tI(t,n,i){var r,e=i||1e5,o=new Array(n);for(r=0;r<n;++r)o[r]=0;for(var s=0,a=t.length;s<a;)for(r=0;r<n;++r,++s){var u=t[s],c=u-o[r];o[r]=u,t[s]=c}return iI(t,e)}function nI(t,n,i){var r,e=i||1e5,o=new Array(n);for(r=0;r<n;++r)o[r]=0;for(var s=rI(t,e),a=0,u=s.length;a<u;)for(r=0;r<n;++r,++a)o[r]+=s[a],s[a]=o[r];return s}function iI(t,n){for(var i=n||1e5,r=0,e=t.length;r<e;++r)t[r]=Math.round(t[r]*i);return eI(t)}function rI(t,n){for(var i=n||1e5,r=oI(t),e=0,o=r.length;e<o;++e)r[e]/=i;return r}function eI(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];t[n]=r<0?~(r<<1):r<<1}return sI(t)}function oI(t){for(var n=aI(t),i=0,r=n.length;i<r;++i){var e=n[i];n[i]=1&e?~(e>>1):e>>1}return n}function sI(t){for(var n="",i=0,r=t.length;i<r;++i)n+=uI(t[i]);return n}function aI(t){for(var n=[],i=0,r=0,e=0,o=t.length;e<o;++e){var s=t.charCodeAt(e)-63;i|=(31&s)<<r,s<32?(n.push(i),i=0,r=0):r+=5}return n}function uI(t){for(var n,i="";t>=32;)n=63+(32|31&t),i+=String.fromCharCode(n),t>>=5;return n=t+63,i+=String.fromCharCode(n)}var cI=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=gr("EPSG:4326"),i.Ay=r.factor?r.factor:1e5,i.Cy=r.geometryLayout?r.geometryLayout:Et,i}return QP(n,t),n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n);return new Tt(i)},n.prototype.readFeaturesFromText=function(t,n){return[this.readFeatureFromText(t,n)]},n.prototype.readGeometryFromText=function(t,n){var i=$r(this.Cy),r=nI(t,i,this.Ay);GE(r,0,r.length,i,r);var e=be(r,0,r.length,i);return Yj(new kj(e,this.Cy),!1,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):(Mt(!1,40),"")},n.prototype.writeFeaturesText=function(t,n){return this.writeFeatureText(t[0],n)},n.prototype.writeGeometryText=function(t,n){var i=(t=Yj(t,!0,this.adaptOptions(n))).getFlatCoordinates(),r=t.getStride();return GE(i,0,i.length,r,i),tI(i,r,this.Ay)},n}(lC),hI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fI=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.tv=r.layerName,i.qc=r.layers?r.layers:null,i.dataProjection=gr(r.dataProjection?r.dataProjection:"EPSG:4326"),i}return hI(n,t),n.prototype.readFeaturesFromObject=function(t,n){if("Topology"==t.type){var i=t,r=void 0,e=null,o=null;i.transform&&(e=(r=i.transform).scale,o=r.translate);var s=i.arcs;r&&function(t,n,i){for(var r=0,e=t.length;r<e;++r)yI(t[r],n,i)}(s,e,o);var a=[],u=i.objects,c=this.tv,h=void 0;for(var f in u)this.qc&&-1==this.qc.indexOf(f)||("GeometryCollection"===u[f].type?(h=u[f],a.push.apply(a,dI(h,s,e,o,c,f,n))):(h=u[f],a.push(pI(h,s,e,o,c,f,n))));return a}return[]},n.prototype.readProjectionFromObject=function(t){return this.dataProjection},n}(lS),lI={Point:function(t,n,i){var r=t.coordinates;n&&i&&mI(r,n,i);return new Te(r)},LineString:function(t,n){var i=vI(t.arcs,n);return new kj(i)},Polygon:function(t,n){for(var i=[],r=0,e=t.arcs.length;r<e;++r)i[r]=vI(t.arcs[r],n);return new Ye(i)},MultiPoint:function(t,n,i){var r=t.coordinates;if(n&&i)for(var e=0,o=r.length;e<o;++e)mI(r[e],n,i);return new bj(r)},MultiLineString:function(t,n){for(var i=[],r=0,e=t.arcs.length;r<e;++r)i[r]=vI(t.arcs[r],n);return new _j(i)},MultiPolygon:function(t,n){for(var i=[],r=0,e=t.arcs.length;r<e;++r){for(var o=t.arcs[r],s=[],a=0,u=o.length;a<u;++a)s[a]=vI(o[a],n);i[r]=s}return new Ej(i)}};function vI(t,n){for(var i,r=[],e=0,o=t.length;e<o;++e)if(i=t[e],e>0&&r.pop(),i>=0)for(var s=0,a=(u=n[i]).length;s<a;++s)r.push(u[s].slice(0));else{var u;for(s=(u=n[~i]).length-1;s>=0;--s)r.push(u[s].slice(0))}return r}function dI(t,n,i,r,e,o,s){for(var a=t.geometries,u=[],c=0,h=a.length;c<h;++c)u[c]=pI(a[c],n,i,r,e,o,s);return u}function pI(t,n,i,r,e,o,s){var a=null,u=t.type;if(u){var c=lI[u];a=Yj(a="Point"===u||"MultiPoint"===u?c(t,i,r):c(t,n),!1,s)}var h=new Tt({geometry:a});void 0!==t.id&&h.setId(t.id);var f=t.properties;return e&&(f||(f={}),f[e]=o),f&&h.setProperties(f,!0),h}function yI(t,n,i){for(var r=0,e=0,o=0,s=t.length;o<s;++o){var a=t[o];r+=a[0],e+=a[1],a[0]=r,a[1]=e,mI(a,n,i)}}function mI(t,n,i){t[0]=t[0]*n[0]+i[0],t[1]=t[1]*n[1]+i[1]}var wI=fI,bI=function(){function t(t){this.Ry=t}return t.prototype.getTagName=function(){return this.Ry},t}(),gI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xI=function(t){function n(n,i){var r=t.call(this,n)||this;return r.conditions=i,Mt(r.conditions.length>=2,57),r}return gI(n,t),n}(bI),jI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),SI=function(t){function n(n){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return jI(n,t),n}(xI),kI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),MI=function(t){function n(n,i,r){var e=t.call(this,"BBOX")||this;if(e.geometryName=n,e.extent=i,4!==i.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return e.srsName=r,e}return kI(n,t),n}(bI),_I=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),OI=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.geometryName=i||"the_geom",o.geometry=r,o.srsName=e,o}return _I(n,t),n}(bI),TI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),EI=function(t){function n(n,i,r){return t.call(this,"Contains",n,i,r)||this}return TI(n,t),n}(OI),AI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),CI=function(t){function n(n,i,r,e,o){var s=t.call(this,"DWithin",n,i,o)||this;return s.distance=r,s.unit=e,s}return AI(n,t),n}(OI),RI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),PI=function(t){function n(n,i,r){return t.call(this,"Disjoint",n,i,r)||this}return RI(n,t),n}(OI),II=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),NI=function(t){function n(n,i){var r=t.call(this,n)||this;return r.propertyName=i,r}return II(n,t),n}(bI),zI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),FI=function(t){function n(n,i,r){var e=t.call(this,"During",n)||this;return e.begin=i,e.end=r,e}return zI(n,t),n}(NI),LI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),GI=function(t){function n(n,i,r,e){var o=t.call(this,n,i)||this;return o.expression=r,o.matchCase=e,o}return LI(n,t),n}(NI),DI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),UI=function(t){function n(n,i,r){return t.call(this,"PropertyIsEqualTo",n,i,r)||this}return DI(n,t),n}(GI),qI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),BI=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThan",n,i)||this}return qI(n,t),n}(GI),WI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),VI=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThanOrEqualTo",n,i)||this}return WI(n,t),n}(GI),XI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),HI=function(t){function n(n,i,r){return t.call(this,"Intersects",n,i,r)||this}return XI(n,t),n}(OI),JI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),KI=function(t){function n(n,i,r){var e=t.call(this,"PropertyIsBetween",n)||this;return e.lowerBoundary=i,e.upperBoundary=r,e}return JI(n,t),n}(NI),YI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZI=function(t){function n(n,i,r,e,o,s){var a=t.call(this,"PropertyIsLike",n)||this;return a.pattern=i,a.wildCard=void 0!==r?r:"*",a.singleChar=void 0!==e?e:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}return YI(n,t),n}(NI),$I=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),QI=function(t){function n(n){return t.call(this,"PropertyIsNull",n)||this}return $I(n,t),n}(NI),tN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nN=function(t){function n(n,i){return t.call(this,"PropertyIsLessThan",n,i)||this}return tN(n,t),n}(GI),iN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rN=function(t){function n(n,i){return t.call(this,"PropertyIsLessThanOrEqualTo",n,i)||this}return iN(n,t),n}(GI),eN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oN=function(t){function n(n){var i=t.call(this,"Not")||this;return i.condition=n,i}return eN(n,t),n}(bI),sN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),aN=function(t){function n(n,i,r){return t.call(this,"PropertyIsNotEqualTo",n,i,r)||this}return sN(n,t),n}(GI),uN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cN=function(t){function n(n){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return uN(n,t),n}(xI),hN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fN=function(t){function n(n){var i=t.call(this,"ResourceId")||this;return i.rid=n,i}return hN(n,t),n}(bI),lN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vN=function(t){function n(n,i,r){return t.call(this,"Within",n,i,r)||this}return lN(n,t),n}(OI);function dN(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(SI,n))}function pN(t,n,i){return new MI(t,n,i)}var yN=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mN={"http://www.opengis.net/gml":{boundedBy:Tf(tA.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Mf(tA.prototype.readFeaturesInternal)}},wN={"http://www.opengis.net/wfs":{totalInserted:Tf(sA),totalUpdated:Tf(sA),totalDeleted:Tf(sA)},"http://www.opengis.net/wfs/2.0":{totalInserted:Tf(sA),totalUpdated:Tf(sA),totalDeleted:Tf(sA)}},bN={"http://www.opengis.net/wfs":{TransactionSummary:Tf(CN,"transactionSummary"),InsertResults:Tf(NN,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:Tf(CN,"transactionSummary"),InsertResults:Tf(NN,"insertIds")}},gN={"http://www.opengis.net/wfs":{PropertyName:Ef(dA)},"http://www.opengis.net/wfs/2.0":{PropertyName:Ef(dA)}},xN={"http://www.opengis.net/wfs":{Insert:Ef(zN),Update:Ef(DN),Delete:Ef(GN),Property:Ef(UN),Native:Ef(qN)},"http://www.opengis.net/wfs/2.0":{Insert:Ef(zN),Update:Ef(DN),Delete:Ef(GN),Property:Ef(UN),Native:Ef(qN)}},jN="feature",SN="http://www.w3.org/2000/xmlns/",kN={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},MN={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},_N={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},ON={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},TN={"2.0.0":OA,"1.1.0":jA,"1.0.0":wA},EN=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.sh=r.version?r.version:"1.1.0",i.Py=r.featureType,i.Iy=r.featureNS,i.Ny=r.gmlFormat?r.gmlFormat:new TN[i.sh],i.zy=r.schemaLocation?r.schemaLocation:ON[i.sh],i}return yN(n,t),n.prototype.getFeatureType=function(){return this.Py},n.prototype.setFeatureType=function(t){this.Py=t},n.prototype.readFeaturesFromNode=function(t,n){var i={node:t};E(i,{featureType:this.Py,featureNS:this.Iy}),E(i,this.getReadOptions(t,n||{}));var r=[i],e=zf([],"2.0.0"===this.sh?mN:this.Ny.FEATURE_COLLECTION_PARSERS,t,r,this.Ny);return e||(e=[]),e},n.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readTransactionResponseFromDocument(n)}return xf(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},n.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var n=Sf(t);return this.readFeatureCollectionMetadataFromDocument(n)}return xf(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},n.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)},n.prototype.readFeatureCollectionMetadataFromNode=function(t){var n={},i=aA(t.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,zf(n,mN,t,[],this.Ny)},n.prototype.readTransactionResponseFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)},n.prototype.readTransactionResponseFromNode=function(t){return zf({},bN,t,[])},n.prototype.writeGetFeature=function(t){var n=this,i=wf(MN[this.sh],"GetFeature");i.setAttribute("service","WFS"),i.setAttribute("version",this.sh),t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&i.setAttribute("count",String(t.count)),void 0!==t.viewParams&&i.setAttribute("viewParams",t.viewParams),i.setAttributeNS(mf,"xsi:schemaLocation",this.zy);var r={node:i};if(E(r,{version:this.sh,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.Iy,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Mt(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var e=t.filter;t.bbox&&(Mt(t.geometryName,12),e=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,e)),E(r,{geometryName:t.geometryName,filter:e}),sz(i,t.featureTypes,[r])}else t.featureTypes.forEach((function(e){var o=n.combineBboxAndFilter(e.geometryName,e.bbox,t.srsName,t.filter);E(r,{geometryName:e.geometryName,filter:o}),sz(i,[e.name],[r])}));return i},n.prototype.combineBboxAndFilter=function(t,n,i,r){var e=pN(t,n,i);return r?dN(r,e):e},n.prototype.writeTransaction=function(t,n,i,r){var e,o=[],s=r.version?r.version:this.sh,a=wf(MN[s],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",s),r&&(e=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(mf,"xsi:schemaLocation",ON[s]);var u=function(t,n,i,r){var e,o=r.featurePrefix?r.featurePrefix:jN;"1.0.0"===i?e=2:"1.1.0"===i?e=3:"2.0.0"===i&&(e=3.2);return E({node:t},{version:i,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:e,hasZ:r.hasZ,srsName:r.srsName},n)}(a,e,s,r);return t&&AN("Insert",t,o,u),n&&AN("Update",n,o,u),i&&AN("Delete",i,o,u),r.nativeElements&&AN("Native",r.nativeElements,o,u),a},n.prototype.readProjectionFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null},n.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var n=(t=t.firstElementChild.firstElementChild).firstElementChild;n;n=n.nextElementSibling)if(0!==n.childNodes.length&&(1!==n.childNodes.length||3!==n.firstChild.nodeType)){var i=[{}];return this.Ny.readGeometryElement(n,i),gr(i.pop().srsName)}return null},n}(KE);function AN(t,n,i,r){Lf(r,xN,Cf(t),n,i)}function CN(t,n){return zf({},wN,t,n)}var RN={"http://www.opengis.net/ogc":{FeatureId:Mf((function(t,n){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Mf((function(t,n){return t.getAttribute("fid")}))}};function PN(t,n){Nf(RN,t,n)}var IN={"http://www.opengis.net/wfs":{Feature:PN},"http://www.opengis.net/wfs/2.0":{Feature:PN}};function NN(t,n){return zf([],IN,t,n)}function zN(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s=r.gmlVersion,a=wf(o,e);t.appendChild(a),2===s?wA.prototype.writeFeatureElement(a,n,i):3===s?jA.prototype.writeFeatureElement(a,n,i):OA.prototype.writeFeatureElement(a,n,i)}function FN(t,n,i){var r=i[i.length-1].version,e=kN[r],o=wf(e,"Filter"),s=wf(e,"FeatureId");o.appendChild(s),s.setAttribute("fid",n),t.appendChild(o)}function LN(t,n){var i=(t=t||jN)+":";return 0===n.indexOf(i)?n:i+n}function GN(t,n,i){var r=i[i.length-1];Mt(void 0!==n.getId(),26);var e=r.featureType,o=r.featurePrefix,s=r.featureNS,a=LN(o,e);t.setAttribute("typeName",a),t.setAttributeNS(SN,"xmlns:"+o,s);var u=n.getId();void 0!==u&&FN(t,u,i)}function DN(t,n,i){var r=i[i.length-1];Mt(void 0!==n.getId(),27);var e=r.version,o=r.featureType,s=r.featurePrefix,a=r.featureNS,u=LN(s,o),c=n.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(SN,"xmlns:"+s,a);var h=n.getId();if(void 0!==h){for(var f=n.getKeys(),l=[],v=0,d=f.length;v<d;v++){var p=n.get(f[v]);if(void 0!==p){var y=f[v];p&&"function"==typeof p.getSimplifiedGeometry&&(y=c),l.push({name:y,value:p})}}Lf({version:e,gmlVersion:r.gmlVersion,node:t,hasZ:r.hasZ,srsName:r.srsName},xN,Cf("Property"),l,i),FN(t,h,i)}}function UN(t,n,i){var r=i[i.length-1],e=r.version,o=MN[e],s=wf(o,"Name"),a=r.gmlVersion;if(t.appendChild(s),dA(s,n.name),void 0!==n.value&&null!==n.value){var u=wf(o,"Value");t.appendChild(u),n.value&&"function"==typeof n.value.getSimplifiedGeometry?2===a?wA.prototype.writeGeometryElement(u,n.value,i):3===a?jA.prototype.writeGeometryElement(u,n.value,i):OA.prototype.writeGeometryElement(u,n.value,i):dA(u,n.value)}}function qN(t,n,i){n.vendorId&&t.setAttribute("vendorId",n.vendorId),void 0!==n.safeToIgnore&&t.setAttribute("safeToIgnore",String(n.safeToIgnore)),void 0!==n.value&&dA(t,n.value)}var BN={"http://www.opengis.net/wfs":{Query:Ef(WN)},"http://www.opengis.net/wfs/2.0":{Query:Ef(WN)},"http://www.opengis.net/ogc":{During:Ef(KN),And:Ef(YN),Or:Ef(YN),Not:Ef(ZN),BBOX:Ef(XN),Contains:Ef(HN),Intersects:Ef(HN),Within:Ef(HN),DWithin:Ef(JN),PropertyIsEqualTo:Ef($N),PropertyIsNotEqualTo:Ef($N),PropertyIsLessThan:Ef($N),PropertyIsLessThanOrEqualTo:Ef($N),PropertyIsGreaterThan:Ef($N),PropertyIsGreaterThanOrEqualTo:Ef($N),PropertyIsNull:Ef(QN),PropertyIsBetween:Ef(tz),PropertyIsLike:Ef(nz)},"http://www.opengis.net/fes/2.0":{During:Ef(KN),And:Ef(YN),Or:Ef(YN),Not:Ef(ZN),BBOX:Ef(XN),Contains:Ef(HN),Disjoint:Ef(HN),Intersects:Ef(HN),ResourceId:Ef((function(t,n,i){t.setAttribute("rid",n.rid)})),Within:Ef(HN),DWithin:Ef(JN),PropertyIsEqualTo:Ef($N),PropertyIsNotEqualTo:Ef($N),PropertyIsLessThan:Ef($N),PropertyIsLessThanOrEqualTo:Ef($N),PropertyIsGreaterThan:Ef($N),PropertyIsGreaterThanOrEqualTo:Ef($N),PropertyIsNull:Ef(QN),PropertyIsBetween:Ef(tz),PropertyIsLike:Ef(nz)}};function WN(t,n,i){var r,e,o=i[i.length-1],s=o.version,a=o.featurePrefix,u=o.featureNS,c=o.propertyNames,h=o.srsName;r=a?LN(a,n):n,e="2.0.0"===s?"typeNames":"typeName",t.setAttribute(e,r),h&&t.setAttribute("srsName",h),u&&t.setAttributeNS(SN,"xmlns:"+a,u);var f=E({},o);f.node=t,Lf(f,gN,Cf("PropertyName"),c,i);var l=o.filter;if(l){var v=wf(az(s),"Filter");t.appendChild(v),VN(v,l,i)}}function VN(t,n,i){var r=i[i.length-1],e={node:t};E(e,{context:r}),Lf(e,BN,Cf(n.getTagName()),[n],i)}function XN(t,n,i){var r=i[i.length-1],e=r.context.version;r.srsName=n.srsName;var o=TN[e];ez(e,t,n.geometryName),o.prototype.writeGeometryElement(t,n.extent,i)}function HN(t,n,i){var r=i[i.length-1],e=r.context.version;r.srsName=n.srsName;var o=TN[e];ez(e,t,n.geometryName),o.prototype.writeGeometryElement(t,n.geometry,i)}function JN(t,n,i){var r=i[i.length-1].context.version;HN(t,n,i);var e=wf(az(r),"Distance");dA(e,n.distance.toString()),"2.0.0"===r?e.setAttribute("uom",n.unit):e.setAttribute("units",n.unit),t.appendChild(e)}function KN(t,n,i){var r=i[i.length-1].context.version;iz(_N[r],"ValueReference",t,n.propertyName);var e=wf(ZE,"TimePeriod");t.appendChild(e);var o=wf(ZE,"begin");e.appendChild(o),oz(o,n.begin);var s=wf(ZE,"end");e.appendChild(s),oz(s,n.end)}function YN(t,n,i){var r=i[i.length-1].context,e={node:t};E(e,{context:r});for(var o=n.conditions,s=0,a=o.length;s<a;++s){var u=o[s];Lf(e,BN,Cf(u.getTagName()),[u],i)}}function ZN(t,n,i){var r=i[i.length-1].context,e={node:t};E(e,{context:r});var o=n.condition;Lf(e,BN,Cf(o.getTagName()),[o],i)}function $N(t,n,i){var r=i[i.length-1].context.version;void 0!==n.matchCase&&t.setAttribute("matchCase",n.matchCase.toString()),ez(r,t,n.propertyName),rz(r,t,""+n.expression)}function QN(t,n,i){ez(i[i.length-1].context.version,t,n.propertyName)}function tz(t,n,i){var r=i[i.length-1].context.version,e=az(r);ez(r,t,n.propertyName);var o=wf(e,"LowerBoundary");t.appendChild(o),rz(r,o,""+n.lowerBoundary);var s=wf(e,"UpperBoundary");t.appendChild(s),rz(r,s,""+n.upperBoundary)}function nz(t,n,i){var r=i[i.length-1].context.version;t.setAttribute("wildCard",n.wildCard),t.setAttribute("singleChar",n.singleChar),t.setAttribute("escapeChar",n.escapeChar),void 0!==n.matchCase&&t.setAttribute("matchCase",n.matchCase.toString()),ez(r,t,n.propertyName),rz(r,t,""+n.pattern)}function iz(t,n,i,r){var e=wf(t,n);dA(e,r),i.appendChild(e)}function rz(t,n,i){iz(az(t),"Literal",n,i)}function ez(t,n,i){"2.0.0"===t?iz(_N[t],"ValueReference",n,i):iz(kN[t],"PropertyName",n,i)}function oz(t,n){var i=wf(ZE,"TimeInstant");t.appendChild(i);var r=wf(ZE,"timePosition");i.appendChild(r),dA(r,n)}function sz(t,n,i){var r=i[i.length-1],e=E({},r);e.node=t,Lf(e,BN,Cf("Query"),n,i)}function az(t){return"2.0.0"===t?_N[t]:kN[t]}var uz=EN,cz=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hz=1,fz=2,lz=3,vz=4,dz=5,pz=6,yz=7,mz=15,wz=16,bz=17,gz=function(){function t(t){this.Fy=t,this.Ly=0,this.Gy=!1,this.Dy=!1,this.Uy=!1,this.qy=!1,this.By=null,this.Wy=Et}return t.prototype.readUint8=function(){return this.Fy.getUint8(this.Ly++)},t.prototype.readUint32=function(t){return this.Fy.getUint32((this.Ly+=4)-4,void 0!==t?t:this.Dy)},t.prototype.readDouble=function(t){return this.Fy.getFloat64((this.Ly+=8)-8,void 0!==t?t:this.Dy)},t.prototype.readPoint=function(){var t=[];return t.push(this.readDouble()),t.push(this.readDouble()),this.Uy&&t.push(this.readDouble()),this.qy&&t.push(this.readDouble()),t},t.prototype.readLineString=function(){for(var t=this.readUint32(),n=[],i=0;i<t;i++)n.push(this.readPoint());return n},t.prototype.readPolygon=function(){for(var t=this.readUint32(),n=[],i=0;i<t;i++)n.push(this.readLineString());return n},t.prototype.readWkbHeader=function(t){var n=this.readUint8()>0,i=this.readUint32(n),r=Math.floor((268435455&i)/1e3),e=Boolean(2147483648&i)||1===r||3===r,o=Boolean(1073741824&i)||2===r||3===r,s=Boolean(536870912&i),a=(268435455&i)%1e3,u=["XY",e?"Z":"",o?"M":""].join(""),c=s?this.readUint32(n):null;if(void 0!==t&&t!==a)throw new Error("Unexpected WKB geometry type "+a);if(this.Gy){if(this.Dy!==n)throw new Error("Inconsistent endian");if(this.Wy!==u)throw new Error("Inconsistent geometry layout");if(c&&this.By!==c)throw new Error("Inconsistent coordinate system (SRID)")}else this.Dy=n,this.Uy=e,this.qy=o,this.Wy=u,this.By=c,this.Gy=!0;return a},t.prototype.readWkbPayload=function(t){switch(t){case hz:return this.readPoint();case fz:return this.readLineString();case lz:case bz:return this.readPolygon();case vz:return this.readMultiPoint();case dz:return this.readMultiLineString();case pz:case mz:case wz:return this.readMultiPolygon();case yz:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}},t.prototype.readWkbBlock=function(t){return this.readWkbPayload(this.readWkbHeader(t))},t.prototype.readWkbCollection=function(t,n){for(var i=this.readUint32(),r=[],e=0;e<i;e++){var o=t.call(this,n);o&&r.push(o)}return r},t.prototype.readMultiPoint=function(){return this.readWkbCollection(this.readWkbBlock,hz)},t.prototype.readMultiLineString=function(){return this.readWkbCollection(this.readWkbBlock,fz)},t.prototype.readMultiPolygon=function(){return this.readWkbCollection(this.readWkbBlock,lz)},t.prototype.readGeometryCollection=function(){return this.readWkbCollection(this.readGeometry)},t.prototype.readGeometry=function(){var t=this.readWkbHeader(),n=this.readWkbPayload(t);switch(t){case hz:return new Te(n,this.Wy);case fz:return new kj(n,this.Wy);case lz:case bz:return new Ye(n,this.Wy);case vz:return new bj(n,this.Wy);case dz:return new _j(n,this.Wy);case pz:case mz:case wz:return new Ej(n,this.Wy);case yz:return new cS(n);default:return null}},t.prototype.getSrid=function(){return this.By},t}(),xz=function(){function t(t){t=t||{},this.Wy=t.layout,this.Dy=!1!==t.littleEndian,this.Vy=!1!==t.ewkb,this.Xy=[],this.Hy=E({X:0,Y:0,Z:0,M:0},t.nodata)}return t.prototype.writeUint8=function(t){this.Xy.push([1,t])},t.prototype.writeUint32=function(t){this.Xy.push([4,t])},t.prototype.writeDouble=function(t){this.Xy.push([8,t])},t.prototype.writePoint=function(t,n){for(var i=E.apply(null,n.split("").map((function(n,i){var r;return(r={})[n]=t[i],r}))),r=0,e=this.Wy;r<e.length;r++){var o=e[r];this.writeDouble(o in i?i[o]:this.Hy[o])}},t.prototype.writeLineString=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writePoint(t[i],n)},t.prototype.writePolygon=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeLineString(t[i],n)},t.prototype.writeWkbHeader=function(t,n){t%=1e3,this.Wy.indexOf("Z")>=0&&(t+=this.Vy?2147483648:1e3),this.Wy.indexOf("M")>=0&&(t+=this.Vy?1073741824:2e3),this.Vy&&Number.isInteger(n)&&(t|=536870912),this.writeUint8(this.Dy?1:0),this.writeUint32(t),this.Vy&&Number.isInteger(n)&&this.writeUint32(n)},t.prototype.writeMultiPoint=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeWkbHeader(1),this.writePoint(t[i],n)},t.prototype.writeMultiLineString=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeWkbHeader(2),this.writeLineString(t[i],n)},t.prototype.writeMultiPolygon=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeWkbHeader(3),this.writePolygon(t[i],n)},t.prototype.writeGeometryCollection=function(t){this.writeUint32(t.length);for(var n=0;n<t.length;n++)this.writeGeometry(t[n])},t.prototype.findMinimumLayout=function(t,n){void 0===n&&(n=Rt);var i,r;if(t instanceof te)return(i=t.getLayout())===(r=n)?i:i===Rt?r:r===Rt?i:Et;if(t instanceof cS)for(var e=t.getGeometriesArray(),o=0;o<e.length&&n!==Et;o++)n=this.findMinimumLayout(e[o],n);return n},t.prototype.writeGeometry=function(t,n){var i,r,e=((i={})[Pt.POINT]=hz,i[Pt.LINE_STRING]=fz,i[Pt.POLYGON]=lz,i[Pt.MULTI_POINT]=vz,i[Pt.MULTI_LINE_STRING]=dz,i[Pt.MULTI_POLYGON]=pz,i[Pt.GEOMETRY_COLLECTION]=yz,i),o=t.getType(),s=e[o];if(!s)throw new Error("GeometryType "+o+" is not supported");(this.Wy||(this.Wy=this.findMinimumLayout(t)),this.writeWkbHeader(s,n),t instanceof te)?((r={})[Pt.POINT]=this.writePoint,r[Pt.LINE_STRING]=this.writeLineString,r[Pt.POLYGON]=this.writePolygon,r[Pt.MULTI_POINT]=this.writeMultiPoint,r[Pt.MULTI_LINE_STRING]=this.writeMultiLineString,r[Pt.MULTI_POLYGON]=this.writeMultiPolygon,r)[o].call(this,t.getCoordinates(),t.getLayout()):t instanceof cS&&this.writeGeometryCollection(t.getGeometriesArray())},t.prototype.getBuffer=function(){var t=this,n=this.Xy.reduce((function(t,n){return t+n[0]}),0),i=new ArrayBuffer(n),r=new DataView(i),e=0;return this.Xy.forEach((function(n){switch(n[0]){case 1:r.setUint8(e,n[1]);break;case 4:r.setUint32(e,n[1],t.Dy);break;case 8:r.setFloat64(e,n[1],t.Dy)}e+=n[0]})),i},t}();function jz(t){return"string"==typeof t?function(t){for(var n=new Uint8Array(t.length/2),i=0;i<t.length/2;i++)n[i]=parseInt(t.substr(2*i,2),16);return new DataView(n.buffer)}(t):ArrayBuffer.isView(t)?t instanceof DataView?t:new DataView(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new DataView(t):null}var Sz=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.splitCollection=Boolean(r.splitCollection),i.Jy=null,i.Ky=!1!==r.hex,i.Yy=!1!==r.littleEndian,i.Zy=!1!==r.ewkb,i.Wy=r.geometryLayout,i.$y=r.nodataZ||0,i.Qy=r.nodataM||0,i.By=r.srid,i}return cz(n,t),n.prototype.getType=function(){return this.Ky?hh:uh},n.prototype.readFeature=function(t,n){return new Tt({geometry:this.readGeometry(t,n)})},n.prototype.readFeatures=function(t,n){var i=this.readGeometry(t,n);return(this.splitCollection&&i instanceof cS?i.getGeometriesArray():[i]).map((function(t){return new Tt({geometry:t})}))},n.prototype.readGeometry=function(t,n){var i=jz(t);if(!i)return null;var r=new gz(i).readGeometry();this.Jy=i;var e=this.getReadOptions(t,n);return this.Jy=null,Yj(r,!1,e)},n.prototype.readProjection=function(t){var n=this.Jy||jz(t);if(n){var i=new gz(n);return i.readWkbHeader(),i.getSrid()&&gr("EPSG:"+i.getSrid())||void 0}},n.prototype.writeFeature=function(t,n){return this.writeGeometry(t.getGeometry(),n)},n.prototype.writeFeatures=function(t,n){return this.writeGeometry(new cS(t.map((function(t){return t.getGeometry()}))),n)},n.prototype.writeGeometry=function(t,n){var i=this.adaptOptions(n),r=new xz({layout:this.Wy,littleEndian:this.Yy,ewkb:this.Zy,nodata:{Z:this.$y,M:this.Qy}}),e=Number.isInteger(this.By)?Number(this.By):null;if(!1!==this.By&&!Number.isInteger(this.By)){var o=i.dataProjection&&gr(i.dataProjection);if(o){var s=o.getCode();0===s.indexOf("EPSG:")&&(e=Number(s.substring(5)))}}r.writeGeometry(Yj(t,!0,i),e);var a=r.getBuffer();return this.Ky?function(t){var n=new Uint8Array(t);return Array.from(n.values()).map((function(t){return(t<16?"0":"")+Number(t).toString(16).toUpperCase()})).join("")}(a):a},n}(Kj),kz=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mz={POINT:Te,LINESTRING:kj,POLYGON:Ye,MULTIPOINT:bj,MULTILINESTRING:_j,MULTIPOLYGON:Ej},_z="EMPTY",Oz=0,Tz=1,Ez=2,Az=3,Cz=4,Rz=5,Pz=6,Iz={};for(var Nz in Pt)Iz[Nz]=Pt[Nz].toUpperCase();var zz=function(){function t(t){this.wkt=t,this.tm=-1}return t.prototype.nm=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.im=function(t,n){return t>="0"&&t<="9"||"."==t&&!(void 0!==n&&n)},t.prototype.rm=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.om=function(){return this.wkt.charAt(++this.tm)},t.prototype.nextToken=function(){var t,n=this.om(),i=this.tm,r=n;if("("==n)t=Ez;else if(","==n)t=Rz;else if(")"==n)t=Az;else if(this.im(n)||"-"==n)t=Cz,r=this.sm();else if(this.nm(n))t=Tz,r=this.am();else{if(this.rm(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=Pz}return{position:i,value:r,type:t}},t.prototype.sm=function(){var t,n=this.tm,i=!1,r=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.om()}while(this.im(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(n,this.tm--))},t.prototype.am=function(){var t,n=this.tm;do{t=this.om()}while(this.nm(t));return this.wkt.substring(n,this.tm--).toUpperCase()},t}(),Fz=function(){function t(t){this.um=t,this.hm={position:0,type:Oz},this.Wy=Et}return t.prototype.fm=function(){this.hm=this.um.nextToken()},t.prototype.isTokenType=function(t){return this.hm.type==t},t.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.fm(),n},t.prototype.parse=function(){return this.fm(),this.lm()},t.prototype.vm=function(){var t=Et,n=this.hm;if(this.isTokenType(Tz)){var i=n.value;"Z"===i?t=At:"M"===i?t=Ct:"ZM"===i&&(t=Rt),t!==Et&&this.fm()}return t},t.prototype.dm=function(){if(this.match(Ez)){var t=[];do{t.push(this.lm())}while(this.match(Rz));if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.ym=function(){if(this.match(Ez)){var t=this.wm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.bm=function(){if(this.match(Ez)){var t=this.gm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.xm=function(){if(this.match(Ez)){var t=this.jm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.Sm=function(){if(this.match(Ez)){var t=void 0;if(t=this.hm.type==Ez?this.km():this.gm(),this.match(Az))return t}throw new Error(this.pm())},t.prototype.Mm=function(){if(this.match(Ez)){var t=this.jm();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype._m=function(){if(this.match(Ez)){var t=this.Om();if(this.match(Az))return t}throw new Error(this.pm())},t.prototype.wm=function(){for(var t=[],n=this.Wy.length,i=0;i<n;++i){var r=this.hm;if(!this.match(Cz))break;t.push(r.value)}if(t.length==n)return t;throw new Error(this.pm())},t.prototype.gm=function(){for(var t=[this.wm()];this.match(Rz);)t.push(this.wm());return t},t.prototype.km=function(){for(var t=[this.ym()];this.match(Rz);)t.push(this.ym());return t},t.prototype.jm=function(){for(var t=[this.bm()];this.match(Rz);)t.push(this.bm());return t},t.prototype.Om=function(){for(var t=[this.xm()];this.match(Rz);)t.push(this.xm());return t},t.prototype.Tm=function(){var t=this.isTokenType(Tz)&&this.hm.value==_z;return t&&this.fm(),t},t.prototype.pm=function(){return"Unexpected `"+this.hm.value+"` at position "+this.hm.position+" in `"+this.um.wkt+"`"},t.prototype.lm=function(){var t=this.hm;if(this.match(Tz)){var n=t.value;this.Wy=this.vm();var i=this.Tm();if("GEOMETRYCOLLECTION"==n){if(i)return new cS([]);var r=this.dm();return new cS(r)}var e=Mz[n];if(!e)throw new Error("Invalid geometry type: "+n);var o=void 0;if(i)o="POINT"==n?[NaN,NaN]:[];else switch(n){case"POINT":o=this.ym();break;case"LINESTRING":o=this.bm();break;case"POLYGON":o=this.xm();break;case"MULTIPOINT":o=this.Sm();break;case"MULTILINESTRING":o=this.Mm();break;case"MULTIPOLYGON":o=this._m()}return new e(o,this.Wy)}throw new Error(this.pm())},t}(),Lz=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Em=void 0!==r.splitCollection&&r.splitCollection,i}return kz(n,t),n.prototype.Am=function(t){var n=new zz(t);return new Fz(n).parse()},n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n),r=new Tt;return r.setGeometry(i),r},n.prototype.readFeaturesFromText=function(t,n){for(var i=[],r=this.readGeometryFromText(t,n),e=[],o=0,s=(i=this.Em&&r.getType()==Pt.GEOMETRY_COLLECTION?r.getGeometriesArray():[r]).length;o<s;++o){var a=new Tt;a.setGeometry(i[o]),e.push(a)}return e},n.prototype.readGeometryFromText=function(t,n){return Yj(this.Am(t),!1,n)},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):""},n.prototype.writeFeaturesText=function(t,n){if(1==t.length)return this.writeFeatureText(t[0],n);for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r].getGeometry());var o=new cS(i);return this.writeGeometryText(o,n)},n.prototype.writeGeometryText=function(t,n){return Bz(Yj(t,!0,n))},n}(lC);function Gz(t){var n=t.getCoordinates();return 0===n.length?"":n.join(" ")}function Dz(t){for(var n=t.getCoordinates(),i=[],r=0,e=n.length;r<e;++r)i.push(n[r].join(" "));return i.join(",")}function Uz(t){for(var n=[],i=t.getLinearRings(),r=0,e=i.length;r<e;++r)n.push("("+Dz(i[r])+")");return n.join(",")}var qz={Point:Gz,LineString:Dz,Polygon:Uz,MultiPoint:function(t){for(var n=[],i=t.getPoints(),r=0,e=i.length;r<e;++r)n.push("("+Gz(i[r])+")");return n.join(",")},MultiLineString:function(t){for(var n=[],i=t.getLineStrings(),r=0,e=i.length;r<e;++r)n.push("("+Dz(i[r])+")");return n.join(",")},MultiPolygon:function(t){for(var n=[],i=t.getPolygons(),r=0,e=i.length;r<e;++r)n.push("("+Uz(i[r])+")");return n.join(",")},GeometryCollection:function(t){for(var n=[],i=t.getGeometries(),r=0,e=i.length;r<e;++r)n.push(Bz(i[r]));return n.join(",")}};function Bz(t){var n=t.getType(),i=(0,qz[n])(t);if(n=n.toUpperCase(),"function"==typeof t.getFlatCoordinates){var r=function(t){var n=t.getLayout(),i="";return n!==At&&n!==Rt||(i+="Z"),n!==Ct&&n!==Rt||(i+="M"),i}(t);r.length>0&&(n+=" "+r)}return 0===i.length?n+" "+_z:n+"("+i+")"}var Wz=Lz,Vz=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xz=[null,"http://www.opengis.net/wms"],Hz=If(Xz,{Service:Tf((function(t,n){return zf({},Yz,t,n)})),Capability:Tf((function(t,n){return zf({},Jz,t,n)}))}),Jz=If(Xz,{Request:Tf((function(t,n){return zf({},eF,t,n)})),Exception:Tf((function(t,n){return zf([],tF,t,n)})),Layer:Tf((function(t,n){var i=zf({},nF,t,n);if(void 0===i.Layer)return Object.assign(i,fF(t,n));return i}))}),Kz=function(t){function n(){var n=t.call(this)||this;return n.version=void 0,n}return Vz(n,t),n.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var n=zf({version:this.version},Hz,t,[]);return n||null},n}(PP),Yz=If(Xz,{Name:Tf(uA),Title:Tf(uA),Abstract:Tf(uA),KeywordList:Tf(pF),OnlineResource:Tf(IP),ContactInformation:Tf((function(t,n){return zf({},Zz,t,n)})),Fees:Tf(uA),AccessConstraints:Tf(uA),LayerLimit:Tf(sA),MaxWidth:Tf(sA),MaxHeight:Tf(sA)}),Zz=If(Xz,{ContactPersonPrimary:Tf((function(t,n){return zf({},$z,t,n)})),ContactPosition:Tf(uA),ContactAddress:Tf((function(t,n){return zf({},Qz,t,n)})),ContactVoiceTelephone:Tf(uA),ContactFacsimileTelephone:Tf(uA),ContactElectronicMailAddress:Tf(uA)}),$z=If(Xz,{ContactPerson:Tf(uA),ContactOrganization:Tf(uA)}),Qz=If(Xz,{AddressType:Tf(uA),Address:Tf(uA),City:Tf(uA),StateOrProvince:Tf(uA),PostCode:Tf(uA),Country:Tf(uA)}),tF=If(Xz,{Format:Mf(uA)}),nF=If(Xz,{Name:Tf(uA),Title:Tf(uA),Abstract:Tf(uA),KeywordList:Tf(pF),CRS:Of(uA),EX_GeographicBoundingBox:Tf((function(t,n){var i=zf({},rF,t,n);if(!i)return;var r=i.westBoundLongitude,e=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===e||void 0===o||void 0===s)return;return[r,e,o,s]})),BoundingBox:Of((function(t,n){var i=[oA(t.getAttribute("minx")),oA(t.getAttribute("miny")),oA(t.getAttribute("maxx")),oA(t.getAttribute("maxy"))],r=[oA(t.getAttribute("resx")),oA(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}})),Dimension:Of((function(t,n){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:iA(t.getAttribute("multipleValues")),nearestValue:iA(t.getAttribute("nearestValue")),current:iA(t.getAttribute("current")),values:uA(t)}})),Attribution:Tf((function(t,n){return zf({},iF,t,n)})),AuthorityURL:Of((function(t,n){var i=lF(t,n);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:Of(uA),MetadataURL:Of((function(t,n){var i=lF(t,n);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:Of(lF),FeatureListURL:Of(lF),Style:Of((function(t,n){return zf({},uF,t,n)})),MinScaleDenominator:Tf(eA),MaxScaleDenominator:Tf(eA),Layer:Of(fF)}),iF=If(Xz,{Title:Tf(uA),OnlineResource:Tf(IP),LogoURL:Tf(dF)}),rF=If(Xz,{westBoundLongitude:Tf(eA),eastBoundLongitude:Tf(eA),southBoundLatitude:Tf(eA),northBoundLatitude:Tf(eA)}),eF=If(Xz,{GetCapabilities:Tf(vF),GetMap:Tf(vF),GetFeatureInfo:Tf(vF)}),oF=If(Xz,{Format:Of(uA),DCPType:Of((function(t,n){return zf({},sF,t,n)}))}),sF=If(Xz,{HTTP:Tf((function(t,n){return zf({},aF,t,n)}))}),aF=If(Xz,{Get:Tf(lF),Post:Tf(lF)}),uF=If(Xz,{Name:Tf(uA),Title:Tf(uA),Abstract:Tf(uA),LegendURL:Of(dF),StyleSheetURL:Tf(lF),StyleURL:Tf(lF)}),cF=If(Xz,{Format:Tf(uA),OnlineResource:Tf(IP)}),hF=If(Xz,{Keyword:Mf(uA)});function fF(t,n){var i=n[n.length-1],r=zf({},nF,t,n);if(r){var e=iA(t.getAttribute("queryable"));void 0===e&&(e=i.queryable),r.queryable=void 0!==e&&e;var o=aA(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded),r.cascaded=o;var s=iA(t.getAttribute("opaque"));void 0===s&&(s=i.opaque),r.opaque=void 0!==s&&s;var a=iA(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets),r.noSubsets=void 0!==a&&a;var u=oA(t.getAttribute("fixedWidth"));u||(u=i.fixedWidth),r.fixedWidth=u;var c=oA(t.getAttribute("fixedHeight"));c||(c=i.fixedHeight),r.fixedHeight=c;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in i){var n=r[t]||[];r[t]=n.concat(i[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var n=i[t];r[t]=n}})),r}}function lF(t,n){return zf({},cF,t,n)}function vF(t,n){return zf({},oF,t,n)}function dF(t,n){var i=lF(t,n);if(i){var r=[aA(t.getAttribute("width")),aA(t.getAttribute("height"))];return i.size=r,i}}function pF(t,n){return zf([],hF,t,n)}var yF=Kz,mF=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wF=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Iy="http://mapserver.gis.umn.edu/mapserver",i.Ny=new wA,i.qc=r.layers?r.layers:null,i}return mF(n,t),n.prototype.getLayers=function(){return this.qc},n.prototype.setLayers=function(t){this.qc=t},n.prototype.Cm=function(t,n){t.setAttribute("namespaceURI",this.Iy);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var e=0,o=t.childNodes.length;e<o;e++){var s=t.childNodes[e];if(s.nodeType===Node.ELEMENT_NODE){var a=s,u=n[0],c=a.localName.replace("_layer","");if(!this.qc||y(this.qc,c)){var h=c+"_feature";u.featureType=h,u.featureNS=this.Iy;var f={};f[h]=Mf(this.Ny.readFeatureElement,this.Ny);var l=If([u.featureNS,null],f);a.setAttribute("namespaceURI",this.Iy);var v=zf([],l,a,n,this.Ny);v&&b(r,v)}}}if("FeatureCollection"==i){var d=zf([],this.Ny.FEATURE_COLLECTION_PARSERS,t,[{}],this.Ny);d&&(r=d)}return r},n.prototype.readFeaturesFromNode=function(t,n){var i={};return n&&E(i,this.getReadOptions(t,n)),this.Cm(t,[i])},n}(KE),bF=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gF=[null,"http://www.opengis.net/wmts/1.0"],xF=[null,"http://www.opengis.net/ows/1.1"],jF=If(gF,{Contents:Tf((function(t,n){return zf({},kF,t,n)}))}),SF=function(t){function n(){var n=t.call(this)||this;return n.Rm=new $P,n}return bF(n,t),n.prototype.readFromNode=function(t){var n=t.getAttribute("version");n&&(n=n.trim());var i=this.Rm.readFromNode(t);return i?(i.version=n,(i=zf(i,jF,t,[]))||null):null},n}(PP),kF=If(gF,{Layer:Of((function(t,n){return zf({},MF,t,n)})),TileMatrixSet:Of((function(t,n){return zf({},RF,t,n)}))}),MF=If(gF,{Style:Of((function(t,n){var i=zf({},_F,t,n);if(!i)return;var r="true"===t.getAttribute("isDefault");return i.isDefault=r,i})),Format:Of(uA),TileMatrixSetLink:Of((function(t,n){return zf({},OF,t,n)})),Dimension:Of((function(t,n){return zf({},AF,t,n)})),ResourceURL:Of((function(t,n){var i=t.getAttribute("format"),r=t.getAttribute("template"),e=t.getAttribute("resourceType"),o={};i&&(o.format=i);r&&(o.template=r);e&&(o.resourceType=e);return o}))},If(xF,{Title:Tf(uA),Abstract:Tf(uA),WGS84BoundingBox:Tf(IF),Identifier:Tf(uA)})),_F=If(gF,{LegendURL:Of((function(t,n){var i={};return i.format=t.getAttribute("format"),i.href=IP(t),i}))},If(xF,{Title:Tf(uA),Identifier:Tf(uA)})),OF=If(gF,{TileMatrixSet:Tf(uA),TileMatrixSetLimits:Tf((function(t,n){return zf([],TF,t,n)}))}),TF=If(gF,{TileMatrixLimits:Mf((function(t,n){return zf({},EF,t,n)}))}),EF=If(gF,{TileMatrix:Tf(uA),MinTileRow:Tf(sA),MaxTileRow:Tf(sA),MinTileCol:Tf(sA),MaxTileCol:Tf(sA)}),AF=If(gF,{Default:Tf(uA),Value:Of(uA)},If(xF,{Identifier:Tf(uA)})),CF=If(xF,{LowerCorner:Mf(NF),UpperCorner:Mf(NF)}),RF=If(gF,{WellKnownScaleSet:Tf(uA),TileMatrix:Of((function(t,n){return zf({},PF,t,n)}))},If(xF,{SupportedCRS:Tf(uA),Identifier:Tf(uA),BoundingBox:Tf(IF)})),PF=If(gF,{TopLeftCorner:Tf(NF),ScaleDenominator:Tf(eA),TileWidth:Tf(sA),TileHeight:Tf(sA),MatrixWidth:Tf(sA),MatrixHeight:Tf(sA)},If(xF,{Identifier:Tf(uA)}));function IF(t,n){var i=zf([],CF,t,n);if(2==i.length)return jn(i)}function NF(t,n){var i=uA(t).split(/\s+/);if(i&&2==i.length){var r=+i[0],e=+i[1];if(!isNaN(r)&&!isNaN(e))return[r,e]}}var zF=SF,FF=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),LF=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],GF="enterfullscreen",DF="leavefullscreen";function UF(t){var n=t.body;return!!(n.webkitRequestFullscreen||n.msRequestFullscreen&&t.msFullscreenEnabled||n.requestFullscreen&&t.fullscreenEnabled)}function qF(t){return!!(t.webkitIsFullScreen||t.msFullscreenElement||t.fullscreenElement)}function BF(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var WF=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).on,i.once,i.un,i.nh=void 0!==r.keys&&r.keys,i.Ov=r.source,i.Pm=!1,i.Im=i.Nm.bind(i),i.zm=void 0!==r.className?r.className:"ol-full-screen",i.Fm=[],i.Lm=void 0!==r.activeClassName?r.activeClassName.split(" "):[i.zm+"-true"],i.Gm=void 0!==r.inactiveClassName?r.inactiveClassName.split(" "):[i.zm+"-false"];var e=void 0!==r.label?r.label:"⤢";i.Dm="string"==typeof e?document.createTextNode(e):e;var o=void 0!==r.labelActive?r.labelActive:"×";i.Um="string"==typeof o?document.createTextNode(o):o;var s=r.tipLabel?r.tipLabel:"Toggle full-screen";return i.qm=document.createElement("button"),i.qm.title=s,i.qm.setAttribute("type","button"),i.qm.appendChild(i.Dm),i.qm.addEventListener(G,i.Rr.bind(i),!1),i.Bm(i.qm,i.Pm),i.element.className="".concat(i.zm," ").concat(Ts," ").concat(As),i.element.appendChild(i.qm),i}return FF(n,t),n.prototype.Rr=function(t){t.preventDefault(),this.Wm()},n.prototype.Wm=function(){var t=this.getMap();if(t){var n=t.getOwnerDocument();if(UF(n))if(qF(n))!function(t){t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}(n);else{var i=void 0;i=this.Ov?"string"==typeof this.Ov?n.getElementById(this.Ov):this.Ov:t.getTargetElement(),this.nh?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():BF(t)}(i):BF(i)}}},n.prototype.Vm=function(){var t=this.getMap();if(t){var n=this.Pm;this.Pm=qF(t.getOwnerDocument()),n!==this.Pm&&(this.Bm(this.qm,this.Pm),this.Pm?(Ao(this.Um,this.Dm),this.dispatchEvent(GF)):(Ao(this.Dm,this.Um),this.dispatchEvent(DF)),t.updateSize())}},n.prototype.Bm=function(t,n){var i,r,e,o;n?((i=t.classList).remove.apply(i,this.Gm),(r=t.classList).add.apply(r,this.Lm)):((e=t.classList).remove.apply(e,this.Lm),(o=t.classList).add.apply(o,this.Gm))},n.prototype.setMap=function(n){var i=this.getMap();i&&i.removeChangeListener(Ea,this.Im),t.prototype.setMap.call(this,n),this.Nm(),n&&n.addChangeListener(Ea,this.Im)},n.prototype.Nm=function(){for(var t=this.Fm,n=0,i=t.length;n<i;++n)$(t[n]);t.length=0;var r=this.getMap();if(r){var e=r.getOwnerDocument();UF(e)?this.element.classList.remove(Es):this.element.classList.add(Es);for(n=0,i=LF.length;n<i;++n)t.push(Y(e,LF[n],this.Vm,this));this.Vm()}},n}(du),VF=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),XF="projection",HF="coordinateFormat",JF=function(t){function n(n){var i=this,r=n||{},e=document.createElement("div");e.className=void 0!==r.className?r.className:"ol-mouse-position",(i=t.call(this,{element:e,render:r.render,target:r.target})||this).on,i.once,i.un,i.addChangeListener(XF,i.Tt),r.coordinateFormat&&i.setCoordinateFormat(r.coordinateFormat),r.projection&&i.setProjection(r.projection);var o=!0,s="&#160;";return"undefinedHTML"in r?(void 0!==r.undefinedHTML&&(s=r.undefinedHTML),o=!!s):"placeholder"in r&&(!1===r.placeholder?o=!1:s=String(r.placeholder)),i.Xm=s,i.Hm=o,i.Jm=e.innerHTML,i.Km=null,i._t=null,i}return VF(n,t),n.prototype.Tt=function(){this._t=null},n.prototype.getCoordinateFormat=function(){return this.get(HF)},n.prototype.getProjection=function(){return this.get(XF)},n.prototype.handleMouseMove=function(t){var n=this.getMap();this.Ym(n.getEventPixel(t))},n.prototype.handleMouseOut=function(t){this.Ym(null)},n.prototype.setMap=function(n){if(t.prototype.setMap.call(this,n),n){var i=n.getViewport();this.listenerKeys.push(Y(i,ya,this.handleMouseMove,this)),this.Hm&&this.listenerKeys.push(Y(i,ba,this.handleMouseOut,this)),this.Ym(null)}},n.prototype.setCoordinateFormat=function(t){this.set(HF,t)},n.prototype.setProjection=function(t){this.set(XF,gr(t))},n.prototype.Ym=function(t){var n=this.Xm;if(t&&this.Km){if(!this._t){var i=this.getProjection();this._t=i?Er(this.Km,i):mr}var r=this.getMap().getCoordinateFromPixelInternal(t);if(r){var e=Nr();e&&(this._t=Er(this.Km,e)),this._t(r,r);var o=this.getCoordinateFormat();n=o?o(r):r.toString()}}this.Jm&&n===this.Jm||(this.element.innerHTML=n,this.Jm=n)},n.prototype.render=function(t){var n=t.frameState;n?this.Km!=n.viewState.projection&&(this.Km=n.viewState.projection,this._t=null):this.Km=null},n}(du),KF=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),YF=.75,ZF=.1,$F=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return KF(n,t),n.prototype.createRenderer=function(){return new sa(this)},n}(lu),QF=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).Zm=i.$m.bind(i),i.kr=void 0===r.collapsed||r.collapsed,i.Tr=void 0===r.collapsible||r.collapsible,i.Tr||(i.kr=!1),i.ca=void 0!==r.rotateWithView&&r.rotateWithView,i.Qm=void 0;var e=void 0!==r.className?r.className:"ol-overviewmap",o=void 0!==r.tipLabel?r.tipLabel:"Overview map",s=void 0!==r.collapseLabel?r.collapseLabel:"‹";"string"==typeof s?(i.Er=document.createElement("span"),i.Er.textContent=s):i.Er=s;var a=void 0!==r.label?r.label:"›";"string"==typeof a?(i.Ar=document.createElement("span"),i.Ar.textContent=a):i.Ar=a;var u=i.Tr&&!i.kr?i.Er:i.Ar,c=document.createElement("button");c.setAttribute("type","button"),c.title=o,c.appendChild(u),c.addEventListener(G,i.Rr.bind(i),!1),i.tw=document.createElement("div"),i.tw.className="ol-overviewmap-map",i.Fy=r.view,i.nw=new $F({view:r.view});var h=i.nw;r.layers&&r.layers.forEach((function(t){h.addLayer(t)}));var f=document.createElement("div");f.className="ol-overviewmap-box",f.style.boxSizing="border-box",i.iw=new qc({position:[0,0],positioning:Ac,element:f}),i.nw.addOverlay(i.iw);var l=e+" "+"ol-unselectable "+As+(i.kr&&i.Tr?" ol-collapsed":"")+(i.Tr?"":" ol-uncollapsible"),v=i.element;v.className=l,v.appendChild(i.tw),v.appendChild(c);var d=i,p=i.iw,y=i.iw.getElement(),m=function(t){var n,i={clientX:(n=t).clientX,clientY:n.clientY},r=h.getEventCoordinateInternal(i);p.setPosition(r)},w=function t(n){var i=h.getEventCoordinateInternal(n);d.getMap().getView().setCenterInternal(i),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",t)};return y.addEventListener("mousedown",(function(){window.addEventListener("mousemove",m),window.addEventListener("mouseup",w)})),i}return KF(n,t),n.prototype.setMap=function(n){var i=this.getMap();if(n!==i){if(i){var r=i.getView();r&&this.rw(r),this.nw.setTarget(null)}if(t.prototype.setMap.call(this,n),n){this.nw.setTarget(this.tw),this.listenerKeys.push(Y(n,l,this.ew,this));var e=n.getView();e&&(this.ow(e),e.isDef()&&(this.nw.updateSize(),this.sw())),this.nw.isRendered()||this.aw()}}},n.prototype.ew=function(t){if(t.key===Aa){var n=t.oldValue;n&&this.rw(n);var i=this.getMap().getView();this.ow(i)}else this.nw.isRendered()||t.key!==Ea&&t.key!==Ta||this.nw.updateSize()},n.prototype.ow=function(t){if(!this.Fy){var n=new eu({projection:t.getProjection()});this.nw.setView(n)}t.addChangeListener(La.ROTATION,this.Zm),this.$m()},n.prototype.rw=function(t){t.removeChangeListener(La.ROTATION,this.Zm)},n.prototype.$m=function(){this.ca&&this.nw.getView().setRotation(this.getMap().getView().getRotation())},n.prototype.uw=function(){var t=this.getMap(),n=this.nw;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView().calculateExtentInternal(i);if(!this.Qm||!Nn(r,this.Qm)){this.Qm=r;var e=n.getSize(),o=n.getView().calculateExtentInternal(e),s=n.getPixelFromCoordinateInternal($n(r)),a=n.getPixelFromCoordinateInternal(Xn(r)),u=Math.abs(s[0]-a[0]),c=Math.abs(s[1]-a[1]),h=e[0],f=e[1];u<h*ZF||c<f*ZF||u>h*YF||c>f*YF?this.sw():On(o,r)||this.cw()}}},n.prototype.sw=function(){var t=this.getMap(),n=this.nw,i=t.getSize(),r=t.getView().calculateExtentInternal(i),e=n.getView(),o=Math.log(7.5)/Math.LN2;ei(r,1/(Math.pow(2,o/2)*ZF)),e.fitInternal($e(r))},n.prototype.cw=function(){var t=this.getMap(),n=this.nw,i=t.getView();n.getView().setCenterInternal(i.getCenterInternal())},n.prototype.hw=function(){var t=this.getMap(),n=this.nw;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView(),e=n.getView(),o=this.ca?0:-r.getRotation(),s=this.iw,a=this.iw.getElement(),u=r.getCenterInternal(),c=r.getResolution(),h=e.getResolution(),f=i[0]*c/h,l=i[1]*c/h;if(s.setPosition(u),a){a.style.width=f+"px",a.style.height=l+"px";var v="rotate("+o+"rad)";a.style.transform=v}}},n.prototype.aw=function(){this.fw||(this.fw=Z(this.nw,ja,(function(t){delete this.fw,this.hw()}),this))},n.prototype.Rr=function(t){t.preventDefault(),this.zr()},n.prototype.zr=function(){this.element.classList.toggle(Cs),this.kr?Ao(this.Er,this.Ar):Ao(this.Ar,this.Er),this.kr=!this.kr;var t=this.nw;if(!this.kr){if(t.isRendered())return this.Qm=void 0,void t.render();t.updateSize(),this.sw(),this.aw()}},n.prototype.getCollapsible=function(){return this.Tr},n.prototype.setCollapsible=function(t){this.Tr!==t&&(this.Tr=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.kr&&this.zr())},n.prototype.setCollapsed=function(t){this.Tr&&this.kr!==t&&this.zr()},n.prototype.getCollapsed=function(){return this.kr},n.prototype.getRotateWithView=function(){return this.ca},n.prototype.setRotateWithView=function(t){this.ca!==t&&(this.ca=t,0!==this.getMap().getView().getRotation()&&(this.ca?this.$m():this.nw.getView().setRotation(0),this.Qm=void 0,this.uw(),this.hw()))},n.prototype.getOverviewMap=function(){return this.nw},n.prototype.render=function(t){this.uw(),this.hw()},n}(du),tL=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nL="units",iL="degrees",rL="imperial",eL="nautical",oL="metric",sL="us",aL=[1,2,5],uL=25.4/.28,cL=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,i.once,i.un,i.lw=document.createElement("div"),i.lw.className=e+"-inner",i.element.className=e+" "+Ts,i.element.appendChild(i.lw),i.dw=null,i.pw=void 0!==r.minWidth?r.minWidth:64,i.mn=!1,i.yw=void 0,i.Jm="",i.addChangeListener(nL,i.mw),i.setUnits(r.units||oL),i.ww=r.bar||!1,i.bw=r.steps||4,i.gw=r.text||!1,i.xw=r.dpi||void 0,i}return tL(n,t),n.prototype.getUnits=function(){return this.get(nL)},n.prototype.mw=function(){this.Nr()},n.prototype.setUnits=function(t){this.set(nL,t)},n.prototype.setDpi=function(t){this.xw=t},n.prototype.Nr=function(){var t=this.dw;if(t){var n=t.center,i=t.projection,r=this.getUnits(),e=r==iL?Gt.DEGREES:Gt.METERS,o=xr(i,t.resolution,n,e),s=this.pw*(this.xw||uL)/uL,a=s*o,u="";if(r==iL){var c=Ft[Gt.DEGREES];(a*=c)<c/60?(u="″",o*=3600):a<c?(u="′",o*=60):u="°"}else r==rL?a<.9144?(u="in",o/=.0254):a<1609.344?(u="ft",o/=.3048):(u="mi",o/=1609.344):r==eL?(o/=1852,u="nm"):r==oL?a<.001?(u="μm",o*=1e6):a<1?(u="mm",o*=1e3):a<1e3?u="m":(u="km",o/=1e3):r==sL?a<.9144?(u="in",o*=39.37):a<1609.344?(u="ft",o/=.30480061):(u="mi",o/=1609.3472):Mt(!1,33);for(var h,f,l,v,d=3*Math.floor(Math.log(s*o)/Math.log(10));;){l=Math.floor(d/3);var p=Math.pow(10,l);if(h=aL[(d%3+3)%3]*p,f=Math.round(h/o),isNaN(f))return this.element.style.display="none",void(this.mn=!1);if(f>=s)break;++d}v=this.ww?this.createScaleBar(f,h,u):h.toFixed(l<0?-l:0)+" "+u,this.Jm!=v&&(this.lw.innerHTML=v,this.Jm=v),this.yw!=f&&(this.lw.style.width=f+"px",this.yw=f),this.mn||(this.element.style.display="",this.mn=!0)}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.createScaleBar=function(t,n,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),e=[],o=t/this.bw,s="#ffffff",a=0;a<this.bw;a++)0===a&&e.push(this.createMarker("absolute",a)),e.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+s+';"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.bw?this.createStepText(a,t,!1,n,i):"")+"</div>"),a===this.bw-1&&e.push(this.createStepText(a+1,t,!0,n,i)),s="#ffffff"===s?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.gw?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</div>":"")+e.join("")+"</div>"},n.prototype.createMarker=function(t,n){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},n.prototype.createStepText=function(t,n,i,r,e){var o=(0===t?0:Math.round(r/this.bw*t*100)/100)+(0===t?"":" "+e);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:n/this.bw*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:n/this.bw*2)+"px;left: "+(i?n+"px":"unset")+';">'+o+"</div>"},n.prototype.getScaleForResolution=function(){var t=xr(this.dw.projection,this.dw.resolution,this.dw.center,Gt.METERS),n=this.xw||uL;return parseFloat(t.toString())*(1e3/25.4)*n},n.prototype.render=function(t){var n=t.frameState;this.dw=n?n.viewState:null,this.Nr()},n}(du),hL=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fL=0,lL=1,vL=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render})||this).Rn=[],i.jw=void 0,i.Sw=fL,i.Cn,i.kw=0,i.Mw=0,i._w,i.Ow,i.Tw=null,i.Ew=!1,i.Lr=void 0!==r.duration?r.duration:200;var e=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=e+"-thumb "+Ts;var s=i.element;return s.className=e+" "+"ol-unselectable "+As,s.appendChild(o),s.addEventListener(ma,i.Aw.bind(i),!1),s.addEventListener(ya,i.Cw.bind(i),!1),s.addEventListener(wa,i.Rw.bind(i),!1),s.addEventListener(G,i.Pw.bind(i),!1),o.addEventListener(G,h,!1),i}return hL(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),n&&n.render()},n.prototype.Iw=function(){var t=this.element,n=t.offsetWidth,i=t.offsetHeight;if(0===n&&0===i)return this.Ew=!1;var r=getComputedStyle(t);n-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var e=t.firstElementChild,o=getComputedStyle(e),s=e.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),a=e.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.Tw=[s,a],n>i?(this.Sw=lL,this.Mw=n-s):(this.Sw=fL,this.kw=i-a),this.Ew=!0},n.prototype.Pw=function(t){var n=this.getMap().getView(),i=this.Nw(t.offsetX-this.Tw[0]/2,t.offsetY-this.Tw[1]/2),r=this.zw(i),e=n.getConstrainedZoom(n.getZoomForResolution(r));n.animateInternal({zoom:e,duration:this.Lr,easing:wt})},n.prototype.Aw=function(t){if(!this.Cn&&t.target===this.element.firstElementChild){var n=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this._w=t.clientX-parseFloat(n.style.left),this.Ow=t.clientY-parseFloat(n.style.top),this.Cn=!0,0===this.Rn.length){var i=this.Cw,r=this.Rw,e=this.getMap().getOwnerDocument();this.Rn.push(Y(e,ya,i,this),Y(e,wa,r,this))}}},n.prototype.Cw=function(t){if(this.Cn){var n=t.clientX-this._w,i=t.clientY-this.Ow,r=this.Nw(n,i);this.jw=this.zw(r),this.getMap().getView().setResolution(this.jw)}},n.prototype.Rw=function(t){this.Cn&&(this.getMap().getView().endInteraction(),this.Cn=!1,this._w=void 0,this.Ow=void 0,this.Rn.forEach($),this.Rn.length=0)},n.prototype.Fw=function(t){var n=this.Lw(t),i=this.element.firstElementChild;this.Sw==lL?i.style.left=this.Mw*n+"px":i.style.top=this.kw*n+"px"},n.prototype.Nw=function(t,n){return ci(this.Sw===lL?t/this.Mw:n/this.kw,0,1)},n.prototype.zw=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},n.prototype.Lw=function(t){return ci(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},n.prototype.render=function(t){if(t.frameState&&(this.Ew||this.Iw())){var n=t.frameState.viewState.resolution;this.jw=n,this.Fw(n)}},n}(du),dL=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pL=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var e=void 0!==r.className?r.className:"ol-zoom-extent",o=void 0!==r.label?r.label:"E",s=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",a=document.createElement("button");a.setAttribute("type","button"),a.title=s,a.appendChild("string"==typeof o?document.createTextNode(o):o),a.addEventListener(G,i.Rr.bind(i),!1);var u=e+" "+"ol-unselectable "+As,c=i.element;return c.className=u,c.appendChild(a),i}return dL(n,t),n.prototype.Rr=function(t){t.preventDefault(),this.handleZoomToExtent()},n.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),n=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal($e(n))},n}(du),yL={};yL.AssertionError=c,yL.Collection=ft,yL.Collection.CollectionEvent=ht,yL.DataTile=kt,yL.Disposable=v,yL.Feature=Tt,yL.Feature.createStyleFunction=Ot,yL.Geolocation=vo,yL.Image=ko,yL.Image.listenImage=So,yL.ImageBase=yo,yL.ImageCanvas=_o,yL.ImageTile=No,yL.Kinetic=zo,yL.Map=Mc,yL.MapBrowserEvent=da,yL.MapBrowserEventHandler=xa,yL.MapEvent=la,yL.Object=ot,yL.Object.ObjectEvent=et,yL.Observable=it,yL.Observable.unByKey=nt,yL.Overlay=qc,yL.PluggableMap=lu,yL.Tile=jt,yL.TileCache=$c,yL.TileQueue=Ia,yL.TileQueue.getTilePriority=Na,yL.TileRange=nh,yL.TileRange.createOrUpdate=th,yL.VectorRenderTile=eh,yL.VectorTile=sh,yL.View=eu,yL.View.createCenterConstraint=Qa,yL.View.createResolutionConstraint=tu,yL.View.createRotationConstraint=nu,yL.View.isNoopAnimation=iu,yL.array={},yL.array.binarySearch=d,yL.array.equals=x,yL.array.extend=b,yL.array.find=g,yL.array.findIndex=j,yL.array.includes=y,yL.array.isSorted=S,yL.array.linearFindNearest=m,yL.array.numberSafeCompareFunction=p,yL.array.remove=function(t,n){var i=t.indexOf(n),r=i>-1;return r&&t.splice(i,1),r},yL.array.reverseSubArray=w,yL.array.stableSort=function(t,n){var i,r=t.length,e=Array(t.length);for(i=0;i<r;i++)e[i]={index:i,value:t[i]};for(e.sort((function(t,i){return n(t.value,i.value)||t.index-i.index})),i=0;i<t.length;i++)t[i]=e[i].value},yL.asserts={},yL.asserts.assert=Mt,yL.centerconstraint={},yL.centerconstraint.createExtent=Da,yL.centerconstraint.none=Ua,yL.color={},yL.color.asArray=qo,yL.color.asString=Go,yL.color.fromString=Uo,yL.color.isStringColor=Vo,yL.color.normalize=Bo,yL.color.toString=Wo,yL.colorlike={},yL.colorlike.asColorLike=ah,yL.control={},yL.control.Attribution=yu,yL.control.Control=du,yL.control.FullScreen=WF,yL.control.MousePosition=JF,yL.control.OverviewMap=QF,yL.control.Rotate=wu,yL.control.ScaleLine=cL,yL.control.Zoom=gu,yL.control.ZoomSlider=vL,yL.control.ZoomToExtent=pL,yL.control.defaults=xu,yL.coordinate={},yL.coordinate.add=Ki,yL.coordinate.closestOnCircle=Yi,yL.coordinate.closestOnSegment=Zi,yL.coordinate.createStringXY=function(t){return function(n){return sr(n,t)}},yL.coordinate.degreesToStringHDMS=$i,yL.coordinate.distance=er,yL.coordinate.equals=tr,yL.coordinate.format=Qi,yL.coordinate.getWorldsAway=ur,yL.coordinate.rotate=nr,yL.coordinate.scale=ir,yL.coordinate.squaredDistance=rr,yL.coordinate.squaredDistanceToSegment=or,yL.coordinate.toStringHDMS=function(t,n){return t?$i("NS",t[1],n)+" "+$i("EW",t[0],n):""},yL.coordinate.toStringXY=sr,yL.coordinate.wrapX=ar,yL.css={},yL.css.CLASS_COLLAPSED=Cs,yL.css.CLASS_CONTROL=As,yL.css.CLASS_HIDDEN=_s,yL.css.CLASS_SELECTABLE=Os,yL.css.CLASS_UNSELECTABLE=Ts,yL.css.CLASS_UNSUPPORTED=Es,yL.css.cssOpacity=Ns,yL.css.getFontParameters=Is,yL.dom={},yL.dom.createCanvasContext2D=Oo,yL.dom.outerHeight=Eo,yL.dom.outerWidth=To,yL.dom.removeChildren=Ro,yL.dom.removeNode=Co,yL.dom.replaceChildren=Po,yL.dom.replaceNode=Ao,yL.easing={},yL.easing.easeIn=mt,yL.easing.easeOut=wt,yL.easing.inAndOut=bt,yL.easing.linear=gt,yL.easing.upAndDown=function(t){return t<.5?bt(2*t):1-bt(2*(t-.5))},yL.events={},yL.events.Event=f,yL.events.Event.preventDefault=function(t){t.preventDefault()},yL.events.Event.stopPropagation=h,yL.events.Target=I,yL.events.condition={},yL.events.condition.all=Ru,yL.events.condition.altKeyOnly=Pu,yL.events.condition.altShiftKeysOnly=Iu,yL.events.condition.always=Fu,yL.events.condition.click=function(t){return t.type==pa.CLICK},yL.events.condition.doubleClick=function(t){return t.type==pa.DBLCLICK},yL.events.condition.focus=Nu,yL.events.condition.focusWithTabindex=zu,yL.events.condition.mouseActionButton=Lu,yL.events.condition.mouseOnly=Wu,yL.events.condition.never=Gu,yL.events.condition.noModifierKeys=Uu,yL.events.condition.penOnly=function(t){var n=t.originalEvent;return Mt(void 0!==n,56),"pen"===n.pointerType},yL.events.condition.platformModifierKeyOnly=function(t){var n=t.originalEvent;return!n.altKey&&(Vt?n.metaKey:n.ctrlKey)&&!n.shiftKey},yL.events.condition.pointerMove=function(t){return"pointermove"==t.type},yL.events.condition.primaryAction=Vu,yL.events.condition.shiftKeyOnly=qu,yL.events.condition.singleClick=Du,yL.events.condition.targetNotEditable=Bu,yL.events.condition.touchOnly=function(t){var n=t.originalEvent;return Mt(void 0!==n,56),"touch"===n.pointerType},yL.events.listen=Y,yL.events.listenOnce=Z,yL.events.unlistenByKey=$,yL.extent={},yL.extent.applyTransform=si,yL.extent.approximatelyEquals=zn,yL.extent.boundingExtent=jn,yL.extent.buffer=Sn,yL.extent.clone=kn,yL.extent.closestSquaredDistanceXY=Mn,yL.extent.containsCoordinate=_n,yL.extent.containsExtent=On,yL.extent.containsXY=Tn,yL.extent.coordinateRelationship=En,yL.extent.createEmpty=An,yL.extent.createOrUpdate=Cn,yL.extent.createOrUpdateEmpty=Rn,yL.extent.createOrUpdateFromCoordinate=Pn,yL.extent.createOrUpdateFromCoordinates=function(t,n){return Gn(Rn(n),t)},yL.extent.createOrUpdateFromFlatCoordinates=In,yL.extent.createOrUpdateFromRings=function(t,n){return Un(Rn(n),t)},yL.extent.equals=Nn,yL.extent.extend=Fn,yL.extent.extendCoordinate=Ln,yL.extent.extendCoordinates=Gn,yL.extent.extendFlatCoordinates=Dn,yL.extent.extendRings=Un,yL.extent.extendXY=qn,yL.extent.forEachCorner=Bn,yL.extent.getArea=Wn,yL.extent.getBottomLeft=Vn,yL.extent.getBottomRight=Xn,yL.extent.getCenter=Hn,yL.extent.getCorner=Jn,yL.extent.getEnlargedArea=function(t,n){var i=Math.min(t[0],n[0]),r=Math.min(t[1],n[1]);return(Math.max(t[2],n[2])-i)*(Math.max(t[3],n[3])-r)},yL.extent.getForViewAndSize=Kn,yL.extent.getHeight=Yn,yL.extent.getIntersection=Zn,yL.extent.getIntersectionArea=function(t,n){return Wn(Zn(t,n))},yL.extent.getMargin=function(t){return ti(t)+Yn(t)},yL.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},yL.extent.getTopLeft=$n,yL.extent.getTopRight=Qn,yL.extent.getWidth=ti,yL.extent.intersects=ni,yL.extent.intersectsSegment=oi,yL.extent.isEmpty=ii,yL.extent.returnOrUpdate=ri,yL.extent.scaleFromCenter=ei,yL.extent.wrapX=ai,yL.featureloader={},yL.featureloader.loadFeaturesXhr=vh,yL.featureloader.setWithCredentials=function(t){lh=t},yL.featureloader.xhr=dh,yL.format={},yL.format.EsriJSON=HE,yL.format.Feature=Kj,yL.format.Feature.transformExtentWithOptions=Zj,yL.format.Feature.transformGeometryWithOptions=Yj,yL.format.GML=kA,yL.format.GML2=wA,yL.format.GML3=jA,yL.format.GML32=OA,yL.format.GMLBase=tA,yL.format.GMLBase.GMLNS=ZE,yL.format.GPX=cC,yL.format.GeoJSON=yS,yL.format.IGC=xC,yL.format.IIIFInfo=Mb,yL.format.JSONFeature=lS,yL.format.KML=kP,yL.format.KML.getDefaultFillStyle=function(){return GC},yL.format.KML.getDefaultImageStyle=function(){return UC},yL.format.KML.getDefaultStrokeStyle=function(){return BC},yL.format.KML.getDefaultStyle=function(){return VC},yL.format.KML.getDefaultStyleArray=function(){return HC},yL.format.KML.getDefaultTextStyle=function(){return WC},yL.format.KML.readFlatCoordinates=QC,yL.format.MVT=eS,yL.format.OSMXML=RP,yL.format.OWS=$P,yL.format.Polyline=cI,yL.format.Polyline.decodeDeltas=nI,yL.format.Polyline.decodeFloats=rI,yL.format.Polyline.decodeSignedIntegers=oI,yL.format.Polyline.decodeUnsignedIntegers=aI,yL.format.Polyline.encodeDeltas=tI,yL.format.Polyline.encodeFloats=iI,yL.format.Polyline.encodeSignedIntegers=eI,yL.format.Polyline.encodeUnsignedInteger=uI,yL.format.Polyline.encodeUnsignedIntegers=sI,yL.format.TextFeature=lC,yL.format.TopoJSON=wI,yL.format.WFS=uz,yL.format.WFS.writeFilter=function(t,n){var i=n||"1.1.0",r=wf(az(i),"Filter"),e={node:r};return E(e,{version:i,filter:t}),VN(r,t,[e]),r},yL.format.WKB=Sz,yL.format.WKT=Wz,yL.format.WMSCapabilities=yF,yL.format.WMSGetFeatureInfo=wF,yL.format.WMTSCapabilities=zF,yL.format.XML=PP,yL.format.XMLFeature=KE,yL.format.filter={},yL.format.filter.And=SI,yL.format.filter.Bbox=MI,yL.format.filter.Comparison=NI,yL.format.filter.ComparisonBinary=GI,yL.format.filter.Contains=EI,yL.format.filter.DWithin=CI,yL.format.filter.Disjoint=PI,yL.format.filter.During=FI,yL.format.filter.EqualTo=UI,yL.format.filter.Filter=bI,yL.format.filter.GreaterThan=BI,yL.format.filter.GreaterThanOrEqualTo=VI,yL.format.filter.Intersects=HI,yL.format.filter.IsBetween=KI,yL.format.filter.IsLike=ZI,yL.format.filter.IsNull=QI,yL.format.filter.LessThan=nN,yL.format.filter.LessThanOrEqualTo=rN,yL.format.filter.LogicalNary=xI,yL.format.filter.Not=oN,yL.format.filter.NotEqualTo=aN,yL.format.filter.Or=cN,yL.format.filter.ResourceId=fN,yL.format.filter.Spatial=OI,yL.format.filter.Within=vN,yL.format.filter.and=dN,yL.format.filter.bbox=pN,yL.format.filter.between=function(t,n,i){return new KI(t,n,i)},yL.format.filter.contains=function(t,n,i){return new EI(t,n,i)},yL.format.filter.disjoint=function(t,n,i){return new PI(t,n,i)},yL.format.filter.during=function(t,n,i){return new FI(t,n,i)},yL.format.filter.dwithin=function(t,n,i,r,e){return new CI(t,n,i,r,e)},yL.format.filter.equalTo=function(t,n,i){return new UI(t,n,i)},yL.format.filter.greaterThan=function(t,n){return new BI(t,n)},yL.format.filter.greaterThanOrEqualTo=function(t,n){return new VI(t,n)},yL.format.filter.intersects=function(t,n,i){return new HI(t,n,i)},yL.format.filter.isNull=function(t){return new QI(t)},yL.format.filter.lessThan=function(t,n){return new nN(t,n)},yL.format.filter.lessThanOrEqualTo=function(t,n){return new rN(t,n)},yL.format.filter.like=function(t,n,i,r,e,o){return new ZI(t,n,i,r,e,o)},yL.format.filter.not=function(t){return new oN(t)},yL.format.filter.notEqualTo=function(t,n,i){return new aN(t,n,i)},yL.format.filter.or=function(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(cN,n))},yL.format.filter.resourceId=function(t){return new fN(t)},yL.format.filter.within=function(t,n,i){return new vN(t,n,i)},yL.format.xlink={},yL.format.xlink.readHref=IP,yL.format.xsd={},yL.format.xsd.readBoolean=nA,yL.format.xsd.readBooleanString=iA,yL.format.xsd.readDateTime=rA,yL.format.xsd.readDecimal=eA,yL.format.xsd.readDecimalString=oA,yL.format.xsd.readNonNegativeIntegerString=aA,yL.format.xsd.readPositiveInteger=sA,yL.format.xsd.readString=uA,yL.format.xsd.writeBooleanTextNode=cA,yL.format.xsd.writeCDATASection=hA,yL.format.xsd.writeDateTimeTextNode=fA,yL.format.xsd.writeDecimalTextNode=lA,yL.format.xsd.writeNonNegativeIntegerTextNode=vA,yL.format.xsd.writeStringTextNode=dA,yL.functions={},yL.functions.FALSE=M,yL.functions.TRUE=k,yL.functions.VOID=_,yL.functions.memoizeOne=O,yL.functions.toPromise=T,yL.geom={},yL.geom.Circle=KT,yL.geom.Geometry=Yr,yL.geom.GeometryCollection=cS,yL.geom.LineString=kj,yL.geom.LinearRing=_e,yL.geom.MultiLineString=_j,yL.geom.MultiPoint=bj,yL.geom.MultiPolygon=Ej,yL.geom.Point=Te,yL.geom.Polygon=Ye,yL.geom.Polygon.circular=Ze,yL.geom.Polygon.fromCircle=Qe,yL.geom.Polygon.fromExtent=$e,yL.geom.Polygon.makeRegular=to,yL.geom.SimpleGeometry=te,yL.geom.SimpleGeometry.getStrideForLayout=$r,yL.geom.SimpleGeometry.transformGeom2D=Qr,yL.geom.flat={},yL.geom.flat.area={},yL.geom.flat.area.linearRing=je,yL.geom.flat.area.linearRings=Se,yL.geom.flat.area.linearRingss=ke,yL.geom.flat.center={},yL.geom.flat.center.linearRingss=Oj,yL.geom.flat.closest={},yL.geom.flat.closest.arrayMaxSquaredDelta=re,yL.geom.flat.closest.assignClosestArrayPoint=se,yL.geom.flat.closest.assignClosestMultiArrayPoint=ae,yL.geom.flat.closest.assignClosestPoint=oe,yL.geom.flat.closest.maxSquaredDelta=ie,yL.geom.flat.closest.multiArrayMaxSquaredDelta=ee,yL.geom.flat.contains={},yL.geom.flat.contains.linearRingContainsExtent=Ee,yL.geom.flat.contains.linearRingContainsXY=Ae,yL.geom.flat.contains.linearRingsContainsXY=Ce,yL.geom.flat.contains.linearRingssContainsXY=Re,yL.geom.flat.deflate={},yL.geom.flat.deflate.deflateCoordinate=ue,yL.geom.flat.deflate.deflateCoordinates=ce,yL.geom.flat.deflate.deflateCoordinatesArray=he,yL.geom.flat.deflate.deflateMultiCoordinatesArray=fe,yL.geom.flat.flip={},yL.geom.flat.flip.flipXY=GE,yL.geom.flat.geodesic={},yL.geom.flat.geodesic.greatCircleArc=function(t,n,i,r,e,o){var s=gr("EPSG:4326"),a=Math.cos(yi(n)),u=Math.sin(yi(n)),c=Math.cos(yi(r)),h=Math.sin(yi(r)),f=Math.cos(yi(i-t)),l=Math.sin(yi(i-t)),v=u*h+a*c*f;return zj((function(n){if(1<=v)return[i,r];var e=n*Math.acos(v),o=Math.cos(e),s=Math.sin(e),d=l*c,p=a*h-u*c*f,y=Math.atan2(d,p),m=Math.asin(u*o+a*s*Math.cos(y));return[pi(yi(t)+Math.atan2(Math.sin(y)*s*a,o-u*Math.sin(m))),pi(m)]}),Ar(s,e),o)},yL.geom.flat.geodesic.meridian=Fj,yL.geom.flat.geodesic.parallel=Lj,yL.geom.flat.inflate={},yL.geom.flat.inflate.inflateCoordinates=be,yL.geom.flat.inflate.inflateCoordinatesArray=ge,yL.geom.flat.inflate.inflateMultiCoordinatesArray=xe,yL.geom.flat.interiorpoint={},yL.geom.flat.interiorpoint.getInteriorPointOfArray=Pe,yL.geom.flat.interiorpoint.getInteriorPointsOfMultiArray=Ie,yL.geom.flat.interpolate={},yL.geom.flat.interpolate.interpolatePoint=gj,yL.geom.flat.interpolate.lineStringCoordinateAtM=xj,yL.geom.flat.interpolate.lineStringsCoordinateAtM=jj,yL.geom.flat.intersectsextent={},yL.geom.flat.intersectsextent.intersectsLineString=ze,yL.geom.flat.intersectsextent.intersectsLineStringArray=Fe,yL.geom.flat.intersectsextent.intersectsLinearRing=Le,yL.geom.flat.intersectsextent.intersectsLinearRingArray=Ge,yL.geom.flat.intersectsextent.intersectsLinearRingMultiArray=De,yL.geom.flat.length={},yL.geom.flat.length.lineStringLength=qx,yL.geom.flat.length.linearRingLength=function(t,n,i,r){var e=qx(t,n,i,r),o=t[i-r]-t[n],s=t[i-r+1]-t[n+1];return e+=Math.sqrt(o*o+s*s)},yL.geom.flat.orient={},yL.geom.flat.orient.inflateEnds=He,yL.geom.flat.orient.linearRingIsClockwise=qe,yL.geom.flat.orient.linearRingsAreOriented=Be,yL.geom.flat.orient.linearRingssAreOriented=We,yL.geom.flat.orient.orientLinearRings=Ve,yL.geom.flat.orient.orientLinearRingsArray=Xe,yL.geom.flat.reverse={},yL.geom.flat.reverse.coordinates=Ue,yL.geom.flat.segments={},yL.geom.flat.segments.forEach=Ne,yL.geom.flat.simplify={},yL.geom.flat.simplify.douglasPeucker=le,yL.geom.flat.simplify.douglasPeuckerArray=ve,yL.geom.flat.simplify.douglasPeuckerMultiArray=function(t,n,i,r,e,o,s,a){for(var u=0,c=i.length;u<c;++u){var h=i[u],f=[];s=ve(t,n,h,r,e,o,s,f),a.push(f),n=h[h.length-1]}return s},yL.geom.flat.simplify.quantize=ye,yL.geom.flat.simplify.quantizeArray=me,yL.geom.flat.simplify.quantizeMultiArray=we,yL.geom.flat.simplify.radialDistance=de,yL.geom.flat.simplify.simplifyLineString=function(t,n,i,r,e,o,s){var a=void 0!==s?s:[];return o||(i=de(t,n,i,r,e,a,0),t=a,n=0,r=2),a.length=le(t,n,i,r,e,a,0),a},yL.geom.flat.simplify.snap=pe,yL.geom.flat.straightchunk={},yL.geom.flat.straightchunk.matchingChunk=Nx,yL.geom.flat.textpath={},yL.geom.flat.textpath.drawTextOnPath=Ux,yL.geom.flat.topology={},yL.geom.flat.topology.lineStringIsClosed=function(t,n,i,r){var e=i-r;return t[n]===t[e]&&t[n+1]===t[e+1]&&(i-n)/r>3&&!!je(t,n,i,r)},yL.geom.flat.transform={},yL.geom.flat.transform.rotate=Vr,yL.geom.flat.transform.scale=Xr,yL.geom.flat.transform.transform2D=Wr,yL.geom.flat.transform.translate=Hr,yL.has={},yL.has.DEVICE_PIXEL_RATIO=Xt,yL.has.FIREFOX=Ut,yL.has.IMAGE_DECODE=Jt,yL.has.MAC=Vt,yL.has.PASSIVE_EVENT_LISTENERS=Kt,yL.has.SAFARI=qt,yL.has.SAFARI_BUG_237906=Bt,yL.has.WEBKIT=Wt,yL.has.WORKER_OFFSCREEN_CANVAS=Ht,yL.interaction={},yL.interaction.DoubleClickZoom=Tu,yL.interaction.DragAndDrop=WT,yL.interaction.DragAndDrop.DragAndDropEvent=BT,yL.interaction.DragBox=ec,yL.interaction.DragBox.DragBoxEvent=rc,yL.interaction.DragPan=Hu,yL.interaction.DragRotate=Ku,yL.interaction.DragRotateAndZoom=XT,yL.interaction.DragZoom=sc,yL.interaction.Draw=oE,yL.interaction.Draw.DrawEvent=eE,yL.interaction.Draw.createBox=function(){return function(t,n,i){var r=jn([t[0],t[t.length-1]].map((function(t){return Fr(t,i)}))),e=[[Vn(r),Xn(r),Qn(r),$n(r),Vn(r)]],o=n;o?o.setCoordinates(e):o=new Ye(e);var s=Nr();return s&&o.transform(i,s),o}},yL.interaction.Draw.createRegularPolygon=function(t,n){return function(i,r,e){var o=Fr(i[0],e),s=Fr(i[i.length-1],e),a=Math.sqrt(rr(o,s)),u=r||Qe(new KT(o),t),c=n;if(!n&&0!==n){var h=s[0]-o[0],f=s[1]-o[1];c=Math.atan2(f,h)}to(u,o,a,c);var l=Nr();return l&&u.transform(e,l),u}},yL.interaction.Extent=lE,yL.interaction.Extent.ExtentEvent=uE,yL.interaction.Interaction=_u,yL.interaction.Interaction.pan=ku,yL.interaction.Interaction.zoomByDelta=Mu,yL.interaction.KeyboardPan=lc,yL.interaction.KeyboardZoom=dc,yL.interaction.Modify=SE,yL.interaction.Modify.ModifyEvent=bE,yL.interaction.MouseWheelZoom=wc,yL.interaction.PinchRotate=gc,yL.interaction.PinchZoom=jc,yL.interaction.Pointer=Cu,yL.interaction.Pointer.centroid=Au,yL.interaction.Select=TE,yL.interaction.Select.SelectEvent=_E,yL.interaction.Snap=RE,yL.interaction.Translate=LE,yL.interaction.Translate.TranslateEvent=FE,yL.interaction.defaults=Sc,yL.layer={},yL.layer.Base=us,yL.layer.BaseImage=mg,yL.layer.BaseTile=Eg,yL.layer.BaseVector=wx,yL.layer.Graticule=qj,yL.layer.Group=ha,yL.layer.Group.GroupEvent=ua,yL.layer.Heatmap=Jj,yL.layer.Image=Mg,yL.layer.Layer=gs,yL.layer.Layer.inView=bs,yL.layer.MapboxVector=RT,yL.layer.MapboxVector.getMapboxPath=MT,yL.layer.MapboxVector.normalizeGlyphsUrl=OT,yL.layer.MapboxVector.normalizeSourceUrl=ET,yL.layer.MapboxVector.normalizeSpriteUrl=_T,yL.layer.MapboxVector.normalizeStyleUrl=TT,yL.layer.Tile=Pg,yL.layer.Vector=Nj,yL.layer.VectorImage=IT,yL.layer.VectorTile=sS,yL.layer.WebGLPoints=zT,yL.layer.WebGLTile=DT,yL.loadingstrategy={},yL.loadingstrategy.all=ph,yL.loadingstrategy.bbox=function(t,n){return[t]},yL.loadingstrategy.tile=function(t){return function(n,i,r){var e=t.getZForResolution(Ur(i,r)),o=t.getTileRangeForExtentAndZ(Gr(n,r),e),s=[],a=[e,0,0];for(a[1]=o.minX;a[1]<=o.maxX;++a[1])for(a[2]=o.minY;a[2]<=o.maxY;++a[2])s.push(Lr(t.getTileCoordExtent(a),r));return s}},yL.math={},yL.math.ceil=ji,yL.math.clamp=ci,yL.math.cosh=hi,yL.math.floor=xi,yL.math.lerp=wi,yL.math.log2=fi,yL.math.modulo=mi,yL.math.round=gi,yL.math.solveLinearSystem=di,yL.math.squaredDistance=vi,yL.math.squaredSegmentDistance=li,yL.math.toDegrees=pi,yL.math.toFixed=bi,yL.math.toRadians=yi,yL.net={},yL.net.ClientError=gh,yL.net.ResponseError=bh,yL.net.getJSON=xh,yL.net.jsonp=mh,yL.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&(wh=XMLHttpRequest),global.XMLHttpRequest=t},yL.net.resolveUrl=jh,yL.net.restoreXHR=function(){global.XMLHttpRequest=wh},yL.obj={},yL.obj.assign=E,yL.obj.clear=A,yL.obj.getValues=C,yL.obj.isEmpty=R,yL.proj={},yL.proj.Projection=ui,yL.proj.Units={},yL.proj.Units.METERS_PER_UNIT=Ft,yL.proj.Units.fromCode=zt,yL.proj.addCommon=Br,yL.proj.addCoordinateTransforms=_r,yL.proj.addEquivalentProjections=jr,yL.proj.addEquivalentTransforms=Sr,yL.proj.addProjection=wr,yL.proj.addProjections=br,yL.proj.clearAllProjections=function(){Di(),Wi()},yL.proj.clearUserProjection=function(){Pr=null},yL.proj.cloneTransform=yr,yL.proj.createProjection=kr,yL.proj.createSafeCoordinateTransform=qr,yL.proj.createTransformFromCoordinateTransform=Mr,yL.proj.disableCoordinateWarning=pr,yL.proj.epsg3857={},yL.proj.epsg3857.EXTENT=_i,yL.proj.epsg3857.HALF_SIZE=Mi,yL.proj.epsg3857.MAX_SAFE_Y=Ti,yL.proj.epsg3857.PROJECTIONS=Ai,yL.proj.epsg3857.RADIUS=ki,yL.proj.epsg3857.WORLD_EXTENT=Oi,yL.proj.epsg3857.fromEPSG4326=Ci,yL.proj.epsg3857.toEPSG4326=Ri,yL.proj.epsg4326={},yL.proj.epsg4326.EXTENT=Ni,yL.proj.epsg4326.METERS_PER_UNIT=zi,yL.proj.epsg4326.PROJECTIONS=Li,yL.proj.epsg4326.RADIUS=Ii,yL.proj.equivalent=Tr,yL.proj.fromLonLat=Or,yL.proj.fromUserCoordinate=Fr,yL.proj.fromUserExtent=Gr,yL.proj.fromUserResolution=Ur,yL.proj.get=gr,yL.proj.getPointResolution=xr,yL.proj.getTransform=Ar,yL.proj.getTransformFromProjections=Er,yL.proj.getUserProjection=Nr,yL.proj.identityTransform=mr,yL.proj.proj4={},yL.proj.proj4.register=function(t){var n,i,r=Object.keys(t.defs),e=r.length;for(n=0;n<e;++n){var o=r[n];if(!gr(o)){var s=t.defs(o),a=s.units;a||"longlat"!==s.projName||(a=Gt.DEGREES),wr(new ui({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:a}))}}for(n=0;n<e;++n){var u=r[n],c=gr(u);for(i=0;i<e;++i){var h=r[i],f=gr(h);if(!Xi(u,h))if(t.defs[u]===t.defs[h])jr([c,f]);else{var l=t(u,h);_r(c,f,qr(c,f,l.forward),qr(f,c,l.inverse))}}}},yL.proj.projections={},yL.proj.projections.add=qi,yL.proj.projections.clear=Di,yL.proj.projections.get=Ui,yL.proj.setUserProjection=Ir,yL.proj.toLonLat=function(t,n){var i=Cr(t,void 0!==n?n:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||r>180)&&(i[0]=mi(r+180,360)-180),i},yL.proj.toUserCoordinate=zr,yL.proj.toUserExtent=Lr,yL.proj.toUserResolution=Dr,yL.proj.transform=Cr,yL.proj.transformExtent=Rr,yL.proj.transformWithProjections=function(t,n,i){return Er(n,i)(t)},yL.proj.transforms={},yL.proj.transforms.add=Vi,yL.proj.transforms.clear=Wi,yL.proj.transforms.get=Xi,yL.proj.transforms.remove=function(t,n){var i=t.getCode(),r=n.getCode(),e=Bi[i][r];return delete Bi[i][r],R(Bi[i])&&delete Bi[i],e},yL.proj.useGeographic=function(){Ir("EPSG:4326")},yL.render={},yL.render.Box=Zu,yL.render.Event=Ms,yL.render.Feature=Pj,yL.render.Feature.toFeature=function(t,n){var i=t.getId(),r=Rj(t),e=t.getProperties(),o=new Tt;return void 0!==n&&o.setGeometryName(n),o.setGeometry(r),void 0!==i&&o.setId(i),o.setProperties(e,!0),o},yL.render.Feature.toGeometry=Rj,yL.render.VectorContext=Sh,yL.render.canvas={},yL.render.canvas.Builder=Tx,yL.render.canvas.BuilderGroup=Dx,yL.render.canvas.Executor=$x,yL.render.canvas.ExecutorGroup=rj,yL.render.canvas.ExecutorGroup.getPixelIndexArray=ij,yL.render.canvas.ImageBuilder=Ax,yL.render.canvas.Immediate=Mh,yL.render.canvas.Instruction={},yL.render.canvas.Instruction.beginPathInstruction=kx,yL.render.canvas.Instruction.closePathInstruction=Mx,yL.render.canvas.Instruction.fillInstruction=jx,yL.render.canvas.Instruction.strokeInstruction=Sx,yL.render.canvas.LineStringBuilder=Rx,yL.render.canvas.PolygonBuilder=Ix,yL.render.canvas.TextBuilder=Lx,yL.render.canvas.checkedFonts=Xs,yL.render.canvas.defaultFillStyle=Fs,yL.render.canvas.defaultFont=zs,yL.render.canvas.defaultLineCap=Ls,yL.render.canvas.defaultLineDash=Gs,yL.render.canvas.defaultLineDashOffset=0,yL.render.canvas.defaultLineJoin=Ds,yL.render.canvas.defaultLineWidth=1,yL.render.canvas.defaultMiterLimit=Us,yL.render.canvas.defaultPadding=Vs,yL.render.canvas.defaultStrokeStyle=qs,yL.render.canvas.defaultTextAlign=Bs,yL.render.canvas.defaultTextBaseline=Ws,yL.render.canvas.drawImageOrLabel=ea,yL.render.canvas.getTextDimensions=ra,yL.render.canvas.hitdetect={},yL.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=ej,yL.render.canvas.hitdetect.createHitDetectionImageData=oj,yL.render.canvas.hitdetect.hitDetect=sj,yL.render.canvas.labelCache=Hs,yL.render.canvas.measureAndCacheTextWidth=ia,yL.render.canvas.measureTextHeight=Qs,yL.render.canvas.measureTextWidth=na,yL.render.canvas.registerFont=$s,yL.render.canvas.rotateAtOffset=function(t,n,i,r){0!==n&&(t.translate(i,r),t.rotate(n),t.translate(-i,-r))},yL.render.canvas.textHeights=Zs,yL.render.getRenderPixel=function(t,n){return rn(t.inversePixelTransform,n.slice(0))},yL.render.getVectorContext=Lh,yL.render.toContext=function(t,n){var i=t.canvas,r=n||{},e=r.pixelRatio||Xt,o=r.size;o&&(i.width=o[0]*e,i.height=o[1]*e,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],a=on([1,0,0,1,0,0],e,e);return new Mh(t,e,s,a,0)},yL.renderer={},yL.renderer.Composite=sa,yL.renderer.Layer=kl,yL.renderer.Map=Ss,yL.renderer.canvas={},yL.renderer.canvas.ImageLayer=Sg,yL.renderer.canvas.Layer=xg,yL.renderer.canvas.TileLayer=Cg,yL.renderer.canvas.VectorImageLayer=hj,yL.renderer.canvas.VectorLayer=uj,yL.renderer.canvas.VectorTileLayer=mj,yL.renderer.canvas.common={},yL.renderer.canvas.common.IMAGE_SMOOTHING_DISABLED=Dh,yL.renderer.canvas.common.IMAGE_SMOOTHING_ENABLED=Uh,yL.renderer.vector={},yL.renderer.vector.defaultOrder=Ph,yL.renderer.vector.getSquaredTolerance=Ih,yL.renderer.vector.getTolerance=Nh,yL.renderer.vector.renderFeature=zh,yL.renderer.webgl={},yL.renderer.webgl.Layer=Pl,yL.renderer.webgl.Layer.colorDecodeId=Rl,yL.renderer.webgl.Layer.colorEncodeId=Cl,yL.renderer.webgl.Layer.getBlankImageData=function(){var t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},yL.renderer.webgl.Layer.writePointFeatureToBuffers=function(t,n,i,r,e,o){var s=3+e,a=t[n+0],u=t[n+1],c=Tl;c.length=e;for(var h=0;h<c.length;h++)c[h]=t[n+2+h];var f=o?o.vertexPosition:0,l=o?o.indexPosition:0,v=f/s;return Al(i,f,a,u,0),c.length&&i.set(c,f+3),Al(i,f+=s,a,u,1),c.length&&i.set(c,f+3),Al(i,f+=s,a,u,2),c.length&&i.set(c,f+3),Al(i,f+=s,a,u,3),c.length&&i.set(c,f+3),f+=s,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,El.vertexPosition=f,El.indexPosition=l,El},yL.renderer.webgl.PointsLayer=gx,yL.renderer.webgl.TileLayer=Bl,yL.renderer.webgl.TileLayer.Attributes=zl,yL.renderer.webgl.TileLayer.Uniforms=Nl,yL.reproj={},yL.reproj.Image=Ab,yL.reproj.Tile=ml,yL.reproj.Triangulation=pl,yL.reproj.calculateSourceExtentResolution=Vh,yL.reproj.calculateSourceResolution=Wh,yL.reproj.common={},yL.reproj.common.ENABLE_RASTER_REPROJECTION=dl,yL.reproj.common.ERROR_THRESHOLD=.5,yL.reproj.render=Xh,yL.resolutionconstraint={},yL.resolutionconstraint.createMinMaxResolution=Xa,yL.resolutionconstraint.createSnapToPower=Va,yL.resolutionconstraint.createSnapToResolutions=Wa,yL.rotationconstraint={},yL.rotationconstraint.createSnapToN=Ka,yL.rotationconstraint.createSnapToZero=Ya,yL.rotationconstraint.disable=Ha,yL.rotationconstraint.none=Ja,yL.size={},yL.size.buffer=ou,yL.size.hasArea=su,yL.size.scale=au,yL.size.toSize=uu,yL.source={},yL.source.BingMaps=Sd,yL.source.BingMaps.quadKey=jd,yL.source.CartoDB=Od,yL.source.Cluster=Gd,yL.source.DataTile=Ud,yL.source.GeoTIFF=hb,yL.source.IIIF=Tb,yL.source.Image=Fb,yL.source.Image.ImageSourceEvent=Nb,yL.source.Image.defaultImageLoadFunction=zb,yL.source.ImageArcGISRest=Gb,yL.source.ImageCanvas=Ub,yL.source.ImageMapGuide=Bb,yL.source.ImageStatic=Vb,yL.source.ImageWMS=Qb,yL.source.OGCMapTile=ag,yL.source.OGCVectorTile=lg,yL.source.OSM=pg,yL.source.OSM.ATTRIBUTION=dg,yL.source.Raster=Kg,yL.source.Raster.Processor=Gg,yL.source.Raster.RasterSourceEvent=Wg,yL.source.Raster.newImageData=zg,yL.source.Source=fd,yL.source.Stamen=tx,yL.source.Tile=pd,yL.source.Tile.TileSourceEvent=dd,yL.source.TileArcGISRest=ix,yL.source.TileDebug=ex,yL.source.TileImage=gd,yL.source.TileJSON=sx,yL.source.TileWMS=ux,yL.source.UTFGrid=fx,yL.source.UTFGrid.CustomTile=hx,yL.source.UrlTile=md,yL.source.Vector=Fd,yL.source.Vector.VectorSourceEvent=zd,yL.source.VectorTile=cg,yL.source.VectorTile.defaultLoadFunction=hg,yL.source.WMTS=px,yL.source.WMTS.optionsFromCapabilities=function(t,n){var i=g(t.Contents.Layer,(function(t,i,r){return t.Identifier==n.layer}));if(null===i)return null;var r,e=t.Contents.TileMatrixSet;(r=i.TileMatrixSetLink.length>1?j(i.TileMatrixSetLink,"projection"in n?function(t,i,r){var o=g(e,(function(n){return n.Identifier==t.TileMatrixSet})).SupportedCRS,s=gr(o),a=gr(n.projection);return s&&a?Tr(s,a):o==n.projection}:function(t,i,r){return t.TileMatrixSet==n.matrixSet}):0)<0&&(r=0);var o=i.TileMatrixSetLink[r].TileMatrixSet,s=i.TileMatrixSetLink[r].TileMatrixSetLimits,a=i.Format[0];"format"in n&&(a=n.format),(r=j(i.Style,(function(t,i,r){return"style"in n?t.Title==n.style:t.isDefault})))<0&&(r=0);var u=i.Style[r].Identifier,c={};"Dimension"in i&&i.Dimension.forEach((function(t,n,i){var r=t.Identifier,e=t.Default;void 0===e&&(e=t.Value[0]),c[r]=e}));var h,f=g(t.Contents.TileMatrixSet,(function(t,n,i){return t.Identifier==o})),l=f.SupportedCRS;if(l&&(h=gr(l)),"projection"in n){var v=gr(n.projection);v&&(h&&!Tr(v,h)||(h=v))}var d=!1,p="ne"==h.getAxisOrientation().substr(0,2),m=f.TileMatrix[0],w={MinTileCol:0,MinTileRow:0,MaxTileCol:m.MatrixWidth-1,MaxTileRow:m.MatrixHeight-1};if(s){w=s[s.length-1];var b=g(f.TileMatrix,(function(t){return t.Identifier===w.TileMatrix||f.Identifier+":"+t.Identifier===w.TileMatrix}));b&&(m=b)}var x=28e-5*m.ScaleDenominator/h.getMetersPerUnit(),S=p?[m.TopLeftCorner[1],m.TopLeftCorner[0]]:m.TopLeftCorner,k=m.TileWidth*x,M=m.TileHeight*x,_=f.BoundingBox,O=[S[0]+k*w.MinTileCol,S[1]-M*(1+w.MaxTileRow),S[0]+k*(1+w.MaxTileCol),S[1]-M*w.MinTileRow];if(void 0!==_&&!On(_,O)){var T=i.WGS84BoundingBox,E=gr("EPSG:4326").getExtent();if(O=_,T)d=T[0]===E[0]&&T[2]===E[2];else{var A=Rr(_,f.SupportedCRS,"EPSG:4326");d=A[0]-1e-10<=E[0]&&A[2]+1e-10>=E[2]}}var C=Mv(f,O,s),R=[],P=n.requestEncoding;if(P=void 0!==P?P:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var I=t.OperationsMetadata.GetTile.DCP.HTTP.Get,N=0,z=I.length;N<z;++N)if(I[N].Constraint){var F=g(I[N].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===P&&(P=F[0]),P!==lx)break;y(F,lx)&&R.push(I[N].href)}else I[N].href&&(P=lx,R.push(I[N].href));return 0===R.length&&(P=vx,i.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(a=t.format,R.push(t.template))}))),{urls:R,layer:n.layer,matrixSet:o,format:a,projection:h,requestEncoding:P,tileGrid:C,style:u,dimensions:c,wrapX:d,crossOrigin:n.crossOrigin}},yL.source.XYZ=Md,yL.source.Zoomify=pb,yL.source.Zoomify.CustomTile=db,yL.source.common={},yL.source.common.DEFAULT_WMS_VERSION=Xb,yL.source.ogcTileUtil={},yL.source.ogcTileUtil.getMapTileUrlTemplate=ig,yL.source.ogcTileUtil.getTileSetInfo=og,yL.source.ogcTileUtil.getVectorTileUrlTemplate=rg,yL.source.sourcesFromTileGrid=function(t,n){var i=new Bc(32),r=t.getExtent();return function(e,o){i.expireCache(),r&&(e=Zn(r,e));var s=t.getZForResolution(o),a=[];return t.forEachTileCoord(e,s,(function(t){var r=t.toString();if(!i.containsKey(r)){var e=n(t);i.set(r,e)}a.push(i.get(r))})),a}},yL.sphere={},yL.sphere.DEFAULT_RADIUS=cr,yL.sphere.getArea=function t(n,i){var r=i||{},e=r.radius||cr,o=r.projection||"EPSG:3857",s=n.getType();s!==Pt.GEOMETRY_COLLECTION&&(n=n.clone().transform(o,"EPSG:4326"));var a,u,c,h,f,l,v=0;switch(s){case Pt.POINT:case Pt.MULTI_POINT:case Pt.LINE_STRING:case Pt.MULTI_LINE_STRING:case Pt.LINEAR_RING:break;case Pt.POLYGON:for(a=n.getCoordinates(),v=Math.abs(lr(a[0],e)),c=1,h=a.length;c<h;++c)v-=Math.abs(lr(a[c],e));break;case Pt.MULTI_POLYGON:for(c=0,h=(a=n.getCoordinates()).length;c<h;++c)for(u=a[c],v+=Math.abs(lr(u[0],e)),f=1,l=u.length;f<l;++f)v-=Math.abs(lr(u[f],e));break;case Pt.GEOMETRY_COLLECTION:var d=n.getGeometries();for(c=0,h=d.length;c<h;++c)v+=t(d[c],i);break;default:throw new Error("Unsupported geometry type: "+s)}return v},yL.sphere.getDistance=hr,yL.sphere.getLength=function t(n,i){var r=i||{},e=r.radius||cr,o=r.projection||"EPSG:3857",s=n.getType();s!==Pt.GEOMETRY_COLLECTION&&(n=n.clone().transform(o,"EPSG:4326"));var a,u,c,h,f,l,v=0;switch(s){case Pt.POINT:case Pt.MULTI_POINT:break;case Pt.LINE_STRING:case Pt.LINEAR_RING:v=fr(a=n.getCoordinates(),e);break;case Pt.MULTI_LINE_STRING:case Pt.POLYGON:for(c=0,h=(a=n.getCoordinates()).length;c<h;++c)v+=fr(a[c],e);break;case Pt.MULTI_POLYGON:for(c=0,h=(a=n.getCoordinates()).length;c<h;++c)for(f=0,l=(u=a[c]).length;f<l;++f)v+=fr(u[f],e);break;case Pt.GEOMETRY_COLLECTION:var d=n.getGeometries();for(c=0,h=d.length;c<h;++c)v+=t(d[c],i);break;default:throw new Error("Unsupported geometry type: "+s)}return v},yL.sphere.offset=vr,yL.string={},yL.string.compareVersions=Ji,yL.string.padNumber=Hi,yL.structs={},yL.structs.LRUCache=Bc,yL.structs.LinkedList=rd,yL.structs.PriorityQueue=Ra,yL.structs.PriorityQueue.DROP=Ca,yL.structs.RBush=od,yL.style={},yL.style.Circle=Av,yL.style.Fill=Cv,yL.style.Icon=Wv,yL.style.IconImage=qv,yL.style.IconImage.get=Uv,yL.style.IconImageCache=Jo,yL.style.IconImageCache.shared=Ko,yL.style.Image=_v,yL.style.RegularShape=Tv,yL.style.Stroke=Vv,yL.style.Style=Qv,yL.style.Style.createDefaultStyle=Yv,yL.style.Style.createEditingStyle=Zv,yL.style.Style.toFunction=Jv,yL.style.Text=id,yL.style.expressions={},yL.style.expressions.Operators=Zl,yL.style.expressions.PALETTE_TEXTURE_ARRAY=yv,yL.style.expressions.arrayToGlsl=nv,yL.style.expressions.colorToGlsl=iv,yL.style.expressions.expressionToGlsl=ov,yL.style.expressions.getStringNumberEquivalent=rv,yL.style.expressions.getValueType=$l,yL.style.expressions.isTypeUnique=Ql,yL.style.expressions.numberToGlsl=tv,yL.style.expressions.stringToGlsl=ev,yL.style.expressions.uniformNameForVariable=pv,yL.tilecoord={},yL.tilecoord.createOrUpdate=Wc,yL.tilecoord.fromKey=Jc,yL.tilecoord.getCacheKeyForTileKey=Hc,yL.tilecoord.getKey=Xc,yL.tilecoord.getKeyZXY=Vc,yL.tilecoord.hash=Kc,yL.tilecoord.withinExtentAndZ=Yc,yL.tilegrid={},yL.tilegrid.TileGrid=Jh,yL.tilegrid.WMTS=kv,yL.tilegrid.WMTS.createFromCapabilitiesMatrixSet=Mv,yL.tilegrid.common={},yL.tilegrid.common.DEFAULT_MAX_ZOOM=42,yL.tilegrid.common.DEFAULT_TILE_SIZE=Ga,yL.tilegrid.createForExtent=Zh,yL.tilegrid.createForProjection=tf,yL.tilegrid.createXYZ=$h,yL.tilegrid.extentFromProjection=nf,yL.tilegrid.getForProjection=Kh,yL.tilegrid.wrapX=Yh,yL.tileurlfunction={},yL.tileurlfunction.createFromTemplate=rf,yL.tileurlfunction.createFromTemplates=ef;yL.tileurlfunction.createFromTileUrlFunctions=of,yL.tileurlfunction.expandUrl=af,yL.tileurlfunction.nullTileUrlFunction=sf,yL.transform={},yL.transform.apply=rn,yL.transform.compose=un,yL.transform.composeCssTransform=function(t,n,i,r,e,o,s){return fn(un([1,0,0,1,0,0],t,n,i,r,e,o,s))},yL.transform.create=Zt,yL.transform.determinant=hn,yL.transform.invert=function(t){return cn(t,t)},yL.transform.makeInverse=cn,yL.transform.makeScale=sn,yL.transform.multiply=Qt,yL.transform.reset=$t,yL.transform.rotate=en,yL.transform.scale=on,yL.transform.set=tn,yL.transform.setFromArray=nn,yL.transform.toString=fn,yL.transform.translate=an,yL.uri={},yL.uri.appendParams=uf,yL.util={},yL.util.VERSION=a,yL.util.abstract=r,yL.util.getUid=o,yL.vec={},yL.vec.mat4={},yL.vec.mat4.create=Kf,yL.vec.mat4.fromTransform=Yf,yL.webgl={},yL.webgl.ARRAY_BUFFER=hf,yL.webgl.Buffer=Vf,yL.webgl.Buffer.getArrayClassForType=Wf,yL.webgl.DYNAMIC_DRAW=vf,yL.webgl.ELEMENT_ARRAY_BUFFER=ff,yL.webgl.FLOAT=df,yL.webgl.Helper=hl,yL.webgl.Helper.computeAttributesStride=ul,yL.webgl.PaletteTexture=fl,yL.webgl.PostProcessingPass=Jf,yL.webgl.RenderTarget=vl,yL.webgl.STATIC_DRAW=lf,yL.webgl.STREAM_DRAW=35040,yL.webgl.ShaderBuilder={},yL.webgl.ShaderBuilder.ShaderBuilder=gv,yL.webgl.ShaderBuilder.parseLiteralStyle=xv,yL.webgl.TileTexture=jl,yL.webgl.UNSIGNED_BYTE=5121,yL.webgl.UNSIGNED_INT=5125,yL.webgl.UNSIGNED_SHORT=5123,yL.webgl.getContext=yf,yL.webgl.getSupportedExtensions=function(){if(!cf){var t=yf(document.createElement("canvas"));t&&(cf=t.getSupportedExtensions())}return cf},yL.xml={},yL.xml.OBJECT_PROPERTY_NODE_FACTORY=Rf,yL.xml.XML_SCHEMA_INSTANCE_URI=mf,yL.xml.createElementNS=wf,yL.xml.getAllTextContent=bf,yL.xml.Gw=gf,yL.xml.getAttributeNS=jf,yL.xml.getDocument=qf,yL.xml.getXMLSerializer=Df,yL.xml.isDocument=xf,yL.xml.makeArrayExtender=kf,yL.xml.makeArrayPusher=Mf,yL.xml.makeArraySerializer=Af,yL.xml.makeChildAppender=Ef,yL.xml.makeObjectPropertyPusher=Of,yL.xml.makeObjectPropertySetter=Tf,yL.xml.makeReplacer=_f,yL.xml.makeSequence=Pf,yL.xml.makeSimpleNodeFactory=Cf,yL.xml.makeStructureNS=If,yL.xml.parse=Sf,yL.xml.parseNode=Nf,yL.xml.pushParseAndPop=zf,yL.xml.pushSerializeAndPop=Lf,yL.xml.registerDocument=function(t){Uf=t},yL.xml.registerXMLSerializer=function(t){Gf=t},yL.xml.serialize=Ff;var mL=yL},150:function(t,n,i){"use strict";i.d(n,{Ie:function(){return h},It:function(){return s},L:function(){return r},L5:function(){return l},P1:function(){return d},Qb:function(){return v},pd:function(){return f},sf:function(){return u}});var r={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},e={};for(var o in r)r.hasOwnProperty(o)&&(e[r[o]]=parseInt(o,10));var s=[e.BitsPerSample,e.ExtraSamples,e.SampleFormat,e.StripByteCounts,e.StripOffsets,e.StripRowCounts,e.TileByteCounts,e.TileOffsets,e.SubIFDs],a={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},u={};for(var c in a)a.hasOwnProperty(c)&&(u[a[c]]=parseInt(c,10));var h={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},f={Unspecified:0,Assocalpha:1,Unassalpha:2},l={Version:0,AddCompression:1},v={None:0,Deflate:1},d={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},p={};for(var y in d)d.hasOwnProperty(y)&&(p[d[y]]=parseInt(y,10))}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={id:t,loaded:!1,exports:{}};return n[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.m=n,r.d=function(t,n){for(var i in n)r.o(n,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},r.f={},r.e=function(t){return Promise.all(Object.keys(r.f).reduce((function(n,i){return r.f[i](t,n),n}),[]))},r.u=function(t){return t+".ol.js"},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},t={},r.l=function(n,i,e,o){if(t[n])t[n].push(i);else{var s,a;if(void 0!==e)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var h=u[c];if(h.getAttribute("src")==n||h.getAttribute("data-webpack")=="ol:"+e){s=h;break}}s||(a=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack","ol:"+e),s.src=n),t[n]=[i];var f=function(i,r){s.onerror=s.onload=null,clearTimeout(l);var e=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),e&&e.forEach((function(t){return t(r)})),i)return i(r)},l=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),a&&document.head.appendChild(s)}},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},function(){var t;r.g.importScripts&&(t=r.g.location+"");var n=r.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var i=n.getElementsByTagName("script");i.length&&(t=i[i.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t}(),function(){var t={179:0};r.f.j=function(n,i){var e=r.o(t,n)?t[n]:void 0;if(0!==e)if(e)i.push(e[2]);else{var o=new Promise((function(i,r){e=t[n]=[i,r]}));i.push(e[2]=o);var s=r.p+r.u(n),a=new Error;r.l(s,(function(i){if(r.o(t,n)&&(0!==(e=t[n])&&(t[n]=void 0),e)){var o=i&&("load"===i.type?"missing":i.type),s=i&&i.target&&i.target.src;a.message="Loading chunk "+n+" failed.\n("+o+": "+s+")",a.name="ChunkLoadError",a.type=o,a.request=s,e[1](a)}}),"chunk-"+n,n)}};var n=function(n,i){var e,o,s=i[0],a=i[1],u=i[2],c=0;if(s.some((function(n){return 0!==t[n]}))){for(e in a)r.o(a,e)&&(r.m[e]=a[e]);if(u)u(r)}for(n&&n(i);c<s.length;c++)o=s[c],r.o(t,o)&&t[o]&&t[o][0](),t[o]=0},i=self.webpackChunkol=self.webpackChunkol||[];i.forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i))}(),r(760);var e=r(920);return e=e.default}()}));
//# sourceMappingURL=ol.js.map \ No newline at end of file