!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ol=t():n.ol=t()}(window,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((1&i&&(n=t(n)),8&i)||4&i&&"object"==typeof n&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=9)}([function(n,t,i){"use strict";function f(n,t){if(!(this instanceof f))return new f(n,t);this._maxEntries=Math.max(4,n||9);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));t&&this._initFormat(t);this.clear()}function w(n,t,i){if(!i)return t.indexOf(n);for(var r=0;r<t.length;r++)if(i(n,t[r]))return r;return-1}function r(n,t){e(n,0,n.children.length,t,n)}function e(n,t,i,r,f){f||(f=u(null));f.minX=1/0;f.minY=1/0;f.maxX=-1/0;f.maxY=-1/0;for(var e,s=t;s<i;s++)e=n.children[s],o(f,n.leaf?r(e):e);return f}function o(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function a(n,t){return n.minX-t.minX}function v(n,t){return n.minY-t.minY}function c(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function s(n){return n.maxX-n.minX+(n.maxY-n.minY)}function b(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function k(n,t){var i=Math.max(n.minX,t.minX),r=Math.max(n.minY,t.minY),u=Math.min(n.maxX,t.maxX),f=Math.min(n.maxY,t.maxY);return Math.max(0,u-i)*Math.max(0,f-r)}function l(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function h(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function u(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(n,t,i,r,u){for(var f,e=[t,i];e.length;)(i=e.pop())-(t=e.pop())<=r||(f=t+Math.ceil((i-t)/r/2)*r,p(n,f,t,i,u),e.push(t,f,f,i))}n.exports=f;n.exports.default=f;var p=i(5);f.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,r=[],s=this.toBBox,u,e,i,o,f;if(!h(n,t))return r;for(f=[];t;){for(u=0,e=t.children.length;u<e;u++)i=t.children[u],h(n,o=t.leaf?s(i):i)&&(t.leaf?r.push(i):l(n,o)?this._all(i,r):f.push(i));t=f.pop()}return r},collides:function(n){var t=this.data,o=this.toBBox,i,f,r,e,u;if(!h(n,t))return!1;for(u=[];t;){for(i=0,f=t.children.length;i<f;i++)if(r=t.children[i],h(n,e=t.leaf?o(r):r)){if(t.leaf||l(n,e))return!0;u.push(r)}t=u.pop()}return!1},load:function(n){var i,r,t,u;if(!n||!n.length)return this;if(n.length<this._minEntries){for(i=0,r=n.length;i<r;i++)this.insert(n[i]);return this}return t=this._build(n.slice(),0,n.length-1,0),this.data.children.length?this.data.height===t.height?this._splitRoot(this.data,t):(this.data.height<t.height&&(u=this.data,this.data=t,t=u),this._insert(t,this.data.height-t.height-1,!0)):this.data=t,this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=u([]),this},remove:function(n,t){if(!n)return this;for(var u,f,o,e,i=this.data,h=this.toBBox(n),r=[],s=[];i||r.length;){if(i||(i=r.pop(),f=r[r.length-1],u=s.pop(),e=!0),i.leaf&&-1!==(o=w(n,i.children,t)))return i.children.splice(o,1),r.push(i),this._condense(r),this;e||i.leaf||!l(i,h)?f?(u++,i=f.children[u],e=!1):i=null:(r.push(i),s.push(u),u=0,f=i,i=i.children[0])}return this},toBBox:function(n){return n},compareMinX:a,compareMinY:v,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var i=[];n;)n.leaf?t.push.apply(t,n.children):i.push.apply(i,n.children),n=i.pop();return t},_build:function(n,t,i,f){var e,l=i-t+1,o=this._maxEntries,s,h,v,p,c,a;if(l<=o)return r(e=u(n.slice(t,i+1)),this.toBBox),e;for(f||(f=Math.ceil(Math.log(l)/Math.log(o)),o=Math.ceil(l/Math.pow(o,f-1))),(e=u([])).leaf=!1,e.height=f,c=Math.ceil(l/o),a=c*Math.ceil(Math.sqrt(o)),y(n,t,i,a,this.compareMinX),s=t;s<=i;s+=a)for(y(n,s,v=Math.min(s+a-1,i),c,this.compareMinY),h=s;h<=v;h+=c)p=Math.min(h+c-1,v),e.children.push(this._build(n,h,p,f-1));return r(e,this.toBBox),e},_chooseSubtree:function(n,t,i,r){for(var e,a,o,h,u,l,f,s;r.push(t),!t.leaf&&r.length-1!==i;){for(f=s=1/0,e=0,a=t.children.length;e<a;e++)u=c(o=t.children[e]),(l=b(n,o)-u)<s?(s=l,f=u<f?u:f,h=o):l===s&&u<f&&(f=u,h=o);t=h||t.children[0]}return t},_insert:function(n,t,i){var e=this.toBBox,u=i?n:e(n),r=[],f=this._chooseSubtree(u,this.data,t,r);for(f.children.push(n),o(f,u);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(u,r,t)},_split:function(n,t){var i=n[t],o=i.children.length,s=this._minEntries,e,f;this._chooseSplitAxis(i,s,o);e=this._chooseSplitIndex(i,s,o);f=u(i.children.splice(e,i.children.length-e));f.height=i.height;f.leaf=i.leaf;r(i,this.toBBox);r(f,this.toBBox);t?n[t-1].children.push(f):this._splitRoot(i,f)},_splitRoot:function(n,t){this.data=u([n,t]);this.data.height=n.height+1;this.data.leaf=!1;r(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,i){for(var l,a,o,f,u,h,s=u=1/0,r=t;r<=i-t;r++)o=k(l=e(n,0,r,this.toBBox),a=e(n,r,i,this.toBBox)),f=c(l)+c(a),o<s?(s=o,h=r,u=f<u?f:u):o===s&&f<u&&(u=f,h=r);return h},_chooseSplitAxis:function(n,t,i){var r=n.leaf?this.compareMinX:a,u=n.leaf?this.compareMinY:v;this._allDistMargin(n,t,i,r)<this._allDistMargin(n,t,i,u)&&n.children.sort(r)},_allDistMargin:function(n,t,i,r){n.children.sort(r);for(var f,h=this.toBBox,c=e(n,0,t,h),l=e(n,i-t,i,h),a=s(c)+s(l),u=t;u<i-t;u++)f=n.children[u],o(c,n.leaf?h(f):f),a+=s(c);for(u=i-t-1;u>=t;u--)f=n.children[u],o(l,n.leaf?h(f):f),a+=s(l);return a},_adjustParentBBoxes:function(n,t,i){for(var r=i;r>=0;r--)o(t[r],n)},_condense:function(n){for(var i,t=n.length-1;t>=0;t--)0===n[t].children.length?t>0?(i=n[t-1].children).splice(i.indexOf(n[t]),1):this.clear():r(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0]));this.compareMinY=new Function("a","b",t.join(n[1]));this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}}},function(n,t,i){"use strict";function r(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0);this.pos=0;this.type=0;this.length=this.buf.length}function u(n){return n.type===r.Bytes?n.readVarint()+n.pos:n.pos+1}function f(n,t,i){return i?4294967296*t+(n>>>0):4294967296*(t>>>0)+(n>>>0)}function h(n,t,i){var u=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2)),r;for(i.realloc(u),r=i.pos-1;r>=n;r--)i.buf[r+u]=i.buf[r]}function l(n,t){for(var i=0;i<n.length;i++)t.writeVarint(n[i])}function a(n,t){for(var i=0;i<n.length;i++)t.writeSVarint(n[i])}function v(n,t){for(var i=0;i<n.length;i++)t.writeFloat(n[i])}function y(n,t){for(var i=0;i<n.length;i++)t.writeDouble(n[i])}function p(n,t){for(var i=0;i<n.length;i++)t.writeBoolean(n[i])}function w(n,t){for(var i=0;i<n.length;i++)t.writeFixed32(n[i])}function b(n,t){for(var i=0;i<n.length;i++)t.writeSFixed32(n[i])}function k(n,t){for(var i=0;i<n.length;i++)t.writeFixed64(n[i])}function d(n,t){for(var i=0;i<n.length;i++)t.writeSFixed64(n[i])}function s(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16)+16777216*n[t+3]}function e(n,t,i){n[i]=t;n[i+1]=t>>>8;n[i+2]=t>>>16;n[i+3]=t>>>24}function c(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16)+(n[t+3]<<24)}n.exports=r;var o=i(6);r.Varint=0;r.Fixed64=1;r.Bytes=2;r.Fixed32=5;r.prototype={destroy:function(){this.buf=null},readFields:function(n,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),u=r>>3,f=this.pos;this.type=7&r;n(u,t,this);this.pos===f&&this.skip(r)}return t},readMessage:function(n,t){return this.readFields(n,t,this.readVarint()+this.pos)},readFixed32:function(){var n=s(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=c(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=s(this.buf,this.pos)+4294967296*s(this.buf,this.pos+4);return this.pos+=8,n},readSFixed64:function(){var n=s(this.buf,this.pos)+4294967296*c(this.buf,this.pos+4);return this.pos+=8,n},readFloat:function(){var n=o.read(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=o.read(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(n,t,i){var u,r,e=i.buf;if((r=e[i.pos++],u=(112&r)>>4,r<128)||(r=e[i.pos++],u|=(127&r)<<3,r<128)||(r=e[i.pos++],u|=(127&r)<<10,r<128)||(r=e[i.pos++],u|=(127&r)<<17,r<128)||(r=e[i.pos++],u|=(127&r)<<24,r<128)||(r=e[i.pos++],u|=(1&r)<<31,r<128))return f(n,u,t);throw new Error("Expected varint not more than 10 bytes");}(t|=(15&(i=r[this.pos]))<<28,n,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2==1?(n+1)/-2:n/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var n=this.readVarint()+this.pos,t=function(n,t,i){for(var h="",u=t;u<i;){var f,s,c,e=n[u],r=null,o=e>239?4:e>223?3:e>191?2:1;if(u+o>i)break;1===o?e<128&&(r=e):2===o?128==(192&(f=n[u+1]))&&(r=(31&e)<<6|63&f)<=127&&(r=null):3===o?(f=n[u+1],s=n[u+2],128==(192&f)&&128==(192&s)&&((r=(15&e)<<12|(63&f)<<6|63&s)<=2047||r>=55296&&r<=57343)&&(r=null)):4===o&&(f=n[u+1],s=n[u+2],c=n[u+3],128==(192&f)&&128==(192&s)&&128==(192&c)&&((r=(15&e)<<18|(63&f)<<12|(63&s)<<6|63&c)<=65535||r>=1114112)&&(r=null));null===r?(r=65533,o=1):r>65535&&(r-=65536,h+=String.fromCharCode(r>>>10&1023|55296),r=56320|1023&r);h+=String.fromCharCode(r);u+=o}return h}(this.buf,this.pos,n);return this.pos=n,t},readBytes:function(){var n=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,n);return this.pos=n,t},readPackedVarint:function(n,t){var i=u(this);for(n=n||[];this.pos<i;)n.push(this.readVarint(t));return n},readPackedSVarint:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readSVarint());return n},readPackedBoolean:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readBoolean());return n},readPackedFloat:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readFloat());return n},readPackedDouble:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readDouble());return n},readPackedFixed32:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readFixed32());return n},readPackedSFixed32:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readSFixed32());return n},readPackedFixed64:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readFixed64());return n},readPackedSFixed64:function(n){var t=u(this);for(n=n||[];this.pos<t;)n.push(this.readSFixed64());return n},skip:function(n){var t=7&n;if(t===r.Varint)for(;this.buf[this.pos++]>127;);else if(t===r.Bytes)this.pos=this.readVarint()+this.pos;else if(t===r.Fixed32)this.pos+=4;else{if(t!==r.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(n,t){this.writeVarint(n<<3|t)},realloc:function(n){for(var i,t=this.length||16;t<this.pos+n;)t*=2;t!==this.length&&(i=new Uint8Array(t),i.set(this.buf),this.buf=i,this.length=t)},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(n){this.realloc(4);e(this.buf,n,this.pos);this.pos+=4},writeSFixed32:function(n){this.realloc(4);e(this.buf,n,this.pos);this.pos+=4},writeFixed64:function(n){this.realloc(8);e(this.buf,-1&n,this.pos);e(this.buf,Math.floor(n*(1/4294967296)),this.pos+4);this.pos+=8},writeSFixed64:function(n){this.realloc(8);e(this.buf,-1&n,this.pos);e(this.buf,Math.floor(n*(1/4294967296)),this.pos+4);this.pos+=8},writeVarint:function(n){(n=+n||0)>268435455||n<0?function(n,t){var i,r;if(n>=0?(i=n%4294967296|0,r=n/4294967296|0):(r=~(-n/4294967296),4294967295^(i=~(-n%4294967296))?i=i+1|0:(i=0,r=r+1|0)),n>=0x10000000000000000||n<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(n,t,i){i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos]=127&n}(i,0,t),function(n,t){var i=(7&n)<<4;(t.buf[t.pos++]|=i|((n>>>=3)?128:0),n)&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n)&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n)&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n)&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n)&&(t.buf[t.pos++]=127&n)}(r,t)}(n,this):(this.realloc(4),this.buf[this.pos++]=127&n|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=n>>>7&127))))},writeSVarint:function(n){this.writeVarint(n<0?2*-n-1:2*n)},writeBoolean:function(n){this.writeVarint(Boolean(n))},writeString:function(n){var i,t;n=String(n);this.realloc(4*n.length);this.pos++;i=this.pos;this.pos=function(n,t,i){for(var r,u,f=0;f<t.length;f++){if((r=t.charCodeAt(f))>55295&&r<57344){if(!u){r>56319||f+1===t.length?(n[i++]=239,n[i++]=191,n[i++]=189):u=r;continue}if(r<56320){n[i++]=239;n[i++]=191;n[i++]=189;u=r;continue}r=u-55296<<10|r-56320|65536;u=null}else u&&(n[i++]=239,n[i++]=191,n[i++]=189,u=null);r<128?n[i++]=r:(r<2048?n[i++]=r>>6|192:(r<65536?n[i++]=r>>12|224:(n[i++]=r>>18|240,n[i++]=r>>12&63|128),n[i++]=r>>6&63|128),n[i++]=63&r|128)}return i}(this.buf,n,this.pos);t=this.pos-i;t>=128&&h(i,t,this);this.pos=i-1;this.writeVarint(t);this.pos+=t},writeFloat:function(n){this.realloc(4);o.write(this.buf,n,this.pos,!0,23,4);this.pos+=4},writeDouble:function(n){this.realloc(8);o.write(this.buf,n,this.pos,!0,52,8);this.pos+=8},writeBytes:function(n){var i=n.length,t;for(this.writeVarint(i),this.realloc(i),t=0;t<i;t++)this.buf[this.pos++]=n[t]},writeRawMessage:function(n,t){var r,i;this.pos++;r=this.pos;n(t,this);i=this.pos-r;i>=128&&h(r,i,this);this.pos=r-1;this.writeVarint(i);this.pos+=i},writeMessage:function(n,t,i){this.writeTag(n,r.Bytes);this.writeRawMessage(t,i)},writePackedVarint:function(n,t){this.writeMessage(n,l,t)},writePackedSVarint:function(n,t){this.writeMessage(n,a,t)},writePackedBoolean:function(n,t){this.writeMessage(n,p,t)},writePackedFloat:function(n,t){this.writeMessage(n,v,t)},writePackedDouble:function(n,t){this.writeMessage(n,y,t)},writePackedFixed32:function(n,t){this.writeMessage(n,w,t)},writePackedSFixed32:function(n,t){this.writeMessage(n,b,t)},writePackedFixed64:function(n,t){this.writeMessage(n,k,t)},writePackedSFixed64:function(n,t){this.writeMessage(n,d,t)},writeBytesField:function(n,t){this.writeTag(n,r.Bytes);this.writeBytes(t)},writeFixed32Field:function(n,t){this.writeTag(n,r.Fixed32);this.writeFixed32(t)},writeSFixed32Field:function(n,t){this.writeTag(n,r.Fixed32);this.writeSFixed32(t)},writeFixed64Field:function(n,t){this.writeTag(n,r.Fixed64);this.writeFixed64(t)},writeSFixed64Field:function(n,t){this.writeTag(n,r.Fixed64);this.writeSFixed64(t)},writeVarintField:function(n,t){this.writeTag(n,r.Varint);this.writeVarint(t)},writeSVarintField:function(n,t){this.writeTag(n,r.Varint);this.writeSVarint(t)},writeStringField:function(n,t){this.writeTag(n,r.Bytes);this.writeString(t)},writeFloatField:function(n,t){this.writeTag(n,r.Fixed32);this.writeFloat(t)},writeDoubleField:function(n,t){this.writeTag(n,r.Fixed64);this.writeDouble(t)},writeBooleanField:function(n,t){this.writeVarintField(n,Boolean(t))}}},function(n,t,i){var r=i(7);t.Processor=r},,,function(n){n.exports=function(){"use strict";function n(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function t(n,t){return n<t?-1:n>t?1:0}return function(i,r,u,f,e){!function t(i,r,u,f,e){for(;f>u;){if(f-u>600){var s=f-u+1,a=r-u+1,v=Math.log(s),c=.5*Math.exp(2*v/3),y=.5*Math.sqrt(v*c*(s-c)/s)*(a-s/2<0?-1:1),p=Math.max(u,Math.floor(r-a*c/s+y)),w=Math.min(f,Math.floor(r+(s-a)*c/s+y));t(i,r,p,w,e)}var l=i[r],h=u,o=f;for(n(i,u,r),e(i[f],l)>0&&n(i,u,f);h<o;){for(n(i,h,o),h++,o--;e(i[h],l)<0;)h++;for(;e(i[o],l)>0;)o--}0===e(i[u],l)?n(i,u,o):n(i,++o,f);o<=r&&(u=o+1);r<=o&&(f=o-1)}}(i,r,u||0,f||i.length-1,e||t)}}()},function(n,t){t.read=function(n,t,i,r,u){var f,o,l=8*u-r-1,a=(1<<l)-1,v=a>>1,e=-7,s=i?u-1:0,c=i?-1:1,h=n[t+s];for(s+=c,f=h&(1<<-e)-1,h>>=-e,e+=l;e>0;f=256*f+n[t+s],s+=c,e-=8);for(o=f&(1<<-e)-1,f>>=-e,e+=r;e>0;o=256*o+n[t+s],s+=c,e-=8);if(0===f)f=1-v;else{if(f===a)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r);f-=v}return(h?-1:1)*o*Math.pow(2,f-r)};t.write=function(n,t,i,r,u,f){var e,o,s,l=8*f-u-1,a=(1<<l)-1,h=a>>1,y=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:f-1,v=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,e=a):(e=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-e))<1&&(e--,s*=2),(t+=e+h>=1?y/s:y*Math.pow(2,1-h))*s>=2&&(e++,s/=2),e+h>=a?(o=0,e=a):e+h>=1?(o=(t*s-1)*Math.pow(2,u),e+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,u),e=0));u>=8;n[i+c]=255&o,c+=v,o/=256,u-=8);for(e=e<<u|o,l+=u;l>0;n[i+c]=255&e,c+=v,e/=256,l-=8);n[i+c-v]|=128*p}},function(n,t,i){function u(n){function i(n,i,r){return t?new ImageData(n,i,r):{data:n,width:i,height:r}}var t=!0;try{new ImageData(10,10)}catch(n){t=!1}return function(t){var e,r,l=t.buffers,y=t.meta,w=t.imageOps,b=t.width,k=t.height,s=l.length,p=l[0].byteLength,a,v,o,u,f,h,c;if(w){for(a=new Array(s),r=0;r<s;++r)a[r]=i(new Uint8ClampedArray(l[r]),b,k);e=n(a,y).data}else{for(e=new Uint8ClampedArray(p),v=new Array(s),o=new Array(s),r=0;r<s;++r)v[r]=new Uint8ClampedArray(l[r]),o[r]=[0,0,0,0];for(u=0;u<p;u+=4){for(f=0;f<s;++f)h=v[f],o[f][0]=h[u],o[f][1]=h[u+1],o[f][2]=h[u+2],o[f][3]=h[u+3];c=n(o,y);e[u]=c[0];e[u+1]=c[1];e[u+2]=c[2];e[u+3]=c[3]}}return e.buffer}}function e(n,t){var r=Object.keys(n.lib||{}).map(function(t){return"var "+t+" = "+n.lib[t].toString()+";"}).concat(["var __minion__ = ("+u.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {',"  var buffer = __minion__(event.data);","  self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),f=new Blob(r,{type:"text/javascript"}),e=URL.createObjectURL(f),i=new Worker(e);return i.addEventListener("message",t),i}function r(n){var r,i,t;if(this._imageOps=!!n.imageOps,i=[],r=0===n.threads?0:this._imageOps?1:n.threads||1)for(t=0;t<r;++t)i[t]=e(n,this._onWorkerMessage.bind(this,t));else i[0]=function(n,t){var i=u(n.operation);return{postMessage:function(n){setTimeout(function(){t({data:{buffer:i(n),meta:n.meta}})},0)}}}(n,this._onWorkerMessage.bind(this,0));this._workers=i;this._queue=[];this._maxQueueLength=n.queue||1/0;this._running=0;this._dataLookup={};this._job=null}var f=i(8).newImageData;r.prototype.process=function(n,t,i){this._enqueue({inputs:n,meta:t,callback:i});this._dispatch()};r.prototype.destroy=function(){for(var n in this)this[n]=null;this._destroyed=!0};r.prototype._enqueue=function(n){for(this._queue.push(n);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)};r.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var n=this._job=this._queue.shift(),f=n.inputs[0].width,e=n.inputs[0].height,i=n.inputs.map(function(n){return n.data.buffer}),r=this._workers.length;if(this._running=r,1===r)this._workers[0].postMessage({buffers:i,meta:n.meta,imageOps:this._imageOps,width:f,height:e},i);else for(var c=n.inputs[0].data.length,o=4*Math.ceil(c/4/r),t=0;t<r;++t){for(var s=t*o,u=[],h=0,l=i.length;h<l;++h)u.push(i[t].slice(s,s+o));this._workers[t].postMessage({buffers:u,meta:n.meta,imageOps:this._imageOps,width:f,height:e},u)}}};r.prototype._onWorkerMessage=function(n,t){this._destroyed||(this._dataLookup[n]=t.data,--this._running,0===this._running&&this._resolveJob())};r.prototype._resolveJob=function(){var t,i,r=this._job,e=this._workers.length,u,o,n,s,h;if(1===e)t=new Uint8ClampedArray(this._dataLookup[0].buffer),i=this._dataLookup[0].meta;else for(u=r.inputs[0].data.length,t=new Uint8ClampedArray(u),i=new Array(u),o=4*Math.ceil(u/4/e),n=0;n<e;++n)s=this._dataLookup[n].buffer,h=n*o,t.set(new Uint8ClampedArray(s),h),i[n]=this._dataLookup[n].meta;this._job=null;this._dataLookup={};r.callback(null,f(t,r.inputs[0].width,r.inputs[0].height),i);this._dispatch()};n.exports=r},function(n,t){var i=!0,r;try{new ImageData(10,10)}catch(n){i=!1}r=document.createElement("canvas").getContext("2d");t.newImageData=function(n,t,u){if(i)return new ImageData(n,t,u);var f=r.createImageData(t,u);return f.data.set(n),f}},function(n,t,i){"use strict";function p(){return function(){throw new Error("Unimplemented abstract method.");}()}function y(n){return n.ol_uid||(n.ol_uid=String(++brt))}function pf(n){for(var t in n)delete n[t]}function wk(n){var t=[];for(var i in n)t.push(n[i]);return t}function wu(n){for(var t in n)return!1;return!t}function drt(n,t,i,r){for(var u,f=0,e=n.length;f<e;++f)if((u=n[f]).listener===t&&u.bindTo===i)return r&&(u.deleteIndex=f),u}function bk(n,t){var i=by(n);if(i)return i[t]}function by(n,t){var i=n.ol_lm;return!i&&t&&(i=n.ol_lm={}),i}function grt(n,t){var i=bk(n,t),r,f,u;if(i){for(r=0,f=i.length;r<f;++r)n.removeEventListener(t,i[r].boundListener),pf(i[r]);i.length=0;u=by(n);u&&(delete u[t],0===Object.keys(u).length&&function(n){delete n.ol_lm}(n))}}function o(n,t,i,r,u){var o=by(n,!0),e=o[t],f;return e||(e=o[t]=[]),f=drt(e,i,r,!1),f?u||(f.callOnce=!1):(f={bindTo:r,callOnce:!!u,listener:i,target:n,type:t},n.addEventListener(t,function(n){var t=function(t){var i=n.listener,r=n.bindTo||n.target;return n.callOnce&&lt(n),i.call(r,t)};return n.boundListener=t,t}(f)),e.push(f)),f}function ee(n,t,i,r){return o(n,t,i,r,!0)}function ou(n,t,i,r){var f=bk(n,t),u;f&&(u=drt(f,i,r,!0),u&&lt(u))}function lt(n){var t,i;n&&n.target&&(n.target.removeEventListener(n.type,n.boundListener),t=bk(n.target,n.type),t&&(i="deleteIndex"in n?n.deleteIndex:t.indexOf(n),-1!==i&&t.splice(i,1),0===t.length&&grt(n.target,n.type)),pf(n))}function nut(n){var t=by(n),i;if(t)for(i in t)grt(n,i)}function bu(){return!0}function nh(){return!1}function wf(){}function tut(n){n.stopPropagation()}function ni(n){return dk.hasOwnProperty(n)?dk[n]:dk[n]="change:"+n}function g(n,t){if(!n)throw new krt(t);}function lo(n,t){return n>t?1:n<t?-1:0}function tr(n,t){return n.indexOf(t)>=0}function np(n,t,i){var r,u=n.length;if(n[0]<=t)return 0;if(t<=n[u-1])return u-1;if(i>0){for(r=1;r<u;++r)if(n[r]<t)return r-1}else if(i<0){for(r=1;r<u;++r)if(n[r]<=t)return r}else for(r=1;r<u;++r){if(n[r]==t)return r;if(n[r]<t)return n[r-1]-t<t-n[r]?r-1:r}return u-1}function fbt(n,t,i){for(;t<i;){var r=n[t];n[t]=n[i];n[i]=r;++t;--i}}function pt(n,t){for(var r=Array.isArray(t)?t:[t],u=r.length,i=0;i<u;i++)n[n.length]=r[i]}function ha(n,t){for(var r,u=n.length>>>0,i=0;i<u;i++)if(t(r=n[i],i,n))return r;return null}function uf(n,t){var r=n.length,i;if(r!==t.length)return!1;for(i=0;i<r;i++)if(n[i]!==t[i])return!1;return!0}function gk(n,t){for(var u=n.length,r=Array(n.length),i=0;i<u;i++)r[i]={index:i,value:n[i]};for(r.sort(function(n,i){return t(n.value,i.value)||n.index-i.index}),i=0;i<n.length;i++)n[i]=r[i].value}function uut(n,t){var i;return n.every(function(r,u){return i=u,!t(r,u,n)})?-1:i}function hi(n){for(var i=eut(),t=0,r=n.length;t<r;++t)se(i,n[t]);return i}function ff(n,t,i){return i?(i[0]=n[0]-t,i[1]=n[1]-t,i[2]=n[2]+t,i[3]=n[3]+t,i):[n[0]-t,n[1]-t,n[2]+t,n[3]+t]}function fut(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n.slice()}function ih(n,t,i){var r,u;return(r=t<n[0]?n[0]-t:n[2]<t?t-n[2]:0)*r+(u=i<n[1]?n[1]-i:n[3]<i?i-n[3]:0)*u}function tp(n,t){return ip(n,t[0],t[1])}function lr(n,t){return n[0]<=t[0]&&t[2]<=n[2]&&n[1]<=t[1]&&t[3]<=n[3]}function ip(n,t,i){return n[0]<=t&&t<=n[2]&&n[1]<=i&&i<=n[3]}function nd(n,t){var f=n[0],e=n[1],o=n[2],s=n[3],r=t[0],u=t[1],i=ir.UNKNOWN;return r<f?i|=ir.LEFT:r>o&&(i|=ir.RIGHT),u<e?i|=ir.BELOW:u>s&&(i|=ir.ABOVE),i===ir.UNKNOWN&&(i=ir.INTERSECTING),i}function eut(){return[1/0,1/0,-1/0,-1/0]}function ef(n,t,i,r,u){return u?(u[0]=n,u[1]=t,u[2]=i,u[3]=r,u):[n,t,i,r]}function rh(n){return ef(1/0,1/0,-1/0,-1/0,n)}function uh(n,t){var i=n[0],r=n[1];return ef(i,r,i,r,t)}function td(n,t,i,r,u){return out(rh(u),n,t,i,r)}function oe(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function rp(n,t){return t[0]<n[0]&&(n[0]=t[0]),t[2]>n[2]&&(n[2]=t[2]),t[1]<n[1]&&(n[1]=t[1]),t[3]>n[3]&&(n[3]=t[3]),n}function se(n,t){t[0]<n[0]&&(n[0]=t[0]);t[0]>n[2]&&(n[2]=t[0]);t[1]<n[1]&&(n[1]=t[1]);t[1]>n[3]&&(n[3]=t[1])}function ebt(n,t){for(var i=0,r=t.length;i<r;++i)se(n,t[i]);return n}function out(n,t,i,r,u){for(;i<r;i+=u)obt(n,t[i],t[i+1]);return n}function obt(n,t,i){n[0]=Math.min(n[0],t);n[1]=Math.min(n[1],i);n[2]=Math.max(n[2],t);n[3]=Math.max(n[3],i)}function sut(n,t,i){var r;return(r=t.call(i,de(n)))?r:(r=t.call(i,fh(n)))?r:(r=t.call(i,ao(n)))?r:(r=t.call(i,bf(n)))||!1}function up(n){var t=0;return eh(n)||(t=wt(n)*ti(n)),t}function de(n){return[n[0],n[1]]}function fh(n){return[n[2],n[1]]}function su(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function ca(n,t,i,r,u){var l=t*r[0]/2,a=t*r[1]/2,v=Math.cos(i),y=Math.sin(i),f=l*v,e=l*y,o=a*v,s=a*y,h=n[0],c=n[1],p=h-f+s,w=h-f-s,b=h+f-s,k=h+f+s,d=c-e-o,g=c-e+o,nt=c+e+o,tt=c+e-o;return ef(Math.min(p,w,b,k),Math.min(d,g,nt,tt),Math.max(p,w,b,k),Math.max(d,g,nt,tt),u)}function ti(n){return n[3]-n[1]}function of(n,t,i){var r=i||[1/0,1/0,-1/0,-1/0];return dt(n,t)?(r[0]=n[0]>t[0]?n[0]:t[0],r[1]=n[1]>t[1]?n[1]:t[1],r[2]=n[2]<t[2]?n[2]:t[2],r[3]=n[3]<t[3]?n[3]:t[3]):rh(r),r}function bf(n){return[n[0],n[3]]}function ao(n){return[n[2],n[3]]}function wt(n){return n[2]-n[0]}function dt(n,t){return n[0]<=t[2]&&n[2]>=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function eh(n){return n[2]<n[0]||n[3]<n[1]}function fp(n,t){var i=(n[2]-n[0])/2*(t-1),r=(n[3]-n[1])/2*(t-1);n[0]-=i;n[2]+=i;n[1]-=r;n[3]+=r}function la(n,t,i){var r=[n[0],n[1],n[0],n[3],n[2],n[1],n[2],n[3]];return t(r,r,2),function(n,t,i){return ef(Math.min.apply(null,n),Math.min.apply(null,t),Math.max.apply(null,n),Math.max.apply(null,t),i)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],i)}function vo(n,t,i,r,u,f){for(var h,c,e=f||[],o=0,s=t;s<i;s+=r)h=n[s],c=n[s+1],e[o++]=u[0]*h+u[2]*c+u[4],e[o++]=u[1]*h+u[3]*c+u[5];return f&&e.length!=o&&(e.length=o),e}function yo(n,t,i,r,u,f,e){for(var c,o=e||[],h=0,s=t;s<i;s+=r)for(o[h++]=n[s]+u,o[h++]=n[s+1]+f,c=s+2;c<s+r;++c)o[h++]=n[c];return e&&o.length!=h&&(o.length=h),o}function vi(n,t,i){return Math.min(Math.max(n,t),i)}function cut(n,t,i,r,u,f){var e=u-i,o=f-r,s;return(0!==e||0!==o)&&(s=((n-i)*e+(t-r)*o)/(e*e+o*o),s>1?(i=u,r=f):s>0&&(i+=e*s,r+=o*s)),oh(n,t,i,r)}function oh(n,t,i,r){var u=i-n,f=r-t;return u*u+f*f}function lut(n){return 180*n/Math.PI}function kf(n){return n*Math.PI/180}function df(n,t){var i=n%t;return i*t<0?i+t:i}function yc(n,t,i){return n+i*(t-n)}function ep(n,t,i){var s=i||aa,r=kf(n[1]),u=kf(t[1]),f=(u-r)/2,e=kf(t[0]-n[0])/2,o=Math.sin(f)*Math.sin(f)+Math.sin(e)*Math.sin(e)*Math.cos(r)*Math.cos(u);return 2*s*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}function id(n,t){for(var r=0,i=0,u=n.length;i<u-1;++i)r+=ep(n[i],n[i+1],t);return r}function op(n,t){for(var u,f,e=0,r=n.length,o=n[r-1][0],s=n[r-1][1],i=0;i<r;i++)u=n[i][0],f=n[i][1],e+=kf(u-o)*(2+Math.sin(kf(s))+Math.sin(kf(f))),o=u,s=f;return e*t*t/2}function sbt(n,t,i,r){var o=r||aa,u=kf(n[1]),s=kf(n[0]),f=t/o,e=Math.asin(Math.sin(u)*Math.cos(f)+Math.cos(u)*Math.sin(f)*Math.cos(i));return[lut(s+Math.atan2(Math.sin(i)*Math.sin(f)*Math.cos(u),Math.cos(f)-Math.sin(u)*Math.sin(e))),lut(e)]}function lbt(n,t,i){var o=n.length,s=i>1?i:2,e=t,u,r,f;for(void 0===e&&(e=s>2?n.slice():new Array(o)),u=wc,r=0;r<o;r+=s)e[r]=u*n[r]/180,f=sp*Math.log(Math.tan(Math.PI*(n[r+1]+90)/360)),f>u?f=u:f<-u&&(f=-u),e[r+1]=f;return e}function abt(n,t,i){var f=n.length,e=i>1?i:2,u=t,r;for(void 0===u&&(u=e>2?n.slice():new Array(f)),r=0;r<f;r+=e)u[r]=180*n[r]/wc,u[r+1]=360*Math.atan(Math.exp(n[r+1]/sp))/Math.PI-90;return u}function kc(n,t,i){var r=n.getCode(),u=t.getCode();r in bc||(bc[r]={});bc[r][u]=i}function wut(n,t){var i;return n in bc&&t in bc[n]&&(i=bc[n][t]),i}function rd(n,t){var r,i,u;if(void 0!==t){for(i=0,u=n.length;i<u;++i)t[i]=n[i];r=t}else r=n.slice();return r}function ud(n,t){if(void 0!==t&&n!==t){for(var i=0,r=n.length;i<r;++i)t[i]=n[i];n=t}return n}function fd(n){!function(n,t){put[n]=t}(n.getCode(),n);kc(n,n,rd)}function w(n){return"string"==typeof n?function(n){return put[n]||null}(n):n||null}function hp(n,t,i,r){var f,o=(n=w(n)).getPointResolutionFunc(),s,u,e;return o?f=o(t,i):(n.getUnits()!=pr.DEGREES||r)&&r!=pr.DEGREES?(s=wo(n,w("EPSG:4326")),u=[i[0]-t/2,i[1],i[0]+t/2,i[1],i[0],i[1]-t/2,i[0],i[1]+t/2],f=(ep((u=s(u,u,2)).slice(0,2),u.slice(2,4))+ep(u.slice(4,6),u.slice(6,8)))/2,e=r?gf[r]:n.getMetersPerUnit(),void 0!==e&&(f/=e)):f=t,f}function cp(n){!function(n){n.forEach(fd)}(n);n.forEach(function(t){n.forEach(function(n){t!==n&&kc(t,n,rd)})})}function but(n,t){return n?"string"==typeof n?w(n):n:w(t)}function kut(n){return function(t,i,r){for(var o,f,s=t.length,h=void 0!==r?r:2,e=void 0!==i?i:new Array(s),u=0;u<s;u+=h)for(o=n([t[u],t[u+1]]),e[u]=o[0],e[u+1]=o[1],f=h-1;f>=2;--f)e[u+f]=t[u+f];return e}}function dut(n,t,i,r){var u=w(n),f=w(t);kc(u,f,kut(i));kc(f,u,kut(r))}function hu(n,t){if(n===t)return!0;var i=n.getUnits()===t.getUnits();return n.getCode()===t.getCode()?i:wo(n,t)===rd&&i}function wo(n,t){var i=wut(n.getCode(),t.getCode());return i||(i=ud),i}function he(n,t){return wo(w(n),w(t))}function dc(n,t,i){return he(t,i)(n,void 0,n.length)}function bo(n,t,i){return la(n,he(t,i))}function hh(n){return ap(n,1,0,0,1,0,0)}function ya(n,t){var i=n[0],r=n[1],u=n[2],f=n[3],a=n[4],v=n[5],e=t[0],o=t[1],s=t[2],h=t[3],c=t[4],l=t[5];return n[0]=i*e+u*o,n[1]=r*e+f*o,n[2]=i*s+u*h,n[3]=r*s+f*h,n[4]=i*c+u*l+a,n[5]=r*c+f*l+v,n}function ap(n,t,i,r,u,f,e){return n[0]=t,n[1]=i,n[2]=r,n[3]=u,n[4]=f,n[5]=e,n}function gut(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function wr(n,t){var i=t[0],r=t[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function vp(n,t){var i=Math.cos(t),r=Math.sin(t);return ya(n,ap(lp,i,r,-r,i,0,0))}function sf(n,t,i){return ya(n,ap(lp,t,0,0,i,0,0))}function ne(n,t,i){return ya(n,ap(lp,1,0,0,1,t,i))}function cu(n,t,i,r,u,f,e,o){var s=Math.sin(f),h=Math.cos(f);return n[0]=r*h,n[1]=u*s,n[2]=-r*s,n[3]=u*h,n[4]=e*r*h-o*r*s+t,n[5]=e*u*s+o*u*h+i,n}function nft(n){var t=function(n){return n[0]*n[3]-n[1]*n[2]}(n);g(0!==t,32);var i=n[0],r=n[1],u=n[2],f=n[3],e=n[4],o=n[5];return n[0]=f/t,n[1]=-r/t,n[2]=-u/t,n[3]=i/t,n[4]=(u*o-f*e)/t,n[5]=-(i*o-r*e)/t,n}function od(n){var t;return n==v.XY?t=2:n==v.XYZ||n==v.XYM?t=3:n==v.XYZM&&(t=4),t}function sd(n,t,i,r){for(var u,f,e=0,o=n[i-r],s=n[i-r+1];t<i;t+=r)u=n[t],f=n[t+1],e+=s*u-o*f,o=u,s=f;return e/2}function tft(n,t,i,r){for(var f,e=0,u=0,o=i.length;u<o;++u)f=i[u],e+=sd(n,t,f,r),t=f;return e}function ift(n,t,i,r,u,f,e){var h,v=n[t],y=n[t+1],c=n[i]-v,l=n[i+1]-y,a,o,s;if(0===c&&0===l)h=t;else if(a=((u-v)*c+(f-y)*l)/(c*c+l*l),a>1)h=i;else{if(a>0){for(o=0;o<r;++o)e[o]=yc(n[t+o],n[i+o],a);return void(e.length=r)}h=t}for(s=0;s<r;++s)e[s]=n[h+s];e.length=r}function hd(n,t,i,r,u){var f=n[t],e=n[t+1];for(t+=r;t<i;t+=r){var o=n[t],s=n[t+1],h=oh(f,e,o,s);h>u&&(u=h);f=o;e=s}return u}function cd(n,t,i,r,u){for(var e,f=0,o=i.length;f<o;++f)e=i[f],u=hd(n,t,e,r,u),t=e;return u}function ld(n,t,i,r,u,f,e,o,s,h,c){var l,v,a,y;if(t==i)return h;if(0===u){if((v=oh(e,o,n[t],n[t+1]))<h){for(l=0;l<r;++l)s[l]=n[t+l];return s.length=r,v}return h}for(a=c||[NaN,NaN],y=t+r;y<i;)if(ift(n,y-r,y,r,e,o,a),(v=oh(e,o,a[0],a[1]))<h){for(h=v,l=0;l<r;++l)s[l]=a[l];s.length=r;y+=r}else y+=r*Math.max((Math.sqrt(v)-Math.sqrt(h))/u|0,1);if(f&&(ift(n,i-r,t,r,e,o,a),(v=oh(e,o,a[0],a[1]))<h)){for(h=v,l=0;l<r;++l)s[l]=a[l];s.length=r}return h}function ad(n,t,i,r,u,f,e,o,s,h,c){for(var a,v=c||[NaN,NaN],l=0,y=i.length;l<y;++l)a=i[l],h=ld(n,t,a,r,u,f,e,o,s,h,v),t=a;return h}function rft(n,t,i){for(var r=0,u=i.length;r<u;++r)n[t++]=i[r];return t}function pa(n,t,i,r){for(var o,f,u=0,e=i.length;u<e;++u)for(o=i[u],f=0;f<r;++f)n[t++]=o[f];return t}function vd(n,t,i,r,u){for(var o,f=u||[],s=0,e=0,h=i.length;e<h;++e)o=pa(n,t,i[e],r),f[s++]=o,t=o;return f.length=s,f}function gc(n,t,i,r,u){for(var e=void 0!==u?u:[],o=0,f=t;f<i;f+=r)e[o++]=n.slice(f,f+r);return e.length=o,e}function pp(n,t,i,r,u){for(var s,f=void 0!==u?u:[],e=0,o=0,h=i.length;o<h;++o)s=i[o],f[e++]=gc(n,t,s,r,f[e]),t=s;return f.length=e,f}function uft(n,t,i,r,u){for(var e,f=void 0!==u?u:[],o=0,s=0,h=i.length;s<h;++s)e=i[s],f[o++]=pp(n,t,e,r,f[o]),t=e[e.length-1];return f.length=o,f}function yd(n,t,i,r,u,f,e){var y=(i-t)/r,c,s,o,w,h;if(y<3){for(;t<i;t+=r)f[e++]=n[t],f[e++]=n[t+1];return e}for(c=new Array(y),c[0]=1,c[y-1]=1,s=[t,i-r],o=0;s.length>0;){for(var l=s.pop(),a=s.pop(),p=0,b=n[a],k=n[a+1],d=n[l],g=n[l+1],v=a+r;v<l;v+=r)w=cut(n[v],n[v+1],b,k,d,g),w>p&&(o=v,p=w);p>u&&(c[(o-t)/r]=1,a+r<o&&s.push(a,o),o+r<l&&s.push(o,l))}for(h=0;h<y;++h)c[h]&&(f[e++]=n[t+h*r],f[e++]=n[t+h*r+1]);return e}function ybt(n,t,i,r,u,f,e,o){for(var h,s=0,c=i.length;s<c;++s)h=i[s],e=yd(n,t,h,r,u,f,e),o.push(e),t=h;return e}function ch(n,t){return t*Math.round(n/t)}function pbt(n,t,i,r,u,f,e){var o,s,h,c,v,y;if(t==i)return e;h=ch(n[t],u);c=ch(n[t+1],u);t+=r;f[e++]=h;f[e++]=c;do if(o=ch(n[t],u),s=ch(n[t+1],u),(t+=r)==i)return f[e++]=o,f[e++]=s,e;while(o==h&&s==c);for(;t<i;)if(v=ch(n[t],u),y=ch(n[t+1],u),t+=r,v!=o||y!=s){var l=o-h,a=s-c,p=v-h,w=y-c;l*w==a*p&&(l<0&&p<l||l==p||l>0&&p>l)&&(a<0&&w<a||a==w||a>0&&w>a)?(o=v,s=y):(f[e++]=o,f[e++]=s,h=o,c=s,o=v,s=y)}return f[e++]=o,f[e++]=s,e}function fft(n,t,i,r,u,f,e,o){for(var h,s=0,c=i.length;s<c;++s)h=i[s],e=pbt(n,t,h,r,u,f,e),o.push(e),t=h;return e}function wbt(n,t,i,r,u){return!sut(u,function(u){return!ko(n,t,i,r,u[0],u[1])})}function ko(n,t,i,r,u,f){for(var h,o,c=0,s=n[i-r],e=n[i-r+1];t<i;t+=r)h=n[t],o=n[t+1],e<=f?o>f&&(h-s)*(f-e)-(u-s)*(o-e)>0&&c++:o<=f&&(h-s)*(f-e)-(u-s)*(o-e)<0&&c--,s=h,e=o;return 0!==c}function pd(n,t,i,r,u,f){if(0===i.length||!ko(n,t,i[0],r,u,f))return!1;for(var e=1,o=i.length;e<o;++e)if(ko(n,i[e-1],i[e],r,u,f))return!1;return!0}function wd(n,t,i,r,u,f,e){for(var b,a,p,d,o,g,w,s,c,l,v,h=u[f+1],y=[],k=0,nt=i.length;k<nt;++k)for(b=i[k],s=n[b-r],l=n[b-r+1],o=t;o<b;o+=r)c=n[o],v=n[o+1],(h<=l&&v<=h||l<=h&&h<=v)&&(w=(h-l)/(v-l)*(c-s)+s,y.push(w)),s=c,l=v;for(a=NaN,p=-1/0,y.sort(lo),s=y[0],o=1,g=y.length;o<g;++o)c=y[o],d=Math.abs(c-s),d>p&&pd(n,t,i,r,w=(s+c)/2,h)&&(a=w,p=d),s=c;return isNaN(a)&&(a=u[f]),e?(e.push(a,h,p),e):[a,h,p]}function eft(n,t,i,r,u){for(var e,o=[],f=0,s=i.length;f<s;++f)e=i[f],o=wd(n,t,e,r,u,2*f,o),t=e[e.length-1];return o}function oft(n,t,i,r,u,f){for(var s,o=[n[t],n[t+1]],e=[];t+r<i;t+=r){if(e[0]=n[t+r],e[1]=n[t+r+1],s=u.call(f,o,e))return s;o[0]=e[0];o[1]=e[1]}return!1}function wp(n,t,i,r,u){var f=out([1/0,1/0,-1/0,-1/0],n,t,i,r);return!!dt(u,f)&&(!!lr(u,f)||f[0]>=u[0]&&f[2]<=u[2]||f[1]>=u[1]&&f[3]<=u[3]||oft(n,t,i,r,function(n,t){return function(n,t,i){var r=!1,u=nd(n,t),f=nd(n,i);if(u===ir.INTERSECTING||f===ir.INTERSECTING)r=!0;else{var s,h,l=n[0],a=n[1],v=n[2],y=n[3],p=t[0],w=t[1],e=i[0],o=i[1],c=(o-w)/(e-p);f&ir.ABOVE&&!(u&ir.ABOVE)&&(r=(s=e-(o-y)/c)>=l&&s<=v);r||!(f&ir.RIGHT)||u&ir.RIGHT||(r=(h=o-(e-v)*c)>=a&&h<=y);r||!(f&ir.BELOW)||u&ir.BELOW||(r=(s=e-(o-a)/c)>=l&&s<=v);r||!(f&ir.LEFT)||u&ir.LEFT||(r=(h=o-(e-l)*c)>=a&&h<=y)}return r}(u,n,t)}))}function sft(n,t,i,r,u){if(!function(n,t,i,r,u){return!!(wp(n,t,i,r,u)||ko(n,t,i,r,u[0],u[1])||ko(n,t,i,r,u[0],u[3])||ko(n,t,i,r,u[2],u[1])||ko(n,t,i,r,u[2],u[3]))}(n,t,i[0],r,u))return!1;if(1===i.length)return!0;for(var f=1,e=i.length;f<e;++f)if(wbt(n,i[f-1],i[f],r,u)&&!wp(n,i[f-1],i[f],r,u))return!1;return!0}function bbt(n,t,i,r){for(var u,f;t<i-r;){for(u=0;u<r;++u)f=n[t+u],n[t+u]=n[i-r+u],n[i-r+u]=f;t+=r;i-=r}}function go(n,t,i,r){for(var u,f,e=0,o=n[i-r],s=n[i-r+1];t<i;t+=r)u=n[t],f=n[t+1],e+=(u-o)*(f+s),o=u,s=f;return e>0}function hft(n,t,i,r,u){for(var s,f,e=void 0!==u&&u,o=0,h=i.length;o<h;++o){if(s=i[o],f=go(n,t,s,r),0===o){if(e&&f||!e&&!f)return!1}else if(e&&!f||!e&&f)return!1;t=s}return!0}function bd(n,t,i,r,u){for(var s,f,e=void 0!==u&&u,o=0,h=i.length;o<h;++o)s=i[o],f=go(n,t,s,r),(0===o?e&&f||!e&&!f:e&&!f||!e&&f)&&bbt(n,t,s,r),t=s;return t}function cft(n,t,i,r,u){for(var f=0,e=i.length;f<e;++f)t=bd(n,t,i[f],r,u);return t}function lft(n,t,i,r){for(var e=i||32,u=[],f=0;f<e;++f)pt(u,sbt(n,t,2*Math.PI*f/e,r));return u.push(u[0],u[1]),new wa(u,v.XY,[u.length])}function ba(n){var t=n[0],i=n[1],r=n[2],u=n[3],f=[t,i,t,u,r,u,r,i,t,i];return new wa(f,v.XY,[f.length])}function kd(n,t,i){for(var f,c,o,l=t||32,e=n.getStride(),a=n.getLayout(),s=n.getCenter(),h=e*(l+1),r=new Array(h),u=0;u<h;u+=e)for(r[u]=0,r[u+1]=0,f=2;f<e;f++)r[u+f]=s[f];return c=[r.length],o=new wa(r,a,c),aft(o,s,n.getRadius(),i),o}function aft(n,t,i,r){for(var o,s,f=n.getFlatCoordinates(),h=n.getStride(),e=f.length/h-1,c=r||0,u=0;u<=e;++u)o=u*h,s=c+2*df(u,e)*Math.PI/e,f[o]=t[0]+i*Math.cos(s),f[o+1]=t[1]+i*Math.sin(s);n.changed()}function ah(n,t,i){var r=void 0!==i?n.toFixed(i):""+n,u=r.indexOf(".");return(u=-1===u?r.length:u)>t?r:new Array(1+t-u).join("0")+r}function pft(n,t){for(var r,u,f=(""+n).split("."),e=(""+t).split("."),i=0;i<Math.max(f.length,e.length);i++){if(r=parseInt(f[i]||"0",10),u=parseInt(e[i]||"0",10),r>u)return 1;if(u>r)return-1}return 0}function ka(n,t){return n[0]+=t[0],n[1]+=t[1],n}function bp(n,t){var u,f,v=n[0],y=n[1],h=t[0],c=t[1],e=h[0],o=h[1],l=c[0],a=c[1],i=l-e,r=a-o,s=0===i&&0===r?0:(i*(v-e)+r*(y-o))/(i*i+r*r||0);return s<=0?(u=e,f=o):s>=1?(u=l,f=a):(u=e+s*i,f=o+s*r),[u,f]}function kp(n,t,i){var e=df(t+180,360)-180,o=Math.abs(3600*e),s=i||0,h=Math.pow(10,s),u=Math.floor(o/3600),r=Math.floor((o-3600*u)/60),f=o-3600*u-60*r;return(f=Math.ceil(f*h)/h)>=60&&(f=0,r+=1),r>=60&&(r=0,u+=1),u+"° "+ah(r,2)+"′ "+ah(f,2,s)+"″"+(0==e?"":" "+n.charAt(e<0?1:0))}function wft(n,t,i){return n?t.replace("{x}",n[0].toFixed(i)).replace("{y}",n[1].toFixed(i)):""}function ns(n,t){for(var r=!0,i=n.length-1;i>=0;--i)if(n[i]!=t[i]){r=!1;break}return r}function da(n,t){var i=Math.cos(t),r=Math.sin(t),u=n[0]*i-n[1]*r,f=n[1]*i+n[0]*r;return n[0]=u,n[1]=f,n}function gd(n,t){return n[0]*=t,n[1]*=t,n}function ku(n,t){var i=n[0]-t[0],r=n[1]-t[1];return i*i+r*r}function dp(n,t){return Math.sqrt(ku(n,t))}function ga(n,t){return ku(n,bp(n,t))}function bft(n,t){return wft(n,"{x}, {y}",t)}function gp(n,t,i,r,u,f){var o=NaN,s=NaN,y=(i-t)/r,a,v,k,e,d,c;if(1===y)o=n[t],s=n[t+1];else if(2==y)o=(1-u)*n[t]+u*n[t+r],s=(1-u)*n[t+1]+u*n[t+r+1];else if(0!==y){for(var p=n[t],w=n[t+1],b=0,h=[0],l=t+r;l<i;l+=r)a=n[l],v=n[l+1],b+=Math.sqrt((a-p)*(a-p)+(v-w)*(v-w)),h.push(b),p=a,w=v;k=u*b;e=function(n,t,i){for(var u,e,s=i||lo,r=0,f=n.length,o=!1;r<f;)(e=+s(n[u=r+(f-r>>1)],t))<0?r=u+1:(f=u,o=!e);return o?r:~r}(h,k);e<0?(d=(k-h[-e-2])/(h[-e-1]-h[-e-2]),c=t+(-e-2)*r,o=yc(n[c],n[c+r],d),s=yc(n[c+1],n[c+r+1],d)):(o=n[t+e*r],s=n[t+e*r+1])}return f?(f[0]=o,f[1]=s,f):[o,s]}function ng(n,t,i,r,u,f){var o,e,h,c,l,a,s;if(i==t)return null;if(u<n[t+r-1])return f?((o=n.slice(t,t+r))[r-1]=u,o):null;if(n[i-1]<u)return f?((o=n.slice(i-r,i))[r-1]=u,o):null;if(u==n[t+r-1])return n.slice(t,t+r);for(e=t/r,h=i/r;e<h;)c=e+h>>1,u<n[(c+1)*r-1]?h=c:e=c+1;if(l=n[e*r-1],u==l)return n.slice((e-1)*r,(e-1)*r+r);for(a=(u-l)/(n[(e+1)*r-1]-l),o=[],s=0;s<r-1;++s)o.push(yc(n[(e-1)*r+s],n[e*r+s],a));return o.push(u),o}function kft(n,t,i,r){for(var f,e,o=n[t],s=n[t+1],h=0,u=t+r;u<i;u+=r)f=n[u],e=n[u+1],h+=Math.sqrt((f-o)*(f-o)+(e-s)*(e-s)),o=f,s=e;return h}function dft(n,t,i){for(var l,f,e,o,a,v,y=[],s=n(0),h=n(1),r=t(s),u=t(h),p=[h,s],w=[u,r],c=[1,0],b={},k=1e5;--k>0&&c.length>0;)e=c.pop(),s=p.pop(),r=w.pop(),(v=e.toString())in b||(y.push(r[0],r[1]),b[v]=!0),o=c.pop(),h=p.pop(),u=w.pop(),cut((f=t(l=n(a=(e+o)/2)))[0],f[1],r[0],r[1],u[0],u[1])<i?(y.push(u[0],u[1]),b[v=o.toString()]=!0):(c.push(o,a,a,e),w.push(u,f,f,r),p.push(h,l,l,s));return y}function vh(n){return"string"==typeof n?n:tet(n)}function yh(n){return Array.isArray(n)?n:gft(n)}function net(n){return n[0]=vi(n[0]+.5|0,0,255),n[1]=vi(n[1]+.5|0,0,255),n[2]=vi(n[2]+.5|0,0,255),n[3]=vi(n[3],0,1),n}function tet(n){var r=n[0],t,i;return r!=(0|r)&&(r=r+.5|0),t=n[1],t!=(0|t)&&(t=t+.5|0),i=n[2],i!=(0|i)&&(i=i+.5|0),"rgba("+r+","+t+","+i+","+(void 0===n[3]?1:n[3])+")"}function ckt(n){if(!this.isEventSimulatedFromTouch_(n)){bh.toString()in this.pointerMap&&this.cancel(n);var t=kh(n,this.dispatcher);this.pointerMap[bh.toString()]=n;this.dispatcher.down(t,n)}}function lkt(n){if(!this.isEventSimulatedFromTouch_(n)){var t=kh(n,this.dispatcher);this.dispatcher.move(t,n)}}function akt(n){var t,i;this.isEventSimulatedFromTouch_(n)||(t=this.pointerMap[bh.toString()],t&&t.button===n.button&&(i=kh(n,this.dispatcher),this.dispatcher.up(i,n),this.cleanupMouse()))}function vkt(n){if(!this.isEventSimulatedFromTouch_(n)){var t=kh(n,this.dispatcher);this.dispatcher.enterOver(t,n)}}function ykt(n){if(!this.isEventSimulatedFromTouch_(n)){var t=kh(n,this.dispatcher);this.dispatcher.leaveOut(t,n)}}function kh(n,t){var i=t.cloneEvent(n,n),r=i.preventDefault;return i.preventDefault=function(){n.preventDefault();r()},i.pointerId=bh,i.isPrimary=!0,i.pointerType=fet,i}function pkt(n){this.pointerMap[n.pointerId.toString()]=n;var t=this.prepareEvent_(n);this.dispatcher.down(t,n)}function wkt(n){var t=this.prepareEvent_(n);this.dispatcher.move(t,n)}function bkt(n){var t=this.prepareEvent_(n);this.dispatcher.up(t,n);this.cleanup(n.pointerId)}function kkt(n){var t=this.prepareEvent_(n);this.dispatcher.leaveOut(t,n)}function dkt(n){var t=this.prepareEvent_(n);this.dispatcher.enterOver(t,n)}function gkt(n){var t=this.prepareEvent_(n);this.dispatcher.cancel(t,n);this.cleanup(n.pointerId)}function ndt(n){var t=this.dispatcher.makeEvent("lostpointercapture",n,n);this.dispatcher.dispatchEvent(t)}function tdt(n){var t=this.dispatcher.makeEvent("gotpointercapture",n,n);this.dispatcher.dispatchEvent(t)}function idt(n){this.dispatcher.fireNativeEvent(n)}function rdt(n){this.dispatcher.fireNativeEvent(n)}function udt(n){this.dispatcher.fireNativeEvent(n)}function fdt(n){this.dispatcher.fireNativeEvent(n)}function edt(n){this.dispatcher.fireNativeEvent(n)}function odt(n){this.dispatcher.fireNativeEvent(n)}function sdt(n){this.dispatcher.fireNativeEvent(n)}function hdt(n){this.dispatcher.fireNativeEvent(n)}function adt(n){this.vacuumTouches_(n);this.setPrimaryTouch_(n.changedTouches[0]);this.dedupSynthMouse_(n);this.clickCount_++;this.processTouches_(n,this.overDown_)}function vdt(n){this.processTouches_(n,this.moveOverOut_)}function ydt(n){this.dedupSynthMouse_(n);this.processTouches_(n,this.upOut_)}function pdt(n){this.processTouches_(n,this.cancelOut_)}function ngt(n){return n}function uw(n){if(void 0!==n)return 0}function yet(n,t){if(void 0!==n)return n+t}function ug(n){return Math.pow(n,3)}function cf(n){return 1-ug(1-n)}function fw(n){return 3*n*n-2*n*n*n}function pet(n){return n}function ow(n,t){setTimeout(function(){n(t)},0)}function tgt(n){return!(n.sourceCenter&&n.targetCenter&&!ns(n.sourceCenter,n.targetCenter))&&n.sourceResolution===n.targetResolution&&n.sourceRotation===n.targetRotation}function kt(n,t){var i=document.createElement("canvas");return n&&(i.width=n),t&&(i.height=t),i.getContext("2d")}function fl(n,t){var i=t.parentNode;i&&i.replaceChild(n,t)}function sw(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function wet(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function ket(n,t,i){return void 0===i&&(i=[0,0]),i[0]=n[0]+2*t,i[1]=n[1]+2*t,i}function sg(n,t,i){return void 0===i&&(i=[0,0]),i[0]=n[0]*t+.5|0,i[1]=n[1]*t+.5|0,i}function ru(n,t){return Array.isArray(n)?n:(void 0===t?t=[n,n]:t[0]=t[1]=n,t)}function is(n,t){return n.visible&&t>=n.minResolution&&t<n.maxResolution}function det(n){this.updateElement_(n.frameState)}function get(n){var u=n.frameState,t,i,r;u&&(t=u.viewState.rotation,t!=this.rotation_&&(i="rotate("+t+"rad)",this.autoHide_&&(r=this.element.classList.contains(hw),r||0!==t?r&&0!==t&&this.element.classList.remove(hw):this.element.classList.add(hw)),this.label_.style.msTransform=i,this.label_.style.webkitTransform=i,this.label_.style.transform=i),this.rotation_=t)}function vg(n){var t=n||{},i=new er;return(void 0===t.zoom||t.zoom)&&i.push(new ag(t.zoomOptions)),(void 0===t.rotate||t.rotate)&&i.push(new lg(t.rotateOptions)),(void 0===t.attribution||t.attribution)&&i.push(new cg(t.attributionOptions)),i}function yg(n,t,i,r){aw(n,t=n.constrainRotation(t,0),i,r)}function aw(n,t,i,r){if(void 0!==t){var u=n.getRotation(),f=n.getCenter();void 0!==u&&f&&r>0?n.animate({rotation:t,anchor:i,duration:r,easing:cf}):n.rotate(t,i)}}function not(n,t,i,r,u){vw(n,t=n.constrainResolution(t,0,u),i,r)}function pg(n,t,i,r){var f=n.getResolution(),u=n.constrainResolution(f,t,0),o,s,e;void 0!==u&&(o=n.getResolutions(),u=vi(u,n.getMinResolution()||o[o.length-1],n.getMaxResolution()||o[0]));i&&void 0!==u&&u!==f&&(s=n.getCenter(),e=n.calculateCenterZoom(u,i),e=n.constrainCenter(e),i=[(u*s[0]-f*e[0])/(u-f),(u*s[1]-f*e[1])/(u-f)]);vw(n,u,i,r)}function vw(n,t,i,r){var u,f,e;t&&(u=n.getResolution(),f=n.getCenter(),void 0!==u&&f&&t!==u&&r?n.animate({resolution:t,anchor:i,duration:r,easing:cf}):(i&&(e=n.calculateCenterZoom(t,i),n.setCenter(e)),n.setResolution(t)))}function fgt(n){var t=!1;if(n.type==ht.DBLCLICK){var i=n.originalEvent,r=n.map,u=n.coordinate,f=i.shiftKey?-this.delta_:this.delta_;pg(r.getView(),f,u,this.duration_);n.preventDefault();t=!0}return!t}function gg(n){for(var i=n.length,r=0,u=0,t=0;t<i;t++)r+=n[t].clientX,u+=n[t].clientY;return[r/i,u/i]}function cgt(){var i=this.getMap(),n=i.getView(),u=i.getSize(),t=this.getGeometry().getExtent(),f,e,o,r;this.out_&&(f=n.calculateExtent(u),e=function(n,t){return ebt(rh(t),n)}([i.getPixelFromCoordinate(de(t)),i.getPixelFromCoordinate(ao(t))]),fp(f,1/n.getResolutionForExtent(e,u)),t=f);o=n.constrainResolution(n.getResolutionForExtent(t,u));r=su(t);r=n.constrainCenter(r);n.animate({resolution:o,center:r,duration:this.duration_,easing:cf})}function lgt(n){var o=!1,t,e;if(n.type==a.KEYDOWN&&(t=n.originalEvent.keyCode,this.condition_(n)&&(t==rs.DOWN||t==rs.LEFT||t==rs.RIGHT||t==rs.UP))){var r=n.map.getView(),i=r.getResolution()*this.pixelDelta_,u=0,f=0;t==rs.DOWN?f=-i:t==rs.LEFT?u=-i:t==rs.RIGHT?u=i:f=i;e=[u,f];da(e,r.getRotation()),function(n,t,i){var r=n.getCenter(),u;r&&(u=n.constrainCenter([r[0]+t[0],r[1]+t[1]]),i?n.animate({duration:i,easing:pet,center:u}):n.setCenter(u))}(r,e,this.duration_);n.preventDefault();o=!0}return!o}function agt(n){var i=!1,t,r,u;return(n.type==a.KEYDOWN||n.type==a.KEYPRESS)&&(t=n.originalEvent.charCode,this.condition_(n)&&(t=="+".charCodeAt(0)||t=="-".charCodeAt(0))&&(r=n.map,u=t=="+".charCodeAt(0)?this.delta_:-this.delta_,pg(r.getView(),u,void 0,this.duration_),n.preventDefault(),i=!0)),!i}function un(n){var t=n||{},i=new er,r=new ret(-.005,.05,100);return(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&i.push(new sot),(void 0===t.doubleClickZoom||t.doubleClickZoom)&&i.push(new tot({delta:t.zoomDelta,duration:t.zoomDuration})),(void 0===t.dragPan||t.dragPan)&&i.push(new oot({condition:t.onFocusOnly?wg:void 0,kinetic:r})),(void 0===t.pinchRotate||t.pinchRotate)&&i.push(new vot),(void 0===t.pinchZoom||t.pinchZoom)&&i.push(new yot({constrainResolution:t.constrainResolution,duration:t.zoomDuration})),(void 0===t.keyboard||t.keyboard)&&(i.push(new rn),i.push(new cot({delta:t.zoomDelta,duration:t.zoomDuration}))),(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&i.push(new aot({condition:t.onFocusOnly?wg:void 0,constrainResolution:t.constrainResolution,duration:t.zoomDuration})),(void 0===t.shiftDragZoom||t.shiftDragZoom)&&i.push(new tn({duration:t.zoomDuration})),i}function kot(){return bw||(bw=kt(1,1)),bw}function sn(n,t){var i=kot();return n!=i.font&&(i.font=n),i.measureText(t).width}function to(n,t,i,r){0!==t&&(n.translate(i,r),n.rotate(t),n.translate(-i,-r))}function got(n,t,i,r,u,f,e,o,s,h,c){var l;1!=i&&(l=n.globalAlpha,n.globalAlpha=l*i);t&&n.setTransform.apply(n,t);n.drawImage(r,u,f,e,o,s,h,e*c,o*c);l&&(n.globalAlpha=l);t&&n.setTransform.apply(n,hn)}function du(n){return Array.isArray(n)?tet(n):n}function nst(n,t,i){return t+":"+n+":"+(i?vh(i):"null")}function wgt(){ev.expire()}function tst(n,t){return n.zIndex-t.zIndex}function ln(n,t,i,r,u){return void 0!==u?(u.minX=n,u.maxX=t,u.minY=i,u.maxY=r,u):new af(n,t,i,r)}function kgt(n,t,i,r,u,f,e,o){for(var nt,h,ut,ot,c,b,s,ft,k,tt=[],v=n[t]>n[i-r],et=u.length,y=n[t],p=n[t+1],l=n[t+=r],a=n[t+1],it=0,d=Math.sqrt(Math.pow(l-y,2)+Math.pow(a-p,2)),w="",rt=0,g=0;g<et;++g){for(ft=v?et-g-1:g,nt=u.charAt(ft),h=f(w=v?nt+w:w+nt)-rt,rt+=h,ut=e+h/2;t<i-r&&it+d<ut;)y=l,p=a,l=n[t+=r],a=n[t+1],it+=d,d=Math.sqrt(Math.pow(l-y,2)+Math.pow(a-p,2));if(ot=ut-it,c=Math.atan2(a-p,l-y),(v&&(c+=c>0?-Math.PI:Math.PI),void 0!==k)&&(b=c-k,b+=b>Math.PI?-2*Math.PI:b<-Math.PI?2*Math.PI:0,Math.abs(b)>o))return null;var st=ot/d,ht=yc(y,l,st),ct=yc(p,a,st);k==c?(v&&(s[0]=ht,s[1]=ct,s[2]=h/2),s[4]=w):(rt=h,s=[ht,ct,h/2,c,w=nt],v?tt.unshift(s):tt.push(s),k=c);e+=h}return tt}function nnt(n,t,i,r,u){for(var c,h,l,b,a,k,e,o,d=i,g=i,v=0,s=0,y=i,p,w,f=i;f<r;f+=u)p=t[f],w=t[f+1],void 0!==l&&(e=p-l,o=w-b,h=Math.sqrt(e*e+o*o),void 0!==a&&(s+=c,Math.acos((a*e+k*o)/(c*h))>n&&(s>v&&(v=s,d=y,g=f),s=0,y=f-u)),c=h,a=e,k=o),l=p,b=w;return(s+=h)>v?[y,f]:[d,g]}function es(n,t,i){var r,u=Math.floor(n.length/2);if(t>=u)for(r=u;r<t;r++)n[r][i]=!0;else if(t<u)for(r=t+1;r<u;r++)n[r][i]=!0}function lst(n,t){return parseInt(y(n),10)-parseInt(y(t),10)}function av(n,t){var i=pn(n,t);return i*i}function pn(n,t){return rnt*n/t}function hl(n,t,i,r,u,e){var h=!1,o=i.getImage(),s;return o&&(s=o.getImageState(),s==ot.LOADED||s==ot.ERROR?o.unlistenImageChange(u,e):(s==ot.IDLE&&o.load(),s=o.getImageState(),o.listenImageChange(u,e),h=!0)),function(n,t,i,r){var e=i.getGeometryFunction()(t),u,o;e&&(u=e.getSimplifiedGeometry(r),i.getRenderer()?!function n(t,i,r,u){var s;if(i.getType()==f.GEOMETRY_COLLECTION){for(var o=i.getGeometries(),e=0,h=o.length;e<h;++e)n(t,o[e],r,u);return}s=t.getReplay(r.getZIndex(),ft.DEFAULT);s.drawCustom(i,u,r.getRenderer())}(n,u,i,t):(o=cst[u.getType()],o(n,u,i,t)))}(n,t,i,r),h}function dst(n,t){for(var r,u=kst.length,i=0;i<u;++i)try{if(r=n.getContext(kst[i],t),r)return r}catch(n){}return null}function wv(n,t){return n[0]=t[0],n[1]=t[1],n[4]=t[2],n[5]=t[3],n[12]=t[4],n[13]=t[5],n}function tht(n,t,i){var r=n.createTexture();return n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),void 0!==t&&n.texParameteri(vr,wst,t),void 0!==i&&n.texParameteri(vr,bst,i),r}function iht(n,t,i,r,u){var f=tht(n,r,u);return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t,i,0,n.RGBA,n.UNSIGNED_BYTE,null),f}function rht(n,t,i,r){var u=tht(n,i,r);return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),u}function dn(n,t,i,r){var u=i-r;return n[t]===n[u]&&n[t+1]===n[u+1]&&(i-t)/r>3&&!!sd(n,t,i,r)}function bht(){var n=kt(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}function ntt(n,t,i,r){return void 0!==r?(r[0]=n,r[1]=t,r[2]=i,r):[n,t,i]}function ss(n,t,i){return n+"/"+t+"/"+i}function kht(n){return ss(n[0],n[1],n[2])}function ttt(n){return(n[1]<<n[0])+n[2]}function dht(n){return n?Array.isArray(n)?function(){return n}:"function"==typeof n?n:function(){return[n]}:null}function ght(n){var t=n.getDefaultTileGrid();return t||(t=tct(n),n.setDefaultTileGrid(t)),t}function cti(n,t,i,r){var u=void 0!==r?r:vc.TOP_LEFT,f=nct(n,t,i);return new yl({extent:n,origin:function(n,t){var i;return t===vc.BOTTOM_LEFT?i=de(n):t===vc.BOTTOM_RIGHT?i=fh(n):t===vc.TOP_LEFT?i=bf(n):t===vc.TOP_RIGHT?i=ao(n):g(!1,13),i}(n,u),resolutions:f,tileSize:i})}function pl(n){var t=n||{},i=t.extent||w("EPSG:3857").getExtent(),r={extent:i,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:nct(i,t.maxZoom,t.tileSize)};return new yl(r)}function nct(n,t,i){for(var o=void 0!==t?t:gdt,s=ti(n),h=wt(n),u=ru(void 0!==i?i:rw),c=Math.max(h/u[0],s/u[1]),f=o+1,e=new Array(f),r=0;r<f;++r)e[r]=c/Math.pow(2,r);return e}function tct(n,t,i,r){return cti(uc(n),t,i,r)}function uc(n){var i=(n=w(n)).getExtent(),t;return i||(t=180*gf[pr.DEGREES]/n.getMetersPerUnit(),i=ef(-t,-t,t,t)),i}function rct(n,t,i,r){return function(u,f,e){var o=new XMLHttpRequest;o.open("GET","function"==typeof n?n(u,f,e):n,!0);t.getType()==ro.ARRAY_BUFFER&&(o.responseType="arraybuffer");o.onload=function(){if(!o.status||o.status>=200&&o.status<300){var n,u=t.getType();u==ro.JSON||u==ro.TEXT?n=o.responseText:u==ro.XML?(n=o.responseXML)||(n=(new DOMParser).parseFromString(o.responseText,"application/xml")):u==ro.ARRAY_BUFFER&&(n=o.response);n?i.call(this,t.readFeatures(n,{featureProjection:e}),t.readProjection(n),t.getLastExtent()):r.call(this)}else r.call(this)}.bind(this);o.onerror=function(){r.call(this)}.bind(this);o.send()}}function uct(n,t){return rct(n,t,function(n){"function"==typeof this.addFeatures&&this.addFeatures(n)},wf)}function fct(){return[[-1/0,-1/0,1/0,1/0]]}function rt(n,t){return fc.createElementNS(n,t)}function fu(n,t){return function n(t,i,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)i?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else for(var u=t.firstChild;u;u=u.nextSibling)n(u,i,r);return r}(n,t,[]).join("")}function ye(n){return"documentElement"in n}function ue(n){return(new DOMParser).parseFromString(n,"application/xml")}function ect(n,t){return function(i,r){var u=n.call(void 0!==t?t:this,i,r);void 0!==u&&pt(r[r.length-1],u)}}function b(n,t){return function(i,r){var u=n.call(void 0!==t?t:this,i,r);void 0!==u&&r[r.length-1].push(u)}}function tt(n,t){return function(i,r){var u=n.call(void 0!==t?t:this,i,r);void 0!==u&&(r[r.length-1]=u)}}function ii(n,t,i){return function(r,u){var o=n.call(void 0!==i?i:this,r,u),f,e;void 0!==o&&(f=u[u.length-1],e=void 0!==t?t:r.localName,(e in f?f[e]:f[e]=[]).push(o))}}function u(n,t,i){return function(r,u){var f=n.call(void 0!==i?i:this,r,u);void 0!==f&&(u[u.length-1][void 0!==t?t:r.localName]=f)}}function e(n,t){return function(i,r,u){n.call(void 0!==t?t:this,i,r,u);u[u.length-1].node.appendChild(i)}}function oct(n){var t,i;return function(r,u,f){if(void 0===t){t={};var e={};e[r.localName]=n;t[r.namespaceURI]=e;i=gt(r.localName)}sct(t,i,u,f)}}function gt(n,t){var i=n;return function(n,r,u){var e=r[r.length-1].node,f=i;return void 0===f&&(f=u),rt(void 0!==t?t:e.namespaceURI,f)}}function nf(n,t){for(var r=t.length,u=new Array(r),i=0;i<r;++i)u[i]=n[t[i]];return u}function s(n,t,i){for(var f=void 0!==i?i:{},r=0,u=n.length;r<u;++r)f[n[r]]=t;return f}function vu(n,t,i,r){for(var f,e,u=t.firstElementChild;u;u=u.nextElementSibling)f=n[u.namespaceURI],void 0!==f&&(e=f[u.localName],void 0!==e&&e.call(r,u,i))}function h(n,t,i,r,u){return r.push(n),vu(t,i,r,u),r.pop()}function sct(n,t,i,r,u,f){for(var s,e,h=(void 0!==u?u:i).length,o=0;o<h;++o)void 0!==(s=i[o])&&void 0!==(e=t.call(void 0!==f?f:this,s,r,void 0!==u?u[o]:void 0))&&n[e.namespaceURI][e.localName].call(f,e,s,r)}function it(n,t,i,r,u,f,e){return u.push(n),sct(t,i,r,u,f,e),u.pop()}function cct(n,t,i){var u=[],f=[],r=[],e=[],o=[],s=void 0!==i?i:[],h=n.SupportedCRS,c=w(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||w(h),l=c.getMetersPerUnit(),a="ne"==c.getAxisOrientation().substr(0,2);return n.TileMatrix.sort(function(n,t){return t.ScaleDenominator-n.ScaleDenominator}),n.TileMatrix.forEach(function(t){if(!(s.length>0)||ha(s,function(i){return t.Identifier==i.TileMatrix||-1===t.Identifier.indexOf(":")&&n.Identifier+":"+t.Identifier===i.TileMatrix})){f.push(t.Identifier);var c=.00028*t.ScaleDenominator/l,i=t.TileWidth,h=t.TileHeight;a?r.push([t.TopLeftCorner[1],t.TopLeftCorner[0]]):r.push(t.TopLeftCorner);u.push(c);e.push(i==h?i:[i,h]);o.push([t.MatrixWidth,-t.MatrixHeight])}}),new utt({extent:t,origins:r,resolutions:u,matrixIds:f,tileSizes:e,sizes:o})}function kti(){if(!yb){var n=new te({color:"rgba(255,255,255,0.4)"}),t=new hf({color:"#3399CC",width:1.25});yb=[new ai({image:new ett({fill:n,stroke:t,radius:5}),fill:n,stroke:t})]}return yb}function ty(){var n={},t=[255,255,255,1],i=[0,153,255,1];return n[f.POLYGON]=[new ai({fill:new te({color:[255,255,255,.5]})})],n[f.MULTI_POLYGON]=n[f.POLYGON],n[f.LINE_STRING]=[new ai({stroke:new hf({color:t,width:5})}),new ai({stroke:new hf({color:i,width:3})})],n[f.MULTI_LINE_STRING]=n[f.LINE_STRING],n[f.CIRCLE]=n[f.POLYGON].concat(n[f.LINE_STRING]),n[f.POINT]=[new ai({image:new ett({radius:6,fill:new te({color:i}),stroke:new hf({color:t,width:1.5})}),zIndex:1/0})],n[f.MULTI_POINT]=n[f.POINT],n[f.GEOMETRY_COLLECTION]=n[f.POLYGON].concat(n[f.LINE_STRING],n[f.POINT]),n}function act(n){return n.getGeometry()}function dti(n,t){var i=/\{z\}/g,r=/\{x\}/g,u=/\{y\}/g,f=/\{-y\}/g;return function(e){if(e)return n.replace(i,e[0].toString()).replace(r,e[1].toString()).replace(u,function(){return(-e[2]-1).toString()}).replace(f,function(){var i=e[0],n=t.getFullTileRange(i);return g(n,55),(n.getHeight()+e[2]).toString()})}}function ott(n,t){for(var r=n.length,u=new Array(r),i=0;i<r;++i)u[i]=dti(n[i],t);return iy(u)}function iy(n){return 1===n.length?n[0]:function(t,i,r){if(t){var u=df(ttt(t),n.length);return n[u](t,i,r)}}}function stt(){}function htt(n){var i=[],t=/\{([a-z])-([a-z])\}/.exec(n),r,f,e,o,u;if(t){for(f=t[1].charCodeAt(0),e=t[2].charCodeAt(0),r=f;r<=e;++r)i.push(n.replace(t[0],String.fromCharCode(r)));return i}if(t=t=/\{(\d+)-(\d+)\}/.exec(n)){for(o=parseInt(t[2],10),u=parseInt(t[1],10);u<=o;u++)i.push(n.replace(t[0],u.toString()));return i}return i.push(n),i}function pb(n,t,i,r){function e(){delete window[f];u.parentNode.removeChild(u)}var u=document.createElement("script"),f="olc_"+y(t),o;u.async=!0;u.src=n+(-1==n.indexOf("?")?"?":"&")+(r||"callback")+"="+f;o=setTimeout(function(){e();i&&i()},1e4);window[f]=function(n){clearTimeout(o);e();t(n)};document.getElementsByTagName("head")[0].appendChild(u)}function wb(n,t,i,r){var s=dc(i,t,n),u=hp(t,r,i),h=t.getMetersPerUnit(),e,o,f;return void 0!==h&&(u*=h),e=n.getMetersPerUnit(),void 0!==e&&(u/=e),o=n.getExtent(),(!o||tp(o,s))&&(f=hp(n,u,s)/u,isFinite(f)&&f>0&&(u/=f)),u}function ctt(n,t,i,r){var u=i-n,f=r-t,e=Math.sqrt(u*u+f*f);return[Math.round(i+u/e),Math.round(r+f/e)]}function vct(n,t,i,r,u,f,e,o,s,h,c){var l=kt(Math.round(i*n),Math.round(i*t)),v,a;if(0===s.length)return l.canvas;l.scale(i,i);v=[1/0,1/0,-1/0,-1/0];s.forEach(function(n){rp(v,n.extent)});var w=wt(v),b=ti(v),p=kt(Math.round(i*w/r),Math.round(i*b/r)),y=i/r;return s.forEach(function(n){var t=n.extent[0]-v[0],i=-(n.extent[3]-v[3]),r=wt(n.extent),u=ti(n.extent);p.drawImage(n.image,h,h,n.image.width-2*h,n.image.height-2*h,t*y,i*y,r*y,u*y)}),a=bf(e),o.getTriangles().forEach(function(n){var t=n.source,u=n.target,nt=t[0][0],tt=t[0][1],it=t[1][0],rt=t[1][1],ut=t[2][0],ft=t[2][1],o=(u[0][0]-a[0])/f,s=-(u[0][1]-a[1])/f,h=(u[1][0]-a[0])/f,c=-(u[1][1]-a[1])/f,y=(u[2][0]-a[0])/f,w=-(u[2][1]-a[1])/f,b=nt,k=tt,e;if(nt=0,tt=0,e=function(n){for(var l,a,f,v,u,s,i,e,r=n.length,t=0;t<r;t++){for(var h=t,c=Math.abs(n[t][t]),o=t+1;o<r;o++)l=Math.abs(n[o][t]),l>c&&(c=l,h=o);if(0===c)return null;for(a=n[h],n[h]=n[t],n[t]=a,f=t+1;f<r;f++)for(v=-n[f][t]/n[t][t],u=t;u<r+1;u++)t==u?n[f][u]=0:n[f][u]+=v*n[t][u]}for(s=new Array(r),i=r-1;i>=0;i--)for(s[i]=n[i][r]/n[i][i],e=i-1;e>=0;e--)n[e][r]-=n[e][i]*s[i];return s}([[it-=b,rt-=k,0,0,h-o],[ut-=b,ft-=k,0,0,y-o],[0,0,it,rt,c-s],[0,0,ut,ft,w-s]]),e){l.save();l.beginPath();var d=(o+h+y)/3,g=(s+c+w)/3,et=ctt(d,g,o,s),ot=ctt(d,g,h,c),st=ctt(d,g,y,w);l.moveTo(ot[0],ot[1]);l.lineTo(et[0],et[1]);l.lineTo(st[0],st[1]);l.clip();l.transform(e[0],e[2],e[1],e[3],o,s);l.translate(v[0]-b,v[3]-k);l.scale(r/i,-r/i);l.drawImage(p.canvas,0,0);l.restore()}}),c&&(l.save(),l.strokeStyle="black",l.lineWidth=1,o.getTriangles().forEach(function(n){var t=n.target,i=(t[0][0]-a[0])/f,r=-(t[0][1]-a[1])/f,u=(t[1][0]-a[0])/f,e=-(t[1][1]-a[1])/f,o=(t[2][0]-a[0])/f,s=-(t[2][1]-a[1])/f;l.beginPath();l.moveTo(u,e);l.lineTo(i,r);l.lineTo(o,s);l.closePath();l.stroke()}),l.restore()),l.canvas}function rii(n,t){n.getImage().src=t}function kb(n,t){n.getImage().src=t}function oc(n,t){var i=[],r;return Object.keys(t).forEach(function(n){null!==t[n]&&void 0!==t[n]&&i.push(n+"="+encodeURIComponent(t[n]))}),r=i.join("&"),(n=-1===(n=n.replace(/[?&]$/,"")).indexOf("?")?n+"?":n+"&")+r}function gii(n,t,i){var r,u,f;return n.prepareFrame(t,i)?(r=t.size[0],u=t.size[1],sc?(f=sc.canvas,f.width!==r||f.height!==u?sc=kt(r,u):sc.clearRect(0,0,r,u)):sc=kt(r,u),n.composeFrame(t,i,sc),sc.getImageData(0,0,r,u)):null}function nri(n){var r=n,u=n,t=n,i=null;return"function"==typeof r.getTile?i=function(n){var t=new rlt({source:n});return new sv(t)}(r):"function"==typeof u.getImage?i=function(n){var t=new tlt({source:n});return new ov(t)}(u):t.getType()===kr.TILE?i=new sv(t):t.getType()!=kr.IMAGE&&t.getType()!=kr.VECTOR||(i=new ov(t)),i}function eri(n,t,i){var r=this.getTileGrid(),e,u,f;if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=n[0]))return e=r.getTileCoordExtent(n,this.tmpExtent_),u=ru(r.getTileSize(n[0]),this.tmpSize),1!=t&&(u=sg(u,t,this.tmpSize)),f={F:"image",FORMAT:"PNG32",TRANSPARENT:!0},nt(f,this.params_),this.getRequestUrl_(n,u,e,t,i,f)}function lri(n,t,i){var r=this.getTileGrid(),o;if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=n[0])){1==t||this.hidpi_&&void 0!==this.serverType_||(t=1);var s=r.getResolution(n[0]),f=r.getTileCoordExtent(n,this.tmpExtent_),u=ru(r.getTileSize(n[0]),this.tmpSize),e=this.gutter_;return 0!==e&&(u=ket(u,e,this.tmpSize),f=ff(f,s*e,f)),1!=t&&(u=sg(u,t,this.tmpSize)),o={SERVICE:"WMS",VERSION:kl,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0},nt(o,this.params_),this.getRequestUrl_(n,u,f,t,i,o)}}function wri(n,t){var i=rct(t,n.getFormat(),n.onLoad.bind(n),n.onError.bind(n));n.setLoader(i)}function elt(n){var i=this.requestEncoding_,t={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_},r,u;return i==as.KVP&&nt(t,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),n=i==as.KVP?oc(n,t):n.replace(/\{(\w+?)\}/g,function(n,i){return i.toLowerCase()in t?t[i.toLowerCase()]:n}),r=this.tileGrid,u=this.dimensions_,function(t){var f,e;if(t)return f={TileMatrix:r.getMatrixId(t[0]),TileCol:t[1],TileRow:-t[2]-1},nt(f,u),e=n,i==as.KVP?oc(e,f):e.replace(/\{(\w+?)\}/g,function(n,t){return f[t]})}}function oui(n){for(var i,r,u=n.dataTransfer.files,t=0,f=u.length;t<f;++t)i=u.item(t),r=new FileReader,r.addEventListener(a.LOAD,this.handleResult_.bind(this,i)),r.readAsText(i)}function ytt(n){n.stopPropagation();n.preventDefault();n.dataTransfer.dropEffect="copy"}function llt(n,t,i,r){for(var f,o=[],u=[1/0,1/0,-1/0,-1/0],e=0,s=i.length;e<s;++e)f=i[e],u=td(n,t,f[0],r),o.push((u[0]+u[2])/2,(u[1]+u[3])/2),t=f[f.length-1];return o}function vlt(n){return function(t){return hi([n,t])}}function ylt(n,t){return n[0]==t[0]?function(i){return hi([n,[i[0],t[1]]])}:n[1]==t[1]?function(i){return hi([n,[t[0],i[1]]])}:null}function wui(n,t){return n.index-t.index}function wlt(n,t){var u=t.geometry,i,e,r;return u.getType()===f.CIRCLE&&(i=u,t.index===fy)?(e=ku(i.getCenter(),n),r=Math.sqrt(e)-i.getRadius(),r*r):ga(n,t.segment)}function blt(n,t){var i=t.geometry;return i.getType()===f.CIRCLE&&t.index===fy?i.getClosestPoint(n):bp(n,t.segment)}function gui(n){var u,f,s,e;if(!this.condition_(n))return!0;var h=this.addCondition_(n),c=this.removeCondition_(n),o=this.toggleCondition_(n),a=!h&&!c&&!o,l=n.map,i=this.getFeatures(),r=[],t=[];if(a){for(pf(this.featureLayerAssociation_),l.forEachFeatureAtPixel(n.pixel,function(n,i){if(this.filter_(n,i))return t.push(n),this.addFeatureLayerAssociation_(n,i),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_}),u=i.getLength()-1;u>=0;--u)f=i.item(u),s=t.indexOf(f),s>-1?t.splice(s,1):(i.remove(f),r.push(f));0!==t.length&&i.extend(t)}else{for(l.forEachFeatureAtPixel(n.pixel,function(n,u){if(this.filter_(n,u))return!h&&!o||tr(i.getArray(),n)?(c||o)&&tr(i.getArray(),n)&&(r.push(n),this.removeFeatureLayerAssociation_(n)):(t.push(n),this.addFeatureLayerAssociation_(n,u)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_}),e=r.length-1;e>=0;--e)i.remove(r[e]);i.extend(t)}return(t.length>0||r.length>0)&&this.dispatchEvent(new dui(kui.SELECT,t,r,n)),fot(n)}function dlt(n){return n.feature?n.feature:n.element?n.element:void 0}function glt(n){for(var i=[],t=0,r=n.length;t<r;++t)i.push(n[t].clone());return i}function si(n,t,i){var r,u=i?w(i.featureProjection):null,f=i?w(i.dataProjection):null,e;return(r=u&&f&&!hu(u,f)?Array.isArray(n)?bo(n,f,u):(t?n.clone():n).transform(t?u:f,t?f:u):n,t&&i&&void 0!==i.decimals&&!Array.isArray(r))&&(e=Math.pow(10,i.decimals),r===n&&(r=n.clone()),r.applyTransform(function(n){for(var t=0,i=n.length;t<i;++t)n[t]=Math.round(n[t]*e)/e;return n})),r}function nk(n){if("string"==typeof n){var t=JSON.parse(n);return t||null}return null!==n?n:null}function nat(n,t){var i;if(!n)return null;if("number"==typeof n.x&&"number"==typeof n.y)i=f.POINT;else if(n.points)i=f.MULTI_POINT;else if(n.paths)i=1===n.paths.length?f.LINE_STRING:f.MULTI_LINE_STRING;else if(n.rings){var u=n,e=gl(u),r=function(n,t){for(var u=[],r=[],e=[],h,f,o,c,l,i=0,s=n.length;i<s;++i)u.length=0,pa(u,0,n[i],t.length),h=go(u,0,u.length,t.length),h?r.push([n[i]]):e.push(n[i]);for(;e.length;){for(f=e.shift(),o=!1,i=r.length-1;i>=0;i--)if(c=r[i][0],l=lr(new lh(c).getExtent(),new lh(f).getExtent()),l){r[i].push(f);o=!0;break}o||r.push([f.reverse()])}return r}(u.rings,e);1===r.length?(i=f.POLYGON,n.rings=r[0]):(i=f.MULTI_POLYGON,n.rings=r)}return si(ps[i](n),!1,t)}function gl(n){var t=v.XY;return!0===n.hasZ&&!0===n.hasM?t=v.XYZM:!0===n.hasZ?t=v.XYZ:!0===n.hasM&&(t=v.XYM),t}function ey(n){var t=n.getLayout();return{hasZ:t===v.XYZ||t===v.XYZM,hasM:t===v.XYM||t===v.XYZM}}function tat(n,t){return ws[n.getType()](si(n,!0,t),t)}function bs(n){return hc(fu(n,!1))}function hc(n){var t=/^\s*(true|1)|(false|0)\s*$/.exec(n);if(t)return void 0!==t[1]||!1}function dtt(n){var i=fu(n,!1),t=Date.parse(i);if(!isNaN(t))return t/1e3}function yt(n){return fo(fu(n,!1))}function fo(n){var t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n);if(t)return parseFloat(t[1])}function cr(n){return eo(fu(n,!1))}function eo(n){var t=/^\s*(\d+)\s*$/.exec(n);if(t)return parseInt(t[1],10)}function l(n){return fu(n,!1).trim()}function ik(n,t){ut(n,t?"1":"0")}function yu(n,t){var i=t.toPrecision();n.appendChild(fc.createTextNode(i))}function rk(n,t){var i=t.toString();n.appendChild(fc.createTextNode(i))}function ut(n,t){n.appendChild(fc.createTextNode(t))}function pei(n,t){var r=n.getGeometry(),i;if(r&&(i=yei[r.getType()],i))return rt(t[t.length-1].node.namespaceURI,i)}function gtt(n,t,i,r){return n.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in r?(n.push(r.ele),delete r.ele,t.hasZ=!0):n.push(0),"time"in r?(n.push(r.time),delete r.time,t.hasM=!0):n.push(0),n}function nit(n,t,i){var e=v.XY,u=2,r,o,f,s;if(n.hasZ&&n.hasM?(e=v.XYZM,u=4):n.hasZ?(e=v.XYZ,u=3):n.hasM&&(e=v.XYM,u=3),4!==u){for(r=0,o=t.length/4;r<o;r++)t[r*u]=t[4*r],t[r*u+1]=t[4*r+1],n.hasZ&&(t[r*u+2]=t[4*r+2]),n.hasM&&(t[r*u+2]=t[4*r+3]);if(t.length=t.length/4*u,i)for(f=0,s=i.length;f<s;f++)i[f]=i[f]/4*u}return e}function tit(n,t){var r=t[t.length-1],i=n.getAttribute("href");null!==i&&(r.link=i);vu(pfi,n,t)}function iit(n,t){t[t.length-1].extensionsNode_=n}function iat(n,t){var s=t[0],i=h({flatCoordinates:[],layoutOptions:{}},kfi,n,t),r,e,o,u,f;if(i)return r=i.flatCoordinates,delete i.flatCoordinates,e=i.layoutOptions,delete i.layoutOptions,o=nit(e,r),u=new yi(r,o),si(u,!1,s),f=new fi(u),f.setProperties(i),f}function rat(n,t){var c=t[0],i=h({flatCoordinates:[],ends:[],layoutOptions:{}},gfi,n,t),r,u,o,s,f,e;if(i)return r=i.flatCoordinates,delete i.flatCoordinates,u=i.ends,delete i.ends,o=i.layoutOptions,delete i.layoutOptions,s=nit(o,r,u),f=new yf(r,s,u),si(f,!1,c),e=new fi(f),e.setProperties(i),e}function uat(n,t){var o=t[0],i=h({},iei,n,t),r;if(i){var u={},f=gtt([],u,n,i),s=nit(u,f),e=new ei(f,s);return si(e,!1,o),r=new fi(e),r.setProperties(i),r}}function rit(n,t,i){n.setAttribute("href",t);var r=i[i.length-1].properties,u=[r.linkText,r.linkType];it({node:n},uei,hr,u,i,rei)}function uit(n,t,i){var u=i[i.length-1],e=u.node.namespaceURI,r=u.properties,f,o;switch(n.setAttributeNS(null,"lat",String(t[1])),n.setAttributeNS(null,"lon",String(t[0])),u.geometryLayout){case v.XYZM:0!==t[3]&&(r.time=t[3]);case v.XYZ:0!==t[2]&&(r.ele=t[2]);break;case v.XYM:0!==t[2]&&(r.time=t[2])}f="rtept"==n.nodeName?oei[e]:aei[e];o=nf(r,f);it({node:n,properties:r},vei,hr,o,i,f)}function fit(n,t){if(!n)return null;var i;switch(n.type){case f.POINT:i=function(n){return new ei(n.coordinates)}(n);break;case f.LINE_STRING:i=function(n){return new yi(n.coordinates)}(n);break;case f.POLYGON:i=function(n){return new or(n.coordinates)}(n);break;case f.MULTI_POINT:i=function(n){return new pe(n.coordinates)}(n);break;case f.MULTI_LINE_STRING:i=function(n){return new yf(n.coordinates)}(n);break;case f.MULTI_POLYGON:i=function(n){return new we(n.coordinates)}(n);break;case f.GEOMETRY_COLLECTION:i=function(n,t){var i=n.geometries.map(function(n){return fit(n,t)});return new ys(i)}(n);break;default:throw new Error("Unsupported GeoJSON type: "+n.type);}return si(i,!1,t)}function eit(n,t){var i,r=(n=si(n,!0,t)).getType();switch(r){case f.POINT:i=function(n){return{type:"Point",coordinates:n.getCoordinates()}}(n);break;case f.LINE_STRING:i=function(n){return{type:"LineString",coordinates:n.getCoordinates()}}(n);break;case f.POLYGON:i=function(n,t){var i;return t&&(i=t.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(i)}}(n,t);break;case f.MULTI_POINT:i=function(n){return{type:"MultiPoint",coordinates:n.getCoordinates()}}(n);break;case f.MULTI_LINE_STRING:i=function(n){return{type:"MultiLineString",coordinates:n.getCoordinates()}}(n);break;case f.MULTI_POLYGON:i=function(n,t){var i;return t&&(i=t.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(i)}}(n,t);break;case f.GEOMETRY_COLLECTION:i=function(n,t){return{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(n){var i=nt({},t);return delete i.featureProjection,eit(n,i)})}}(n,t);break;case f.CIRCLE:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r);}return i}function fk(n){return"string"==typeof n?n:""}function bit(n,t){var i=null,f=[0,0],o="start",r,e,u;return n.getImage()&&(r=n.getImage().getImageSize(),(null===r&&(r=ek),2==r.length)&&(e=n.getImage().getScale(),f[0]=e*r[0]/2,f[1]=-e*r[1]/2,o="left")),null!==n.getText()?(u=n.getText(),(i=u.clone()).setFont(u.getFont()||cc.getFont()),i.setScale(u.getScale()||cc.getScale()),i.setFill(u.getFill()||cc.getFill()),i.setStroke(u.getStroke()||yit)):i=cc.clone(),i.setText(t),i.setOffsetX(f[0]),i.setOffsetY(f[1]),i.setTextAlign(o),new wl({text:i})}function kit(n){var r=fu(n,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(r),t;if(i)return t=i[1],[parseInt(t.substr(6,2),16),parseInt(t.substr(4,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(0,2),16)/255]}function cat(n){for(var t,i=fu(n,!1),r=[];t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i.exec(i);){var u=parseFloat(t[1]),f=parseFloat(t[2]),e=t[3]?parseFloat(t[3]):0;r.push(u,f,e);i=i.substr(t[0].length)}if(""===i)return r}function sk(n){var i=fu(n,!1).trim(),t=n.baseURI;return t&&"about:blank"!=t||(t=window.location.href),t?new URL(i,t).href:i}function lat(n){return yt(n)}function vat(n,t){return h(void 0,aat,n,t)}function yat(n,t){return h(null,coi,n,t)}function bat(n,t){var r=h({flatCoordinates:[],whens:[]},wat,n,t);if(r){for(var u=r.flatCoordinates,f=r.whens,i=0,e=Math.min(u.length,f.length);i<e;++i)u[4*i+3]=f[i];return new yi(u,v.XYZM)}}function dit(n,t){return h(null,dat,n,t)}function gat(n,t){var u=h({},ly,n,t),r=dit(n,t),i;if(r)return i=new yi(r,v.XYZ),i.setProperties(u),i}function nvt(n,t){var u=h({},ly,n,t),i=dit(n,t),r;if(i)return r=new or(i,v.XYZ,[i.length]),r.setProperties(u),r}function ivt(n,t){var r,i=h([],tvt,n,t),c,e,v;if(!i)return null;if(0===i.length)return new ys(i);for(var l,o,a=!0,u=i[0].getType(),s=1,y=i.length;s<y;++s)if(i[s].getType()!=u){a=!1;break}if(a)if(u==f.POINT){for(c=i[0],l=c.getLayout(),o=c.getFlatCoordinates(),e=1,v=i.length;e<v;++e)pt(o,i[e].getFlatCoordinates());nrt(r=new pe(o,l),i)}else u==f.LINE_STRING?nrt(r=new yf(i),i):u==f.POLYGON?nrt(r=new we(i),i):u==f.GEOMETRY_COLLECTION?r=new ys(i):g(!1,37);else r=new ys(i);return r}function rvt(n,t){var u=h({},ly,n,t),r=dit(n,t),i;if(r)return i=new ei(r,v.XYZ),i.setProperties(u),i}function fvt(n,t){var o=h({},ly,n,t),i=h([null],uvt,n,t),f;if(i&&i[0]){for(var r=i[0],e=[r.length],u=1,s=i.length;u<s;++u)pt(r,i[u]),e.push(r.length);return f=new or(r,v.XYZ,e),f.setProperties(o),f}}function git(n,t){var i=h({},evt,n,t),r,u,f;if(!i)return null;u="fillStyle"in i?i.fillStyle:ok;f=i.fill;void 0===f||f||(u=null);"imageStyle"in i?i.imageStyle!=ait&&(r=i.imageStyle):r=vit;var s="textStyle"in i?i.textStyle:cc,e="strokeStyle"in i?i.strokeStyle:pit,o=i.outline;return void 0===o||o||(e=null),[new wl({fill:u,image:r,stroke:e,text:s,zIndex:void 0})]}function nrt(n,t){for(var u,f,c=t.length,o=new Array(t.length),s=new Array(t.length),h=new Array(t.length),e,r=u=f=!1,i=0;i<c;++i)e=t[i],o[i]=e.get("extrude"),s[i]=e.get("tessellate"),h[i]=e.get("altitudeMode"),r=r||void 0!==o[i],u=u||void 0!==s[i],f=f||h[i];r&&n.set("extrude",o);u&&n.set("tessellate",s);f&&n.set("altitudeMode",h)}function hvt(n,t){vu(svt,n,t)}function cvt(n,t){vu(sat,n,t)}function trt(n,t){for(var u,i=yh(t),f=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],r=0;r<4;++r)u=Math.floor(f[r]).toString(16),f[r]=1==u.length?"0"+u:u;ut(n,f.join(""))}function yvt(n,t,i){var r,u,o={node:n},e=t.getType();e==f.GEOMETRY_COLLECTION?(r=t.getGeometries(),u=vvt):e==f.MULTI_POINT?(r=t.getPoints(),u=osi):e==f.MULTI_LINE_STRING?(r=t.getLineStrings(),u=ssi):e==f.MULTI_POLYGON?(r=t.getPolygons(),u=csi):g(!1,39);it(o,lsi,u,r,i)}function wvt(n,t,i){it({node:n},pvt,hsi,[t],i)}function bvt(n,t,i){var o={node:n},r,s,e,a,h,u,c,l,y,f;t.getId()&&n.setAttribute("id",t.getId());r=t.getProperties();s={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};s[t.getGeometryName()]=1;e=Object.keys(r||{}).sort().filter(function(n){return!s[n]});e.length>0&&(a=nf(r,e),it(o,irt,vsi,[{names:e,values:a}],i));h=t.getStyleFunction();h&&(u=h(t,0),u&&(c=Array.isArray(u)?u[0]:u,this.writeStyles_&&(r.Style=c),l=c.getText(),l&&(r.name=l.getText())));var p=i[i.length-1].node,v=asi[p.namespaceURI],w=nf(r,v);it(o,irt,hr,w,i,v);y=i[0];f=t.getGeometry();f&&(f=si(f,!0,y));it(o,irt,vvt,[f],i)}function ta(n,t,i){var e=t.getFlatCoordinates(),r={node:n},u;r.layout=t.getLayout();r.stride=t.getStride();u=t.getProperties();u.coordinates=e;var o=i[i.length-1].node,f=kvt[o.namespaceURI],s=nf(u,f);it(r,dvt,hr,s,i,f)}function nyt(n,t,i){var r=t.getLinearRings(),f=r.shift(),u={node:n};it(u,gvt,ysi,r,i);it(u,gvt,psi,[f],i)}function ryt(n,t){yu(n,Math.round(1e6*t)/1e6)}function nhi(n,t,i){if(3===n){var r={keys:[],values:[],features:[]},u=i.readVarint()+i.pos;i.readFields(thi,r,u);r.length=r.features.length;r.length&&(t[r.name]=r)}}function thi(n,t,i){if(15===n)t.version=i.readVarint();else if(1===n)t.name=i.readString();else if(5===n)t.extent=i.readVarint();else if(2===n)t.features.push(i.pos);else if(3===n)t.keys.push(i.readString());else if(4===n){for(var r=null,u=i.readVarint()+i.pos;i.pos<u;)r=1==(n=i.readVarint()>>3)?i.readString():2===n?i.readFloat():3===n?i.readDouble():4===n?i.readVarint64():5===n?i.readVarint():6===n?i.readSVarint():7===n?i.readBoolean():null;t.values.push(r)}}function ihi(n,t,i){var r,u,f;if(1==n)t.id=i.readVarint();else if(2==n)for(r=i.readVarint()+i.pos;i.pos<r;)u=t.layer.keys[i.readVarint()],f=t.layer.values[i.readVarint()],t.properties[u]=f;else 3==n?t.type=i.readVarint():4==n&&(t.geometry=i.pos)}function rhi(n,t,i){n.pos=t.features[i];var u=n.readVarint()+n.pos,r={layer:t,type:0,properties:{}};return n.readFields(ihi,r,u),r}function fyt(n,t){t[t.length-1].tags[n.getAttribute("k")]=n.getAttribute("v")}function oyt(n,t,i,r,u,f){var e,o,s,c,h;for(void 0!==u?(e=u,o=void 0!==f?f:0):(e=[],o=0),s=t;s<i;)for(c=n[s++],e[o++]=n[s++],e[o++]=c,h=2;h<r;++h)e[o++]=n[s++];return e.length=o,e}function syt(n,t,i){for(var h=i||1e5,f=new Array(t),u,o,e,s,r=0;r<t;++r)f[r]=0;for(u=0,o=n.length;u<o;)for(r=0;r<t;++r,++u)e=n[u],s=e-f[r],f[r]=e,n[u]=s;return cyt(n,h)}function hyt(n,t,i){for(var o=i||1e5,e=new Array(t),r=0;r<t;++r)e[r]=0;for(var u=lyt(n,o),f=0,s=u.length;f<s;)for(r=0;r<t;++r,++f)e[r]+=u[f],u[f]=e[r];return u}function cyt(n,t){for(var r=t||1e5,i=0,u=n.length;i<u;++i)n[i]=Math.round(n[i]*r);return function(n){for(var i,t=0,r=n.length;t<r;++t)i=n[t],n[t]=i<0?~(i<<1):i<<1;return function(n){for(var i="",t=0,r=n.length;t<r;++t)i+=hhi(n[t]);return i}(n)}(n)}function lyt(n,t){for(var u=t||1e5,i=function(n){for(var r,t=function(n){for(var u,f=[],t=0,i=0,r=0,e=n.length;r<e;++r)u=n.charCodeAt(r)-63,t|=(31&u)<<i,u<32?(f.push(t),t=0,i=0):i+=5;return f}(n),i=0,u=t.length;i<u;++i)r=t[i],t[i]=1&r?~(r>>1):r>>1;return t}(n),r=0,f=i.length;r<f;++r)i[r]/=u;return i}function hhi(n){for(var t,i="";n>=32;)t=63+(32|31&n),i+=String.fromCharCode(t),n>>=5;return t=n+63,i+String.fromCharCode(t)}function ck(n,t){for(var r,o,u,e,i=[],f=0,s=n.length;f<s;++f)u=n[f],f>0&&i.pop(),e=u>=0?t[u]:t[~u].slice().reverse(),i.push.apply(i,e);for(r=0,o=i.length;r<o;++r)i[r]=i[r].slice();return i}function chi(n,t,i,r,u,f,e){for(var s=n.geometries,h=[],o=0,c=s.length;o<c;++o)h[o]=yyt(s[o],t,i,r,u,f,e);return h}function yyt(n,t,i,r,u,f,e){var c,h=n.type,l=vyt[h],s,o;return c="Point"===h||"MultiPoint"===h?l(n,i,r):l(n,t),s=new fi,s.setGeometry(si(c,!1,e)),void 0!==n.id&&s.setId(n.id),o=n.properties,u&&(o||(o={}),o[u]=f),o&&s.setProperties(o),s}function lhi(n,t,i){for(var r,f=0,e=0,u=0,o=n.length;u<o;++u)r=n[u],f+=r[0],e+=r[1],r[0]=f,r[1]=e,frt(r,t,i)}function frt(n,t,i){n[0]=n[0]*t[0]+i[0];n[1]=n[1]*t[1]+i[1]}function apt(){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(ahi,n))}function vpt(n,t,i){return new byt(n,t,i)}function bpt(n,t){var i=rt(lc,"Filter"),r=rt(lc,"FeatureId");i.appendChild(r);r.setAttribute("fid",t);n.appendChild(i)}function hrt(n,t){var i=(n=n||ypt)+":";return 0===t.indexOf(i)?t:i+t}function kpt(n,t,i){it({node:n},py,gt(t.getTagName()),[t],i)}function dpt(n,t,i){for(var u,e={node:n},f=t.conditions,r=0,o=f.length;r<o;++r)u=f[r],it(e,py,gt(u.getTagName()),[u],i)}function ra(n,t){void 0!==t.matchCase&&n.setAttribute("matchCase",t.matchCase.toString());ks(n,t.propertyName);ak(n,""+t.expression)}function gpt(n,t,i){var r=rt(lc,n);ut(r,i);t.appendChild(r)}function ks(n,t){gpt("PropertyName",n,t)}function ak(n,t){gpt("Literal",n,t)}function nwt(n,t){var r=rt(be,"TimeInstant"),i;n.appendChild(r);i=rt(be,"timePosition");r.appendChild(i);ut(i,t)}function ewt(n){var t=n.getCoordinates();return 0===t.length?"":t.join(" ")}function lrt(n){for(var i=n.getCoordinates(),r=[],t=0,u=i.length;t<u;++t)r.push(i[t].join(" "));return r.join(",")}function owt(n){for(var i=[],r=n.getLinearRings(),t=0,u=r.length;t<u;++t)i.push("("+lrt(r[t])+")");return i.join(",")}function hwt(n){var t=n.getType(),r=swt[t](n),i;return(t=t.toUpperCase(),"function"==typeof n.getFlatCoordinates)&&(i=function(n){var t=n.getLayout(),i="";return t!==v.XYZ&&t!==v.XYZM||(i+=rwt),t!==v.XYM&&t!==v.XYZM||(i+=uwt),i}(n),i.length>0&&(t+=" "+i)),0===r.length?t+" "+iwt:t+"("+r+")"}function fa(n){return n.getAttributeNS(lwt,"href")}function co(n,t){return h({},kci,n,t)}function vrt(n,t){return h({},yci,n,t)}function vwt(n,t){var i=co(n,t),r;if(i)return r=[eo(n.getAttribute("width")),eo(n.getAttribute("height"))],i.size=r,i}function ywt(n,t){return h([],dci,n,t)}function yrt(n){var t=l(n).split(/\s+/),i,r;if(t&&2==t.length&&(i=+t[0],r=+t[1],!isNaN(i)&&!isNaN(r)))return[i,r]}function bwt(){var n=document.body;return!!(n.webkitRequestFullscreen||n.mozRequestFullScreen&&document.mozFullScreenEnabled||n.msRequestFullscreen&&document.msFullscreenEnabled||n.requestFullscreen&&document.fullscreenEnabled)}function prt(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function kwt(n){n.requestFullscreen?n.requestFullscreen():n.msRequestFullscreen?n.msRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullscreen&&n.webkitRequestFullscreen()}function gwt(n){var t=n.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}function tbt(){this.validateExtent_();this.updateBox_()}function ibt(n){var t=n.frameState;this.viewState_=t?t.viewState:null;this.updateElement_()}function ubt(n){if(n.frameState){this.sliderInitialized_||this.initSlider_();var t=n.frameState.viewState.resolution;t!==this.currentResolution_&&(this.currentResolution_=t,this.setThumbPosition_(t))}}var brt,ky,sa,dy,fi,vc,ir,v,f,hut,aa,pc,gf,pr,ar,lp,ed,yp,ce,lh,ei,wa,or,yi,gft,ph,te,rr,iet,wh,eet,oet,set,cet,ew,fg,lw,cg,lg,ag,tv,ge,tn,rs,rn,dot,hn,sr,ev,ov,af,gw,sl,vn,ft,vv,wn,gst,yv,pv,ob,uu,sb,rc,cb,itt,yl,rtt,ny,fc,hs,hr,utt,hct,ri,yb,wl,bl,ls,uy,klt,ys,tf,dl,tk,ps,ws,ct,et,uk,oy,bt,fat,eat,aat,pat,wat,kat,dat,ly,tvt,uvt,evt,ovt,svt,pvt,kvt,dvt,tyt,iyt,rrt,eyt,ayt,vyt,pyt,ert,py,crt,ho,bi,swt,cwt,lwt,wy,pwt,wwt,dwt,yk,nbt,rbt,oa;i.r(t);brt=0;var pk="5.3.0",krt=function(n){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===pk?pk:"v"+pk.split("-")[0])+"/doc/errors/#"+t+" for details.";n.call(this,i);this.code=t;this.name="AssertionError";this.message=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),ki={ADD:"add",REMOVE:"remove"},gs="propertychange",nt="function"==typeof Object.assign?Object.assign:function(n){var f=arguments,t,i;if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(var u=Object(n),r=1,e=arguments.length;r<e;++r)if(t=f[r],void 0!==t&&null!==t)for(i in t)t.hasOwnProperty(i)&&(u[i]=t[i]);return u};ky=function(){this.disposed_=!1};ky.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())};ky.prototype.disposeInternal=function(){};sa=ky;dy=function(n){this.propagationStopped;this.type=n;this.target=null};dy.prototype.preventDefault=function(){this.propagationStopped=!0};dy.prototype.stopPropagation=function(){this.propagationStopped=!0};var fr=dy,th=function(n){function t(){n.call(this);this.pendingRemovals_={};this.dispatching_={};this.listeners_={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(n,t){var i=this.listeners_[n];i||(i=this.listeners_[n]=[]);-1===i.indexOf(t)&&i.push(t)},t.prototype.dispatchEvent=function(n){var i="string"==typeof n?new fr(n):n,t=i.type,f,r,u,e,o;if(i.target=this,r=this.listeners_[t],r){for((t in this.dispatching_)||(this.dispatching_[t]=0,this.pendingRemovals_[t]=0),++this.dispatching_[t],u=0,e=r.length;u<e;++u)if(!1===r[u].call(this,i)||i.propagationStopped){f=!1;break}if(--this.dispatching_[t],0===this.dispatching_[t]){for(o=this.pendingRemovals_[t],delete this.pendingRemovals_[t];o--;)this.removeEventListener(t,wf);delete this.dispatching_[t]}return f}},t.prototype.disposeInternal=function(){nut(this)},t.prototype.getListeners=function(n){return this.listeners_[n]},t.prototype.hasListener=function(n){return n?n in this.listeners_:Object.keys(this.listeners_).length>0},t.prototype.removeEventListener=function(n,t){var i=this.listeners_[n],r;i&&(r=i.indexOf(t),n in this.pendingRemovals_?(i[r]=wf,++this.pendingRemovals_[n]):(i.splice(r,1),0===i.length&&delete this.listeners_[n]))},t}(sa),a={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"},kk=function(n){function t(){n.call(this);this.revision_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_;this.dispatchEvent(a.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(n,t){if(Array.isArray(n)){for(var r=n.length,u=new Array(r),i=0;i<r;++i)u[i]=o(this,n[i],t);return u}return o(this,n,t)},t.prototype.once=function(n,t){if(Array.isArray(n)){for(var r=n.length,u=new Array(r),i=0;i<r;++i)u[i]=ee(this,n[i],t);return u}return ee(this,n,t)},t.prototype.un=function(n,t){if(Array.isArray(n))for(var i=0,r=n.length;i<r;++i)ou(this,n[i],t);else ou(this,n,t)},t}(th),iut=function(n){function t(t,i,r){n.call(this,t);this.key=i;this.oldValue=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),dk={};var rf=function(n){function t(t){n.call(this);y(this);this.values_={};void 0!==t&&this.setProperties(t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(n){var t;return this.values_.hasOwnProperty(n)&&(t=this.values_[n]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return nt({},this.values_)},t.prototype.notify=function(n,t){var i;i=ni(n);this.dispatchEvent(new iut(i,n,t));i=gs;this.dispatchEvent(new iut(i,n,t))},t.prototype.set=function(n,t,i){if(i)this.values_[n]=t;else{var r=this.values_[n];this.values_[n]=t;r!==t&&this.notify(n,r)}},t.prototype.setProperties=function(n,t){for(var i in n)this.set(i,n[i],t)},t.prototype.unset=function(n,t){if(n in this.values_){var i=this.values_[n];delete this.values_[n];t||this.notify(n,i)}},t}(kk),rut="length",gy=function(n){function t(t,i){n.call(this,t);this.element=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),er=function(n){function t(t,i){var u,r,f;if(n.call(this),u=i||{},this.unique_=!!u.unique,this.array_=t||[],this.unique_)for(r=0,f=this.array_.length;r<f;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},t.prototype.extend=function(n){for(var t=0,i=n.length;t<i;++t)this.push(n[t]);return this},t.prototype.forEach=function(n){for(var i=this.array_,t=0,r=i.length;t<r;++t)n(i[t],t,i)},t.prototype.getArray=function(){return this.array_},t.prototype.item=function(n){return this.array_[n]},t.prototype.getLength=function(){return this.get(rut)},t.prototype.insertAt=function(n,t){this.unique_&&this.assertUnique_(t);this.array_.splice(n,0,t);this.updateLength_();this.dispatchEvent(new gy(ki.ADD,t))},t.prototype.pop=function(){return this.removeAt(this.getLength()-1)},t.prototype.push=function(n){this.unique_&&this.assertUnique_(n);var t=this.getLength();return this.insertAt(t,n),this.getLength()},t.prototype.remove=function(n){for(var i=this.array_,t=0,r=i.length;t<r;++t)if(i[t]===n)return this.removeAt(t)},t.prototype.removeAt=function(n){var t=this.array_[n];return this.array_.splice(n,1),this.updateLength_(),this.dispatchEvent(new gy(ki.REMOVE,t)),t},t.prototype.setAt=function(n,t){var r=this.getLength(),u,i;if(n<r)this.unique_&&this.assertUnique_(t,n),u=this.array_[n],this.array_[n]=t,this.dispatchEvent(new gy(ki.REMOVE,u)),this.dispatchEvent(new gy(ki.ADD,t));else{for(i=r;i<n;++i)this.insertAt(i,void 0);this.insertAt(n,t)}},t.prototype.updateLength_=function(){this.set(rut,this.array_.length)},t.prototype.assertUnique_=function(n,t){for(var i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===n&&i!==t)throw new krt(58);},t}(rf);fi=function(n){function t(t){var i,r;(n.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,o(this,ni(this.geometryName_),this.handleGeometryChanged_,this),t)&&("function"==typeof t.getSimplifiedGeometry?(i=t,this.setGeometry(i)):(r=t,this.setProperties(r)))}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var n=new t(this.getProperties()),i,r;return n.setGeometryName(this.getGeometryName()),i=this.getGeometry(),i&&n.setGeometry(i.clone()),r=this.getStyle(),r&&n.setStyle(r),n},t.prototype.getGeometry=function(){return this.get(this.geometryName_)},t.prototype.getId=function(){return this.id_},t.prototype.getGeometryName=function(){return this.geometryName_},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.handleGeometryChange_=function(){this.changed()},t.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(lt(this.geometryChangeKey_),this.geometryChangeKey_=null);var n=this.getGeometry();n&&(this.geometryChangeKey_=o(n,a.CHANGE,this.handleGeometryChange_,this));this.changed()},t.prototype.setGeometry=function(n){this.set(this.geometryName_,n)},t.prototype.setStyle=function(n){this.style_=n;this.styleFunction_=n?function(n){var t,i;return"function"==typeof n?n:(Array.isArray(n)?t=n:(g("function"==typeof n.getZIndex,41),i=n,t=[i]),function(){return t})}(n):void 0;this.changed()},t.prototype.setId=function(n){this.id_=n;this.changed()},t.prototype.setGeometryName=function(n){ou(this,ni(this.geometryName_),this.handleGeometryChanged_,this);this.geometryName_=n;o(this,ni(this.geometryName_),this.handleGeometryChanged_,this);this.handleGeometryChanged_()},t}(rf);vc={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};ir={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};v={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};f={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"};hut="cosh"in Math?Math.cosh:function(n){var t=Math.exp(n);return(t+1/t)/2};aa=6371008.8;pc={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};gf={};gf[pc.DEGREES]=12741994*Math.PI/360;gf[pc.FEET]=.3048;gf[pc.METERS]=1;gf[pc.USFEET]=1200/3937;pr=pc;ar=function(n){this.code_=n.code;this.units_=n.units;this.extent_=void 0!==n.extent?n.extent:null;this.worldExtent_=void 0!==n.worldExtent?n.worldExtent:null;this.axisOrientation_=void 0!==n.axisOrientation?n.axisOrientation:"enu";this.global_=void 0!==n.global&&n.global;this.canWrapX_=!(!this.global_||!this.extent_);this.getPointResolutionFunc_=n.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=n.metersPerUnit};ar.prototype.canWrapX=function(){return this.canWrapX_};ar.prototype.getCode=function(){return this.code_};ar.prototype.getExtent=function(){return this.extent_};ar.prototype.getUnits=function(){return this.units_};ar.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||gf[this.units_]};ar.prototype.getWorldExtent=function(){return this.worldExtent_};ar.prototype.getAxisOrientation=function(){return this.axisOrientation_};ar.prototype.isGlobal=function(){return this.global_};ar.prototype.setGlobal=function(n){this.global_=n;this.canWrapX_=!(!n||!this.extent_)};ar.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};ar.prototype.setDefaultTileGrid=function(n){this.defaultTileGrid_=n};ar.prototype.setExtent=function(n){this.extent_=n;this.canWrapX_=!(!this.global_||!n)};ar.prototype.setWorldExtent=function(n){this.worldExtent_=n};ar.prototype.setGetPointResolution=function(n){this.getPointResolutionFunc_=n};ar.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var va=ar,sp=6378137,wc=Math.PI*sp,hbt=[-wc,-wc,wc,wc],cbt=[-180,-85,180,85],sh=function(n){function t(t){n.call(this,{code:t,units:pr.METERS,extent:hbt,global:!0,worldExtent:cbt,getPointResolution:function(n,t){return n/hut(t[1]/sp)}})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(va),aut=[new sh("EPSG:3857"),new sh("EPSG:102100"),new sh("EPSG:102113"),new sh("EPSG:900913"),new sh("urn:ogc:def:crs:EPSG:6.18:3:3857"),new sh("urn:ogc:def:crs:EPSG::3857"),new sh("http://www.opengis.net/gml/srs/epsg.xml#3857")];var vut=[-180,-90,180,90],vbt=6378137*Math.PI/180,po=function(n){function t(t,i){n.call(this,{code:t,units:pr.DEGREES,extent:vut,axisOrientation:i,global:!0,metersPerUnit:vbt,worldExtent:vut})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(va),yut=[new po("CRS:84"),new po("EPSG:4326","neu"),new po("urn:ogc:def:crs:EPSG::4326","neu"),new po("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new po("urn:ogc:def:crs:OGC:1.3:CRS84"),new po("urn:ogc:def:crs:OGC:2:84"),new po("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new po("urn:x-ogc:def:crs:EPSG:4326","neu")],put={},bc={};cp(aut);cp(yut),function(n,t,i,r){n.forEach(function(n){t.forEach(function(t){kc(n,t,i);kc(t,n,r)})})}(yut,aut,lbt,abt);lp=new Array(6);ed=[1,0,0,1,0,0];yp=function(n){function t(){n.call(this);this.extent_=[1/0,1/0,-1/0,-1/0];this.extentRevision_=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return p()},t.prototype.closestPointXY=function(){return p()},t.prototype.containsXY=function(){return!1},t.prototype.getClosestPoint=function(n,t){var i=t||[NaN,NaN];return this.closestPointXY(n[0],n[1],i,1/0),i},t.prototype.intersectsCoordinate=function(n){return this.containsXY(n[0],n[1])},t.prototype.computeExtent=function(){return p()},t.prototype.getExtent=function(n){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n}(this.extent_,n)},t.prototype.rotate=function(){p()},t.prototype.scale=function(){p()},t.prototype.simplify=function(n){return this.getSimplifiedGeometry(n*n)},t.prototype.getSimplifiedGeometry=function(){return p()},t.prototype.getType=function(){return p()},t.prototype.applyTransform=function(){p()},t.prototype.intersectsExtent=function(){return p()},t.prototype.translate=function(){p()},t.prototype.transform=function(n,t){var i=w(n),r=i.getUnits()==pr.TILE_PIXELS?function(n,r,u){var o=i.getExtent(),f=i.getWorldExtent(),e=ti(f)/ti(o);return cu(ed,f[0],f[3],e,-e,0,0,0),vo(n,0,n.length,u,ed,r),he(i,t)(n,r,u)}:he(i,t);return this.applyTransform(r),this},t}(rf);ce=function(n){function t(){n.call(this);this.layout=v.XY;this.stride=2;this.flatCoordinates=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(n){return td(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n)},t.prototype.getCoordinates=function(){return p()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(n){var t,i;return(this.simplifiedGeometryRevision!=this.getRevision()&&(pf(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),n<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&n<=this.simplifiedGeometryMaxMinSquaredTolerance)?this:(t=n.toString(),this.simplifiedGeometryCache.hasOwnProperty(t))?this.simplifiedGeometryCache[t]:(i=this.getSimplifiedGeometryInternal(n),i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=n,this))},t.prototype.getSimplifiedGeometryInternal=function(){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(n,t){this.stride=od(n);this.layout=n;this.flatCoordinates=t},t.prototype.setCoordinates=function(){p()},t.prototype.setLayout=function(n,t,i){var r,u;if(n)r=od(n);else{for(u=0;u<i;++u){if(0===t.length)return this.layout=v.XY,void(this.stride=2);t=t[0]}n=function(n){var t;return 2==n?t=v.XY:3==n?t=v.XYZ:4==n&&(t=v.XYZM),t}(r=t.length)}this.layout=n;this.stride=r},t.prototype.applyTransform=function(n){this.flatCoordinates&&(n(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(n,t){var i=this.getFlatCoordinates(),r;i&&(r=this.getStride(),!function(n,t,i,r,u,f,e){for(var l,a,c,s=e||[],v=Math.cos(u),y=Math.sin(u),p=f[0],w=f[1],h=0,o=t;o<i;o+=r)for(l=n[o]-p,a=n[o+1]-w,s[h++]=p+l*v-a*y,s[h++]=w+l*y+a*v,c=o+2;c<o+r;++c)s[h++]=n[c];e&&s.length!=h&&(s.length=h)}(i,0,i.length,r,n,t,i),this.changed())},t.prototype.scale=function(n,t,i){var f=t,u,r,e;void 0===f&&(f=n);u=i;u||(u=su(this.getExtent()));r=this.getFlatCoordinates();r&&(e=this.getStride(),!function(n,t,i,r,u,f,e,o){for(var y,p,l,h=o||[],a=e[0],v=e[1],c=0,s=t;s<i;s+=r)for(y=n[s]-a,p=n[s+1]-v,h[c++]=a+u*y,h[c++]=v+f*p,l=s+2;l<s+r;++l)h[c++]=n[l];o&&h.length!=c&&(h.length=c)}(r,0,r.length,e,n,f,u,r),this.changed())},t.prototype.translate=function(n,t){var i=this.getFlatCoordinates(),r;i&&(r=this.getStride(),yo(i,0,i.length,r,n,t,i),this.changed())},t}(yp);lh=function(n){function t(t,i){n.call(this);this.maxDelta_=-1;this.maxDeltaRevision_=-1;void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(n,t,i,r){return r<ih(this.getExtent(),n,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(hd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ld(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,n,t,i,r))},t.prototype.getArea=function(){return sd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return gc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(n){var i=[];return i.length=yd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,i,0),new t(i,v.XY)},t.prototype.getType=function(){return f.LINEAR_RING},t.prototype.intersectsExtent=function(){return!1},t.prototype.setCoordinates=function(n,t){this.setLayout(t,n,1);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=pa(this.flatCoordinates,0,n,this.stride);this.changed()},t}(ce);ei=function(n){function t(t,i){n.call(this);this.setCoordinates(t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(n,t,i,r){var f=this.flatCoordinates,o=oh(n,t,f[0],f[1]),e,u;if(o<r){for(e=this.stride,u=0;u<e;++u)i[u]=f[u];return i.length=e,o}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(n){return uh(this.flatCoordinates,n)},t.prototype.getType=function(){return f.POINT},t.prototype.intersectsExtent=function(n){return ip(n,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(n,t){this.setLayout(t,n,0);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=rft(this.flatCoordinates,0,n,this.stride);this.changed()},t}(ce);wa=function(n){function t(t,i,r){n.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,t),this.ends_=r):this.setCoordinates(t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.appendLinearRing=function(n){this.flatCoordinates?pt(this.flatCoordinates,n.getFlatCoordinates()):this.flatCoordinates=n.getFlatCoordinates().slice();this.ends_.push(this.flatCoordinates.length);this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(n,t,i,r){return r<ih(this.getExtent(),n,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(cd(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ad(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,n,t,i,r))},t.prototype.containsXY=function(n,t){return pd(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,n,t)},t.prototype.getArea=function(){return tft(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(n){var t;return void 0!==n?bd(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,n):t=this.flatCoordinates,pp(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var n=su(this.getExtent());this.flatInteriorPoint_=wd(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,n,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new ei(this.getFlatInteriorPoint(),v.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(n){return n<0||this.ends_.length<=n?null:new lh(this.flatCoordinates.slice(0===n?0:this.ends_[n-1],this.ends_[n]),this.layout)},t.prototype.getLinearRings=function(){for(var t,f,e=this.layout,o=this.flatCoordinates,i=this.ends_,r=[],u=0,n=0,s=i.length;n<s;++n)t=i[n],f=new lh(o.slice(u,t),e),r.push(f),u=t;return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var n=this.flatCoordinates;hft(n,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=n:(this.orientedFlatCoordinates_=n.slice(),this.orientedFlatCoordinates_.length=bd(this.orientedFlatCoordinates_,0,this.ends_,this.stride));this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(n){var i=[],r=[];return i.length=fft(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(n),i,0,r),new t(i,v.XY,r)},t.prototype.getType=function(){return f.POLYGON},t.prototype.intersectsExtent=function(n){return sft(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,n)},t.prototype.setCoordinates=function(n,t){this.setLayout(t,n,2);this.flatCoordinates||(this.flatCoordinates=[]);var i=vd(this.flatCoordinates,0,n,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1];this.changed()},t}(ce);or=wa;var nl="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",kbt=-1!==nl.indexOf("firefox"),dbt=-1!==nl.indexOf("safari")&&-1==nl.indexOf("chrom"),gbt=-1!==nl.indexOf("webkit")&&-1==nl.indexOf("edge"),vft=-1!==nl.indexOf("macintosh"),tl=window.devicePixelRatio||1,il=function(){var n=!1;try{n=!!document.createElement("canvas").getContext("2d").setLineDash}catch(n){}return n}(),yft="geolocation"in navigator,dd="ontouchstart"in window,nkt="PointerEvent"in window,tkt=!!navigator.msPointerEnabled,ci={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},ikt=function(n){function t(t){n.call(this,a.ERROR);this.code=t.code;this.message=t.message}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),rkt=function(n){function t(t){n.call(this);var i=t||{};this.position_=null;this.transform_=ud;this.watchId_=void 0;o(this,ni(ci.PROJECTION),this.handleProjectionChanged_,this);o(this,ni(ci.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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.setTracking(!1);n.prototype.disposeInternal.call(this)},t.prototype.handleProjectionChanged_=function(){var n=this.getProjection();n&&(this.transform_=wo(w("EPSG:4326"),n),this.position_&&this.set(ci.POSITION,this.transform_(this.position_)))},t.prototype.handleTrackingChanged_=function(){if(yft){var n=this.getTracking();n&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):n||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},t.prototype.positionChange_=function(n){var t=n.coords,r,i;this.set(ci.ACCURACY,t.accuracy);this.set(ci.ALTITUDE,null===t.altitude?void 0:t.altitude);this.set(ci.ALTITUDE_ACCURACY,null===t.altitudeAccuracy?void 0:t.altitudeAccuracy);this.set(ci.HEADING,null===t.heading?void 0:kf(t.heading));this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];r=this.transform_(this.position_);this.set(ci.POSITION,r);this.set(ci.SPEED,null===t.speed?void 0:t.speed);i=lft(this.position_,t.accuracy);i.applyTransform(this.transform_);this.set(ci.ACCURACY_GEOMETRY,i);this.changed()},t.prototype.positionError_=function(n){this.setTracking(!1);this.dispatchEvent(new ikt(n))},t.prototype.getAccuracy=function(){return this.get(ci.ACCURACY)},t.prototype.getAccuracyGeometry=function(){return this.get(ci.ACCURACY_GEOMETRY)||null},t.prototype.getAltitude=function(){return this.get(ci.ALTITUDE)},t.prototype.getAltitudeAccuracy=function(){return this.get(ci.ALTITUDE_ACCURACY)},t.prototype.getHeading=function(){return this.get(ci.HEADING)},t.prototype.getPosition=function(){return this.get(ci.POSITION)},t.prototype.getProjection=function(){return this.get(ci.PROJECTION)},t.prototype.getSpeed=function(){return this.get(ci.SPEED)},t.prototype.getTracking=function(){return this.get(ci.TRACKING)},t.prototype.getTrackingOptions=function(){return this.get(ci.TRACKING_OPTIONS)},t.prototype.setProjection=function(n){this.set(ci.PROJECTION,w(n))},t.prototype.setTracking=function(n){this.set(ci.TRACKING,n)},t.prototype.setTrackingOptions=function(n){this.set(ci.TRACKING_OPTIONS,n)},t}(rf);yi=function(n){function t(t,i){n.call(this);this.flatMidpoint_=null;this.flatMidpointRevision_=-1;this.maxDelta_=-1;this.maxDeltaRevision_=-1;void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.appendCoordinate=function(n){this.flatCoordinates?pt(this.flatCoordinates,n):this.flatCoordinates=n.slice();this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(n,t,i,r){return r<ih(this.getExtent(),n,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(hd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ld(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,n,t,i,r))},t.prototype.forEachSegment=function(n){return oft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n)},t.prototype.getCoordinateAtM=function(n,t){if(this.layout!=v.XYM&&this.layout!=v.XYZM)return null;var i=void 0!==t&&t;return ng(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,i)},t.prototype.getCoordinates=function(){return gc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(n,t){return gp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,t)},t.prototype.getLength=function(){return kft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},t.prototype.getSimplifiedGeometryInternal=function(n){var i=[];return i.length=yd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,i,0),new t(i,v.XY)},t.prototype.getType=function(){return f.LINE_STRING},t.prototype.intersectsExtent=function(n){return wp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n)},t.prototype.setCoordinates=function(n,t){this.setLayout(t,n,1);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=pa(this.flatCoordinates,0,n,this.stride);this.changed()},t}(ce);var gr={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render",RENDERCOMPLETE:"rendercomplete"},ukt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,fkt=/^([a-z]*)$/i;gft=function(){var n={},t=0;return function(i){var r,u,f;if(n.hasOwnProperty(i))r=n[i];else{if(t>=1024){u=0;for(f in n)0==(3&u++)&&(delete n[f],--t)}r=function(n){var i,r,u,f,e,t,o,s;return fkt.exec(n)&&(n=function(n){var t=document.createElement("div"),i;return(t.style.color=n,""!==t.style.color)?(document.body.appendChild(t),i=getComputedStyle(t).color,document.body.removeChild(t),i):""}(n)),ukt.exec(n)?(o=n.length-1,t=o<=4?1:2,s=4===o||8===o,i=parseInt(n.substr(1+0*t,t),16),r=parseInt(n.substr(1+1*t,t),16),u=parseInt(n.substr(1+2*t,t),16),f=s?parseInt(n.substr(1+3*t,t),16):255,1==t&&(i=(i<<4)+i,r=(r<<4)+r,u=(u<<4)+u,s&&(f=(f<<4)+f)),e=[i,r,u,f/255]):0==n.indexOf("rgba(")?net(e=n.slice(5,-1).split(",").map(Number)):0==n.indexOf("rgb(")?((e=n.slice(4,-1).split(",").map(Number)).push(1),net(e)):g(!1,14),e}(i);n[i]=r;++t}return r}}();ph=function(n){var t=n||{};this.color_=void 0!==t.color?t.color:null;this.checksum_=void 0};ph.prototype.clone=function(){var n=this.getColor();return new ph({color:Array.isArray(n)?n.slice():n||void 0})};ph.prototype.getColor=function(){return this.color_};ph.prototype.setColor=function(n){this.color_=n;this.checksum_=void 0};ph.prototype.getChecksum=function(){if(void 0===this.checksum_){var n=this.color_;this.checksum_=n?Array.isArray(n)||"string"==typeof n?"f"+vh(n):y(this.color_):"f-"}return this.checksum_};te=ph;rr=function(n){var t=n||{};this.color_=void 0!==t.color?t.color:null;this.lineCap_=t.lineCap;this.lineDash_=void 0!==t.lineDash?t.lineDash:null;this.lineDashOffset_=t.lineDashOffset;this.lineJoin_=t.lineJoin;this.miterLimit_=t.miterLimit;this.width_=t.width;this.checksum_=void 0};rr.prototype.clone=function(){var n=this.getColor();return new rr({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()})};rr.prototype.getColor=function(){return this.color_};rr.prototype.getLineCap=function(){return this.lineCap_};rr.prototype.getLineDash=function(){return this.lineDash_};rr.prototype.getLineDashOffset=function(){return this.lineDashOffset_};rr.prototype.getLineJoin=function(){return this.lineJoin_};rr.prototype.getMiterLimit=function(){return this.miterLimit_};rr.prototype.getWidth=function(){return this.width_};rr.prototype.setColor=function(n){this.color_=n;this.checksum_=void 0};rr.prototype.setLineCap=function(n){this.lineCap_=n;this.checksum_=void 0};rr.prototype.setLineDash=function(n){this.lineDash_=n;this.checksum_=void 0};rr.prototype.setLineDashOffset=function(n){this.lineDashOffset_=n;this.checksum_=void 0};rr.prototype.setLineJoin=function(n){this.lineJoin_=n;this.checksum_=void 0};rr.prototype.setMiterLimit=function(n){this.miterLimit_=n;this.checksum_=void 0};rr.prototype.setWidth=function(n){this.width_=n;this.checksum_=void 0};rr.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.checksum_+=this.color_?"string"==typeof this.color_?this.color_:y(this.color_):"-",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 hf=rr,ekt="point",okt="line",at=function(n){var t=n||{};this.font_=t.font;this.rotation_=t.rotation;this.rotateWithView_=t.rotateWithView;this.scale_=t.scale;this.text_=t.text;this.textAlign_=t.textAlign;this.textBaseline_=t.textBaseline;this.fill_=void 0!==t.fill?t.fill:new te({color:"#333"});this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4;this.placement_=void 0!==t.placement?t.placement:ekt;this.overflow_=!!t.overflow;this.stroke_=void 0!==t.stroke?t.stroke:null;this.offsetX_=void 0!==t.offsetX?t.offsetX:0;this.offsetY_=void 0!==t.offsetY?t.offsetY:0;this.backgroundFill_=t.backgroundFill?t.backgroundFill:null;this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null;this.padding_=void 0===t.padding?null:t.padding};at.prototype.clone=function(){return new at({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})};at.prototype.getOverflow=function(){return this.overflow_};at.prototype.getFont=function(){return this.font_};at.prototype.getMaxAngle=function(){return this.maxAngle_};at.prototype.getPlacement=function(){return this.placement_};at.prototype.getOffsetX=function(){return this.offsetX_};at.prototype.getOffsetY=function(){return this.offsetY_};at.prototype.getFill=function(){return this.fill_};at.prototype.getRotateWithView=function(){return this.rotateWithView_};at.prototype.getRotation=function(){return this.rotation_};at.prototype.getScale=function(){return this.scale_};at.prototype.getStroke=function(){return this.stroke_};at.prototype.getText=function(){return this.text_};at.prototype.getTextAlign=function(){return this.textAlign_};at.prototype.getTextBaseline=function(){return this.textBaseline_};at.prototype.getBackgroundFill=function(){return this.backgroundFill_};at.prototype.getBackgroundStroke=function(){return this.backgroundStroke_};at.prototype.getPadding=function(){return this.padding_};at.prototype.setOverflow=function(n){this.overflow_=n};at.prototype.setFont=function(n){this.font_=n};at.prototype.setMaxAngle=function(n){this.maxAngle_=n};at.prototype.setOffsetX=function(n){this.offsetX_=n};at.prototype.setOffsetY=function(n){this.offsetY_=n};at.prototype.setPlacement=function(n){this.placement_=n};at.prototype.setFill=function(n){this.fill_=n};at.prototype.setRotation=function(n){this.rotation_=n};at.prototype.setScale=function(n){this.scale_=n};at.prototype.setStroke=function(n){this.stroke_=n};at.prototype.setText=function(n){this.text_=n};at.prototype.setTextAlign=function(n){this.textAlign_=n};at.prototype.setTextBaseline=function(n){this.textBaseline_=n};at.prototype.setBackgroundFill=function(n){this.backgroundFill_=n};at.prototype.setBackgroundStroke=function(n){this.backgroundStroke_=n};at.prototype.setPadding=function(n){this.padding_=n};var nv=at,skt=new hf({color:"rgba(0,0,0,0.2)"}),hkt=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],nu=function(n){var t=n||{};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!==t.targetSize?t.targetSize:100;this.maxLines_=void 0!==t.maxLines?t.maxLines:100;this.meridians_=[];this.parallels_=[];this.strokeStyle_=void 0!==t.strokeStyle?t.strokeStyle:skt;this.fromLonLatTransform_=void 0;this.toLonLatTransform_=void 0;this.projectionCenterLonLat_=null;this.meridiansLabels_=null;this.parallelsLabels_=null;1==t.showLabels&&(this.lonLabelFormatter_=void 0==t.lonLabelFormatter?kp.bind(this,"EW"):t.lonLabelFormatter,this.latLabelFormatter_=void 0==t.latLabelFormatter?kp.bind(this,"NS"):t.latLabelFormatter,this.lonLabelPosition_=void 0==t.lonLabelPosition?0:t.lonLabelPosition,this.latLabelPosition_=void 0==t.latLabelPosition?1:t.latLabelPosition,this.lonLabelStyle_=void 0!==t.lonLabelStyle?t.lonLabelStyle:new nv({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new te({color:"rgba(0,0,0,1)"}),stroke:new hf({color:"rgba(255,255,255,1)",width:3})}),this.latLabelStyle_=void 0!==t.latLabelStyle?t.latLabelStyle:new nv({font:"12px Calibri,sans-serif",textAlign:"end",fill:new te({color:"rgba(0,0,0,1)"}),stroke:new hf({color:"rgba(255,255,255,1)",width:3})}),this.meridiansLabels_=[],this.parallelsLabels_=[]);this.intervals_=void 0!==t.intervals?t.intervals:hkt;this.setMap(void 0!==t.map?t.map:null)};nu.prototype.addMeridian_=function(n,t,i,r,u,f){var e=this.getMeridian_(n,t,i,r,f),o;return dt(e.getExtent(),u)&&(this.meridiansLabels_&&(o=this.getMeridianPoint_(e,u,f),this.meridiansLabels_[f]={geom:o,text:this.lonLabelFormatter_(n)}),this.meridians_[f++]=e),f};nu.prototype.getMeridianPoint_=function(n,t,i){var u,r=n.getFlatCoordinates(),e=Math.max(t[1],r[1]),o=Math.min(t[3],r[r.length-1]),s=vi(t[1]+Math.abs(t[1]-t[3])*this.lonLabelPosition_,e,o),f=[r[0],s];return i in this.meridiansLabels_?(u=this.meridiansLabels_[i].geom).setCoordinates(f):u=new ei(f),u};nu.prototype.addParallel_=function(n,t,i,r,u,f){var e=this.getParallel_(n,t,i,r,f),o;return dt(e.getExtent(),u)&&(this.parallelsLabels_&&(o=this.getParallelPoint_(e,u,f),this.parallelsLabels_[f]={geom:o,text:this.latLabelFormatter_(n)}),this.parallels_[f++]=e),f};nu.prototype.getParallelPoint_=function(n,t,i){var u,r=n.getFlatCoordinates(),e=Math.max(t[0],r[0]),o=Math.min(t[2],r[r.length-2]),f=[vi(t[0]+Math.abs(t[0]-t[2])*this.latLabelPosition_,e,o),r[1]];return i in this.parallelsLabels_?(u=this.parallelsLabels_[i].geom).setCoordinates(f):u=new ei(f),u};nu.prototype.createGraticule_=function(n,t,i,r){var o=this.getInterval_(i);if(-1==o)return this.meridians_.length=this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var s,u,f,e,b=this.toLonLatTransform_(t),l=b[0],a=b[1],c=this.maxLines_,h=[Math.max(n[0],this.minLonP_),Math.max(n[1],this.minLatP_),Math.min(n[2],this.maxLonP_),Math.min(n[3],this.maxLatP_)],v=(h=bo(h,this.projection_,"EPSG:4326"))[3],y=h[2],p=h[1],w=h[0];for(e=vi(l=Math.floor(l/o)*o,this.minLon_,this.maxLon_),u=this.addMeridian_(e,p,v,r,n,0),s=0;e!=this.minLon_&&s++<c;)e=Math.max(e-o,this.minLon_),u=this.addMeridian_(e,p,v,r,n,u);for(e=vi(l,this.minLon_,this.maxLon_),s=0;e!=this.maxLon_&&s++<c;)e=Math.min(e+o,this.maxLon_),u=this.addMeridian_(e,p,v,r,n,u);for(this.meridians_.length=u,this.meridiansLabels_&&(this.meridiansLabels_.length=u),f=vi(a=Math.floor(a/o)*o,this.minLat_,this.maxLat_),u=this.addParallel_(f,w,y,r,n,0),s=0;f!=this.minLat_&&s++<c;)f=Math.max(f-o,this.minLat_),u=this.addParallel_(f,w,y,r,n,u);for(f=vi(a,this.minLat_,this.maxLat_),s=0;f!=this.maxLat_&&s++<c;)f=Math.min(f+o,this.maxLat_),u=this.addParallel_(f,w,y,r,n,u);this.parallels_.length=u;this.parallelsLabels_&&(this.parallelsLabels_.length=u)};nu.prototype.getInterval_=function(n){for(var r,f=this.projectionCenterLonLat_[0],e=this.projectionCenterLonLat_[1],o=-1,s=Math.pow(this.targetSize_*n,2),t=[],i=[],u=0,h=this.intervals_.length;u<h;++u){if(r=this.intervals_[u]/2,t[0]=f-r,t[1]=e-r,i[0]=f+r,i[1]=e+r,this.fromLonLatTransform_(t,t),this.fromLonLatTransform_(i,i),Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2)<=s)break;o=this.intervals_[u]}return o};nu.prototype.getMap=function(){return this.map_};nu.prototype.getMeridian_=function(n,t,i,r,u){var e=function(n,t,i,r,u){return dft(function(r){return[n,t+(i-t)*r]},he(w("EPSG:4326"),r),u)}(n,t,i,this.projection_,r),f=this.meridians_[u];return f?(f.setFlatCoordinates(v.XY,e),f.changed()):f=this.meridians_[u]=new yi(e,v.XY),f};nu.prototype.getMeridians=function(){return this.meridians_};nu.prototype.getParallel_=function(n,t,i,r,u){var e=function(n,t,i,r,u){return dft(function(r){return[t+(i-t)*r,n]},he(w("EPSG:4326"),r),u)}(n,t,i,this.projection_,r),f=this.parallels_[u];return f?(f.setFlatCoordinates(v.XY,e),f.changed()):f=new yi(e,v.XY),f};nu.prototype.getParallels=function(){return this.parallels_};nu.prototype.handlePostCompose_=function(n){var t,i,f,u,r=n.vectorContext,e=n.frameState,l=e.extent,o=e.viewState,a=o.center,h=o.projection,s=o.resolution,c=e.pixelRatio,v=s*s/(4*c*c);for((!this.projection_||!hu(this.projection_,h))&&this.updateProjectionInfo_(h),this.createGraticule_(l,a,s,v),r.setFillStrokeStyle(null,this.strokeStyle_),t=0,i=this.meridians_.length;t<i;++t)f=this.meridians_[t],r.drawGeometry(f);for(t=0,i=this.parallels_.length;t<i;++t)f=this.parallels_[t],r.drawGeometry(f);if(this.meridiansLabels_)for(t=0,i=this.meridiansLabels_.length;t<i;++t)u=this.meridiansLabels_[t],this.lonLabelStyle_.setText(u.text),r.setTextStyle(this.lonLabelStyle_),r.drawGeometry(u.geom);if(this.parallelsLabels_)for(t=0,i=this.parallelsLabels_.length;t<i;++t)u=this.parallelsLabels_[t],this.latLabelStyle_.setText(u.text),r.setTextStyle(this.latLabelStyle_),r.drawGeometry(u.geom)};nu.prototype.updateProjectionInfo_=function(n){var r=w("EPSG:4326"),t=n.getWorldExtent(),i=bo(t,r,n);this.maxLat_=t[3];this.maxLon_=t[2];this.minLat_=t[1];this.minLon_=t[0];this.maxLatP_=i[3];this.maxLonP_=i[2];this.minLatP_=i[1];this.minLonP_=i[0];this.fromLonLatTransform_=he(r,n);this.toLonLatTransform_=he(n,r);this.projectionCenterLonLat_=this.toLonLatTransform_(su(n.getExtent()));this.projection_=n};nu.prototype.setMap=function(n){this.map_&&(lt(this.postcomposeListenerKey_),this.postcomposeListenerKey_=null,this.map_.render());n&&(this.postcomposeListenerKey_=o(n,gr.POSTCOMPOSE,this.handlePostCompose_,this),n.render());this.map_=n};iet=nu;wh=function(n,t,i){this.decay_=n;this.minVelocity_=t;this.delay_=i;this.points_=[];this.angle_=0;this.initialVelocity_=0};wh.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0};wh.prototype.update=function(n,t){this.points_.push(n,t,Date.now())};wh.prototype.end=function(){var u,t,n,f,i,r;if(this.points_.length<6||(u=Date.now()-this.delay_,t=this.points_.length-3,this.points_[t+2]<u))return!1;for(n=t-3;n>0&&this.points_[n+2]>u;)n-=3;return(f=this.points_[t+2]-this.points_[n+2],f<1e3/60)?!1:(i=this.points_[t]-this.points_[n],r=this.points_[t+1]-this.points_[n+1],this.angle_=Math.atan2(r,i),this.initialVelocity_=Math.sqrt(i*i+r*r)/f,this.initialVelocity_>this.minVelocity_)};wh.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};wh.prototype.getAngle=function(){return this.angle_};var ret=wh,nw=function(n){function t(t,i,r){n.call(this,t);this.map=i;this.frameState=void 0!==r?r:null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),uet=function(n){function t(t,i,r,u,f){n.call(this,t,i,f);this.originalEvent=r;this.pixel=i.getEventPixel(r);this.coordinate=i.getCoordinateFromPixel(this.pixel);this.dragging=void 0!==u&&u}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.preventDefault=function(){n.prototype.preventDefault.call(this);this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){n.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()},t}(nw),ht={SINGLECLICK:"singleclick",CLICK:a.CLICK,DBLCLICK:a.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ts=function(n){function t(t,i,r,u,f){n.call(this,t,i,r.originalEvent,u,f);this.pointerEvent=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(uet),tu={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},tg=function(n,t){this.dispatcher=n;this.mapping_=t};tg.prototype.getEvents=function(){return Object.keys(this.mapping_)};tg.prototype.getHandlerForEvent=function(n){return this.mapping_[n]};var tw=tg,bh=1,fet="mouse";eet=function(n){function t(t){var i={mousedown:ckt,mousemove:lkt,mouseup:akt,mouseover:vkt,mouseout:ykt};n.call(this,t,i);this.pointerMap=t.pointerMap;this.lastTouches=[]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isEventSimulatedFromTouch_=function(n){for(var u,f,r=this.lastTouches,e=n.clientX,o=n.clientY,t=0,s=r.length,i=void 0;t<s&&(i=r[t]);t++)if(u=Math.abs(e-i[0]),f=Math.abs(o-i[1]),u<=25&&f<=25)return!0;return!1},t.prototype.cancel=function(n){var t=kh(n,this.dispatcher);this.dispatcher.cancel(t,n);this.cleanupMouse()},t.prototype.cleanupMouse=function(){delete this.pointerMap[bh.toString()]},t}(tw);oet=["","unavailable","touch","pen","mouse"];set=function(n){function t(t){var i={MSPointerDown:pkt,MSPointerMove:wkt,MSPointerUp:bkt,MSPointerOut:kkt,MSPointerOver:dkt,MSPointerCancel:gkt,MSGotPointerCapture:tdt,MSLostPointerCapture:ndt};n.call(this,t,i);this.pointerMap=t.pointerMap}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvent_=function(n){var t=n;return"number"==typeof n.pointerType&&((t=this.dispatcher.cloneEvent(n,n)).pointerType=oet[n.pointerType]),t},t.prototype.cleanup=function(n){delete this.pointerMap[n.toString()]},t}(tw);var cdt=function(n){function t(t){var i={pointerdown:idt,pointermove:rdt,pointerup:udt,pointerout:fdt,pointerover:edt,pointercancel:odt,gotpointercapture:hdt,lostpointercapture:sdt};n.call(this,t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(tw),het=!1,ldt=function(n){function t(t,i,r){n.call(this,t);this.originalEvent=i;var u=r||{};this.buttons=function(n){var t;if(n.buttons||het)t=n.buttons;else switch(n.which){case 1:t=1;break;case 2:t=4;break;case 3:t=2;break;default:t=0}return t}(u);this.pressure=function(n,t){return n.pressure?n.pressure:t?.5:0}(u,this.buttons);this.bubbles="bubbles"in u&&u.bubbles;this.cancelable="cancelable"in u&&u.cancelable;this.view="view"in u?u.view:null;this.detail="detail"in u?u.detail:null;this.screenX="screenX"in u?u.screenX:0;this.screenY="screenY"in u?u.screenY:0;this.clientX="clientX"in u?u.clientX:0;this.clientY="clientY"in u?u.clientY:0;this.ctrlKey="ctrlKey"in u&&u.ctrlKey;this.altKey="altKey"in u&&u.altKey;this.shiftKey="shiftKey"in u&&u.shiftKey;this.metaKey="metaKey"in u&&u.metaKey;this.button="button"in u?u.button:0;this.relatedTarget="relatedTarget"in u?u.relatedTarget:null;this.pointerId="pointerId"in u?u.pointerId:0;this.width="width"in u?u.width:0;this.height="height"in u?u.height:0;this.tiltX="tiltX"in u?u.tiltX:0;this.tiltY="tiltY"in u?u.tiltY:0;this.pointerType="pointerType"in u?u.pointerType:"";this.hwTimestamp="hwTimestamp"in u?u.hwTimestamp:0;this.isPrimary="isPrimary"in u&&u.isPrimary;i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr);!function(){try{var n=new MouseEvent("click",{buttons:1});het=1===n.buttons}catch(n){}}();cet=ldt;var wdt=function(n){function t(t,i){var r={touchstart:adt,touchmove:vdt,touchend:ydt,touchcancel:pdt};n.call(this,t,r);this.pointerMap=t.pointerMap;this.mouseSource=i;this.firstTouchId_=void 0;this.clickCount_=0;this.resetId_;this.dedupTimeout_=2500}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isPrimaryTouch_=function(n){return this.firstTouchId_===n.identifier},t.prototype.setPrimaryTouch_=function(n){var t=Object.keys(this.pointerMap).length;(0===t||1===t&&bh.toString()in this.pointerMap)&&(this.firstTouchId_=n.identifier,this.cancelResetClickCount_())},t.prototype.removePrimaryPointer_=function(n){n.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},t.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},t.prototype.resetClickCountHandler_=function(){this.clickCount_=0;this.resetId_=void 0},t.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},t.prototype.touchToPointer_=function(n,t){var i=this.dispatcher.cloneEvent(n,t);return i.pointerId=t.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=t.radiusX||0,i.height=t.radiusY||0,i.pressure=t.force||.5,i.isPrimary=this.isPrimaryTouch_(t),i.pointerType="touch",i.clientX=t.clientX,i.clientY=t.clientY,i.screenX=t.screenX,i.screenY=t.screenY,i},t.prototype.processTouches_=function(n,t){function e(){n.preventDefault()}for(var r,u=Array.prototype.slice.call(n.changedTouches),f=u.length,i=0;i<f;++i)r=this.touchToPointer_(n,u[i]),r.preventDefault=e,t.call(this,n,r)},t.prototype.findTouch_=function(n,t){for(var r=n.length,i=0;i<r;i++)if(n[i].identifier===t)return!0;return!1},t.prototype.vacuumTouches_=function(n){var f=n.touches,e=Object.keys(this.pointerMap),o=e.length,t,i,r,s,u;if(o>=f.length){for(t=[],i=0;i<o;++i)r=Number(e[i]),s=this.pointerMap[r],r==bh||this.findTouch_(f,r-2)||t.push(s.out);for(u=0;u<t.length;++u)this.cancelOut_(n,t[u])}},t.prototype.overDown_=function(n,t){this.pointerMap[t.pointerId]={target:t.target,out:t,outTarget:t.target};this.dispatcher.over(t,n);this.dispatcher.enter(t,n);this.dispatcher.down(t,n)},t.prototype.moveOverOut_=function(n,t){var i=t,r=this.pointerMap[i.pointerId],u,f;r&&(u=r.out,f=r.outTarget,this.dispatcher.move(i,n),u&&f!==i.target&&(u.relatedTarget=i.target,i.relatedTarget=f,u.target=f,i.target?(this.dispatcher.leaveOut(u,n),this.dispatcher.enterOver(i,n)):(i.target=f,i.relatedTarget=null,this.cancelOut_(n,i))),r.out=i,r.outTarget=i.target)},t.prototype.upOut_=function(n,t){this.dispatcher.up(t,n);this.dispatcher.out(t,n);this.dispatcher.leave(t,n);this.cleanUpPointer_(t)},t.prototype.cancelOut_=function(n,t){this.dispatcher.cancel(t,n);this.dispatcher.out(t,n);this.dispatcher.leave(t,n);this.cleanUpPointer_(t)},t.prototype.cleanUpPointer_=function(n){delete this.pointerMap[n.pointerId];this.removePrimaryPointer_(n)},t.prototype.dedupSynthMouse_=function(n){var r=this.mouseSource.lastTouches,t=n.changedTouches[0],i;this.isPrimaryTouch_(t)&&(i=[t.clientX,t.clientY],r.push(i),setTimeout(function(){!function(n,t){var i=n.indexOf(t),r=i>-1;r&&n.splice(i,1)}(r,i)},this.dedupTimeout_))},t}(tw),ig=[["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]],rg=function(n){function t(t){n.call(this);this.element_=t;this.pointerMap={};this.eventMap_={};this.eventSourceList_=[];this.registerSources()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.registerSources=function(){if(nkt)this.registerSource("native",new cdt(this));else if(tkt)this.registerSource("ms",new set(this));else{var n=new eet(this);this.registerSource("mouse",n);dd&&this.registerSource("touch",new wdt(this,n))}this.register_()},t.prototype.registerSource=function(n,t){var i=t,r=i.getEvents();r&&(r.forEach(function(n){var t=i.getHandlerForEvent(n);t&&(this.eventMap_[n]=t.bind(i))}.bind(this)),this.eventSourceList_.push(i))},t.prototype.register_=function(){for(var i,t=this.eventSourceList_.length,n=0;n<t;n++)i=this.eventSourceList_[n],this.addEvents_(i.getEvents())},t.prototype.unregister_=function(){for(var i,t=this.eventSourceList_.length,n=0;n<t;n++)i=this.eventSourceList_[n],this.removeEvents_(i.getEvents())},t.prototype.eventHandler_=function(n){var i=n.type,t=this.eventMap_[i];t&&t(n)},t.prototype.addEvents_=function(n){n.forEach(function(n){o(this.element_,n,this.eventHandler_,this)}.bind(this))},t.prototype.removeEvents_=function(n){n.forEach(function(n){ou(this.element_,n,this.eventHandler_,this)}.bind(this))},t.prototype.cloneEvent=function(n,t){for(var r,u={},i=0,f=ig.length;i<f;i++)r=ig[i][0],u[r]=n[r]||t[r]||ig[i][1];return u},t.prototype.down=function(n,t){this.fireEvent(tu.POINTERDOWN,n,t)},t.prototype.move=function(n,t){this.fireEvent(tu.POINTERMOVE,n,t)},t.prototype.up=function(n,t){this.fireEvent(tu.POINTERUP,n,t)},t.prototype.enter=function(n,t){n.bubbles=!1;this.fireEvent(tu.POINTERENTER,n,t)},t.prototype.leave=function(n,t){n.bubbles=!1;this.fireEvent(tu.POINTERLEAVE,n,t)},t.prototype.over=function(n,t){n.bubbles=!0;this.fireEvent(tu.POINTEROVER,n,t)},t.prototype.out=function(n,t){n.bubbles=!0;this.fireEvent(tu.POINTEROUT,n,t)},t.prototype.cancel=function(n,t){this.fireEvent(tu.POINTERCANCEL,n,t)},t.prototype.leaveOut=function(n,t){this.out(n,t);this.contains_(n.target,n.relatedTarget)||this.leave(n,t)},t.prototype.enterOver=function(n,t){this.over(n,t);this.contains_(n.target,n.relatedTarget)||this.enter(n,t)},t.prototype.contains_=function(n,t){return!(!n||!t)&&n.contains(t)},t.prototype.makeEvent=function(n,t,i){return new cet(n,i,t)},t.prototype.fireEvent=function(n,t,i){var r=this.makeEvent(n,t,i);this.dispatchEvent(r)},t.prototype.fireNativeEvent=function(n){var t=this.makeEvent(n.type,n,n);this.dispatchEvent(t)},t.prototype.wrapMouseEvent=function(n,t){return this.makeEvent(n,kh(t,this),t)},t.prototype.disposeInternal=function(){this.unregister_();n.prototype.disposeInternal.call(this)},t}(th),bdt=function(n){function t(t,i){n.call(this);this.map_=t;this.clickTimeoutId_;this.dragging_=!1;this.dragListenerKeys_=[];this.moveTolerance_=i?i*tl:tl;this.down_=null;var r=this.map_.getViewport();this.activePointers_=0;this.trackedTouches_={};this.pointerEventHandler_=new rg(r);this.documentPointerEventHandler_=null;this.pointerdownListenerKey_=o(this.pointerEventHandler_,tu.POINTERDOWN,this.handlePointerDown_,this);this.relayedListenerKey_=o(this.pointerEventHandler_,tu.POINTERMOVE,this.relayEvent_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.emulateClick_=function(n){var t=new ts(ht.CLICK,this.map_,n);this.dispatchEvent(t);void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new ts(ht.DBLCLICK,this.map_,n),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var t=new ts(ht.SINGLECLICK,this.map_,n);this.dispatchEvent(t)}.bind(this),250)},t.prototype.updateActivePointers_=function(n){var t=n;t.type==ht.POINTERUP||t.type==ht.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==ht.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0);this.activePointers_=Object.keys(this.trackedTouches_).length},t.prototype.handlePointerUp_=function(n){this.updateActivePointers_(n);var t=new ts(ht.POINTERUP,this.map_,n);this.dispatchEvent(t);t.propagationStopped||this.dragging_||!this.isMouseActionButton_(n)||this.emulateClick_(this.down_);0===this.activePointers_&&(this.dragListenerKeys_.forEach(lt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},t.prototype.isMouseActionButton_=function(n){return 0===n.button},t.prototype.handlePointerDown_=function(n){this.updateActivePointers_(n);var t=new ts(ht.POINTERDOWN,this.map_,n);this.dispatchEvent(t);this.down_=n;0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new rg(document),this.dragListenerKeys_.push(o(this.documentPointerEventHandler_,ht.POINTERMOVE,this.handlePointerMove_,this),o(this.documentPointerEventHandler_,ht.POINTERUP,this.handlePointerUp_,this),o(this.pointerEventHandler_,ht.POINTERCANCEL,this.handlePointerUp_,this)))},t.prototype.handlePointerMove_=function(n){if(this.isMoving_(n)){this.dragging_=!0;var t=new ts(ht.POINTERDRAG,this.map_,n,this.dragging_);this.dispatchEvent(t)}n.preventDefault()},t.prototype.relayEvent_=function(n){var t=!(!this.down_||!this.isMoving_(n));this.dispatchEvent(new ts(n.type,this.map_,n,t))},t.prototype.isMoving_=function(n){return this.dragging_||Math.abs(n.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(lt(this.relayedListenerKey_),this.relayedListenerKey_=null);this.pointerdownListenerKey_&&(lt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null);this.dragListenerKeys_.forEach(lt);this.dragListenerKeys_.length=0;this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null);this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null);n.prototype.disposeInternal.call(this)},t}(th),iw="postrender",kdt="movestart",ddt="moveend",br={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},c={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5},iu=function(n,t){this.priorityFunction_=n;this.keyFunction_=t;this.elements_=[];this.priorities_=[];this.queuedElements_={}};iu.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;pf(this.queuedElements_)};iu.prototype.dequeue=function(){var n=this.elements_,t=this.priorities_,i=n[0],r;return 1==n.length?(n.length=0,t.length=0):(n[0]=n.pop(),t[0]=t.pop(),this.siftUp_(0)),r=this.keyFunction_(i),delete this.queuedElements_[r],i};iu.prototype.enqueue=function(n){g(!(this.keyFunction_(n)in this.queuedElements_),31);var t=this.priorityFunction_(n);return t!=1/0&&(this.elements_.push(n),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(n)]=!0,this.siftDown_(0,this.elements_.length-1),!0)};iu.prototype.getCount=function(){return this.elements_.length};iu.prototype.getLeftChildIndex_=function(n){return 2*n+1};iu.prototype.getRightChildIndex_=function(n){return 2*n+2};iu.prototype.getParentIndex_=function(n){return n-1>>1};iu.prototype.heapify_=function(){for(var n=(this.elements_.length>>1)-1;n>=0;n--)this.siftUp_(n)};iu.prototype.isEmpty=function(){return 0===this.elements_.length};iu.prototype.isKeyQueued=function(n){return n in this.queuedElements_};iu.prototype.isQueued=function(n){return this.isKeyQueued(this.keyFunction_(n))};iu.prototype.siftUp_=function(n){for(var i=this.elements_,t=this.priorities_,f=i.length,o=i[n],s=t[n],h=n;n<f>>1;){var e=this.getLeftChildIndex_(n),r=this.getRightChildIndex_(n),u=r<f&&t[r]<t[e]?r:e;i[n]=i[u];t[n]=t[u];n=u}i[n]=o;t[n]=s;this.siftDown_(h,n)};iu.prototype.siftDown_=function(n,t){for(var r,u=this.elements_,i=this.priorities_,e=u[t],f=i[t];t>n;){if(r=this.getParentIndex_(t),!(i[r]>f))break;u[t]=u[r];i[t]=i[r];t=r}u[t]=e;i[t]=f};iu.prototype.reprioritize=function(){for(var r,u,e=this.priorityFunction_,t=this.elements_,f=this.priorities_,i=0,o=t.length,n=0;n<o;++n)(u=e(r=t[n]))==1/0?delete this.queuedElements_[this.keyFunction_(r)]:(f[i]=u,t[i++]=r);t.length=i;f.length=i;this.heapify_()};var aet=iu,vet=function(n){function t(t,i){n.call(this,function(n){return t.apply(null,n)},function(n){return n[0].getKey()});this.tileChangeCallback_=i;this.tilesLoading_=0;this.tilesLoadingKeys_={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.enqueue=function(t){var i=n.prototype.enqueue.call(this,t);return i&&o(t[0],a.CHANGE,this.handleTileChange,this),i},t.prototype.getTilesLoading=function(){return this.tilesLoading_},t.prototype.handleTileChange=function(n){var i=n.target,t=i.getState(),r;(t===c.LOADED||t===c.ERROR||t===c.EMPTY||t===c.ABORT)&&(ou(i,a.CHANGE,this.handleTileChange,this),r=i.getKey(),r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_())},t.prototype.loadMoreTiles=function(n,t){for(var f,i,r,u=0,e=!1;this.tilesLoading_<n&&u<t&&this.getCount()>0;)r=(i=this.dequeue()[0]).getKey(),(f=i.getState())===c.ABORT?e=!0:f!==c.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++u,i.load());0===u&&e&&this.tileChangeCallback_()},t}(aet),gdt=42,rw=256;var lu=0,oi=1,rl="center",dh="resolution",ul="rotation";ew=0;fg=function(n){function t(t){n.call(this);var i=nt({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimationKey_;this.updateAnimations_=this.updateAnimations_.bind(this);this.projection_=but(i.projection,"EPSG:3857");this.applyOptions_(i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.applyOptions_=function(n){var t={},i;t[rl]=void 0!==n.center?n.center:null;i=function(n){var o,t,e,i=void 0!==n.minZoom?n.minZoom:ew,r=void 0!==n.maxZoom?n.maxZoom:28,u=void 0!==n.zoomFactor?n.zoomFactor:2,f;if(void 0!==n.resolutions)f=n.resolutions,t=f[i],e=void 0!==f[r]?f[r]:f[f.length-1],o=function(n){return function(t,i,r){var f,u,e;if(void 0!==t)return(f=np(n,t,r),f=vi(f+i,0,n.length-1),u=Math.floor(f),f!=u&&u<n.length-1)?(e=n[u]/n[u+1],n[u]/Math.pow(e,f-u)):n[u]}}(f);else{var c=but(n.projection,"EPSG:3857"),s=c.getExtent(),l=s?Math.max(wt(s),ti(s)):360*gf[pr.DEGREES]/c.getMetersPerUnit(),h=l/rw/Math.pow(2,ew),a=h/Math.pow(2,28-ew);void 0!==(t=n.maxResolution)?i=0:t=h/Math.pow(u,i);void 0===(e=n.minResolution)&&(e=void 0!==n.maxZoom?void 0!==n.maxResolution?t/Math.pow(u,r):h/Math.pow(u,r):a);r=i+Math.floor(Math.log(t/e)/Math.log(u));e=t/Math.pow(u,r-i);o=function(n,t,i){return function(r,u,f){if(void 0!==r){var o=-f/2+.5,s=Math.floor(Math.log(t/r)/Math.log(n)+o),e=Math.max(s+u,0);return void 0!==i&&(e=Math.min(e,i)),t/Math.pow(n,e)}}}(u,t,r-i)}return{constraint:o,maxResolution:t,minResolution:e,minZoom:i,zoomFactor:u}}(n);this.maxResolution_=i.maxResolution;this.minResolution_=i.minResolution;this.zoomFactor_=i.zoomFactor;this.resolutions_=n.resolutions;this.minZoom_=i.minZoom;var r=function(n){return void 0!==n.extent?function(n){return function(t){if(t)return[vi(t[0],n[0],n[2]),vi(t[1],n[1],n[3])]}}(n.extent):ngt}(n),u=i.constraint,f=function(n){if(void 0===n.enableRotation||n.enableRotation){var t=n.constrainRotation;return void 0===t||!0===t?function(n){var t=n||kf(5);return function(n,i){if(void 0!==n)return Math.abs(n+i)<=t?0:n+i}}():!1===t?yet:"number"==typeof t?function(n){var t=2*Math.PI/n;return function(n,i){if(void 0!==n)return n=Math.floor((n+i)/t+.5)*t}}(t):yet}return uw}(n);this.constraints_={center:r,resolution:u,rotation:f};void 0!==n.resolution?t[dh]=n.resolution:void 0!==n.zoom&&(t[dh]=this.constrainResolution(this.maxResolution_,n.zoom-this.minZoom_),this.resolutions_&&(t[dh]=vi(Number(this.getResolution()||t[dh]),this.minResolution_,this.maxResolution_)));t[ul]=void 0!==n.rotation?n.rotation:0;this.setProperties(t);this.options_=n},t.prototype.getUpdatedOptions_=function(n){var t=nt({},this.options_);return void 0!==t.resolution?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenter(),t.rotation=this.getRotation(),nt({},t,n)},t.prototype.animate=function(){var u,a=arguments,r=arguments.length,i,t,n,l;if(r>1&&"function"==typeof arguments[r-1]&&(u=arguments[r-1],--r),!this.isDef())return i=arguments[r-1],i.center&&this.setCenter(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(u&&ow(u,!0));for(var s=Date.now(),h=this.getCenter().slice(),f=this.getResolution(),e=this.getRotation(),c=[],o=0;o<r;++o)t=a[o],n={start:s,complete:!1,anchor:t.anchor,duration:void 0!==t.duration?t.duration:1e3,easing:t.easing||fw},(t.center&&(n.sourceCenter=h,n.targetCenter=t.center,h=n.targetCenter),void 0!==t.zoom?(n.sourceResolution=f,n.targetResolution=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_,0),f=n.targetResolution):t.resolution&&(n.sourceResolution=f,n.targetResolution=t.resolution,f=n.targetResolution),void 0!==t.rotation)&&(n.sourceRotation=e,l=df(t.rotation-e+Math.PI,2*Math.PI)-Math.PI,n.targetRotation=e+l,e=n.targetRotation),n.callback=u,tgt(n)?n.complete=!0:s+=n.duration,c.push(n);this.animations_.push(c);this.setHint(lu,1);this.updateAnimations_()},t.prototype.getAnimating=function(){return this.hints_[lu]>0},t.prototype.getInteracting=function(){return this.hints_[oi]>0},t.prototype.cancelAnimations=function(){var n,i,t;for(this.setHint(lu,-this.hints_[lu]),n=0,i=this.animations_.length;n<i;++n)t=this.animations_[n],t[0].callback&&ow(t[0].callback,!1);this.animations_.length=0},t.prototype.updateAnimations_=function(){var n,l,r,t,e,o,s;if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var y=Date.now(),h=!1,i=this.animations_.length-1;i>=0;--i){for(var u=this.animations_[i],c=!0,f=0,p=u.length;f<p;++f)if(n=u[f],!n.complete){if(l=y-n.start,r=n.duration>0?l/n.duration:1,r>=1?(n.complete=!0,r=1):c=!1,t=n.easing(r),n.sourceCenter){var a=n.sourceCenter[0],v=n.sourceCenter[1],w=a+t*(n.targetCenter[0]-a),b=v+t*(n.targetCenter[1]-v);this.set(rl,[w,b])}if(n.sourceResolution&&n.targetResolution&&(e=1===t?n.targetResolution:n.sourceResolution+t*(n.targetResolution-n.sourceResolution),n.anchor&&this.set(rl,this.calculateCenterZoom(e,n.anchor)),this.set(dh,e)),void 0!==n.sourceRotation&&void 0!==n.targetRotation&&(o=1===t?df(n.targetRotation+Math.PI,2*Math.PI)-Math.PI:n.sourceRotation+t*(n.targetRotation-n.sourceRotation),n.anchor&&this.set(rl,this.calculateCenterRotate(o,n.anchor)),this.set(ul,o)),h=!0,!n.complete)break}c&&(this.animations_[i]=null,this.setHint(lu,-1),s=u[0].callback,s&&ow(s,!0))}this.animations_=this.animations_.filter(Boolean);h&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},t.prototype.calculateCenterRotate=function(n,t){var i,r=this.getCenter();return void 0!==r&&(da(i=[r[0]-t[0],r[1]-t[1]],n-this.getRotation()),ka(i,t)),i},t.prototype.calculateCenterZoom=function(n,t){var u,i=this.getCenter(),r=this.getResolution();return void 0!==i&&void 0!==r&&(u=[t[0]-n*(t[0]-i[0])/r,t[1]-n*(t[1]-i[1])/r]),u},t.prototype.getSizeFromViewport_=function(){var n=[100,100],r='.ol-viewport[data-view="'+y(this)+'"]',i=document.querySelector(r),t;return i&&(t=getComputedStyle(i),n[0]=parseInt(t.width,10),n[1]=parseInt(t.height,10)),n},t.prototype.constrainCenter=function(n){return this.constraints_.center(n)},t.prototype.constrainResolution=function(n,t,i){var r=t||0,u=i||0;return this.constraints_.resolution(n,r,u)},t.prototype.constrainRotation=function(n,t){var i=t||0;return this.constraints_.rotation(n,i)},t.prototype.getCenter=function(){return this.get(rl)},t.prototype.getConstraints=function(){return this.constraints_},t.prototype.getHints=function(n){return void 0!==n?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},t.prototype.calculateExtent=function(n){var u=n||this.getSizeFromViewport_(),r=this.getCenter(),t,i;return g(r,1),t=this.getResolution(),g(void 0!==t,2),i=this.getRotation(),g(void 0!==i,3),ca(r,t,i,u)},t.prototype.getMaxResolution=function(){return this.maxResolution_},t.prototype.getMinResolution=function(){return this.minResolution_},t.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},t.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},t.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},t.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolution=function(){return this.get(dh)},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getResolutionForExtent=function(n,t){var i=t||this.getSizeFromViewport_(),r=wt(n)/i[0],u=ti(n)/i[1];return Math.max(r,u)},t.prototype.getResolutionForValueFunction=function(n){var t=n||2,i=this.maxResolution_,r=this.minResolution_,u=Math.log(i/r)/Math.log(t);return function(n){return i/Math.pow(t,n*u)}},t.prototype.getRotation=function(){return this.get(ul)},t.prototype.getValueForResolutionFunction=function(n){var t=n||2,i=this.maxResolution_,r=this.minResolution_,u=Math.log(i/r)/Math.log(t);return function(n){return Math.log(i/n)/Math.log(t)/u}},t.prototype.getState=function(n){var i=this.getCenter(),r=this.getProjection(),u=this.getResolution(),t=u/n,f=this.getRotation();return{center:[Math.round(i[0]/t)*t,Math.round(i[1]/t)*t],projection:void 0!==r?r:null,resolution:u,rotation:f,zoom:this.getZoom()}},t.prototype.getZoom=function(){var n,t=this.getResolution();return void 0!==t&&(n=this.getZoomForResolution(t)),n},t.prototype.getZoomForResolution=function(n){var i,r,u=this.minZoom_||0,t;return this.resolutions_?(t=np(this.resolutions_,n,1),u=t,i=this.resolutions_[t],r=t==this.resolutions_.length-1?2:i/this.resolutions_[t+1]):(i=this.maxResolution_,r=this.zoomFactor_),u+Math.log(i/n)/Math.log(r)},t.prototype.getResolutionForZoom=function(n){return this.constrainResolution(this.maxResolution_,n-this.minZoom_,0)},t.prototype.fit=function(n,t){var s,i=t||{},l=i.size,k,d,r,c;l||(l=this.getSizeFromViewport_());g(Array.isArray(n)||"function"==typeof n.getSimplifiedGeometry,24);Array.isArray(n)?(g(!eh(n),25),s=ba(n)):n.getType()===f.CIRCLE?(s=ba(n=n.getExtent())).rotate(this.getRotation(),su(n)):s=n;var b,u=void 0!==i.padding?i.padding:[0,0,0,0],ft=void 0===i.constrainResolution||i.constrainResolution,et=void 0!==i.nearest&&i.nearest;b=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.constrainResolution(this.maxResolution_,i.maxZoom-this.minZoom_,0):0;for(var h=s.getFlatCoordinates(),nt=this.getRotation(),a=Math.cos(-nt),e=Math.sin(-nt),v=1/0,y=1/0,p=-1/0,w=-1/0,ot=s.getStride(),o=0,st=h.length;o<st;o+=ot)k=h[o]*a-h[o+1]*e,d=h[o]*e+h[o+1]*a,v=Math.min(v,k),y=Math.min(y,d),p=Math.max(p,k),w=Math.max(w,d);r=this.getResolutionForExtent([v,y,p,w],[l[0]-u[1]-u[3],l[1]-u[0]-u[2]]);(r=isNaN(r)?b:Math.max(r,b),ft)&&(c=this.constrainResolution(r,0,0),!et&&c<r&&(c=this.constrainResolution(c,-1,0)),r=c);e=-e;var tt=(v+p)/2,it=(y+w)/2,rt=[(tt+=(u[1]-u[3])/2*r)*a-(it+=(u[0]-u[2])/2*r)*e,it*a+tt*e],ut=i.callback?i.callback:wf;void 0!==i.duration?this.animate({resolution:r,center:rt,duration:i.duration,easing:i.easing},ut):(this.setResolution(r),this.setCenter(rt),ow(ut,!0))},t.prototype.centerOn=function(n,t,i){var f=this.getRotation(),u=Math.cos(-f),r=Math.sin(-f),e=n[0]*u-n[1]*r,o=n[1]*u+n[0]*r,s=this.getResolution(),h=(e+=(t[0]/2-i[0])*s)*u-(o+=(i[1]-t[1]/2)*s)*(r=-r),c=o*u+e*r;this.setCenter([h,c])},t.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},t.prototype.rotate=function(n,t){if(void 0!==t){var i=this.calculateCenterRotate(n,t);this.setCenter(i)}this.setRotation(n)},t.prototype.setCenter=function(n){this.set(rl,n);this.getAnimating()&&this.cancelAnimations()},t.prototype.setHint=function(n,t){return this.hints_[n]+=t,this.changed(),this.hints_[n]},t.prototype.setResolution=function(n){this.set(dh,n);this.getAnimating()&&this.cancelAnimations()},t.prototype.setRotation=function(n){this.set(ul,n);this.getAnimating()&&this.cancelAnimations()},t.prototype.setZoom=function(n){this.setResolution(this.getResolutionForZoom(n))},t}(rf);var di={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"},eg=function(n){function t(t){n.call(this);var i=nt({},t);i[di.OPACITY]=void 0!==t.opacity?t.opacity:1;i[di.VISIBLE]=void 0===t.visible||t.visible;i[di.Z_INDEX]=t.zIndex;i[di.MAX_RESOLUTION]=void 0!==t.maxResolution?t.maxResolution:1/0;i[di.MIN_RESOLUTION]=void 0!==t.minResolution?t.minResolution:0;this.setProperties(i);this.state_=null;this.type}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getType=function(){return this.type},t.prototype.getLayerState=function(){var n=this.state_||{layer:this,managed:!0};return n.opacity=vi(this.getOpacity(),0,1),n.sourceState=this.getSourceState(),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=this.getZIndex()||0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),this.state_=n,n},t.prototype.getLayersArray=function(){return p()},t.prototype.getLayerStatesArray=function(){return p()},t.prototype.getExtent=function(){return this.get(di.EXTENT)},t.prototype.getMaxResolution=function(){return this.get(di.MAX_RESOLUTION)},t.prototype.getMinResolution=function(){return this.get(di.MIN_RESOLUTION)},t.prototype.getOpacity=function(){return this.get(di.OPACITY)},t.prototype.getSourceState=function(){return p()},t.prototype.getVisible=function(){return this.get(di.VISIBLE)},t.prototype.getZIndex=function(){return this.get(di.Z_INDEX)},t.prototype.setExtent=function(n){this.set(di.EXTENT,n)},t.prototype.setMaxResolution=function(n){this.set(di.MAX_RESOLUTION,n)},t.prototype.setMinResolution=function(n){this.set(di.MIN_RESOLUTION,n)},t.prototype.setOpacity=function(n){this.set(di.OPACITY,n)},t.prototype.setVisible=function(n){this.set(di.VISIBLE,n)},t.prototype.setZIndex=function(n){this.set(di.Z_INDEX,n)},t}(rf),pi={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},og={LAYERS:"layers"},bet=function(n){function t(t){var r=t||{},u=nt({},r),i;delete u.layers;i=r.layers;n.call(this,u);this.layersListenerKeys_=[];this.listenerKeys_={};o(this,ni(og.LAYERS),this.handleLayersChanged_,this);i?Array.isArray(i)?i=new er(i.slice(),{unique:!0}):g("function"==typeof i.getArray,43):i=new er(void 0,{unique:!0});this.setLayers(i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){var n,r,t;this.layersListenerKeys_.forEach(lt);this.layersListenerKeys_.length=0;n=this.getLayers();for(r in this.layersListenerKeys_.push(o(n,ki.ADD,this.handleLayersAdd_,this),o(n,ki.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[r].forEach(lt);pf(this.listenerKeys_);for(var u=n.getArray(),i=0,f=u.length;i<f;i++)t=u[i],this.listenerKeys_[y(t)]=[o(t,gs,this.handleLayerChange_,this),o(t,a.CHANGE,this.handleLayerChange_,this)];this.changed()},t.prototype.handleLayersAdd_=function(n){var t=n.element;this.listenerKeys_[y(t)]=[o(t,gs,this.handleLayerChange_,this),o(t,a.CHANGE,this.handleLayerChange_,this)];this.changed()},t.prototype.handleLayersRemove_=function(n){var t=y(n.element);this.listenerKeys_[t].forEach(lt);delete this.listenerKeys_[t];this.changed()},t.prototype.getLayers=function(){return this.get(og.LAYERS)},t.prototype.setLayers=function(n){this.set(og.LAYERS,n)},t.prototype.getLayersArray=function(n){var t=void 0!==n?n:[];return this.getLayers().forEach(function(n){n.getLayersArray(t)}),t},t.prototype.getLayerStatesArray=function(n){var r=void 0!==n?n:[],f=r.length,t;this.getLayers().forEach(function(n){n.getLayerStatesArray(r)});for(var i=this.getLayerState(),u=f,e=r.length;u<e;u++)t=r[u],t.opacity*=i.opacity,t.visible=t.visible&&i.visible,t.maxResolution=Math.min(t.maxResolution,i.maxResolution),t.minResolution=Math.max(t.minResolution,i.minResolution),void 0!==i.extent&&(t.extent=void 0!==t.extent?of(t.extent,i.extent):i.extent);return r},t.prototype.getSourceState=function(){return pi.READY},t}(eg);var hg=function(n){function t(t){var i,f;n.call(this);i=function(n){var f=null,r,u,i,t,e;return void 0!==n.keyboardEventTarget&&(f="string"==typeof n.keyboardEventTarget?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget),t={},e=n.layers&&"function"==typeof n.layers.getLayers?n.layers:new bet({layers:n.layers}),t[br.LAYERGROUP]=e,t[br.TARGET]=n.target,t[br.VIEW]=void 0!==n.view?n.view:new fg,void 0!==n.controls&&(Array.isArray(n.controls)?r=new er(n.controls.slice()):(g("function"==typeof n.controls.getArray,47),r=n.controls)),void 0!==n.interactions&&(Array.isArray(n.interactions)?u=new er(n.interactions.slice()):(g("function"==typeof n.interactions.getArray,48),u=n.interactions)),void 0!==n.overlays?Array.isArray(n.overlays)?i=new er(n.overlays.slice()):(g("function"==typeof n.overlays.getArray,49),i=n.overlays):i=new er,{controls:r,interactions:u,keyboardEventTarget:f,overlays:i,values:t}}(t);this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16;this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating;this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting;this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:tl;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"+(dd?" 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 u=[a.CLICK,a.DBLCLICK,a.MOUSEDOWN,a.TOUCHSTART,a.MSPOINTERDOWN,ht.POINTERDOWN,a.MOUSEWHEEL,a.WHEEL],r=0,e=u.length;r<e;++r)o(this.overlayContainerStopEvent_,u[r],tut);for(f in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new bdt(this,t.moveTolerance),ht)o(this.mapBrowserEventHandler_,ht[f],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget;this.keyHandlerKeys_=null;o(this.viewport_,a.CONTEXTMENU,this.handleBrowserEvent,this);o(this.viewport_,a.WHEEL,this.handleBrowserEvent,this);o(this.viewport_,a.MOUSEWHEEL,this.handleBrowserEvent,this);this.controls=i.controls||new er;this.interactions=i.interactions||new er;this.overlays_=i.overlays;this.overlayIdIndex_={};this.renderer_=this.createRenderer();this.handleResize_;this.focus_=null;this.postRenderFunctions_=[];this.tileQueue_=new vet(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.skippedFeatureUids_={};o(this,ni(br.LAYERGROUP),this.handleLayerGroupChanged_,this);o(this,ni(br.VIEW),this.handleViewChanged_,this);o(this,ni(br.SIZE),this.handleSizeChanged_,this);o(this,ni(br.TARGET),this.handleTargetChanged_,this);this.setProperties(i.values);this.controls.forEach(function(n){n.setMap(this)}.bind(this));o(this.controls,ki.ADD,function(n){n.element.setMap(this)},this);o(this.controls,ki.REMOVE,function(n){n.element.setMap(null)},this);this.interactions.forEach(function(n){n.setMap(this)}.bind(this));o(this.interactions,ki.ADD,function(n){n.element.setMap(this)},this);o(this.interactions,ki.REMOVE,function(n){n.element.setMap(null)},this);this.overlays_.forEach(this.addOverlayInternal_.bind(this));o(this.overlays_,ki.ADD,function(n){this.addOverlayInternal_(n.element)},this);o(this.overlays_,ki.REMOVE,function(n){var t=n.element.getId();void 0!==t&&delete this.overlayIdIndex_[t.toString()];n.element.setMap(null)},this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method");},t.prototype.addControl=function(n){this.getControls().push(n)},t.prototype.addInteraction=function(n){this.getInteractions().push(n)},t.prototype.addLayer=function(n){this.getLayerGroup().getLayers().push(n)},t.prototype.addOverlay=function(n){this.getOverlays().push(n)},t.prototype.addOverlayInternal_=function(n){var t=n.getId();void 0!==t&&(this.overlayIdIndex_[t.toString()]=n);n.setMap(this)},t.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();ou(this.viewport_,a.CONTEXTMENU,this.handleBrowserEvent,this);ou(this.viewport_,a.WHEEL,this.handleBrowserEvent,this);ou(this.viewport_,a.MOUSEWHEEL,this.handleBrowserEvent,this);void 0!==this.handleResize_&&(removeEventListener(a.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.setTarget(null);n.prototype.disposeInternal.call(this)},t.prototype.forEachFeatureAtPixel=function(n,t,i){if(this.frameState_){var r=this.getCoordinateFromPixel(n),u=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,f=void 0!==i.layerFilter?i.layerFilter:bu;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,u,t,null,f,null)}},t.prototype.getFeaturesAtPixel=function(n,t){var i=null;return this.forEachFeatureAtPixel(n,function(n){i||(i=[]);i.push(n)},t),i},t.prototype.forEachLayerAtPixel=function(n,t,i){if(this.frameState_){var r=i||{},u=void 0!==r.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,f=r.layerFilter||bu;return this.renderer_.forEachLayerAtPixel(n,this.frameState_,u,t,null,f,null)}},t.prototype.hasFeatureAtPixel=function(n,t){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixel(n),r=void 0!==(t=void 0!==t?t:{}).layerFilter?t.layerFilter:bu,u=void 0!==t.hitTolerance?t.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,u,r,null)},t.prototype.getEventCoordinate=function(n){return this.getCoordinateFromPixel(this.getEventPixel(n))},t.prototype.getEventPixel=function(n){var t=this.viewport_.getBoundingClientRect(),i="changedTouches"in n?n.changedTouches[0]:n;return[i.clientX-t.left,i.clientY-t.top]},t.prototype.getTarget=function(){return this.get(br.TARGET)},t.prototype.getTargetElement=function(){var n=this.getTarget();return void 0!==n?"string"==typeof n?document.getElementById(n):n:null},t.prototype.getCoordinateFromPixel=function(n){var t=this.frameState_;return t?wr(t.pixelToCoordinateTransform,n.slice()):null},t.prototype.getControls=function(){return this.controls},t.prototype.getOverlays=function(){return this.overlays_},t.prototype.getOverlayById=function(n){var t=this.overlayIdIndex_[n.toString()];return void 0!==t?t:null},t.prototype.getInteractions=function(){return this.interactions},t.prototype.getLayerGroup=function(){return this.get(br.LAYERGROUP)},t.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},t.prototype.getPixelFromCoordinate=function(n){var t=this.frameState_;return t?wr(t.coordinateToPixelTransform,n.slice(0,2)):null},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.getSize=function(){return this.get(br.SIZE)},t.prototype.getView=function(){return this.get(br.VIEW)},t.prototype.getViewport=function(){return this.viewport_},t.prototype.getOverlayContainer=function(){return this.overlayContainer_},t.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},t.prototype.getTilePriority=function(n,t,i,r){var u=this.frameState_,f,e;return(u&&t in u.wantedTiles)?u.wantedTiles[t][n.getKey()]?(f=i[0]-u.focus[0],e=i[1]-u.focus[1],65536*Math.log(r)+Math.sqrt(f*f+e*e)/r):1/0:1/0},t.prototype.handleBrowserEvent=function(n,t){var i=t||n.type,r=new uet(i,this,n);this.handleMapBrowserEvent(r)},t.prototype.handleMapBrowserEvent=function(n){var i,t,r;if(this.frameState_&&(this.focus_=n.coordinate,n.frameState=this.frameState_,i=this.getInteractions().getArray(),!1!==this.dispatchEvent(n)))for(t=i.length-1;t>=0;t--)if(r=i[t],r.getActive()&&!r.handleEvent(n))break},t.prototype.handlePostRender=function(){var n=this.frameState_,i=this.tileQueue_,t,r,u;i.isEmpty()||(t=this.maxTilesLoading_,r=t,n&&(u=n.viewHints,u[lu]&&(t=this.loadTilesWhileAnimating_?8:0,r=2),u[oi]&&(t=this.loadTilesWhileInteracting_?8:0,r=2)),i.getTilesLoading()<t&&(i.reprioritize(),i.loadMoreTiles(t,r)));!n||!this.hasListener(gr.RENDERCOMPLETE)||n.animate||this.tileQueue_.getTilesLoading()||function n(t){for(var r,u,i=0,f=t.length;i<f;++i){if(r=t[i],"function"==typeof r.getLayers)return n(r.getLayers().getArray());if(u=r.getSource(),u&&u.loading)return!0}return!1}(this.getLayers().getArray())||this.renderer_.dispatchRenderEvent(gr.RENDERCOMPLETE,n);for(var f=this.postRenderFunctions_,e=0,o=f.length;e<o;++e)f[e](this,n);f.length=0},t.prototype.handleSizeChanged_=function(){this.render()},t.prototype.handleTargetChanged_=function(){var n,t,r,i;if(this.getTarget()&&(n=this.getTargetElement()),this.keyHandlerKeys_){for(t=0,r=this.keyHandlerKeys_.length;t<r;++t)lt(this.keyHandlerKeys_[t]);this.keyHandlerKeys_=null}n?(n.appendChild(this.viewport_),i=this.keyboardEventTarget_?this.keyboardEventTarget_:n,this.keyHandlerKeys_=[o(i,a.KEYDOWN,this.handleBrowserEvent,this),o(i,a.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),addEventListener(a.RESIZE,this.handleResize_,!1))):(this.renderer_.removeLayerRenderers(),sw(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(a.RESIZE,this.handleResize_,!1),this.handleResize_=void 0));this.updateSize()},t.prototype.handleTileChange_=function(){this.render()},t.prototype.handleViewPropertyChanged_=function(){this.render()},t.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(lt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null);this.viewChangeListenerKey_&&(lt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var n=this.getView();n&&(this.viewport_.setAttribute("data-view",y(n)),this.viewPropertyListenerKey_=o(n,gs,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=o(n,a.CHANGE,this.handleViewPropertyChanged_,this));this.render()},t.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(lt),this.layerGroupPropertyListenerKeys_=null);var n=this.getLayerGroup();n&&(this.layerGroupPropertyListenerKeys_=[o(n,gs,this.render,this),o(n,a.CHANGE,this.render,this)]);this.render()},t.prototype.isRendered=function(){return!!this.frameState_},t.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_);this.animationDelay_()},t.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},t.prototype.removeControl=function(n){return this.getControls().remove(n)},t.prototype.removeInteraction=function(n){return this.getInteractions().remove(n)},t.prototype.removeLayer=function(n){return this.getLayerGroup().getLayers().remove(n)},t.prototype.removeOverlay=function(n){return this.getOverlays().remove(n)},t.prototype.renderFrame_=function(n){var i,e=this.getSize(),r=this.getView(),o=[1/0,1/0,-1/0,-1/0],s=this.frameState_,t=null;if(void 0!==e&&function(n){return n[0]>0&&n[1]>0}(e)&&r&&r.isDef()){for(var c=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),u=this.getLayerGroup().getLayerStatesArray(),h={},f=0,l=u.length;f<l;++f)h[y(u[f].layer)]=u[f];i=r.getState(this.pixelRatio_);t={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:o,focus:this.focus_?this.focus_:i.center,index:this.frameIndex_++,layerStates:h,layerStatesArray:u,pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:n,usedTiles:{},viewState:i,viewHints:c,wantedTiles:{}}}(t&&(t.extent=ca(i.center,i.resolution,i.rotation,t.size,o)),this.frameState_=t,this.renderer_.renderFrame(t),t)&&((t.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,t.postRenderFunctions),s)&&(this.previousExtent_&&(eh(this.previousExtent_)||oe(t.extent,this.previousExtent_))||(this.dispatchEvent(new nw(kdt,this,s)),this.previousExtent_=rh(this.previousExtent_))),!this.previousExtent_||t.viewHints[lu]||t.viewHints[oi]||oe(t.extent,this.previousExtent_)||(this.dispatchEvent(new nw(ddt,this,t)),fut(t.extent,this.previousExtent_)));this.dispatchEvent(new nw(iw,this,t));setTimeout(this.handlePostRender.bind(this),0)},t.prototype.setLayerGroup=function(n){this.set(br.LAYERGROUP,n)},t.prototype.setSize=function(n){this.set(br.SIZE,n)},t.prototype.setTarget=function(n){this.set(br.TARGET,n)},t.prototype.setView=function(n){this.set(br.VIEW,n)},t.prototype.skipFeature=function(n){this.skippedFeatureUids_[y(n)]=!0;this.render()},t.prototype.updateSize=function(){var t=this.getTargetElement(),n;t?(n=getComputedStyle(t),this.setSize([t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth)])):this.setSize(void 0)},t.prototype.unskipFeature=function(n){delete this.skippedFeatureUids_[y(n)];this.render()},t}(rf),le=function(n){function t(t){n.call(this);this.element=t.element?t.element:null;this.target_=null;this.map_=null;this.listenerKeys=[];this.render=t.render?t.render:wf;t.target&&this.setTarget(t.target)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){sw(this.element);n.prototype.disposeInternal.call(this)},t.prototype.getMap=function(){return this.map_},t.prototype.setMap=function(n){this.map_&&sw(this.element);for(var t=0,i=this.listenerKeys.length;t<i;++t)lt(this.listenerKeys[t]);(this.listenerKeys.length=0,this.map_=n,this.map_)&&((this.target_?this.target_:n.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==wf&&this.listenerKeys.push(o(n,iw,this.render,this)),n.render())},t.prototype.setTarget=function(n){this.target_="string"==typeof n?document.getElementById(n):n},t}(rf),hw="ol-hidden",igt="ol-selectable",ie="ol-unselectable",rgt="ol-unsupported",gh="ol-control",cw="ol-collapsed",ugt=function(){var n,t={};return function(i){if(n||(n=document.createElement("div").style),!(i in t)){n.font=i;var r=n.fontFamily;if(n.font="",!r)return null;t[i]=r.split(/,\s?/)}return t[i]}}();lw=function(n){function t(t){var i=nt({},t),r;delete i.source;n.call(this,i);this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;t.map&&this.setMap(t.map);o(this,ni(di.SOURCE),this.handleSourcePropertyChange_,this);r=t.source?t.source:null;this.setSource(r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getLayersArray=function(n){var t=n||[];return t.push(this),t},t.prototype.getLayerStatesArray=function(n){var t=n||[];return t.push(this.getLayerState()),t},t.prototype.getSource=function(){return this.get(di.SOURCE)||null},t.prototype.getSourceState=function(){var n=this.getSource();return n?n.getState():pi.UNDEFINED},t.prototype.handleSourceChange_=function(){this.changed()},t.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(lt(this.sourceChangeKey_),this.sourceChangeKey_=null);var n=this.getSource();n&&(this.sourceChangeKey_=o(n,a.CHANGE,this.handleSourceChange_,this));this.changed()},t.prototype.setMap=function(n){this.mapPrecomposeKey_&&(lt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null);n||this.changed();this.mapRenderKey_&&(lt(this.mapRenderKey_),this.mapRenderKey_=null);n&&(this.mapPrecomposeKey_=o(n,gr.PRECOMPOSE,function(n){var i=n,t=this.getLayerState();t.managed=!1;void 0===this.getZIndex()&&(t.zIndex=1/0);i.frameState.layerStatesArray.push(t);i.frameState.layerStates[y(this)]=t},this),this.mapRenderKey_=o(this,a.CHANGE,n.render,n),this.changed())},t.prototype.setSource=function(n){this.set(di.SOURCE,n)},t}(eg);cg=function(n){function t(t){var i=t||{},u,s,r,h,f;n.call(this,{element:document.createElement("div"),render:i.render||det,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 c=void 0!==i.className?i.className:"ol-attribution",l=void 0!==i.tipLabel?i.tipLabel:"Attributions",e=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof e?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=e):this.collapseLabel_=e;u=void 0!==i.label?i.label:"i";"string"==typeof u?(this.label_=document.createElement("span"),this.label_.textContent=u):this.label_=u;s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;r=document.createElement("button");r.setAttribute("type","button");r.title=l;r.appendChild(s);o(r,a.CLICK,this.handleClick_,this);h=c+" "+ie+" "+gh+(this.collapsed_&&this.collapsible_?" "+cw:"")+(this.collapsible_?"":" ol-uncollapsible");f=this.element;f.className=h;f.appendChild(this.ulElement_);f.appendChild(r);this.renderedAttributions_=[];this.renderedVisible_=!0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.collectSourceAttributions_=function(n){for(var o,u,s,t,i,c,r={},f=[],h=n.layerStatesArray,l=n.viewState.resolution,e=0,a=h.length;e<a;++e)if(o=h[e],is(o,l)&&(u=o.layer.getSource(),u&&(s=u.getAttributions(),s&&(t=s(n),t))))if(this.overrideCollapsible_||!1!==u.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(t))for(i=0,c=t.length;i<c;++i)t[i]in r||(f.push(t[i]),r[t[i]]=!0);else t in r||(f.push(t),r[t]=!0);return f},t.prototype.updateElement_=function(n){var t,i,r,f,u;if(n){if(t=this.collectSourceAttributions_(n),i=t.length>0,this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!uf(t,this.renderedAttributions_)){for(wet(this.ulElement_),r=0,f=t.length;r<f;++r)u=document.createElement("li"),u.innerHTML=t[r],this.ulElement_.appendChild(u);this.renderedAttributions_=t}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t.prototype.handleClick_=function(n){n.preventDefault();this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(cw);this.collapsed_?fl(this.collapseLabel_,this.label_):fl(this.label_,this.collapseLabel_);this.collapsed_=!this.collapsed_},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(n){this.collapsible_!==n&&(this.collapsible_=n,this.element.classList.toggle("ol-uncollapsible"),!n&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(n){this.collapsible_&&this.collapsed_!==n&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t}(le);lg=function(n){function t(t){var i=t||{},f,u,s,r,h,e;n.call(this,{element:document.createElement("div"),render:i.render||get,target:i.target});f=void 0!==i.className?i.className:"ol-rotate";u=void 0!==i.label?i.label:"⇧";this.label_=null;"string"==typeof u?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=u):(this.label_=u,this.label_.classList.add("ol-compass"));s=i.tipLabel?i.tipLabel:"Reset rotation";r=document.createElement("button");r.className=f+"-reset";r.setAttribute("type","button");r.title=s;r.appendChild(this.label_);o(r,a.CLICK,this.handleClick_,this);h=f+" "+ie+" "+gh;e=this.element;e.className=h;e.appendChild(r);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(hw)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleClick_=function(n){n.preventDefault();void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},t.prototype.resetNorth_=function(){var n=this.getMap().getView();n&&void 0!==n.getRotation()&&(this.duration_>0?n.animate({rotation:0,duration:this.duration_,easing:cf}):n.setRotation(0))},t}(le);ag=function(n){function t(t){var i=t||{},r,l,f;n.call(this,{element:document.createElement("div"),target:i.target});var e=void 0!==i.className?i.className:"ol-zoom",c=void 0!==i.delta?i.delta:1,s=void 0!==i.zoomInLabel?i.zoomInLabel:"+",h=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",v=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",y=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=e+"-in";u.setAttribute("type","button");u.title=v;u.appendChild("string"==typeof s?document.createTextNode(s):s);o(u,a.CLICK,this.handleClick_.bind(this,c));r=document.createElement("button");r.className=e+"-out";r.setAttribute("type","button");r.title=y;r.appendChild("string"==typeof h?document.createTextNode(h):h);o(r,a.CLICK,this.handleClick_.bind(this,-c));l=e+" "+ie+" "+gh;f=this.element;f.className=l;f.appendChild(u);f.appendChild(r);this.duration_=void 0!==i.duration?i.duration:250}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleClick_=function(n,t){t.preventDefault();this.zoomByDelta_(n)},t.prototype.zoomByDelta_=function(n){var t=this.getMap().getView(),i,r;t&&(i=t.getResolution(),i&&(r=t.constrainResolution(i,n),this.duration_>0?(t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:r,duration:this.duration_,easing:cf})):t.setResolution(r)))},t}(le);tv={ACTIVE:"active"};ge=function(n){function t(t){n.call(this);t.handleEvent&&(this.handleEvent=t.handleEvent);this.map_=null;this.setActive(!0)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getActive=function(){return this.get(tv.ACTIVE)},t.prototype.getMap=function(){return this.map_},t.prototype.handleEvent=function(){return!0},t.prototype.setActive=function(n){this.set(tv.ACTIVE,n)},t.prototype.setMap=function(n){this.map_=n},t}(rf);var tot=function(n){function t(t){n.call(this,{handleEvent:fgt});var i=t||{};this.delta_=i.delta?i.delta:1;this.duration_=void 0!==i.duration?i.duration:250}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ge),iot=function(n){var t=n.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},rot=function(n){var t=n.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},wg=function(n){return n.target.getTargetElement()===document.activeElement},iv=bu,uot=function(n){var t=n.originalEvent;return 0==t.button&&!(gbt&&vft&&t.ctrlKey)},bg=nh,fot=function(n){return"pointermove"==n.type},kg=function(n){return n.type==ht.SINGLECLICK},yw=function(n){var t=n.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},rv=function(n){var t=n.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},dg=function(n){var t=n.originalEvent.target.tagName;return"INPUT"!==t&&"SELECT"!==t&&"TEXTAREA"!==t},ae=function(n){var t=n.pointerEvent;return g(void 0!==t,56),"mouse"==t.pointerType},eot=function(n){var t=n.pointerEvent;return g(void 0!==t,56),t.isPrimary&&0===t.button};var lf=function(n){function t(t){var i=t||{};n.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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDownEvent=function(){return!1},t.prototype.handleDragEvent=function(){},t.prototype.handleEvent=function(n){var i,r,t;return n.pointerEvent?(i=!1,(this.updateTrackedPointers_(n),this.handlingDownUpSequence)?n.type==ht.POINTERDRAG?this.handleDragEvent(n):n.type==ht.POINTERUP&&(r=this.handleUpEvent(n),this.handlingDownUpSequence=r&&this.targetPointers.length>0):n.type==ht.POINTERDOWN?(t=this.handleDownEvent(n),t&&n.preventDefault(),this.handlingDownUpSequence=t,i=this.stopDown(t)):n.type==ht.POINTERMOVE&&this.handleMoveEvent(n),!i):!0},t.prototype.handleMoveEvent=function(){},t.prototype.handleUpEvent=function(){return!1},t.prototype.stopDown=function(n){return n},t.prototype.updateTrackedPointers_=function(n){if(function(n){var t=n.type;return t===ht.POINTERDOWN||t===ht.POINTERDRAG||t===ht.POINTERUP}(n)){var i=n.pointerEvent,t=i.pointerId.toString();n.type==ht.POINTERUP?delete this.trackedPointers_[t]:n.type==ht.POINTERDOWN?this.trackedPointers_[t]=i:t in this.trackedPointers_&&(this.trackedPointers_[t]=i);this.targetPointers=wk(this.trackedPointers_)}},t}(ge),oot=function(n){function t(t){n.call(this,{stopDown:nh});var i=t||{};this.kinetic_=i.kinetic;this.lastCentroid=null;this.lastPointersCount_;this.panning_=!1;this.condition_=i.condition?i.condition:yw;this.noKinetic_=!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDragEvent=function(n){var u,t;if(this.panning_||(this.panning_=!0,this.getMap().getView().setHint(oi,1)),u=this.targetPointers,t=gg(u),u.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(t[0],t[1]),this.lastCentroid){var f=this.lastCentroid[0]-t[0],e=t[1]-this.lastCentroid[1],r=n.map.getView(),i=[f,e];gd(i,r.getResolution());da(i,r.getRotation());ka(i,r.getCenter());i=r.constrainCenter(i);r.setCenter(i)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=t;this.lastPointersCount_=u.length},t.prototype.handleUpEvent=function(n){var i=n.map,t=i.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),u=this.kinetic_.getAngle(),e=t.getCenter(),f=i.getPixelFromCoordinate(e),o=i.getCoordinateFromPixel([f[0]-r*Math.cos(u),f[1]-r*Math.sin(u)]);t.animate({center:t.constrainCenter(o),duration:500,easing:cf})}return this.panning_&&(this.panning_=!1,t.setHint(oi,-1)),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>0&&this.condition_(n)){var t=n.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.setCenter(n.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},t}(lf),sot=function(n){function t(t){var i=t||{};n.call(this,{stopDown:nh});this.condition_=i.condition?i.condition:rot;this.lastAngle_=void 0;this.duration_=void 0!==i.duration?i.duration:250}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDragEvent=function(n){var i,t,e;if(ae(n)&&(i=n.map,t=i.getView(),t.getConstraints().rotation!==uw)){var r=i.getSize(),u=n.pixel,f=Math.atan2(r[1]/2-u[1],u[0]-r[0]/2);void 0!==this.lastAngle_&&(e=f-this.lastAngle_,aw(t,t.getRotation()-e));this.lastAngle_=f}},t.prototype.handleUpEvent=function(n){if(!ae(n))return!0;var t=n.map.getView();return t.setHint(oi,-1),yg(t,t.getRotation(),void 0,this.duration_),!1},t.prototype.handleDownEvent=function(n){return!!ae(n)&&!(!uot(n)||!this.condition_(n))&&(n.map.getView().setHint(oi,1),this.lastAngle_=void 0,!0)},t}(lf),egt=function(n){function t(t){n.call(this);this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.setMap(null)},t.prototype.render_=function(){var n=this.startPixel_,t=this.endPixel_,i=this.element_.style;i.left=Math.min(n[0],t[0])+"px";i.top=Math.min(n[1],t[1])+"px";i.width=Math.abs(t[0]-n[0])+"px";i.height=Math.abs(t[1]-n[1])+"px"},t.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var t=this.element_.style;t.left=t.top=t.width=t.height="inherit"}this.map_=n;this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},t.prototype.setPixels=function(n,t){this.startPixel_=n;this.endPixel_=t;this.createOrUpdateGeometry();this.render_()},t.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,i=this.endPixel_,n=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);n[4]=n[0].slice();this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new or([n])},t.prototype.getGeometry=function(){return this.geometry_},t}(sa),ogt="boxstart",sgt="boxdrag",hgt="boxend",nn=function(n){function t(t,i,r){n.call(this,t);this.coordinate=i;this.mapBrowserEvent=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),hot=function(n){function t(t){n.call(this);var i=t||{};this.box_=new egt(i.className||"ol-dragbox");this.minArea_=void 0!==i.minArea?i.minArea:64;this.onBoxEnd_=i.onBoxEnd?i.onBoxEnd:wf;this.startPixel_=null;this.condition_=i.condition?i.condition:iv;this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:this.defaultBoxEndCondition}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.defaultBoxEndCondition=function(n,t,i){var r=i[0]-t[0],u=i[1]-t[1];return r*r+u*u>=this.minArea_},t.prototype.getGeometry=function(){return this.box_.getGeometry()},t.prototype.handleDragEvent=function(n){ae(n)&&(this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new nn(sgt,n.coordinate,n)))},t.prototype.handleUpEvent=function(n){return!ae(n)||(this.box_.setMap(null),this.boxEndCondition_(n,this.startPixel_,n.pixel)&&(this.onBoxEnd_(n),this.dispatchEvent(new nn(hgt,n.coordinate,n))),!1)},t.prototype.handleDownEvent=function(n){return!!ae(n)&&!(!uot(n)||!this.condition_(n))&&(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new nn(ogt,n.coordinate,n)),!0)},t}(lf);tn=function(n){function t(t){var i=t||{},r=i.condition?i.condition:rv;n.call(this,{condition:r,className:i.className||"ol-dragzoom",onBoxEnd:cgt});this.duration_=void 0!==i.duration?i.duration:200;this.out_=void 0!==i.out&&i.out}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(hot);rs={LEFT:37,UP:38,RIGHT:39,DOWN:40};rn=function(n){function t(t){n.call(this,{handleEvent:lgt});var i=t||{};this.defaultCondition_=function(n){return yw(n)&&dg(n)};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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ge);var cot=function(n){function t(t){n.call(this,{handleEvent:agt});var i=t||{};this.condition_=i.condition?i.condition:dg;this.delta_=i.delta?i.delta:1;this.duration_=void 0!==i.duration?i.duration:100}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ge),lot="trackpad",vgt="wheel",aot=function(n){function t(t){var i=t||{};n.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:iv;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0;this.getMap().getView().setHint(oi,-1)},t.prototype.handleEvent=function(n){var o,i,s,u,f,t,l,v;if(!this.condition_(n)||(o=n.type,o!==a.WHEEL&&o!==a.MOUSEWHEEL))return!0;if(n.preventDefault(),s=n.map,u=n.originalEvent,this.useAnchor_&&(this.lastAnchor_=n.coordinate),n.type==a.WHEEL?(i=u.deltaY,kbt&&u.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=tl),u.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):n.type==a.MOUSEWHEEL&&(i=-u.wheelDeltaY,dbt&&(i/=3)),0===i)return!1;if(f=Date.now(),void 0===this.startTime_&&(this.startTime_=f),(!this.mode_||f-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?lot:vgt),this.mode_===lot){t=s.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):t.setHint(oi,1);this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var r=t.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),h=t.getMinResolution(),c=t.getMaxResolution(),e=0;return(r<h?(r=Math.max(r,h/this.trackpadZoomBuffer_),e=1):r>c&&(r=Math.min(r,c*this.trackpadZoomBuffer_),e=-1),this.lastAnchor_)&&(l=t.calculateCenterZoom(r,this.lastAnchor_),t.setCenter(t.constrainCenter(l))),t.setResolution(r),0===e&&this.constrainResolution_&&t.animate({resolution:t.constrainResolution(r,i>0?-1:1),easing:cf,anchor:this.lastAnchor_,duration:this.duration_}),e>0?t.animate({resolution:h,easing:cf,anchor:this.lastAnchor_,duration:500}):e<0&&t.animate({resolution:c,easing:cf,anchor:this.lastAnchor_,duration:500}),this.startTime_=f,!1}return this.delta_+=i,v=Math.max(this.timeout_-(f-this.startTime_),0),clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,s),v),!1},t.prototype.handleWheelZoom_=function(n){var t=n.getView();t.getAnimating()&&t.cancelAnimations();pg(t,-vi(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},t.prototype.setMouseAnchor=function(n){this.useAnchor_=n;n||(this.lastAnchor_=null)},t}(ge),vot=function(n){function t(t){var i=t||{},r=i;r.stopDown||(r.stopDown=nh);n.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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDragEvent=function(n){var e=0,o=this.targetPointers[0],s=this.targetPointers[1],h=Math.atan2(s.clientY-o.clientY,s.clientX-o.clientX),u,t,i,f,r,c;void 0!==this.lastAngle_&&(u=h-this.lastAngle_,this.rotationDelta_+=u,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=u);this.lastAngle_=h;t=n.map;i=t.getView();i.getConstraints().rotation!==uw&&(f=t.getViewport().getBoundingClientRect(),r=gg(this.targetPointers),(r[0]-=f.left,r[1]-=f.top,this.anchor_=t.getCoordinateFromPixel(r),this.rotating_)&&(c=i.getRotation(),t.render(),aw(i,c+e,this.anchor_)))},t.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var t=n.map.getView();return(t.setHint(oi,-1),this.rotating_)&&yg(t,t.getRotation(),this.anchor_,this.duration_),!1}return!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var t=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().setHint(oi,1),!0}return!1},t}(lf),yot=function(n){function t(t){var i=t||{},r=i;r.stopDown||(r.stopDown=nh);n.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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDragEvent=function(n){var t=1,c=this.targetPointers[0],l=this.targetPointers[1],a=c.clientX-l.clientX,v=c.clientY-l.clientY,y=Math.sqrt(a*a+v*v),h,f;void 0!==this.lastDistance_&&(t=this.lastDistance_/y);this.lastDistance_=y;var r=n.map,u=r.getView(),e=u.getResolution(),o=u.getMaxResolution(),s=u.getMinResolution(),i=e*t;i>o?(t=o/e,i=o):i<s&&(t=s/e,i=s);1!=t&&(this.lastScaleDelta_=t);h=r.getViewport().getBoundingClientRect();f=gg(this.targetPointers);f[0]-=h.left;f[1]-=h.top;this.anchor_=r.getCoordinateFromPixel(f);r.render();vw(u,i,this.anchor_)},t.prototype.handleUpEvent=function(n){var t,i,r;return this.targetPointers.length<2?(t=n.map.getView(),t.setHint(oi,-1),i=t.getResolution(),(this.constrainResolution_||i<t.getMinResolution()||i>t.getMaxResolution())&&(r=this.lastScaleDelta_-1,not(t,i,this.anchor_,this.duration_,r)),!1):!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var t=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().setHint(oi,1),!0}return!1},t}(lf);var pot=.5,fn=function(n){function t(t,i,r,u){n.call(this);this.extent=t;this.pixelRatio_=r;this.resolution=i;this.state=u}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.changed=function(){this.dispatchEvent(a.CHANGE)},t.prototype.getExtent=function(){return this.extent},t.prototype.getImage=function(){return p()},t.prototype.getPixelRatio=function(){return this.pixelRatio_},t.prototype.getResolution=function(){return this.resolution},t.prototype.getState=function(){return this.state},t.prototype.load=function(){p()},t}(th),ot={IDLE:0,LOADING:1,LOADED:2,ERROR:3},en=function(n){function t(t,i,r,u,f){var e=void 0!==f?ot.IDLE:ot.LOADED;n.call(this,t,i,r,e);this.loader_=void 0!==f?f:null;this.canvas_=u;this.error_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getError=function(){return this.error_},t.prototype.handleLoad_=function(n){n?(this.error_=n,this.state=ot.ERROR):this.state=ot.LOADED;this.changed()},t.prototype.load=function(){this.state==ot.IDLE&&(this.state=ot.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},t.prototype.getImage=function(){return this.canvas_},t}(fn),kr={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"},wot={IMAGE:"image",VECTOR:"vector"},pw=function(n){function t(t,i,r,u,f){n.call(this,t);this.vectorContext=i;this.frameState=r;this.context=u;this.glContext=f}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),on=function(n){function t(t){n.call(this);this.highWaterMark=void 0!==t?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(a.CLEAR)},t.prototype.containsKey=function(n){return this.entries_.hasOwnProperty(n)},t.prototype.forEach=function(n,t){for(var i=this.oldest_;i;)n.call(t,i.value_,i.key_,this),i=i.newer},t.prototype.get=function(n){var t=this.entries_[n];return g(void 0!==t,15),t===this.newest_?t.value_:(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t,t.value_)},t.prototype.remove=function(n){var t=this.entries_[n];return g(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[n],--this.count_,t.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){for(var t=new Array(this.count_),i=0,n=this.newest_;n;n=n.older)t[i++]=n.key_;return t},t.prototype.getValues=function(){for(var t=new Array(this.count_),i=0,n=this.newest_;n;n=n.older)t[i++]=n.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var n=this.oldest_;return delete this.entries_[n.key_],n.newer&&(n.newer.older=null),this.oldest_=n.newer,this.oldest_||(this.newest_=null),--this.count_,n.value_},t.prototype.replace=function(n,t){this.get(n);this.entries_[n].value_=t},t.prototype.set=function(n,t){g(!(n in this.entries_),16);var i={key_:n,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i;this.newest_=i;this.entries_[n]=i;++this.count_},t.prototype.setSize=function(n){this.highWaterMark=n},t.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(th),no=[0,0,0,1],ww=[],uv=[0,0,0,1],el=[0,0,0,0],ve=new on,ygt={},bw=null,bot={},pgt=function(){function o(n){for(var o,a,t=kot(),i=100;i<=700;i+=300){for(var l=i+" ",h=!0,c=0;c<s;++c)o=f[c],(t.font=l+u+o,r=t.measureText(e).width,n!=o)&&(t.font=l+u+n+","+o,a=t.measureText(e).width,h=h&&a!=r);if(h)return!0}return!1}function h(){var u=!0;for(var r in n)n[r]<i&&(o(r)?(n[r]=i,pf(bot),bw=null,ve.clear()):(++n[r],u=!1));u&&(clearInterval(t),t=void 0)}var t,r,i=60,n=ygt,u="32px ",f=["monospace","serif"],s=f.length,e="wmytzilWMYTZIL@#/&?$%10";return function(r){var e=ugt(r),f,s,u;if(e)for(f=0,s=e.length;f<s;++f)u=e[f],u in n||(n[u]=i,o(u)||(n[u]=0,void 0===t&&(t=setInterval(h,32))))}}();dot=function(){var n,t=bot;return function(i){var r=t[i];return void 0==r&&(n||((n=document.createElement("span")).textContent="M",n.style.margin=n.style.padding="0 !important",n.style.position="absolute !important",n.style.left="-99999px !important"),n.style.font=i,document.body.appendChild(n),r=t[i]=n.offsetHeight,document.body.removeChild(n)),r}}();hn=[1,0,0,1,0,0];sr=function(){};sr.prototype.drawCustom=function(){};sr.prototype.drawGeometry=function(){};sr.prototype.setStyle=function(){};sr.prototype.drawCircle=function(){};sr.prototype.drawFeature=function(){};sr.prototype.drawGeometryCollection=function(){};sr.prototype.drawLineString=function(){};sr.prototype.drawMultiLineString=function(){};sr.prototype.drawMultiPoint=function(){};sr.prototype.drawMultiPolygon=function(){};sr.prototype.drawPoint=function(){};sr.prototype.drawPolygon=function(){};sr.prototype.drawText=function(){};sr.prototype.setFillStrokeStyle=function(){};sr.prototype.setImageStyle=function(){};sr.prototype.setTextStyle=function(){};var fv=sr,cn=function(n){function t(t,i,r,u,f){n.call(this);this.context_=t;this.pixelRatio_=i;this.extent_=r;this.transform_=u;this.viewRotation_=f;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawImages_=function(n,t,i){var u,f,v,o,s,h,c;if(this.image_){var e=vo(n,t,i,2,this.transform_,this.pixelCoordinates_),r=this.context_,l=this.tmpLocalTransform_,a=r.globalAlpha;for(1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_),u=this.imageRotation_,this.imageRotateWithView_&&(u+=this.viewRotation_),f=0,v=e.length;f<v;f+=2)o=e[f]-this.imageAnchorX_,s=e[f+1]-this.imageAnchorY_,(0!==u||1!=this.imageScale_)&&(h=o+this.imageAnchorX_,c=s+this.imageAnchorY_,cu(l,h,c,this.imageScale_,this.imageScale_,u,-h,-c),r.setTransform.apply(r,l)),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,o,s,this.imageWidth_,this.imageHeight_);0===u&&1==this.imageScale_||r.setTransform(1,0,0,1,0,0);1!=this.imageOpacity_&&(r.globalAlpha=a)}},t.prototype.drawText_=function(n,t,i,r){var f,e,h;if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_);this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_);this.setContextTextState_(this.textState_);var s=vo(n,t,i,r,this.transform_,this.pixelCoordinates_),u=this.context_,o=this.textRotation_;for(this.textRotateWithView_&&(o+=this.viewRotation_);t<i;t+=r)f=s[t]+this.textOffsetX_,e=s[t+1]+this.textOffsetY_,(0!==o||1!=this.textScale_)&&(h=cu(this.tmpLocalTransform_,f,e,this.textScale_,this.textScale_,o,-f,-e),u.setTransform.apply(u,h)),this.textStrokeState_&&u.strokeText(this.text_,f,e),this.textFillState_&&u.fillText(this.text_,f,e);0===o&&1==this.textScale_||u.setTransform(1,0,0,1,0,0)}},t.prototype.moveToLineTo_=function(n,t,i,r,u){var o=this.context_,f=vo(n,t,i,r,this.transform_,this.pixelCoordinates_),s,e;for(o.moveTo(f[0],f[1]),s=f.length,u&&(s-=2),e=2;e<s;e+=2)o.lineTo(f[e],f[e+1]);return u&&o.closePath(),i},t.prototype.drawRings_=function(n,t,i,r){for(var u=0,f=i.length;u<f;++u)t=this.moveToLineTo_(n,t,i[u],r,!0);return t},t.prototype.drawCircle=function(n){if(dt(this.extent_,n.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_);this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var t=function(n,t,i){var r=n.getFlatCoordinates(),u;return r?(u=n.getStride(),vo(r,0,r.length,u,t,i)):null}(n,this.transform_,this.pixelCoordinates_),r=t[2]-t[0],u=t[3]-t[1],f=Math.sqrt(r*r+u*u),i=this.context_;i.beginPath();i.arc(t[0],t[1],f,0,2*Math.PI);this.fillState_&&i.fill();this.strokeState_&&i.stroke()}""!==this.text_&&this.drawText_(n.getCenter(),0,2,2)}},t.prototype.setStyle=function(n){this.setFillStrokeStyle(n.getFill(),n.getStroke());this.setImageStyle(n.getImage());this.setTextStyle(n.getText())},t.prototype.drawGeometry=function(n){switch(n.getType()){case f.POINT:this.drawPoint(n);break;case f.LINE_STRING:this.drawLineString(n);break;case f.POLYGON:this.drawPolygon(n);break;case f.MULTI_POINT:this.drawMultiPoint(n);break;case f.MULTI_LINE_STRING:this.drawMultiLineString(n);break;case f.MULTI_POLYGON:this.drawMultiPolygon(n);break;case f.GEOMETRY_COLLECTION:this.drawGeometryCollection(n);break;case f.CIRCLE:this.drawCircle(n)}},t.prototype.drawFeature=function(n,t){var i=t.getGeometryFunction()(n);i&&dt(this.extent_,i.getExtent())&&(this.setStyle(t),this.drawGeometry(i))},t.prototype.drawGeometryCollection=function(n){for(var i=n.getGeometriesArray(),t=0,r=i.length;t<r;++t)this.drawGeometry(i[t])},t.prototype.drawPoint=function(n){var t=n.getFlatCoordinates(),i=n.getStride();this.image_&&this.drawImages_(t,0,t.length,i);""!==this.text_&&this.drawText_(t,0,t.length,i)},t.prototype.drawMultiPoint=function(n){var t=n.getFlatCoordinates(),i=n.getStride();this.image_&&this.drawImages_(t,0,t.length,i);""!==this.text_&&this.drawText_(t,0,t.length,i)},t.prototype.drawLineString=function(n){var t,i,r;dt(this.extent_,n.getExtent())&&(this.strokeState_&&(this.setContextStrokeState_(this.strokeState_),t=this.context_,i=n.getFlatCoordinates(),t.beginPath(),this.moveToLineTo_(i,0,i.length,n.getStride(),!1),t.stroke()),""!==this.text_&&(r=n.getFlatMidpoint(),this.drawText_(r,0,2,2)))},t.prototype.drawMultiLineString=function(n){var o=n.getExtent(),t,e,i;if(dt(this.extent_,o)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,s=n.getFlatCoordinates(),u=0,f=n.getEnds(),h=n.getStride();for(r.beginPath(),t=0,e=f.length;t<e;++t)u=this.moveToLineTo_(s,u,f[t],h,!1);r.stroke()}""!==this.text_&&(i=n.getFlatMidpoints(),this.drawText_(i,0,i.length,2))}},t.prototype.drawPolygon=function(n){var t,i;dt(this.extent_,n.getExtent())&&((this.strokeState_||this.fillState_)&&(this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_),t=this.context_,t.beginPath(),this.drawRings_(n.getOrientedFlatCoordinates(),0,n.getEnds(),n.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()),""!==this.text_&&(i=n.getFlatInteriorPoint(),this.drawText_(i,0,2,2)))},t.prototype.drawMultiPolygon=function(n){var t,e,o,r;if(dt(this.extent_,n.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_);this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_,s=n.getOrientedFlatCoordinates(),u=0,f=n.getEndss(),h=n.getStride();for(i.beginPath(),t=0,e=f.length;t<e;++t)o=f[t],u=this.drawRings_(s,u,o,h);this.fillState_&&i.fill();this.strokeState_&&i.stroke()}""!==this.text_&&(r=n.getFlatInteriorPoints(),this.drawText_(r,0,r.length,2))}},t.prototype.setContextFillState_=function(n){var i=this.context_,t=this.contextFillState_;t?t.fillStyle!=n.fillStyle&&(t.fillStyle=i.fillStyle=n.fillStyle):(i.fillStyle=n.fillStyle,this.contextFillState_={fillStyle:n.fillStyle})},t.prototype.setContextStrokeState_=function(n){var i=this.context_,t=this.contextStrokeState_;t?(t.lineCap!=n.lineCap&&(t.lineCap=i.lineCap=n.lineCap),il&&(uf(t.lineDash,n.lineDash)||i.setLineDash(t.lineDash=n.lineDash),t.lineDashOffset!=n.lineDashOffset&&(t.lineDashOffset=i.lineDashOffset=n.lineDashOffset)),t.lineJoin!=n.lineJoin&&(t.lineJoin=i.lineJoin=n.lineJoin),t.lineWidth!=n.lineWidth&&(t.lineWidth=i.lineWidth=n.lineWidth),t.miterLimit!=n.miterLimit&&(t.miterLimit=i.miterLimit=n.miterLimit),t.strokeStyle!=n.strokeStyle&&(t.strokeStyle=i.strokeStyle=n.strokeStyle)):(i.lineCap=n.lineCap,il&&(i.setLineDash(n.lineDash),i.lineDashOffset=n.lineDashOffset),i.lineJoin=n.lineJoin,i.lineWidth=n.lineWidth,i.miterLimit=n.miterLimit,i.strokeStyle=n.strokeStyle,this.contextStrokeState_={lineCap:n.lineCap,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset,lineJoin:n.lineJoin,lineWidth:n.lineWidth,miterLimit:n.miterLimit,strokeStyle:n.strokeStyle})},t.prototype.setContextTextState_=function(n){var i=this.context_,t=this.contextTextState_,r=n.textAlign?n.textAlign:"center";t?(t.font!=n.font&&(t.font=i.font=n.font),t.textAlign!=r&&(t.textAlign=i.textAlign=r),t.textBaseline!=n.textBaseline&&(t.textBaseline=i.textBaseline=n.textBaseline)):(i.font=n.font,i.textAlign=r,i.textBaseline=n.textBaseline,this.contextTextState_={font:n.font,textAlign:r,textBaseline:n.textBaseline})},t.prototype.setFillStrokeStyle=function(n,t){var i;if(n?(i=n.getColor(),this.fillState_={fillStyle:du(i||no)}):this.fillState_=null,t){var o=t.getColor(),r=t.getLineCap(),s=t.getLineDash(),h=t.getLineDashOffset(),u=t.getLineJoin(),f=t.getWidth(),e=t.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:s||ww,lineDashOffset:h||0,lineJoin:void 0!==u?u:"round",lineWidth:this.pixelRatio_*(void 0!==f?f:1),miterLimit:void 0!==e?e:10,strokeStyle:du(o||uv)}}else this.strokeState_=null},t.prototype.setImageStyle=function(n){if(n){var t=n.getAnchor(),u=n.getImage(1),i=n.getOrigin(),r=n.getSize();this.imageAnchorX_=t[0];this.imageAnchorY_=t[1];this.imageHeight_=r[1];this.image_=u;this.imageOpacity_=n.getOpacity();this.imageOriginX_=i[0];this.imageOriginY_=i[1];this.imageRotateWithView_=n.getRotateWithView();this.imageRotation_=n.getRotation();this.imageScale_=n.getScale()*this.pixelRatio_;this.imageWidth_=r[0]}else this.image_=null},t.prototype.setTextStyle=function(n){var i,r,t;if(n){if(i=n.getFill(),i?(r=i.getColor(),this.textFillState_={fillStyle:du(r||no)}):this.textFillState_=null,t=n.getStroke(),t){var b=t.getColor(),u=t.getLineCap(),k=t.getLineDash(),d=t.getLineDashOffset(),f=t.getLineJoin(),e=t.getWidth(),o=t.getMiterLimit();this.textStrokeState_={lineCap:void 0!==u?u:"round",lineDash:k||ww,lineDashOffset:d||0,lineJoin:void 0!==f?f:"round",lineWidth:void 0!==e?e:1,miterLimit:void 0!==o?o:10,strokeStyle:du(b||uv)}}else this.textStrokeState_=null;var s=n.getFont(),h=n.getOffsetX(),c=n.getOffsetY(),l=n.getRotateWithView(),a=n.getRotation(),v=n.getScale(),y=n.getText(),p=n.getTextAlign(),w=n.getTextBaseline();this.textState_={font:void 0!==s?s:"10px sans-serif",textAlign:void 0!==p?p:"center",textBaseline:void 0!==w?w:"middle"};this.text_=void 0!==y?y:"";this.textOffsetX_=void 0!==h?this.pixelRatio_*h:0;this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0;this.textRotateWithView_=void 0!==l&&l;this.textRotation_=void 0!==a?a:0;this.textScale_=this.pixelRatio_*(void 0!==v?v:1)}else this.text_=""},t}(fv),ol=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};ol.prototype.clear=function(){this.cache_={};this.cacheSize_=0};ol.prototype.expire=function(){var t,n,i;if(this.cacheSize_>this.maxCacheSize_){t=0;for(n in this.cache_)i=this.cache_[n],0!=(3&t++)||i.hasListener()||(delete this.cache_[n],--this.cacheSize_)}};ol.prototype.get=function(n,t,i){var r=nst(n,t,i);return r in this.cache_?this.cache_[r]:null};ol.prototype.set=function(n,t,i,r){var u=nst(n,t,i);this.cache_[u]=r;++this.cacheSize_};ol.prototype.setSize=function(n){this.maxCacheSize_=n;this.expire()};ev=new ol;var ist=function(n){function t(t){n.call(this);this.map_=t;this.layerRenderers_={};this.layerRendererListeners_={};this.layerRendererConstructors_=[]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.dispatchRenderEvent=function(){p()},t.prototype.registerLayerRenderers=function(n){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,n)},t.prototype.calculateMatrices2D=function(n){var t=n.viewState,i=n.coordinateToPixelTransform,r=n.pixelToCoordinateTransform;cu(i,n.size[0]/2,n.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]);nft(gut(r,i))},t.prototype.removeLayerRenderers=function(){for(var n in this.layerRenderers_)this.removeLayerRendererByKey_(n).dispose()},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u,f,e){function tt(n,i){var f=t.layerStates[y(i)].managed;if(!(y(n)in t.skippedFeatureUids)||f)return r.call(u,n,f?i:null)}var l,w=t.viewState,nt=w.resolution,b=w.projection,k=n,h,a,v,c,g,p;if(b.canWrapX()){var o=b.getExtent(),d=wt(o),s=n[0];(s<o[0]||s>o[2])&&(k=[s+d*Math.ceil((o[0]-s)/d),n[1]])}for(a=t.layerStatesArray,h=a.length-1;h>=0;--h)if(v=a[h],c=v.layer,is(v,nt)&&f.call(e,c)&&(g=this.getLayerRenderer(c),p=c.getSource(),p&&(l=g.forEachFeatureAtCoordinate(p.getWrapX()?k:n,t,i,tt)),l))return l},t.prototype.forEachLayerAtPixel=function(){return p()},t.prototype.hasFeatureAtCoordinate=function(n,t,i,r,u){return void 0!==this.forEachFeatureAtCoordinate(n,t,i,bu,this,r,u)},t.prototype.getLayerRenderer=function(n){var i=y(n),t,r,f,u;if(i in this.layerRenderers_)return this.layerRenderers_[i];for(r=0,f=this.layerRendererConstructors_.length;r<f;++r)if(u=this.layerRendererConstructors_[r],u.handles(n)){t=u.create(this,n);break}if(!t)throw new Error("Unable to create renderer for layer: "+n.getType());return this.layerRenderers_[i]=t,this.layerRendererListeners_[i]=o(t,a.CHANGE,this.handleLayerRendererChange_,this),t},t.prototype.getLayerRendererByKey=function(n){return this.layerRenderers_[n]},t.prototype.getLayerRenderers=function(){return this.layerRenderers_},t.prototype.getMap=function(){return this.map_},t.prototype.handleLayerRendererChange_=function(){this.map_.render()},t.prototype.removeLayerRendererByKey_=function(n){var t=this.layerRenderers_[n];return delete this.layerRenderers_[n],lt(this.layerRendererListeners_[n]),delete this.layerRendererListeners_[n],t},t.prototype.removeUnusedLayerRenderers_=function(n,t){for(var i in this.layerRenderers_)t&&i in t.layerStates||this.removeLayerRendererByKey_(i).dispose()},t.prototype.renderFrame=function(){p()},t.prototype.scheduleExpireIconCache=function(n){n.postRenderFunctions.push(wgt)},t.prototype.scheduleRemoveUnusedLayerRenderers=function(n){for(var t in this.layerRenderers_)if(!(t in n.layerStates))return void n.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},t}(sa),kw=[],rst=function(n){function t(t){n.call(this,t);var i=t.getViewport();this.context_=kt();this.canvas_=this.context_.canvas;this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=ie;i.insertBefore(this.canvas_,i.childNodes[0]||null);this.renderedVisible_=!0;this.transform_=[1,0,0,1,0,0]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.dispatchRenderEvent=function(n,t){var i=this.getMap(),r=this.context_;if(i.hasListener(n)){var u=t.extent,f=t.pixelRatio,e=t.viewState.rotation,o=this.getTransform(t),s=new cn(r,f,u,o,e),h=new pw(n,s,t,r,null);i.dispatchEvent(h)}},t.prototype.getTransform=function(n){var t=n.viewState,r=this.canvas_.width/2,u=this.canvas_.height/2,i=n.pixelRatio/t.resolution,f=-i,e=-t.rotation,o=-t.center[0],s=-t.center[1];return cu(this.transform_,r,u,i,f,e,o,s)},t.prototype.renderFrame=function(n){var f,e,o,h,c;if(n){var t=this.context_,s=n.pixelRatio,r=Math.round(n.size[0]*s),u=Math.round(n.size[1]*s);for(this.canvas_.width!=r||this.canvas_.height!=u?(this.canvas_.width=r,this.canvas_.height=u):t.clearRect(0,0,r,u),f=n.viewState.rotation,this.calculateMatrices2D(n),this.dispatchRenderEvent(gr.PRECOMPOSE,n),e=n.layerStatesArray,gk(e,tst),f&&(t.save(),to(t,f,r/2,u/2)),c=n.viewState.resolution,o=0,h=e.length;o<h;++o){var i=e[o],a=i.layer,l=this.getLayerRenderer(a);is(i,c)&&i.sourceState==pi.READY&&l.prepareFrame(n,i)&&l.composeFrame(n,i,t)}f&&t.restore();this.dispatchRenderEvent(gr.POSTCOMPOSE,n);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0);this.scheduleRemoveUnusedLayerRenderers(n);this.scheduleExpireIconCache(n)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},t.prototype.forEachLayerAtPixel=function(n,t,i,r,u,f,e){for(var c,a=t.viewState.resolution,l=t.layerStatesArray,v=l.length,y=wr(t.pixelToCoordinateTransform,n.slice()),s,h,o=v-1;o>=0;--o)if(s=l[o],h=s.layer,is(s,a)&&f.call(e,h)&&(c=this.getLayerRenderer(h).forEachLayerAtCoordinate(y,t,i,r,u)))return c},t.prototype.registerLayerRenderers=function(t){var i,u,r;for(n.prototype.registerLayerRenderers.call(this,t),i=0,u=t.length;i<u;++i)r=t[i],tr(kw,r)||kw.push(r)},t}(ist),ust=function(n){function t(t){n.call(this);this.layer_=t}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createLoadedTileFinder=function(n,t,i){return function(r,u){return n.forEachLoadedTile(t,r,u,function(n){i[r]||(i[r]={});i[r][n.tileCoord.toString()]=n})}},t.prototype.forEachFeatureAtCoordinate=function(){},t.prototype.getLayer=function(){return this.layer_},t.prototype.handleImageChange_=function(n){n.target.getState()===ot.LOADED&&this.renderIfReadyAndVisible()},t.prototype.hasFeatureAtCoordinate=function(){return!1},t.prototype.loadImage=function(n){var t=n.getState();return t!=ot.LOADED&&t!=ot.ERROR&&o(n,a.CHANGE,this.handleImageChange_,this),t==ot.IDLE&&(n.load(),t=n.getState()),t==ot.LOADED},t.prototype.renderIfReadyAndVisible=function(){var n=this.getLayer();n.getVisible()&&n.getSourceState()==pi.READY&&this.changed()},t.prototype.scheduleExpireCache=function(n,t){if(t.canExpireCache()){var i=function(n,t,i){var r=y(n);r in i.usedTiles&&n.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,t);n.postRenderFunctions.push(i)}},t.prototype.updateUsedTiles=function(n,t,i,r){var u=y(t),f=i.toString();u in n?f in n[u]?n[u][f].extend(r):n[u][f]=r:(n[u]={},n[u][f]=r)},t.prototype.manageTilePyramid=function(n,t,i,r,u,f,e,o,s,h){var b=y(t),a,v,d,p,w,l,g,k;for((b in n.wantedTiles)||(n.wantedTiles[b]={}),g=n.wantedTiles[b],k=n.tileQueue,l=i.getMinZoom();l<=e;++l)for(v=i.getTileRangeForExtentAndZ(f,l,v),d=i.getResolution(l),p=v.minX;p<=v.maxX;++p)for(w=v.minY;w<=v.maxY;++w)e-l<=o?((a=t.getTile(l,p,w,r,u)).getState()==c.IDLE&&(g[a.getKey()]=!0,k.isKeyQueued(a.getKey())||k.enqueue([a,b,i.getTileCoordCenter(a.tileCoord),d])),void 0!==s&&s.call(h,a)):t.useTile(l,p,w,u)},t}(kk),fst=function(n){function t(t){n.call(this,t);this.renderedResolution;this.transform_=[1,0,0,1,0,0]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clip=function(n,t,i){var r=t.pixelRatio,s=t.size[0]*r,h=t.size[1]*r,c=t.viewState.rotation,u=bf(i),f=ao(i),e=fh(i),o=de(i);wr(t.coordinateToPixelTransform,u);wr(t.coordinateToPixelTransform,f);wr(t.coordinateToPixelTransform,e);wr(t.coordinateToPixelTransform,o);n.save();to(n,-c,s/2,h/2);n.beginPath();n.moveTo(u[0]*r,u[1]*r);n.lineTo(f[0]*r,f[1]*r);n.lineTo(e[0]*r,e[1]*r);n.lineTo(o[0]*r,o[1]*r);n.clip();to(n,c,s/2,h/2)},t.prototype.dispatchComposeEvent_=function(n,t,i,r){var u=this.getLayer();if(u.hasListener(n)){var f=i.size[0]*i.pixelRatio,e=i.size[1]*i.pixelRatio,o=i.viewState.rotation;to(t,-o,f/2,e/2);var s=void 0!==r?r:this.getTransform(i,0),h=new cn(t,i.pixelRatio,i.extent,s,i.viewState.rotation),c=new pw(n,h,i,t,null);u.dispatchEvent(c);to(t,o,f/2,e/2)}},t.prototype.forEachLayerAtCoordinate=function(n,t,i,r,u){if(this.forEachFeatureAtCoordinate(n,t,i,bu))return r.call(u,this.getLayer(),null)},t.prototype.postCompose=function(n,t,i,r){this.dispatchComposeEvent_(gr.POSTCOMPOSE,n,t,r)},t.prototype.preCompose=function(n,t,i){this.dispatchComposeEvent_(gr.PRECOMPOSE,n,t,i)},t.prototype.dispatchRenderEvent=function(n,t,i){this.dispatchComposeEvent_(gr.RENDER,n,t,i)},t.prototype.getTransform=function(n,t){var i=n.viewState,r=n.pixelRatio,f=r*n.size[0]/2,e=r*n.size[1]/2,u=r/i.resolution,o=-u,s=-i.rotation,h=-i.center[0]+t,c=-i.center[1];return cu(this.transform_,f,e,u,o,s,h,c)},t.prototype.composeFrame=function(){p()},t.prototype.prepareFrame=function(){return p()},t}(ust),est=function(n){function t(t){n.call(this,t);this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0];this.hitCanvasContext_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.composeFrame=function(n,t,i){var r,u,e,f,o;if(this.preCompose(i,n),r=this.getImage(),r){u=t.extent;e=void 0!==u&&!lr(u,n.extent)&&dt(u,n.extent);e&&this.clip(i,n,u);f=this.getImageTransform();o=i.globalAlpha;i.globalAlpha=t.opacity;var c=f[4],l=f[5],s=r.width*f[0],h=r.height*f[3];s>=.5&&h>=.5&&i.drawImage(r,0,0,+r.width,+r.height,Math.round(c),Math.round(l),Math.round(s),Math.round(h));i.globalAlpha=o;e&&i.restore()}this.postCompose(i,n,t)},t.prototype.getImage=function(){return p()},t.prototype.getImageTransform=function(){return p()},t.prototype.forEachLayerAtCoordinate=function(n,t,i,r,u){var f,e;if(this.getImage())return f=wr(this.coordinateToCanvasPixelTransform,n.slice()),gd(f,t.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=kt(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),f[0],f[1],1,1,0,0,1,1),e=this.hitCanvasContext_.getImageData(0,0,1,1).data,e[3]>0?r.call(u,this.getLayer(),e):void 0},t}(fst),dw=function(n){function t(i){var r,f,u;if(n.call(this,i),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,i.getType()===kr.VECTOR)for(r=0,f=kw.length;r<f;++r)if(u=kw[r],u!==t&&u.handles(i)){this.vectorRenderer_=new u(i);break}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.vectorRenderer_&&this.vectorRenderer_.dispose();n.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.image_?this.image_.getImage():null},t.prototype.getImageTransform=function(){return this.imageTransform_},t.prototype.prepareFrame=function(n,t){var r,i=n.pixelRatio,s=n.size,y=n.viewState,h=y.center,u=y.resolution,tt=this.getLayer().getSource(),p=n.viewHints,e=this.vectorRenderer_,f=n.extent,w,c;if(e||void 0===t.extent||(f=of(f,t.extent)),!p[lu]&&!p[oi]&&!eh(f)){if(w=y.projection,c=this.skippedFeatures_,e){var l=e.context,o=nt({},n,{size:[wt(f)/u,ti(f)/u],viewState:nt({},n.viewState,{rotation:0})}),b=Object.keys(o.skippedFeatureUids).sort();r=new en(f,u,i,l.canvas,function(n){e.prepareFrame(o,t)&&(e.replayGroupChanged||!uf(c,b))&&(l.canvas.width=o.size[0]*i,l.canvas.height=o.size[1]*i,e.compose(l,o,t),c=b,n())})}else r=tt.getImage(f,u,i,w);r&&this.loadImage(r)&&(this.image_=r,this.skippedFeatures_=c)}if(this.image_){var k=(r=this.image_).getExtent(),a=r.getResolution(),v=r.getPixelRatio(),d=i*a/(u*v),g=cu(this.imageTransform_,i*s[0]/2,i*s[1]/2,d,d,0,v*(k[0]-h[0])/a,v*(h[1]-k[3])/a);cu(this.coordinateToCanvasPixelTransform,i*s[0]/2-g[4],i*s[1]/2-g[5],i/u,-i/u,0,-h[0],-h[1]);this.renderedResolution=a*i/v}return!!this.image_},t.prototype.forEachFeatureAtCoordinate=function(t,i,r,u){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,r,u):n.prototype.forEachFeatureAtCoordinate.call(this,t,i,r,u)},t}(est);dw.handles=function(n){return n.getType()===kr.IMAGE||n.getType()===kr.VECTOR&&n.getRenderMode()===wot.IMAGE};dw.create=function(n,t){return new dw(t)};ov=dw;af=function(n,t,i,r){this.minX=n;this.maxX=t;this.minY=i;this.maxY=r};af.prototype.contains=function(n){return this.containsXY(n[1],n[2])};af.prototype.containsTileRange=function(n){return this.minX<=n.minX&&n.maxX<=this.maxX&&this.minY<=n.minY&&n.maxY<=this.maxY};af.prototype.containsXY=function(n,t){return this.minX<=n&&n<=this.maxX&&this.minY<=t&&t<=this.maxY};af.prototype.equals=function(n){return this.minX==n.minX&&this.minY==n.minY&&this.maxX==n.maxX&&this.maxY==n.maxY};af.prototype.extend=function(n){n.minX<this.minX&&(this.minX=n.minX);n.maxX>this.maxX&&(this.maxX=n.maxX);n.minY<this.minY&&(this.minY=n.minY);n.maxY>this.maxY&&(this.maxY=n.maxY)};af.prototype.getHeight=function(){return this.maxY-this.minY+1};af.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};af.prototype.getWidth=function(){return this.maxX-this.minX+1};af.prototype.intersects=function(n){return this.minX<=n.maxX&&this.maxX>=n.minX&&this.minY<=n.maxY&&this.maxY>=n.minY};gw=af;sl=function(n){function t(t,i){n.call(this,t);this.context=i?null:kt();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 gw(0,0,0,0);this.imageTransform_=[1,0,0,1,0,0];this.zDirection=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isDrawableTile_=function(n){var i=this.getLayer(),t=n.getState(),r=i.getUseInterimTilesOnError();return t==c.LOADED||t==c.EMPTY||t==c.ERROR&&!r},t.prototype.getTile=function(n,t,i,r,u){var e=this.getLayer(),f=e.getSource().getTile(n,t,i,r,u);return f.getState()==c.ERROR&&(e.getUseInterimTilesOnError()?e.getPreload()>0&&(this.newTiles_=!0):f.setState(c.LOADED)),this.isDrawableTile_(f)||(f=f.getInterimTile()),f},t.prototype.prepareFrame=function(n,t){var i=n.pixelRatio,g=n.size,et=n.viewState,h=et.projection,w=et.resolution,nt=et.center,kt=this.getLayer(),e=kt.getSource(),dt=e.getRevision(),o=e.getTileGridForProjection(h),u=o.getZForResolution(w,this.zDirection),l=o.getResolution(u),f=Math.round(w/l)||1,a=n.extent,ht,ii,ct,lt,ri,it,yt,pt,d,ut,fi,ei,si,hi,ci,li,ft,ai,wt,bt;if(void 0!==t.extent&&(a=of(a,t.extent)),eh(a))return!1;var s=o.getTileRangeForExtentAndZ(a,u),tt=o.getTileRangeExtent(u,s),b=e.getTilePixelRatio(i),k={};k[u]={};var r,v,p,gt=this.createLoadedTileFinder(e,h,k),ni=n.viewHints,ot=ni[lu]||ni[oi],st=this.tmpExtent,ti=this.tmpTileRange_;for(this.newTiles_=!1,v=s.minX;v<=s.maxX;++v)for(p=s.minY;p<=s.maxY;++p)if(!(Date.now()-n.time>16&&ot)){if((r=this.getTile(u,v,p,i,h),this.isDrawableTile_(r))&&(ht=y(this),r.getState()==c.LOADED&&(k[u][r.tileCoord.toString()]=r,ii=r.inTransition(ht),this.newTiles_||!ii&&-1!==this.renderedTiles.indexOf(r)||(this.newTiles_=!0)),1===r.getAlpha(ht,n.time)))continue;ct=o.getTileCoordChildTileRange(r.tileCoord,ti,st);lt=!1;ct&&(lt=gt(u+1,ct));lt||o.forEachTileCoordParentTileRange(r.tileCoord,gt,null,ti,st)}if(ri=l*i/b*f,!(this.renderedResolution&&Date.now()-n.time>16&&ot)&&(this.newTiles_||!this.renderedExtent_||!lr(this.renderedExtent_,a)||this.renderedRevision!=dt||f!=this.oversampling_||!ot&&ri!=this.renderedResolution)){if(it=this.context,it){var ui=e.getTilePixelSize(u,i,h),at=Math.round(s.getWidth()*ui[0]/f),vt=Math.round(s.getHeight()*ui[1]/f),rt=it.canvas;rt.width!=at||rt.height!=vt?(this.oversampling_=f,rt.width=at,rt.height=vt):(this.renderedExtent_&&!oe(tt,this.renderedExtent_)&&it.clearRect(0,0,at,vt),f=this.oversampling_)}for(this.renderedTiles.length=0,ft=Object.keys(k).map(Number),ft.sort(function(n,t){return n===u?1:t===u?-1:n>t?1:n<t?-1:0}),ut=0,fi=ft.length;ut<fi;++ut)for(ai in d=ft[ut],pt=e.getTilePixelSize(d,i,h),yt=o.getResolution(d)/l,si=b*e.getGutterForProjection(h),hi=k[d])r=hi[ai],v=((ei=o.getTileCoordExtent(r.getTileCoord(),st))[0]-tt[0])/l*b/f,p=(tt[3]-ei[3])/l*b/f,ci=pt[0]*yt/f,li=pt[1]*yt/f,this.drawTileImage(r,n,t,v,p,ci,li,si,u===d),this.renderedTiles.push(r);this.renderedRevision=dt;this.renderedResolution=l*i/b*f;this.renderedExtent_=tt}return wt=this.renderedResolution/w,bt=cu(this.imageTransform_,i*g[0]/2,i*g[1]/2,wt,wt,0,(this.renderedExtent_[0]-nt[0])/this.renderedResolution*i,(nt[1]-this.renderedExtent_[3])/this.renderedResolution*i),cu(this.coordinateToCanvasPixelTransform,i*g[0]/2-bt[4],i*g[1]/2-bt[5],i/w,-i/w,0,-nt[0],-nt[1]),this.updateUsedTiles(n.usedTiles,e,u,s),this.manageTilePyramid(n,e,o,i,h,a,u,kt.getPreload()),this.scheduleExpireCache(n,e),this.renderedTiles.length>0},t.prototype.drawTileImage=function(n,t,i,r,u,f,e,o,s){var h=this.getTileImage(n),l;if(h){var a=y(this),c=s?n.getAlpha(a,t.time):1,v=this.getLayer().getSource();1!==c||v.getOpaque(t.viewState.projection)||this.context.clearRect(r,u,f,e);l=c!==this.context.globalAlpha;l&&(this.context.save(),this.context.globalAlpha=c);this.context.drawImage(h,o,o,h.width-2*o,h.height-2*o,r,u,f,e);l&&this.context.restore();1!==c?t.animate=!0:s&&n.endTransition(a)}},t.prototype.getImage=function(){var n=this.context;return n?n.canvas:null},t.prototype.getImageTransform=function(){return this.imageTransform_},t.prototype.getTileImage=function(n){return n.getImage()},t}(est);sl.handles=function(n){return n.getType()===kr.TILE};sl.create=function(n,t){return new sl(t)};sl.prototype.getLayer;var sv=sl,bgt=i(0),an=i.n(bgt),nb=function(){};nb.prototype.getReplay=function(){return p()};nb.prototype.isEmpty=function(){return p()};nb.prototype.addDeclutter=function(){return p()};vn=nb;ft={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var hv={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},tb=[hv.FILL],us=[hv.STROKE],nc=[hv.BEGIN_PATH],ost=[hv.CLOSE_PATH],st=hv,fs=[ft.POLYGON,ft.CIRCLE,ft.LINE_STRING,ft.IMAGE,ft.TEXT,ft.DEFAULT],tc={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},re=[1/0,1/0,-1/0,-1/0],cv=[1,0,0,1,0,0],lv=function(n){function t(t,i,r,u,f,e){n.call(this);this.declutterTree=e;this.tolerance=t;this.maxExtent=i;this.overlaps=f;this.pixelRatio=u;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.replayTextBackground_=function(n,t,i,r,u,f,e){n.beginPath();n.moveTo.apply(n,t);n.lineTo.apply(n,i);n.lineTo.apply(n,r);n.lineTo.apply(n,u);n.lineTo.apply(n,t);f&&(this.alignFill_=f[2],this.fill_(n));e&&(this.setStrokeStyle_(n,e),n.stroke())},t.prototype.replayImage_=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){var et=w||b,g,lt,at,ft;t-=u*=a;i-=f*=a;var nt,tt,it,rt,ot=y+h>r.width?r.width-h:y,st=o+c>r.height?r.height-c:o,ht=p[3]+ot*a+p[1],ct=p[0]+st*a+p[2],k=t-p[3],d=i-p[0];(et||0!==l)&&(nt=[k,d],tt=[k+ht,d],it=[k+ht,d+ct],rt=[k,d+ct]);g=null;0!==l?(lt=t+u,at=i+f,g=cu(cv,lt,at,1,1,l,-lt,-at),rh(re),se(re,wr(cv,nt)),se(re,wr(cv,tt)),se(re,wr(cv,it)),se(re,wr(cv,rt))):ef(k,d,k+ht,d+ct,re);var yt=n.canvas,ut=b?b[2]*a/2:0,vt=re[0]-ut<=yt.width&&re[2]+ut>=0&&re[1]-ut<=yt.height&&re[3]+ut>=0;if(v&&(t=Math.round(t),i=Math.round(i)),e){if(!vt&&1==e[4])return;rp(e,re);ft=vt?[n,g?g.slice(0):null,s,r,h,c,ot,st,t,i,a]:null;ft&&et&&ft.push(w,b,nt,tt,it,rt);e.push(ft)}else vt&&(et&&this.replayTextBackground_(n,nt,tt,it,rt,w,b),got(n,g,s,r,h,c,ot,st,t,i,a))},t.prototype.applyPixelRatio=function(n){var t=this.pixelRatio;return 1==t?n:n.map(function(n){return n*t})},t.prototype.appendFlatCoordinates=function(n,t,i,r,u,f){var e=this.coordinates.length,v=this.getBufferedMaxExtent();f&&(t+=r);for(var a,l,h=[n[t],n[t+1]],o=[NaN,NaN],c=!0,s=t+r;s<i;s+=r)o[0]=n[s],o[1]=n[s+1],(l=nd(v,o))!==a?(c&&(this.coordinates[e++]=h[0],this.coordinates[e++]=h[1]),this.coordinates[e++]=o[0],this.coordinates[e++]=o[1],c=!1):l===ir.INTERSECTING?(this.coordinates[e++]=o[0],this.coordinates[e++]=o[1],c=!1):c=!0,h[0]=o[0],h[1]=o[1],a=l;return(u&&c||s===t+r)&&(this.coordinates[e++]=h[0],this.coordinates[e++]=h[1]),e},t.prototype.drawCustomCoordinates_=function(n,t,i,r,u){for(var e,s,f=0,o=i.length;f<o;++f)e=i[f],s=this.appendFlatCoordinates(n,t,e,r,!1,!1),u.push(s),t=e;return t},t.prototype.drawCustom=function(n,t,i){var v,h,p,y;this.beginGeometry(n,t);var r,e,c,l,o,u=n.getType(),a=n.getStride(),s=this.coordinates.length;if(u==f.MULTI_POLYGON){for(r=(n=n).getOrientedFlatCoordinates(),l=[],v=n.getEndss(),o=0,h=0,p=v.length;h<p;++h)y=[],o=this.drawCustomCoordinates_(r,o,v[h],a,y),l.push(y);this.instructions.push([st.CUSTOM,s,l,n,i,uft])}else u==f.POLYGON||u==f.MULTI_LINE_STRING?(c=[],r=u==f.POLYGON?n.getOrientedFlatCoordinates():n.getFlatCoordinates(),o=this.drawCustomCoordinates_(r,0,n.getEnds(),a,c),this.instructions.push([st.CUSTOM,s,c,n,i,pp])):u==f.LINE_STRING||u==f.MULTI_POINT?(r=n.getFlatCoordinates(),e=this.appendFlatCoordinates(r,0,r.length,a,!1,!1),this.instructions.push([st.CUSTOM,s,e,n,i,gc])):u==f.POINT&&(r=n.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),e=this.coordinates.length,this.instructions.push([st.CUSTOM,s,e,n,i]));this.endGeometry(n,t)},t.prototype.beginGeometry=function(n,t){this.beginGeometryInstruction1_=[st.BEGIN_GEOMETRY,t,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[st.BEGIN_GEOMETRY,t,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(n){if(this.alignFill_){var t=wr(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;n.translate(t[0]%i,t[1]%i);n.rotate(this.viewRotation_)}n.fill();this.alignFill_&&n.setTransform.apply(n,hn)},t.prototype.setStrokeStyle_=function(n,t){n.strokeStyle=t[1];n.lineWidth=t[2];n.lineCap=t[3];n.lineJoin=t[4];n.miterLimit=t[5];il&&(n.lineDashOffset=t[7],n.setLineDash(t[6]))},t.prototype.renderDeclutter_=function(n,t){var u,f,r,e,i;if(n&&n.length>5&&(u=n[4],1==u||u==n.length-5)){if(f={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:t},!this.declutterTree.collides(f))for(this.declutterTree.insert(f),r=5,e=n.length;r<e;++r)i=n[r],i&&(i.length>11&&this.replayTextBackground_(i[0],i[13],i[14],i[15],i[16],i[11],i[12]),got.apply(void 0,i));n.length=5;rh(n)}},t.prototype.replay_=function(n,t,i,r,u,f,e){var c,o,it,ri;this.pixelCoordinates_&&uf(t,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=vo(this.coordinates,0,this.coordinates.length,2,t,this.pixelCoordinates_),gut(this.renderedTransform_,t));for(var b,g,nt,rt,ut,ft,tt,k,ui,p,et,ht,rr=!wu(i),h=0,ur=r.length,s=0,d=0,v=0,fi=null,ei=null,vt=this.coordinateCache_,oi=this.viewRotation_,yt={context:n,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:oi},ct=this.instructions!=r||this.overlaps?0:200;h<ur;){o=r[h];switch(o[0]){case st.BEGIN_GEOMETRY:p=o[1];rr&&i[y(p)]||!p.getGeometry()?h=o[2]:void 0===e||dt(e,p.getGeometry().getExtent())?++h:h=o[2]+1;break;case st.BEGIN_PATH:d>ct&&(this.fill_(n),d=0);v>ct&&(n.stroke(),v=0);d||v||(n.beginPath(),rt=ut=NaN);++h;break;case st.CIRCLE:var pt=c[s=o[1]],wt=c[s+1],si=c[s+2]-pt,hi=c[s+3]-wt,ci=Math.sqrt(si*si+hi*hi);n.moveTo(pt+ci,wt);n.arc(pt,wt,ci,0,2*Math.PI,!0);++h;break;case st.CLOSE_PATH:n.closePath();++h;break;case st.CUSTOM:s=o[1];b=o[2];var fr=o[3],er=o[4],li=6==o.length?o[5]:void 0;yt.geometry=fr;yt.feature=p;h in vt||(vt[h]=[]);it=vt[h];li?li(c,s,b,2,it):(it[0]=c[s],it[1]=c[s+1],it.length=2);er(it,yt);++h;break;case st.DRAW_IMAGE:s=o[1];b=o[2];ui=o[3];g=o[4];nt=o[5];k=f?null:o[6];var or=o[7],sr=o[8],hr=o[9],cr=o[10],lr=o[11],ai=o[12],ar=o[13],vr=o[14],bt=void 0,kt=void 0,gt=void 0;for(o.length>16?(bt=o[15],kt=o[16],gt=o[17]):(bt=el,kt=gt=!1),lr&&(ai+=oi);s<b;s+=2)this.replayImage_(n,c[s],c[s+1],ui,g,nt,k,or,sr,hr,cr,ai,ar,u,vr,bt,kt?fi:null,gt?ei:null);this.renderDeclutter_(k,p);++h;break;case st.DRAW_CHARS:var vi=o[1],yi=o[2],ni=o[3];k=f?null:o[4];var yr=o[5],pi=o[6],pr=o[7],wi=o[8],bi=o[9],ki=o[10],di=o[11],gi=o[12],ti=o[13],nr=o[14],tr=kft(c,vi,yi,2),ir=wi(gi);if(yr||ir<=tr){var ii=this,wr=ii.textStates[ti].textAlign,ot=kgt(c,vi,yi,2,gi,wi,(tr-ir)*tc[wr],pr);if(ot){var w=void 0,lt=void 0,at=void 0,l=void 0,a=void 0;if(ki)for(w=0,lt=ot.length;w<lt;++w)at=(a=ot[w])[4],l=ii.getImage(at,ti,"",ki),g=a[2]+di,nt=ni*l.height+2*(.5-ni)*di-bi,this.replayImage_(n,a[0],a[1],l,g,nt,k,l.height,1,0,0,a[3],nr,!1,l.width,el,null,null);if(pi)for(w=0,lt=ot.length;w<lt;++w)at=(a=ot[w])[4],l=ii.getImage(at,ti,pi,""),g=a[2],nt=ni*l.height-bi,this.replayImage_(n,a[0],a[1],l,g,nt,k,l.height,1,0,0,a[3],nr,!1,l.width,el,null,null)}}this.renderDeclutter_(k,p);++h;break;case st.END_GEOMETRY:if(void 0!==f&&(ri=f(p=o[1]),ri))return ri;++h;break;case st.FILL:ct?d++:this.fill_(n);++h;break;case st.MOVE_TO_LINE_TO:for(s=o[1],b=o[2],et=c[s],tt=(ht=c[s+1])+.5|0,(ft=et+.5|0)===rt&&tt===ut||(n.moveTo(et,ht),rt=ft,ut=tt),s+=2;s<b;s+=2)ft=(et=c[s])+.5|0,tt=(ht=c[s+1])+.5|0,s!=b-2&&ft===rt&&tt===ut||(n.lineTo(et,ht),rt=ft,ut=tt);++h;break;case st.SET_FILL_STYLE:fi=o;this.alignFill_=o[2];d&&(this.fill_(n),d=0,v&&(n.stroke(),v=0));n.fillStyle=o[1];++h;break;case st.SET_STROKE_STYLE:ei=o;v&&(n.stroke(),v=0);this.setStrokeStyle_(n,o);++h;break;case st.STROKE:ct?v++:n.stroke();++h;break;default:++h}}d&&this.fill_(n);v&&n.stroke()},t.prototype.replay=function(n,t,i,r,u){this.viewRotation_=i;this.replay_(n,t,r,this.instructions,u,void 0,void 0)},t.prototype.replayHitDetection=function(n,t,i,r,u,f){return this.viewRotation_=i,this.replay_(n,t,r,this.hitDetectionInstructions,!0,u,f)},t.prototype.reverseHitDetectionInstructions=function(){var n,i=this.hitDetectionInstructions,r,u,f,t;for(i.reverse(),f=i.length,t=-1,n=0;n<f;++n)(u=(r=i[n])[0])==st.END_GEOMETRY?t=n:u==st.BEGIN_GEOMETRY&&(r[2]=n,fbt(this.hitDetectionInstructions,t,n),t=-1)},t.prototype.setFillStrokeStyle=function(n,t){var i=this.state,s,h,r,u,c,f,e,o;n?(s=n.getColor(),i.fillStyle=du(s||no)):i.fillStyle=void 0;t?(h=t.getColor(),i.strokeStyle=du(h||uv),r=t.getLineCap(),i.lineCap=void 0!==r?r:"round",u=t.getLineDash(),i.lineDash=u?u.slice():ww,c=t.getLineDashOffset(),i.lineDashOffset=c||0,f=t.getLineJoin(),i.lineJoin=void 0!==f?f:"round",e=t.getWidth(),i.lineWidth=void 0!==e?e:1,o=t.getMiterLimit(),i.miterLimit=void 0!==o?o:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)):(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)},t.prototype.createFill=function(n){var t=n.fillStyle,i=[st.SET_FILL_STYLE,t];return"string"!=typeof t&&i.push(!0),i},t.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},t.prototype.createStroke=function(n){return[st.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(n,t,i){var r=n.fillStyle;"string"==typeof r&&n.currentFillStyle==r||(void 0!==r&&this.instructions.push(t.call(this,n,i)),n.currentFillStyle=r)},t.prototype.updateStrokeStyle=function(n,t){var i=n.strokeStyle,u=n.lineCap,r=n.lineDash,f=n.lineDashOffset,e=n.lineJoin,o=n.lineWidth,s=n.miterLimit;n.currentStrokeStyle==i&&n.currentLineCap==u&&(r==n.currentLineDash||uf(n.currentLineDash,r))&&n.currentLineDashOffset==f&&n.currentLineJoin==e&&n.currentLineWidth==o&&n.currentMiterLimit==s||(void 0!==i&&t.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=u,n.currentLineDash=r,n.currentLineDashOffset=f,n.currentLineJoin=e,n.currentLineWidth=o,n.currentMiterLimit=s)},t.prototype.endGeometry=function(n,t){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var i=[st.END_GEOMETRY,t];this.instructions.push(i);this.hitDetectionInstructions.push(i)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=fut(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;ff(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(fv),dgt=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,r,u,f,e);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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(n,t,i,r){return this.appendFlatCoordinates(n,t,i,r,!1,!1)},t.prototype.drawPoint=function(n,t){if(this.image_){this.beginGeometry(n,t);var i=n.getFlatCoordinates(),f=n.getStride(),r=this.coordinates.length,u=this.drawCoordinates_(i,0,i.length,f);this.instructions.push([st.DRAW_IMAGE,r,u,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([st.DRAW_IMAGE,r,u,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(n,t)}},t.prototype.drawMultiPoint=function(n,t){if(this.image_){this.beginGeometry(n,t);var i=n.getFlatCoordinates(),f=n.getStride(),r=this.coordinates.length,u=this.drawCoordinates_(i,0,i.length,f);this.instructions.push([st.DRAW_IMAGE,r,u,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([st.DRAW_IMAGE,r,u,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(n,t)}},t.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},t.prototype.setImageStyle=function(n,t){var i=n.getAnchor(),r=n.getSize(),f=n.getHitDetectionImage(1),e=n.getImage(1),u=n.getOrigin();this.anchorX_=i[0];this.anchorY_=i[1];this.declutterGroup_=t;this.hitDetectionImage_=f;this.image_=e;this.height_=r[1];this.opacity_=n.getOpacity();this.originX_=u[0];this.originY_=u[1];this.rotateWithView_=n.getRotateWithView();this.rotation_=n.getRotation();this.scale_=n.getScale();this.width_=r[0]},t}(lv),ggt=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,r,u,f,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinates_=function(n,t,i,r){var f=this.coordinates.length,e=this.appendFlatCoordinates(n,t,i,r,!1,!1),u=[st.MOVE_TO_LINE_TO,f,e];return this.instructions.push(u),this.hitDetectionInstructions.push(u),i},t.prototype.drawLineString=function(n,t){var i=this.state,f=i.strokeStyle,e=i.lineWidth,r,u;void 0!==f&&void 0!==e&&(this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,t),this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],nc),r=n.getFlatCoordinates(),u=n.getStride(),this.drawFlatCoordinates_(r,0,r.length,u),this.hitDetectionInstructions.push(us),this.endGeometry(n,t))},t.prototype.drawMultiLineString=function(n,t){var i=this.state,e=i.strokeStyle,o=i.lineWidth;if(void 0!==e&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke);this.beginGeometry(n,t);this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],nc);for(var u=n.getEnds(),s=n.getFlatCoordinates(),h=n.getStride(),f=0,r=0,c=u.length;r<c;++r)f=this.drawFlatCoordinates_(s,f,u[r],h);this.hitDetectionInstructions.push(us);this.endGeometry(n,t)}},t.prototype.finish=function(){var n=this.state;void 0!=n.lastStroke&&n.lastStroke!=this.coordinates.length&&this.instructions.push(us);this.reverseHitDetectionInstructions();this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(us),t.lastStroke=this.coordinates.length);t.lastStroke=0;n.prototype.applyStroke.call(this,t);this.instructions.push(nc)},t}(lv),sst=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,r,u,f,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinatess_=function(n,t,i,r){var e=this.state,h=void 0!==e.fillStyle,f=void 0!=e.strokeStyle,c=i.length,u;for(this.instructions.push(nc),this.hitDetectionInstructions.push(nc),u=0;u<c;++u){var o=i[u],l=this.coordinates.length,a=this.appendFlatCoordinates(n,t,o,r,!0,!f),s=[st.MOVE_TO_LINE_TO,l,a];this.instructions.push(s);this.hitDetectionInstructions.push(s);f&&(this.instructions.push(ost),this.hitDetectionInstructions.push(ost));t=o}return h&&(this.instructions.push(tb),this.hitDetectionInstructions.push(tb)),f&&(this.instructions.push(us),this.hitDetectionInstructions.push(us)),t},t.prototype.drawCircle=function(n,t){var i=this.state,f=i.fillStyle,e=i.strokeStyle,r;if(void 0!==f||void 0!==e){this.setFillStrokeStyles_(n);this.beginGeometry(n,t);void 0!==i.fillStyle&&this.hitDetectionInstructions.push([st.SET_FILL_STYLE,vh(no)]);void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var u=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(u,0,u.length,o,!1,!1);r=[st.CIRCLE,s];this.instructions.push(nc,r);this.hitDetectionInstructions.push(nc,r);this.hitDetectionInstructions.push(tb);void 0!==i.fillStyle&&this.instructions.push(tb);void 0!==i.strokeStyle&&(this.instructions.push(us),this.hitDetectionInstructions.push(us));this.endGeometry(n,t)}},t.prototype.drawPolygon=function(n,t){var i=this.state,r=i.fillStyle,u=i.strokeStyle;if(void 0!==r||void 0!==u){this.setFillStrokeStyles_(n);this.beginGeometry(n,t);void 0!==i.fillStyle&&this.hitDetectionInstructions.push([st.SET_FILL_STYLE,vh(no)]);void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var f=n.getEnds(),e=n.getOrientedFlatCoordinates(),o=n.getStride();this.drawFlatCoordinatess_(e,0,f,o);this.endGeometry(n,t)}},t.prototype.drawMultiPolygon=function(n,t){var i=this.state,e=i.fillStyle,o=i.strokeStyle;if(void 0!==e||void 0!==o){this.setFillStrokeStyles_(n);this.beginGeometry(n,t);void 0!==i.fillStyle&&this.hitDetectionInstructions.push([st.SET_FILL_STYLE,vh(no)]);void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var u=n.getEndss(),s=n.getOrientedFlatCoordinates(),h=n.getStride(),f=0,r=0,c=u.length;r<c;++r)f=this.drawFlatCoordinatess_(s,f,u[r],h);this.endGeometry(n,t)}},t.prototype.finish=function(){var t;if(this.reverseHitDetectionInstructions(),this.state=null,t=this.tolerance,0!==t)for(var i=this.coordinates,n=0,r=i.length;n<r;++n)i[n]=ch(i[n],t)},t.prototype.setFillStrokeStyles_=function(n){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill,n);void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},t}(lv);var tnt={Circle:sst,Default:lv,Image:dgt,LineString:ggt,Polygon:sst,Text:function(n){function t(t,i,r,u,f,e){n.call(this,t,i,r,u,f,e);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_={};ve.prune()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawText=function(n,t){var g=this.textFillState_,nt=this.textStrokeState_,u=this.textState_,o,p,b,k,d,l;if(""!==this.text_&&u&&(g||nt)){var i,a,y=this.coordinates.length,s=n.getType(),r=null,e=2,h=2;if(u.placement===okt){if(!dt(this.getBufferedMaxExtent(),n.getExtent()))return;if(r=n.getFlatCoordinates(),h=n.getStride(),s==f.LINE_STRING)o=[r.length];else if(s==f.MULTI_LINE_STRING)o=n.getEnds();else if(s==f.POLYGON)o=n.getEnds().slice(0,1);else if(s==f.MULTI_POLYGON)for(p=n.getEndss(),o=[],i=0,a=p.length;i<a;++i)o.push(p[i][0]);this.beginGeometry(n,t);for(var w,tt=u.textAlign,v=0,c=0,it=o.length;c<it;++c){for(void 0==tt?(b=nnt(u.maxAngle,r,v,o[c],h),v=b[0],w=b[1]):w=o[c],i=v;i<w;i+=h)this.coordinates.push(r[i],r[i+1]);e=this.coordinates.length;v=o[c];this.drawChars_(y,e,this.declutterGroup_);y=e}this.endGeometry(n,t)}else{k=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_);d=k.width/this.pixelRatio;switch(s){case f.POINT:case f.MULTI_POINT:e=(r=n.getFlatCoordinates()).length;break;case f.LINE_STRING:r=n.getFlatMidpoint();break;case f.CIRCLE:r=n.getCenter();break;case f.MULTI_LINE_STRING:e=(r=n.getFlatMidpoints()).length;break;case f.POLYGON:if(r=n.getFlatInteriorPoint(),!u.overflow&&r[2]/this.resolution<d)return;h=3;break;case f.MULTI_POLYGON:for(l=n.getFlatInteriorPoints(),r=[],i=0,a=l.length;i<a;i+=3)(u.overflow||l[i+2]/this.resolution>=d)&&r.push(l[i],l[i+1]);if(0==(e=r.length))return}e=this.appendFlatCoordinates(r,0,e,h,!1,!1);(u.backgroundFill||u.backgroundStroke)&&(this.setFillStrokeStyle(u.backgroundFill,u.backgroundStroke),u.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,n),this.hitDetectionInstructions.push(this.createFill(this.state,n))),u.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state))));this.beginGeometry(n,t);this.drawTextImage_(k,y,e);this.endGeometry(n,t)}}},t.prototype.getImage=function(n,t,i,r){var v,y=r+t+n+i+this.pixelRatio,f,a,b;if(!ve.containsKey(y)){var e=r?this.strokeStates[r]||this.textStrokeState_:null,d=i?this.fillStates[i]||this.textFillState_:null,h=this.textStates[t]||this.textState_,g=this.pixelRatio,o=h.scale*g,k=tc[h.textAlign||"center"],s=r&&e.lineWidth?e.lineWidth:0,l=n.split("\n"),p=l.length,w=[],nt=function(n,t,i){for(var f,e=t.length,r=0,u=0;u<e;++u)f=sn(n,t[u]),r=Math.max(r,f),i.push(f);return r}(h.font,l,w),c=dot(h.font),tt=c*p,it=nt+s,u=kt(Math.ceil(it*o),Math.ceil((tt+s)*o));if(v=u.canvas,ve.set(y,v),1!=o&&u.scale(o,o),u.font=h.font,r&&(u.strokeStyle=e.strokeStyle,u.lineWidth=s,u.lineCap=e.lineCap,u.lineJoin=e.lineJoin,u.miterLimit=e.miterLimit,il&&e.lineDash.length&&(u.setLineDash(e.lineDash),u.lineDashOffset=e.lineDashOffset)),i&&(u.fillStyle=d.fillStyle),u.textBaseline="middle",u.textAlign="center",a=.5-k,b=k*v.width/o+a*s,r)for(f=0;f<p;++f)u.strokeText(l[f],b+a*w[f],.5*(s+c)+f*c);if(i)for(f=0;f<p;++f)u.fillText(l[f],b+a*w[f],.5*(s+c)+f*c)}return ve.get(y)},t.prototype.drawTextImage_=function(n,t,i){var r=this.textState_,f=this.textStrokeState_,u=this.pixelRatio,e=tc[r.textAlign||"center"],o=tc[r.textBaseline],s=f&&f.lineWidth?f.lineWidth:0,h=e*n.width/u+2*(.5-e)*s,c=o*n.height/u+2*(.5-o)*s;this.instructions.push([st.DRAW_IMAGE,t,i,n,(h-this.textOffsetX_)*u,(c-this.textOffsetY_)*u,this.declutterGroup_,n.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,n.width,r.padding==el?el:r.padding.map(function(n){return n*u}),!!r.backgroundFill,!!r.backgroundStroke]);this.hitDetectionInstructions.push([st.DRAW_IMAGE,t,i,n,(h-this.textOffsetX_)*u,(c-this.textOffsetY_)*u,this.declutterGroup_,n.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/u,n.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(n,t,i){var r=this.textStrokeState_,u=this.textState_,a=this.textFillState_,o=this.strokeKey_,c,e;r&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));c=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:u.font,textAlign:u.textAlign||"center",scale:u.scale});e=this.fillKey_;a&&(e in this.fillStates||(this.fillStates[e]={fillStyle:a.fillStyle}));var s=this.pixelRatio,v=tc[u.textBaseline],y=this.textOffsetY_*s,p=this.text_,h=u.font,l=u.scale,w=r?r.lineWidth*l/2:0,f=this.widths_[h];f||(this.widths_[h]=f={});this.instructions.push([st.DRAW_CHARS,n,t,v,i,u.overflow,e,u.maxAngle,function(n){var t=f[n];return t||(t=f[n]=sn(h,n)),t*l*s},y,o,w*s,p,c,1]);this.hitDetectionInstructions.push([st.DRAW_CHARS,n,t,v,i,u.overflow,e,u.maxAngle,function(n){var t=f[n];return t||(t=f[n]=sn(h,n)),t*l},y,o,w,p,c,1/s])},t.prototype.setTextStyle=function(n,t){var r,f,i,e,u,o,s;if(n){if(this.declutterGroup_=t,e=n.getFill(),e?((f=this.textFillState_)||(f=this.textFillState_={}),f.fillStyle=du(e.getColor()||no)):f=this.textFillState_=null,u=n.getStroke(),u){(i=this.textStrokeState_)||(i=this.textStrokeState_={});var h=u.getLineDash(),c=u.getLineDashOffset(),l=u.getWidth(),a=u.getMiterLimit();i.lineCap=u.getLineCap()||"round";i.lineDash=h?h.slice():ww;i.lineDashOffset=void 0===c?0:c;i.lineJoin=u.getLineJoin()||"round";i.lineWidth=void 0===l?1:l;i.miterLimit=void 0===a?10:a;i.strokeStyle=du(u.getColor()||uv)}else i=this.textStrokeState_=null;r=this.textState_;o=n.getFont()||"10px sans-serif";pgt(o);s=n.getScale();r.overflow=n.getOverflow();r.font=o;r.maxAngle=n.getMaxAngle();r.placement=n.getPlacement();r.textAlign=n.getTextAlign();r.textBaseline=n.getTextBaseline()||"middle";r.backgroundFill=n.getBackgroundFill();r.backgroundStroke=n.getBackgroundStroke();r.padding=n.getPadding()||el;r.scale=void 0===s?1:s;var v=n.getOffsetX(),p=n.getOffsetY(),w=n.getRotateWithView(),b=n.getRotation();this.text_=n.getText()||"";this.textOffsetX_=void 0===v?0:v;this.textOffsetY_=void 0===p?0:p;this.textRotateWithView_=void 0!==w&&w;this.textRotation_=void 0===b?0:b;this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:y(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"";this.textKey_=r.font+r.scale+(r.textAlign||"?");this.fillKey_=f?"string"==typeof f.fillStyle?f.fillStyle:"|"+y(f.fillStyle):""}else this.text_=""},t}(lv)},int=function(n){function t(t,i,r,u,f,e,o){n.call(this);this.declutterTree_=e;this.declutterGroup_=null;this.tolerance_=t;this.maxExtent_=i;this.overlaps_=f;this.pixelRatio_=u;this.resolution_=r;this.renderBuffer_=o;this.replaysByZIndex_={};this.hitDetectionContext_=kt(1,1);this.hitDetectionTransform_=[1,0,0,1,0,0]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addDeclutter=function(n){var t=null;return this.declutterTree_&&(n?(t=this.declutterGroup_)[4]++:(t=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),t},t.prototype.clip=function(n,t){var i=this.getClipCoords(t);n.beginPath();n.moveTo(i[0],i[1]);n.lineTo(i[2],i[3]);n.lineTo(i[4],i[5]);n.lineTo(i[6],i[7]);n.clip()},t.prototype.hasReplays=function(n){for(var i in this.replaysByZIndex_)for(var r=this.replaysByZIndex_[i],t=0,u=n.length;t<u;++t)if(n[t]in r)return!0;return!1},t.prototype.finish=function(){var t,n,i;for(t in this.replaysByZIndex_){n=this.replaysByZIndex_[t];for(i in n)n[i].finish()}},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u,f,e){function tt(n){for(var i,r,u=s.getImageData(0,0,o,o).data,t=0;t<o;t++)for(i=0;i<o;i++)if(d[t][i]&&u[4*(i*o+t)+3]>0)return r=void 0,(!b||h!=ft.IMAGE&&h!=ft.TEXT||-1!==b.indexOf(n))&&(r=f(n)),r||void s.clearRect(0,0,o,o)}var c,o=2*(r=Math.round(r))+1,w=cu(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-n[0],-n[1]),s=this.hitDetectionContext_,b,h,d,l,a,g,v,nt,y,p,k;for(s.canvas.width!==o||s.canvas.height!==o?(s.canvas.width=o,s.canvas.height=o):s.clearRect(0,0,o,o),void 0!==this.renderBuffer_&&(se(c=[1/0,1/0,-1/0,-1/0],n),ff(c,t*(this.renderBuffer_+r),c)),d=function(n){if(void 0!==yn[n])return yn[n];for(var u=2*n+1,t=new Array(u),f=0;f<u;f++)t[f]=new Array(u);for(var i=n,r=0,e=0;i>=r;)es(t,n+i,n+r),es(t,n+r,n+i),es(t,n-r,n+i),es(t,n-i,n+r),es(t,n-i,n-r),es(t,n-r,n-i),es(t,n+r,n-i),es(t,n+i,n-r),2*((e+=1+2*++r)-i)+1>0&&(e+=1-2*(i-=1));return yn[n]=t,t}(r),this.declutterTree_&&(b=this.declutterTree_.all().map(function(n){return n.value})),y=Object.keys(this.replaysByZIndex_).map(Number),y.sort(lo),l=y.length-1;l>=0;--l)for(p=y[l].toString(),g=this.replaysByZIndex_[p],a=fs.length-1;a>=0;--a)if(void 0!==(v=g[h=fs[a]]))if(e&&(h==ft.IMAGE||h==ft.TEXT))k=e[p],k?k.push(v,w.slice(0)):e[p]=[v,w.slice(0)];else if(nt=v.replayHitDetection(s,w,i,u,tt,c))return nt},t.prototype.getClipCoords=function(n){var t=this.maxExtent_,r=t[0],u=t[1],f=t[2],e=t[3],i=[r,u,r,e,f,e,f,u];return vo(i,0,8,2,n,i),i},t.prototype.getReplay=function(n,t){var u=void 0!==n?n.toString():"0",i=this.replaysByZIndex_[u],r;return void 0===i&&(i={},this.replaysByZIndex_[u]=i),r=i[t],void 0===r&&(r=new tnt[t](this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),i[t]=r),r},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return wu(this.replaysByZIndex_)},t.prototype.replay=function(n,t,i,r,u,f,e){var a=Object.keys(this.replaysByZIndex_).map(Number),s,p,h,w,b,o,v,c,l,y;for(a.sort(lo),n.save(),this.clip(n,t),v=f||fs,s=0,p=a.length;s<p;++s)for(c=a[s].toString(),b=this.replaysByZIndex_[c],h=0,w=v.length;h<w;++h)l=v[h],(o=b[l],void 0!==o)&&(e&&(l==ft.IMAGE||l==ft.TEXT)?(y=e[c],y?y.push(o,t.slice(0)):e[c]=[o,t.slice(0)]):o.replay(n,t,i,r,u));n.restore()},t}(vn),yn={0:[[!0]]};var hst=int,rnt=.5,cst={Point:function(n,t,i,r){var u=i.getImage(),f,e,o;if(u){if(u.getImageState()!=ot.LOADED)return;f=n.getReplay(i.getZIndex(),ft.IMAGE);f.setImageStyle(u,n.addDeclutter(!1));f.drawPoint(t,r)}e=i.getText();e&&(o=n.getReplay(i.getZIndex(),ft.TEXT),o.setTextStyle(e,n.addDeclutter(!!u)),o.drawText(t,r))},LineString:function(n,t,i,r){var o=i.getStroke(),u,f,e;o&&(u=n.getReplay(i.getZIndex(),ft.LINE_STRING),u.setFillStrokeStyle(null,o),u.drawLineString(t,r));f=i.getText();f&&(e=n.getReplay(i.getZIndex(),ft.TEXT),e.setTextStyle(f,n.addDeclutter(!1)),e.drawText(t,r))},Polygon:function(n,t,i,r){var o=i.getFill(),s=i.getStroke(),u,f,e;(o||s)&&(u=n.getReplay(i.getZIndex(),ft.POLYGON),u.setFillStrokeStyle(o,s),u.drawPolygon(t,r));f=i.getText();f&&(e=n.getReplay(i.getZIndex(),ft.TEXT),e.setTextStyle(f,n.addDeclutter(!1)),e.drawText(t,r))},MultiPoint:function(n,t,i,r){var u=i.getImage(),f,e,o;if(u){if(u.getImageState()!=ot.LOADED)return;f=n.getReplay(i.getZIndex(),ft.IMAGE);f.setImageStyle(u,n.addDeclutter(!1));f.drawMultiPoint(t,r)}e=i.getText();e&&(o=n.getReplay(i.getZIndex(),ft.TEXT),o.setTextStyle(e,n.addDeclutter(!!u)),o.drawText(t,r))},MultiLineString:function(n,t,i,r){var o=i.getStroke(),u,f,e;o&&(u=n.getReplay(i.getZIndex(),ft.LINE_STRING),u.setFillStrokeStyle(null,o),u.drawMultiLineString(t,r));f=i.getText();f&&(e=n.getReplay(i.getZIndex(),ft.TEXT),e.setTextStyle(f,n.addDeclutter(!1)),e.drawText(t,r))},MultiPolygon:function(n,t,i,r){var o=i.getFill(),s=i.getStroke(),u,f,e;(s||o)&&(u=n.getReplay(i.getZIndex(),ft.POLYGON),u.setFillStrokeStyle(o,s),u.drawMultiPolygon(t,r));f=i.getText();f&&(e=n.getReplay(i.getZIndex(),ft.TEXT),e.setTextStyle(f,n.addDeclutter(!1)),e.drawText(t,r))},GeometryCollection:function(n,t,i,r){for(var f=t.getGeometriesArray(),o,u=0,e=f.length;u<e;++u)o=cst[f[u].getType()],o(n,f[u],i,r)},Circle:function(n,t,i,r){var o=i.getFill(),s=i.getStroke(),u,f,e;(o||s)&&(u=n.getReplay(i.getZIndex(),ft.CIRCLE),u.setFillStrokeStyle(o,s),u.drawCircle(t,r));f=i.getText();f&&(e=n.getReplay(i.getZIndex(),ft.TEXT),e.setTextStyle(f,n.addDeclutter(!1)),e.drawText(t,r))}};vv=function(n){function t(t){n.call(this,t);this.declutterTree_=t.getDeclutter()?an()(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=kt();o(ve,a.CLEAR,this.handleFontsChanged_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){ou(ve,a.CLEAR,this.handleFontsChanged_,this);n.prototype.disposeInternal.call(this)},t.prototype.compose=function(n,t,i){var b=t.extent,nt=t.pixelRatio,k=i.managed?t.skippedFeatureUids:{},tt=t.viewState,it=tt.projection,u=tt.rotation,a=it.getExtent(),lt=this.getLayer().getSource(),f=this.getTransform(t,0),rt=i.extent,ut=void 0!==rt,e,o,s,y,et,ct;if(ut&&this.clip(n,t,rt),e=this.replayGroup_,e&&!e.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var r,at=this.getLayer(),h=0,c=0,v=1!==i.opacity,ft=at.hasListener(gr.RENDER);v||ft?(o=n.canvas.width,s=n.canvas.height,u&&(y=Math.round(Math.sqrt(o*o+s*s)),h=(y-o)/2,c=(y-s)/2,o=s=y),this.context.canvas.width=o,this.context.canvas.height=s,r=this.context):r=n;et=r.globalAlpha;v||(r.globalAlpha=i.opacity);r!=n&&r.translate(h,c);var ot=t.viewHints,d=!(ot[lu]||ot[oi]),st=t.size[0]*nt,ht=t.size[1]*nt;if(to(r,-u,st/2,ht/2),e.replay(r,f,u,k,d),lt.getWrapX()&&it.canWrapX()&&!lr(a,b)){for(var p,l=b[0],w=wt(a),g=0;l<a[0];)p=w*--g,f=this.getTransform(t,p),e.replay(r,f,u,k,d),l+=w;for(g=0,l=b[2];l>a[2];)p=w*++g,f=this.getTransform(t,p),e.replay(r,f,u,k,d),l-=w}(to(r,u,st/2,ht/2),ft&&this.dispatchRenderEvent(r,t,f),r!=n)&&(v?(ct=n.globalAlpha,n.globalAlpha=i.opacity,n.drawImage(r.canvas,-h,-c),n.globalAlpha=ct):n.drawImage(r.canvas,-h,-c),r.translate(-h,-c));v||(r.globalAlpha=et)}ut&&n.restore()},t.prototype.composeFrame=function(n,t,i){var r=this.getTransform(n,0);this.preCompose(i,n,r);this.compose(i,n,t);this.postCompose(i,n,t,r)},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u){if(this.replayGroup_){var e=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),f={};return this.replayGroup_.forEachFeatureAtCoordinate(n,e,o,i,{},function(n){var t=y(n);if(!(t in f))return f[t]=!0,r.call(u,n,s)},null)}},t.prototype.handleFontsChanged_=function(){var n=this.getLayer();n.getVisible()&&this.replayGroup_&&n.changed()},t.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(n){var i=this.getLayer(),f=i.getSource(),b=n.viewHints[lu],k=n.viewHints[oi],d=i.getUpdateWhileAnimating(),g=i.getUpdateWhileInteracting(),t,e,p,a,h,v,o,c,w;if(!this.dirty_&&!d&&b||!g&&k)return!0;var nt=n.extent,s=n.viewState,tt=s.projection,r=s.resolution,l=n.pixelRatio,y=i.getRevision(),it=i.getRenderBuffer(),u=i.getRenderOrder();if(void 0===u&&(u=lst),t=ff(nt,it*r),e=s.projection.getExtent(),f.getWrapX()&&s.projection.canWrapX()&&!lr(e,n.extent)&&(p=wt(e),a=Math.max(wt(t)/2,p),t[0]=e[0]-a,t[2]=e[2]+a),!this.dirty_&&this.renderedResolution_==r&&this.renderedRevision_==y&&this.renderedRenderOrder_==u&&lr(this.renderedExtent_,t))return this.replayGroupChanged=!1,!0;if(this.replayGroup_=null,this.dirty_=!1,h=new hst(pn(r,l),t,r,l,f.getOverlaps(),this.declutterTree_,i.getRenderBuffer()),f.loadFeatures(t,r,tt),v=function(n){var t,u=n.getStyleFunction()||i.getStyleFunction(),f;(u&&(t=u(n,r)),t)&&(f=this.renderFeature(n,r,l,t,h),this.dirty_=this.dirty_||f)}.bind(this),u)for(o=[],f.forEachFeatureInExtent(t,function(n){o.push(n)}),o.sort(u),c=0,w=o.length;c<w;++c)v(o[c]);else f.forEachFeatureInExtent(t,v);return h.finish(),this.renderedResolution_=r,this.renderedRevision_=y,this.renderedRenderOrder_=u,this.renderedExtent_=t,this.replayGroup_=h,this.replayGroupChanged=!0,!0},t.prototype.renderFeature=function(n,t,i,r,u){var f,e,o;if(!r)return!1;if(f=!1,Array.isArray(r))for(e=0,o=r.length;e<o;++e)f=hl(u,n,r[e],av(t,i),this.handleStyleImageChange_,this)||f;else f=hl(u,n,r,av(t,i),this.handleStyleImageChange_,this);return f},t}(fst);vv.handles=function(n){return n.getType()===kr.VECTOR};vv.create=function(n,t){return new vv(t)};var ast=vv,io={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"},unt={image:[ft.POLYGON,ft.CIRCLE,ft.LINE_STRING,ft.IMAGE,ft.TEXT],hybrid:[ft.POLYGON,ft.LINE_STRING]},fnt={image:[ft.DEFAULT],hybrid:[ft.IMAGE,ft.TEXT,ft.DEFAULT],vector:fs},ib=function(n){function t(t){n.call(this,t,!0);this.declutterTree_=t.getDeclutter()?an()(9,void 0):null;this.dirty_=!1;this.renderedLayerRevision_;this.tmpTransform_=[1,0,0,1,0,0];var i=t.getRenderMode();this.zDirection=i===io.VECTOR?1:0;i!==io.VECTOR&&(this.context=kt());o(ve,a.CLEAR,this.handleFontsChanged_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){ou(ve,a.CLEAR,this.handleFontsChanged_,this);n.prototype.disposeInternal.call(this)},t.prototype.getTile=function(t,i,r,u,f){var e=n.prototype.getTile.call(this,t,i,r,u,f);return e.getState()===c.LOADED&&(this.createReplayGroup_(e,u,f),this.context&&this.renderTileImage_(e,u,f)),e},t.prototype.getTileImage=function(n){var t=this.getLayer();return n.getImage(t)},t.prototype.prepareFrame=function(t,i){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,n.prototype.prepareFrame.call(this,t,i)},t.prototype.createReplayGroup_=function(n,t,i){var o=this,u=this.getLayer(),l=u.getRevision(),f=u.getRenderOrder()||null,r=n.getReplayState(u);if(r.dirty||r.renderedRevision!=l||r.renderedRenderOrder!=f){for(var s=u.getSource(),a=s.getTileGrid(),e=s.getTileGridForProjection(i).getResolution(n.tileCoord[0]),v=n.extent,y=function(h){var l=n.getTile(n.tileKeys[h]),p,it,w;if(l.getState()==c.LOADED){var rt=l.tileCoord,b=a.getTileCoordExtent(rt),k=of(v,b),nt=oe(b,k)?null:ff(k,u.getRenderBuffer()*e,o.tmpExtent),y=l.getProjection(),tt=!1;hu(i,y)||(tt=!0,l.setProjection(i));r.dirty=!1;var d=new hst(0,k,e,t,s.getOverlaps(),o.declutterTree_,u.getRenderBuffer()),ut=av(e,t),ft=function(n){var t,f=n.getStyleFunction()||u.getStyleFunction(),i;(f&&(t=f(n,e)),t)&&(i=this.renderFeature(n,ut,t,d),this.dirty_=this.dirty_||i,r.dirty=r.dirty||i)},g=l.getFeatures();for(f&&f!==r.renderedRenderOrder&&g.sort(f),p=0,it=g.length;p<it;++p)w=g[p],tt&&(y.getUnits()==pr.TILE_PIXELS&&(y.setWorldExtent(b),y.setExtent(l.getExtent())),w.getGeometry().transform(y,i)),nt&&!dt(nt,w.getGeometry().getExtent())||ft.call(o,w);d.finish();l.setReplayGroup(u,n.tileCoord.toString(),d)}},h=0,p=n.tileKeys.length;h<p;++h)y(h);r.renderedRevision=l;r.renderedRenderOrder=f}},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u){var l=t.viewState.resolution,g=t.viewState.rotation,f,o,k,h,d;i=void 0==i?0:i;for(var a,s,p=this.getLayer(),w={},b=this.renderedTiles,e=0,v=b.length;e<v;++e)if(f=b[e],tp(a=ff(f.extent,i*l,a),n))for(o=0,k=f.tileKeys.length;o<k;++o)h=f.getTile(f.tileKeys[o]),h.getState()==c.LOADED&&(d=h.getReplayGroup(p,f.tileCoord.toString()),s=s||d.forEachFeatureAtCoordinate(n,l,g,i,{},function(n){var t=y(n);if(!(t in w))return w[t]=!0,r.call(u,n,p)},null));return s},t.prototype.getReplayTransform_=function(n,t){var f=this.getLayer().getSource().getTileGrid(),e=n.tileCoord,i=f.getResolution(e[0]),r=t.viewState,u=t.pixelRatio,o=r.resolution/u,l=f.getTileCoordExtent(e,this.tmpExtent),s=r.center,h=bf(l),c=t.size,a=Math.round(u*c[0]/2),v=Math.round(u*c[1]/2);return cu(this.tmpTransform_,a,v,i/o,i/o,r.rotation,(h[0]-s[0])/i,(s[1]-h[1])/i)},t.prototype.handleFontsChanged_=function(){var n=this.getLayer();n.getVisible()&&void 0!==this.renderedLayerRevision_&&n.changed()},t.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},t.prototype.postCompose=function(t,i,r){var l=this.getLayer(),d=l.getRenderMode(),e,y,s,k,u,h,ht,f;if(d!=io.IMAGE){var g,nt,a=l.getDeclutter()?{}:null,ct=l.getSource(),tt=fnt[d],it=i.pixelRatio,o=i.viewState.rotation,rt=i.size;o&&to(t,-o,g=Math.round(it*rt[0]/2),nt=Math.round(it*rt[1]/2));a&&this.declutterTree_.clear();for(var ut=i.viewHints,ft=!(ut[lu]||ut[oi]),et=this.renderedTiles,lt=ct.getTileGridForProjection(i.viewState.projection),p=[],ot=[],w=et.length-1;w>=0;--w)if(e=et[w],e.getState()!=c.ABORT)for(var st=e.tileCoord,at=lt.getTileCoordExtent(st,this.tmpExtent)[0]-e.extent[0],v=void 0,b=0,vt=e.tileKeys.length;b<vt;++b)if(y=e.getTile(e.tileKeys[b]),y.getState()==c.LOADED&&(s=y.getReplayGroup(l,st.toString()),s&&s.hasReplays(tt))){for(v||(v=this.getTransform(i,at)),k=y.tileCoord[0],u=s.getClipCoords(v),t.save(),t.globalAlpha=r.opacity,h=0,ht=p.length;h<ht;++h)f=p[h],k<ot[h]&&(t.beginPath(),t.moveTo(u[0],u[1]),t.lineTo(u[2],u[3]),t.lineTo(u[4],u[5]),t.lineTo(u[6],u[7]),t.moveTo(f[6],f[7]),t.lineTo(f[4],f[5]),t.lineTo(f[2],f[3]),t.lineTo(f[0],f[1]),t.clip());s.replay(t,v,o,{},ft,tt,a);t.restore();p.push(u);ot.push(k)}a&&function(n,t,i,r){for(var s,h,o=Object.keys(n).map(Number).sort(lo),c={},u=0,l=o.length;u<l;++u)for(var f=n[o[u].toString()],e=0,a=f.length;e<a;)s=f[e++],h=f[e++],s.replay(t,h,i,c,r)}(a,t,o,ft);o&&to(t,o,g,nt)}n.prototype.postCompose.call(this,t,i,r)},t.prototype.renderFeature=function(n,t,i,r){var u,f,e;if(!i)return!1;if(u=!1,Array.isArray(i))for(f=0,e=i.length;f<e;++f)u=hl(r,n,i[f],t,this.handleStyleImageChange_,this)||u;else u=hl(r,n,i,t,this.handleStyleImageChange_,this);return u},t.prototype.renderTileImage_=function(n,t,i){var r=this.getLayer(),h=n.getReplayState(r),l=r.getRevision(),a=unt[r.getRenderMode()],o,s,u;if(a&&h.renderedTileRevision!==l){h.renderedTileRevision=l;var v=n.wrappedTileCoord,y=v[0],p=r.getSource(),w=p.getTileGridForProjection(i),d=w.getResolution(y),f=n.getContext(r),b=p.getTilePixelSize(y,t,i);f.canvas.width=b[0];f.canvas.height=b[1];for(var k=w.getTileCoordExtent(v,this.tmpExtent),e=0,g=n.tileKeys.length;e<g;++e)o=n.getTile(n.tileKeys[e]),o.getState()==c.LOADED&&(s=t/d,u=hh(this.tmpTransform_),sf(u,s,-s),ne(u,-k[0],-k[3]),o.getReplayGroup(r,n.tileCoord.toString()).replay(f,u,0,{},!0,a))}},t}(sv);ib.handles=function(n){return n.getType()===kr.VECTOR_TILE};ib.create=function(n,t){return new ib(t)};var vst=ib,yst=function(n){function t(t){(t=nt({},t)).controls||(t.controls=vg());t.interactions||(t.interactions=un());n.call(this,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createRenderer=function(){var n=new rst(this);return n.registerLayerRenderers([ov,sv,ast,vst]),n},t}(hg),au={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"},dr={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},pst=function(n){function t(t){n.call(this);this.options=t;this.id=t.id;this.insertFirst=void 0===t.insertFirst||t.insertFirst;this.stopEvent=void 0===t.stopEvent||t.stopEvent;this.element=document.createElement("div");this.element.className=void 0!==t.className?t.className:"ol-overlay-container "+igt;this.element.style.position="absolute";this.autoPan=void 0!==t.autoPan&&t.autoPan;this.autoPanAnimation=t.autoPanAnimation||{};this.autoPanMargin=void 0!==t.autoPanMargin?t.autoPanMargin:20;this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0};this.mapPostrenderListenerKey=null;o(this,ni(dr.ELEMENT),this.handleElementChanged,this);o(this,ni(dr.MAP),this.handleMapChanged,this);o(this,ni(dr.OFFSET),this.handleOffsetChanged,this);o(this,ni(dr.POSITION),this.handlePositionChanged,this);o(this,ni(dr.POSITIONING),this.handlePositioningChanged,this);void 0!==t.element&&this.setElement(t.element);this.setOffset(void 0!==t.offset?t.offset:[0,0]);this.setPositioning(void 0!==t.positioning?t.positioning:au.TOP_LEFT);void 0!==t.position&&this.setPosition(t.position)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getElement=function(){return this.get(dr.ELEMENT)},t.prototype.getId=function(){return this.id},t.prototype.getMap=function(){return this.get(dr.MAP)},t.prototype.getOffset=function(){return this.get(dr.OFFSET)},t.prototype.getPosition=function(){return this.get(dr.POSITION)},t.prototype.getPositioning=function(){return this.get(dr.POSITIONING)},t.prototype.handleElementChanged=function(){wet(this.element);var n=this.getElement();n&&this.element.appendChild(n)},t.prototype.handleMapChanged=function(){var n,t;this.mapPostrenderListenerKey&&(sw(this.element),lt(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);n=this.getMap();n&&(this.mapPostrenderListenerKey=o(n,iw,this.render,this),this.updatePixelPosition(),t=this.stopEvent?n.getOverlayContainerStopEvent():n.getOverlayContainer(),this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element))},t.prototype.render=function(){this.updatePixelPosition()},t.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},t.prototype.handlePositionChanged=function(){this.updatePixelPosition();this.get(dr.POSITION)&&this.autoPan&&this.panIntoView()},t.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},t.prototype.setElement=function(n){this.set(dr.ELEMENT,n)},t.prototype.setMap=function(n){this.set(dr.MAP,n)},t.prototype.setOffset=function(n){this.set(dr.OFFSET,n)},t.prototype.setPosition=function(n){this.set(dr.POSITION,n)},t.prototype.panIntoView=function(){var n=this.getMap();if(n&&n.getTargetElement()){var i=this.getRect(n.getTargetElement(),n.getSize()),f=this.getElement(),r=this.getRect(f,[function(n){var i=n.offsetWidth,t=getComputedStyle(n);return i+(parseInt(t.marginLeft,10)+parseInt(t.marginRight,10))}(f),function(n){var i=n.offsetHeight,t=getComputedStyle(n);return i+(parseInt(t.marginTop,10)+parseInt(t.marginBottom,10))}(f)]),u=this.autoPanMargin;if(!lr(i,r)){var e=r[0]-i[0],o=i[2]-r[2],s=r[1]-i[1],h=i[3]-r[3],t=[0,0];if(e<0?t[0]=e-u:o<0&&(t[0]=Math.abs(o)+u),s<0?t[1]=s-u:h<0&&(t[1]=Math.abs(h)+u),0!==t[0]||0!==t[1]){var l=n.getView().getCenter(),c=n.getPixelFromCoordinate(l),a=[c[0]+t[0],c[1]+t[1]];n.getView().animate({center:n.getCoordinateFromPixel(a),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},t.prototype.getRect=function(n,t){var i=n.getBoundingClientRect(),r=i.left+window.pageXOffset,u=i.top+window.pageYOffset;return[r,u,r+t[0],u+t[1]]},t.prototype.setPositioning=function(n){this.set(dr.POSITIONING,n)},t.prototype.setVisible=function(n){this.rendered.visible!==n&&(this.element.style.display=n?"":"none",this.rendered.visible=n)},t.prototype.updatePixelPosition=function(){var n=this.getMap(),t=this.getPosition(),i,r;n&&n.isRendered()&&t?(i=n.getPixelFromCoordinate(t),r=n.getSize(),this.updateRenderedPosition(i,r)):this.setVisible(!1)},t.prototype.updateRenderedPosition=function(n,t){var r=this.element.style,c=this.getOffset(),i=this.getPositioning(),u,f,e,o,s,h;this.setVisible(!0);u=c[0];f=c[1];i==au.BOTTOM_RIGHT||i==au.CENTER_RIGHT||i==au.TOP_RIGHT?(""!==this.rendered.left_&&(this.rendered.left_=r.left=""),e=Math.round(t[0]-n[0]-u)+"px",this.rendered.right_!=e&&(this.rendered.right_=r.right=e)):(""!==this.rendered.right_&&(this.rendered.right_=r.right=""),i!=au.BOTTOM_CENTER&&i!=au.CENTER_CENTER&&i!=au.TOP_CENTER||(u-=this.element.offsetWidth/2),o=Math.round(n[0]+u)+"px",this.rendered.left_!=o&&(this.rendered.left_=r.left=o));i==au.BOTTOM_LEFT||i==au.BOTTOM_CENTER||i==au.BOTTOM_RIGHT?(""!==this.rendered.top_&&(this.rendered.top_=r.top=""),s=Math.round(t[1]-n[1]-f)+"px",this.rendered.bottom_!=s&&(this.rendered.bottom_=r.bottom=s)):(""!==this.rendered.bottom_&&(this.rendered.bottom_=r.bottom=""),i!=au.CENTER_LEFT&&i!=au.CENTER_CENTER&&i!=au.CENTER_RIGHT||(f-=this.element.offsetHeight/2),h=Math.round(n[1]+f)+"px",this.rendered.top_!=h&&(this.rendered.top_=r.top=h))},t.prototype.getOptions=function(){return this.options},t}(rf),rb=9729,wst=10242,bst=10243,vr=3553,kst=["experimental-webgl","webgl","webkit-3d","moz-webgl"];if("undefined"!=typeof window&&"WebGLRenderingContext"in window)try{yv=dst(document.createElement("canvas"),{failIfMajorPerformanceCaveat:!0});yv&&(wn=yv.getParameter(yv.MAX_TEXTURE_SIZE),gst=yv.getSupportedExtensions())}catch(n){}pv=function(n){this.source_=n};pv.prototype.isAnimated=function(){return!1};pv.prototype.getType=function(){return p()};pv.prototype.getSource=function(){return this.source_};var nht=pv,cl=function(n){function t(t){n.call(this,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getType=function(){return 35632},t}(nht),ll=function(n){function t(t){n.call(this,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getType=function(){return 35633},t}(nht),ent=new cl("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"),ont=new ll("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"),snt=function(n,t){this.u_projectionMatrix=n.getUniformLocation(t,"u_projectionMatrix");this.u_offsetScaleMatrix=n.getUniformLocation(t,"u_offsetScaleMatrix");this.u_offsetRotateMatrix=n.getUniformLocation(t,"u_offsetRotateMatrix");this.u_lineWidth=n.getUniformLocation(t,"u_lineWidth");this.u_pixelRatio=n.getUniformLocation(t,"u_pixelRatio");this.u_opacity=n.getUniformLocation(t,"u_opacity");this.u_fillColor=n.getUniformLocation(t,"u_fillColor");this.u_strokeColor=n.getUniformLocation(t,"u_strokeColor");this.u_size=n.getUniformLocation(t,"u_size");this.a_position=n.getAttribLocation(t,"a_position");this.a_instruction=n.getAttribLocation(t,"a_instruction");this.a_radius=n.getAttribLocation(t,"a_radius")};var ub=function(n){function t(t,i){n.call(this);this.tolerance=t;this.maxExtent=i;this.origin=su(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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDeleteResourcesFunction=function(){return p()},t.prototype.finish=function(){p()},t.prototype.setUpProgram=function(){return p()},t.prototype.shutDownProgram=function(){p()},t.prototype.drawReplay=function(){p()},t.prototype.drawHitDetectionReplayOneByOne=function(){return p()},t.prototype.drawHitDetectionReplay=function(n,t,i,r,u,f){return u?this.drawHitDetectionReplayOneByOne(n,t,i,r,f):this.drawHitDetectionReplayAll(n,t,i,r)},t.prototype.drawHitDetectionReplayAll=function(n,t,i,r){n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT);this.drawReplay(n,t,i,!0);var u=r(null);return u||void 0},t.prototype.replay=function(n,t,i,r,u,f,e,o,s,h,c){var w,b,k,d,g,nt,tt,it,l=n.getGL(),a,v,y,rt,p;return this.lineStringReplay&&(w=l.isEnabled(l.STENCIL_TEST),b=l.getParameter(l.STENCIL_FUNC),k=l.getParameter(l.STENCIL_VALUE_MASK),d=l.getParameter(l.STENCIL_REF),g=l.getParameter(l.STENCIL_WRITEMASK),nt=l.getParameter(l.STENCIL_FAIL),tt=l.getParameter(l.STENCIL_PASS_DEPTH_PASS),it=l.getParameter(l.STENCIL_PASS_DEPTH_FAIL),l.enable(l.STENCIL_TEST),l.clear(l.STENCIL_BUFFER_BIT),l.stencilMask(255),l.stencilFunc(l.ALWAYS,1,255),l.stencilOp(l.KEEP,l.KEEP,l.REPLACE),this.lineStringReplay.replay(n,t,i,r,u,f,e,o,s,h,c),l.stencilMask(0),l.stencilFunc(l.NOTEQUAL,1,255)),n.bindBuffer(34962,this.verticesBuffer),n.bindBuffer(34963,this.indicesBuffer),a=this.setUpProgram(l,n,u,f),v=hh(this.projectionMatrix_),sf(v,2/(i*u[0]),2/(i*u[1])),vp(v,-r),ne(v,-(t[0]-this.origin[0]),-(t[1]-this.origin[1])),y=hh(this.offsetScaleMatrix_),sf(y,2/u[0],2/u[1]),p=hh(this.offsetRotateMatrix_),0!==r&&vp(p,-r),l.uniformMatrix4fv(a.u_projectionMatrix,!1,wv(this.tmpMat4_,v)),l.uniformMatrix4fv(a.u_offsetScaleMatrix,!1,wv(this.tmpMat4_,y)),l.uniformMatrix4fv(a.u_offsetRotateMatrix,!1,wv(this.tmpMat4_,p)),l.uniform1f(a.u_opacity,e),void 0===s?this.drawReplay(l,n,o,!1):rt=this.drawHitDetectionReplay(l,n,o,s,h,c),this.shutDownProgram(l,a),this.lineStringReplay&&(w||l.disable(l.STENCIL_TEST),l.clear(l.STENCIL_BUFFER_BIT),l.stencilFunc(b,d,k),l.stencilMask(g),l.stencilOp(nt,it,tt)),rt},t.prototype.drawElements=function(n,t,i,r){var u=t.hasOESElementIndexUint?5125:5123,f=r-i,e=i*(t.hasOESElementIndexUint?4:2);n.drawElements(4,f,u,e)},t}(fv),bv=[0,0,0,1],bn=[],kv=[0,0,0,1],al=Number.EPSILON||22204460492503131e-32,fb=function(n,t,i,r,u,f){var e=(i-n)*(f-t)-(u-n)*(r-t);if(!(e<=al)||!(e>=-al))return e>0},hnt=35044,kn=function(n,t){this.arr_=void 0!==n?n:[];this.usage_=void 0!==t?t:hnt};kn.prototype.getArray=function(){return this.arr_};kn.prototype.getUsage=function(){return this.usage_};var vf=kn,cnt=function(n){function t(t,i){n.call(this,t,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(n,t,i,r){for(var u=this.vertices.length,o=this.indices.length,e=u/4,f=t,s=i;f<s;f+=r)this.vertices[u++]=n[f],this.vertices[u++]=n[f+1],this.vertices[u++]=0,this.vertices[u++]=this.radius_,this.vertices[u++]=n[f],this.vertices[u++]=n[f+1],this.vertices[u++]=1,this.vertices[u++]=this.radius_,this.vertices[u++]=n[f],this.vertices[u++]=n[f+1],this.vertices[u++]=2,this.vertices[u++]=this.radius_,this.vertices[u++]=n[f],this.vertices[u++]=n[f+1],this.vertices[u++]=3,this.vertices[u++]=this.radius_,this.indices[o++]=e,this.indices[o++]=e+1,this.indices[o++]=e+2,this.indices[o++]=e+2,this.indices[o++]=e+3,this.indices[o++]=e,e+=4},t.prototype.drawCircle=function(n,t){var u=n.getRadius(),f=n.getStride(),i,r;u?(this.startIndices.push(this.indices.length),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=u,i=n.getFlatCoordinates(),i=yo(i,0,2,f,-this.origin[0],-this.origin[1]),this.drawCoordinates_(i,0,2,f)):this.state_.changed&&(this.styles_.pop(),this.styles_.length)&&(r=this.styles_[this.styles_.length-1],this.state_.fillColor=r[0],this.state_.strokeColor=r[1],this.state_.lineWidth=r[2],this.state_.changed=!1)},t.prototype.finish=function(){this.verticesBuffer=new vf(this.vertices);this.indicesBuffer=new vf(this.indices);this.startIndices.push(this.indices.length);0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]);this.vertices=null;this.indices=null},t.prototype.getDeleteResourcesFunction=function(n){var t=this.verticesBuffer,i=this.indicesBuffer;return function(){n.deleteBuffer(t);n.deleteBuffer(i)}},t.prototype.setUpProgram=function(n,t,i,r){var u,f=t.getProgram(ent,ont);return this.defaultLocations_?u=this.defaultLocations_:(u=new snt(n,f),this.defaultLocations_=u),t.useProgram(f),n.enableVertexAttribArray(u.a_position),n.vertexAttribPointer(u.a_position,2,5126,!1,16,0),n.enableVertexAttribArray(u.a_instruction),n.vertexAttribPointer(u.a_instruction,1,5126,!1,16,8),n.enableVertexAttribArray(u.a_radius),n.vertexAttribPointer(u.a_radius,1,5126,!1,16,12),n.uniform2fv(u.u_size,i),n.uniform1f(u.u_pixelRatio,r),u},t.prototype.shutDownProgram=function(n,t){n.disableVertexAttribArray(t.a_position);n.disableVertexAttribArray(t.a_instruction);n.disableVertexAttribArray(t.a_radius)},t.prototype.drawReplay=function(n,t,i){var r,f,e,u;if(wu(i))for(e=this.startIndices[this.startIndices.length-1],r=this.styleIndices_.length-1;r>=0;--r)f=this.styleIndices_[r],u=this.styles_[r],this.setFillStyle_(n,u[0]),this.setStrokeStyle_(n,u[1],u[2]),this.drawElements(n,t,f,e),e=f;else this.drawReplaySkipping_(n,t,i)},t.prototype.drawHitDetectionReplayOneByOne=function(n,t,i,r,u){var e,h,c,o,a,s,f,l;for(f=this.startIndices.length-2,c=this.startIndices[f+1],e=this.styleIndices_.length-1;e>=0;--e)for(o=this.styles_[e],this.setFillStyle_(n,o[0]),this.setStrokeStyle_(n,o[1],o[2]),a=this.styleIndices_[e];f>=0&&this.startIndices[f]>=a;){if((h=this.startIndices[f],void 0===i[y(s=this.startIndicesFeature[f])]&&s.getGeometry()&&(void 0===u||dt(u,s.getGeometry().getExtent())))&&(n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),this.drawElements(n,t,h,c),l=r(s),l))return l;f--;c=h}},t.prototype.drawReplaySkipping_=function(n,t,i){var e,r,u,o,s,f,h;for(f=this.startIndices.length-2,u=r=this.startIndices[f+1],e=this.styleIndices_.length-1;e>=0;--e){for(o=this.styles_[e],this.setFillStyle_(n,o[0]),this.setStrokeStyle_(n,o[1],o[2]),s=this.styleIndices_[e];f>=0&&this.startIndices[f]>=s;)h=this.startIndices[f],i[y(this.startIndicesFeature[f])]&&(r!==u&&this.drawElements(n,t,r,u),u=h),f--,r=h;r!==u&&this.drawElements(n,t,r,u);r=u=s}},t.prototype.setFillStyle_=function(n,t){n.uniform4fv(this.defaultLocations_.u_fillColor,t)},t.prototype.setStrokeStyle_=function(n,t,i){n.uniform4fv(this.defaultLocations_.u_strokeColor,t);n.uniform1f(this.defaultLocations_.u_lineWidth,i)},t.prototype.setFillStrokeStyle=function(n,t){var i,u,f,e,r;t?(f=t.getLineDash(),this.state_.lineDash=f||bn,e=t.getLineDashOffset(),this.state_.lineDashOffset=e||0,i=(i=t.getColor())instanceof CanvasGradient||i instanceof CanvasPattern?kv:yh(i).map(function(n,t){return 3!=t?n/255:n})||kv,u=void 0!==(u=t.getWidth())?u:1):(i=[0,0,0,0],u=0);r=n?n.getColor():[0,0,0,0];r=r instanceof CanvasGradient||r instanceof CanvasPattern?bv:yh(r).map(function(n,t){return 3!=t?n/255:n})||bv;this.state_.strokeColor&&uf(this.state_.strokeColor,i)&&this.state_.fillColor&&uf(this.state_.fillColor,r)&&this.state_.lineWidth===u||(this.state_.changed=!0,this.state_.fillColor=r,this.state_.strokeColor=i,this.state_.lineWidth=u,this.styles_.push([r,i,u]))},t}(ub),lnt=new cl("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"),ant=new ll("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"),vnt=function(n,t){this.u_projectionMatrix=n.getUniformLocation(t,"u_projectionMatrix");this.u_offsetScaleMatrix=n.getUniformLocation(t,"u_offsetScaleMatrix");this.u_offsetRotateMatrix=n.getUniformLocation(t,"u_offsetRotateMatrix");this.u_opacity=n.getUniformLocation(t,"u_opacity");this.u_image=n.getUniformLocation(t,"u_image");this.a_position=n.getAttribLocation(t,"a_position");this.a_texCoord=n.getAttribLocation(t,"a_texCoord");this.a_offsets=n.getAttribLocation(t,"a_offsets");this.a_opacity=n.getAttribLocation(t,"a_opacity");this.a_rotateWithView=n.getAttribLocation(t,"a_rotateWithView")},eb={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var ynt=function(n){function t(t,i){n.call(this);this.canvas_=t;this.gl_=i;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null;this.hasOESElementIndexUint=tr(gst,"OES_element_index_uint");this.hasOESElementIndexUint&&i.getExtension("OES_element_index_uint");o(this.canvas_,eb.LOST,this.handleWebGLContextLost,this);o(this.canvas_,eb.RESTORED,this.handleWebGLContextRestored,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.bindBuffer=function(n,t){var i=this.getGL(),r=t.getArray(),u=y(t),o,f,e;u in this.bufferCache_?(o=this.bufferCache_[u],i.bindBuffer(n,o.buffer)):(e=i.createBuffer(),i.bindBuffer(n,e),34962==n?f=new Float32Array(r):34963==n&&(f=this.hasOESElementIndexUint?new Uint32Array(r):new Uint16Array(r)),i.bufferData(n,f,t.getUsage()),this.bufferCache_[u]={buf:t,buffer:e})},t.prototype.deleteBuffer=function(n){var t=this.getGL(),i=y(n),r=this.bufferCache_[i];t.isContextLost()||t.deleteBuffer(r.buffer);delete this.bufferCache_[i]},t.prototype.disposeInternal=function(){var n,t,i,r;if(nut(this.canvas_),n=this.getGL(),!n.isContextLost()){for(t in this.bufferCache_)n.deleteBuffer(this.bufferCache_[t].buffer);for(i in this.programCache_)n.deleteProgram(this.programCache_[i]);for(r in this.shaderCache_)n.deleteShader(this.shaderCache_[r]);n.deleteFramebuffer(this.hitDetectionFramebuffer_);n.deleteRenderbuffer(this.hitDetectionRenderbuffer_);n.deleteTexture(this.hitDetectionTexture_)}},t.prototype.getCanvas=function(){return this.canvas_},t.prototype.getGL=function(){return this.gl_},t.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},t.prototype.getShader=function(n){var r=y(n),i,t;return r in this.shaderCache_?this.shaderCache_[r]:(i=this.getGL(),t=i.createShader(n.getType()),i.shaderSource(t,n.getSource()),i.compileShader(t),this.shaderCache_[r]=t,t)},t.prototype.getProgram=function(n,t){var u=y(n)+"/"+y(t),r,i;return u in this.programCache_?this.programCache_[u]:(r=this.getGL(),i=r.createProgram(),r.attachShader(i,this.getShader(n)),r.attachShader(i,this.getShader(t)),r.linkProgram(i),this.programCache_[u]=i,i)},t.prototype.handleWebGLContextLost=function(){pf(this.bufferCache_);pf(this.shaderCache_);pf(this.programCache_);this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null},t.prototype.handleWebGLContextRestored=function(){},t.prototype.initHitDetectionFramebuffer_=function(){var n=this.gl_,r=n.createFramebuffer(),i,t;n.bindFramebuffer(n.FRAMEBUFFER,r);i=iht(n,1,1);t=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,t);n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,1,1);n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,i,0);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t);n.bindTexture(n.TEXTURE_2D,null);n.bindRenderbuffer(n.RENDERBUFFER,null);n.bindFramebuffer(n.FRAMEBUFFER,null);this.hitDetectionFramebuffer_=r;this.hitDetectionTexture_=i;this.hitDetectionRenderbuffer_=t},t.prototype.useProgram=function(n){return n!=this.currentProgram_&&(this.getGL().useProgram(n),this.currentProgram_=n,!0)},t}(sa),uht=function(n){function t(t,i){n.call(this,t,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDeleteResourcesFunction=function(n){var r=this.verticesBuffer,u=this.indicesBuffer,t=this.getTextures(!0),i=n.getGL();return function(){var f,e;if(!i.isContextLost())for(f=0,e=t.length;f<e;++f)i.deleteTexture(t[f]);n.deleteBuffer(r);n.deleteBuffer(u)}},t.prototype.drawCoordinates=function(n,t,i,r){for(var c,f,e,v,y,p=this.anchorX,w=this.anchorY,b=this.height,k=this.imageHeight,d=this.imageWidth,g=this.opacity,nt=this.originX,tt=this.originY,it=this.rotateWithView?1:0,ut=-this.rotation,o=this.scale,rt=this.width,s=Math.cos(ut),h=Math.sin(ut),l=this.indices.length,u=this.vertices.length,a=t;a<i;a+=r)v=n[a]-this.origin[0],y=n[a+1]-this.origin[1],c=u/8,f=-o*p,e=-o*(b-w),this.vertices[u++]=v,this.vertices[u++]=y,this.vertices[u++]=f*s-e*h,this.vertices[u++]=f*h+e*s,this.vertices[u++]=nt/d,this.vertices[u++]=(tt+b)/k,this.vertices[u++]=g,this.vertices[u++]=it,f=o*(rt-p),e=-o*(b-w),this.vertices[u++]=v,this.vertices[u++]=y,this.vertices[u++]=f*s-e*h,this.vertices[u++]=f*h+e*s,this.vertices[u++]=(nt+rt)/d,this.vertices[u++]=(tt+b)/k,this.vertices[u++]=g,this.vertices[u++]=it,f=o*(rt-p),e=o*w,this.vertices[u++]=v,this.vertices[u++]=y,this.vertices[u++]=f*s-e*h,this.vertices[u++]=f*h+e*s,this.vertices[u++]=(nt+rt)/d,this.vertices[u++]=tt/k,this.vertices[u++]=g,this.vertices[u++]=it,f=-o*p,e=o*w,this.vertices[u++]=v,this.vertices[u++]=y,this.vertices[u++]=f*s-e*h,this.vertices[u++]=f*h+e*s,this.vertices[u++]=nt/d,this.vertices[u++]=tt/k,this.vertices[u++]=g,this.vertices[u++]=it,this.indices[l++]=c,this.indices[l++]=c+1,this.indices[l++]=c+2,this.indices[l++]=c,this.indices[l++]=c+2,this.indices[l++]=c+3;return u},t.prototype.createTextures=function(n,t,i,r){for(var f,o,e,s=t.length,u=0;u<s;++u)(e=y(o=t[u]))in i?f=i[e]:(f=rht(r,o,33071,33071),i[e]=f),n[u]=f},t.prototype.setUpProgram=function(n,t){var i,r=t.getProgram(lnt,ant);return this.defaultLocations?i=this.defaultLocations:(i=new vnt(n,r),this.defaultLocations=i),t.useProgram(r),n.enableVertexAttribArray(i.a_position),n.vertexAttribPointer(i.a_position,2,5126,!1,32,0),n.enableVertexAttribArray(i.a_offsets),n.vertexAttribPointer(i.a_offsets,2,5126,!1,32,8),n.enableVertexAttribArray(i.a_texCoord),n.vertexAttribPointer(i.a_texCoord,2,5126,!1,32,16),n.enableVertexAttribArray(i.a_opacity),n.vertexAttribPointer(i.a_opacity,1,5126,!1,32,24),n.enableVertexAttribArray(i.a_rotateWithView),n.vertexAttribPointer(i.a_rotateWithView,1,5126,!1,32,28),i},t.prototype.shutDownProgram=function(n,t){n.disableVertexAttribArray(t.a_position);n.disableVertexAttribArray(t.a_offsets);n.disableVertexAttribArray(t.a_texCoord);n.disableVertexAttribArray(t.a_opacity);n.disableVertexAttribArray(t.a_rotateWithView)},t.prototype.drawReplay=function(n,t,i,r){var u,s,f,e=r?this.getHitDetectionTextures():this.getTextures(),h=r?this.hitDetectionGroupIndices:this.groupIndices,o;if(wu(i))for(u=0,s=e.length,f=0;u<s;++u)n.bindTexture(vr,e[u]),o=h[u],this.drawElements(n,t,f,o),f=o;else this.drawReplaySkipping(n,t,i,e,h)},t.prototype.drawReplaySkipping=function(n,t,i,r,u){for(var f=0,e=0,c=r.length;e<c;++e){n.bindTexture(vr,r[e]);for(var l=e>0?u[e-1]:0,h=u[e],s=l,o=l;f<this.startIndices.length&&this.startIndices[f]<=h;)void 0!==i[y(this.startIndicesFeature[f])]?(s!==o&&this.drawElements(n,t,s,o),o=s=f===this.startIndices.length-1?h:this.startIndices[f+1]):o=f===this.startIndices.length-1?h:this.startIndices[f+1],f++;s!==o&&this.drawElements(n,t,s,o)}},t.prototype.drawHitDetectionReplayOneByOne=function(n,t,i,r,u){for(var l,s,h,o,e=this.startIndices.length-1,a=this.getHitDetectionTextures(),c,f=a.length-1;f>=0;--f)for(n.bindTexture(vr,a[f]),l=f>0?this.hitDetectionGroupIndices[f-1]:0,h=this.hitDetectionGroupIndices[f];e>=0&&this.startIndices[e]>=l;){if((s=this.startIndices[e],void 0===i[y(o=this.startIndicesFeature[e])]&&o.getGeometry()&&(void 0===u||dt(u,o.getGeometry().getExtent())))&&(n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),this.drawElements(n,t,s,h),c=r(o),c))return c;h=s;e--}},t.prototype.finish=function(){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},t.prototype.getTextures=function(){return p()},t.prototype.getHitDetectionTextures=function(){return p()},t}(ub),pnt=function(n){function t(t,i){n.call(this,t,i);this.images_=[];this.hitDetectionImages_=[];this.textures_=[];this.hitDetectionTextures_=[]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawMultiPoint=function(n,t){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(t);var i=n.getFlatCoordinates(),r=n.getStride();this.drawCoordinates(i,0,i.length,r)},t.prototype.drawPoint=function(n,t){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(t);var i=n.getFlatCoordinates(),r=n.getStride();this.drawCoordinates(i,0,i.length,r)},t.prototype.finish=function(t){var r=t.getGL(),u,i;this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices.push(this.indices.length);this.verticesBuffer=new vf(this.vertices);u=this.indices;this.indicesBuffer=new vf(u);i={};this.createTextures(this.textures_,this.images_,i,r);this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,i,r);this.images_=null;this.hitDetectionImages_=null;n.prototype.finish.call(this,t)},t.prototype.setImageStyle=function(n){var r=n.getAnchor(),t=n.getImage(1),u=n.getImageSize(),i=n.getHitDetectionImage(1),o=n.getOpacity(),f=n.getOrigin(),s=n.getRotateWithView(),h=n.getRotation(),e=n.getSize(),c=n.getScale();0===this.images_.length?this.images_.push(t):y(this.images_[this.images_.length-1])!=y(t)&&(this.groupIndices.push(this.indices.length),this.images_.push(t));0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(i):y(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=y(i)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(i));this.anchorX=r[0];this.anchorY=r[1];this.height=e[1];this.imageHeight=u[1];this.imageWidth=u[0];this.opacity=o;this.originX=f[0];this.originY=f[1];this.rotation=h;this.rotateWithView=s;this.scale=c;this.width=e[0]},t.prototype.getTextures=function(n){return n?this.textures_.concat(this.hitDetectionTextures_):this.textures_},t.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_},t}(uht);var wnt=new cl("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"),bnt=new ll("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"),knt=function(n,t){this.u_projectionMatrix=n.getUniformLocation(t,"u_projectionMatrix");this.u_offsetScaleMatrix=n.getUniformLocation(t,"u_offsetScaleMatrix");this.u_offsetRotateMatrix=n.getUniformLocation(t,"u_offsetRotateMatrix");this.u_lineWidth=n.getUniformLocation(t,"u_lineWidth");this.u_miterLimit=n.getUniformLocation(t,"u_miterLimit");this.u_opacity=n.getUniformLocation(t,"u_opacity");this.u_color=n.getUniformLocation(t,"u_color");this.u_size=n.getUniformLocation(t,"u_size");this.u_pixelRatio=n.getUniformLocation(t,"u_pixelRatio");this.a_lastPos=n.getAttribLocation(t,"a_lastPos");this.a_position=n.getAttribLocation(t,"a_position");this.a_nextPos=n.getAttribLocation(t,"a_nextPos");this.a_direction=n.getAttribLocation(t,"a_direction")},fht=3,eht=5,oht=7,sht=11,hht=13,dnt=17,cht=19,gnt=23,lht=function(n){function t(t,i){n.call(this,t,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(n,t,i,r){for(var k,a,f,h,o,s,e=this.vertices.length,u=this.indices.length,p="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,y="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,w=dn(n,t,i,r),c=u,v=1,l=t,b=i;l<b;l+=r){if(f=e/7,h=o,o=s||[n[l],n[l+1]],l===t){if(s=[n[l+r],n[l+r+1]],i-t==2*r&&uf(o,s))break;if(!w){y&&(e=this.addVertices_([0,0],o,s,v*oht*y,e),e=this.addVertices_([0,0],o,s,-v*oht*y,e),this.indices[u++]=f+2,this.indices[u++]=f,this.indices[u++]=f+1,this.indices[u++]=f+1,this.indices[u++]=f+3,this.indices[u++]=f+2);e=this.addVertices_([0,0],o,s,v*fht*(y||1),e);c=(e=this.addVertices_([0,0],o,s,-v*fht*(y||1),e))/7-1;continue}h=[n[i-2*r],n[i-2*r+1]];k=s}else{if(l===i-r){if(w){s=k;break}h=h||[0,0];e=this.addVertices_(h,o,[0,0],v*eht*(y||1),e);e=this.addVertices_(h,o,[0,0],-v*eht*(y||1),e);this.indices[u++]=f;this.indices[u++]=c-1;this.indices[u++]=c;this.indices[u++]=c;this.indices[u++]=f+1;this.indices[u++]=f;y&&(e=this.addVertices_(h,o,[0,0],v*sht*y,e),e=this.addVertices_(h,o,[0,0],-v*sht*y,e),this.indices[u++]=f+2,this.indices[u++]=f,this.indices[u++]=f+1,this.indices[u++]=f+1,this.indices[u++]=f+3,this.indices[u++]=f+2);break}s=[n[l+r],n[l+r+1]]}a=fb(h[0],h[1],o[0],o[1],s[0],s[1])?-1:1;e=this.addVertices_(h,o,s,a*hht*(p||1),e);e=this.addVertices_(h,o,s,a*dnt*(p||1),e);e=this.addVertices_(h,o,s,-a*cht*(p||1),e);l>t&&(this.indices[u++]=f,this.indices[u++]=c-1,this.indices[u++]=c,this.indices[u++]=f+2,this.indices[u++]=f,this.indices[u++]=v*a>0?c:c-1);this.indices[u++]=f;this.indices[u++]=f+2;this.indices[u++]=f+1;c=f+2;v=a;p&&(e=this.addVertices_(h,o,s,a*gnt*p,e),this.indices[u++]=f+1,this.indices[u++]=f+3,this.indices[u++]=f)}w&&(f=f||e/7,a=go([h[0],h[1],o[0],o[1],s[0],s[1]],0,6,2)?1:-1,e=this.addVertices_(h,o,s,a*hht*(p||1),e),e=this.addVertices_(h,o,s,-a*cht*(p||1),e),this.indices[u++]=f,this.indices[u++]=c-1,this.indices[u++]=c,this.indices[u++]=f+1,this.indices[u++]=f,this.indices[u++]=v*a>0?c:c-1)},t.prototype.addVertices_=function(n,t,i,r,u){return this.vertices[u++]=n[0],this.vertices[u++]=n[1],this.vertices[u++]=t[0],this.vertices[u++]=t[1],this.vertices[u++]=i[0],this.vertices[u++]=i[1],this.vertices[u++]=r,u},t.prototype.isValid_=function(n,t,i,r){var u=i-t;return!(u<2*r)&&(u!==2*r||!uf([n[t],n[t+1]],[n[t+r],n[t+r+1]]))},t.prototype.drawLineString=function(n,t){var i=n.getFlatCoordinates(),r=n.getStride();this.isValid_(i,0,i.length,r)&&(i=yo(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(t),this.drawCoordinates_(i,0,i.length,r))},t.prototype.drawMultiLineString=function(n,t){var f=this.indices.length,i=n.getEnds(),r,s,e,u,o;if(i.unshift(0),e=n.getFlatCoordinates(),u=n.getStride(),i.length>1)for(r=1,s=i.length;r<s;++r)this.isValid_(e,i[r-1],i[r],u)&&(o=yo(e,i[r-1],i[r],u,-this.origin[0],-this.origin[1]),this.drawCoordinates_(o,0,o.length,u));this.indices.length>f&&(this.startIndices.push(f),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(f),this.state_.changed=!1))},t.prototype.drawPolygonCoordinates=function(n,t,i){var r,u;if(dn(n,0,n.length,i)||(n.push(n[0]),n.push(n[1])),this.drawCoordinates_(n,0,n.length,i),t.length)for(r=0,u=t.length;r<u;++r)dn(t[r],0,t[r].length,i)||(t[r].push(t[r][0]),t[r].push(t[r][1])),this.drawCoordinates_(t[r],0,t[r].length,i)},t.prototype.setPolygonStyle=function(n,t){var i=void 0===t?this.indices.length:t;this.startIndices.push(i);this.startIndicesFeature.push(n);this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1)},t.prototype.getCurrentIndex=function(){return this.indices.length},t.prototype.finish=function(){this.verticesBuffer=new vf(this.vertices);this.indicesBuffer=new vf(this.indices);this.startIndices.push(this.indices.length);0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]);this.vertices=null;this.indices=null},t.prototype.getDeleteResourcesFunction=function(n){var t=this.verticesBuffer,i=this.indicesBuffer;return function(){n.deleteBuffer(t);n.deleteBuffer(i)}},t.prototype.setUpProgram=function(n,t,i,r){var u,f=t.getProgram(wnt,bnt);return this.defaultLocations_?u=this.defaultLocations_:(u=new knt(n,f),this.defaultLocations_=u),t.useProgram(f),n.enableVertexAttribArray(u.a_lastPos),n.vertexAttribPointer(u.a_lastPos,2,5126,!1,28,0),n.enableVertexAttribArray(u.a_position),n.vertexAttribPointer(u.a_position,2,5126,!1,28,8),n.enableVertexAttribArray(u.a_nextPos),n.vertexAttribPointer(u.a_nextPos,2,5126,!1,28,16),n.enableVertexAttribArray(u.a_direction),n.vertexAttribPointer(u.a_direction,1,5126,!1,28,24),n.uniform2fv(u.u_size,i),n.uniform1f(u.u_pixelRatio,r),u},t.prototype.shutDownProgram=function(n,t){n.disableVertexAttribArray(t.a_lastPos);n.disableVertexAttribArray(t.a_position);n.disableVertexAttribArray(t.a_nextPos);n.disableVertexAttribArray(t.a_direction)},t.prototype.drawReplay=function(n,t,i,r){var u,e,o,f,s=n.getParameter(n.DEPTH_FUNC),h=n.getParameter(n.DEPTH_WRITEMASK);if(r||(n.enable(n.DEPTH_TEST),n.depthMask(!0),n.depthFunc(n.NOTEQUAL)),wu(i))for(o=this.startIndices[this.startIndices.length-1],u=this.styleIndices_.length-1;u>=0;--u)e=this.styleIndices_[u],f=this.styles_[u],this.setStrokeStyle_(n,f[0],f[1],f[2]),this.drawElements(n,t,e,o),n.clear(n.DEPTH_BUFFER_BIT),o=e;else this.drawReplaySkipping_(n,t,i);r||(n.disable(n.DEPTH_TEST),n.clear(n.DEPTH_BUFFER_BIT),n.depthMask(h),n.depthFunc(s))},t.prototype.drawReplaySkipping_=function(n,t,i){var e,r,u,o,s,f,h;for(f=this.startIndices.length-2,u=r=this.startIndices[f+1],e=this.styleIndices_.length-1;e>=0;--e){for(o=this.styles_[e],this.setStrokeStyle_(n,o[0],o[1],o[2]),s=this.styleIndices_[e];f>=0&&this.startIndices[f]>=s;)h=this.startIndices[f],i[y(this.startIndicesFeature[f])]&&(r!==u&&(this.drawElements(n,t,r,u),n.clear(n.DEPTH_BUFFER_BIT)),u=h),f--,r=h;r!==u&&(this.drawElements(n,t,r,u),n.clear(n.DEPTH_BUFFER_BIT));r=u=s}},t.prototype.drawHitDetectionReplayOneByOne=function(n,t,i,r,u){var e,h,c,o,a,s,f,l;for(f=this.startIndices.length-2,c=this.startIndices[f+1],e=this.styleIndices_.length-1;e>=0;--e)for(o=this.styles_[e],this.setStrokeStyle_(n,o[0],o[1],o[2]),a=this.styleIndices_[e];f>=0&&this.startIndices[f]>=a;){if((h=this.startIndices[f],void 0===i[y(s=this.startIndicesFeature[f])]&&s.getGeometry()&&(void 0===u||dt(u,s.getGeometry().getExtent())))&&(n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),this.drawElements(n,t,h,c),l=r(s),l))return l;f--;c=h}},t.prototype.setStrokeStyle_=function(n,t,i,r){n.uniform4fv(this.defaultLocations_.u_color,t);n.uniform1f(this.defaultLocations_.u_lineWidth,i);n.uniform1f(this.defaultLocations_.u_miterLimit,r)},t.prototype.setFillStrokeStyle=function(n,t){var e=t.getLineCap(),o,s,f,i,r,u;this.state_.lineCap=void 0!==e?e:"round";o=t.getLineDash();this.state_.lineDash=o||bn;s=t.getLineDashOffset();this.state_.lineDashOffset=s||0;f=t.getLineJoin();this.state_.lineJoin=void 0!==f?f:"round";i=t.getColor();i=i instanceof CanvasGradient||i instanceof CanvasPattern?kv:yh(i).map(function(n,t){return 3!=t?n/255:n})||kv;r=t.getWidth();r=void 0!==r?r:1;u=t.getMiterLimit();u=void 0!==u?u:10;this.state_.strokeColor&&uf(this.state_.strokeColor,i)&&this.state_.lineWidth===r&&this.state_.miterLimit===u||(this.state_.changed=!0,this.state_.strokeColor=i,this.state_.lineWidth=r,this.state_.miterLimit=u,this.styles_.push([i,r,u]))},t}(ub),nti=new cl("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"),tti=new ll("\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"),iti=function(n,t){this.u_projectionMatrix=n.getUniformLocation(t,"u_projectionMatrix");this.u_offsetScaleMatrix=n.getUniformLocation(t,"u_offsetScaleMatrix");this.u_offsetRotateMatrix=n.getUniformLocation(t,"u_offsetRotateMatrix");this.u_color=n.getUniformLocation(t,"u_color");this.u_opacity=n.getUniformLocation(t,"u_opacity");this.a_position=n.getAttribLocation(t,"a_position")},gu=function(n){this.first_;this.last_;this.head_;this.circular_=void 0===n||n;this.length_=0};gu.prototype.insertItem=function(n){var t={prev:void 0,next:void 0,data:n},i=this.head_,r;i?(r=i.next,t.prev=i,t.next=r,i.next=t,r&&(r.prev=t),i===this.last_&&(this.last_=t)):(this.first_=t,this.last_=t,this.circular_&&(t.next=t,t.prev=t));this.head_=t;this.length_++};gu.prototype.removeItem=function(){var t=this.head_,i,n;t&&(i=t.next,n=t.prev,i&&(i.prev=n),n&&(n.next=i),this.head_=i||n,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_=n?this.head_.prev:this.head_),this.length_--)};gu.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data};gu.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data};gu.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data};gu.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data};gu.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data};gu.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data};gu.prototype.getCurrItem=function(){if(this.head_)return this.head_.data};gu.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)};gu.prototype.concat=function(n){if(n.head_){if(this.head_){var t=this.head_.next;this.head_.next=n.first_;n.first_.prev=this.head_;t.prev=n.last_;n.last_.next=t;this.length_+=n.length_}else this.head_=n.head_,this.first_=n.first_,this.last_=n.last_,this.length_=n.length_;n.head_=void 0;n.first_=void 0;n.last_=void 0;n.length_=0}};gu.prototype.getLength=function(){return this.length_};ob=gu;uu=function(n){this.rbush_=an()(n,void 0);this.items_={}};uu.prototype.insert=function(n,t){var i={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:t};this.rbush_.insert(i);this.items_[y(t)]=i};uu.prototype.load=function(n,t){for(var u=new Array(t.length),i=0,o=t.length;i<o;i++){var r=n[i],f=t[i],e={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:f};u[i]=e;this.items_[y(f)]=e}this.rbush_.load(u)};uu.prototype.remove=function(n){var t=y(n),i=this.items_[t];return delete this.items_[t],null!==this.rbush_.remove(i)};uu.prototype.update=function(n,t){var i=this.items_[y(t)];oe([i.minX,i.minY,i.maxX,i.maxY],n)||(this.remove(t),this.insert(n,t))};uu.prototype.getAll=function(){return this.rbush_.all().map(function(n){return n.value})};uu.prototype.getInExtent=function(n){var t={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]};return this.rbush_.search(t).map(function(n){return n.value})};uu.prototype.forEach=function(n,t){return this.forEach_(this.getAll(),n,t)};uu.prototype.forEachInExtent=function(n,t,i){return this.forEach_(this.getInExtent(n),t,i)};uu.prototype.forEach_=function(n,t,i){for(var r,u=0,f=n.length;u<f;u++)if(r=t.call(i,n[u]))return r;return r};uu.prototype.isEmpty=function(){return wu(this.items_)};uu.prototype.clear=function(){this.rbush_.clear();this.items_={}};uu.prototype.getExtent=function(n){var t=this.rbush_.toJSON();return ef(t.minX,t.minY,t.maxX,t.maxY,n)};uu.prototype.concat=function(n){for(var t in this.rbush_.load(n.rbush_.all()),n.items_)this.items_[t]=n.items_[t]};var ic=uu,rti=function(n){function t(t,i){n.call(this,t,i);this.lineStringReplay=new lht(t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={fillColor:null,changed:!1}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(n,t,i){var o=new ob,f=new ic,c,r,l,e,u;if(this.processFlatCoordinates_(n,i,o,f,!0),c=this.getMaxCoords_(o),t.length){for(e=[],r=0,l=t.length;r<l;++r)u={list:new ob,maxCoords:void 0,rtree:new ic},e.push(u),this.processFlatCoordinates_(t[r],i,u.list,u.rtree,!1),this.classifyPoints_(u.list,u.rtree,!0),u.maxCoords=this.getMaxCoords_(u.list);for(e.sort(function(n,t){return t.maxCoords[0]===n.maxCoords[0]?n.maxCoords[1]-t.maxCoords[1]:t.maxCoords[0]-n.maxCoords[0]}),r=0;r<e.length;++r){var s=e[r].list,a=s.firstItem(),h=a,v=void 0;do{if(this.getIntersections_(h,f).length){v=!0;break}h=s.nextItem()}while(a!==h);v||this.bridgeHole_(s,e[r].maxCoords[0],o,c[0],f)&&(f.concat(e[r].rtree),this.classifyPoints_(o,f,!1))}}else this.classifyPoints_(o,f,!1);this.triangulate_(o,f)},t.prototype.processFlatCoordinates_=function(n,t,i,r,u){var o,c,l,e,f,y=go(n,0,n.length,t),a=this.vertices.length/2,s=[],h=[],v;if(u===y){for(e=l=this.createPoint_(n[0],n[1],a++),o=t,c=n.length;o<c;o+=t)f=this.createPoint_(n[o],n[o+1],a++),h.push(this.insertItem_(e,f,i)),s.push([Math.min(e.x,f.x),Math.min(e.y,f.y),Math.max(e.x,f.x),Math.max(e.y,f.y)]),e=f;h.push(this.insertItem_(f,l,i));s.push([Math.min(e.x,f.x),Math.min(e.y,f.y),Math.max(e.x,f.x),Math.max(e.y,f.y)])}else{for(v=n.length-t,e=l=this.createPoint_(n[v],n[v+1],a++),o=v-t,c=0;o>=c;o-=t)f=this.createPoint_(n[o],n[o+1],a++),h.push(this.insertItem_(e,f,i)),s.push([Math.min(e.x,f.x),Math.min(e.y,f.y),Math.max(e.x,f.x),Math.max(e.y,f.y)]),e=f;h.push(this.insertItem_(f,l,i));s.push([Math.min(e.x,f.x),Math.min(e.y,f.y),Math.max(e.x,f.x),Math.max(e.y,f.y)])}r.load(s,h)},t.prototype.getMaxCoords_=function(n){var r=n.firstItem(),t=r,i=[t.p0.x,t.p0.y];do(t=n.nextItem()).p0.x>i[0]&&(i=[t.p0.x,t.p0.y]);while(t!==r);return i},t.prototype.classifyPoints_=function(n,t,i){var f=n.firstItem(),r=f,u=n.nextItem(),o=!1,e;do e=i?fb(u.p1.x,u.p1.y,r.p1.x,r.p1.y,r.p0.x,r.p0.y):fb(r.p0.x,r.p0.y,r.p1.x,r.p1.y,u.p1.x,u.p1.y),void 0===e?(this.removeItem_(r,u,n,t),o=!0,u===f&&(f=n.getNextItem()),u=r,n.prevItem()):r.p1.reflex!==e&&(r.p1.reflex=e,o=!0),r=u,u=n.nextItem();while(r!==f);return o},t.prototype.bridgeHole_=function(n,t,i,r,u){for(var v,y,c,p,k,d,f=n.firstItem();f.p1.x!==t;)f=n.nextItem();for(var h,g,e=f.p1,w={x:r,y:e.y,i:-1},a=1/0,nt=this.getIntersections_({p0:e,p1:w},u,!0),o=0,l=nt.length;o<l;++o){var s=nt[o],b=this.calculateIntersection_(e,w,s.p0,s.p1,!0),tt=Math.abs(e.x-b[0]);tt<a&&void 0!==fb(e.x,e.y,s.p0.x,s.p0.y,s.p1.x,s.p1.y)&&(a=tt,g={x:b[0],y:b[1],i:-1},f=s)}if(a===1/0)return!1;if((h=f.p1,a>0)&&(v=this.getPointsInTriangle_(e,g,f.p1,u),v.length))for(y=1/0,o=0,l=v.length;o<l;++o)c=v[o],p=Math.atan2(e.y-c.y,w.x-c.x),(p<y||p===y&&c.x<h.x)&&(y=p,h=c);for(f=i.firstItem();f.p1.x!==h.x||f.p1.y!==h.y;)f=i.nextItem();return k={x:e.x,y:e.y,i:e.i,reflex:void 0},d={x:f.p1.x,y:f.p1.y,i:f.p1.i,reflex:void 0},n.getNextItem().p0=k,this.insertItem_(e,f.p1,n,u),this.insertItem_(d,k,n,u),f.p1=d,n.setFirstItem(),i.concat(n),!0},t.prototype.triangulate_=function(n,t){for(var u,i=!1,r=this.isSimple_(n,t);n.getLength()>3;)if(r){if(!this.clipEars_(n,t,r,i)&&!this.classifyPoints_(n,t,i)&&!this.resolveSelfIntersections_(n,t,!0))break}else if(!this.clipEars_(n,t,r,i)&&!this.classifyPoints_(n,t,i)&&!this.resolveSelfIntersections_(n,t)){if(!(r=this.isSimple_(n,t))){this.splitPolygon_(n,t);break}i=!this.isClockwise_(n);this.classifyPoints_(n,t,i)}3===n.getLength()&&(u=this.indices.length,this.indices[u++]=n.getPrevItem().p0.i,this.indices[u++]=n.getCurrItem().p0.i,this.indices[u++]=n.getNextItem().p0.i)},t.prototype.clipEars_=function(n,t,i,r){var u,e,f,a=this.indices.length,c=n.firstItem(),s=n.getPrevItem(),h=c,l=n.nextItem(),o=n.getNextItem(),y=!1,v;do(u=h.p0,e=h.p1,f=l.p1,!1===e.reflex)&&(v=void 0,v=i?0===this.getPointsInTriangle_(u,e,f,t,!0).length:r?this.diagonalIsInside_(o.p1,f,e,u,s.p0):this.diagonalIsInside_(s.p0,u,e,f,o.p1),(i||0===this.getIntersections_({p0:u,p1:f},t).length)&&v&&(i||!1===u.reflex||!1===f.reflex||go([s.p0.x,s.p0.y,u.x,u.y,e.x,e.y,f.x,f.y,o.p1.x,o.p1.y],0,10,2)===!r)&&(this.indices[a++]=u.i,this.indices[a++]=e.i,this.indices[a++]=f.i,this.removeItem_(h,l,n,t),l===c&&(c=o),y=!0)),s=n.getPrevItem(),h=n.getCurrItem(),l=n.nextItem(),o=n.getNextItem();while(h!==c&&n.getLength()>3);return y},t.prototype.resolveSelfIntersections_=function(n,t,i){var s=n.firstItem(),e,f;n.nextItem();var r=s,u=n.nextItem(),l=!1;do{if(e=this.calculateIntersection_(r.p0,r.p1,u.p0,u.p1,i),e){var o=!1,a=this.vertices.length,c=this.indices.length,v=a/2,h=n.prevItem();if(n.removeItem(),t.remove(h),o=h===s,f=void 0,i?(e[0]===r.p0.x&&e[1]===r.p0.y?(n.prevItem(),f=r.p0,u.p0=f,t.remove(r),o=o||r===s):(f=u.p1,r.p1=f,t.remove(u),o=o||u===s),n.removeItem()):(f=this.createPoint_(e[0],e[1],v),r.p1=f,u.p0=f,t.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r),t.update([Math.min(u.p0.x,u.p1.x),Math.min(u.p0.y,u.p1.y),Math.max(u.p0.x,u.p1.x),Math.max(u.p0.y,u.p1.y)],u)),this.indices[c++]=h.p0.i,this.indices[c++]=h.p1.i,this.indices[c++]=f.i,l=!0,o)break}r=n.getPrevItem();u=n.nextItem()}while(r!==s);return l},t.prototype.isSimple_=function(n,t){var r=n.firstItem(),i=r;do{if(this.getIntersections_(i,t).length)return!1;i=n.nextItem()}while(i!==r);return!0},t.prototype.isClockwise_=function(n){var r=2*n.getLength(),i=new Array(r),u=n.firstItem(),t=u,f=0;do i[f++]=t.p0.x,i[f++]=t.p0.y,t=n.nextItem();while(t!==u);return go(i,0,r,2)},t.prototype.splitPolygon_=function(n,t){var h=n.firstItem(),i=h,s,f;do{if(s=this.getIntersections_(i,t),s.length){var u=s[0],l=this.vertices.length/2,c=this.calculateIntersection_(i.p0,i.p1,u.p0,u.p1),r=this.createPoint_(c[0],c[1],l),e=new ob,o=new ic;for(this.insertItem_(r,i.p1,e,o),i.p1=r,t.update([Math.min(i.p0.x,r.x),Math.min(i.p0.y,r.y),Math.max(i.p0.x,r.x),Math.max(i.p0.y,r.y)],i),f=n.nextItem();f!==u;)this.insertItem_(f.p0,f.p1,e,o),t.remove(f),n.removeItem(),f=n.getCurrItem();this.insertItem_(u.p0,r,e,o);u.p0=r;t.update([Math.min(u.p1.x,r.x),Math.min(u.p1.y,r.y),Math.max(u.p1.x,r.x),Math.max(u.p1.y,r.y)],u);this.classifyPoints_(n,t,!1);this.triangulate_(n,t);this.classifyPoints_(e,o,!1);this.triangulate_(e,o);break}i=n.nextItem()}while(i!==h)},t.prototype.createPoint_=function(n,t,i){var r=this.vertices.length;return this.vertices[r++]=n,this.vertices[r++]=t,{x:n,y:t,i:i,reflex:void 0}},t.prototype.insertItem_=function(n,t,i,r){var u={p0:n,p1:t};return i.insertItem(u),r&&r.insert([Math.min(n.x,t.x),Math.min(n.y,t.y),Math.max(n.x,t.x),Math.max(n.y,t.y)],u),u},t.prototype.removeItem_=function(n,t,i,r){i.getCurrItem()===t&&(i.removeItem(),n.p1=t.p1,r.remove(t),r.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))},t.prototype.getPointsInTriangle_=function(n,t,i,r,u){for(var h,f,o=[],s=r.getInExtent([Math.min(n.x,t.x,i.x),Math.min(n.y,t.y,i.y),Math.max(n.x,t.x,i.x),Math.max(n.y,t.y,i.y)]),e=0,c=s.length;e<c;++e)for(h in s[e])f=s[e][h],"object"==typeof f&&(!u||f.reflex)&&(f.x!==n.x||f.y!==n.y)&&(f.x!==t.x||f.y!==t.y)&&(f.x!==i.x||f.y!==i.y)&&-1===o.indexOf(f)&&ko([n.x,n.y,t.x,t.y,i.x,i.y],0,6,2,f.x,f.y)&&o.push(f);return o},t.prototype.getIntersections_=function(n,t,i){for(var r,u=n.p0,f=n.p1,o=t.getInExtent([Math.min(u.x,f.x),Math.min(u.y,f.y),Math.max(u.x,f.x),Math.max(u.y,f.y)]),s=[],e=0,h=o.length;e<h;++e)r=o[e],n!==r&&(i||r.p0!==f||r.p1!==u)&&this.calculateIntersection_(u,f,r.p0,r.p1,i)&&s.push(r);return s},t.prototype.calculateIntersection_=function(n,t,i,r,u){var o=(r.y-i.y)*(t.x-n.x)-(r.x-i.x)*(t.y-n.y),f,e;if(0!==o&&(f=((r.x-i.x)*(n.y-i.y)-(r.y-i.y)*(n.x-i.x))/o,e=((t.x-n.x)*(n.y-i.y)-(t.y-n.y)*(n.x-i.x))/o,!u&&f>al&&f<1-al&&e>al&&e<1-al||u&&f>=0&&f<=1&&e>=0&&e<=1))return[n.x+f*(t.x-n.x),n.y+f*(t.y-n.y)]},t.prototype.diagonalIsInside_=function(n,t,i,r,u){if(void 0===t.reflex||void 0===r.reflex)return!1;var f=(i.x-r.x)*(t.y-r.y)>(i.y-r.y)*(t.x-r.x),e=(u.x-r.x)*(t.y-r.y)<(u.y-r.y)*(t.x-r.x),o=(n.x-t.x)*(r.y-t.y)>(n.y-t.y)*(r.x-t.x),s=(i.x-t.x)*(r.y-t.y)<(i.y-t.y)*(r.x-t.x),h=r.reflex?e||f:e&&f,c=t.reflex?s||o:s&&o;return h&&c},t.prototype.drawMultiPolygon=function(n,t){for(var r,l,a=n.getEndss(),f=n.getStride(),s=this.indices.length,v=this.lineStringReplay.getCurrentIndex(),y=n.getFlatCoordinates(),p=0,i,e,o,h,u=0,c=a.length;u<c;++u){if(i=a[u],i.length>0&&(e=yo(y,p,i[0],f,-this.origin[0],-this.origin[1]),e.length)){for(o=[],h=void 0,r=1,l=i.length;r<l;++r)i[r]!==i[r-1]&&(h=yo(y,i[r-1],i[r],f,-this.origin[0],-this.origin[1]),o.push(h));this.lineStringReplay.drawPolygonCoordinates(e,o,f);this.drawCoordinates_(e,o,f)}p=i[i.length-1]}this.indices.length>s&&(this.startIndices.push(s),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1));this.lineStringReplay.getCurrentIndex()>v&&this.lineStringReplay.setPolygonStyle(t,v)},t.prototype.drawPolygon=function(n,t){var i=n.getEnds(),u=n.getStride(),o,f,r,s,h,e;if(i.length>0&&(o=n.getFlatCoordinates().map(Number),f=yo(o,0,i[0],u,-this.origin[0],-this.origin[1]),f.length)){for(e=[],r=1,s=i.length;r<s;++r)i[r]!==i[r-1]&&(h=yo(o,i[r-1],i[r],u,-this.origin[0],-this.origin[1]),e.push(h));this.startIndices.push(this.indices.length);this.startIndicesFeature.push(t);this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1);this.lineStringReplay.setPolygonStyle(t);this.lineStringReplay.drawPolygonCoordinates(f,e,u);this.drawCoordinates_(f,e,u)}},t.prototype.finish=function(n){this.verticesBuffer=new vf(this.vertices);this.indicesBuffer=new vf(this.indices);this.startIndices.push(this.indices.length);this.lineStringReplay.finish(n);0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]);this.vertices=null;this.indices=null},t.prototype.getDeleteResourcesFunction=function(n){var t=this.verticesBuffer,i=this.indicesBuffer,r=this.lineStringReplay.getDeleteResourcesFunction(n);return function(){n.deleteBuffer(t);n.deleteBuffer(i);r()}},t.prototype.setUpProgram=function(n,t){var i,r=t.getProgram(nti,tti);return this.defaultLocations_?i=this.defaultLocations_:(i=new iti(n,r),this.defaultLocations_=i),t.useProgram(r),n.enableVertexAttribArray(i.a_position),n.vertexAttribPointer(i.a_position,2,5126,!1,8,0),i},t.prototype.shutDownProgram=function(n,t){n.disableVertexAttribArray(t.a_position)},t.prototype.drawReplay=function(n,t,i,r){var u,f,e,o,s=n.getParameter(n.DEPTH_FUNC),h=n.getParameter(n.DEPTH_WRITEMASK);if(r||(n.enable(n.DEPTH_TEST),n.depthMask(!0),n.depthFunc(n.NOTEQUAL)),wu(i))for(e=this.startIndices[this.startIndices.length-1],u=this.styleIndices_.length-1;u>=0;--u)f=this.styleIndices_[u],o=this.styles_[u],this.setFillStyle_(n,o),this.drawElements(n,t,f,e),e=f;else this.drawReplaySkipping_(n,t,i);r||(n.disable(n.DEPTH_TEST),n.clear(n.DEPTH_BUFFER_BIT),n.depthMask(h),n.depthFunc(s))},t.prototype.drawHitDetectionReplayOneByOne=function(n,t,i,r,u){var e,s,h,l,a,o,f,c;for(f=this.startIndices.length-2,h=this.startIndices[f+1],e=this.styleIndices_.length-1;e>=0;--e)for(l=this.styles_[e],this.setFillStyle_(n,l),a=this.styleIndices_[e];f>=0&&this.startIndices[f]>=a;){if((s=this.startIndices[f],void 0===i[y(o=this.startIndicesFeature[f])]&&o.getGeometry()&&(void 0===u||dt(u,o.getGeometry().getExtent())))&&(n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),this.drawElements(n,t,s,h),c=r(o),c))return c;f--;h=s}},t.prototype.drawReplaySkipping_=function(n,t,i){var e,r,u,h,o,f,s;for(f=this.startIndices.length-2,u=r=this.startIndices[f+1],e=this.styleIndices_.length-1;e>=0;--e){for(h=this.styles_[e],this.setFillStyle_(n,h),o=this.styleIndices_[e];f>=0&&this.startIndices[f]>=o;)s=this.startIndices[f],i[y(this.startIndicesFeature[f])]&&(r!==u&&(this.drawElements(n,t,r,u),n.clear(n.DEPTH_BUFFER_BIT)),u=s),f--,r=s;r!==u&&(this.drawElements(n,t,r,u),n.clear(n.DEPTH_BUFFER_BIT));r=u=o}},t.prototype.setFillStyle_=function(n,t){n.uniform4fv(this.defaultLocations_.u_color,t)},t.prototype.setFillStrokeStyle=function(n,t){var i=n?n.getColor():[0,0,0,0],r;(i=i instanceof CanvasGradient||i instanceof CanvasPattern?bv:yh(i).map(function(n,t){return 3!=t?n/255:n})||bv,this.state_.fillColor&&uf(i,this.state_.fillColor)||(this.state_.fillColor=i,this.state_.changed=!0,this.styles_.push(i)),t)?this.lineStringReplay.setFillStrokeStyle(null,t):(r=new hf({color:[0,0,0,0],width:0}),this.lineStringReplay.setFillStrokeStyle(null,r))},t}(ub),dv=function(n,t){this.space_=t;this.emptyBlocks_=[{x:0,y:0,width:n,height:n}];this.entries_={};this.context_=kt(n,n);this.canvas_=this.context_.canvas};dv.prototype.get=function(n){return this.entries_[n]||null};dv.prototype.add=function(n,t,i,r,u){for(var f,o,e=0,s=this.emptyBlocks_.length;e<s;++e)if(f=this.emptyBlocks_[e],f.width>=t+this.space_&&f.height>=i+this.space_)return o={offsetX:f.x+this.space_,offsetY:f.y+this.space_,image:this.canvas_},this.entries_[n]=o,r.call(u,this.context_,f.x+this.space_,f.y+this.space_),this.split_(e,f,t+this.space_,i+this.space_),o;return null};dv.prototype.split_=function(n,t,i,r){var u,f;t.width-i>t.height-r?(u={x:t.x+i,y:t.y,width:t.width-i,height:t.height},f={x:t.x,y:t.y+r,width:i,height:t.height-r},this.updateBlocks_(n,u,f)):(u={x:t.x+i,y:t.y,width:t.width-i,height:r},f={x:t.x,y:t.y+r,width:t.width,height:t.height-r},this.updateBlocks_(n,u,f))};dv.prototype.updateBlocks_=function(n,t,i){var r=[n,1];t.width>0&&t.height>0&&r.push(t);i.width>0&&i.height>0&&r.push(i);this.emptyBlocks_.splice.apply(this.emptyBlocks_,r)};sb=dv;rc=function(n){var t=n||{};this.currentSize_=void 0!==t.initialSize?t.initialSize:256;this.maxSize_=void 0!==t.maxSize?t.maxSize:void 0!==wn?wn:2048;this.space_=void 0!==t.space?t.space:1;this.atlases_=[new sb(this.currentSize_,this.space_)];this.currentHitSize_=this.currentSize_;this.hitAtlases_=[new sb(this.currentHitSize_,this.space_)]};rc.prototype.getInfo=function(n){var t=this.getInfo_(this.atlases_,n),i;return t?(i=this.getInfo_(this.hitAtlases_,n),this.mergeInfos_(t,i)):null};rc.prototype.getInfo_=function(n,t){for(var r,i=0,u=n.length;i<u;++i)if(r=n[i].get(t),r)return r;return null};rc.prototype.mergeInfos_=function(n,t){return{offsetX:n.offsetX,offsetY:n.offsetY,image:n.image,hitImage:t.image}};rc.prototype.add=function(n,t,i,r,u,f){var e,o,s;return t+this.space_>this.maxSize_||i+this.space_>this.maxSize_?null:(e=this.add_(!1,n,t,i,r,f),!e)?null:(o=void 0!==u?u:wf,s=this.add_(!0,n,t,i,o,f),this.mergeInfos_(e,s))};rc.prototype.add_=function(n,t,i,r,u,f){for(var h,c,l=n?this.hitAtlases_:this.atlases_,e,o=0,s=l.length;o<s;++o){if(c=(h=l[o]).add(t,i,r,u,f))return c;c||o!==s-1||(e=void 0,n?(e=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=e):(e=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=e),h=new sb(e,this.space_),l.push(h),++s)}return null};var aht=rc,uti=function(n){function t(t,i){n.call(this,t,i);this.images_=[];this.textures_=[];this.measureCanvas_=kt(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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawText=function(n,t){var u;if(this.text_){var r=null,c=2,v=2;switch(n.getType()){case f.POINT:case f.MULTI_POINT:c=(r=n.getFlatCoordinates()).length;v=n.getStride();break;case f.CIRCLE:r=n.getCenter();break;case f.LINE_STRING:r=n.getFlatMidpoint();break;case f.MULTI_LINE_STRING:c=(r=n.getFlatMidpoints()).length;break;case f.POLYGON:r=n.getFlatInteriorPoint();break;case f.MULTI_POLYGON:c=(r=n.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(t);for(var i,w,l,b,o,s,h=this.currAtlas_,a=this.text_.split("\n"),k=this.getTextSize_(a),g=Math.round(k[0]*this.textAlign_-this.offsetX_),nt=Math.round(k[1]*this.textBaseline_-this.offsetY_),d=this.state_.lineWidth/2*this.state_.scale,e=0,p=a.length;e<p;++e)for(l=0,b=h.height*e,i=0,w=(o=a[e].split("")).length;i<w;++i)(s=h.atlas.getInfo(o[i]))&&(u=s.image,(this.anchorX=g-l,this.anchorY=nt-b,this.originX=0===i?s.offsetX-d:s.offsetX,this.originY=s.offsetY,this.height=h.height,this.width=0===i||i===o.length-1?h.width[o[i]]+d:h.width[o[i]],this.imageHeight=u.height,this.imageWidth=u.width,0===this.images_.length)?this.images_.push(u):y(this.images_[this.images_.length-1])!=y(u)&&(this.groupIndices.push(this.indices.length),this.images_.push(u)),this.drawText_(r,0,c,v)),l+=this.width}},t.prototype.getTextSize_=function(n){var i=this,t=this.currAtlas_,r=n.length*t.height;return[n.map(function(n){for(var r,f=0,u=0,e=n.length;u<e;++u)r=n[u],t.width[r]||i.addCharToAtlas_(r),f+=t.width[r]?t.width[r]:0;return f}).reduce(function(n,t){return Math.max(n,t)}),r]},t.prototype.drawText_=function(n,t,i,r){for(var u=t,f=i;u<f;u+=r)this.drawCoordinates(n,t,i,r)},t.prototype.addCharToAtlas_=function(n){var r;if(1===n.length){var i=this.currAtlas_,t=this.state_,u=this.measureCanvas_.getContext("2d");u.font=t.font;r=Math.ceil(u.measureText(n).width*t.scale);i.atlas.add(n,r,i.height,function(i,r,u){i.font=t.font;i.fillStyle=t.fillColor;i.strokeStyle=t.strokeColor;i.lineWidth=t.lineWidth;i.lineCap=t.lineCap;i.lineJoin=t.lineJoin;i.miterLimit=t.miterLimit;i.textAlign="left";i.textBaseline="top";il&&t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset);1!==t.scale&&i.setTransform(t.scale,0,0,t.scale,0,0);t.strokeColor&&i.strokeText(n,r,u);t.fillColor&&i.fillText(n,r,u)})&&(i.width[n]=r)}},t.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices=this.groupIndices;this.verticesBuffer=new vf(this.vertices);this.indicesBuffer=new vf(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;n.prototype.finish.call(this,t)},t.prototype.setTextStyle=function(n){var t=this.state_,r=n.getFill(),i=n.getStroke(),o,s,u,f,e;n&&n.getText()&&(r||i)?(r?(o=r.getColor(),t.fillColor=du(o||bv)):t.fillColor=null,i?(s=i.getColor(),t.strokeColor=du(s||kv),t.lineWidth=i.getWidth()||1,t.lineCap=i.getLineCap()||"round",t.lineDashOffset=i.getLineDashOffset()||0,t.lineJoin=i.getLineJoin()||"round",t.miterLimit=i.getMiterLimit()||10,u=i.getLineDash(),t.lineDash=u?u.slice():bn):(t.strokeColor=null,t.lineWidth=0),t.font=n.getFont()||"10px sans-serif",t.scale=n.getScale()||1,this.text_=n.getText(),f=tc[n.getTextAlign()],e=tc[n.getTextBaseline()],this.textAlign_=void 0===f?.5:f,this.textBaseline_=void 0===e?.5:e,this.offsetX_=n.getOffsetX()||0,this.offsetY_=n.getOffsetY()||0,this.rotateWithView=!!n.getRotateWithView(),this.rotation=n.getRotation()||0,this.currAtlas_=this.getAtlas_(t)):this.text_=""},t.prototype.getAtlas_=function(n){var i=[],t,r,u,f;for(t in n)(n[t]||0===n[t])&&(Array.isArray(n[t])?i=i.concat(n[t]):i.push(n[t]));return r=this.calculateHash_(i),this.atlases_[r]||(u=this.measureCanvas_.getContext("2d"),u.font=n.font,f=Math.ceil((1.5*u.measureText("M").width+n.lineWidth/2)*n.scale),this.atlases_[r]={atlas:new aht({space:n.lineWidth+1}),width:{},height:f}),this.atlases_[r]},t.prototype.calculateHash_=function(n){for(var i="",t=0,r=n.length;t<r;++t)i+=n[t];return i},t.prototype.getTextures=function(){return this.textures_},t.prototype.getHitDetectionTextures=function(){return this.textures_},t}(uht),vht=[1,1],fti={Circle:cnt,Image:pnt,LineString:lht,Polygon:rti,Text:uti},os=function(n){function t(t,i,r){n.call(this);this.maxExtent_=i;this.tolerance_=t;this.renderBuffer_=r;this.replaysByZIndex_={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addDeclutter=function(){return[]},t.prototype.getDeleteResourcesFunction=function(n){var r,t=[],i,u;for(r in this.replaysByZIndex_){i=this.replaysByZIndex_[r];for(u in i)t.push(i[u].getDeleteResourcesFunction(n))}return function(){for(var i,r=arguments,u=t.length,n=0;n<u;n++)i=t[n].apply(this,r);return i}},t.prototype.finish=function(n){var i,t,r;for(i in this.replaysByZIndex_){t=this.replaysByZIndex_[i];for(r in t)t[r].finish(n)}},t.prototype.getReplay=function(n,t){var u=void 0!==n?n.toString():"0",i=this.replaysByZIndex_[u],r;return void 0===i&&(i={},this.replaysByZIndex_[u]=i),r=i[t],void 0===r&&(r=new fti[t](this.tolerance_,this.maxExtent_),i[t]=r),r},t.prototype.isEmpty=function(){return wu(this.replaysByZIndex_)},t.prototype.replay=function(n,t,i,r,u,f,e,o){var s,a,h,v,y,c,l=Object.keys(this.replaysByZIndex_).map(Number);for(l.sort(lo),s=0,a=l.length;s<a;++s)for(y=this.replaysByZIndex_[l[s].toString()],h=0,v=fs.length;h<v;++h)c=y[fs[h]],void 0!==c&&c.replay(n,t,i,r,u,f,e,o,void 0,!1)},t.prototype.replayHitDetection_=function(n,t,i,r,u,f,e,o,s,h,c){var l,y,a,p,w,b,v=Object.keys(this.replaysByZIndex_).map(Number);for(v.sort(function(n,t){return t-n}),l=0,y=v.length;l<y;++l)for(p=this.replaysByZIndex_[v[l].toString()],a=fs.length-1;a>=0;--a)if(void 0!==(w=p[fs[a]])&&(b=w.replay(n,t,i,r,u,f,e,o,s,h,c)))return b},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u,f,e,o,s,h){var l,c=t.getGL();return c.bindFramebuffer(c.FRAMEBUFFER,t.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(l=ff(uh(n),r*this.renderBuffer_)),this.replayHitDetection_(t,n,r,u,vht,e,o,s,function(n){var i=new Uint8Array(4),t;if((c.readPixels(0,0,1,1,c.RGBA,c.UNSIGNED_BYTE,i),i[3]>0)&&(t=h(n),t))return t},!0,l)},t.prototype.hasFeatureAtCoordinate=function(n,t,i,r,u,f,e,o,s){var h=t.getGL();return h.bindFramebuffer(h.FRAMEBUFFER,t.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(t,n,r,u,vht,e,o,s,function(){var n=new Uint8Array(4);return h.readPixels(0,0,1,1,h.RGBA,h.UNSIGNED_BYTE,n),n[3]>0},!1)},t}(vn),yht=function(n){function t(t,i,r,u,f,e,o){n.call(this);this.context_=t;this.center_=i;this.extent_=e;this.pixelRatio_=o;this.size_=f;this.rotation_=u;this.resolution_=r;this.imageStyle_=null;this.fillStyle_=null;this.strokeStyle_=null;this.textStyle_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.drawText_=function(n,t){var r=this.context_,i=n.getReplay(0,ft.TEXT);i.setTextStyle(this.textStyle_);i.drawText(t,null);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)()},t.prototype.setStyle=function(n){this.setFillStrokeStyle(n.getFill(),n.getStroke());this.setImageStyle(n.getImage());this.setTextStyle(n.getText())},t.prototype.drawGeometry=function(n){switch(n.getType()){case f.POINT:this.drawPoint(n,null);break;case f.LINE_STRING:this.drawLineString(n,null);break;case f.POLYGON:this.drawPolygon(n,null);break;case f.MULTI_POINT:this.drawMultiPoint(n,null);break;case f.MULTI_LINE_STRING:this.drawMultiLineString(n,null);break;case f.MULTI_POLYGON:this.drawMultiPolygon(n,null);break;case f.GEOMETRY_COLLECTION:this.drawGeometryCollection(n,null);break;case f.CIRCLE:this.drawCircle(n,null)}},t.prototype.drawFeature=function(n,t){var i=t.getGeometryFunction()(n);i&&dt(this.extent_,i.getExtent())&&(this.setStyle(t),this.drawGeometry(i))},t.prototype.drawGeometryCollection=function(n){for(var r=n.getGeometriesArray(),t=0,i=r.length;t<i;++t)this.drawGeometry(r[t])},t.prototype.drawPoint=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.IMAGE);i.setImageStyle(this.imageStyle_);i.drawPoint(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.drawMultiPoint=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.IMAGE);i.setImageStyle(this.imageStyle_);i.drawMultiPoint(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.drawLineString=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.LINE_STRING);i.setFillStrokeStyle(null,this.strokeStyle_);i.drawLineString(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.drawMultiLineString=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.LINE_STRING);i.setFillStrokeStyle(null,this.strokeStyle_);i.drawMultiLineString(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.drawPolygon=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.POLYGON);i.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);i.drawPolygon(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.drawMultiPolygon=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.POLYGON);i.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);i.drawMultiPolygon(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.drawCircle=function(n,t){var r=this.context_,u=new os(1,this.extent_),i=u.getReplay(0,ft.CIRCLE);i.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);i.drawCircle(n,t);i.finish(r);i.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1);i.getDeleteResourcesFunction(r)();this.textStyle_&&this.drawText_(u,n)},t.prototype.setImageStyle=function(n){this.imageStyle_=n},t.prototype.setFillStrokeStyle=function(n,t){this.fillStyle_=n;this.strokeStyle_=t},t.prototype.setTextStyle=function(n){this.textStyle_=n},t}(fv),eti=new cl("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"),oti=new ll("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"),sti=function(n,t){this.u_texCoordMatrix=n.getUniformLocation(t,"u_texCoordMatrix");this.u_projectionMatrix=n.getUniformLocation(t,"u_projectionMatrix");this.u_opacity=n.getUniformLocation(t,"u_opacity");this.u_texture=n.getUniformLocation(t,"u_texture");this.a_position=n.getAttribLocation(t,"a_position");this.a_texCoord=n.getAttribLocation(t,"a_texCoord")},gn=function(n){function t(t,i){n.call(this,i);this.mapRenderer=t;this.arrayBuffer_=new vf([-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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.bindFramebuffer=function(n,t){var i=this.mapRenderer.getGL(),f,r,u;void 0===this.framebufferDimension||this.framebufferDimension!=t?(f=function(n,t,i){n.isContextLost()||(n.deleteFramebuffer(t),n.deleteTexture(i))}.bind(null,i,this.framebuffer,this.texture),n.postRenderFunctions.push(f),r=iht(i,t,t),u=i.createFramebuffer(),i.bindFramebuffer(36160,u),i.framebufferTexture2D(36160,36064,vr,r,0),this.texture=r,this.framebuffer=u,this.framebufferDimension=t):i.bindFramebuffer(36160,this.framebuffer)},t.prototype.composeFrame=function(n,t,i){this.dispatchComposeEvent_(gr.PRECOMPOSE,i,n);i.bindBuffer(34962,this.arrayBuffer_);var r,u=i.getGL(),f=i.getProgram(eti,oti);this.defaultLocations_?r=this.defaultLocations_:(r=new sti(u,f),this.defaultLocations_=r);i.useProgram(f)&&(u.enableVertexAttribArray(r.a_position),u.vertexAttribPointer(r.a_position,2,5126,!1,16,0),u.enableVertexAttribArray(r.a_texCoord),u.vertexAttribPointer(r.a_texCoord,2,5126,!1,16,8),u.uniform1i(r.u_texture,0));u.uniformMatrix4fv(r.u_texCoordMatrix,!1,wv(this.tmpMat4_,this.getTexCoordMatrix()));u.uniformMatrix4fv(r.u_projectionMatrix,!1,wv(this.tmpMat4_,this.getProjectionMatrix()));u.uniform1f(r.u_opacity,t.opacity);u.bindTexture(vr,this.getTexture());u.drawArrays(5,0,4);this.dispatchComposeEvent_(gr.POSTCOMPOSE,i,n)},t.prototype.dispatchComposeEvent_=function(n,t,i){var u=this.getLayer();if(u.hasListener(n)){var r=i.viewState,f=r.resolution,e=i.pixelRatio,o=i.extent,s=r.center,h=r.rotation,c=i.size,l=new yht(t,s,f,h,c,o,e),a=new pw(n,l,i,null,t);u.dispatchEvent(a)}},t.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},t.prototype.getTexture=function(){return this.texture},t.prototype.getProjectionMatrix=function(){return this.projectionMatrix},t.prototype.handleWebGLContextLost=function(){this.texture=null;this.framebuffer=null;this.framebufferDimension=void 0},t.prototype.prepareFrame=function(){return p()},t.prototype.forEachLayerAtPixel=function(){return p()},t}(ust),hb=function(n){function t(t,i){n.call(this,t,i);this.image_=null;this.hitCanvasContext_=null;this.hitTransformationMatrix_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createTexture_=function(n){var t=n.getImage();return rht(this.mapRenderer.getGL(),t,33071,33071)},t.prototype.prepareFrame=function(n,t){var y=this.mapRenderer.getGL(),s=n.pixelRatio,u=n.viewState,p=u.center,h=u.resolution,w=u.rotation,i=this.image_,c=this.texture,b=this.getLayer().getSource(),l=n.viewHints,f=n.extent,a,r,v,o,e;return(void 0!==t.extent&&(f=of(f,t.extent)),l[lu]||l[oi]||eh(f))||(a=u.projection,r=b.getImage(f,h,s,a),r&&this.loadImage(r)&&(i=r,c=this.createTexture_(r),this.texture)&&(v=function(n,t){n.isContextLost()||n.deleteTexture(t)}.bind(null,y,this.texture),n.postRenderFunctions.push(v))),i&&(o=this.mapRenderer.getContext().getCanvas(),this.updateProjectionMatrix_(o.width,o.height,s,p,h,w,i.getExtent()),this.hitTransformationMatrix_=null,e=this.texCoordMatrix,hh(e),sf(e,1,-1),ne(e,0,-1),this.image_=i,this.texture=c),!!i},t.prototype.updateProjectionMatrix_=function(n,t,i,r,u,f,e){var s=n*u,h=t*u,o=this.projectionMatrix;hh(o);sf(o,2*i/s,2*i/h);vp(o,-f);ne(o,e[0]-r[0],e[1]-r[1]);sf(o,(e[2]-e[0])/2,(e[3]-e[1])/2);ne(o,1,1)},t.prototype.forEachLayerAtPixel=function(n,t,i,r){var f,u,e;if(this.image_&&this.image_.getImage()&&(f=[this.image_.getImage().width,this.image_.getImage().height],this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(t.size,f)),u=wr(this.hitTransformationMatrix_,n.slice()),!(u[0]<0||u[0]>f[0]||u[1]<0||u[1]>f[1])))return this.hitCanvasContext_||(this.hitCanvasContext_=kt(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),u[0],u[1],1,1,0,0,1,1),e=this.hitCanvasContext_.getImageData(0,0,1,1).data,e[3]>0?i.call(r,this.getLayer(),e):void 0},t.prototype.getHitTransformationMatrix_=function(n,t){var r=[1,0,0,1,0,0],u,i;return ne(r,-1,-1),sf(r,2/n[0],2/n[1]),ne(r,0,n[1]),sf(r,1,-1),u=nft(this.projectionMatrix.slice()),i=[1,0,0,1,0,0],ne(i,0,t[1]),sf(i,1,-1),sf(i,t[0]/2,t[1]/2),ne(i,1,1),ya(i,u),ya(i,r),i},t}(gn);hb.handles=function(n){return n.getType()===kr.IMAGE};hb.create=function(n,t){return new hb(n,t)};var pht=hb,wht=function(n){function t(t){n.call(this,t);var i=t.getViewport();this.canvas_=document.createElement("canvas");this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=ie;i.insertBefore(this.canvas_,i.childNodes[0]||null);this.clipTileCanvasWidth_=0;this.clipTileCanvasHeight_=0;this.clipTileContext_=kt();this.renderedVisible_=!0;this.gl_=dst(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0});this.context_=new ynt(this.canvas_,this.gl_);o(this.canvas_,eb.LOST,this.handleWebGLContextLost,this);o(this.canvas_,eb.RESTORED,this.handleWebGLContextRestored,this);this.textureCache_=new on;this.focus_=null;this.tileTextureQueue_=new aet(function(n){var t=n[1],i=n[2],r=t[0]-this.focus_[0],u=t[1]-this.focus_[1];return 65536*Math.log(i)+Math.sqrt(r*r+u*u)/i}.bind(this),function(n){return n[0].getKey()});this.loadNextTileTexture_=function(){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var n=this.tileTextureQueue_.dequeue(),t=n[0],i=n[3],r=n[4];this.bindTileTexture(t,i,r,rb,rb)}return!1}.bind(this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.bindTileTexture=function(n,t,i,r,u){var f=this.getGL(),s=n.getKey(),e,h,c,o,l;this.textureCache_.containsKey(s)?(e=this.textureCache_.get(s),f.bindTexture(vr,e.texture),e.magFilter!=r&&(f.texParameteri(vr,10240,r),e.magFilter=r),e.minFilter!=u&&(f.texParameteri(vr,10241,u),e.minFilter=u)):(h=f.createTexture(),c=n,(f.bindTexture(vr,h),i>0)?(o=this.clipTileContext_.canvas,l=this.clipTileContext_,this.clipTileCanvasWidth_!==t[0]||this.clipTileCanvasHeight_!==t[1]?(o.width=t[0],o.height=t[1],this.clipTileCanvasWidth_=t[0],this.clipTileCanvasHeight_=t[1]):l.clearRect(0,0,t[0],t[1]),l.drawImage(c.getImage(),i,i,t[0],t[1],0,0,t[0],t[1]),f.texImage2D(vr,0,6408,6408,5121,o)):f.texImage2D(vr,0,6408,6408,5121,c.getImage()),f.texParameteri(vr,10240,r),f.texParameteri(vr,10241,u),f.texParameteri(vr,wst,33071),f.texParameteri(vr,bst,33071),this.textureCache_.set(s,{texture:h,magFilter:r,minFilter:u}))},t.prototype.dispatchRenderEvent=function(n,t){var r=this.getMap();if(r.hasListener(n)){var u=this.context_,f=t.extent,e=t.size,i=t.viewState,o=t.pixelRatio,s=i.resolution,h=i.center,c=i.rotation,l=new yht(u,h,s,c,e,f,o),a=new pw(n,l,t,null,u);r.dispatchEvent(a)}},t.prototype.disposeInternal=function(){var t=this.getGL();t.isContextLost()||this.textureCache_.forEach(function(n){n&&t.deleteTexture(n.texture)});this.context_.dispose();n.prototype.disposeInternal.call(this)},t.prototype.expireCache_=function(n,t){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()==t.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},t.prototype.getContext=function(){return this.context_},t.prototype.getGL=function(){return this.gl_},t.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},t.prototype.handleWebGLContextLost=function(n){var t,i;n.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;t=this.getLayerRenderers();for(i in t)t[i].handleWebGLContextLost()},t.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()},t.prototype.initializeGL_=function(){var n=this.gl_;n.activeTexture(33984);n.blendFuncSeparate(770,771,1,771);n.disable(2884);n.disable(2929);n.disable(3089);n.disable(2960)},t.prototype.isTileTextureLoaded=function(n){return this.textureCache_.containsKey(n.getKey())},t.prototype.renderFrame=function(n){var c=this.getContext(),i=this.getGL(),u,f,t,e,l,r,o,s,h;if(i.isContextLost())return!1;if(!n)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;for(this.focus_=n.focus,this.textureCache_.set((-n.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchRenderEvent(gr.PRECOMPOSE,n),u=[],f=n.layerStatesArray,gk(f,tst),l=n.viewState.resolution,t=0,e=f.length;t<e;++t)r=f[t],is(r,l)&&r.sourceState==pi.READY&&this.getLayerRenderer(r.layer).prepareFrame(n,r,c)&&u.push(r);for(o=n.size[0]*n.pixelRatio,s=n.size[1]*n.pixelRatio,this.canvas_.width==o&&this.canvas_.height==s||(this.canvas_.width=o,this.canvas_.height=s),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),t=0,e=u.length;t<e;++t)h=u[t],this.getLayerRenderer(h.layer).composeFrame(n,h,c);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0);this.calculateMatrices2D(n);this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>1024&&n.postRenderFunctions.push(this.expireCache_.bind(this));this.tileTextureQueue_.isEmpty()||(n.postRenderFunctions.push(this.loadNextTileTexture_),n.animate=!0);this.dispatchRenderEvent(gr.POSTCOMPOSE,n);this.scheduleRemoveUnusedLayerRenderers(n);this.scheduleExpireIconCache(n)},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u,f,e){var l,o,a,s,h,c;if(this.getGL().isContextLost())return!1;for(a=t.viewState,s=t.layerStatesArray,o=s.length-1;o>=0;--o)if(h=s[o],c=h.layer,is(h,a.resolution)&&f.call(e,c)&&(l=this.getLayerRenderer(c).forEachFeatureAtCoordinate(n,t,i,r)))return l},t.prototype.hasFeatureAtCoordinate=function(n,t,i,r,u){var h=!1,f,c,e,o,s;if(this.getGL().isContextLost())return!1;for(c=t.viewState,e=t.layerStatesArray,f=e.length-1;f>=0;--f)if(o=e[f],s=o.layer,is(o,c.resolution)&&r.call(u,s)&&(h=this.getLayerRenderer(s).hasFeatureAtCoordinate(n,t)))return!0;return h},t.prototype.forEachLayerAtPixel=function(n,t,i,r,u,f){var c,e,l,o,s,h;if(this.getGL().isContextLost())return!1;for(l=t.viewState,o=t.layerStatesArray,e=o.length-1;e>=0;--e)if(s=o[e],h=s.layer,is(s,l.resolution)&&f.call(u,h)&&(c=this.getLayerRenderer(h).forEachLayerAtPixel(n,t,r,u)))return c},t}(ist),vl=function(n){function t(t,i,r){n.call(this);var u=r||{};this.tileCoord=t;this.state=i;this.interimTile=null;this.key="";this.transition_=void 0===u.transition?250:u.transition;this.transitionStarts_={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.changed=function(){this.dispatchEvent(a.CHANGE)},t.prototype.getKey=function(){return this.key+"/"+this.tileCoord},t.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==c.LOADED)return n;n=n.interimTile}while(n);return this},t.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,t=this;do{if(n.getState()==c.LOADED){n.interimTile=null;break}n.getState()==c.LOADING?t=n:n.getState()==c.IDLE?t.interimTile=n.interimTile:t=n;n=t.interimTile}while(n)}},t.prototype.getTileCoord=function(){return this.tileCoord},t.prototype.getState=function(){return this.state},t.prototype.setState=function(n){this.state=n;this.changed()},t.prototype.load=function(){},t.prototype.getAlpha=function(n,t){var i,r;if(!this.transition_)return 1;if(i=this.transitionStarts_[n],i){if(-1===i)return 1}else i=t,this.transitionStarts_[n]=i;return r=t-i+1e3/60,r>=this.transition_?1:ug(r/this.transition_)},t.prototype.inTransition=function(n){return!!this.transition_&&-1!==this.transitionStarts_[n]},t.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},t}(th);cb=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,e);this.crossOrigin_=u;this.src_=r;this.image_=new Image;null!==u&&(this.image_.crossOrigin=u);this.imageListenerKeys_=null;this.tileLoadFunction_=f}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.state==c.LOADING&&(this.unlistenImage_(),this.image_=bht());this.interimTile&&this.interimTile.dispose();this.state=c.ABORT;this.changed();n.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.image_},t.prototype.getKey=function(){return this.src_},t.prototype.handleImageError_=function(){this.state=c.ERROR;this.unlistenImage_();this.image_=bht();this.changed()},t.prototype.handleImageLoad_=function(){var n=this.image_;this.state=n.naturalWidth&&n.naturalHeight?c.LOADED:c.EMPTY;this.unlistenImage_();this.changed()},t.prototype.load=function(){this.state==c.ERROR&&(this.state=c.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_));this.state==c.IDLE&&(this.state=c.LOADING,this.changed(),this.imageListenerKeys_=[ee(this.image_,a.ERROR,this.handleImageError_,this),ee(this.image_,a.LOAD,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(lt);this.imageListenerKeys_=null},t}(vl);itt=function(n){function t(t){n.call(this,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.expireCache=function(n){for(;this.canExpireCache();){var t=this.peekLast(),i=t.tileCoord[0].toString();if(i in n&&n[i].contains(t.tileCoord))break;this.pop().dispose()}},t.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var n=function(n){return n.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach(function(t){t.tileCoord[0]!==n&&(this.remove(kht(t.tileCoord)),t.dispose())},this)}},t}(on);var lb=function(n){function t(t){n.call(this);this.projection_=w(t.projection);this.attributions_=dht(t.attributions);this.attributionsCollapsible_=void 0===t.attributionsCollapsible||t.attributionsCollapsible;this.loading=!1;this.state_=void 0!==t.state?t.state:pi.READY;this.wrapX_=void 0!==t.wrapX&&t.wrapX}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getAttributions=function(){return this.attributions_},t.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolutions=function(){return p()},t.prototype.getState=function(){return this.state_},t.prototype.getWrapX=function(){return this.wrapX_},t.prototype.refresh=function(){this.changed()},t.prototype.setAttributions=function(n){this.attributions_=dht(n);this.changed()},t.prototype.setState=function(n){this.state_=n;this.changed()},t}(rf),hti=[0,0,0],li=function(n){var r,t,u,i;if(this.minZoom=void 0!==n.minZoom?n.minZoom:0,this.resolutions_=n.resolutions,g(function(n,t,i){var r=t||lo;return n.every(function(t,u){if(0===u)return!0;var f=r(n[u-1],t);return!(f>0||i&&0===f)})}(this.resolutions_,function(n,t){return t-n},!0),17),!n.origins)for(t=0,u=this.resolutions_.length-1;t<u;++t)if(r){if(this.resolutions_[t]/this.resolutions_[t+1]!==r){r=void 0;break}}else r=this.resolutions_[t]/this.resolutions_[t+1];this.zoomFactor_=r;this.maxZoom=this.resolutions_.length-1;this.origin_=void 0!==n.origin?n.origin:null;this.origins_=null;void 0!==n.origins&&(this.origins_=n.origins,g(this.origins_.length==this.resolutions_.length,20));i=n.extent;void 0===i||this.origin_||this.origins_||(this.origin_=bf(i));g(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;void 0!==n.tileSizes&&(this.tileSizes_=n.tileSizes,g(this.tileSizes_.length==this.resolutions_.length,19));this.tileSize_=void 0!==n.tileSize?n.tileSize:this.tileSizes_?null:rw;g(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=void 0!==i?i:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];void 0!==n.sizes?this.fullTileRanges_=n.sizes.map(function(n){return new gw(Math.min(0,n[0]),Math.max(n[0]-1,-1),Math.min(0,n[1]),Math.max(n[1]-1,-1))},this):i&&this.calculateTileRanges_(i)};li.prototype.forEachTileCoord=function(n,t,i){for(var u,e,r=this.getTileRangeForExtentAndZ(n,t),f=r.minX,o=r.maxX;f<=o;++f)for(u=r.minY,e=r.maxY;u<=e;++u)i([t,f,u])};li.prototype.forEachTileCoordParentTileRange=function(n,t,i,r,u){var s,f,e,h=null,o=n[0]-1;for(2===this.zoomFactor_?(f=n[1],e=n[2]):h=this.getTileCoordExtent(n,u);o>=this.minZoom;){if(s=2===this.zoomFactor_?ln(f=Math.floor(f/2),f,e=Math.floor(e/2),e,r):this.getTileRangeForExtentAndZ(h,o,r),t.call(i,o,s))return!0;--o}return!1};li.prototype.getExtent=function(){return this.extent_};li.prototype.getMaxZoom=function(){return this.maxZoom};li.prototype.getMinZoom=function(){return this.minZoom};li.prototype.getOrigin=function(n){return this.origin_?this.origin_:this.origins_[n]};li.prototype.getResolution=function(n){return this.resolutions_[n]};li.prototype.getResolutions=function(){return this.resolutions_};li.prototype.getTileCoordChildTileRange=function(n,t,i){var r,u,f;return n[0]<this.maxZoom?2===this.zoomFactor_?(r=2*n[1],u=2*n[2],ln(r,r+1,u,u+1,t)):(f=this.getTileCoordExtent(n,i),this.getTileRangeForExtentAndZ(f,n[0]+1,t)):null};li.prototype.getTileRangeExtent=function(n,t,i){var r=this.getOrigin(n),u=this.getResolution(n),f=ru(this.getTileSize(n),this.tmpSize_),e=r[0]+t.minX*f[0]*u,o=r[0]+(t.maxX+1)*f[0]*u;return ef(e,r[1]+t.minY*f[1]*u,o,r[1]+(t.maxY+1)*f[1]*u,i)};li.prototype.getTileRangeForExtentAndZ=function(n,t,i){var r=hti,u,f;return this.getTileCoordForXYAndZ_(n[0],n[1],t,!1,r),u=r[1],f=r[2],this.getTileCoordForXYAndZ_(n[2],n[3],t,!0,r),ln(u,r[1],f,r[2],i)};li.prototype.getTileCoordCenter=function(n){var t=this.getOrigin(n[0]),i=this.getResolution(n[0]),r=ru(this.getTileSize(n[0]),this.tmpSize_);return[t[0]+(n[1]+.5)*r[0]*i,t[1]+(n[2]+.5)*r[1]*i]};li.prototype.getTileCoordExtent=function(n,t){var u=this.getOrigin(n[0]),i=this.getResolution(n[0]),r=ru(this.getTileSize(n[0]),this.tmpSize_),f=u[0]+n[1]*r[0]*i,e=u[1]+n[2]*r[1]*i;return ef(f,e,f+r[0]*i,e+r[1]*i,t)};li.prototype.getTileCoordForCoordAndResolution=function(n,t,i){return this.getTileCoordForXYAndResolution_(n[0],n[1],t,!1,i)};li.prototype.getTileCoordForXYAndResolution_=function(n,t,i,r,u){var o=this.getZForResolution(i),s=i/this.getResolution(o),h=this.getOrigin(o),c=ru(this.getTileSize(o),this.tmpSize_),l=r?.5:0,a=r?0:.5,v=Math.floor((n-h[0])/i+l),y=Math.floor((t-h[1])/i+a),f=s*v/c[0],e=s*y/c[1];return r?(f=Math.ceil(f)-1,e=Math.ceil(e)-1):(f=Math.floor(f),e=Math.floor(e)),ntt(o,f,e,u)};li.prototype.getTileCoordForXYAndZ_=function(n,t,i,r,u){var o=this.getOrigin(i),s=this.getResolution(i),h=ru(this.getTileSize(i),this.tmpSize_),c=r?.5:0,l=r?0:.5,a=Math.floor((n-o[0])/s+c),v=Math.floor((t-o[1])/s+l),f=a/h[0],e=v/h[1];return r?(f=Math.ceil(f)-1,e=Math.ceil(e)-1):(f=Math.floor(f),e=Math.floor(e)),ntt(i,f,e,u)};li.prototype.getTileCoordForCoordAndZ=function(n,t,i){return this.getTileCoordForXYAndZ_(n[0],n[1],t,!1,i)};li.prototype.getTileCoordResolution=function(n){return this.resolutions_[n[0]]};li.prototype.getTileSize=function(n){return this.tileSize_?this.tileSize_:this.tileSizes_[n]};li.prototype.getFullTileRange=function(n){return this.fullTileRanges_?this.fullTileRanges_[n]:null};li.prototype.getZForResolution=function(n,t){return vi(np(this.resolutions_,n,t||0),this.minZoom,this.maxZoom)};li.prototype.calculateTileRanges_=function(n){for(var i=this.resolutions_.length,r=new Array(i),t=this.minZoom;t<i;++t)r[t]=this.getTileRangeForExtentAndZ(n,t);this.fullTileRanges_=r};yl=li;var lti=function(n){function t(t){n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX});this.opaque_=void 0!==t.opaque&&t.opaque;this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1;this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;this.tileCache=new itt(t.cacheSize);this.tmpSize=[0,0];this.key_=t.key||"";this.tileOptions={transition:t.transition}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},t.prototype.expireCache=function(n,t){var i=this.getTileCacheForProjection(n);i&&i.expireCache(t)},t.prototype.forEachLoadedTile=function(n,t,i,r){var o=this.getTileCacheForProjection(n),l,s,u,h,f,e;if(!o)return!1;for(h=!0,f=i.minX;f<=i.maxX;++f)for(e=i.minY;e<=i.maxY;++e)s=ss(t,f,e),u=!1,o.containsKey(s)&&(u=(l=o.get(s)).getState()===c.LOADED)&&(u=!1!==r(l)),u||(h=!1);return h},t.prototype.getGutterForProjection=function(){return 0},t.prototype.getKey=function(){return this.key_},t.prototype.setKey=function(n){this.key_!==n&&(this.key_=n,this.changed())},t.prototype.getOpaque=function(){return this.opaque_},t.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},t.prototype.getTile=function(){return p()},t.prototype.getTileGrid=function(){return this.tileGrid},t.prototype.getTileGridForProjection=function(n){return this.tileGrid?this.tileGrid:ght(n)},t.prototype.getTileCacheForProjection=function(n){var t=this.getProjection();return t&&!hu(t,n)?null:this.tileCache},t.prototype.getTilePixelRatio=function(){return this.tilePixelRatio_},t.prototype.getTilePixelSize=function(n,t,i){var f=this.getTileGridForProjection(i),r=this.getTilePixelRatio(t),u=ru(f.getTileSize(n),this.tmpSize);return 1==r?u:sg(u,r,this.tmpSize)},t.prototype.getTileCoordForTileUrlFunction=function(n,t){var i=void 0!==t?t:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(n=function(n,t,i){var o=t[0],r=n.getTileCoordCenter(t),u=uc(i),f,e;return tp(u,r)?t:(f=wt(u),e=Math.ceil((u[0]-r[0])/f),r[0]+=f*e,n.getTileCoordForCoordAndZ(r,o))}(r,n,i)),function(n,t){var i=n[0],f=n[1],e=n[2],u,r;return t.getMinZoom()>i||i>t.getMaxZoom()?!1:(r=t.getExtent(),!(u=r?t.getTileRangeForExtentAndZ(r,i):t.getFullTileRange(i))||u.containsXY(f,e))}(n,r)?n:null},t.prototype.refresh=function(){this.tileCache.clear();this.changed()},t.prototype.useTile=function(){},t}(lb),ati=function(n){function t(t,i){n.call(this,t);this.tile=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),gv=lti,vti=new cl("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"),yti=new ll("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"),pti=function(n,t){this.u_tileOffset=n.getUniformLocation(t,"u_tileOffset");this.u_texture=n.getUniformLocation(t,"u_texture");this.a_position=n.getAttribLocation(t,"a_position");this.a_texCoord=n.getAttribLocation(t,"a_texCoord")},ab=function(n){function t(t,i){n.call(this,t,i);this.fragmentShader_=vti;this.vertexShader_=yti;this.locations_=null;this.renderArrayBuffer_=new vf([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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_);n.prototype.disposeInternal.call(this)},t.prototype.createLoadedTileFinder=function(n,t,i){var r=this.mapRenderer;return function(u,f){return n.forEachLoadedTile(t,u,f,function(n){var t=r.isTileTextureLoaded(n);return t&&(i[u]||(i[u]={}),i[u][n.tileCoord.toString()]=n),t})}},t.prototype.handleWebGLContextLost=function(){n.prototype.handleWebGLContextLost.call(this);this.locations_=null},t.prototype.prepareFrame=function(n,t,i){var it=this.mapRenderer,f=i.getGL(),a=n.viewState,y=a.projection,st=this.getLayer(),e=st.getSource(),ct,b,ot,at,ei,vt,d;if(!(e instanceof gv))return!0;var r,o=e.getTileGridForProjection(y),s=o.getZForResolution(a.resolution),nt=o.getResolution(s),v=e.getTilePixelSize(s,n.pixelRatio,y),p=v[0]/ru(o.getTileSize(s),this.tmpSize_)[0],ht=nt/p,yt=e.getTilePixelRatio(p)*e.getGutterForProjection(y),pt=a.center,wt=n.extent,h=o.getTileRangeForExtentAndZ(wt,s);if(this.renderedTileRange_&&this.renderedTileRange_.equals(h)&&this.renderedRevision_==e.getRevision())r=this.renderedFramebufferExtent_;else{var bt=h.getSize(),rt=function(n){return g(0<n,29),Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}(Math.max(bt[0]*v[0],bt[1]*v[1])),w=ht*rt,kt=o.getOrigin(s),gt=kt[0]+h.minX*v[0]*ht,ni=kt[1]+h.minY*v[1]*ht;r=[gt,ni,gt+w,ni+w];this.bindFramebuffer(n,rt);f.viewport(0,0,rt,rt);f.clearColor(0,0,0,0);f.clear(16384);f.disable(3042);ct=i.getProgram(this.fragmentShader_,this.vertexShader_);i.useProgram(ct);this.locations_||(this.locations_=new pti(f,ct));i.bindBuffer(34962,this.renderArrayBuffer_);f.enableVertexAttribArray(this.locations_.a_position);f.vertexAttribPointer(this.locations_.a_position,2,5126,!1,16,0);f.enableVertexAttribArray(this.locations_.a_texCoord);f.vertexAttribPointer(this.locations_.a_texCoord,2,5126,!1,16,8);f.uniform1i(this.locations_.u_texture,0);b={};b[s]={};for(var ti,u,k,ft,l,ii=this.createLoadedTileFinder(e,y,b),ri=st.getUseInterimTilesOnError(),ui=!0,et=[1/0,1/0,-1/0,-1/0],fi=new gw(0,0,0,0),ut=h.minX;ut<=h.maxX;++ut)for(ft=h.minY;ft<=h.maxY;++ft)if(u=e.getTile(s,ut,ft,p,y),void 0===t.extent||dt(l=o.getTileCoordExtent(u.tileCoord,et),t.extent)){if((k=u.getState())==c.LOADED||k==c.EMPTY||k==c.ERROR&&!ri||(u=u.getInterimTile()),(k=u.getState())==c.LOADED){if(it.isTileTextureLoaded(u)){b[s][u.tileCoord.toString()]=u;continue}}else if(k==c.EMPTY||k==c.ERROR&&!ri)continue;ui=!1;o.forEachTileCoordParentTileRange(u.tileCoord,ii,null,fi,et)||(ti=o.getTileCoordChildTileRange(u.tileCoord,fi,et))&&ii(s+1,ti)}ot=Object.keys(b).map(Number);ot.sort(lo);for(var tt=new Float32Array(4),lt=0,oi=ot.length;lt<oi;++lt){at=b[ot[lt]];for(ei in at)(u=at[ei])instanceof cb&&(l=o.getTileCoordExtent(u.tileCoord,et),tt[0]=2*(l[2]-l[0])/w,tt[1]=2*(l[3]-l[1])/w,tt[2]=2*(l[0]-r[0])/w-1,tt[3]=2*(l[1]-r[1])/w-1,f.uniform4fv(this.locations_.u_tileOffset,tt),it.bindTileTexture(u,v,yt*p,rb,rb),f.drawArrays(5,0,4))}ui?(this.renderedTileRange_=h,this.renderedFramebufferExtent_=r,this.renderedRevision_=e.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,n.animate=!0)}return this.updateUsedTiles(n.usedTiles,e,s,h),vt=it.getTileTextureQueue(),this.manageTilePyramid(n,e,o,p,y,wt,s,st.getPreload(),function(n){n.getState()!=c.LOADED||it.isTileTextureLoaded(n)||vt.isKeyQueued(n.getKey())||vt.enqueue([n,o.getTileCoordCenter(n.tileCoord),o.getResolution(n.tileCoord[0]),v,yt*p])},this),this.scheduleExpireCache(n,e),d=this.texCoordMatrix,hh(d),ne(d,(Math.round(pt[0]/nt)*nt-r[0])/(r[2]-r[0]),(Math.round(pt[1]/nt)*nt-r[1])/(r[3]-r[1])),0!==a.rotation&&vp(d,a.rotation),sf(d,n.size[0]*a.resolution/(r[2]-r[0]),n.size[1]*a.resolution/(r[3]-r[1])),ne(d,-.5,-.5),!0},t.prototype.forEachLayerAtPixel=function(n,t,i,r){var f;if(this.framebuffer){var s=[n[0]/t.size[0],(t.size[1]-n[1])/t.size[1]],e=wr(this.texCoordMatrix,s.slice()),o=[e[0]*this.framebufferDimension,e[1]*this.framebufferDimension],u=this.mapRenderer.getContext().getGL();return u.bindFramebuffer(u.FRAMEBUFFER,this.framebuffer),f=new Uint8Array(4),u.readPixels(o[0],o[1],1,1,u.RGBA,u.UNSIGNED_BYTE,f),f[3]>0?i.call(r,this.getLayer(),f):void 0}},t}(gn);ab.handles=function(n){return n.getType()===kr.TILE};ab.create=function(n,t){return new ab(n,t)};rtt=ab;ny=function(n){function t(t,i){n.call(this,t,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.composeFrame=function(n,t,i){this.layerState_=t;var u=n.viewState,f=this.replayGroup_,e=n.size,o=n.pixelRatio,r=this.mapRenderer.getGL();f&&!f.isEmpty()&&(r.enable(r.SCISSOR_TEST),r.scissor(0,0,e[0]*o,e[1]*o),f.replay(i,u.center,u.resolution,u.rotation,e,o,t.opacity,t.managed?n.skippedFeatureUids:{}),r.disable(r.SCISSOR_TEST))},t.prototype.disposeInternal=function(){var t=this.replayGroup_,i;t&&(i=this.mapRenderer.getContext(),t.getDeleteResourcesFunction(i)(),this.replayGroup_=null);n.prototype.disposeInternal.call(this)},t.prototype.forEachFeatureAtCoordinate=function(n,t,i,r,u){if(this.replayGroup_&&this.layerState_){var o=this.mapRenderer.getContext(),f=t.viewState,s=this.getLayer(),h=this.layerState_,e={};return this.replayGroup_.forEachFeatureAtCoordinate(n,o,f.center,f.resolution,f.rotation,t.size,t.pixelRatio,h.opacity,{},function(n){var t=y(n);if(!(t in e))return e[t]=!0,r.call(u,n,s)})}},t.prototype.hasFeatureAtCoordinate=function(n,t){if(this.replayGroup_&&this.layerState_){var r=this.mapRenderer.getContext(),i=t.viewState,u=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(n,r,i.center,i.resolution,i.rotation,t.size,t.pixelRatio,u.opacity,t.skippedFeatureUids)}return!1},t.prototype.forEachLayerAtPixel=function(n,t,i,r){var u=wr(t.pixelToCoordinateTransform,n.slice());if(this.hasFeatureAtCoordinate(u,t))return i.call(r,this.getLayer(),null)},t.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(n,t,i){var r=this.getLayer(),h=r.getSource(),y=n.viewHints[lu],p=n.viewHints[oi],w=r.getUpdateWhileAnimating(),b=r.getUpdateWhileInteracting(),f,o,c,s;if(!this.dirty_&&!w&&y||!b&&p)return!0;var k=n.extent,l=n.viewState,d=l.projection,u=l.resolution,a=n.pixelRatio,v=r.getRevision(),g=r.getRenderBuffer(),e=r.getRenderOrder();return(void 0===e&&(e=lst),f=ff(k,g*u),!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==v&&this.renderedRenderOrder_==e&&lr(this.renderedExtent_,f))?!0:(this.replayGroup_&&n.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(i)),this.dirty_=!1,o=new os(pn(u,a),f,r.getRenderBuffer()),h.loadFeatures(f,u,d),c=function(n){var t,i=n.getStyleFunction()||r.getStyleFunction(),f;(i&&(t=i(n,u)),t)&&(f=this.renderFeature(n,u,a,t,o),this.dirty_=this.dirty_||f)}.bind(this),e?(s=[],h.forEachFeatureInExtent(f,function(n){s.push(n)}),s.sort(e),s.forEach(c.bind(this))):h.forEachFeatureInExtent(f,c),o.finish(i),this.renderedResolution_=u,this.renderedRevision_=v,this.renderedRenderOrder_=e,this.renderedExtent_=f,this.replayGroup_=o,!0)},t.prototype.renderFeature=function(n,t,i,r,u){var f,e;if(!r)return!1;if(f=!1,Array.isArray(r))for(e=r.length-1;e>=0;--e)f=hl(u,n,r[e],av(t,i),this.handleStyleImageChange_,this)||f;else f=hl(u,n,r,av(t,i),this.handleStyleImageChange_,this)||f;return f},t}(gn);ny.handles=function(n){return n.getType()===kr.VECTOR};ny.create=function(n,t){return new ny(n,t)};var ict=ny,wti=function(n){function t(t){(t=nt({},t)).controls||(t.controls=vg());t.interactions||(t.interactions=un());n.call(this,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createRenderer=function(){var n=new wht(this);return n.registerLayerRenderers([pht,rtt,ict]),n},t}(hg),ro={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};fc=document.implementation.createDocument("","",null);hs="http://www.w3.org/2001/XMLSchema-instance";hr=gt();utt=function(n){function t(t){n.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes});this.matrixIds_=t.matrixIds}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getMatrixId=function(n){return this.matrixIds_[n]},t.prototype.getMatrixIds=function(){return this.matrixIds_},t}(yl);hct=utt;ri=function(n){this.opacity_=n.opacity;this.rotateWithView_=n.rotateWithView;this.rotation_=n.rotation;this.scale_=n.scale};ri.prototype.clone=function(){return new ri({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})};ri.prototype.getOpacity=function(){return this.opacity_};ri.prototype.getRotateWithView=function(){return this.rotateWithView_};ri.prototype.getRotation=function(){return this.rotation_};ri.prototype.getScale=function(){return this.scale_};ri.prototype.getSnapToPixel=function(){return!1};ri.prototype.getAnchor=function(){return p()};ri.prototype.getImage=function(){return p()};ri.prototype.getHitDetectionImage=function(){return p()};ri.prototype.getImageState=function(){return p()};ri.prototype.getImageSize=function(){return p()};ri.prototype.getHitDetectionImageSize=function(){return p()};ri.prototype.getOrigin=function(){return p()};ri.prototype.getSize=function(){return p()};ri.prototype.setOpacity=function(n){this.opacity_=n};ri.prototype.setRotateWithView=function(n){this.rotateWithView_=n};ri.prototype.setRotation=function(n){this.rotation_=n};ri.prototype.setScale=function(n){this.scale_=n};ri.prototype.setSnapToPixel=function(){};ri.prototype.listenImageChange=function(){return p()};ri.prototype.load=function(){p()};ri.prototype.unlistenImageChange=function(){p()};var ftt=ri,lct=function(n){function t(t){var i=void 0!==t.rotateWithView&&t.rotateWithView;n.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1});this.checksums_=null;this.canvas_=null;this.hitDetectionCanvas_=null;this.fill_=void 0!==t.fill?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius_=void 0!==t.radius?t.radius:t.radius1;this.radius2_=t.radius2;this.angle_=void 0!==t.angle?t.angle:0;this.stroke_=void 0!==t.stroke?t.stroke:null;this.anchor_=null;this.size_=null;this.imageSize_=null;this.hitDetectionImageSize_=null;this.atlasManager_=t.atlasManager;this.render_(this.atlasManager_)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var n=new t({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 n.setOpacity(this.getOpacity()),n.setScale(this.getScale()),n},t.prototype.getAnchor=function(){return this.anchor_},t.prototype.getAngle=function(){return this.angle_},t.prototype.getFill=function(){return this.fill_},t.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_},t.prototype.getImage=function(){return this.canvas_},t.prototype.getImageSize=function(){return this.imageSize_},t.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},t.prototype.getImageState=function(){return ot.LOADED},t.prototype.getOrigin=function(){return this.origin_},t.prototype.getPoints=function(){return this.points_},t.prototype.getRadius=function(){return this.radius_},t.prototype.getRadius2=function(){return this.radius2_},t.prototype.getSize=function(){return this.size_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.listenImageChange=function(){},t.prototype.load=function(){},t.prototype.unlistenImageChange=function(){},t.prototype.render_=function(n){var r,u,o="",s="",h=0,c=null,l=0,e=0,t,f,a,y,v,p,i;this.stroke_&&(null===(u=this.stroke_.getColor())&&(u=uv),u=du(u),void 0===(e=this.stroke_.getWidth())&&(e=1),c=this.stroke_.getLineDash(),l=this.stroke_.getLineDashOffset(),il||(c=null,l=0),void 0===(s=this.stroke_.getLineJoin())&&(s="round"),void 0===(o=this.stroke_.getLineCap())&&(o="round"),void 0===(h=this.stroke_.getMiterLimit())&&(h=10));t=2*(this.radius_+e)+1;f={strokeStyle:u,strokeWidth:e,size:t,lineCap:o,lineDash:c,lineDashOffset:l,lineJoin:s,miterLimit:h};void 0===n?(a=kt(t,t),this.canvas_=a.canvas,r=t=this.canvas_.width,this.draw_(f,a,0,0),this.createHitDetectionCanvas_(f)):(t=Math.round(t),v=!this.fill_,v&&(y=this.drawHitDetectionCanvas_.bind(this,f)),p=this.getChecksum(),i=n.add(p,t,t,this.draw_.bind(this,f),y),this.canvas_=i.image,this.origin_=[i.offsetX,i.offsetY],r=i.image.width,v?(this.hitDetectionCanvas_=i.hitImage,this.hitDetectionImageSize_=[i.hitImage.width,i.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[r,r]));this.anchor_=[t/2,t/2];this.size_=[t,t];this.imageSize_=[r,r]},t.prototype.draw_=function(n,t,i,r){var u,o,s,f,h,e;if(t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath(),f=this.points_,f===1/0)t.arc(n.size/2,n.size/2,this.radius_,0,2*Math.PI,!0);else for(h=void 0!==this.radius2_?this.radius2_:this.radius_,h!==this.radius_&&(f*=2),u=0;u<=f;u++)o=2*u*Math.PI/f-Math.PI/2+this.angle_,s=u%2==0?this.radius_:h,t.lineTo(n.size/2+s*Math.cos(o),n.size/2+s*Math.sin(o));this.fill_&&(e=this.fill_.getColor(),null===e&&(e=no),t.fillStyle=du(e),t.fill());this.stroke_&&(t.strokeStyle=n.strokeStyle,t.lineWidth=n.strokeWidth,n.lineDash&&(t.setLineDash(n.lineDash),t.lineDashOffset=n.lineDashOffset),t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.miterLimit=n.miterLimit,t.stroke());t.closePath()},t.prototype.createHitDetectionCanvas_=function(n){if(this.hitDetectionImageSize_=[n.size,n.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var t=kt(n.size,n.size);this.hitDetectionCanvas_=t.canvas;this.drawHitDetectionCanvas_(n,t,0,0)}},t.prototype.drawHitDetectionCanvas_=function(n,t,i,r){var u,f,e,o,s;if(t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath(),u=this.points_,u===1/0)t.arc(n.size/2,n.size/2,this.radius_,0,2*Math.PI,!0);else for(s=void 0!==this.radius2_?this.radius2_:this.radius_,s!==this.radius_&&(u*=2),f=0;f<=u;f++)o=2*f*Math.PI/u-Math.PI/2+this.angle_,e=f%2==0?this.radius_:s,t.lineTo(n.size/2+e*Math.cos(o),n.size/2+e*Math.sin(o));t.fillStyle=vh(no);t.fill();this.stroke_&&(t.strokeStyle=n.strokeStyle,t.lineWidth=n.strokeWidth,n.lineDash&&(t.setLineDash(n.lineDash),t.lineDashOffset=n.lineDashOffset),t.stroke());t.closePath()},t.prototype.getChecksum=function(){var n=this.stroke_?this.stroke_.getChecksum():"-",t=this.fill_?this.fill_.getChecksum():"-",i;return this.checksums_&&n==this.checksums_[1]&&t==this.checksums_[2]&&this.radius_==this.checksums_[3]&&this.radius2_==this.checksums_[4]&&this.angle_==this.checksums_[5]&&this.points_==this.checksums_[6]||(i="r"+n+t+(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,n,t,this.radius_,this.radius2_,this.angle_,this.points_]),this.checksums_[0]},t}(ftt),ett=function(n){function t(t){var i=t||{};n.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var n=new t({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return n.setOpacity(this.getOpacity()),n.setScale(this.getScale()),n},t.prototype.setRadius=function(n){this.radius_=n;this.render_(this.atlasManager_)},t}(lct),eu={FRACTION:"fraction",PIXELS:"pixels"},bti=function(n){function t(t,i,r,u,f,e){n.call(this);this.hitDetectionImage_=null;this.image_=t||new Image;null!==u&&(this.image_.crossOrigin=u);this.canvas_=e?document.createElement("canvas"):null;this.color_=e;this.imageListenerKeys_=null;this.imageState_=f;this.size_=r;this.src_=i;this.tainted_}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===ot.LOADED){this.tainted_=!1;var n=kt(1,1);try{n.drawImage(this.image_,0,0);n.getImageData(0,0,1,1)}catch(n){this.tainted_=!0}}return!0===this.tainted_},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(a.CHANGE)},t.prototype.handleImageError_=function(){this.imageState_=ot.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=ot.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_()},t.prototype.getImage=function(){return this.canvas_?this.canvas_:this.image_},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],t=this.size_[1],i=kt(n,t);i.fillRect(0,0,n,t);this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==ot.IDLE){this.imageState_=ot.LOADING;this.imageListenerKeys_=[ee(this.image_,a.ERROR,this.handleImageError_,this),ee(this.image_,a.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(n){this.handleImageError_()}}},t.prototype.replaceColor_=function(){var t;if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var r=t.getImageData(0,0,this.image_.width,this.image_.height),i=r.data,u=this.color_[0]/255,f=this.color_[1]/255,e=this.color_[2]/255,n=0,o=i.length;n<o;n+=4)i[n]*=u,i[n+1]*=f,i[n+2]*=e;t.putImageData(r,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(lt);this.imageListenerKeys_=null},t}(th),ur={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},vb=function(n){function t(t){var i=t||{},o=void 0!==i.opacity?i.opacity:1,s=void 0!==i.rotation?i.rotation:0,h=void 0!==i.scale?i.scale:1,c=void 0!==i.rotateWithView&&i.rotateWithView,e;n.call(this,{opacity:o,rotation:s,scale:h,rotateWithView:c});this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:ur.TOP_LEFT;this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:eu.FRACTION;this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:eu.FRACTION;this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var r=void 0!==i.img?i.img:null,f=void 0!==i.imgSize?i.imgSize:null,u=i.src;g(!(void 0!==u&&r),4);g(!r||r&&f,5);void 0!==u&&0!==u.length||!r||(u=r.src||y(r));g(void 0!==u&&u.length>0,6);e=void 0!==i.src?ot.IDLE:ot.LOADED;this.color_=void 0!==i.color?yh(i.color):null;this.iconImage_=function(n,t,i,r,u,f){var e=ev.get(t,r,f);return e||(e=new bti(n,t,i,r,u,f),ev.set(t,r,f,e)),e}(r,u,f,this.crossOrigin_,e,this.color_);this.offset_=void 0!==i.offset?i.offset:[0,0];this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:ur.TOP_LEFT;this.origin_=null;this.size_=void 0!==i.size?i.size:null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t({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()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var n=this.anchor_,t=this.getSize();if(this.anchorXUnits_==eu.FRACTION||this.anchorYUnits_==eu.FRACTION){if(!t)return null;n=this.anchor_.slice();this.anchorXUnits_==eu.FRACTION&&(n[0]*=t[0]);this.anchorYUnits_==eu.FRACTION&&(n[1]*=t[1])}if(this.anchorOrigin_!=ur.TOP_LEFT){if(!t)return null;n===this.anchor_&&(n=this.anchor_.slice());this.anchorOrigin_!=ur.TOP_RIGHT&&this.anchorOrigin_!=ur.BOTTOM_RIGHT||(n[0]=-n[0]+t[0]);this.anchorOrigin_!=ur.BOTTOM_LEFT&&this.anchorOrigin_!=ur.BOTTOM_RIGHT||(n[1]=-n[1]+t[1])}return this.normalizedAnchor_=n,this.normalizedAnchor_},t.prototype.setAnchor=function(n){this.anchor_=n;this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(n){return this.iconImage_.getImage(n)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(n){return this.iconImage_.getHitDetectionImage(n)},t.prototype.getOrigin=function(){var n,t,i;if(this.origin_)return this.origin_;if(n=this.offset_,this.offsetOrigin_!=ur.TOP_LEFT){if(t=this.getSize(),i=this.iconImage_.getSize(),!t||!i)return null;n=n.slice();this.offsetOrigin_!=ur.TOP_RIGHT&&this.offsetOrigin_!=ur.BOTTOM_RIGHT||(n[0]=i[0]-t[0]-n[0]);this.offsetOrigin_!=ur.BOTTOM_LEFT&&this.offsetOrigin_!=ur.BOTTOM_RIGHT||(n[1]=i[1]-t[1]-n[1])}return this.origin_=n,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(n,t){return o(this.iconImage_,a.CHANGE,n,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(n,t){ou(this.iconImage_,a.CHANGE,n,t)},t}(ftt),ai=function(n){var t=n||{};this.geometry_=null;this.geometryFunction_=act;void 0!==t.geometry&&this.setGeometry(t.geometry);this.fill_=void 0!==t.fill?t.fill:null;this.image_=void 0!==t.image?t.image:null;this.renderer_=void 0!==t.renderer?t.renderer:null;this.stroke_=void 0!==t.stroke?t.stroke:null;this.text_=void 0!==t.text?t.text:null;this.zIndex_=t.zIndex};ai.prototype.clone=function(){var n=this.getGeometry();return n&&"object"==typeof n&&(n=n.clone()),new ai({geometry:n,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()})};ai.prototype.getRenderer=function(){return this.renderer_};ai.prototype.setRenderer=function(n){this.renderer_=n};ai.prototype.getGeometry=function(){return this.geometry_};ai.prototype.getGeometryFunction=function(){return this.geometryFunction_};ai.prototype.getFill=function(){return this.fill_};ai.prototype.setFill=function(n){this.fill_=n};ai.prototype.getImage=function(){return this.image_};ai.prototype.setImage=function(n){this.image_=n};ai.prototype.getStroke=function(){return this.stroke_};ai.prototype.setStroke=function(n){this.stroke_=n};ai.prototype.getText=function(){return this.text_};ai.prototype.setText=function(n){this.text_=n};ai.prototype.getZIndex=function(){return this.zIndex_};ai.prototype.setGeometry=function(n){"function"==typeof n?this.geometryFunction_=n:"string"==typeof n?this.geometryFunction_=function(t){return t.get(n)}:n?void 0!==n&&(this.geometryFunction_=function(){return n}):this.geometryFunction_=act;this.geometry_=n};ai.prototype.setZIndex=function(n){this.zIndex_=n};yb=null;wl=ai;bl=function(n,t,i,r,u){var e,o,f;this.sourceProj_=n;this.targetProj_=t;e={};o=he(this.targetProj_,this.sourceProj_);this.transformInv_=function(n){var t=n[0]+"/"+n[1];return e[t]||(e[t]=o(n)),e[t]};this.maxSourceExtent_=r;this.errorThresholdSquared_=u*u;this.triangles_=[];this.wrapsXInSource_=!1;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&wt(r)==wt(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?wt(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?wt(this.targetProj_.getExtent()):null;var s=bf(i),h=ao(i),c=fh(i),l=de(i),a=this.transformInv_(s),v=this.transformInv_(h),y=this.transformInv_(c),p=this.transformInv_(l);(this.addQuad_(s,h,c,l,a,v,y,p,10),this.wrapsXInSource_)&&(f=1/0,this.triangles_.forEach(function(n){f=Math.min(f,n.source[0][0],n.source[1][0],n.source[2][0])}),this.triangles_.forEach(function(n){var t,i;Math.max(n.source[0][0],n.source[1][0],n.source[2][0])-f>this.sourceWorldWidth_/2&&(t=[[n.source[0][0],n.source[0][1]],[n.source[1][0],n.source[1][1]],[n.source[2][0],n.source[2][1]]],t[0][0]-f>this.sourceWorldWidth_/2&&(t[0][0]-=this.sourceWorldWidth_),t[1][0]-f>this.sourceWorldWidth_/2&&(t[1][0]-=this.sourceWorldWidth_),t[2][0]-f>this.sourceWorldWidth_/2&&(t[2][0]-=this.sourceWorldWidth_),i=Math.min(t[0][0],t[1][0],t[2][0]),Math.max(t[0][0],t[1][0],t[2][0])-i<this.sourceWorldWidth_/2&&(n.source=t))}.bind(this)));e={}};bl.prototype.addTriangle_=function(n,t,i,r,u,f){this.triangles_.push({source:[r,u,f],target:[n,t,i]})};bl.prototype.addQuad_=function(n,t,i,r,u,f,e,o,s){var g=hi([u,f,e,o]),c=this.sourceWorldWidth_?wt(g)/this.sourceWorldWidth_:null,a=this.sourceWorldWidth_,v=this.sourceProj_.canWrapX()&&c>.5&&c<1,h=!1,y,nt,l,p;if(s>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(h=wt(hi([n,t,i,r]))/this.targetWorldWidth_>.25||h),!v&&this.sourceProj_.isGlobal()&&c&&(h=c>.25||h)),h||!this.maxSourceExtent_||dt(g,this.maxSourceExtent_)){if(!(h||isFinite(u[0])&&isFinite(u[1])&&isFinite(f[0])&&isFinite(f[1])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1]))){if(!(s>0))return;h=!0}if(s>0&&(h||(nt=[(n[0]+i[0])/2,(n[1]+i[1])/2],l=this.transformInv_(nt),y=v?(df(u[0],a)+df(e[0],a))/2-df(l[0],a):(u[0]+e[0])/2-l[0],p=(u[1]+e[1])/2-l[1],h=y*y+p*p>this.errorThresholdSquared_),h)){if(Math.abs(n[0]-i[0])<=Math.abs(n[1]-i[1])){var w=[(t[0]+i[0])/2,(t[1]+i[1])/2],tt=this.transformInv_(w),b=[(r[0]+n[0])/2,(r[1]+n[1])/2],it=this.transformInv_(b);this.addQuad_(n,t,w,b,u,f,tt,it,s-1);this.addQuad_(b,w,i,r,it,tt,e,o,s-1)}else{var k=[(n[0]+t[0])/2,(n[1]+t[1])/2],rt=this.transformInv_(k),d=[(i[0]+r[0])/2,(i[1]+r[1])/2],ut=this.transformInv_(d);this.addQuad_(n,k,d,r,u,rt,ut,o,s-1);this.addQuad_(k,t,i,d,rt,f,e,ut,s-1)}return}if(v){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(n,i,r,u,e,o);this.addTriangle_(n,t,i,u,f,e)}};bl.prototype.calculateSourceExtent=function(){var n=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(t){var i=t.source;se(n,i[0]);se(n,i[1]);se(n,i[2])}),n};bl.prototype.getTriangles=function(){return this.triangles_};var yct=bl,gti=function(n){function t(t,i,r,u,f,e,o,s,h,l,a){var b,rt,p,ut,y,w,k,d,nt;n.call(this,f,c.IDLE);this.renderEdges_=void 0!==a&&a;this.pixelRatio_=o;this.gutter_=s;this.canvas_=null;this.sourceTileGrid_=i;this.targetTileGrid_=u;this.wrappedTileCoord_=e||f;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;var tt=u.getTileCoordExtent(this.wrappedTileCoord_),it=this.targetTileGrid_.getExtent(),v=this.sourceTileGrid_.getExtent(),g=it?of(tt,it):tt;if(0!==up(g))if(b=t.getExtent(),b&&(v=v?of(v,b):b),rt=u.getResolution(this.wrappedTileCoord_[0]),p=wb(t,r,su(g),rt),!isFinite(p)||p<=0)this.state=c.EMPTY;else if(ut=void 0!==l?l:pot,this.triangulation_=new yct(t,r,g,v,p*ut),0!==this.triangulation_.getTriangles().length)if(this.sourceZ_=i.getZForResolution(p),y=this.triangulation_.calculateSourceExtent(),v&&(t.canWrapX()?(y[1]=vi(y[1],v[1],v[3]),y[3]=vi(y[3],v[1],v[3])):y=of(y,v)),up(y)){for(w=i.getTileRangeForExtentAndZ(y,this.sourceZ_),k=w.minX;k<=w.maxX;k++)for(d=w.minY;d<=w.maxY;d++)nt=h(this.sourceZ_,k,d,o),nt&&this.sourceTiles_.push(nt);0===this.sourceTiles_.length&&(this.state=c.EMPTY)}else this.state=c.EMPTY;else this.state=c.EMPTY;else this.state=c.EMPTY}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.state==c.LOADING&&this.unlistenSources_();n.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.canvas_},t.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(n){n&&n.getState()==c.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=c.ERROR;else{var i=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(i),r="number"==typeof n?n:n[0],u="number"==typeof n?n:n[1],f=this.targetTileGrid_.getResolution(i),e=this.sourceTileGrid_.getResolution(this.sourceZ_),o=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=vct(r,u,this.pixelRatio_,e,this.sourceTileGrid_.getExtent(),f,o,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=c.LOADED}this.changed()},t.prototype.load=function(){if(this.state==c.IDLE){this.state=c.LOADING;this.changed();var n=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach(function(t){var r=t.getState(),i;(r==c.IDLE||r==c.LOADING)&&(n++,i=o(t,a.CHANGE,function(){var r=t.getState();r!=c.LOADED&&r!=c.ERROR&&r!=c.EMPTY||(lt(i),0==--n&&(this.unlistenSources_(),this.reproject_()))},this),this.sourcesListenerKeys_.push(i))}.bind(this));this.sourceTiles_.forEach(function(n){n.getState()==c.IDLE&&n.load()});0===n&&setTimeout(this.reproject_.bind(this),0)}},t.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(lt);this.sourcesListenerKeys_=null},t}(vl),nii="tileloadstart",tii="tileloadend",iii="tileloaderror",pct=function(n){function t(t){n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,key:t.key,attributionsCollapsible:t.attributionsCollapsible});this.generateTileUrlFunction_=!t.tileUrlFunction;this.tileLoadFunction=t.tileLoadFunction;this.tileUrlFunction=t.tileUrlFunction?t.tileUrlFunction.bind(this):stt;this.urls=null;t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url);t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction,this.key_);this.tileLoadingKeys_={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},t.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},t.prototype.getUrls=function(){return this.urls},t.prototype.handleTileChange=function(n){var t,r=n.target,u=y(r),i=r.getState();i==c.LOADING?(this.tileLoadingKeys_[u]=!0,t=nii):u in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[u],t=i==c.ERROR?iii:i==c.LOADED||i==c.ABORT?tii:void 0);void 0!=t&&this.dispatchEvent(new ati(t,r))},t.prototype.setTileLoadFunction=function(n){this.tileCache.clear();this.tileLoadFunction=n;this.changed()},t.prototype.setTileUrlFunction=function(n,t){this.tileUrlFunction=n;this.tileCache.pruneExceptNewestZ();void 0!==t?this.setKey(t):this.changed()},t.prototype.setUrl=function(n){var t=this.urls=htt(n);this.setUrls(t)},t.prototype.setUrls=function(n){this.urls=n;var t=n.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(ott(n,this.tileGrid),t):this.setKey(t)},t.prototype.useTile=function(n,t,i){var r=ss(n,t,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},t}(gv);var cs=function(n){function t(t){n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:rii,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,key:t.key,attributionsCollapsible:t.attributionsCollapsible});this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null;this.tileClass=void 0!==t.tileClass?t.tileClass:cb;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var n in this.tileCacheForProjection)if(this.tileCacheForProjection[n].canExpireCache())return!0;return!1},t.prototype.expireCache=function(n,t){var r=this.getTileCacheForProjection(n),u,i;for(u in this.tileCache.expireCache(this.tileCache==r?t:{}),this.tileCacheForProjection)i=this.tileCacheForProjection[u],i.expireCache(i==r?t:{})},t.prototype.getGutterForProjection=function(n){return this.getProjection()&&n&&!hu(this.getProjection(),n)?0:this.getGutter()},t.prototype.getGutter=function(){return 0},t.prototype.getOpaque=function(t){return!(this.getProjection()&&t&&!hu(this.getProjection(),t))&&n.prototype.getOpaque.call(this,t)},t.prototype.getTileGridForProjection=function(n){var i=this.getProjection(),t;return!this.tileGrid||i&&!hu(i,n)?(t=y(n),t in this.tileGridForProjection||(this.tileGridForProjection[t]=ght(n)),this.tileGridForProjection[t]):this.tileGrid},t.prototype.getTileCacheForProjection=function(n){var i=this.getProjection(),t;return!i||hu(i,n)?this.tileCache:(t=y(n),t in this.tileCacheForProjection||(this.tileCacheForProjection[t]=new itt(this.tileCache.highWaterMark)),this.tileCacheForProjection[t])},t.prototype.createTile_=function(n,t,i,r,u,f){var h=[n,t,i],l=this.getTileCoordForTileUrlFunction(h,u),e=l?this.tileUrlFunction(l,r,u):void 0,s=new this.tileClass(h,void 0!==e?c.IDLE:c.EMPTY,void 0!==e?e:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return s.key=f,o(s,a.CHANGE,this.handleTileChange,this),s},t.prototype.getTile=function(n,t,i,r,u){var f=this.getProjection(),l;if(f&&u&&!hu(f,u)){var e,s=this.getTileCacheForProjection(u),c=[n,t,i],h=kht(c);if(s.containsKey(h)&&(e=s.get(h)),l=this.getKey(),e&&e.key==l)return e;var a=this.getTileGridForProjection(f),v=this.getTileGridForProjection(u),y=this.getTileCoordForTileUrlFunction(c,u),o=new gti(f,a,u,v,c,y,this.getTilePixelRatio(r),this.getGutter(),function(n,t,i,r){return this.getTileInternal(n,t,i,r,f)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return o.key=l,e?(o.interimTile=e,o.refreshInterimChain(),s.replace(h,o)):s.set(h,o),o}return this.getTileInternal(n,t,i,r,f||u)},t.prototype.getTileInternal=function(n,t,i,r,u){var f=null,e=ss(n,t,i),s=this.getKey(),o;return this.tileCache.containsKey(e)?(f=this.tileCache.get(e)).key!=s&&(o=f,f=this.createTile_(n,t,i,r,u,s),f.interimTile=o.getState()==c.IDLE?o.interimTile:o,f.refreshInterimChain(),this.tileCache.replace(e,f)):(f=this.createTile_(n,t,i,r,u,s),this.tileCache.set(e,f)),f},t.prototype.setRenderReprojectionEdges=function(n){if(this.renderReprojectionEdges_!=n){for(var t in this.renderReprojectionEdges_=n,this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}},t.prototype.setTileGridForProjection=function(n,t){var r=w(n),i;r&&(i=y(r),i in this.tileGridForProjection||(this.tileGridForProjection[i]=t))},t}(pct),uii=function(n){function t(t){var i=void 0!==t.hidpi&&t.hidpi;n.call(this,{cacheSize:t.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:w("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:pi.LOADING,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:i?2:1,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition});this.hidpi_=i;this.culture_=void 0!==t.culture?t.culture:"en-us";this.maxZoom_=void 0!==t.maxZoom?t.maxZoom:-1;this.apiKey_=t.key;this.imagerySet_=t.imagerySet;pb("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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getApiKey=function(){return this.apiKey_},t.prototype.getImagerySet=function(){return this.imagerySet_},t.prototype.handleImageryMetadataResponse=function(n){var r,u,f;if(200==n.statusCode&&"OK"==n.statusDescription&&"ValidCredentials"==n.authenticationResultCode&&1==n.resourceSets.length&&1==n.resourceSets[0].resources.length){var t=n.resourceSets[0].resources[0],e=-1==this.maxZoom_?t.zoomMax:this.maxZoom_,o=uc(this.getProjection()),i=this.hidpi_?2:1,s=t.imageWidth==t.imageHeight?t.imageWidth/i:[t.imageWidth/i,t.imageHeight/i],h=pl({extent:o,minZoom:t.zoomMin,maxZoom:e,tileSize:s});this.tileGrid=h;r=this.culture_;u=this.hidpi_;(this.tileUrlFunction=iy(t.imageUrlSubdomains.map(function(n){var i=[0,0,0],f=t.imageUrl.replace("{subdomain}",n).replace("{culture}",r);return function(n){if(n){ntt(n[0],n[1],-n[2]-1,i);var t=f;return u&&(t+="&dpi=d1&device=mobile"),t.replace("{quadkey}",function(n){for(var i,r=n[0],f=new Array(r),u=1<<r-1,t=0;t<r;++t)i=48,n[1]&u&&(i+=1),n[2]&u&&(i+=2),f[t]=String.fromCharCode(i),u>>=1;return f.join("")}(i))}}})),t.imageryProviders)&&(f=wo(w("EPSG:4326"),this.getProjection()),this.setAttributions(function(n){var i=[],r=n.viewState,u=this.getTileGrid().getTileCoordForCoordAndResolution(r.center,r.resolution)[0];return t.imageryProviders.map(function(t){for(var e,r,s=!1,h=t.coverageAreas,o=0,c=h.length;o<c;++o)if(e=h[o],u>=e.zoomMin&&u<=e.zoomMax&&(r=e.bbox,dt(la([r[1],r[0],r[3],r[2]],f),n.extent))){s=!0;break}s&&i.push(t.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(pi.READY)}else this.setState(pi.ERROR)},t}(cs),bb=function(n){function t(t){var i=t||{},r=void 0!==i.projection?i.projection:"EPSG:3857",u=void 0!==i.tileGrid?i.tileGrid:pl({extent:uc(r),maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});n.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,opaque:i.opaque,projection:r,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:u,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(cs),fii=function(n){function t(t){n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,maxZoom:void 0!==t.maxZoom?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,wrapX:t.wrapX});this.account_=t.account;this.mapId_=t.map||"";this.config_=t.config||{};this.templateCache_={};this.initializeMap_()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getConfig=function(){return this.config_},t.prototype.updateConfig=function(n){nt(this.config_,n);this.initializeMap_()},t.prototype.setConfig=function(n){this.config_=n||{};this.initializeMap_()},t.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_),i,n;this.templateCache_[t]?this.applyTemplate_(this.templateCache_[t]):(i="https://"+this.account_+".carto.com/api/v1/map",this.mapId_&&(i+="/named/"+this.mapId_),n=new XMLHttpRequest,n.addEventListener("load",this.handleInitResponse_.bind(this,t)),n.addEventListener("error",this.handleInitError_.bind(this)),n.open("POST",i),n.setRequestHeader("Content-type","application/json"),n.send(JSON.stringify(this.config_)))},t.prototype.handleInitResponse_=function(n,t){var i=t.target,r;if(!i.status||i.status>=200&&i.status<300){try{r=JSON.parse(i.responseText)}catch(n){return void this.setState(pi.ERROR)}this.applyTemplate_(r);this.templateCache_[n]=r;this.setState(pi.READY)}else this.setState(pi.ERROR)},t.prototype.handleInitError_=function(){this.setState(pi.ERROR)},t.prototype.applyTemplate_=function(n){var t="https://"+n.cdn_url.https+"/"+this.account_+"/api/v1/map/"+n.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(t)},t}(bb),fe={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"},ry=function(n){function t(t,i){n.call(this,t);this.feature=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),ec=function(n){function t(t){var i=t||{},r,u,f;n.call(this,{attributions:i.attributions,projection:void 0,state:pi.READY,wrapX:void 0===i.wrapX||i.wrapX});this.loader_=wf;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_&&(g(this.format_,7),this.loader_=uct(this.url_,this.format_));this.strategy_=void 0!==i.strategy?i.strategy:fct;f=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=f?new ic:null;this.loadedExtentsRtree_=new ic;this.nullGeometryFeatures_={};this.idIndex_={};this.undefIdIndex_={};this.featureChangeKeys_={};this.featuresCollection_=null;Array.isArray(i.features)?u=i.features:i.features&&(u=(r=i.features).getArray());f||void 0!==r||(r=new er(u));void 0!==u&&this.addFeaturesInternal(u);void 0!==r&&this.bindFeaturesCollection_(r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addFeature=function(n){this.addFeatureInternal(n);this.changed()},t.prototype.addFeatureInternal=function(n){var t=y(n),i,r;this.addToIndex_(t,n)&&(this.setupChangeEvents_(t,n),i=n.getGeometry(),i?(r=i.getExtent(),this.featuresRtree_&&this.featuresRtree_.insert(r,n)):this.nullGeometryFeatures_[t]=n,this.dispatchEvent(new ry(fe.ADDFEATURE,n)))},t.prototype.setupChangeEvents_=function(n,t){this.featureChangeKeys_[n]=[o(t,a.CHANGE,this.handleFeatureChange_,this),o(t,gs,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(n,t){var r=!0,i=t.getId();return void 0!==i?i.toString()in this.idIndex_?r=!1:this.idIndex_[i.toString()]=t:(g(!(n in this.undefIdIndex_),30),this.undefIdIndex_[n]=t),r},t.prototype.addFeatures=function(n){this.addFeaturesInternal(n);this.changed()},t.prototype.addFeaturesInternal=function(n){for(var r,l,u,a,t,o,s,v,f,p,h=[],i=[],c=[],e=0,w=n.length;e<w;e++)r=n[e],l=y(r),this.addToIndex_(l,r)&&i.push(r);for(u=0,a=i.length;u<a;u++)t=i[u],o=y(t),this.setupChangeEvents_(o,t),s=t.getGeometry(),s?(v=s.getExtent(),h.push(v),c.push(t)):this.nullGeometryFeatures_[o]=t;for(this.featuresRtree_&&this.featuresRtree_.load(h,c),f=0,p=i.length;f<p;f++)this.dispatchEvent(new ry(fe.ADDFEATURE,i[f]))},t.prototype.bindFeaturesCollection_=function(n){var t=!1;o(this,fe.ADDFEATURE,function(i){t||(t=!0,n.push(i.feature),t=!1)});o(this,fe.REMOVEFEATURE,function(i){t||(t=!0,n.remove(i.feature),t=!1)});o(n,ki.ADD,function(n){t||(t=!0,this.addFeature(n.element),t=!1)},this);o(n,ki.REMOVE,function(n){t||(t=!0,this.removeFeature(n.element),t=!1)},this);this.featuresCollection_=n},t.prototype.clear=function(n){var t,i,r;if(n){for(t in this.featureChangeKeys_)this.featureChangeKeys_[t].forEach(lt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(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_={};r=new ry(fe.CLEAR);this.dispatchEvent(r);this.changed()},t.prototype.forEachFeature=function(n){if(this.featuresRtree_)return this.featuresRtree_.forEach(n);this.featuresCollection_&&this.featuresCollection_.forEach(n)},t.prototype.forEachFeatureAtCoordinateDirect=function(n,t){var i=[n[0],n[1],n[0],n[1]];return this.forEachFeatureInExtent(i,function(i){if(i.getGeometry().intersectsCoordinate(n))return t(i)})},t.prototype.forEachFeatureInExtent=function(n,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(n,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},t.prototype.forEachFeatureIntersectingExtent=function(n,t){return this.forEachFeatureInExtent(n,function(i){if(i.getGeometry().intersectsExtent(n)){var r=t(i);if(r)return r}})},t.prototype.getFeaturesCollection=function(){return this.featuresCollection_},t.prototype.getFeatures=function(){var n;return this.featuresCollection_?n=this.featuresCollection_.getArray():this.featuresRtree_&&(n=this.featuresRtree_.getAll(),wu(this.nullGeometryFeatures_)||pt(n,wk(this.nullGeometryFeatures_))),n},t.prototype.getFeaturesAtCoordinate=function(n){var t=[];return this.forEachFeatureAtCoordinateDirect(n,function(n){t.push(n)}),t},t.prototype.getFeaturesInExtent=function(n){return this.featuresRtree_.getInExtent(n)},t.prototype.getClosestFeatureToCoordinate=function(n,t){var u=n[0],f=n[1],e=null,o=[NaN,NaN],r=1/0,i=[-1/0,-1/0,1/0,1/0],s=t||bu;return this.featuresRtree_.forEachInExtent(i,function(n){var h,c,t;s(n)&&(h=n.getGeometry(),c=r,(r=h.closestPointXY(u,f,o,r))<c&&(e=n,t=Math.sqrt(r),i[0]=u-t,i[1]=f-t,i[2]=u+t,i[3]=f+t))}),e},t.prototype.getExtent=function(n){return this.featuresRtree_.getExtent(n)},t.prototype.getFeatureById=function(n){var t=this.idIndex_[n.toString()];return void 0!==t?t:null},t.prototype.getFormat=function(){return this.format_},t.prototype.getOverlaps=function(){return this.overlaps_},t.prototype.getUrl=function(){return this.url_},t.prototype.handleFeatureChange_=function(n){var t=n.target,i=y(t),e=t.getGeometry(),u,f,r;e?(u=e.getExtent(),i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(u,t)):this.featuresRtree_&&this.featuresRtree_.update(u,t)):i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[i]=t);f=t.getId();void 0!==f?(r=f.toString(),i in this.undefIdIndex_?(delete this.undefIdIndex_[i],this.idIndex_[r]=t):this.idIndex_[r]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[r]=t)):i in this.undefIdIndex_||(this.removeFromIdIndex_(t),this.undefIdIndex_[i]=t);this.changed();this.dispatchEvent(new ry(fe.CHANGEFEATURE,t))},t.prototype.hasFeature=function(n){var t=n.getId();return void 0!==t?t in this.idIndex_:y(n)in this.undefIdIndex_},t.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&wu(this.nullGeometryFeatures_)},t.prototype.loadFeatures=function(n,t,i){var r=this,f=this.loadedExtentsRtree_,e=this.strategy_(n,t);this.loading=!1;for(var o=function(n){var u=e[n];f.forEachInExtent(u,function(n){return lr(n.extent,u)})||(r.loader_.call(r,u,t,i),f.insert(u,{extent:u.slice()}),r.loading=r.loader_!==wf)},u=0,s=e.length;u<s;++u)o(u)},t.prototype.removeLoadedExtent=function(n){var t,i=this.loadedExtentsRtree_;i.forEachInExtent(n,function(i){if(oe(i.extent,n))return t=i,!0});t&&i.remove(t)},t.prototype.removeFeature=function(n){var t=y(n);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(n);this.removeFeatureInternal(n);this.changed()},t.prototype.removeFeatureInternal=function(n){var t=y(n),i;this.featureChangeKeys_[t].forEach(lt);delete this.featureChangeKeys_[t];i=n.getId();void 0!==i?delete this.idIndex_[i.toString()]:delete this.undefIdIndex_[t];this.dispatchEvent(new ry(fe.REMOVEFEATURE,n))},t.prototype.removeFromIdIndex_=function(n){var t=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i];t=!0;break}return t},t.prototype.setLoader=function(n){this.loader_=n},t}(lb),eii=function(n){function t(t){n.call(this,{attributions:t.attributions,wrapX:t.wrapX});this.resolution=void 0;this.distance=void 0!==t.distance?t.distance:20;this.features=[];this.geometryFunction=t.geometryFunction||function(n){var t=n.getGeometry();return g(t.getType()==f.POINT,10),t};this.source=t.source;o(this.source,a.CHANGE,this.refresh,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDistance=function(){return this.distance},t.prototype.getSource=function(){return this.source},t.prototype.loadFeatures=function(n,t,i){this.source.loadFeatures(n,t,i);t!==this.resolution&&(this.clear(),this.resolution=t,this.cluster(),this.addFeatures(this.features))},t.prototype.setDistance=function(n){this.distance=n;this.refresh()},t.prototype.refresh=function(){this.clear();this.cluster();this.addFeatures(this.features);n.prototype.refresh.call(this)},t.prototype.cluster=function(){var u,f,t;if(void 0!==this.resolution){this.features.length=0;for(var n=[1/0,1/0,-1/0,-1/0],o=this.distance*this.resolution,e=this.source.getFeatures(),i={},r=0,s=e.length;r<s;r++)u=e[r],y(u)in i||(f=this.geometryFunction(u),f&&(uh(f.getCoordinates(),n),ff(n,o,n),t=this.source.getFeaturesInExtent(n),t=t.filter(function(n){var t=y(n);return!(t in i)&&(i[t]=!0,!0)}),this.features.push(this.createCluster(t))))}},t.prototype.createCluster=function(n){for(var r,u,i=[0,0],t=n.length-1;t>=0;--t)r=this.geometryFunction(n[t]),r?ka(i,r.getCoordinates()):n.splice(t,1);return gd(i,1/n.length),u=new fi(new ei(i)),u.set("features",n),u},t}(ec),oii=function(n){function t(t,i,r,u,f,e){var h=t.getExtent(),c=i.getExtent(),l=c?of(r,c):r,a=wb(t,i,su(l),u),v=new yct(t,i,l,h,a*pot),o=e(v.calculateSourceExtent(),a,f),y=ot.LOADED,s;o&&(y=ot.IDLE);s=o?o.getPixelRatio():1;n.call(this,r,u,s,y);this.targetProj_=i;this.maxSourceExtent_=h;this.triangulation_=v;this.targetResolution_=u;this.targetExtent_=r;this.sourceImage_=o;this.sourcePixelRatio_=s;this.canvas_=null;this.sourceListenerKey_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.state==ot.LOADING&&this.unlistenSource_();n.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.canvas_},t.prototype.getProjection=function(){return this.targetProj_},t.prototype.reproject_=function(){var n=this.sourceImage_.getState(),t,i;n==ot.LOADED&&(t=wt(this.targetExtent_)/this.targetResolution_,i=ti(this.targetExtent_)/this.targetResolution_,this.canvas_=vct(t,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=n;this.changed()},t.prototype.load=function(){if(this.state==ot.IDLE){this.state=ot.LOADING;this.changed();var n=this.sourceImage_.getState();n==ot.LOADED||n==ot.ERROR?this.reproject_():(this.sourceListenerKey_=o(this.sourceImage_,a.CHANGE,function(){var n=this.sourceImage_.getState();n!=ot.LOADED&&n!=ot.ERROR||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},t.prototype.unlistenSource_=function(){lt(this.sourceListenerKey_);this.sourceListenerKey_=null},t}(fn),sii="imageloadstart",hii="imageloadend",cii="imageloaderror",ltt=function(n){function t(t,i){n.call(this,t);this.image=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr);ls=function(n){function t(t){n.call(this,{attributions:t.attributions,projection:t.projection,state:t.state});this.resolutions_=void 0!==t.resolutions?t.resolutions:null;this.reprojectedImage_=null;this.reprojectedRevision_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.findNearestResolution=function(n){if(this.resolutions_){var t=np(this.resolutions_,n,0);n=this.resolutions_[t]}return n},t.prototype.getImage=function(n,t,i,r){var u=this.getProjection();if(u&&r&&!hu(u,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&hu(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&oe(this.reprojectedImage_.getExtent(),n))return this.reprojectedImage_;this.reprojectedImage_.dispose();this.reprojectedImage_=null}return this.reprojectedImage_=new oii(u,r,n,t,i,function(n,t,i){return this.getImageInternal(n,t,i,u)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return u&&(r=u),this.getImageInternal(n,t,i,r)},t.prototype.getImageInternal=function(){return p()},t.prototype.handleImageChange=function(n){var t=n.target;switch(t.getState()){case ot.LOADING:this.loading=!0;this.dispatchEvent(new ltt(sii,t));break;case ot.LOADED:this.loading=!1;this.dispatchEvent(new ltt(hii,t));break;case ot.ERROR:this.loading=!1;this.dispatchEvent(new ltt(cii,t))}},t}(lb);uy=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,r,ot.IDLE);this.src_=u;this.image_=new Image;null!==f&&(this.image_.crossOrigin=f);this.imageListenerKeys_=null;this.state=ot.IDLE;this.imageLoadFunction_=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getImage=function(){return this.image_},t.prototype.handleImageError_=function(){this.state=ot.ERROR;this.unlistenImage_();this.changed()},t.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ti(this.extent)/this.image_.height);this.state=ot.LOADED;this.unlistenImage_();this.changed()},t.prototype.load=function(){this.state!=ot.IDLE&&this.state!=ot.ERROR||(this.state=ot.LOADING,this.changed(),this.imageListenerKeys_=[ee(this.image_,a.ERROR,this.handleImageError_,this),ee(this.image_,a.LOAD,this.handleImageLoad_,this)],this.imageLoadFunction_(this,this.src_))},t.prototype.setImage=function(n){this.image_=n},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(lt);this.imageListenerKeys_=null},t}(fn);var lii=function(n){function t(t){var i=t||{};n.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:kb;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getParams=function(){return this.params_},t.prototype.getImageInternal=function(n,t,i,r){var u,h,e,s,c,l,p;if(void 0===this.url_)return null;if(t=this.findNearestResolution(t),i=this.hidpi_?i:1,u=this.image_,u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==t&&u.getPixelRatio()==i&&lr(u.getExtent(),n))return u;h={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};nt(h,this.params_);e=((n=n.slice())[0]+n[2])/2;s=(n[1]+n[3])/2;1!=this.ratio_&&(c=this.ratio_*wt(n)/2,l=this.ratio_*ti(n)/2,n[0]=e-c,n[1]=s-l,n[2]=e+c,n[3]=s+l);var f=t/i,v=Math.ceil(wt(n)/f),y=Math.ceil(ti(n)/f);return n[0]=e-f*v/2,n[2]=e+f*v/2,n[1]=s-f*y/2,n[3]=s+f*y/2,this.imageSize_[0]=v,this.imageSize_[1]=y,p=this.getRequestUrl_(n,this.imageSize_,i,r,h),this.image_=new uy(n,t,i,p,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),o(this.image_,a.CHANGE,this.handleImageChange,this),this.image_},t.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},t.prototype.getRequestUrl_=function(n,t,i,r,u){var o=r.getCode().split(":").pop(),f,e;return u.SIZE=t[0]+","+t[1],u.BBOX=n.join(","),u.BBOXSR=o,u.IMAGESR=o,u.DPI=Math.round(90*i),f=this.url_,e=f.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),e==f&&g(!1,50),oc(e,u)},t.prototype.getUrl=function(){return this.url_},t.prototype.setImageLoadFunction=function(n){this.image_=null;this.imageLoadFunction_=n;this.changed()},t.prototype.setUrl=function(n){n!=this.url_&&(this.url_=n,this.image_=null,this.changed())},t.prototype.updateParams=function(n){nt(this.params_,n);this.image_=null;this.changed()},t}(ls),aii=function(n){function t(t){var i=t||{};n.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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getImageInternal=function(n,t,i,r){var u,e,f;return(t=this.findNearestResolution(t),u=this.canvas_,u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==t&&u.getPixelRatio()==i&&lr(u.getExtent(),n))?u:(fp(n=n.slice(),this.ratio_),e=[wt(n)/t*i,ti(n)/t*i],f=this.canvasFunction_.call(this,n,t,i,e,r),f&&(u=new en(n,t,i,f)),this.canvas_=u,this.renderedRevision_=this.getRevision(),u)},t}(ls),vii=function(n){function t(t){n.call(this,{projection:t.projection,resolutions:t.resolutions});this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;this.displayDpi_=void 0!==t.displayDpi?t.displayDpi:96;this.params_=t.params||{};this.url_=t.url;this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:kb;this.hidpi_=void 0===t.hidpi||t.hidpi;this.metersPerUnit_=void 0!==t.metersPerUnit?t.metersPerUnit:1;this.ratio_=void 0!==t.ratio?t.ratio:1;this.useOverlay_=void 0!==t.useOverlay&&t.useOverlay;this.image_=null;this.renderedRevision_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getParams=function(){return this.params_},t.prototype.getImageInternal=function(n,t,i,r){var u,f,e;return(t=this.findNearestResolution(t),i=this.hidpi_?i:1,u=this.image_,u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==t&&u.getPixelRatio()==i&&lr(u.getExtent(),n))?u:(1!=this.ratio_&&fp(n=n.slice(),this.ratio_),f=[wt(n)/t*i,ti(n)/t*i],void 0!==this.url_?(e=this.getUrl(this.url_,this.params_,n,f,r),o(u=new uy(n,t,i,e,this.crossOrigin_,this.imageLoadFunction_),a.CHANGE,this.handleImageChange,this)):u=null,this.image_=u,this.renderedRevision_=this.getRevision(),u)},t.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},t.prototype.updateParams=function(n){nt(this.params_,n);this.changed()},t.prototype.getUrl=function(n,t,i,r){var e=function(n,t,i,r){var u=wt(n),f=ti(n),e=t[0],o=t[1],s=.0254/r;return o*u>e*f?u*i/(e*s):f*i/(o*s)}(i,r,this.metersPerUnit_,this.displayDpi_),u=su(i),f={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:e,SETVIEWCENTERX:u[0],SETVIEWCENTERY:u[1]};return nt(f,t),oc(n,f)},t.prototype.setImageLoadFunction=function(n){this.image_=null;this.imageLoadFunction_=n;this.changed()},t}(ls),yii=function(n){function t(t){var i=void 0!==t.crossOrigin?t.crossOrigin:null,r=void 0!==t.imageLoadFunction?t.imageLoadFunction:kb;n.call(this,{attributions:t.attributions,projection:w(t.projection)});this.url_=t.url;this.imageExtent_=t.imageExtent;this.image_=new uy(this.imageExtent_,void 0,1,this.url_,i,r);this.imageSize_=t.imageSize?t.imageSize:null;o(this.image_,a.CHANGE,this.handleImageChange,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getImageExtent=function(){return this.imageExtent_},t.prototype.getImageInternal=function(n){return dt(n,this.image_.getExtent())?this.image_:null},t.prototype.getUrl=function(){return this.url_},t.prototype.handleImageChange=function(t){var r,i,e,u,h,o,s,f;this.image_.getState()==ot.LOADED&&(e=this.image_.getExtent(),u=this.image_.getImage(),this.imageSize_?(r=this.imageSize_[0],i=this.imageSize_[1]):(r=u.width,i=u.height),h=ti(e)/i,o=Math.ceil(wt(e)/h),o!=r&&(s=kt(o,i),f=s.canvas,s.drawImage(u,0,0,r,i,0,0,f.width,f.height),this.image_.setImage(f)));n.prototype.handleImageChange.call(this,t)},t}(ls),kl="1.3.0",wct="carmentaserver",bct="geoserver",kct="mapserver",dct="qgis",gct=[101,101],pii=function(n){function t(t){var i=t||{};n.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:kb;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getGetFeatureInfoUrl=function(n,t,i,r){var f,u,o,e,s,h;if(void 0!==this.url_)return f=w(i),u=this.getProjection(),u&&u!==f&&(t=wb(u,f,n,t),n=dc(n,f,u)),o=ca(n,t,0,gct),e={SERVICE:"WMS",VERSION:kl,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS},nt(e,this.params_,r),s=Math.floor((n[0]-o[0])/t),h=Math.floor((o[3]-n[1])/t),e[this.v13_?"I":"X"]=s,e[this.v13_?"J":"Y"]=h,this.getRequestUrl_(o,gct,1,u||f,e)},t.prototype.getParams=function(){return this.params_},t.prototype.getImageInternal=function(n,t,i,r){var s,c;if(void 0===this.url_)return null;t=this.findNearestResolution(t);1==i||this.hidpi_&&void 0!==this.serverType_||(i=1);var u=t/i,h=su(n),l=ca(h,u,0,[Math.ceil(wt(n)/u),Math.ceil(ti(n)/u)]),e=ca(h,u,0,[Math.ceil(this.ratio_*wt(n)/u),Math.ceil(this.ratio_*ti(n)/u)]),f=this.image_;return f&&this.renderedRevision_==this.getRevision()&&f.getResolution()==t&&f.getPixelRatio()==i&&lr(f.getExtent(),l)?f:(s={SERVICE:"WMS",VERSION:kl,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0},nt(s,this.params_),this.imageSize_[0]=Math.round(wt(e)/u),this.imageSize_[1]=Math.round(ti(e)/u),c=this.getRequestUrl_(e,this.imageSize_,i,r,s),this.image_=new uy(e,t,i,c,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),o(this.image_,a.CHANGE,this.handleImageChange,this),this.image_)},t.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},t.prototype.getRequestUrl_=function(n,t,i,r,u){var f,e,o;if(g(void 0!==this.url_,9),u[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(u.STYLES=""),1!=i)switch(this.serverType_){case bct:f=90*i+.5|0;"FORMAT_OPTIONS"in u?u.FORMAT_OPTIONS+=";dpi:"+f:u.FORMAT_OPTIONS="dpi:"+f;break;case kct:u.MAP_RESOLUTION=90*i;break;case wct:case dct:u.DPI=90*i;break;default:g(!1,8)}return u.WIDTH=t[0],u.HEIGHT=t[1],o=r.getAxisOrientation(),e=this.v13_&&"ne"==o.substr(0,2)?[n[1],n[0],n[3],n[2]]:n,u.BBOX=e.join(","),oc(this.url_,u)},t.prototype.getUrl=function(){return this.url_},t.prototype.setImageLoadFunction=function(n){this.image_=null;this.imageLoadFunction_=n;this.changed()},t.prototype.setUrl=function(n){n!=this.url_&&(this.url_=n,this.image_=null,this.changed())},t.prototype.updateParams=function(n){nt(this.params_,n);this.updateV13_();this.image_=null;this.changed()},t.prototype.updateV13_=function(){var n=this.params_.VERSION||kl;this.v13_=pft(n,"1.3")>=0},t}(ls),att='&#169; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap<\/a> contributors.',wii=function(n){function t(t){var r,i=t||{},u,f;r=void 0!==i.attributions?i.attributions:[att];u=void 0!==i.crossOrigin?i.crossOrigin:"anonymous";f=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";n.call(this,{attributions:r,cacheSize:i.cacheSize,crossOrigin:u,opaque:void 0===i.opaque||i.opaque,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,url:f,wrapX:i.wrapX,attributionsCollapsible:!1})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(bb),bii=i(2),nlt=function(n){function t(t){var i=t||{};n.call(this,i);this.type=kr.IMAGE}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(lw);nlt.prototype.getSource;var tlt=nlt,db="preload",gb="useInterimTilesOnError",ilt=function(n){function t(t){var i=t||{},r=nt({},i);delete r.preload;delete r.useInterimTilesOnError;n.call(this,r);this.setPreload(void 0!==i.preload?i.preload:0);this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError);this.type=kr.TILE}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getPreload=function(){return this.get(db)},t.prototype.setPreload=function(n){this.set(db,n)},t.prototype.getUseInterimTilesOnError=function(){return this.get(gb)},t.prototype.setUseInterimTilesOnError=function(n){this.set(gb,n)},t}(lw);ilt.prototype.getSource;var rlt=ilt,kii="beforeoperations",dii="afteroperations",ult={PIXEL:"pixel",IMAGE:"image"},flt=function(n){function t(t,i,r){n.call(this,t);this.extent=i.extent;this.resolution=i.viewState.resolution/i.pixelRatio;this.data=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),sc=null;var tri=function(n){function t(t){var i,f;for(n.call(this,{projection:null}),this.worker_=null,this.operationType_=void 0!==t.operationType?t.operationType:ult.PIXEL,this.threads_=void 0!==t.threads?t.threads:1,this.renderers_=function(n){for(var i=n.length,r=new Array(i),t=0;t<i;++t)r[t]=nri(n[t]);return r}(t.sources),i=0,f=this.renderers_.length;i<f;++i)o(this.renderers_[i],a.CHANGE,this.changed,this);this.tileQueue_=new vet(function(){return 1},this.changed.bind(this));for(var r=function(n){return n.map(function(n){return n.getLayer().getLayerState()})}(this.renderers_),e={},u=0,s=r.length;u<s;++u)e[y(r[u].layer)]=r[u];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:e,layerStatesArray:r,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!==t.operation&&this.setOperation(t.operation,t.lib)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setOperation=function(n,t){this.worker_=new bii.Processor({operation:n,imageOps:this.operationType_===ult.IMAGE,queue:1,lib:t,threads:this.threads_});this.changed()},t.prototype.updateFrameState_=function(n,t,i){var r=nt({},this.frameState_),f,u;return r.viewState=nt({},r.viewState),f=su(n),r.extent=n.slice(),r.focus=f,r.size[0]=Math.round(wt(n)/t),r.size[1]=Math.round(ti(n)/t),r.time=Date.now(),r.animate=!1,u=r.viewState,u.center=f,u.projection=i,u.resolution=t,r},t.prototype.allSourcesReady_=function(){for(var t=!0,n=0,i=this.renderers_.length;n<i;++n)if(this.renderers_[n].getLayer().getSource().getState()!==pi.READY){t=!1;break}return t},t.prototype.getImage=function(n,t,i,r){var u,f,e;return this.allSourcesReady_()?(u=this.updateFrameState_(n,t,r),(this.requestedFrameState_=u,this.renderedImageCanvas_)&&(f=this.renderedImageCanvas_.getResolution(),e=this.renderedImageCanvas_.getExtent(),t===f&&oe(n,e)||(this.renderedImageCanvas_=null)),this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),u.tileQueue.loadMoreTiles(16,16),u.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_):null},t.prototype.processSources_=function(){for(var i,r,t=this.requestedFrameState_,u=this.renderers_.length,f=new Array(u),n=0;n<u;++n){if(i=gii(this.renderers_[n],t,t.layerStatesArray[n]),!i)return;f[n]=i}r={};this.dispatchEvent(new flt(kii,t,r));this.worker_.process(f,r,this.onWorkerComplete_.bind(this,t))},t.prototype.onWorkerComplete_=function(n,t,i,r){var u,f,e;!t&&i&&(u=n.extent,f=n.viewState.resolution,f===this.requestedFrameState_.viewState.resolution&&oe(u,this.requestedFrameState_.extent)&&(this.renderedImageCanvas_?e=this.renderedImageCanvas_.getImage().getContext("2d"):(e=kt(Math.round(wt(u)/f),Math.round(ti(u)/f)),this.renderedImageCanvas_=new en(u,f,1,e.canvas)),e.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new flt(dii,n,r))))},t.prototype.getImageInternal=function(){return null},t}(ls),iri=['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>.',att],rri={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}},uri={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:1,maxZoom:16}},fri=function(n){function t(t){var i=t.layer.indexOf("-"),f=-1==i?t.layer:t.layer.slice(0,i),r=uri[f],u=rri[t.layer],e=void 0!==t.url?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+u.extension;n.call(this,{attributions:iri,cacheSize:t.cacheSize,crossOrigin:"anonymous",maxZoom:void 0!=t.maxZoom?t.maxZoom:r.maxZoom,minZoom:void 0!=t.minZoom?t.minZoom:r.minZoom,opaque:u.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,url:e,wrapX:t.wrapX})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(bb);var ori=function(n){function t(t){var i=t||{};n.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,tileUrlFunction:eri,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getKeyForParams_=function(){var i=0,n=[];for(var t in this.params_)n[i++]=t+"-"+this.params_[t];return n.join("/")},t.prototype.getParams=function(){return this.params_},t.prototype.getRequestUrl_=function(n,t,i,r,u,f){var e=this.urls,s,o;if(e)return o=u.getCode().split(":").pop(),s=(f.SIZE=t[0]+","+t[1],f.BBOX=i.join(","),f.BBOXSR=o,f.IMAGESR=o,f.DPI=Math.round(f.DPI?f.DPI*r:90*r),1==e.length)?e[0]:e[df(ttt(n),e.length)],oc(s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),f)},t.prototype.getTilePixelRatio=function(n){return n},t.prototype.updateParams=function(n){nt(this.params_,n);this.setKey(this.getKeyForParams_())},t}(cs),sri=function(n){function t(t,i,r){n.call(this,t,c.LOADED);this.tileSize_=i;this.text_=r;this.canvas_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,n=kt(t[0],t[1]);return n.strokeStyle="black",n.strokeRect(.5,.5,t[0]+.5,t[1]+.5),n.fillStyle="black",n.textAlign="center",n.textBaseline="middle",n.font="24px sans-serif",n.fillText(this.text_,t[0]/2,t[1]/2),this.canvas_=n.canvas,n.canvas},t.prototype.load=function(){},t}(vl),hri=function(n){function t(t){n.call(this,{opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:void 0===t.wrapX||t.wrapX})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getTile=function(n,t,i){var r=ss(n,t,i);if(this.tileCache.containsKey(r))return this.tileCache.get(r);var o=ru(this.tileGrid.getTileSize(n)),u=[n,t,i],f=this.getTileCoordForTileUrlFunction(u),s=f?this.getTileCoordForTileUrlFunction(f).toString():"",e=new sri(u,o,s);return this.tileCache.set(r,e),e},t}(gv),cri=function(n){function t(t){if(n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:w("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:pi.LOADING,tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),this.tileJSON_=null,t.url)if(t.jsonp)pb(t.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",t.url);i.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):g(!1,51)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.onXHRLoad_=function(n){var t=n.target,i;if(!t.status||t.status>=200&&t.status<300){try{i=JSON.parse(t.responseText)}catch(n){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},t.prototype.onXHRError_=function(){this.handleTileJSONError()},t.prototype.getTileJSON=function(){return this.tileJSON_},t.prototype.handleTileJSONResponse=function(n){var t,i=w("EPSG:4326"),r=this.getProjection(),u,e;void 0!==n.bounds&&(u=wo(i,r),t=la(n.bounds,u));var o=n.minzoom||0,s=n.maxzoom||22,f=pl({extent:uc(r),maxZoom:s,minZoom:o});(this.tileGrid=f,this.tileUrlFunction=ott(n.tiles,f),void 0===n.attribution||this.getAttributions())||(e=void 0!==t?t:i.getExtent(),this.setAttributions(function(t){return dt(e,t.extent)?[n.attribution]:null}));this.tileJSON_=n;this.setState(pi.READY)},t.prototype.handleTileJSONError=function(){this.setState(pi.ERROR)},t}(cs);var ari=function(n){function t(t){var i=t||{},r=i.params||{},u=!("TRANSPARENT"in r)||r.TRANSPARENT;n.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,opaque:!u,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,tileUrlFunction:lri,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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getGetFeatureInfoUrl=function(n,t,i,r){var e=w(i),o=this.getProjection(),f=this.getTileGrid(),s,c,v,y;if(f||(f=this.getTileGridForProjection(e)),s=f.getTileCoordForCoordAndResolution(n,t),!(f.getResolutions().length<=s[0])){var h=f.getResolution(s[0]),u=f.getTileCoordExtent(s,this.tmpExtent_),l=ru(f.getTileSize(s[0]),this.tmpSize),a=this.gutter_;return 0!==a&&(l=ket(l,a,this.tmpSize),u=ff(u,h*a,u)),o&&o!==e&&(h=wb(o,e,n,h),u=bo(u,e,o),n=dc(n,e,o)),c={SERVICE:"WMS",VERSION:kl,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS},nt(c,this.params_,r),v=Math.floor((n[0]-u[0])/h),y=Math.floor((u[3]-n[1])/h),c[this.v13_?"I":"X"]=v,c[this.v13_?"J":"Y"]=y,this.getRequestUrl_(s,l,u,1,o||e,c)}},t.prototype.getGutter=function(){return this.gutter_},t.prototype.getParams=function(){return this.params_},t.prototype.getRequestUrl_=function(n,t,i,r,u,f){var o=this.urls,h,s,c,l,e;if(o){if(f.WIDTH=t[0],f.HEIGHT=t[1],f[this.v13_?"CRS":"SRS"]=u.getCode(),"STYLES"in this.params_||(f.STYLES=""),1!=r)switch(this.serverType_){case bct:h=90*r+.5|0;"FORMAT_OPTIONS"in f?f.FORMAT_OPTIONS+=";dpi:"+h:f.FORMAT_OPTIONS="dpi:"+h;break;case kct:f.MAP_RESOLUTION=90*r;break;case wct:case dct:f.DPI=90*r;break;default:g(!1,52)}return l=u.getAxisOrientation(),e=i,this.v13_&&"ne"==l.substr(0,2)&&(s=i[0],e[0]=i[1],e[1]=s,s=i[2],e[2]=i[3],e[3]=s),c=(f.BBOX=e.join(","),1==o.length)?o[0]:o[df(ttt(n),o.length)],oc(c,f)}},t.prototype.getTilePixelRatio=function(n){return this.hidpi_&&void 0!==this.serverType_?n:1},t.prototype.getKeyForParams_=function(){var i=0,n=[];for(var t in this.params_)n[i++]=t+"-"+this.params_[t];return n.join("/")},t.prototype.updateParams=function(n){nt(this.params_,n);this.updateV13_();this.setKey(this.getKeyForParams_())},t.prototype.updateV13_=function(){var n=this.params_.VERSION||kl;this.v13_=pft(n,"1.3")>=0},t}(cs),vri=function(n){function t(t,i,r,u,f,e){n.call(this,t,i);this.src_=r;this.extent_=u;this.preemptive_=f;this.grid_=null;this.keys_=null;this.data_=null;this.jsonp_=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getImage=function(){return null},t.prototype.getData=function(n){var t,u,i;if(!this.grid_||!this.keys_)return null;var f=(n[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),e=(n[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-e)*this.grid_.length)];return"string"!=typeof r?null:(t=r.charCodeAt(Math.floor(f*r.length)),t>=93&&t--,t>=35&&t--,u=null,(t-=32)in this.keys_&&(i=this.keys_[t],u=this.data_&&i in this.data_?this.data_[i]:i),u)},t.prototype.forDataAtCoordinate=function(n,t,i,r){this.state==c.IDLE&&!0===r?(ee(this,a.CHANGE,function(){t.call(i,this.getData(n))},this),this.loadInternal_()):!0===r?setTimeout(function(){t.call(i,this.getData(n))}.bind(this),0):t.call(i,this.getData(n))},t.prototype.getKey=function(){return this.src_},t.prototype.handleError_=function(){this.state=c.ERROR;this.changed()},t.prototype.handleLoad_=function(n){this.grid_=n.grid;this.keys_=n.keys;this.data_=n.data;this.state=c.EMPTY;this.changed()},t.prototype.loadInternal_=function(){if(this.state==c.IDLE)if(this.state=c.LOADING,this.jsonp_)pb(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var n=new XMLHttpRequest;n.addEventListener("load",this.onXHRLoad_.bind(this));n.addEventListener("error",this.onXHRError_.bind(this));n.open("GET",this.src_);n.send()}},t.prototype.onXHRLoad_=function(n){var t=n.target,i;if(!t.status||t.status>=200&&t.status<300){try{i=JSON.parse(t.responseText)}catch(n){return void this.handleError_()}this.handleLoad_(i)}else this.handleError_()},t.prototype.onXHRError_=function(){this.handleError_()},t.prototype.load=function(){this.preemptive_&&this.loadInternal_()},t}(vl),yri=function(n){function t(t){if(n.call(this,{projection:w("EPSG:3857"),state:pi.LOADING}),this.preemptive_=void 0===t.preemptive||t.preemptive,this.tileUrlFunction_=stt,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)pb(t.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",t.url);i.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):g(!1,51)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.onXHRLoad_=function(n){var t=n.target,i;if(!t.status||t.status>=200&&t.status<300){try{i=JSON.parse(t.responseText)}catch(n){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},t.prototype.onXHRError_=function(){this.handleTileJSONError()},t.prototype.getTemplate=function(){return this.template_},t.prototype.forDataAtCoordinateAndResolution=function(n,t,i,r){if(this.tileGrid){var u=this.tileGrid.getTileCoordForCoordAndResolution(n,t);this.getTile(u[0],u[1],u[2],1,this.getProjection()).forDataAtCoordinate(n,i,null,r)}else!0===r?setTimeout(function(){i(null)},0):i(null)},t.prototype.handleTileJSONError=function(){this.setState(pi.ERROR)},t.prototype.handleTileJSONResponse=function(n){var t,r=w("EPSG:4326"),u=this.getProjection(),f,i,o;void 0!==n.bounds&&(f=wo(r,u),t=la(n.bounds,f));var s=n.minzoom||0,h=n.maxzoom||22,e=pl({extent:uc(u),maxZoom:h,minZoom:s});this.tileGrid=e;this.template_=n.template;i=n.grids;i?((this.tileUrlFunction_=ott(i,e),void 0!==n.attribution)&&(o=void 0!==t?t:r.getExtent(),this.setAttributions(function(t){return dt(o,t.extent)?[n.attribution]:null})),this.setState(pi.READY)):this.setState(pi.ERROR)},t.prototype.getTile=function(n,t,i,r,u){var f=ss(n,t,i);if(this.tileCache.containsKey(f))return this.tileCache.get(f);var e=[n,t,i],h=this.getTileCoordForTileUrlFunction(e,u),o=this.tileUrlFunction_(h,r,u),s=new vri(e,void 0!==o?c.IDLE:c.EMPTY,void 0!==o?o:"",this.tileGrid.getTileCoordExtent(e),this.preemptive_,this.jsonp_);return this.tileCache.set(f,s),s},t.prototype.useTile=function(n,t,i){var r=ss(n,t,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},t}(gv),pri=function(n){function t(i,r,u,f,e,s,h,l,v,y,p,w,b,k,d){var tt;if(n.call(this,i,r,{transition:0}),this.context_={},this.loader_,this.replayState_={},this.sourceTiles_=y,this.tileKeys=[],this.extent=null,this.sourceRevision_=u,this.wrappedTileCoord=s,this.loadListenerKeys_=[],this.sourceTileListenerKeys_=[],s){var it=this.extent=v.getTileCoordExtent(s),g=v.getResolution(d),ut=l.getZForResolution(g),nt=d!=i[0],rt=0;if(l.forEachTileCoord(it,ut,function(n){var i=of(it,l.getTileCoordExtent(n)),s=l.getExtent(),r,t,u;(s&&(i=of(i,s,i)),wt(i)/g>=.5&&ti(i)/g>=.5)&&(++rt,r=n.toString(),t=y[r],t||nt||(u=h(n,p,w),t=y[r]=new b(n,void 0==u?c.EMPTY:c.IDLE,void 0==u?"":u,f,e),this.sourceTileListenerKeys_.push(o(t,a.CHANGE,k))),!t||nt&&t.getState()!=c.LOADED||(t.consumers++,this.tileKeys.push(r)))}.bind(this)),nt&&rt==this.tileKeys.length&&this.finishLoading_(),d<=i[0]&&this.state!=c.LOADED)for(;d>v.getMinZoom();)if(tt=new t(i,r,u,f,e,s,h,l,v,y,p,w,b,wf,--d),tt.state==c.LOADED){this.interimTile=tt;break}}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){var t,u,r,i;for(this.state=c.ABORT,this.changed(),this.interimTile&&this.interimTile.dispose(),t=0,u=this.tileKeys.length;t<u;++t)r=this.tileKeys[t],i=this.getTile(r),i.consumers--,0==i.consumers&&(delete this.sourceTiles_[r],i.dispose());this.tileKeys.length=0;this.sourceTiles_=null;this.loadListenerKeys_.forEach(lt);this.loadListenerKeys_.length=0;this.sourceTileListenerKeys_.forEach(lt);this.sourceTileListenerKeys_.length=0;n.prototype.disposeInternal.call(this)},t.prototype.getContext=function(n){var t=y(n);return t in this.context_||(this.context_[t]=kt()),this.context_[t]},t.prototype.getImage=function(n){return-1==this.getReplayState(n).renderedTileRevision?null:this.getContext(n).canvas},t.prototype.getReplayState=function(n){var t=y(n);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedRevision:-1,renderedTileRevision:-1}),this.replayState_[t]},t.prototype.getKey=function(){return this.tileKeys.join("/")+"-"+this.sourceRevision_},t.prototype.getTile=function(n){return this.sourceTiles_[n]},t.prototype.load=function(){var n=0,t={};this.state==c.IDLE&&this.setState(c.LOADING);this.state==c.LOADING&&this.tileKeys.forEach(function(i){var r=this.getTile(i),u;(r.state==c.IDLE&&(r.setLoader(this.loader_),r.load()),r.state==c.LOADING)&&(u=o(r,a.CHANGE,function(){var i=r.getState(),u;(i==c.LOADED||i==c.ERROR)&&(u=y(r),i==c.ERROR?t[u]=!0:(--n,delete t[u]),n-Object.keys(t).length==0&&this.finishLoading_())}.bind(this)),this.loadListenerKeys_.push(u),++n)}.bind(this));n-Object.keys(t).length==0&&setTimeout(this.finishLoading_.bind(this),0)},t.prototype.finishLoading_=function(){for(var i,n=this.tileKeys.length,r=0,t=n-1;t>=0;--t)i=this.getTile(this.tileKeys[t]).getState(),i!=c.LOADED&&--n,i==c.EMPTY&&++r;n==this.tileKeys.length?(this.loadListenerKeys_.forEach(lt),this.loadListenerKeys_.length=0,this.setState(c.LOADED)):this.setState(r==this.tileKeys.length?c.EMPTY:c.ERROR)},t}(vl);var bri=[0,0,4096,4096],kri=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,e);this.consumers=0;this.extent_=null;this.format_=u;this.features_=null;this.loader_;this.projection_=null;this.replayGroups_={};this.tileLoadFunction_=f;this.url_=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.features_=null;this.replayGroups_={};this.state=c.ABORT;this.changed();n.prototype.disposeInternal.call(this)},t.prototype.getExtent=function(){return this.extent_||bri},t.prototype.getFormat=function(){return this.format_},t.prototype.getFeatures=function(){return this.features_},t.prototype.getKey=function(){return this.url_},t.prototype.getProjection=function(){return this.projection_},t.prototype.getReplayGroup=function(n,t){return this.replayGroups_[y(n)+","+t]},t.prototype.load=function(){this.state==c.IDLE&&(this.setState(c.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_(null,NaN,null))},t.prototype.onLoad=function(n,t,i){this.setProjection(t);this.setFeatures(n);this.setExtent(i)},t.prototype.onError=function(){this.setState(c.ERROR)},t.prototype.setExtent=function(n){this.extent_=n},t.prototype.setFeatures=function(n){this.features_=n;this.setState(c.LOADED)},t.prototype.setProjection=function(n){this.projection_=n},t.prototype.setReplayGroup=function(n,t,i){this.replayGroups_[y(n)+","+t]=i},t.prototype.setLoader=function(n){this.loader_=n},t}(vl),dri=function(n){function t(t){var i=t.projection||"EPSG:3857",r=t.extent||uc(i),u=t.tileGrid||pl({extent:r,maxZoom:t.maxZoom||22,minZoom:t.minZoom,tileSize:t.tileSize||512});n.call(this,{attributions:t.attributions,cacheSize:void 0!==t.cacheSize?t.cacheSize:128,opaque:!1,projection:i,state:t.state,tileGrid:u,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:wri,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition});this.format_=t.format?t.format:null;this.sourceTiles_={};this.overlaps_=void 0==t.overlaps||t.overlaps;this.tileClass=t.tileClass?t.tileClass:kri;this.tileGrids_={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getOverlaps=function(){return this.overlaps_},t.prototype.clear=function(){this.tileCache.clear();this.sourceTiles_={}},t.prototype.getTile=function(n,t,i,r,u){var f=ss(n,t,i);if(this.tileCache.containsKey(f))return this.tileCache.get(f);var e=[n,t,i],o=this.getTileCoordForTileUrlFunction(e,u),s=new pri(e,null!==o?c.IDLE:c.EMPTY,this.getRevision(),this.format_,this.tileLoadFunction,o,this.tileUrlFunction,this.tileGrid,this.getTileGridForProjection(u),this.sourceTiles_,r,u,this.tileClass,this.handleTileChange.bind(this),e[0]);return this.tileCache.set(f,s),s},t.prototype.getTileGridForProjection=function(n){var r=n.getCode(),i=this.tileGrids_[r],t;return i||(t=this.tileGrid,i=this.tileGrids_[r]=tct(n,void 0,t?t.getTileSize(t.getMinZoom()):void 0)),i},t.prototype.getTilePixelRatio=function(n){return n},t.prototype.getTilePixelSize=function(n,t,i){var r=ru(this.getTileGridForProjection(i).getTileSize(n),this.tmpSize);return[Math.round(r[0]*t),Math.round(r[1]*t)]},t}(pct),as={KVP:"KVP",REST:"REST"},gri=function(n){function t(t){var r=void 0!==t.requestEncoding?t.requestEncoding:as.KVP,u=t.tileGrid,i=t.urls;void 0===i&&void 0!==t.url&&(i=htt(t.url));n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:u,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:stt,urls:i,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition});this.version_=void 0!==t.version?t.version:"1.0.0";this.format_=void 0!==t.format?t.format:"image/jpeg";this.dimensions_=void 0!==t.dimensions?t.dimensions:{};this.layer_=t.layer;this.matrixSet_=t.matrixSet;this.style_=t.style;this.requestEncoding_=r;this.setKey(this.getKeyForDimensions_());i&&i.length>0&&(this.tileUrlFunction=iy(i.map(elt.bind(this))))}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setUrls=function(n){this.urls=n;var t=n.join("\n");this.setTileUrlFunction(iy(n.map(elt.bind(this))),t)},t.prototype.getDimensions=function(){return this.dimensions_},t.prototype.getFormat=function(){return this.format_},t.prototype.getLayer=function(){return this.layer_},t.prototype.getMatrixSet=function(){return this.matrixSet_},t.prototype.getRequestEncoding=function(){return this.requestEncoding_},t.prototype.getStyle=function(){return this.style_},t.prototype.getVersion=function(){return this.version_},t.prototype.getKeyForDimensions_=function(){var i=0,n=[];for(var t in this.dimensions_)n[i++]=t+"-"+this.dimensions_[t];return n.join("/")},t.prototype.updateDimensions=function(n){nt(this.dimensions_,n);this.setKey(this.getKeyForDimensions_())},t}(cs);var vtt={DEFAULT:"default",TRUNCATED:"truncated"},nui=function(n){function t(t,i,r,u,f,e,o){n.call(this,i,r,u,f,e,o);this.zoomifyImage_=null;this.tileSize_=ru(t.getTileSize(i[0]))}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getImage=function(){var t,i,r;return this.zoomifyImage_?this.zoomifyImage_:(t=n.prototype.getImage.call(this),this.state==c.LOADED)?(i=this.tileSize_,t.width==i[0]&&t.height==i[1])?(this.zoomifyImage_=t,t):(r=kt(i[0],i[1]),r.drawImage(t,0,0),this.zoomifyImage_=r.canvas,r.canvas):t},t}(cb),tui=function(n){function t(t){var i=t||{},o=i.size,d=void 0!==i.tierSizeCalculation?i.tierSizeCalculation:vtt.DEFAULT,l=o[0],a=o[1],p=i.extent||[0,-o[1],o[0],0],u=[],w=i.tileSize||rw,r=w,s,h,c,e,b,k;switch(d){case vtt.DEFAULT:for(;l>r||a>r;)u.push([Math.ceil(l/r),Math.ceil(a/r)]),r+=r;break;case vtt.TRUNCATED:for(s=l,h=a;s>r||h>r;)u.push([Math.ceil(s/r),Math.ceil(h/r)]),s>>=1,h>>=1;break;default:g(!1,53)}u.push([1,1]);u.reverse();for(var v=[1],y=[0],f=1,nt=u.length;f<nt;f++)v.push(1<<f),y.push(u[f-1][0]*u[f-1][1]+y[f-1]);v.reverse();c=new yl({tileSize:w,extent:p,origin:bf(p),resolutions:v});e=i.url;e&&-1==e.indexOf("{TileGroup}")&&-1==e.indexOf("{tileIndex}")&&(e+="{TileGroup}/{z}-{x}-{y}.jpg");b=iy(htt(e).map(function(n){return function(t){if(t){var i=t[0],f=t[1],e=-t[2]-1,o=f+e*u[i][0],r=c.getTileSize(i),s=Array.isArray(r)?r[0]:r,h={z:i,x:f,y:e,tileIndex:o,TileGroup:"TileGroup"+((o+y[i])/s|0)};return n.replace(/\{(\w+?)\}/g,function(n,t){return h[t]})}}}));k=nui.bind(null,c);n.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:k,tileGrid:c,tileUrlFunction:b,transition:i.transition})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(cs),olt="renderOrder",slt=function(n){function t(t){var i=t||{},r=nt({},i);delete r.style;delete r.renderBuffer;delete r.updateWhileAnimating;delete r.updateWhileInteracting;n.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||wot.VECTOR;this.type=kr.VECTOR}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDeclutter=function(){return this.declutter_},t.prototype.setDeclutter=function(n){this.declutter_=n},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(olt)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.setRenderOrder=function(n){this.set(olt,n)},t.prototype.setStyle=function(n){this.style_=void 0!==n?n:kti;this.styleFunction_=null===n?void 0:function(n){var t,i;return"function"==typeof n?t=n:(Array.isArray(n)?i=n:(g("function"==typeof n.getZIndex,41),i=[n]),t=function(){return i}),t}(this.style_);this.changed()},t.prototype.getRenderMode=function(){return this.renderMode_},t}(lw);slt.prototype.getSource;var vs=slt,uo={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},iui=["#00f","#0ff","#0f0","#ff0","#f00"],rui=function(n){function t(t){var i=t||{},r=nt({},i),f,u;delete r.gradient;delete r.radius;delete r.blur;delete r.shadow;delete r.weight;n.call(this,r);this.gradient_=null;this.shadow_=void 0!==i.shadow?i.shadow:250;this.circleImage_=void 0;this.styleCache_=null;o(this,ni(uo.GRADIENT),this.handleGradientChanged_,this);this.setGradient(i.gradient?i.gradient:iui);this.setBlur(void 0!==i.blur?i.blur:15);this.setRadius(void 0!==i.radius?i.radius:8);o(this,ni(uo.BLUR),this.handleStyleChanged_,this);o(this,ni(uo.RADIUS),this.handleStyleChanged_,this);this.handleStyleChanged_();u=i.weight?i.weight:"weight";f="string"==typeof u?function(n){return n.get(u)}:u;this.setStyle(function(n){var i=f(n),r=void 0!==i?vi(i,0,1):1,u=255*r|0,t=this.styleCache_[u];return t||(t=[new wl({image:new vb({opacity:r,src:this.circleImage_})})],this.styleCache_[u]=t),t}.bind(this));this.setRenderOrder(null);o(this,gr.RENDER,this.handleRender_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createCircle_=function(){var i=this.getRadius(),r=this.getBlur(),u=i+r+1,f=2*u,n=kt(f,f),t;return n.shadowOffsetX=n.shadowOffsetY=this.shadow_,n.shadowBlur=r,n.shadowColor="#000",n.beginPath(),t=u-this.shadow_,n.arc(t,t,i,0,2*Math.PI,!0),n.fill(),n.canvas.toDataURL()},t.prototype.getBlur=function(){return this.get(uo.BLUR)},t.prototype.getGradient=function(){return this.get(uo.GRADIENT)},t.prototype.getRadius=function(){return this.get(uo.RADIUS)},t.prototype.handleGradientChanged_=function(){this.gradient_=function(n){for(var t=kt(1,256),r=t.createLinearGradient(0,0,1,256),u=1/(n.length-1),i=0,f=n.length;i<f;++i)r.addColorStop(i*u,n[i]);return t.fillStyle=r,t.fillRect(0,0,1,256),t.getImageData(0,0,1,256).data}(this.getGradient())},t.prototype.handleStyleChanged_=function(){this.circleImage_=this.createCircle_();this.styleCache_=new Array(256);this.changed()},t.prototype.handleRender_=function(n){for(var r,u=n.context,f=u.canvas,e=u.getImageData(0,0,f.width,f.height),i=e.data,t=0,o=i.length;t<o;t+=4)r=4*i[t+3],r&&(i[t]=this.gradient_[r],i[t+1]=this.gradient_[r+1],i[t+2]=this.gradient_[r+2]);u.putImageData(e,0,0)},t.prototype.setBlur=function(n){this.set(uo.BLUR,n)},t.prototype.setGradient=function(n){this.set(uo.GRADIENT,n)},t.prototype.setRadius=function(n){this.set(uo.RADIUS,n)},t}(vs),hlt=function(n){function t(t){var i=t||{},r=i.renderMode||io.HYBRID,u;g(void 0==r||r==io.IMAGE||r==io.HYBRID||r==io.VECTOR,28);i.declutter&&r==io.IMAGE&&(r=io.HYBRID);i.renderMode=r;u=nt({},i);delete u.preload;delete u.useInterimTilesOnError;n.call(this,u);this.setPreload(i.preload?i.preload:0);this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError);this.type=kr.VECTOR_TILE}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getPreload=function(){return this.get(db)},t.prototype.getUseInterimTilesOnError=function(){return this.get(gb)},t.prototype.setPreload=function(n){this.set(db,n)},t.prototype.setUseInterimTilesOnError=function(n){this.set(gb,n)},t}(vs);hlt.prototype.getSource;var uui=hlt,fui="addfeatures",eui=function(n){function t(t,i,r,u){n.call(this,t);this.features=r;this.file=i;this.projection=u}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr);var sui=function(n){function t(t){var i=t||{};n.call(this,{handleEvent:bu});this.formatConstructors_=i.formatConstructors?i.formatConstructors:[];this.projection_=i.projection?w(i.projection):null;this.dropListenKeys_=null;this.source_=i.source||null;this.target=i.target?i.target:null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleResult_=function(n,t){var o=t.target.result,s=this.getMap(),i=this.projection_,e;i||(i=s.getView().getProjection());for(var f=this.formatConstructors_,r=[],u=0,h=f.length;u<h;++u)if(e=new f[u],(r=this.tryReadFeatures_(e,o,{featureProjection:i}))&&r.length>0)break;this.source_&&(this.source_.clear(),this.source_.addFeatures(r));this.dispatchEvent(new eui(fui,n,r,i))},t.prototype.registerListeners_=function(){var t=this.getMap(),n;t&&(n=this.target?this.target:t.getViewport(),this.dropListenKeys_=[o(n,a.DROP,oui,this),o(n,a.DRAGENTER,ytt,this),o(n,a.DRAGOVER,ytt,this),o(n,a.DROP,ytt,this)])},t.prototype.setActive=function(t){n.prototype.setActive.call(this,t);t?this.registerListeners_():this.unregisterListeners_()},t.prototype.setMap=function(t){this.unregisterListeners_();n.prototype.setMap.call(this,t);this.getActive()&&this.registerListeners_()},t.prototype.tryReadFeatures_=function(n,t,i){try{return n.readFeatures(t,i)}catch(n){return null}},t.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(lt),this.dropListenKeys_=null)},t}(ge),hui=function(n){function t(t){var i=t||{};n.call(this,i);this.condition_=i.condition?i.condition:rv;this.lastAngle_=void 0;this.lastMagnitude_=void 0;this.lastScaleDelta_=0;this.duration_=void 0!==i.duration?i.duration:400}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDragEvent=function(n){var h;if(ae(n)){var f=n.map,e=f.getSize(),o=n.pixel,i=o[0]-e[0]/2,r=e[1]/2-o[1],s=Math.atan2(r,i),u=Math.sqrt(i*i+r*r),t=f.getView();t.getConstraints().rotation!==uw&&void 0!==this.lastAngle_&&(h=s-this.lastAngle_,aw(t,t.getRotation()-h));(this.lastAngle_=s,void 0!==this.lastMagnitude_)&&vw(t,this.lastMagnitude_*(t.getResolution()/u));void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/u);this.lastMagnitude_=u}},t.prototype.handleUpEvent=function(n){var t,i;return ae(n)?(t=n.map.getView(),t.setHint(oi,-1),i=this.lastScaleDelta_-1,yg(t,t.getRotation()),not(t,t.getResolution(),void 0,this.duration_,i),this.lastScaleDelta_=0,!1):!0},t.prototype.handleDownEvent=function(n){return!!ae(n)&&!!this.condition_(n)&&(n.map.getView().setHint(oi,1),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0)},t}(lf),clt=function(n){function t(t,i,r){if(n.call(this),void 0!==r&&void 0===i)this.setFlatCoordinates(r,t);else{var u=i||0;this.setCenterAndRadius(t,u,r)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),void 0,this.layout)},t.prototype.closestPointXY=function(n,t,i,r){var u=this.flatCoordinates,s=n-u[0],h=t-u[1],o=s*s+h*h,f,c,e;if(o<r){if(0===o)for(f=0;f<this.stride;++f)i[f]=u[f];else for(c=this.getRadius()/Math.sqrt(o),i[0]=u[0]+c*s,i[1]=u[1]+c*h,e=2;e<this.stride;++e)i[e]=u[e];return i.length=this.stride,o}return r},t.prototype.containsXY=function(n,t){var i=this.flatCoordinates,r=n-i[0],u=t-i[1];return r*r+u*u<=this.getRadiusSquared_()},t.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.computeExtent=function(n){var t=this.flatCoordinates,i=t[this.stride]-t[0];return ef(t[0]-i,t[1]-i,t[0]+i,t[1]+i,n)},t.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},t.prototype.getRadiusSquared_=function(){var n=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return n*n+t*t},t.prototype.getType=function(){return f.CIRCLE},t.prototype.intersectsExtent=function(n){if(dt(n,this.getExtent())){var t=this.getCenter();return n[0]<=t[0]&&n[2]>=t[0]||n[1]<=t[1]&&n[3]>=t[1]||sut(n,this.intersectsCoordinate,this)}return!1},t.prototype.setCenter=function(n){var i=this.stride,u=this.flatCoordinates[i]-this.flatCoordinates[0],r=n.slice(),t;for(r[i]=r[0]+u,t=1;t<i;++t)r[i+t]=n[t];this.setFlatCoordinates(this.layout,r);this.changed()},t.prototype.setCenterAndRadius=function(n,t,i){var r,u,f,e;for(this.setLayout(i,n,0),this.flatCoordinates||(this.flatCoordinates=[]),r=this.flatCoordinates,u=rft(r,0,n,this.stride),r[u++]=r[0]+t,f=1,e=this.stride;f<e;++f)r[u++]=r[f];r.length=u;this.changed()},t.prototype.getCoordinates=function(){return null},t.prototype.setCoordinates=function(){},t.prototype.setRadius=function(n){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+n;this.changed()},t}(ce);clt.prototype.transform;var ptt=clt,yf=function(n){function t(t,i,r){var e;if(n.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,i);else if(void 0!==i&&r)this.setFlatCoordinates(i,t),this.ends_=r;else{for(var o=this.getLayout(),s=t,f=[],h=[],u=0,c=s.length;u<c;++u)e=s[u],0===u&&(o=e.getLayout()),pt(f,e.getFlatCoordinates()),h.push(f.length);this.setFlatCoordinates(o,f);this.ends_=h}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.appendLineString=function(n){this.flatCoordinates?pt(this.flatCoordinates,n.getFlatCoordinates().slice()):this.flatCoordinates=n.getFlatCoordinates().slice();this.ends_.push(this.flatCoordinates.length);this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(n,t,i,r){return r<ih(this.getExtent(),n,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(cd(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ad(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,n,t,i,r))},t.prototype.getCoordinateAtM=function(n,t,i){if(this.layout!=v.XYM&&this.layout!=v.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,u=void 0!==i&&i;return function(n,t,i,r,u,f,e){var s,h,c,o;if(e)return ng(n,t,i[i.length-1],r,u,f);if(u<n[r-1])return f?((s=n.slice(0,r))[r-1]=u,s):null;if(n[n.length-1]<u)return f?((s=n.slice(n.length-r))[r-1]=u,s):null;for(h=0,c=i.length;h<c;++h)if(o=i[h],t!=o){if(u<n[t+r-1])return null;if(u<=n[o-1])return ng(n,t,o,r,u,!1);t=o}return null}(this.flatCoordinates,0,this.ends_,this.stride,n,r,u)},t.prototype.getCoordinates=function(){return pp(this.flatCoordinates,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getLineString=function(n){return n<0||this.ends_.length<=n?null:new yi(this.flatCoordinates.slice(0===n?0:this.ends_[n-1],this.ends_[n]),this.layout)},t.prototype.getLineStrings=function(){for(var t,f,e=this.flatCoordinates,i=this.ends_,o=this.layout,r=[],u=0,n=0,s=i.length;n<s;++n)t=i[n],f=new yi(e.slice(u,t),o),r.push(f),u=t;return r},t.prototype.getFlatMidpoints=function(){for(var t,i=[],f=this.flatCoordinates,r=0,u=this.ends_,e=this.stride,n=0,o=u.length;n<o;++n)t=u[n],pt(i,gp(f,r,t,e,.5)),r=t;return i},t.prototype.getSimplifiedGeometryInternal=function(n){var i=[],r=[];return i.length=ybt(this.flatCoordinates,0,this.ends_,this.stride,n,i,0,r),new t(i,v.XY,r)},t.prototype.getType=function(){return f.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(n){return function(n,t,i,r,u){for(var f=0,e=i.length;f<e;++f){if(wp(n,t,i[f],r,u))return!0;t=i[f]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,n)},t.prototype.setCoordinates=function(n,t){this.setLayout(t,n,2);this.flatCoordinates||(this.flatCoordinates=[]);var i=vd(this.flatCoordinates,0,n,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1];this.changed()},t}(ce),pe=function(n){function t(t,i){n.call(this);i&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.appendPoint=function(n){this.flatCoordinates?pt(this.flatCoordinates,n.getFlatCoordinates()):this.flatCoordinates=n.getFlatCoordinates().slice();this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(n,t,i,r){var s,f;if(r<ih(this.getExtent(),n,t))return r;for(var e=this.flatCoordinates,o=this.stride,u=0,h=e.length;u<h;u+=o)if(s=oh(n,t,e[u],e[u+1]),s<r){for(r=s,f=0;f<o;++f)i[f]=e[u+f];i.length=o}return r},t.prototype.getCoordinates=function(){return gc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getPoint=function(n){var t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return n<0||t<=n?null:new ei(this.flatCoordinates.slice(n*this.stride,(n+1)*this.stride),this.layout)},t.prototype.getPoints=function(){for(var u,t=this.flatCoordinates,f=this.layout,i=this.stride,r=[],n=0,e=t.length;n<e;n+=i)u=new ei(t.slice(n,n+i),f),r.push(u);return r},t.prototype.getType=function(){return f.MULTI_POINT},t.prototype.intersectsExtent=function(n){for(var i=this.flatCoordinates,r=this.stride,t=0,u=i.length;t<u;t+=r)if(ip(n,i[t],i[t+1]))return!0;return!1},t.prototype.setCoordinates=function(n,t){this.setLayout(t,n,1);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=pa(this.flatCoordinates,0,n,this.stride);this.changed()},t}(ce);var we=function(n){function t(t,i,r){var f;if(n.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(t[0])){for(var h=this.getLayout(),c=t,e=[],l=[],u=0,a=c.length;u<a;++u){f=c[u];0===u&&(h=f.getLayout());for(var v=e.length,o=f.getEnds(),s=0,y=o.length;s<y;++s)o[s]+=v;pt(e,f.getFlatCoordinates());l.push(o)}i=h;t=e;r=l}void 0!==i&&r?(this.setFlatCoordinates(i,t),this.endss_=r):this.setCoordinates(t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.appendPolygon=function(n){var t,r,i,u;if(this.flatCoordinates)for(r=this.flatCoordinates.length,pt(this.flatCoordinates,n.getFlatCoordinates()),i=0,u=(t=n.getEnds().slice()).length;i<u;++i)t[i]+=r;else this.flatCoordinates=n.getFlatCoordinates().slice(),t=n.getEnds().slice(),this.endss_.push();this.endss_.push(t);this.changed()},t.prototype.clone=function(){for(var i=this.endss_.length,r=new Array(i),n=0;n<i;++n)r[n]=this.endss_[n].slice();return new t(this.flatCoordinates.slice(),this.layout,r)},t.prototype.closestPointXY=function(n,t,i,r){return r<ih(this.getExtent(),n,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(n,t,i,r,u){for(var e,f=0,o=i.length;f<o;++f)e=i[f],u=cd(n,t,e,r,u),t=e[e.length-1];return u}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(n,t,i,r,u,f,e,o,s,h,c){for(var l,v=c||[NaN,NaN],a=0,y=i.length;a<y;++a)l=i[a],h=ad(n,t,l,r,u,f,e,o,s,h,v),t=l[l.length-1];return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,n,t,i,r))},t.prototype.containsXY=function(n,t){return function(n,t,i,r,u,f){var e,s,o;if(0===i.length)return!1;for(e=0,s=i.length;e<s;++e){if(o=i[e],pd(n,t,o,r,u,f))return!0;t=o[o.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,n,t)},t.prototype.getArea=function(){return function(n,t,i,r){for(var u,e=0,f=0,o=i.length;f<o;++f)u=i[f],e+=tft(n,t,u,r),t=u[u.length-1];return e}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(n){var t;return void 0!==n?cft(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,n):t=this.flatCoordinates,uft(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var n=llt(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=eft(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,n);this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new pe(this.getFlatInteriorPoints().slice(),v.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var n=this.flatCoordinates;(function(n,t,i,r,u){for(var f=0,e=i.length;f<e;++f)if(!hft(n,t,i[f],r,u))return!1;return!0})(n,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=n:(this.orientedFlatCoordinates_=n.slice(),this.orientedFlatCoordinates_.length=cft(this.orientedFlatCoordinates_,0,this.endss_,this.stride));this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(n){var i=[],r=[];return i.length=function(n,t,i,r,u,f,e,o){for(var h,c,s=0,l=i.length;s<l;++s)h=i[s],c=[],e=fft(n,t,h,r,u,f,e,c),o.push(c),t=h[h.length-1];return e}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(n),i,0,r),new t(i,v.XY,r)},t.prototype.getPolygon=function(n){var i,u,t,f,r,e;if(n<0||this.endss_.length<=n)return null;if(0===n?i=0:(u=this.endss_[n-1],i=u[u.length-1]),t=this.endss_[n].slice(),f=t[t.length-1],0!==i)for(r=0,e=t.length;r<e;++r)t[r]-=i;return new or(this.flatCoordinates.slice(i,f),this.layout,t)},t.prototype.getPolygons=function(){for(var n,u,i,o,s,h=this.layout,c=this.flatCoordinates,f=this.endss_,e=[],t=0,r=0,l=f.length;r<l;++r){if(n=f[r].slice(),u=n[n.length-1],0!==t)for(i=0,o=n.length;i<o;++i)n[i]-=t;s=new or(c.slice(t,u),h,n);e.push(s);t=u}return e},t.prototype.getType=function(){return f.MULTI_POLYGON},t.prototype.intersectsExtent=function(n){return function(n,t,i,r,u){for(var e,f=0,o=i.length;f<o;++f){if(e=i[f],sft(n,t,e,r,u))return!0;t=e[e.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,n)},t.prototype.setCoordinates=function(n,t){var i,r;this.setLayout(t,n,3);this.flatCoordinates||(this.flatCoordinates=[]);i=function(n,t,i,r,u){for(var e,f=u||[],o=0,s=0,h=i.length;s<h;++s)e=vd(n,t,i[s],r,f[o]),f[o++]=e,t=e[e.length-1];return f.length=o,f}(this.flatCoordinates,0,n,this.stride,this.endss_);0===i.length?this.flatCoordinates.length=0:(r=i[i.length-1],this.flatCoordinates.length=0===r.length?0:r[r.length-1]);this.changed()},t}(ce),ui={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},alt="drawstart",cui="drawend",wtt=function(n){function t(t,i){n.call(this,t);this.feature=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),lui=function(n){function t(t){var e=t,i,u,r;e.stopDown||(e.stopDown=nh);n.call(this,e);this.shouldHandle_=!1;this.downPx_=null;this.downTimeout_;this.lastDragTime_;this.freehand_=!1;this.source_=t.source?t.source:null;this.features_=t.features?t.features:null;this.snapTolerance_=t.snapTolerance?t.snapTolerance:12;this.type_=t.type;this.mode_=function(n){var t;return n===f.POINT||n===f.MULTI_POINT?t=ui.POINT:n===f.LINE_STRING||n===f.MULTI_LINE_STRING?t=ui.LINE_STRING:n===f.POLYGON||n===f.MULTI_POLYGON?t=ui.POLYGON:n===f.CIRCLE&&(t=ui.CIRCLE),t}(this.type_);this.stopClick_=!!t.stopClick;this.minPoints_=t.minPoints?t.minPoints:this.mode_===ui.POLYGON?3:2;this.maxPoints_=t.maxPoints?t.maxPoints:1/0;this.finishCondition_=t.finishCondition?t.finishCondition:bu;i=t.geometryFunction;i||(this.type_===f.CIRCLE?i=function(n,t){var i=t||new ptt([NaN,NaN]),r=ku(n[0],n[1]);return i.setCenterAndRadius(n[0],Math.sqrt(r)),i}:(r=this.mode_,r===ui.POINT?u=ei:r===ui.LINE_STRING?u=yi:r===ui.POLYGON&&(u=or),i=function(n,t){var i=t;return i?r===ui.POLYGON?n[0].length?i.setCoordinates([n[0].concat([n[0][0]])]):i.setCoordinates([]):i.setCoordinates(n):i=new u(n),i}));this.geometryFunction_=i;this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500;this.finishCoordinate_=null;this.sketchFeature_=null;this.sketchPoint_=null;this.sketchCoords_=null;this.sketchLine_=null;this.sketchLineCoords_=null;this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36;this.overlay_=new vs({source:new ec({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:function(){var n=ty();return function(t){return n[t.getGeometry().getType()]}}(),updateWhileInteracting:!0});this.geometryName_=t.geometryName;this.condition_=t.condition?t.condition:yw;this.freehandCondition_;this.freehandCondition_=t.freehand?iv:t.freehandCondition?t.freehandCondition:rv;o(this,ni(tv.ACTIVE),this.updateState_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setMap=function(t){n.prototype.setMap.call(this,t);this.updateState_()},t.prototype.getOverlay=function(){return this.overlay_},t.prototype.handleEvent=function(t){t.originalEvent.type===a.CONTEXTMENU&&t.preventDefault();this.freehand_=this.mode_!==ui.POINT&&this.freehandCondition_(t);var r=t.type===ht.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&t.type===ht.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===ht.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t),i=!1):this.freehand_&&t.type===ht.POINTERDOWN?i=!1:r?(i=t.type===ht.POINTERMOVE)&&this.freehand_?i=this.handlePointerMove_(t):(t.pointerEvent.pointerType==fet||t.type===ht.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t):t.type===ht.DBLCLICK&&(i=!1),n.prototype.handleEvent.call(this,t)&&i},t.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n),!0):!!this.condition_(n)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new ts(ht.POINTERMOVE,n.map,n.pointerEvent,!1,n.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0)},t.prototype.handleUpEvent=function(n){var t=!0,i;return this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),i=this.mode_===ui.CIRCLE,this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(n)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n):(this.startDrawing_(n),this.mode_===ui.POINT&&this.finishDrawing()),t=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!t&&this.stopClick_&&n.stopPropagation(),t},t.prototype.handlePointerMove_=function(n){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var t=this.downPx_,i=n.pixel,r=t[0]-i[0],u=t[1]-i[1],f=r*r+u*u;if(this.shouldHandle_=this.freehand_?f>this.squaredClickTolerance_:f<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(n):this.createOrUpdateSketchPoint_(n),!0},t.prototype.atFinish_=function(n){var f=!1,i,r,t;if(this.sketchFeature_&&(i=!1,r=[this.finishCoordinate_],this.mode_===ui.LINE_STRING?i=this.sketchCoords_.length>this.minPoints_:this.mode_===ui.POLYGON&&(t=this.sketchCoords_,i=t[0].length>this.minPoints_,r=[t[0][0],t[0][t[0].length-2]]),i))for(var l=n.map,u=0,a=r.length;u<a;u++){var e=r[u],o=l.getPixelFromCoordinate(e),s=n.pixel,h=s[0]-o[0],c=s[1]-o[1],v=this.freehand_?1:this.snapTolerance_;if(f=Math.sqrt(h*h+c*c)<=v){this.finishCoordinate_=e;break}}return f},t.prototype.createOrUpdateSketchPoint_=function(n){var t=n.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new fi(new ei(t)),this.updateSketchFeatures_())},t.prototype.startDrawing_=function(n){var t=n.coordinate,i;this.finishCoordinate_=t;this.mode_===ui.POINT?this.sketchCoords_=t.slice():this.mode_===ui.POLYGON?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()];this.sketchLineCoords_&&(this.sketchLine_=new fi(new yi(this.sketchLineCoords_)));i=this.geometryFunction_(this.sketchCoords_);this.sketchFeature_=new fi;this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_);this.sketchFeature_.setGeometry(i);this.updateSketchFeatures_();this.dispatchEvent(new wtt(alt,this.sketchFeature_))},t.prototype.modifyDrawing_=function(n){var u,i,t,e=n.coordinate,o=this.sketchFeature_.getGeometry(),r;(this.mode_===ui.POINT?i=this.sketchCoords_:this.mode_===ui.POLYGON?(i=(u=this.sketchCoords_[0])[u.length-1],this.atFinish_(n)&&(e=this.finishCoordinate_.slice())):i=(u=this.sketchCoords_)[u.length-1],i[0]=e[0],i[1]=e[1],this.geometryFunction_(this.sketchCoords_,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(e);o.getType()==f.POLYGON&&this.mode_!==ui.POLYGON?(this.sketchLine_||(this.sketchLine_=new fi),r=o.getLinearRing(0),(t=this.sketchLine_.getGeometry())?(t.setFlatCoordinates(r.getLayout(),r.getFlatCoordinates()),t.changed()):(t=new yi(r.getFlatCoordinates(),r.getLayout()),this.sketchLine_.setGeometry(t))):this.sketchLineCoords_&&(t=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},t.prototype.addToDrawing_=function(n){var i,t,r=n.coordinate,u=this.sketchFeature_.getGeometry();this.mode_===ui.LINE_STRING?(this.finishCoordinate_=r.slice(),(t=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?t.pop():i=!0),t.push(r.slice()),this.geometryFunction_(t,u)):this.mode_===ui.POLYGON&&((t=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?t.pop():i=!0),t.push(r.slice()),i&&(this.finishCoordinate_=t[0]),this.geometryFunction_(this.sketchCoords_,u));this.updateSketchFeatures_();i&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n,t=this.sketchFeature_.getGeometry();this.mode_===ui.LINE_STRING?((n=this.sketchCoords_).splice(-2,1),this.geometryFunction_(n,t),n.length>=2&&(this.finishCoordinate_=n[n.length-2].slice())):this.mode_===ui.POLYGON&&((n=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(n),this.geometryFunction_(this.sketchCoords_,t));0===n.length&&(this.finishCoordinate_=null);this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var t=this.abortDrawing_(),n,i;t&&(n=this.sketchCoords_,i=t.getGeometry(),this.mode_===ui.LINE_STRING?(n.pop(),this.geometryFunction_(n,i)):this.mode_===ui.POLYGON&&(n[0].pop(),this.geometryFunction_(n,i),n=i.getCoordinates()),this.type_===f.MULTI_POINT?t.setGeometry(new pe([n])):this.type_===f.MULTI_LINE_STRING?t.setGeometry(new yf([n])):this.type_===f.MULTI_POLYGON&&t.setGeometry(new we([n])),this.dispatchEvent(new wtt(cui,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t))},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return n&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),n},t.prototype.extend=function(n){var i=n.getGeometry(),t;this.sketchFeature_=n;this.sketchCoords_=i.getCoordinates();t=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=t.slice();this.sketchCoords_.push(t.slice());this.updateSketchFeatures_();this.dispatchEvent(new wtt(alt,this.sketchFeature_))},t.prototype.updateSketchFeatures_=function(){var n=[],t;this.sketchFeature_&&n.push(this.sketchFeature_);this.sketchLine_&&n.push(this.sketchLine_);this.sketchPoint_&&n.push(this.sketchPoint_);t=this.overlay_.getSource();t.clear(!0);t.addFeatures(n)},t.prototype.updateState_=function(){var n=this.getMap(),t=this.getActive();n&&t||this.abortDrawing_();this.overlay_.setMap(t?n:null)},t}(lf),aui={EXTENTCHANGED:"extentchanged"},vui=function(n){function t(t){n.call(this,aui.EXTENTCHANGED);this.extent=t}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr);var yui=function(n){function t(t){var i=t||{};n.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;t||(t={});this.extentOverlay_=new vs({source:new ec({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:function(){var n=ty();return function(){return n[f.POLYGON]}}(),updateWhileAnimating:!0,updateWhileInteracting:!0});this.vertexOverlay_=new vs({source:new ec({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:function(){var n=ty();return function(){return n[f.POINT]}}(),updateWhileAnimating:!0,updateWhileInteracting:!0});t.extent&&this.setExtent(t.extent)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapToVertex_=function(n,t){var r=t.getCoordinateFromPixel(n),o=this.getExtent(),u;if(o){u=function(n){return[[[n[0],n[1]],[n[0],n[3]]],[[n[0],n[3]],[n[2],n[3]]],[[n[2],n[3]],[n[2],n[1]]],[[n[2],n[1]],[n[0],n[1]]]]}(o);u.sort(function(n,t){return ga(r,n)-ga(r,t)});var i=u[0],f=bp(r,i),e=t.getPixelFromCoordinate(f);if(dp(n,e)<=this.pixelTolerance_){var c=t.getPixelFromCoordinate(i[0]),l=t.getPixelFromCoordinate(i[1]),s=ku(e,c),h=ku(e,l),a=Math.sqrt(Math.min(s,h));return this.snappedToVertex_=a<=this.pixelTolerance_,this.snappedToVertex_&&(f=s>h?i[1]:i[0]),f}}return null},t.prototype.handlePointerMove_=function(n){var i=n.pixel,r=n.map,t=this.snapToVertex_(i,r);t||(t=r.getCoordinateFromPixel(i));this.createOrUpdatePointerFeature_(t)},t.prototype.createOrUpdateExtentFeature_=function(n){var t=this.extentFeature_;return t?n?t.setGeometry(ba(n)):t.setGeometry(void 0):(t=new fi(n?ba(n):{}),this.extentFeature_=t,this.extentOverlay_.getSource().addFeature(t)),t},t.prototype.createOrUpdatePointerFeature_=function(n){var t=this.vertexFeature_;return t?t.getGeometry().setCoordinates(n):(t=new fi(new ei(n)),this.vertexFeature_=t,this.vertexOverlay_.getSource().addFeature(t)),t},t.prototype.handleEvent=function(t){return!t.pointerEvent||(t.type!=ht.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),n.prototype.handleEvent.call(this,t),!1)},t.prototype.handleDownEvent=function(n){var e=n.pixel,o=n.map,t=this.getExtent(),i=this.snapToVertex_(e,o),r=function(n){var i=null,r=null;return n[0]==t[0]?i=t[2]:n[0]==t[2]&&(i=t[0]),n[1]==t[1]?r=t[3]:n[1]==t[3]&&(r=t[1]),null!==i&&null!==r?[i,r]:null},u,f;return i&&t?(u=i[0]==t[0]||i[0]==t[2]?i[0]:null,f=i[1]==t[1]||i[1]==t[3]?i[1]:null,null!==u&&null!==f?this.pointerHandler_=vlt(r(i)):null!==u?this.pointerHandler_=ylt(r([u,t[1]]),r([u,t[3]])):null!==f&&(this.pointerHandler_=ylt(r([t[0],f]),r([t[2],f])))):(i=o.getCoordinateFromPixel(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=vlt(i)),!0},t.prototype.handleDragEvent=function(n){if(this.pointerHandler_){var t=n.coordinate;this.setExtent(this.pointerHandler_(t));this.createOrUpdatePointerFeature_(t)}return!0},t.prototype.handleUpEvent=function(){this.pointerHandler_=null;var n=this.getExtent();return n&&0!==up(n)||this.setExtent(null),!1},t.prototype.setMap=function(t){this.extentOverlay_.setMap(t);this.vertexOverlay_.setMap(t);n.prototype.setMap.call(this,t)},t.prototype.getExtent=function(){return this.extent_},t.prototype.setExtent=function(n){this.extent_=n||null;this.createOrUpdateExtentFeature_(n);this.dispatchEvent(new vui(this.extent_))},t}(lf),fy=1,pui="modifystart",plt="modifyend",btt=function(n){function t(t,i,r){n.call(this,t);this.features=i;this.mapBrowserEvent=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr);var bui=function(n){function t(t){var i;if(n.call(this,t),this.condition_=t.condition?t.condition:eot,this.defaultDeleteCondition_=function(n){return iot(n)&&kg(n)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:iv,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.modified_=!1,this.rBush_=new ic,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new vs({source:new ec({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:function(){var n=ty();return function(){return n[f.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,t.source?(this.source_=t.source,i=new er(this.source_.getFeatures()),o(this.source_,fe.ADDFEATURE,this.handleSourceAdd_,this),o(this.source_,fe.REMOVEFEATURE,this.handleSourceRemove_,this)):i=t.features,!i)throw new Error("The modify interaction requires features or a source");this.features_=i;this.features_.forEach(this.addFeature_.bind(this));o(this.features_,ki.ADD,this.handleFeatureAdd_,this);o(this.features_,ki.REMOVE,this.handleFeatureRemove_,this);this.lastPointerEvent_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addFeature_=function(n){var t=n.getGeometry(),i;t&&t.getType()in this.SEGMENT_WRITERS_&&this.SEGMENT_WRITERS_[t.getType()].call(this,n,t);i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i);o(n,a.CHANGE,this.handleFeatureChange_,this)},t.prototype.willModifyFeatures_=function(n){this.modified_||(this.modified_=!0,this.dispatchEvent(new btt(pui,this.features_,n)))},t.prototype.removeFeature_=function(n){this.removeFeatureSegmentData_(n);this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);ou(n,a.CHANGE,this.handleFeatureChange_,this)},t.prototype.removeFeatureSegmentData_=function(n){var r=this.rBush_,i=[],t;for(r.forEach(function(t){n===t.feature&&i.push(t)}),t=i.length-1;t>=0;--t)r.remove(i[t])},t.prototype.setActive=function(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);n.prototype.setActive.call(this,t)},t.prototype.setMap=function(t){this.overlay_.setMap(t);n.prototype.setMap.call(this,t)},t.prototype.getOverlay=function(){return this.overlay_},t.prototype.handleSourceAdd_=function(n){n.feature&&this.features_.push(n.feature)},t.prototype.handleSourceRemove_=function(n){n.feature&&this.features_.remove(n.feature)},t.prototype.handleFeatureAdd_=function(n){this.addFeature_(n.element)},t.prototype.handleFeatureChange_=function(n){if(!this.changingFeature_){var t=n.target;this.removeFeature_(t);this.addFeature_(t)}},t.prototype.handleFeatureRemove_=function(n){var t=n.element;this.removeFeature_(t)},t.prototype.writePointGeometry_=function(n,t){var i=t.getCoordinates(),r={feature:n,geometry:t,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)},t.prototype.writeMultiPointGeometry_=function(n,t){for(var r,f,u=t.getCoordinates(),i=0,e=u.length;i<e;++i)r=u[i],f={feature:n,geometry:t,depth:[i],index:i,segment:[r,r]},this.rBush_.insert(t.getExtent(),f)},t.prototype.writeLineStringGeometry_=function(n,t){for(var r,f,u=t.getCoordinates(),i=0,e=u.length-1;i<e;++i)r=u.slice(i,i+2),f={feature:n,geometry:t,index:i,segment:r},this.rBush_.insert(hi(r),f)},t.prototype.writeMultiLineStringGeometry_=function(n,t){for(var u,o,f=t.getCoordinates(),r=0,s=f.length;r<s;++r)for(var e=f[r],i=0,h=e.length-1;i<h;++i)u=e.slice(i,i+2),o={feature:n,geometry:t,depth:[r],index:i,segment:u},this.rBush_.insert(hi(u),o)},t.prototype.writePolygonGeometry_=function(n,t){for(var u,o,f=t.getCoordinates(),r=0,s=f.length;r<s;++r)for(var e=f[r],i=0,h=e.length-1;i<h;++i)u=e.slice(i,i+2),o={feature:n,geometry:t,depth:[r],index:i,segment:u},this.rBush_.insert(hi(u),o)},t.prototype.writeMultiPolygonGeometry_=function(n,t){for(var f,h,e=t.getCoordinates(),r=0,c=e.length;r<c;++r)for(var o=e[r],u=0,l=o.length;u<l;++u)for(var s=o[u],i=0,a=s.length-1;i<a;++i)f=s.slice(i,i+2),h={feature:n,geometry:t,depth:[u,r],index:i,segment:f},this.rBush_.insert(hi(f),h)},t.prototype.writeCircleGeometry_=function(n,t){var i=t.getCenter(),r={feature:n,geometry:t,index:0,segment:[i,i]},u={feature:n,geometry:t,index:fy,segment:[i,i]},f=[r,u];r.featureSegments=u.featureSegments=f;this.rBush_.insert(uh(i),r);this.rBush_.insert(t.getExtent(),u)},t.prototype.writeGeometryCollectionGeometry_=function(n,t){for(var r=t.getGeometriesArray(),i=0;i<r.length;++i)this.SEGMENT_WRITERS_[r[i].getType()].call(this,n,r[i])},t.prototype.createOrUpdateVertexFeature_=function(n){var t=this.vertexFeature_;return t?t.getGeometry().setCoordinates(n):(t=new fi(new ei(n)),this.vertexFeature_=t,this.overlay_.getSource().addFeature(t)),t},t.prototype.handleEvent=function(t){return!t.pointerEvent||(this.lastPointerEvent_=t,t.map.getView().getInteracting()||t.type!=ht.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(i=!(t.type!=ht.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==ht.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),n.prototype.handleEvent.call(this,t)&&!i);var i},t.prototype.handleDragEvent=function(n){this.ignoreNextSingleClick_=!1;this.willModifyFeatures_(n);for(var t=n.coordinate,s=0,l=this.dragSegments_.length;s<l;++s){for(var c=this.dragSegments_[s],u=c[0],h=u.depth,i=u.geometry,e=void 0,r=u.segment,o=c[1];t.length<i.getStride();)t.push(r[o][t.length]);switch(i.getType()){case f.POINT:e=t;r[0]=r[1]=t;break;case f.MULTI_POINT:(e=i.getCoordinates())[u.index]=t;r[0]=r[1]=t;break;case f.LINE_STRING:(e=i.getCoordinates())[u.index+o]=t;r[o]=t;break;case f.MULTI_LINE_STRING:case f.POLYGON:(e=i.getCoordinates())[h[0]][u.index+o]=t;r[o]=t;break;case f.MULTI_POLYGON:(e=i.getCoordinates())[h[1]][h[0]][u.index+o]=t;r[o]=t;break;case f.CIRCLE:r[0]=r[1]=t;0===u.index?(this.changingFeature_=!0,i.setCenter(t),this.changingFeature_=!1):(this.changingFeature_=!0,i.setRadius(dp(i.getCenter(),t)),this.changingFeature_=!1)}e&&this.setGeometryCoordinates_(i,e)}this.createOrUpdateVertexFeature_(t)},t.prototype.handleDownEvent=function(n){var a,h,o,v,s;if(!this.condition_(n))return!1;if(this.handlePointerAtPixel_(n.pixel,n.map),a=n.map.getCoordinateFromPixel(n.pixel),this.dragSegments_.length=0,this.modified_=!1,h=this.vertexFeature_,h){var e=[],u=h.getGeometry().getCoordinates(),w=hi([u]),c=this.rBush_.getInExtent(w),r={};for(c.sort(wui),o=0,v=c.length;o<v;++o){var t=c[o],l=t.segment,i=y(t.feature),p=t.depth;if(p&&(i+="-"+p.join("-")),r[i]||(r[i]=new Array(2)),t.geometry.getType()===f.CIRCLE&&t.index===fy)ns(blt(a,t),u)&&!r[i][0]&&(this.dragSegments_.push([t,0]),r[i][0]=t);else if(ns(l[0],u)&&!r[i][0])this.dragSegments_.push([t,0]),r[i][0]=t;else if(ns(l[1],u)&&!r[i][1]){if((t.geometry.getType()===f.LINE_STRING||t.geometry.getType()===f.MULTI_LINE_STRING)&&r[i][0]&&0===r[i][0].index)continue;this.dragSegments_.push([t,1]);r[i][1]=t}else this.insertVertexCondition_(n)&&y(l)in this.vertexSegments_&&!r[i][0]&&!r[i][1]&&e.push([t,u])}for(e.length&&this.willModifyFeatures_(n),s=e.length-1;s>=0;--s)this.insertVertex_.apply(this,e[s])}return!!this.vertexFeature_},t.prototype.handleUpEvent=function(n){for(var t,r,i=this.dragSegments_.length-1;i>=0;--i)if(t=this.dragSegments_[i][0],r=t.geometry,r.getType()===f.CIRCLE){var u=r.getCenter(),e=t.featureSegments[0],o=t.featureSegments[1];e.segment[0]=e.segment[1]=u;o.segment[0]=o.segment[1]=u;this.rBush_.update(uh(u),e);this.rBush_.update(r.getExtent(),o)}else this.rBush_.update(hi(t.segment),t);return this.modified_&&(this.dispatchEvent(new btt(plt,this.features_,n)),this.modified_=!1),!1},t.prototype.handlePointerMove_=function(n){this.lastPixel_=n.pixel;this.handlePointerAtPixel_(n.pixel,n.map)},t.prototype.handlePointerAtPixel_=function(n,t){var e=t.getCoordinateFromPixel(n),b=ff(uh(e),t.getView().getResolution()*this.pixelTolerance_),u=this.rBush_.getInExtent(b),h,c,w,r;if(u.length>0){u.sort(function(n,t){return wlt(e,n)-wlt(e,t)});var o=u[0],i=o.segment,s=blt(e,o),l=t.getPixelFromCoordinate(s),a=dp(n,l);if(a<=this.pixelTolerance_){if(h={},o.geometry.getType()===f.CIRCLE&&o.index===fy)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(s);else{var k=t.getPixelFromCoordinate(i[0]),d=t.getPixelFromCoordinate(i[1]),v=ku(l,k),p=ku(l,d);for(a=Math.sqrt(Math.min(v,p)),this.snappedToVertex_=a<=this.pixelTolerance_,this.snappedToVertex_&&(s=v>p?i[1]:i[0]),this.createOrUpdateVertexFeature_(s),c=1,w=u.length;c<w;++c){if(r=u[c].segment,!(ns(i[0],r[0])&&ns(i[1],r[1])||ns(i[0],r[1])&&ns(i[1],r[0])))break;h[y(r)]=!0}}return h[y(i)]=!0,void(this.vertexSegments_=h)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},t.prototype.insertVertex_=function(n,t){for(var o,s,h,e,c=n.segment,l=n.feature,i=n.geometry,r=n.depth,u=n.index;t.length<i.getStride();)t.push(0);switch(i.getType()){case f.MULTI_LINE_STRING:case f.POLYGON:(e=i.getCoordinates())[r[0]].splice(u+1,0,t);break;case f.MULTI_POLYGON:(e=i.getCoordinates())[r[1]][r[0]].splice(u+1,0,t);break;case f.LINE_STRING:(e=i.getCoordinates()).splice(u+1,0,t);break;default:return}this.setGeometryCoordinates_(i,e);o=this.rBush_;o.remove(n);this.updateSegmentIndices_(i,u,r,1);s={segment:[c[0],t],feature:l,geometry:i,depth:r,index:u};o.insert(hi(s.segment),s);this.dragSegments_.push([s,1]);h={segment:[t,c[1]],feature:l,geometry:i,depth:r,index:u+1};o.insert(hi(h.segment),h);this.dragSegments_.push([h,0]);this.ignoreNextSingleClick_=!0},t.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ht.POINTERDRAG){var n=this.lastPointerEvent_;return this.willModifyFeatures_(n),this.removeVertex_(),this.dispatchEvent(new btt(plt,this.features_,n)),this.modified_=!1,!0}return!1},t.prototype.removeVertex_=function(){for(var i,o,p,l,u,e,c,s,n,t,w=this.dragSegments_,r={},h=!1,v,b,a=w.length-1;a>=0;--a)t=y((n=(p=w[a])[0]).feature),n.depth&&(t+="-"+n.depth.join("-")),t in r||(r[t]={}),0===p[1]?(r[t].right=n,r[t].index=n.index):1==p[1]&&(r[t].left=n,r[t].index=n.index+1);for(t in r){switch(s=r[t].right,e=r[t].left,c=(u=r[t].index)-1,n=void 0!==e?e:s,c<0&&(c=0),i=o=(l=n.geometry).getCoordinates(),h=!1,l.getType()){case f.MULTI_LINE_STRING:o[n.depth[0]].length>2&&(o[n.depth[0]].splice(u,1),h=!0);break;case f.LINE_STRING:o.length>2&&(o.splice(u,1),h=!0);break;case f.MULTI_POLYGON:i=i[n.depth[1]];case f.POLYGON:(i=i[n.depth[0]]).length>4&&(u==i.length-1&&(u=0),i.splice(u,1),h=!0,0===u&&(i.pop(),i.push(i[0]),c=i.length-1))}h&&(this.setGeometryCoordinates_(l,o),v=[],(void 0!==e&&(this.rBush_.remove(e),v.push(e.segment[0])),void 0!==s&&(this.rBush_.remove(s),v.push(s.segment[1])),void 0!==e&&void 0!==s)&&(b={depth:n.depth,feature:n.feature,geometry:n.geometry,index:c,segment:v},this.rBush_.insert(hi(b.segment),b)),this.updateSegmentIndices_(l,u,n.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),w.length=0)}return h},t.prototype.setGeometryCoordinates_=function(n,t){this.changingFeature_=!0;n.setCoordinates(t);this.changingFeature_=!1},t.prototype.updateSegmentIndices_=function(n,t,i,r){this.rBush_.forEachInExtent(n.getExtent(),function(u){u.geometry===n&&(void 0===i||void 0===u.depth||uf(u.depth,i))&&u.index>t&&(u.index+=r)})},t}(lf),kui={SELECT:"select"},dui=function(n){function t(t,i,r,u){n.call(this,t);this.selected=i;this.deselected=r;this.mapBrowserEvent=u}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr);klt=function(n){function t(t){var i,r,e,s,u;n.call(this,{handleEvent:gui});i=t||{};this.condition_=i.condition?i.condition:kg;this.addCondition_=i.addCondition?i.addCondition:bg;this.removeCondition_=i.removeCondition?i.removeCondition:bg;this.toggleCondition_=i.toggleCondition?i.toggleCondition:rv;this.multi_=!!i.multi&&i.multi;this.filter_=i.filter?i.filter:bu;this.hitTolerance_=i.hitTolerance?i.hitTolerance:0;e=new vs({source:new ec({useSpatialIndex:!1,features:i.features,wrapX:i.wrapX}),style:i.style?i.style:function(){var n=ty();return pt(n[f.POLYGON],n[f.LINE_STRING]),pt(n[f.GEOMETRY_COLLECTION],n[f.LINE_STRING]),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}}(),updateWhileAnimating:!0,updateWhileInteracting:!0});(this.featureOverlay_=e,i.layers)?"function"==typeof i.layers?r=i.layers:(s=i.layers,r=function(n){return tr(s,n)}):r=bu;this.layerFilter_=r;this.featureLayerAssociation_={};u=this.getFeatures();o(u,ki.ADD,this.addFeature_,this);o(u,ki.REMOVE,this.removeFeature_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addFeatureLayerAssociation_=function(n,t){this.featureLayerAssociation_[y(n)]=t},t.prototype.getFeatures=function(){return this.featureOverlay_.getSource().getFeaturesCollection()},t.prototype.getHitTolerance=function(){return this.hitTolerance_},t.prototype.getLayer=function(n){return this.featureLayerAssociation_[y(n)]},t.prototype.getOverlay=function(){return this.featureOverlay_},t.prototype.setHitTolerance=function(n){this.hitTolerance_=n},t.prototype.setMap=function(t){var i=this.getMap(),r=this.getFeatures();i&&r.forEach(i.unskipFeature.bind(i));n.prototype.setMap.call(this,t);this.featureOverlay_.setMap(t);t&&r.forEach(t.skipFeature.bind(t))},t.prototype.addFeature_=function(n){var t=this.getMap();t&&t.skipFeature(n.element)},t.prototype.removeFeature_=function(n){var t=this.getMap();t&&t.unskipFeature(n.element)},t.prototype.removeFeatureLayerAssociation_=function(n){delete this.featureLayerAssociation_[y(n)]},t}(ge);var nfi=function(n){function t(t){var i=t||{},r=i;r.handleDownEvent||(r.handleDownEvent=bu);r.stopDown||(r.stopDown=nh);n.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(n,t){var i=ga(this.pixelCoordinate_,n.segment),r=ga(this.pixelCoordinate_,t.segment);return i-r}.bind(this);this.rBush_=new ic;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addFeature=function(n,t){var f=void 0===t||t,u=y(n),i=n.getGeometry(),r;i&&(r=this.SEGMENT_WRITERS_[i.getType()],r&&(this.indexedFeaturesExtents_[u]=i.getExtent([1/0,1/0,-1/0,-1/0]),r.call(this,n,i)));f&&(this.featureChangeListenerKeys_[u]=o(n,a.CHANGE,this.handleFeatureChange_,this))},t.prototype.forEachFeatureAdd_=function(n){this.addFeature(n)},t.prototype.forEachFeatureRemove_=function(n){this.removeFeature(n)},t.prototype.getFeatures_=function(){var n;return this.features_?n=this.features_:this.source_&&(n=this.source_.getFeatures()),n},t.prototype.handleEvent=function(t){var i=this.snapTo(t.pixel,t.coordinate,t.map);return i.snapped&&(t.coordinate=i.vertex.slice(0,2),t.pixel=i.vertexPixel),n.prototype.handleEvent.call(this,t)},t.prototype.handleFeatureAdd_=function(n){var t=dlt(n);this.addFeature(t)},t.prototype.handleFeatureRemove_=function(n){var t=dlt(n);this.removeFeature(t)},t.prototype.handleFeatureChange_=function(n){var t=n.target,i;this.handlingDownUpSequence?(i=y(t),i in this.pendingFeatures_||(this.pendingFeatures_[i]=t)):this.updateFeature_(t)},t.prototype.handleUpEvent=function(){var n=wk(this.pendingFeatures_);return n.length&&(n.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},t.prototype.removeFeature=function(n,t){var o=void 0===t||t,u=y(n),e=this.indexedFeaturesExtents_[u],f,i,r;if(e)for(f=this.rBush_,i=[],f.forEachInExtent(e,function(t){n===t.feature&&i.push(t)}),r=i.length-1;r>=0;--r)f.remove(i[r]);o&&(lt(this.featureChangeListenerKeys_[u]),delete this.featureChangeListenerKeys_[u])},t.prototype.setMap=function(t){var u=this.getMap(),i=this.featuresListenerKeys_,r=this.getFeatures_();u&&(i.forEach(lt),i.length=0,r.forEach(this.forEachFeatureRemove_.bind(this)));n.prototype.setMap.call(this,t);t&&(this.features_?i.push(o(this.features_,ki.ADD,this.handleFeatureAdd_,this),o(this.features_,ki.REMOVE,this.handleFeatureRemove_,this)):this.source_&&i.push(o(this.source_,fe.ADDFEATURE,this.handleFeatureAdd_,this),o(this.source_,fe.REMOVEFEATURE,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},t.prototype.snapTo=function(n,t,i){var y=hi([i.getCoordinateFromPixel([n[0]-this.pixelTolerance_,n[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([n[0]+this.pixelTolerance_,n[1]-this.pixelTolerance_])]),e=this.rBush_.getInExtent(y),r,v;this.vertex_&&!this.edge_&&(e=e.filter(function(n){return n.feature.getGeometry().getType()!==f.CIRCLE}));var c,l,s,h,a=!1,o=null,u=null;return e.length>0&&(this.pixelCoordinate_=t,e.sort(this.sortByDistance_),r=e[0].segment,v=e[0].feature.getGeometry().getType()===f.CIRCLE,this.vertex_&&!this.edge_?(c=i.getPixelFromCoordinate(r[0]),l=i.getPixelFromCoordinate(r[1]),s=ku(n,c),h=ku(n,l),Math.sqrt(Math.min(s,h))<=this.pixelTolerance_&&(a=!0,o=s>h?r[1]:r[0],u=i.getPixelFromCoordinate(o))):this.edge_&&(o=v?function(n,t){var f=t.getRadius(),e=t.getCenter(),o=e[0],s=e[1],i=n[0]-o,r=n[1]-s,u;return 0===i&&0===r&&(i=1),u=Math.sqrt(i*i+r*r),[o+f*i/u,s+f*r/u]}(t,e[0].feature.getGeometry()):bp(t,r),dp(n,u=i.getPixelFromCoordinate(o))<=this.pixelTolerance_&&(a=!0,this.vertex_&&!v&&(c=i.getPixelFromCoordinate(r[0]),l=i.getPixelFromCoordinate(r[1]),s=ku(u,c),h=ku(u,l),Math.sqrt(Math.min(s,h))<=this.pixelTolerance_&&(o=s>h?r[1]:r[0],u=i.getPixelFromCoordinate(o))))),a&&(u=[Math.round(u[0]),Math.round(u[1])])),{snapped:a,vertex:o,vertexPixel:u}},t.prototype.updateFeature_=function(n){this.removeFeature(n,!1);this.addFeature(n,!1)},t.prototype.writeCircleGeometry_=function(n,t){for(var r,f,u=kd(t).getCoordinates()[0],i=0,e=u.length-1;i<e;++i)r=u.slice(i,i+2),f={feature:n,segment:r},this.rBush_.insert(hi(r),f)},t.prototype.writeGeometryCollectionGeometry_=function(n,t){for(var u,r=t.getGeometriesArray(),i=0;i<r.length;++i)u=this.SEGMENT_WRITERS_[r[i].getType()],u&&u.call(this,n,r[i])},t.prototype.writeLineStringGeometry_=function(n,t){for(var r,f,u=t.getCoordinates(),i=0,e=u.length-1;i<e;++i)r=u.slice(i,i+2),f={feature:n,segment:r},this.rBush_.insert(hi(r),f)},t.prototype.writeMultiLineStringGeometry_=function(n,t){for(var u,o,f=t.getCoordinates(),r=0,s=f.length;r<s;++r)for(var e=f[r],i=0,h=e.length-1;i<h;++i)u=e.slice(i,i+2),o={feature:n,segment:u},this.rBush_.insert(hi(u),o)},t.prototype.writeMultiPointGeometry_=function(n,t){for(var r,f,u=t.getCoordinates(),i=0,e=u.length;i<e;++i)r=u[i],f={feature:n,segment:[r,r]},this.rBush_.insert(t.getExtent(),f)},t.prototype.writeMultiPolygonGeometry_=function(n,t){for(var f,h,e=t.getCoordinates(),r=0,c=e.length;r<c;++r)for(var o=e[r],u=0,l=o.length;u<l;++u)for(var s=o[u],i=0,a=s.length-1;i<a;++i)f=s.slice(i,i+2),h={feature:n,segment:f},this.rBush_.insert(hi(f),h)},t.prototype.writePointGeometry_=function(n,t){var i=t.getCoordinates(),r={feature:n,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)},t.prototype.writePolygonGeometry_=function(n,t){for(var u,o,f=t.getCoordinates(),r=0,s=f.length;r<s;++r)for(var e=f[r],i=0,h=e.length-1;i<h;++i)u=e.slice(i,i+2),o={feature:n,segment:u},this.rBush_.insert(hi(u),o)},t}(lf),tfi="translatestart",ifi="translating",rfi="translateend",ktt=function(n){function t(t,i,r){n.call(this,t);this.features=i;this.coordinate=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(fr),ufi=function(n){function t(t){var r,i=t||{},u;(n.call(this,i),this.lastCoordinate_=null,this.features_=void 0!==i.features?i.features:null,i.layers)?"function"==typeof i.layers?r=i.layers:(u=i.layers,r=function(n){return tr(u,n)}):r=bu;this.layerFilter_=r;this.hitTolerance_=i.hitTolerance?i.hitTolerance:0;this.lastFeature_=null;o(this,ni(tv.ACTIVE),this.handleActiveChanged_,this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleDownEvent=function(n){if(this.lastFeature_=this.featuresAtPixel_(n.pixel,n.map),!this.lastCoordinate_&&this.lastFeature_){this.lastCoordinate_=n.coordinate;this.handleMoveEvent(n);var t=this.features_||new er([this.lastFeature_]);return this.dispatchEvent(new ktt(tfi,t,n.coordinate)),!0}return!1},t.prototype.handleUpEvent=function(n){if(this.lastCoordinate_){this.lastCoordinate_=null;this.handleMoveEvent(n);var t=this.features_||new er([this.lastFeature_]);return this.dispatchEvent(new ktt(rfi,t,n.coordinate)),!0}return!1},t.prototype.handleDragEvent=function(n){if(this.lastCoordinate_){var t=n.coordinate,r=t[0]-this.lastCoordinate_[0],u=t[1]-this.lastCoordinate_[1],i=this.features_||new er([this.lastFeature_]);i.forEach(function(n){var t=n.getGeometry();t.translate(r,u);n.setGeometry(t)});this.lastCoordinate_=t;this.dispatchEvent(new ktt(ifi,i,t))}},t.prototype.handleMoveEvent=function(n){var t=n.map.getViewport();this.featuresAtPixel_(n.pixel,n.map)?(t.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),t.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):t.classList.remove("ol-grab","ol-grabbing")},t.prototype.featuresAtPixel_=function(n,t){return t.forEachFeatureAtPixel(n,function(n){if(!this.features_||tr(this.features_.getArray(),n))return n}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},t.prototype.getHitTolerance=function(){return this.hitTolerance_},t.prototype.setHitTolerance=function(n){this.hitTolerance_=n},t.prototype.setMap=function(t){var i=this.getMap();n.prototype.setMap.call(this,t);this.updateState_(i)},t.prototype.handleActiveChanged_=function(){this.updateState_(null)},t.prototype.updateState_=function(n){var t=this.getMap(),i=this.getActive();t&&i||(t=t||n)&&t.getViewport().classList.remove("ol-grab","ol-grabbing")},t}(lf);ys=function(n){function t(t){n.call(this);this.geometries_=t||null;this.listenGeometriesChange_()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.unlistenGeometriesChange_=function(){if(this.geometries_)for(var n=0,t=this.geometries_.length;n<t;++n)ou(this.geometries_[n],a.CHANGE,this.changed,this)},t.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var n=0,t=this.geometries_.length;n<t;++n)o(this.geometries_[n],a.CHANGE,this.changed,this)},t.prototype.clone=function(){var n=new t(null);return n.setGeometries(this.geometries_),n},t.prototype.closestPointXY=function(n,t,i,r){if(r<ih(this.getExtent(),n,t))return r;for(var f=this.geometries_,u=0,e=f.length;u<e;++u)r=f[u].closestPointXY(n,t,i,r);return r},t.prototype.containsXY=function(n,t){for(var r=this.geometries_,i=0,u=r.length;i<u;++i)if(r[i].containsXY(n,t))return!0;return!1},t.prototype.computeExtent=function(n){rh(n);for(var i=this.geometries_,t=0,r=i.length;t<r;++t)rp(n,i[t].getExtent());return n},t.prototype.getGeometries=function(){return glt(this.geometries_)},t.prototype.getGeometriesArray=function(){return this.geometries_},t.prototype.getSimplifiedGeometry=function(n){var i,f,e,r;if(this.simplifiedGeometryRevision!=this.getRevision()&&(pf(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),n<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&n<this.simplifiedGeometryMaxMinSquaredTolerance)return this;if(i=n.toString(),this.simplifiedGeometryCache.hasOwnProperty(i))return this.simplifiedGeometryCache[i];for(var o=[],s=this.geometries_,h=!1,u=0,c=s.length;u<c;++u)f=s[u],e=f.getSimplifiedGeometry(n),o.push(e),e!==f&&(h=!0);return h?(r=new t(null),r.setGeometriesArray(o),this.simplifiedGeometryCache[i]=r,r):(this.simplifiedGeometryMaxMinSquaredTolerance=n,this)},t.prototype.getType=function(){return f.GEOMETRY_COLLECTION},t.prototype.intersectsExtent=function(n){for(var i=this.geometries_,t=0,r=i.length;t<r;++t)if(i[t].intersectsExtent(n))return!0;return!1},t.prototype.isEmpty=function(){return 0===this.geometries_.length},t.prototype.rotate=function(n,t){for(var r=this.geometries_,i=0,u=r.length;i<u;++i)r[i].rotate(n,t);this.changed()},t.prototype.scale=function(n,t,i){var r=i;r||(r=su(this.getExtent()));for(var f=this.geometries_,u=0,e=f.length;u<e;++u)f[u].scale(n,t,r);this.changed()},t.prototype.setGeometries=function(n){this.setGeometriesArray(glt(n))},t.prototype.setGeometriesArray=function(n){this.unlistenGeometriesChange_();this.geometries_=n;this.listenGeometriesChange_();this.changed()},t.prototype.applyTransform=function(n){for(var i=this.geometries_,t=0,r=i.length;t<r;++t)i[t].applyTransform(n);this.changed()},t.prototype.translate=function(n,t){for(var r=this.geometries_,i=0,u=r.length;i<u;++i)r[i].translate(n,t);this.changed()},t.prototype.disposeInternal=function(){this.unlistenGeometriesChange_();n.prototype.disposeInternal.call(this)},t}(yp);tf=function(){this.dataProjection=null;this.defaultFeatureProjection=null};tf.prototype.getReadOptions=function(n,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(n),featureProjection:t.featureProjection}),this.adaptOptions(i)};tf.prototype.adaptOptions=function(n){return nt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},n)};tf.prototype.getLastExtent=function(){return null};tf.prototype.getType=function(){return p()};tf.prototype.readFeature=function(){return p()};tf.prototype.readFeatures=function(){return p()};tf.prototype.readGeometry=function(){return p()};tf.prototype.readProjection=function(){return p()};tf.prototype.writeFeature=function(){return p()};tf.prototype.writeFeatures=function(){return p()};tf.prototype.writeGeometry=function(){return p()};dl=tf;tk=function(n){function t(){n.call(this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getType=function(){return ro.JSON},t.prototype.readFeature=function(n,t){return this.readFeatureFromObject(nk(n),this.getReadOptions(n,t))},t.prototype.readFeatures=function(n,t){return this.readFeaturesFromObject(nk(n),this.getReadOptions(n,t))},t.prototype.readFeatureFromObject=function(){return p()},t.prototype.readFeaturesFromObject=function(){return p()},t.prototype.readGeometry=function(n,t){return this.readGeometryFromObject(nk(n),this.getReadOptions(n,t))},t.prototype.readGeometryFromObject=function(){return p()},t.prototype.readProjection=function(n){return this.readProjectionFromObject(nk(n))},t.prototype.readProjectionFromObject=function(){return p()},t.prototype.writeFeature=function(n,t){return JSON.stringify(this.writeFeatureObject(n,t))},t.prototype.writeFeatureObject=function(){return p()},t.prototype.writeFeatures=function(n,t){return JSON.stringify(this.writeFeaturesObject(n,t))},t.prototype.writeFeaturesObject=function(){return p()},t.prototype.writeGeometry=function(n,t){return JSON.stringify(this.writeGeometryObject(n,t))},t.prototype.writeGeometryObject=function(){return p()},t}(dl);ps={};ps[f.POINT]=function(n){return void 0!==n.m&&void 0!==n.z?new ei([n.x,n.y,n.z,n.m],v.XYZM):void 0!==n.z?new ei([n.x,n.y,n.z],v.XYZ):void 0!==n.m?new ei([n.x,n.y,n.m],v.XYM):new ei([n.x,n.y])};ps[f.LINE_STRING]=function(n){var t=gl(n);return new yi(n.paths[0],t)};ps[f.POLYGON]=function(n){var t=gl(n);return new or(n.rings,t)};ps[f.MULTI_POINT]=function(n){var t=gl(n);return new pe(n.points,t)};ps[f.MULTI_LINE_STRING]=function(n){var t=gl(n);return new yf(n.paths,t)};ps[f.MULTI_POLYGON]=function(n){var t=gl(n);return new we(n.rings,t)};ws={};ws[f.POINT]=function(n){var i,t=n.getCoordinates(),r=n.getLayout();return r===v.XYZ?i={x:t[0],y:t[1],z:t[2]}:r===v.XYM?i={x:t[0],y:t[1],m:t[2]}:r===v.XYZM?i={x:t[0],y:t[1],z:t[2],m:t[3]}:r===v.XY?i={x:t[0],y:t[1]}:g(!1,34),i};ws[f.LINE_STRING]=function(n){var t=n,i=ey(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}};ws[f.POLYGON]=function(n){var t=n,i=ey(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}};ws[f.MULTI_POINT]=function(n){var t=n,i=ey(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}};ws[f.MULTI_LINE_STRING]=function(n){var t=n,i=ey(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}};ws[f.MULTI_POLYGON]=function(n){for(var i,u=ey(n),r=n.getCoordinates(!1),f=[],t=0;t<r.length;t++)for(i=r[t].length-1;i>=0;i--)f.push(r[t][i]);return{hasZ:u.hasZ,hasM:u.hasM,rings:f}};var ffi=function(n){function t(t){var i=t||{};n.call(this);this.geometryName_=i.geometryName}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeatureFromObject=function(n,t){var i=n,u=nat(i.geometry,t),r=new fi;return this.geometryName_&&r.setGeometryName(this.geometryName_),r.setGeometry(u),t&&t.idField&&i.attributes[t.idField]&&r.setId(i.attributes[t.idField]),i.attributes&&r.setProperties(i.attributes),r},t.prototype.readFeaturesFromObject=function(n,t){var r=t||{},u,f,i,e;if(n.features){for(u=[],f=n.features,r.idField=n.objectIdFieldName,i=0,e=f.length;i<e;++i)u.push(this.readFeatureFromObject(f[i],r));return u}return[this.readFeatureFromObject(n,r)]},t.prototype.readGeometryFromObject=function(n,t){return nat(n,t)},t.prototype.readProjectionFromObject=function(n){return n.spatialReference&&void 0!==n.spatialReference.wkid?w("EPSG:"+n.spatialReference.wkid):null},t.prototype.writeGeometryObject=function(n,t){return tat(n,this.adaptOptions(t))},t.prototype.writeFeatureObject=function(n,t){var i,u,r;return t=this.adaptOptions(t),i={},u=n.getGeometry(),u&&(i.geometry=tat(u,t),t&&t.featureProjection&&(i.geometry.spatialReference={wkid:Number(w(t.featureProjection).getCode().split(":").pop())})),r=n.getProperties(),delete r[n.getGeometryName()],i.attributes=wu(r)?{}:r,i},t.prototype.writeFeaturesObject=function(n,t){t=this.adaptOptions(t);for(var r=[],i=0,u=n.length;i<u;++i)r.push(this.writeFeatureObject(n[i],t));return{features:r}},t}(tk),na=function(n){function t(){n.call(this);this.xmlSerializer_=new XMLSerializer}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getType=function(){return ro.XML},t.prototype.readFeature=function(n,t){if(n){if("string"==typeof n){var i=ue(n);return this.readFeatureFromDocument(i,t)}return ye(n)?this.readFeatureFromDocument(n,t):this.readFeatureFromNode(n,t)}return null},t.prototype.readFeatureFromDocument=function(n,t){var i=this.readFeaturesFromDocument(n,t);return i.length>0?i[0]:null},t.prototype.readFeatureFromNode=function(){return null},t.prototype.readFeatures=function(n,t){if(n){if("string"==typeof n){var i=ue(n);return this.readFeaturesFromDocument(i,t)}return ye(n)?this.readFeaturesFromDocument(n,t):this.readFeaturesFromNode(n,t)}return[]},t.prototype.readFeaturesFromDocument=function(n,t){for(var r=[],i=n.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&pt(r,this.readFeaturesFromNode(i,t));return r},t.prototype.readFeaturesFromNode=function(){return p()},t.prototype.readGeometry=function(n,t){if(n){if("string"==typeof n){var i=ue(n);return this.readGeometryFromDocument(i,t)}return ye(n)?this.readGeometryFromDocument(n,t):this.readGeometryFromNode(n,t)}return null},t.prototype.readGeometryFromDocument=function(){return null},t.prototype.readGeometryFromNode=function(){return null},t.prototype.readProjection=function(n){if(n){if("string"==typeof n){var t=ue(n);return this.readProjectionFromDocument(t)}return ye(n)?this.readProjectionFromDocument(n):this.readProjectionFromNode(n)}return null},t.prototype.readProjectionFromDocument=function(){return this.dataProjection},t.prototype.readProjectionFromNode=function(){return this.dataProjection},t.prototype.writeFeature=function(n,t){var i=this.writeFeatureNode(n,t);return this.xmlSerializer_.serializeToString(i)},t.prototype.writeFeatureNode=function(){return null},t.prototype.writeFeatures=function(n,t){var i=this.writeFeaturesNode(n,t);return this.xmlSerializer_.serializeToString(i)},t.prototype.writeFeaturesNode=function(){return null},t.prototype.writeGeometry=function(n,t){var i=this.writeGeometryNode(n,t);return this.xmlSerializer_.serializeToString(i)},t.prototype.writeGeometryNode=function(){return null},t}(dl),be="http://www.opengis.net/gml",efi=/^[\s\xa0]*$/,wi=function(n){function t(t){n.call(this);var i=t||{};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:b(this.readFeaturesInternal),featureMembers:tt(this.readFeaturesInternal)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeaturesInternal=function(n,t){var u=n.localName,f=null,c,k,l,v,y,nt,p,e,w;if("FeatureCollection"==u)f=h([],this.FEATURE_COLLECTION_PARSERS,n,t,this);else if("featureMembers"==u||"featureMember"==u){var s=t[0],r=s.featureType,i=s.featureNS;if(!r&&n.childNodes){for(r=[],i={},c=0,k=n.childNodes.length;c<k;++c)if(l=n.childNodes[c],1===l.nodeType&&(v=l.nodeName.split(":").pop(),-1===r.indexOf(v))){var a="",d=0,g=l.namespaceURI;for(y in i){if(i[y]===g){a=y;break}++d}a||(i[a="p"+d]=g);r.push(a+":"+v)}"featureMember"!=u&&(s.featureType=r,s.featureNS=i)}"string"==typeof i&&(nt=i,(i={}).p0=nt);p={};e=Array.isArray(r)?r:[r];for(w in i){for(var it={},o=0,rt=e.length;o<rt;++o)(-1===e[o].indexOf(":")?"p0":e[o].split(":")[0])===w&&(it[e[o].split(":").pop()]="featureMembers"==u?b(this.readFeatureElement,this):tt(this.readFeatureElement,this));p[i[w]]=it}f=h("featureMember"==u?void 0:[],p,n,t)}return null===f&&(f=[]),f},t.prototype.readGeometryElement=function(n,t){var i=t[0],r;return i.srsName=n.firstElementChild.getAttribute("srsName"),i.srsDimension=n.firstElementChild.getAttribute("srsDimension"),r=h(null,this.GEOMETRY_PARSERS,n,t,this),r?si(r,!1,i):void 0},t.prototype.readFeatureElementInternal=function(n,t,i){for(var h,e,f,c,o,a,s,l,u={},r=n.firstElementChild;r;r=r.nextElementSibling)if(e=void 0,f=r.localName,0===r.childNodes.length||1===r.childNodes.length&&(3===r.firstChild.nodeType||4===r.firstChild.nodeType)?(e=fu(r,!1),efi.test(e)&&(e=void 0)):(i&&(e=this.readGeometryElement(r,t)),e?"boundedBy"!==f&&(h=f):e=this.readFeatureElementInternal(r,t,!1)),u[f]?(u[f]instanceof Array||(u[f]=[u[f]]),u[f].push(e)):u[f]=e,c=r.attributes.length,c>0)for(u[f]={_content_:u[f]},o=0;o<c;o++)a=r.attributes[o].name,u[f][a]=r.attributes[o].value;return i?(s=new fi(u),h&&s.setGeometryName(h),l=n.getAttribute("fid")||function(n,t,i){return n.getAttributeNS(t,i)||""}(n,this.namespace,"id"),l&&s.setId(l),s):u},t.prototype.readFeatureElement=function(n,t){return this.readFeatureElementInternal(n,t,!0)},t.prototype.readPoint=function(n,t){var i=this.readFlatCoordinatesFromNode_(n,t);if(i)return new ei(i,v.XYZ)},t.prototype.readMultiPoint=function(n,t){var i=h([],this.MULTIPOINT_PARSERS_,n,t,this);if(i)return new pe(i)},t.prototype.readMultiLineString=function(n,t){var i=h([],this.MULTILINESTRING_PARSERS_,n,t,this);if(i)return new yf(i)},t.prototype.readMultiPolygon=function(n,t){var i=h([],this.MULTIPOLYGON_PARSERS_,n,t,this);if(i)return new we(i)},t.prototype.pointMemberParser_=function(n,t){vu(this.POINTMEMBER_PARSERS_,n,t,this)},t.prototype.lineStringMemberParser_=function(n,t){vu(this.LINESTRINGMEMBER_PARSERS_,n,t,this)},t.prototype.polygonMemberParser_=function(n,t){vu(this.POLYGONMEMBER_PARSERS_,n,t,this)},t.prototype.readLineString=function(n,t){var i=this.readFlatCoordinatesFromNode_(n,t);if(i)return new yi(i,v.XYZ)},t.prototype.readFlatLinearRing_=function(n,t){var i=h(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,n,t,this);return i||void 0},t.prototype.readLinearRing=function(n,t){var i=this.readFlatCoordinatesFromNode_(n,t);if(i)return new lh(i,v.XYZ)},t.prototype.readPolygon=function(n,t){var i=h([null],this.FLAT_LINEAR_RINGS_PARSERS,n,t,this),u,e,r,f;if(i&&i[0]){for(r=i[0],f=[r.length],u=1,e=i.length;u<e;++u)pt(r,i[u]),f.push(r.length);return new or(r,v.XYZ,f)}},t.prototype.readFlatCoordinatesFromNode_=function(n,t){return h(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,n,t,this)},t.prototype.readGeometryFromNode=function(n,t){var i=this.readGeometryElement(n,[this.getReadOptions(n,t||{})]);return i||null},t.prototype.readFeaturesFromNode=function(n,t){var i={featureType:this.featureType,featureNS:this.featureNS};return t&&nt(i,this.getReadOptions(n,t)),this.readFeaturesInternal(n,[i])||[]},t.prototype.readProjectionFromNode=function(n){return w(this.srsName?this.srsName:n.firstElementChild.getAttribute("srsName"))},t}(na);wi.prototype.namespace=be;wi.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}};wi.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}};wi.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}};wi.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:b(wi.prototype.pointMemberParser_),pointMembers:b(wi.prototype.pointMemberParser_)}};wi.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:b(wi.prototype.lineStringMemberParser_),lineStringMembers:b(wi.prototype.lineStringMemberParser_)}};wi.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:b(wi.prototype.polygonMemberParser_),polygonMembers:b(wi.prototype.polygonMemberParser_)}};wi.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:b(wi.prototype.readFlatCoordinatesFromNode_)}};wi.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:b(wi.prototype.readLineString)}};wi.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:b(wi.prototype.readPolygon)}};wi.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:tt(wi.prototype.readFlatLinearRing_)}};ct=wi;var ofi=be+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",sfi={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},k=function(n){function t(t){var i=t||{};n.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:ofi;this.hasZ=void 0!==i.hasZ&&i.hasZ}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readMultiCurve_=function(n,t){var i=h([],this.MULTICURVE_PARSERS_,n,t,this);if(i)return new yf(i)},t.prototype.readMultiSurface_=function(n,t){var i=h([],this.MULTISURFACE_PARSERS_,n,t,this);if(i)return new we(i)},t.prototype.curveMemberParser_=function(n,t){vu(this.CURVEMEMBER_PARSERS_,n,t,this)},t.prototype.surfaceMemberParser_=function(n,t){vu(this.SURFACEMEMBER_PARSERS_,n,t,this)},t.prototype.readPatch_=function(n,t){return h([null],this.PATCHES_PARSERS_,n,t,this)},t.prototype.readSegment_=function(n,t){return h([null],this.SEGMENTS_PARSERS_,n,t,this)},t.prototype.readPolygonPatch_=function(n,t){return h([null],this.FLAT_LINEAR_RINGS_PARSERS,n,t,this)},t.prototype.readLineStringSegment_=function(n,t){return h([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,n,t,this)},t.prototype.interiorParser_=function(n,t){var i=h(void 0,this.RING_PARSERS,n,t,this);i&&t[t.length-1].push(i)},t.prototype.exteriorParser_=function(n,t){var i=h(void 0,this.RING_PARSERS,n,t,this);i&&(t[t.length-1][0]=i)},t.prototype.readSurface_=function(n,t){var i=h([null],this.SURFACE_PARSERS_,n,t,this),u,e,r,f;if(i&&i[0]){for(r=i[0],f=[r.length],u=1,e=i.length;u<e;++u)pt(r,i[u]),f.push(r.length);return new or(r,v.XYZ,f)}},t.prototype.readCurve_=function(n,t){var i=h([null],this.CURVE_PARSERS_,n,t,this);if(i)return new yi(i,v.XYZ)},t.prototype.readEnvelope_=function(n,t){var i=h([null],this.ENVELOPE_PARSERS_,n,t,this);return ef(i[1][0],i[1][1],i[2][0],i[2][1])},t.prototype.readFlatPos_=function(n,t){for(var r,h,e,o,c,l,s,f,u=fu(n,!1),i=[];f=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/.exec(u);)i.push(parseFloat(f[1])),u=u.substr(f[0].length);if(""===u){if(e=t[0].srsName,o="enu",e&&(o=w(e).getAxisOrientation()),"neu"===o)for(r=0,h=i.length;r<h;r+=3)c=i[r],l=i[r+1],i[r]=l,i[r+1]=c;if(s=i.length,2==s&&i.push(0),0!==s)return i}},t.prototype.readFlatPosList_=function(n,t){var v=fu(n,!1).replace(/^\s*|\s*$/g,""),h=t[0],c=h.srsName,l=h.srsDimension,a="enu",f,e,o,r,i;c&&(a=w(c).getAxisOrientation());r=v.split(/\s+/);i=2;n.getAttribute("srsDimension")?i=eo(n.getAttribute("srsDimension")):n.getAttribute("dimension")?i=eo(n.getAttribute("dimension")):n.parentNode.getAttribute("srsDimension")?i=eo(n.parentNode.getAttribute("srsDimension")):l&&(i=eo(l));for(var s=[],u=0,y=r.length;u<y;u+=i)f=parseFloat(r[u]),e=parseFloat(r[u+1]),o=3===i?parseFloat(r[u+2]):0,"en"===a.substr(0,2)?s.push(f,e,o):s.push(e,f,o);return s},t.prototype.writePos_=function(n,t,i){var o=i[i.length-1],s=o.hasZ,h=s?"3":"2",u,f,e,r;n.setAttribute("srsDimension",h);u=o.srsName;f="enu";u&&(f=w(u).getAxisOrientation());r=t.getCoordinates();(e="en"===f.substr(0,2)?r[0]+" "+r[1]:r[1]+" "+r[0],s)&&(e+=" "+(r[2]||0));ut(n,e)},t.prototype.getCoords_=function(n,t,i){var u="enu",r;return t&&(u=w(t).getAxisOrientation()),r="en"===u.substr(0,2)?n[0]+" "+n[1]:n[1]+" "+n[0],i&&(r+=" "+(n[2]||0)),r},t.prototype.writePosList_=function(n,t,i){var u=i[i.length-1],f=u.hasZ,c=f?"3":"2";n.setAttribute("srsDimension",c);for(var e,l=u.srsName,o=t.getCoordinates(),s=o.length,h=new Array(s),r=0;r<s;++r)e=o[r],h[r]=this.getCoords_(e,l,f);ut(n,h.join(" "))},t.prototype.writePoint_=function(n,t,i){var u=i[i.length-1].srsName,r;u&&n.setAttribute("srsName",u);r=rt(n.namespaceURI,"pos");n.appendChild(r);this.writePos_(r,t,i)},t.prototype.writeEnvelope=function(n,t,i){var r=i[i.length-1].srsName,u;r&&n.setAttribute("srsName",r);u=[t[0]+" "+t[1],t[2]+" "+t[3]];it({node:n},this.ENVELOPE_SERIALIZERS_,hr,u,i,["lowerCorner","upperCorner"],this)},t.prototype.writeLinearRing_=function(n,t,i){var u=i[i.length-1].srsName,r;u&&n.setAttribute("srsName",u);r=rt(n.namespaceURI,"posList");n.appendChild(r);this.writePosList_(r,t,i)},t.prototype.RING_NODE_FACTORY_=function(n,t){var i=t[t.length-1],u=i.node,r=i.exteriorWritten;return void 0===r&&(i.exteriorWritten=!0),rt(u.namespaceURI,void 0!==r?"interior":"exterior")},t.prototype.writeSurfaceOrPolygon_=function(n,t,i){var f=i[i.length-1],o=f.hasZ,r=f.srsName,e,u;("PolygonPatch"!==n.nodeName&&r&&n.setAttribute("srsName",r),"Polygon"===n.nodeName||"PolygonPatch"===n.nodeName)?(e=t.getLinearRings(),it({node:n,hasZ:o,srsName:r},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,e,i,void 0,this)):"Surface"===n.nodeName&&(u=rt(n.namespaceURI,"patches"),n.appendChild(u),this.writeSurfacePatches_(u,t,i))},t.prototype.writeCurveOrLineString_=function(n,t,i){var f=i[i.length-1].srsName,r,u;("LineStringSegment"!==n.nodeName&&f&&n.setAttribute("srsName",f),"LineString"===n.nodeName||"LineStringSegment"===n.nodeName)?(r=rt(n.namespaceURI,"posList"),n.appendChild(r),this.writePosList_(r,t,i)):"Curve"===n.nodeName&&(u=rt(n.namespaceURI,"segments"),n.appendChild(u),this.writeCurveSegments_(u,t,i))},t.prototype.writeMultiSurfaceOrPolygon_=function(n,t,i){var r=i[i.length-1],e=r.hasZ,u=r.srsName,o=r.surface,f;u&&n.setAttribute("srsName",u);f=t.getPolygons();it({node:n,hasZ:e,srsName:u,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,f,i,void 0,this)},t.prototype.writeMultiPoint_=function(n,t,i){var u=i[i.length-1],r=u.srsName,e=u.hasZ,f;r&&n.setAttribute("srsName",r);f=t.getPoints();it({node:n,hasZ:e,srsName:r},this.POINTMEMBER_SERIALIZERS_,gt("pointMember"),f,i,void 0,this)},t.prototype.writeMultiCurveOrLineString_=function(n,t,i){var r=i[i.length-1],e=r.hasZ,u=r.srsName,o=r.curve,f;u&&n.setAttribute("srsName",u);f=t.getLineStrings();it({node:n,hasZ:e,srsName:u,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,f,i,void 0,this)},t.prototype.writeRing_=function(n,t,i){var r=rt(n.namespaceURI,"LinearRing");n.appendChild(r);this.writeLinearRing_(r,t,i)},t.prototype.writeSurfaceOrPolygonMember_=function(n,t,i){var r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(n.appendChild(r),this.writeSurfaceOrPolygon_(r,t,i))},t.prototype.writePointMember_=function(n,t,i){var r=rt(n.namespaceURI,"Point");n.appendChild(r);this.writePoint_(r,t,i)},t.prototype.writeLineStringOrCurveMember_=function(n,t,i){var r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(n.appendChild(r),this.writeCurveOrLineString_(r,t,i))},t.prototype.writeSurfacePatches_=function(n,t,i){var r=rt(n.namespaceURI,"PolygonPatch");n.appendChild(r);this.writeSurfaceOrPolygon_(r,t,i)},t.prototype.writeCurveSegments_=function(n,t,i){var r=rt(n.namespaceURI,"LineStringSegment");n.appendChild(r);this.writeCurveOrLineString_(r,t,i)},t.prototype.writeGeometryElement=function(n,t,i){var u,r=i[i.length-1],f=nt({},r);f.node=n;u=Array.isArray(t)?r.dataProjection?bo(t,r.featureProjection,r.dataProjection):t:si(t,!0,r);it(f,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[u],i,void 0,this)},t.prototype.writeFeatureElement=function(n,t,i){var h=t.getId(),u,o,s;h&&n.setAttribute("fid",h);var r=i[i.length-1],f=r.featureNS,v=t.getGeometryName();r.serializers||(r.serializers={},r.serializers[f]={});var c=t.getProperties(),l=[],a=[];for(u in c)o=c[u],null!==o&&(l.push(u),a.push(o),u==v||"function"==typeof o.getSimplifiedGeometry?u in r.serializers[f]||(r.serializers[f][u]=e(this.writeGeometryElement,this)):u in r.serializers[f]||(r.serializers[f][u]=e(ut)));s=nt({},r);s.node=n;it(s,r.serializers,gt(void 0,f),a,i,l)},t.prototype.writeFeatureMembers_=function(n,t,i){var r=i[i.length-1],s=r.featureType,u=r.featureNS,f={},o;f[u]={};f[u][s]=e(this.writeFeatureElement,this);o=nt({},r);o.node=n;it(o,f,gt(s,u),t,i)},t.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(n,t){var i=t[t.length-1].node;return rt(this.namespace,sfi[i.nodeName])},t.prototype.GEOMETRY_NODE_FACTORY_=function(n,t){var i,r=t[t.length-1],u=r.multiSurface,f=r.surface,e=r.curve,o=r.multiCurve;return Array.isArray(n)?i="Envelope":"MultiPolygon"===(i=n.getType())&&!0===u?i="MultiSurface":"Polygon"===i&&!0===f?i="Surface":"LineString"===i&&!0===e?i="Curve":"MultiLineString"===i&&!0===o&&(i="MultiCurve"),rt(this.namespace,i)},t.prototype.writeGeometryNode=function(n,t){t=this.adaptOptions(t);var i=rt(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 t&&nt(r,t),this.writeGeometryElement(i,n,[r]),i},t.prototype.writeFeaturesNode=function(n,t){var i,r;return t=this.adaptOptions(t),i=rt(this.namespace,"featureMembers"),i.setAttributeNS(hs,"xsi:schemaLocation",this.schemaLocation),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},t&&nt(r,t),this.writeFeatureMembers_(i,n,[r]),i},t}(ct);k.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:tt(k.prototype.readFlatPos_),posList:tt(k.prototype.readFlatPosList_)}};k.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:k.prototype.interiorParser_,exterior:k.prototype.exteriorParser_}};k.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:tt(ct.prototype.readPoint),MultiPoint:tt(ct.prototype.readMultiPoint),LineString:tt(ct.prototype.readLineString),MultiLineString:tt(ct.prototype.readMultiLineString),LinearRing:tt(ct.prototype.readLinearRing),Polygon:tt(ct.prototype.readPolygon),MultiPolygon:tt(ct.prototype.readMultiPolygon),Surface:tt(k.prototype.readSurface_),MultiSurface:tt(k.prototype.readMultiSurface_),Curve:tt(k.prototype.readCurve_),MultiCurve:tt(k.prototype.readMultiCurve_),Envelope:tt(k.prototype.readEnvelope_)}};k.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:b(k.prototype.curveMemberParser_),curveMembers:b(k.prototype.curveMemberParser_)}};k.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:b(k.prototype.surfaceMemberParser_),surfaceMembers:b(k.prototype.surfaceMemberParser_)}};k.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:b(ct.prototype.readLineString),Curve:b(k.prototype.readCurve_)}};k.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:b(ct.prototype.readPolygon),Surface:b(k.prototype.readSurface_)}};k.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:tt(k.prototype.readPatch_)}};k.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:tt(k.prototype.readSegment_)}};k.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:b(k.prototype.readFlatPosList_),upperCorner:b(k.prototype.readFlatPosList_)}};k.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:tt(k.prototype.readPolygonPatch_)}};k.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:tt(k.prototype.readLineStringSegment_)}};k.prototype.writeFeatures;k.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:e(k.prototype.writeRing_),interior:e(k.prototype.writeRing_)}};k.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:e(ut),upperCorner:e(ut)}};k.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:e(k.prototype.writeSurfaceOrPolygonMember_),polygonMember:e(k.prototype.writeSurfaceOrPolygonMember_)}};k.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:e(k.prototype.writePointMember_)}};k.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:e(k.prototype.writeLineStringOrCurveMember_),curveMember:e(k.prototype.writeLineStringOrCurveMember_)}};k.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:e(k.prototype.writeCurveOrLineString_),MultiCurve:e(k.prototype.writeMultiCurveOrLineString_),Point:e(k.prototype.writePoint_),MultiPoint:e(k.prototype.writeMultiPoint_),LineString:e(k.prototype.writeCurveOrLineString_),MultiLineString:e(k.prototype.writeMultiCurveOrLineString_),LinearRing:e(k.prototype.writeLinearRing_),Polygon:e(k.prototype.writeSurfaceOrPolygon_),MultiPolygon:e(k.prototype.writeMultiSurfaceOrPolygon_),Surface:e(k.prototype.writeSurfaceOrPolygon_),MultiSurface:e(k.prototype.writeMultiSurfaceOrPolygon_),Envelope:e(k.prototype.writeEnvelope)}};et=k;uk=et;uk.prototype.writeFeatures;uk.prototype.writeFeaturesNode;var hfi=uk,cfi=be+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",lfi={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},vt=function(n){function t(t){var i=t||{};n.call(this,i);this.FEATURE_COLLECTION_PARSERS[be].featureMember=b(this.readFeaturesInternal);this.schemaLocation=i.schemaLocation?i.schemaLocation:cfi}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFlatCoordinates_=function(n,t){var a=fu(n,!1).replace(/^\s*|\s*$/g,""),e=t[0].srsName,o="enu",r;e&&(r=w(e),r&&(o=r.getAxisOrientation()));for(var s=a.trim().split(/\s+/),u=[],f=0,v=s.length;f<v;f++){var i=s[f].split(/,+/),h=parseFloat(i[0]),c=parseFloat(i[1]),l=3===i.length?parseFloat(i[2]):0;"en"===o.substr(0,2)?u.push(h,c,l):u.push(c,h,l)}return u},t.prototype.readBox_=function(n,t){var i=h([null],this.BOX_PARSERS_,n,t,this);return ef(i[1][0],i[1][1],i[1][3],i[1][4])},t.prototype.innerBoundaryIsParser_=function(n,t){var i=h(void 0,this.RING_PARSERS,n,t,this);i&&t[t.length-1].push(i)},t.prototype.outerBoundaryIsParser_=function(n,t){var i=h(void 0,this.RING_PARSERS,n,t,this);i&&(t[t.length-1][0]=i)},t.prototype.GEOMETRY_NODE_FACTORY_=function(n,t){var i,r=t[t.length-1],u=r.multiSurface,f=r.surface,e=r.multiCurve;return Array.isArray(n)?i="Envelope":"MultiPolygon"===(i=n.getType())&&!0===u?i="MultiSurface":"Polygon"===i&&!0===f?i="Surface":"MultiLineString"===i&&!0===e&&(i="MultiCurve"),rt("http://www.opengis.net/gml",i)},t.prototype.writeFeatureElement=function(n,t,i){var h=t.getId(),u,o,s;h&&n.setAttribute("fid",h);var r=i[i.length-1],f=r.featureNS,v=t.getGeometryName();r.serializers||(r.serializers={},r.serializers[f]={});var c=t.getProperties(),l=[],a=[];for(u in c)o=c[u],null!==o&&(l.push(u),a.push(o),u==v||"function"==typeof o.getSimplifiedGeometry?u in r.serializers[f]||(r.serializers[f][u]=e(this.writeGeometryElement,this)):u in r.serializers[f]||(r.serializers[f][u]=e(ut)));s=nt({},r);s.node=n;it(s,r.serializers,gt(void 0,f),a,i,l)},t.prototype.writeCurveOrLineString_=function(n,t,i){var f=i[i.length-1].srsName,r,u;("LineStringSegment"!==n.nodeName&&f&&n.setAttribute("srsName",f),"LineString"===n.nodeName||"LineStringSegment"===n.nodeName)?(r=this.createCoordinatesNode_(n.namespaceURI),n.appendChild(r),this.writeCoordinates_(r,t,i)):"Curve"===n.nodeName&&(u=rt(n.namespaceURI,"segments"),n.appendChild(u),this.writeCurveSegments_(u,t,i))},t.prototype.writeLineStringOrCurveMember_=function(n,t,i){var r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(n.appendChild(r),this.writeCurveOrLineString_(r,t,i))},t.prototype.writeMultiCurveOrLineString_=function(n,t,i){var r=i[i.length-1],e=r.hasZ,u=r.srsName,o=r.curve,f;u&&n.setAttribute("srsName",u);f=t.getLineStrings();it({node:n,hasZ:e,srsName:u,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,f,i,void 0,this)},t.prototype.writeGeometryElement=function(n,t,i){var u,r=i[i.length-1],f=nt({},r);f.node=n;u=Array.isArray(t)?r.dataProjection?bo(t,r.featureProjection,r.dataProjection):t:si(t,!0,r);it(f,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[u],i,void 0,this)},t.prototype.createCoordinatesNode_=function(n){var t=rt(n,"coordinates");return t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," "),t},t.prototype.writeCoordinates_=function(n,t,i){for(var s,u=i[i.length-1],h=u.hasZ,c=u.srsName,f=t.getCoordinates(),e=f.length,o=new Array(e),r=0;r<e;++r)s=f[r],o[r]=this.getCoords_(s,c,h);ut(n,o.join(" "))},t.prototype.writeCurveSegments_=function(n,t,i){var r=rt(n.namespaceURI,"LineStringSegment");n.appendChild(r);this.writeCurveOrLineString_(r,t,i)},t.prototype.writeSurfaceOrPolygon_=function(n,t,i){var f=i[i.length-1],o=f.hasZ,r=f.srsName,e,u;("PolygonPatch"!==n.nodeName&&r&&n.setAttribute("srsName",r),"Polygon"===n.nodeName||"PolygonPatch"===n.nodeName)?(e=t.getLinearRings(),it({node:n,hasZ:o,srsName:r},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,e,i,void 0,this)):"Surface"===n.nodeName&&(u=rt(n.namespaceURI,"patches"),n.appendChild(u),this.writeSurfacePatches_(u,t,i))},t.prototype.RING_NODE_FACTORY_=function(n,t){var i=t[t.length-1],u=i.node,r=i.exteriorWritten;return void 0===r&&(i.exteriorWritten=!0),rt(u.namespaceURI,void 0!==r?"innerBoundaryIs":"outerBoundaryIs")},t.prototype.writeSurfacePatches_=function(n,t,i){var r=rt(n.namespaceURI,"PolygonPatch");n.appendChild(r);this.writeSurfaceOrPolygon_(r,t,i)},t.prototype.writeRing_=function(n,t,i){var r=rt(n.namespaceURI,"LinearRing");n.appendChild(r);this.writeLinearRing_(r,t,i)},t.prototype.getCoords_=function(n,t,i){var u="enu",r;return t&&(u=w(t).getAxisOrientation()),r="en"===u.substr(0,2)?n[0]+","+n[1]:n[1]+","+n[0],i&&(r+=","+(n[2]||0)),r},t.prototype.writePoint_=function(n,t,i){var f=i[i.length-1],o=f.hasZ,r=f.srsName,u,e;r&&n.setAttribute("srsName",r);u=this.createCoordinatesNode_(n.namespaceURI);n.appendChild(u);e=t.getCoordinates();ut(u,this.getCoords_(e,r,o))},t.prototype.writeMultiPoint_=function(n,t,i){var u=i[i.length-1],e=u.hasZ,r=u.srsName,f;r&&n.setAttribute("srsName",r);f=t.getPoints();it({node:n,hasZ:e,srsName:r},this.POINTMEMBER_SERIALIZERS_,gt("pointMember"),f,i,void 0,this)},t.prototype.writePointMember_=function(n,t,i){var r=rt(n.namespaceURI,"Point");n.appendChild(r);this.writePoint_(r,t,i)},t.prototype.writeLinearRing_=function(n,t,i){var u=i[i.length-1].srsName,r;u&&n.setAttribute("srsName",u);r=this.createCoordinatesNode_(n.namespaceURI);n.appendChild(r);this.writeCoordinates_(r,t,i)},t.prototype.writeMultiSurfaceOrPolygon_=function(n,t,i){var r=i[i.length-1],e=r.hasZ,u=r.srsName,o=r.surface,f;u&&n.setAttribute("srsName",u);f=t.getPolygons();it({node:n,hasZ:e,srsName:u,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,f,i,void 0,this)},t.prototype.writeSurfaceOrPolygonMember_=function(n,t,i){var r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(n.appendChild(r),this.writeSurfaceOrPolygon_(r,t,i))},t.prototype.writeEnvelope=function(n,t,i){var r=i[i.length-1].srsName,u;r&&n.setAttribute("srsName",r);u=[t[0]+" "+t[1],t[2]+" "+t[3]];it({node:n},this.ENVELOPE_SERIALIZERS_,hr,u,i,["lowerCorner","upperCorner"],this)},t.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(n,t){var i=t[t.length-1].node;return rt("http://www.opengis.net/gml",lfi[i.nodeName])},t}(ct);vt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:tt(vt.prototype.readFlatCoordinates_)}};vt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:vt.prototype.innerBoundaryIsParser_,outerBoundaryIs:vt.prototype.outerBoundaryIsParser_}};vt.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:b(vt.prototype.readFlatCoordinates_)}};vt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:tt(ct.prototype.readPoint),MultiPoint:tt(ct.prototype.readMultiPoint),LineString:tt(ct.prototype.readLineString),MultiLineString:tt(ct.prototype.readMultiLineString),LinearRing:tt(ct.prototype.readLinearRing),Polygon:tt(ct.prototype.readPolygon),MultiPolygon:tt(ct.prototype.readMultiPolygon),Box:tt(vt.prototype.readBox_)}};vt.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:e(vt.prototype.writeCurveOrLineString_),MultiCurve:e(vt.prototype.writeMultiCurveOrLineString_),Point:e(vt.prototype.writePoint_),MultiPoint:e(vt.prototype.writeMultiPoint_),LineString:e(vt.prototype.writeCurveOrLineString_),MultiLineString:e(vt.prototype.writeMultiCurveOrLineString_),LinearRing:e(vt.prototype.writeLinearRing_),Polygon:e(vt.prototype.writeSurfaceOrPolygon_),MultiPolygon:e(vt.prototype.writeMultiSurfaceOrPolygon_),Surface:e(vt.prototype.writeSurfaceOrPolygon_),MultiSurface:e(vt.prototype.writeMultiSurfaceOrPolygon_),Envelope:e(vt.prototype.writeEnvelope)}};vt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:e(vt.prototype.writeLineStringOrCurveMember_),curveMember:e(vt.prototype.writeLineStringOrCurveMember_)}};vt.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{outerBoundaryIs:e(vt.prototype.writeRing_),innerBoundaryIs:e(vt.prototype.writeRing_)}};vt.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:e(vt.prototype.writePointMember_)}};vt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:e(vt.prototype.writeSurfaceOrPolygonMember_),polygonMember:e(vt.prototype.writeSurfaceOrPolygonMember_)}};vt.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:e(ut),upperCorner:e(ut)}};oy=vt;bt=function(n){function t(t){var i=t||{};n.call(this,i);this.schemaLocation=i.schemaLocation?i.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(et);bt.prototype.namespace="http://www.opengis.net/gml/3.2";bt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:tt(et.prototype.readFlatPos_),posList:tt(et.prototype.readFlatPosList_)}};bt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:et.prototype.interiorParser_,exterior:et.prototype.exteriorParser_}};bt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:tt(ct.prototype.readPoint),MultiPoint:tt(ct.prototype.readMultiPoint),LineString:tt(ct.prototype.readLineString),MultiLineString:tt(ct.prototype.readMultiLineString),LinearRing:tt(ct.prototype.readLinearRing),Polygon:tt(ct.prototype.readPolygon),MultiPolygon:tt(ct.prototype.readMultiPolygon),Surface:tt(bt.prototype.readSurface_),MultiSurface:tt(et.prototype.readMultiSurface_),Curve:tt(bt.prototype.readCurve_),MultiCurve:tt(et.prototype.readMultiCurve_),Envelope:tt(bt.prototype.readEnvelope_)}};bt.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{curveMember:b(et.prototype.curveMemberParser_),curveMembers:b(et.prototype.curveMemberParser_)}};bt.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:b(et.prototype.surfaceMemberParser_),surfaceMembers:b(et.prototype.surfaceMemberParser_)}};bt.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:b(ct.prototype.readLineString),Curve:b(et.prototype.readCurve_)}};bt.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:b(ct.prototype.readPolygon),Surface:b(et.prototype.readSurface_)}};bt.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{patches:tt(et.prototype.readPatch_)}};bt.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{segments:tt(et.prototype.readSegment_)}};bt.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:b(et.prototype.readFlatPosList_),upperCorner:b(et.prototype.readFlatPosList_)}};bt.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml/3.2":{PolygonPatch:tt(et.prototype.readPolygonPatch_)}};bt.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml/3.2":{LineStringSegment:tt(et.prototype.readLineStringSegment_)}};bt.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml/3.2":{pointMember:b(ct.prototype.pointMemberParser_),pointMembers:b(ct.prototype.pointMemberParser_)}};bt.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:b(ct.prototype.lineStringMemberParser_),lineStringMembers:b(ct.prototype.lineStringMemberParser_)}};bt.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml/3.2":{polygonMember:b(ct.prototype.polygonMemberParser_),polygonMembers:b(ct.prototype.polygonMemberParser_)}};bt.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Point:b(ct.prototype.readFlatCoordinatesFromNode_)}};bt.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:b(ct.prototype.readLineString)}};bt.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:b(ct.prototype.readPolygon)}};bt.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:tt(ct.prototype.readFlatLinearRing_)}};bt.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{exterior:e(et.prototype.writeRing_),interior:e(et.prototype.writeRing_)}};bt.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:e(ut),upperCorner:e(ut)}};bt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:e(et.prototype.writeSurfaceOrPolygonMember_),polygonMember:e(et.prototype.writeSurfaceOrPolygonMember_)}};bt.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{pointMember:e(et.prototype.writePointMember_)}};bt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:e(et.prototype.writeLineStringOrCurveMember_),curveMember:e(et.prototype.writeLineStringOrCurveMember_)}};bt.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{Curve:e(et.prototype.writeCurveOrLineString_),MultiCurve:e(et.prototype.writeMultiCurveOrLineString_),Point:e(bt.prototype.writePoint_),MultiPoint:e(et.prototype.writeMultiPoint_),LineString:e(et.prototype.writeCurveOrLineString_),MultiLineString:e(et.prototype.writeMultiCurveOrLineString_),LinearRing:e(et.prototype.writeLinearRing_),Polygon:e(et.prototype.writeSurfaceOrPolygon_),MultiPolygon:e(et.prototype.writeMultiSurfaceOrPolygon_),Surface:e(et.prototype.writeSurfaceOrPolygon_),MultiSurface:e(et.prototype.writeMultiSurfaceOrPolygon_),Envelope:e(et.prototype.writeEnvelope)}};var afi=bt,gi=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],vfi={rte:iat,trk:rat,wpt:uat},yfi=s(gi,{rte:b(iat),trk:b(rat),wpt:b(uat)}),pfi=s(gi,{text:u(l,"linkText"),type:u(l,"linkType")}),wfi=s(gi,{rte:e(function(n,t,i){var h=i[0],r=t.getProperties(),u={node:n},e,o;u.properties=r;e=t.getGeometry();e.getType()==f.LINE_STRING&&(o=si(e,!0,h),u.geometryLayout=o.getLayout(),r.rtept=o.getCoordinates());var c=i[i.length-1].node,s=fei[c.namespaceURI],l=nf(r,s);it(u,eei,hr,l,i,s)}),trk:e(function(n,t,i){var h=i[0],r=t.getProperties(),e={node:n},u,o;e.properties=r;u=t.getGeometry();u.getType()==f.MULTI_LINE_STRING&&(o=si(u,!0,h),r.trkseg=o.getLineStrings());var c=i[i.length-1].node,s=sei[c.namespaceURI],l=nf(r,s);it(e,hei,hr,l,i,s)}),wpt:e(function(n,t,i){var o=i[0],e=i[i.length-1],r,u;e.properties=t.getProperties();r=t.getGeometry();r.getType()==f.POINT&&(u=si(r,!0,o),e.geometryLayout=u.getLayout(),uit(n,u.getCoordinates(),i))})}),bfi=function(n){function t(t){n.call(this);var i=t||{};this.dataProjection=w("EPSG:4326");this.readExtensions_=i.readExtensions}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleReadExtensions_=function(n){var t,r,i,u;for(n||(n=[]),t=0,r=n.length;t<r;++t)i=n[t],this.readExtensions_&&(u=i.get("extensionsNode_")||null,this.readExtensions_(i,u)),i.set("extensionsNode_",void 0)},t.prototype.readFeatureFromNode=function(n,t){var r,i;return tr(gi,n.namespaceURI)?(r=vfi[n.localName],!r)?null:(i=r(n,[this.getReadOptions(n,t)]),i?(this.handleReadExtensions_([i]),i):null):null},t.prototype.readFeaturesFromNode=function(n,t){if(!tr(gi,n.namespaceURI))return[];if("gpx"==n.localName){var i=h([],yfi,n,[this.getReadOptions(n,t)]);return i?(this.handleReadExtensions_(i),i):[]}return[]},t.prototype.writeFeaturesNode=function(n,t){t=this.adaptOptions(t);var i=rt("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",hs),i.setAttributeNS(hs,"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"),it({node:i},wfi,pei,n,[t]),i},t}(na),kfi=s(gi,{name:u(l),cmt:u(l),desc:u(l),src:u(l),link:tit,number:u(cr),extensions:iit,type:u(l),rtept:function(n,t){var i=h({},dfi,n,t);if(i){var r=t[t.length-1],u=r.flatCoordinates,f=r.layoutOptions;gtt(u,f,n,i)}}}),dfi=s(gi,{ele:u(yt),time:u(dtt)}),gfi=s(gi,{name:u(l),cmt:u(l),desc:u(l),src:u(l),link:tit,number:u(cr),type:u(l),extensions:iit,trkseg:function(n,t){var i=t[t.length-1],r;vu(nei,n,t);r=i.flatCoordinates;i.ends.push(r.length)}}),nei=s(gi,{trkpt:function(n,t){var i=h({},tei,n,t);if(i){var r=t[t.length-1],u=r.flatCoordinates,f=r.layoutOptions;gtt(u,f,n,i)}}}),tei=s(gi,{ele:u(yt),time:u(dtt)}),iei=s(gi,{ele:u(yt),time:u(dtt),magvar:u(yt),geoidheight:u(yt),name:u(l),cmt:u(l),desc:u(l),src:u(l),link:tit,sym:u(l),type:u(l),fix:u(l),sat:u(cr),hdop:u(yt),vdop:u(yt),pdop:u(yt),ageofdgpsdata:u(yt),dgpsid:u(cr),extensions:iit}),rei=["text","type"],uei=s(gi,{text:e(ut),type:e(ut)}),fei=s(gi,["name","cmt","desc","src","link","number","type","rtept"]),eei=s(gi,{name:e(ut),cmt:e(ut),desc:e(ut),src:e(ut),link:e(rit),number:e(rk),type:e(ut),rtept:oct(e(uit))}),oei=s(gi,["ele","time"]),sei=s(gi,["name","cmt","desc","src","link","number","type","trkseg"]),hei=s(gi,{name:e(ut),cmt:e(ut),desc:e(ut),src:e(ut),link:e(rit),number:e(rk),type:e(ut),trkseg:oct(e(function(n,t,i){var r={node:n};r.geometryLayout=t.getLayout();r.properties={};it(r,lei,cei,t.getCoordinates(),i)}))}),cei=gt("trkpt"),lei=s(gi,{trkpt:e(uit)}),aei=s(gi,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),vei=s(gi,{ele:e(yu),time:e(function(n,t){var i=new Date(1e3*t),r=i.getUTCFullYear()+"-"+ah(i.getUTCMonth()+1,2)+"-"+ah(i.getUTCDate(),2)+"T"+ah(i.getUTCHours(),2)+":"+ah(i.getUTCMinutes(),2)+":"+ah(i.getUTCSeconds(),2)+"Z";n.appendChild(fc.createTextNode(r))}),magvar:e(yu),geoidheight:e(yu),name:e(ut),cmt:e(ut),desc:e(ut),src:e(ut),link:e(rit),sym:e(ut),type:e(ut),fix:e(ut),sat:e(rk),hdop:e(yu),vdop:e(yu),pdop:e(yu),ageofdgpsdata:e(yu),dgpsid:e(rk)}),yei={Point:"wpt",LineString:"rte",MultiLineString:"trk"};fat=bfi;eat=function(n){function t(t){var i=t||{};n.call(this);this.dataProjection=w(i.dataProjection?i.dataProjection:"EPSG:4326");i.featureProjection&&(this.defaultFeatureProjection=w(i.featureProjection));this.geometryName_=i.geometryName;this.extractGeometryName_=i.extractGeometryName}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeatureFromObject=function(n,t){var i=null,u=fit((i="Feature"===n.type?n:{type:"Feature",geometry:n,properties:null}).geometry,t),r=new fi;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&r.setGeometryName(i.geometry_name),r.setGeometry(u),"id"in i&&r.setId(i.id),i.properties&&r.setProperties(i.properties),r},t.prototype.readFeaturesFromObject=function(n,t){var i=null;if("FeatureCollection"===n.type){i=[];for(var u=n.features,r=0,f=u.length;r<f;++r)i.push(this.readFeatureFromObject(u[r],t))}else i=[this.readFeatureFromObject(n,t)];return i},t.prototype.readGeometryFromObject=function(n,t){return fit(n,t)},t.prototype.readProjectionFromObject=function(n){var t,i=n.crs;return i?"name"==i.type?t=w(i.properties.name):g(!1,36):t=this.dataProjection,t},t.prototype.writeFeatureObject=function(n,t){var i,u,f,r;return t=this.adaptOptions(t),i={type:"Feature",geometry:null,properties:null},u=n.getId(),void 0!==u&&(i.id=u),f=n.getGeometry(),f&&(i.geometry=eit(f,t)),r=n.getProperties(),delete r[n.getGeometryName()],wu(r)||(i.properties=r),i},t.prototype.writeFeaturesObject=function(n,t){t=this.adaptOptions(t);for(var r=[],i=0,u=n.length;i<u;++i)r.push(this.writeFeatureObject(n[i],t));return{type:"FeatureCollection",features:r}},t.prototype.writeGeometryObject=function(n,t){return eit(n,this.adaptOptions(t))},t}(tk);var sy,oit,sit,hit,ek,hy,cit,lit=function(n){function t(){n.call(this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getType=function(){return ro.TEXT},t.prototype.readFeature=function(n,t){return this.readFeatureFromText(fk(n),this.adaptOptions(t))},t.prototype.readFeatureFromText=function(){return p()},t.prototype.readFeatures=function(n,t){return this.readFeaturesFromText(fk(n),this.adaptOptions(t))},t.prototype.readFeaturesFromText=function(){return p()},t.prototype.readGeometry=function(n,t){return this.readGeometryFromText(fk(n),this.adaptOptions(t))},t.prototype.readGeometryFromText=function(){return p()},t.prototype.readProjection=function(n){return this.readProjectionFromText(fk(n))},t.prototype.readProjectionFromText=function(){return this.dataProjection},t.prototype.writeFeature=function(n,t){return this.writeFeatureText(n,this.adaptOptions(t))},t.prototype.writeFeatureText=function(){return p()},t.prototype.writeFeatures=function(n,t){return this.writeFeaturesText(n,this.adaptOptions(t))},t.prototype.writeFeaturesText=function(){return p()},t.prototype.writeGeometry=function(n,t){return this.writeGeometryText(n,this.adaptOptions(t))},t.prototype.writeGeometryText=function(){return p()},t}(dl),cy={BAROMETRIC:"barometric",GPS:"gps",NONE:"none"},wei=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,bei=/^H.([A-Z]{3}).*?:(.*)/,kei=/^HFDTE(\d{2})(\d{2})(\d{2})/,dei=/\r\n|\r|\n/,gei=function(n){function t(t){n.call(this);var i=t||{};this.dataProjection=w("EPSG:4326");this.altitudeMode_=i.altitudeMode?i.altitudeMode:cy.NONE}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeatureFromText=function(n,t){for(var o=this.altitudeMode_,w=n.split(dei),b={},u=[],h=2e3,c=0,l=1,k=-1,r,i,s,y,f,e=0,p=w.length;e<p;++e)if(r=w[e],i=void 0,"B"==r.charAt(0)){if(i=wei.exec(r)){var d=parseInt(i[1],10),g=parseInt(i[2],10),nt=parseInt(i[3],10),a=parseInt(i[4],10)+parseInt(i[5],10)/6e4;"S"==i[6]&&(a=-a);s=parseInt(i[7],10)+parseInt(i[8],10)/6e4;("W"==i[9]&&(s=-s),u.push(s,a),o!=cy.NONE)&&(y=void 0,y=o==cy.GPS?parseInt(i[11],10):o==cy.BAROMETRIC?parseInt(i[12],10):0,u.push(y));f=Date.UTC(h,c,l,d,g,nt);f<k&&(f=Date.UTC(h,c,l+1,d,g,nt));u.push(f/1e3);k=f}}else"H"==r.charAt(0)&&((i=kei.exec(r))?(l=parseInt(i[1],10),c=parseInt(i[2],10)-1,h=2e3+parseInt(i[3],10)):(i=bei.exec(r))&&(b[i[1]]=i[2].trim()));if(0===u.length)return null;var it=o==cy.NONE?v.XYM:v.XYZM,rt=new yi(u,it),tt=new fi(si(rt,!1,t));return tt.setProperties(b),tt},t.prototype.readFeaturesFromText=function(n,t){var i=this.readFeatureFromText(n,t);return i?[i]:[]},t}(lit),oo=["http://www.google.com/kml/ext/2.2"],d=[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"],oat={fraction:eu.FRACTION,pixels:eu.PIXELS,insetPixels:eu.PIXELS},noi=s(d,{ExtendedData:hvt,Region:cvt,MultiGeometry:u(ivt,"geometry"),LineString:u(gat,"geometry"),LinearRing:u(nvt,"geometry"),Point:u(rvt,"geometry"),Polygon:u(fvt,"geometry"),Style:u(git),StyleMap:function(n,t){var i=vat(n,t),r;i&&(r=t[t.length-1],Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:g(!1,38))},address:u(l),description:u(l),name:u(l),open:u(bs),phoneNumber:u(l),styleUrl:u(sk),visibility:u(bs)},s(oo,{MultiTrack:u(function(n,t){var i=h([],pat,n,t);if(i)return new yf(i)},"geometry"),Track:u(bat,"geometry")})),toi=s(d,{ExtendedData:hvt,Region:cvt,Link:function(n,t){vu(ioi,n,t)},address:u(l),description:u(l),name:u(l),open:u(bs),phoneNumber:u(l),visibility:u(bs)}),ioi=s(d,{href:u(sk)}),sat=s(d,{LatLonAltBox:function(n,t){var i=h({},voi,n,t),r,u;i&&(r=t[t.length-1],u=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)],r.extent=u,r.altitudeMode=i.altitudeMode,r.minAltitude=parseFloat(i.minAltitude),r.maxAltitude=parseFloat(i.maxAltitude))},Lod:function(n,t){var i=h({},yoi,n,t),r;i&&(r=t[t.length-1],r.minLodPixels=parseFloat(i.minLodPixels),r.maxLodPixels=parseFloat(i.maxLodPixels),r.minFadeExtent=parseFloat(i.minFadeExtent),r.maxFadeExtent=parseFloat(i.maxFadeExtent))}}),roi=s(d,["Document","Placemark"]),uoi=s(d,{Document:e(function(n,t,i){it({node:n},boi,koi,t,i,void 0,this)}),Placemark:e(bvt)}),ok=null,ait,vit=null,yit,pit=null,cc=null,hat=null,wit=null,foi=function(n){function t(t){n.call(this);var i=t||{};wit||(ok=new te({color:sy=[255,255,255,1]}),oit=[20,2],sit=eu.PIXELS,hit=eu.PIXELS,ek=[64,64],hy="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",cit=.5,vit=new vb({anchor:oit,anchorOrigin:ur.BOTTOM_LEFT,anchorXUnits:sit,anchorYUnits:hit,crossOrigin:"anonymous",rotation:0,scale:cit,size:ek,src:hy}),ait="NO_IMAGE",pit=new hf({color:sy,width:1}),yit=new hf({color:[51,51,51,1],width:2}),cc=new nv({font:"bold 16px Helvetica",fill:ok,stroke:yit,scale:.8}),hat=new wl({fill:ok,image:vit,text:cc,stroke:pit,zIndex:0}),wit=[hat]);this.dataProjection=w("EPSG:4326");this.defaultStyle_=i.defaultStyle?i.defaultStyle:wit;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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readDocumentOrFolder_=function(n,t){var i=h([],s(d,{Document:ect(this.readDocumentOrFolder_,this),Folder:ect(this.readDocumentOrFolder_,this),Placemark:b(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),n,t,this);return i||void 0},t.prototype.readPlacemark_=function(n,t){var i=h({geometry:null},noi,n,t),r,e,o,u,s;if(i)return r=new fi,e=n.getAttribute("id"),null!==e&&r.setId(e),o=t[0],u=i.geometry,(u&&si(u,!1,o),r.setGeometry(u),delete i.geometry,this.extractStyles_)&&(s=function(n,t,i,r,u){return function(e){var s,o=u,h="",l,c;return(o&&(l=e.getGeometry(),l&&(o=l.getType()===f.POINT)),o&&(h=e.get("name"),o=o&&!!h),n)?o?(s=bit(n[0],h),n.concat(s)):n:t?(c=function n(t,i,r){return Array.isArray(t)?t:"string"==typeof t?(!(t in r)&&"#"+t in r&&(t="#"+t),n(r[t],i,r)):i}(t,i,r),o?(s=bit(c[0],h),c.concat(s)):c):o?(s=bit(i[0],h),i.concat(s)):i}}(i.Style,i.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_),r.setStyle(s)),delete i.Style,r.setProperties(i),r},t.prototype.readSharedStyle_=function(n,t){var r=n.getAttribute("id"),u,f,i;null!==r&&(u=git(n,t),u&&(i=n.baseURI,f=(i&&"about:blank"!=i||(i=window.location.href),i)?new URL("#"+r,i).href:"#"+r,this.sharedStyles_[f]=u))},t.prototype.readSharedStyleMap_=function(n,t){var r=n.getAttribute("id"),u,f,i;null!==r&&(u=vat(n,t),u&&(i=n.baseURI,f=(i&&"about:blank"!=i||(i=window.location.href),i)?new URL("#"+r,i).href:"#"+r,this.sharedStyles_[f]=u))},t.prototype.readFeatureFromNode=function(n,t){if(!tr(d,n.namespaceURI))return null;var i=this.readPlacemark_(n,[this.getReadOptions(n,t)]);return i||null},t.prototype.readFeaturesFromNode=function(n,t){var u,i,f,r,e;if(!tr(d,n.namespaceURI))return[];if(i=n.localName,"Document"==i||"Folder"==i)return(u=this.readDocumentOrFolder_(n,[this.getReadOptions(n,t)]))||[];if("Placemark"==i)return f=this.readPlacemark_(n,[this.getReadOptions(n,t)]),f?[f]:[];if("kml"==i){for(u=[],r=n.firstElementChild;r;r=r.nextElementSibling)e=this.readFeaturesFromNode(r,t),e&&pt(u,e);return u}return[]},t.prototype.readName=function(n){if(n){if("string"==typeof n){var t=ue(n);return this.readNameFromDocument(t)}return ye(n)?this.readNameFromDocument(n):this.readNameFromNode(n)}},t.prototype.readNameFromDocument=function(n){for(var i,t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE&&(i=this.readNameFromNode(t),i))return i},t.prototype.readNameFromNode=function(n){for(var i,r,u,t=n.firstElementChild;t;t=t.nextElementSibling)if(tr(d,t.namespaceURI)&&"name"==t.localName)return l(t);for(i=n.firstElementChild;i;i=i.nextElementSibling)if(r=i.localName,tr(d,i.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)&&(u=this.readNameFromNode(i),u))return u},t.prototype.readNetworkLinks=function(n){var t=[],i;return"string"==typeof n?(i=ue(n),pt(t,this.readNetworkLinksFromDocument(i))):ye(n)?pt(t,this.readNetworkLinksFromDocument(n)):pt(t,this.readNetworkLinksFromNode(n)),t},t.prototype.readNetworkLinksFromDocument=function(n){for(var i=[],t=n.firstChild;t;t=t.nextSibling)t.nodeType==Node.ELEMENT_NODE&&pt(i,this.readNetworkLinksFromNode(t));return i},t.prototype.readNetworkLinksFromNode=function(n){for(var f,i,u,r=[],t=n.firstElementChild;t;t=t.nextElementSibling)tr(d,t.namespaceURI)&&"NetworkLink"==t.localName&&(f=h({},toi,t,[]),r.push(f));for(i=n.firstElementChild;i;i=i.nextElementSibling)u=i.localName,tr(d,i.namespaceURI)&&("Document"==u||"Folder"==u||"kml"==u)&&pt(r,this.readNetworkLinksFromNode(i));return r},t.prototype.readRegion=function(n){var t=[],i;return"string"==typeof n?(i=ue(n),pt(t,this.readRegionFromDocument(i))):ye(n)?pt(t,this.readRegionFromDocument(n)):pt(t,this.readRegionFromNode(n)),t},t.prototype.readRegionFromDocument=function(n){for(var i=[],t=n.firstChild;t;t=t.nextSibling)t.nodeType==Node.ELEMENT_NODE&&pt(i,this.readRegionFromNode(t));return i},t.prototype.readRegionFromNode=function(n){for(var f,i,u,r=[],t=n.firstElementChild;t;t=t.nextElementSibling)tr(d,t.namespaceURI)&&"Region"==t.localName&&(f=h({},sat,t,[]),r.push(f));for(i=n.firstElementChild;i;i=i.nextElementSibling)u=i.localName,tr(d,i.namespaceURI)&&("Document"==u||"Folder"==u||"kml"==u)&&pt(r,this.readRegionFromNode(i));return r},t.prototype.writeFeaturesNode=function(n,t){var i,u,e,r,f,o;return t=this.adaptOptions(t),i=rt(d[4],"kml"),u="http://www.w3.org/2000/xmlns/",i.setAttributeNS(u,"xmlns:gx",oo[0]),i.setAttributeNS(u,"xmlns:xsi",hs),i.setAttributeNS(hs,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd"),e={node:i},r={},n.length>1?r.Document=n:1==n.length&&(r.Placemark=n[0]),f=roi[i.namespaceURI],o=nf(r,f),it(e,uoi,hr,o,[t],f,this),i},t}(na);aat=s(d,{Pair:function(n,t){var i=h({},loi,n,t),r,u,f;i&&(r=i.key,r&&"normal"==r&&(u=i.styleUrl,u&&(t[t.length-1]=u),f=i.Style,f&&(t[t.length-1]=f)))}});var eoi=s(d,{Icon:u(function(n,t){var i=h({},kat,n,t);return i||null}),heading:u(yt),hotSpot:u(function(n){var i,r=n.getAttribute("xunits"),t=n.getAttribute("yunits");return i="insetPixels"!==r?"insetPixels"!==t?ur.BOTTOM_LEFT:ur.TOP_LEFT:"insetPixels"!==t?ur.BOTTOM_RIGHT:ur.TOP_RIGHT,{x:parseFloat(n.getAttribute("x")),xunits:oat[r],y:parseFloat(n.getAttribute("y")),yunits:oat[t],origin:i}}),scale:u(lat)}),ooi=s(d,{color:u(kit),scale:u(lat)}),soi=s(d,{color:u(kit),width:u(yt)}),hoi=s(d,{color:u(kit),fill:u(bs),outline:u(bs)}),coi=s(d,{coordinates:tt(cat)});pat=s(oo,{Track:b(bat)});wat=s(d,{when:function(n,t){var r=t[t.length-1].whens,u=fu(n,!1),i=Date.parse(u);r.push(isNaN(i)?0:i)}},s(oo,{coord:function(n,t){var r=t[t.length-1].flatCoordinates,u=fu(n,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(u);if(i){var f=parseFloat(i[1]),e=parseFloat(i[2]),o=parseFloat(i[3]);r.push(f,e,o,0)}else r.push(0,0,0,0)}}));kat=s(d,{href:u(sk)},s(oo,{x:u(yt),y:u(yt),w:u(yt),h:u(yt)}));dat=s(d,{coordinates:tt(cat)});ly=s(d,{extrude:u(bs),tessellate:u(bs),altitudeMode:u(l)});tvt=s(d,{LineString:b(gat),LinearRing:b(nvt),MultiGeometry:b(ivt),Point:b(rvt),Polygon:b(fvt)});uvt=s(d,{innerBoundaryIs:function(n,t){var i=h(void 0,poi,n,t),r;i&&(r=t[t.length-1],r.push(i))},outerBoundaryIs:function(n,t){var i=h(void 0,woi,n,t),r;i&&(r=t[t.length-1],r[0]=i)}});evt=s(d,{IconStyle:function(n,t){var i=h({},eoi,n,t),nt,l,r,a,v,y,tt,p,w,b,c,it;if(i){var u,e,o,s,k=t[t.length-1],f="Icon"in i?i.Icon:{},d=!("Icon"in i)||Object.keys(f).length>0,g=f.href;g?u=g:d&&(u=hy);l=ur.BOTTOM_LEFT;r=i.hotSpot;r?(e=[r.x,r.y],o=r.xunits,s=r.yunits,l=r.origin):u===hy?(e=oit,o=sit,s=hit):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(u)&&(e=[.5,0],o=eu.FRACTION,s=eu.FRACTION);v=f.x;y=f.y;void 0!==v&&void 0!==y&&(nt=[v,y]);p=f.w;w=f.h;void 0!==p&&void 0!==w&&(a=[p,w]);b=i.heading;void 0!==b&&(tt=kf(b));c=i.scale;d?(u==hy&&(a=ek,void 0===c&&(c=cit)),it=new vb({anchor:e,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:"anonymous",offset:nt,offsetOrigin:ur.BOTTOM_LEFT,rotation:tt,scale:c,size:a,src:u}),k.imageStyle=it):k.imageStyle=ait}},LabelStyle:function(n,t){var i=h({},ooi,n,t),r,u;i&&(r=t[t.length-1],u=new nv({fill:new te({color:"color"in i?i.color:sy}),scale:i.scale}),r.textStyle=u)},LineStyle:function(n,t){var i=h({},soi,n,t),r,u;i&&(r=t[t.length-1],u=new hf({color:"color"in i?i.color:sy,width:"width"in i?i.width:1}),r.strokeStyle=u)},PolyStyle:function(n,t){var i=h({},hoi,n,t),r,e,u,f;i&&(r=t[t.length-1],e=new te({color:"color"in i?i.color:sy}),r.fillStyle=e,u=i.fill,void 0!==u&&(r.fill=u),f=i.outline,void 0!==f&&(r.outline=f))}});ovt=s(d,{displayName:u(l),value:u(l)});svt=s(d,{Data:function(n,t){var r=n.getAttribute("name"),i;vu(ovt,n,t);i=t[t.length-1];null!==r?i[r]=i.value:null!==i.displayName&&(i[i.displayName]=i.value);delete i.value},SchemaData:function(n,t){vu(aoi,n,t)}});var loi=s(d,{Style:u(git),key:u(l),styleUrl:u(sk)}),aoi=s(d,{SimpleData:function(n,t){var i=n.getAttribute("name"),r,u;null!==i&&(r=l(n),u=t[t.length-1],u[i]=r)}}),voi=s(d,{altitudeMode:u(l),minAltitude:u(yt),maxAltitude:u(yt),north:u(yt),south:u(yt),east:u(yt),west:u(yt)}),yoi=s(d,{minLodPixels:u(yt),maxLodPixels:u(yt),minFadeExtent:u(yt),maxFadeExtent:u(yt)}),poi=s(d,{LinearRing:tt(yat)}),woi=s(d,{LinearRing:tt(yat)});var hk=s(d,{Data:e(function(n,t,i){n.setAttribute("name",t.name);var u={node:n},r=t.value;"object"==typeof r?(null!==r&&r.displayName&&it(u,hk,hr,[r.displayName],i,["displayName"]),null!==r&&r.value&&it(u,hk,hr,[r.value],i,["value"])):it(u,hk,hr,[r],i,["value"])}),value:e(function(n,t){ut(n,t)}),displayName:e(function(n,t){!function(n,t){n.appendChild(fc.createCDATASection(t))}(n,t)})}),boi=s(d,{Placemark:e(bvt)}),koi=function(n,t){return rt(t[t.length-1].node.namespaceURI,"Placemark")},doi=gt("Data"),lvt=s(d,["href"],s(oo,["x","y","w","h"])),avt=s(d,{href:e(ut)},s(oo,{x:e(yu),y:e(yu),w:e(yu),h:e(yu)})),goi=function(n,t,i){return rt(oo[0],"gx:"+i)},nsi=s(d,["scale","heading","Icon","hotSpot"]),tsi=s(d,{Icon:e(function(n,t,i){var f={node:n},e=i[i.length-1].node,r=lvt[e.namespaceURI],u=nf(t,r);it(f,avt,hr,u,i,r);u=nf(t,r=lvt[oo[0]]);it(f,avt,goi,u,i,r)}),heading:e(yu),hotSpot:e(function(n,t){n.setAttribute("x",String(t.x));n.setAttribute("y",String(t.y));n.setAttribute("xunits",t.xunits);n.setAttribute("yunits",t.yunits)}),scale:e(ryt)}),isi=s(d,["color","scale"]),rsi=s(d,{color:e(trt),scale:e(ryt)}),usi=s(d,["color","width"]),fsi=s(d,{color:e(trt),width:e(yu)}),esi={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},vvt=function(n,t){if(n)return rt(t[t.length-1].node.namespaceURI,esi[n.getType()])},osi=gt("Point"),ssi=gt("LineString"),hsi=gt("LinearRing"),csi=gt("Polygon"),lsi=s(d,{LineString:e(ta),Point:e(ta),Polygon:e(nyt),GeometryCollection:e(yvt)});pvt=s(d,{LinearRing:e(ta)});var irt=s(d,{ExtendedData:e(function(n,t,i){for(var f={node:n},u=t.names,e=t.values,o=u.length,r=0;r<o;r++)it(f,hk,doi,[{name:u[r],value:e[r]}],i)}),MultiGeometry:e(yvt),LineString:e(ta),LinearRing:e(ta),Point:e(ta),Polygon:e(nyt),Style:e(function(n,t,i){var h={node:n},r={},f=t.getFill(),e=t.getStroke(),u=t.getImage(),o=t.getText();u&&"function"==typeof u.getSrc&&(r.IconStyle=u);o&&(r.LabelStyle=o);e&&(r.LineStyle=e);f&&(r.PolyStyle=f);var c=i[i.length-1].node,s=wsi[c.namespaceURI],l=nf(r,s);it(h,bsi,hr,l,i,s)}),address:e(ut),description:e(ut),name:e(ut),open:e(ik),phoneNumber:e(ut),styleUrl:e(ut),visibility:e(ik)}),asi=s(d,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),vsi=gt("ExtendedData");kvt=s(d,["extrude","tessellate","altitudeMode","coordinates"]);dvt=s(d,{extrude:e(ik),tessellate:e(ik),altitudeMode:e(ut),coordinates:e(function(n,t,i){var f,c=i[i.length-1],e=c.layout,l=c.stride,h,r,o,u,s;if(e==v.XY||e==v.XYM?f=2:e==v.XYZ||e==v.XYZM?f=3:g(!1,34),h=t.length,r="",h>0){for(r+=t[0],o=1;o<f;++o)r+=","+t[o];for(u=l;u<h;u+=l)for(r+=" "+t[u],s=1;s<f;++s)r+=","+t[u+s]}ut(n,r)})});var gvt=s(d,{outerBoundaryIs:e(wvt),innerBoundaryIs:e(wvt)}),ysi=gt("innerBoundaryIs"),psi=gt("outerBoundaryIs");tyt=s(d,{color:e(trt)});iyt=gt("color");var wsi=s(d,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),bsi=s(d,{IconStyle:e(function(n,t,i){var v={node:n},e={},y=t.getSrc(),r=t.getSize(),c=t.getImageSize(),o={href:y},u,f,l,s,h;r&&(o.w=r[0],o.h=r[1],u=t.getAnchor(),f=t.getOrigin(),(f&&c&&0!==f[0]&&f[1]!==r[1]&&(o.x=f[0],o.y=c[1]-(f[1]+r[1])),u&&(u[0]!==r[0]/2||u[1]!==r[1]/2))&&(l={x:u[0],xunits:eu.PIXELS,y:r[1]-u[1],yunits:eu.PIXELS},e.hotSpot=l));e.Icon=o;s=t.getScale();1!==s&&(e.scale=s);h=t.getRotation();0!==h&&(e.heading=h);var p=i[i.length-1].node,a=nsi[p.namespaceURI],w=nf(e,a);it(v,tsi,hr,w,i,a)}),LabelStyle:e(function(n,t,i){var o={node:n},u={},f=t.getFill(),r;f&&(u.color=f.getColor());r=t.getScale();r&&1!==r&&(u.scale=r);var s=i[i.length-1].node,e=isi[s.namespaceURI],h=nf(u,e);it(o,rsi,hr,h,i,e)}),LineStyle:e(function(n,t,i){var u={node:n},f={color:t.getColor(),width:t.getWidth()},e=i[i.length-1].node,r=usi[e.namespaceURI],o=nf(f,r);it(u,fsi,hr,o,i,r)}),PolyStyle:e(function(n,t,i){it({node:n},tyt,iyt,[t.getColor()],i)})}),ksi=foi,dsi=i(1),gsi=i.n(dsi),uyt=[1,0,0,1,0,0],nr=function(n,t,i,r,u){this.extent_;this.id_=u;this.type_=n;this.flatCoordinates_=t;this.flatInteriorPoints_=null;this.flatMidpoints_=null;this.ends_=i;this.properties_=r};nr.prototype.get=function(n){return this.properties_[n]};nr.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===f.POINT?uh(this.flatCoordinates_):td(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_};nr.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var n=su(this.getExtent());this.flatInteriorPoints_=wd(this.flatCoordinates_,0,this.ends_,2,n,0)}return this.flatInteriorPoints_};nr.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var n=llt(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=eft(this.flatCoordinates_,0,this.ends_,2,n)}return this.flatInteriorPoints_};nr.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=gp(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_};nr.prototype.getFlatMidpoints=function(){var t,u;if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var f=this.flatCoordinates_,i=0,r=this.ends_,n=0,e=r.length;n<e;++n)t=r[n],u=gp(f,i,t,2,.5),pt(this.flatMidpoints_,u),i=t}return this.flatMidpoints_};nr.prototype.getId=function(){return this.id_};nr.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_};nr.prototype.getGeometry=function(){return this};nr.prototype.getSimplifiedGeometry=function(){return this};nr.prototype.getProperties=function(){return this.properties_};nr.prototype.getStride=function(){return 2};nr.prototype.getStyleFunction=function(){};nr.prototype.getType=function(){return this.type_};nr.prototype.transform=function(n){var r=(n=w(n)).getExtent(),t=n.getWorldExtent(),i=ti(t)/ti(r);cu(uyt,t[0],t[3],i,-i,0,0,0);vo(this.flatCoordinates_,0,this.flatCoordinates_.length,2,uyt,this.flatCoordinates_)};nr.prototype.getEnds=nr.prototype.getEndss=function(){return this.ends_};nr.prototype.getFlatCoordinates=nr.prototype.getOrientedFlatCoordinates;rrt=nr;var uhi=function(n){function t(t){n.call(this);var i=t||{};this.dataProjection=new va({code:"",units:pr.TILE_PIXELS});this.featureClass_=i.featureClass?i.featureClass:rrt;this.geometryName_=i.geometryName;this.layerName_=i.layerName?i.layerName:"layer";this.layers_=i.layers?i.layers:null;this.extent_=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readRawGeometry_=function(n,t,i,r){var s;n.pos=t.geometry;for(var l=n.readVarint()+n.pos,e=1,o=0,h=0,c=0,u=0,f=0;n.pos<l;)o||(s=n.readVarint(),e=7&s,o=s>>3),o--,1===e||2===e?(h+=n.readSVarint(),c+=n.readSVarint(),1===e&&u>f&&(r.push(u),f=u),i.push(h,c),u+=2):7===e?u>f&&(i.push(i[f],i[f+1]),u+=2):g(!1,59);u>f&&(r.push(u),f=u)},t.prototype.createFeature_=function(n,t,i){var o,p=t.type,c,h,r,u,e,l,y,k;if(0===p)return null;if(c=t.id,h=t.properties,h[this.layerName_]=t.layer.name,r=[],u=[],this.readRawGeometry_(n,t,r,u),e=function(n,t){var i;return 1===n?i=1===t?f.POINT:f.MULTI_POINT:2===n?i=1===t?f.LINE_STRING:f.MULTI_LINE_STRING:3===n&&(i=f.POLYGON),i}(p,u.length),this.featureClass_===rrt)o=new this.featureClass_(e,r,u,h,c);else{if(e==f.POLYGON){for(var a=[],w=0,b=0,s=0,d=u.length;s<d;++s)y=u[s],go(r,w,y,2)||(a.push(u.slice(b,s)),b=s),w=y;l=a.length>1?new we(r,v.XY,a):new or(r,v.XY,u)}else l=e===f.POINT?new ei(r,v.XY):e===f.LINE_STRING?new yi(r,v.XY):e===f.POLYGON?new or(r,v.XY,u):e===f.MULTI_POINT?new pe(r,v.XY):e===f.MULTI_LINE_STRING?new yf(r,v.XY,u):null;o=new this.featureClass_;this.geometryName_&&o.setGeometryName(this.geometryName_);k=si(l,!1,this.adaptOptions(i));o.setGeometry(k);o.setId(c);o.setProperties(h)}return o},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return ro.ARRAY_BUFFER},t.prototype.readFeatures=function(n){var f=this.layers_,i=new gsi.a(n),e=i.readFields(nhi,{}),o=[],r,s;for(r in e)if(!f||-1!=f.indexOf(r)){for(var t=e[r],u=0,h=t.length;u<h;++u)s=rhi(i,t,u),o.push(this.createFeature_(i,s));this.extent_=t?[0,0,t.extent,t.extent]:null}return o},t.prototype.readProjection=function(){return this.dataProjection},t.prototype.setLayers=function(n){this.layers_=n},t}(dl),urt=[null],fhi=s(urt,{nd:function(n,t){t[t.length-1].ndrefs.push(n.getAttribute("ref"))},tag:fyt}),ehi=s(urt,{node:function(n,t){var s=t[0],f=t[t.length-1],e=n.getAttribute("id"),o=[parseFloat(n.getAttribute("lon")),parseFloat(n.getAttribute("lat"))],r,u,i;f.nodes[e]=o;r=h({tags:{}},shi,n,t);wu(r.tags)||(u=new ei(o),si(u,!1,s),i=new fi(u),i.setId(e),i.setProperties(r.tags),f.features.push(i))},way:function(n,t){var i=h({id:n.getAttribute("id"),ndrefs:[],tags:{}},fhi,n,t);t[t.length-1].ways.push(i)}}),ohi=function(n){function t(){n.call(this);this.dataProjection=w("EPSG:4326")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeaturesFromNode=function(n,t){var c=this.getReadOptions(n,t),i,u,s,e;if("osm"==n.localName){for(i=h({nodes:{},ways:[],features:[]},ehi,n,[c]),u=0;u<i.ways.length;u++){for(var r=i.ways[u],f=[],o=0,l=r.ndrefs.length;o<l;o++)pt(f,i.nodes[r.ndrefs[o]]);s=void 0;si(s=r.ndrefs[0]==r.ndrefs[r.ndrefs.length-1]?new or(f,v.XY,[f.length]):new yi(f,v.XY),!1,c);e=new fi(s);e.setId(r.id);e.setProperties(r.tags);i.features.push(e)}if(i.features)return i.features}return[]},t}(na),shi=s(urt,{tag:fyt});eyt=ohi;ayt=function(n){function t(t){n.call(this);var i=t||{};this.dataProjection=w("EPSG:4326");this.factor_=i.factor?i.factor:1e5;this.geometryLayout_=i.geometryLayout?i.geometryLayout:v.XY}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeatureFromText=function(n,t){var i=this.readGeometryFromText(n,t);return new fi(i)},t.prototype.readFeaturesFromText=function(n,t){return[this.readFeatureFromText(n,t)]},t.prototype.readGeometryFromText=function(n,t){var r=od(this.geometryLayout_),i=hyt(n,r,this.factor_),u;return oyt(i,0,i.length,r,i),u=gc(i,0,i.length,r),si(new yi(u,this.geometryLayout_),!1,this.adaptOptions(t))},t.prototype.writeFeatureText=function(n,t){var i=n.getGeometry();return i?this.writeGeometryText(i,t):(g(!1,40),"")},t.prototype.writeFeaturesText=function(n,t){return this.writeFeatureText(n[0],t)},t.prototype.writeGeometryText=function(n,t){var i=(n=si(n,!0,this.adaptOptions(t))).getFlatCoordinates(),r=n.getStride();return oyt(i,0,i.length,r,i),syt(i,r,this.factor_)},t}(lit);vyt={Point:function(n,t,i){var r=n.coordinates;return t&&i&&frt(r,t,i),new ei(r)},LineString:function(n,t){var i=ck(n.arcs,t);return new yi(i)},Polygon:function(n,t){for(var r=[],i=0,u=n.arcs.length;i<u;++i)r[i]=ck(n.arcs[i],t);return new or(r)},MultiPoint:function(n,t,i){var u=n.coordinates,r,f;if(t&&i)for(r=0,f=u.length;r<f;++r)frt(u[r],t,i);return new pe(u)},MultiLineString:function(n,t){for(var r=[],i=0,u=n.arcs.length;i<u;++i)r[i]=ck(n.arcs[i],t);return new yf(r)},MultiPolygon:function(n,t){for(var u=[],i=0,o=n.arcs.length;i<o;++i){for(var f=n.arcs[i],e=[],r=0,s=f.length;r<s;++r)e[r]=ck(f[r],t);u[i]=e}return new we(u)}};pyt=function(n){function t(t){n.call(this);var i=t||{};this.layerName_=i.layerName;this.layers_=i.layers?i.layers:null;this.dataProjection=w(i.dataProjection?i.dataProjection:"EPSG:4326")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFeaturesFromObject=function(n,t){var e,i;if("Topology"==n.type){var c,r=n,u=null,f=null;r.transform&&(u=(c=r.transform).scale,f=c.translate);e=r.arcs;c&&function(n,t,i){for(var r=0,u=n.length;r<u;++r)lhi(n[r],t,i)}(e,u,f);var o,s=[],h=r.objects,l=this.layerName_;for(i in h)this.layers_&&-1==this.layers_.indexOf(i)||("GeometryCollection"===h[i].type?(o=h[i],s.push.apply(s,chi(o,e,u,f,l,i,t))):(o=h[i],s.push(yyt(o,e,u,f,l,i,t))));return s}return[]},t.prototype.readProjectionFromObject=function(){return this.dataProjection},t}(tk);ert=function(n){this.tagName_=n};ert.prototype.getTagName=function(){return this.tagName_};var ay=ert,wyt=function(n){function t(t,i){n.call(this,t);this.conditions=i;g(this.conditions.length>=2,57)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ay),ahi=function(n){function t(){n.call(this,"And",Array.prototype.slice.call(arguments))}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(wyt),byt=function(n){function t(t,i,r){n.call(this,"BBOX");this.geometryName=t;this.extent=i;this.srsName=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ay),ort=function(n){function t(t,i,r,u){n.call(this,t);this.geometryName=i||"the_geom";this.geometry=r;this.srsName=u}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ay),kyt=function(n){function t(t,i,r){n.call(this,"Contains",t,i,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ort),vy=function(n){function t(t,i){n.call(this,t);this.propertyName=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ay),dyt=function(n){function t(t,i,r){n.call(this,"During",t);this.begin=i;this.end=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(vy),ia=function(n){function t(t,i,r,u){n.call(this,t,i);this.expression=r;this.matchCase=u}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(vy),gyt=function(n){function t(t,i,r){n.call(this,"PropertyIsEqualTo",t,i,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ia),npt=function(n){function t(t,i){n.call(this,"PropertyIsGreaterThan",t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ia),tpt=function(n){function t(t,i){n.call(this,"PropertyIsGreaterThanOrEqualTo",t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ia),ipt=function(n){function t(t,i,r){n.call(this,"Intersects",t,i,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ort),rpt=function(n){function t(t,i,r){n.call(this,"PropertyIsBetween",t);this.lowerBoundary=i;this.upperBoundary=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(vy),upt=function(n){function t(t,i,r,u,f,e){n.call(this,"PropertyIsLike",t);this.pattern=i;this.wildCard=void 0!==r?r:"*";this.singleChar=void 0!==u?u:".";this.escapeChar=void 0!==f?f:"!";this.matchCase=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(vy),fpt=function(n){function t(t){n.call(this,"PropertyIsNull",t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(vy),ept=function(n){function t(t,i){n.call(this,"PropertyIsLessThan",t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ia),opt=function(n){function t(t,i){n.call(this,"PropertyIsLessThanOrEqualTo",t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ia),spt=function(n){function t(t){n.call(this,"Not");this.condition=t}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ay),hpt=function(n){function t(t,i,r){n.call(this,"PropertyIsNotEqualTo",t,i,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ia),cpt=function(n){function t(){n.call(this,"Or",Array.prototype.slice.call(arguments))}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(wyt),lpt=function(n){function t(t,i,r){n.call(this,"Within",t,i,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ort);var vhi={"http://www.opengis.net/gml":{boundedBy:u(ct.prototype.readGeometryElement,"bounds")}},yhi={"http://www.opengis.net/wfs":{totalInserted:u(cr),totalUpdated:u(cr),totalDeleted:u(cr)}},phi={"http://www.opengis.net/wfs":{TransactionSummary:u(function(n,t){return h({},yhi,n,t)},"transactionSummary"),InsertResults:u(function(n,t){return h([],ghi,n,t)},"insertIds")}},whi={"http://www.opengis.net/wfs":{PropertyName:e(ut)}},yy={"http://www.opengis.net/wfs":{Insert:e(function(n,t,i){var r=i[i.length-1],f=r.featureType,e=r.featureNS,o=r.gmlVersion,u=rt(e,f);n.appendChild(u);2===o?oy.prototype.writeFeatureElement(u,t,i):et.prototype.writeFeatureElement(u,t,i)}),Update:e(function(n,t,i){var r=i[i.length-1],e,u,s;g(void 0!==t.getId(),27);var l=r.featureType,h=r.featurePrefix,a=r.featureNS,v=hrt(h,l),y=t.getGeometryName();if(n.setAttribute("typeName",v),n.setAttributeNS(srt,"xmlns:"+h,a),e=t.getId(),void 0!==e){for(var o=t.getKeys(),c=[],f=0,p=o.length;f<p;f++)u=t.get(o[f]),void 0!==u&&(s=o[f],u&&"function"==typeof u.getSimplifiedGeometry&&(s=y),c.push({name:s,value:u}));it({gmlVersion:r.gmlVersion,node:n,hasZ:r.hasZ,srsName:r.srsName},yy,gt("Property"),c,i);bpt(n,e,i)}}),Delete:e(function(n,t,i){var r=i[i.length-1],u;g(void 0!==t.getId(),26);var e=r.featureType,f=r.featurePrefix,o=r.featureNS,s=hrt(f,e);n.setAttribute("typeName",s);n.setAttributeNS(srt,"xmlns:"+f,o);u=t.getId();void 0!==u&&bpt(n,u,i)}),Property:e(function(n,t,i){var u=rt(lk,"Name"),f=i[i.length-1].gmlVersion,r;(n.appendChild(u),ut(u,t.name),void 0!==t.value&&null!==t.value)&&(r=rt(lk,"Value"),n.appendChild(r),t.value&&"function"==typeof t.value.getSimplifiedGeometry?2===f?oy.prototype.writeGeometryElement(r,t.value,i):et.prototype.writeGeometryElement(r,t.value,i):ut(r,t.value))}),Native:e(function(n,t){t.vendorId&&n.setAttribute("vendorId",t.vendorId);void 0!==t.safeToIgnore&&n.setAttribute("safeToIgnore",String(t.safeToIgnore));void 0!==t.value&&ut(n,t.value)})}},ypt="feature",srt="http://www.w3.org/2000/xmlns/",lc="http://www.opengis.net/ogc",lk="http://www.opengis.net/wfs",bhi="http://www.opengis.net/fes",ppt={"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"},wpt="1.1.0",khi=function(n){function t(t){n.call(this);var i=t||{};this.featureType_=i.featureType;this.featureNS_=i.featureNS;this.gmlFormat_=i.gmlFormat?i.gmlFormat:new et;this.schemaLocation_=i.schemaLocation?i.schemaLocation:ppt[wpt]}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getFeatureType=function(){return this.featureType_},t.prototype.setFeatureType=function(n){this.featureType_=n},t.prototype.readFeaturesFromNode=function(n,t){var r={node:n},u,i;return nt(r,{featureType:this.featureType_,featureNS:this.featureNS_}),nt(r,this.getReadOptions(n,t||{})),u=[r],this.gmlFormat_.FEATURE_COLLECTION_PARSERS[be].featureMember=b(ct.prototype.readFeaturesInternal),i=h([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,n,u,this.gmlFormat_),i||(i=[]),i},t.prototype.readTransactionResponse=function(n){if(n){if("string"==typeof n){var t=ue(n);return this.readTransactionResponseFromDocument(t)}return ye(n)?this.readTransactionResponseFromDocument(n):this.readTransactionResponseFromNode(n)}},t.prototype.readFeatureCollectionMetadata=function(n){if(n){if("string"==typeof n){var t=ue(n);return this.readFeatureCollectionMetadataFromDocument(t)}return ye(n)?this.readFeatureCollectionMetadataFromDocument(n):this.readFeatureCollectionMetadataFromNode(n)}},t.prototype.readFeatureCollectionMetadataFromDocument=function(n){for(var t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(t)},t.prototype.readFeatureCollectionMetadataFromNode=function(n){var t={},i=eo(n.getAttribute("numberOfFeatures"));return t.numberOfFeatures=i,h(t,vhi,n,[],this.gmlFormat_)},t.prototype.readTransactionResponseFromDocument=function(n){for(var t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(t)},t.prototype.readTransactionResponseFromNode=function(n){return h({},phi,n,[])},t.prototype.writeGetFeature=function(n){var i,t=rt(lk,"GetFeature"),r,u;return(t.setAttribute("service","WFS"),t.setAttribute("version","1.1.0"),n&&(n.handle&&t.setAttribute("handle",n.handle),n.outputFormat&&t.setAttribute("outputFormat",n.outputFormat),void 0!==n.maxFeatures&&t.setAttribute("maxFeatures",String(n.maxFeatures)),n.resultType&&t.setAttribute("resultType",n.resultType),void 0!==n.startIndex&&t.setAttribute("startIndex",String(n.startIndex)),void 0!==n.count&&t.setAttribute("count",String(n.count)),void 0!==n.viewParams&&t.setAttribute("viewParams ",n.viewParams),i=n.filter,n.bbox))&&(g(n.geometryName,12),r=vpt(n.geometryName,n.bbox,n.srsName),i=i?apt(i,r):r),t.setAttributeNS(hs,"xsi:schemaLocation",this.schemaLocation_),u={node:t},nt(u,{srsName:n.srsName,featureNS:n.featureNS?n.featureNS:this.featureNS_,featurePrefix:n.featurePrefix,geometryName:n.geometryName,filter:i,propertyNames:n.propertyNames?n.propertyNames:[]}),g(Array.isArray(n.featureTypes),11),function(n,t,i){var u=i[i.length-1],r=nt({},u);r.node=n;it(r,py,gt("Query"),t,i)}(t,n.featureTypes,[u]),t},t.prototype.writeTransaction=function(n,t,i,r){var h,f,o=[],u=rt(lk,"Transaction"),c=r.version?r.version:wpt,s="1.0.0"===c?2:3,l,e;return u.setAttribute("service","WFS"),u.setAttribute("version",c),r&&(h=r.gmlOptions?r.gmlOptions:{},r.handle&&u.setAttribute("handle",r.handle)),l=ppt[c],u.setAttributeNS(hs,"xsi:schemaLocation",l),e=r.featurePrefix?r.featurePrefix:ypt,n&&(f=nt({node:u},{featureNS:r.featureNS,featureType:r.featureType,featurePrefix:e,gmlVersion:s,hasZ:r.hasZ,srsName:r.srsName}),nt(f,h),it(f,yy,gt("Insert"),n,o)),t&&(f=nt({node:u},{featureNS:r.featureNS,featureType:r.featureType,featurePrefix:e,gmlVersion:s,hasZ:r.hasZ,srsName:r.srsName}),nt(f,h),it(f,yy,gt("Update"),t,o)),i&&it({node:u,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:e,gmlVersion:s,srsName:r.srsName},yy,gt("Delete"),i,o),r.nativeElements&&it({node:u,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:e,gmlVersion:s,srsName:r.srsName},yy,gt("Native"),r.nativeElements,o),u},t.prototype.readProjectionFromDocument=function(n){for(var t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(t);return null},t.prototype.readProjectionFromNode=function(n){var t,i;if(n.firstElementChild&&n.firstElementChild.firstElementChild)for(t=(n=n.firstElementChild.firstElementChild).firstElementChild;t;t=t.nextElementSibling)if(0!==t.childNodes.length&&(1!==t.childNodes.length||3!==t.firstChild.nodeType))return i=[{}],this.gmlFormat_.readGeometryElement(t,i),w(i.pop().srsName);return null},t}(na),dhi={"http://www.opengis.net/ogc":{FeatureId:b(function(n){return n.getAttribute("fid")})}},ghi={"http://www.opengis.net/wfs":{Feature:function(n,t){vu(dhi,n,t)}}};py={"http://www.opengis.net/wfs":{Query:e(function(n,t,i){var s,r=i[i.length-1],u=r.featurePrefix,h=r.featureNS,l=r.propertyNames,c=r.srsName,f,e,o;s=u?hrt(u,t):t;n.setAttribute("typeName",s);c&&n.setAttribute("srsName",c);h&&n.setAttributeNS(srt,"xmlns:"+u,h);f=nt({},r);f.node=n;it(f,whi,gt("PropertyName"),l,i);e=r.filter;e&&(o=rt(lc,"Filter"),n.appendChild(o),kpt(o,e,i))})},"http://www.opengis.net/ogc":{During:e(function(n,t){var f=rt(bhi,"ValueReference"),i,r,u;ut(f,t.propertyName);n.appendChild(f);i=rt(be,"TimePeriod");n.appendChild(i);r=rt(be,"begin");i.appendChild(r);nwt(r,t.begin);u=rt(be,"end");i.appendChild(u);nwt(u,t.end)}),And:e(dpt),Or:e(dpt),Not:e(function(n,t,i){var u={node:n},r=t.condition;it(u,py,gt(r.getTagName()),[r],i)}),BBOX:e(function(n,t,i){i[i.length-1].srsName=t.srsName;ks(n,t.geometryName);et.prototype.writeGeometryElement(n,t.extent,i)}),Contains:e(function(n,t,i){i[i.length-1].srsName=t.srsName;ks(n,t.geometryName);et.prototype.writeGeometryElement(n,t.geometry,i)}),Intersects:e(function(n,t,i){i[i.length-1].srsName=t.srsName;ks(n,t.geometryName);et.prototype.writeGeometryElement(n,t.geometry,i)}),Within:e(function(n,t,i){i[i.length-1].srsName=t.srsName;ks(n,t.geometryName);et.prototype.writeGeometryElement(n,t.geometry,i)}),PropertyIsEqualTo:e(ra),PropertyIsNotEqualTo:e(ra),PropertyIsLessThan:e(ra),PropertyIsLessThanOrEqualTo:e(ra),PropertyIsGreaterThan:e(ra),PropertyIsGreaterThanOrEqualTo:e(ra),PropertyIsNull:e(function(n,t){ks(n,t.propertyName)}),PropertyIsBetween:e(function(n,t){var i,r;ks(n,t.propertyName);i=rt(lc,"LowerBoundary");n.appendChild(i);ak(i,""+t.lowerBoundary);r=rt(lc,"UpperBoundary");n.appendChild(r);ak(r,""+t.upperBoundary)}),PropertyIsLike:e(function(n,t){n.setAttribute("wildCard",t.wildCard);n.setAttribute("singleChar",t.singleChar);n.setAttribute("escapeChar",t.escapeChar);void 0!==t.matchCase&&n.setAttribute("matchCase",t.matchCase.toString());ks(n,t.propertyName);ak(n,""+t.pattern)})}};var nci=khi,twt={POINT:ei,LINESTRING:yi,POLYGON:or,MULTIPOINT:pe,MULTILINESTRING:yf,MULTIPOLYGON:we},iwt="EMPTY",rwt="Z",uwt="M",vk=1,so=2,ds=3,fwt=4,ua=5,tci=6,ici={};for(crt in f)ici[crt]=f[crt].toUpperCase();ho=function(n){this.wkt=n;this.index_=-1};ho.prototype.isAlpha_=function(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"};ho.prototype.isNumeric_=function(n,t){return n>="0"&&n<="9"||"."==n&&!(void 0!==t&&t)};ho.prototype.isWhiteSpace_=function(n){return" "==n||"\t"==n||"\r"==n||"\n"==n};ho.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)};ho.prototype.nextToken=function(){var t,n=this.nextChar_(),r=this.index_,i=n;if("("==n)t=so;else if(","==n)t=ua;else if(")"==n)t=ds;else if(this.isNumeric_(n)||"-"==n)t=fwt,i=this.readNumber_();else if(this.isAlpha_(n))t=vk,i=this.readText_();else{if(this.isWhiteSpace_(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=tci}return{position:r,value:i,type:t}};ho.prototype.readNumber_=function(){var n,r=this.index_,i=!1,t=!1;do"."==n?i=!0:"e"!=n&&"E"!=n||(t=!0),n=this.nextChar_();while(this.isNumeric_(n,i)||!t&&("e"==n||"E"==n)||t&&("-"==n||"+"==n));return parseFloat(this.wkt.substring(r,this.index_--))};ho.prototype.readText_=function(){var n,t=this.index_;do n=this.nextChar_();while(this.isAlpha_(n));return this.wkt.substring(t,this.index_--).toUpperCase()};bi=function(n){this.lexer_=n;this.token_;this.layout_=v.XY};bi.prototype.consume_=function(){this.token_=this.lexer_.nextToken()};bi.prototype.isTokenType=function(n){return this.token_.type==n};bi.prototype.match=function(n){var t=this.isTokenType(n);return t&&this.consume_(),t};bi.prototype.parse=function(){return this.consume_(),this.parseGeometry_()};bi.prototype.parseGeometryLayout_=function(){var n=v.XY,i=this.token_,t;return this.isTokenType(vk)&&(t=i.value,t===rwt?n=v.XYZ:t===uwt?n=v.XYM:"ZM"===t&&(n=v.XYZM),n!==v.XY&&this.consume_()),n};bi.prototype.parseGeometryCollectionText_=function(){if(this.match(so)){var n=[];do n.push(this.parseGeometry_());while(this.match(ua));if(this.match(ds))return n}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());};bi.prototype.parsePointText_=function(){if(this.match(so)){var n=this.parsePoint_();if(this.match(ds))return n}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_());};bi.prototype.parseLineStringText_=function(){if(this.match(so)){var n=this.parsePointList_();if(this.match(ds))return n}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());};bi.prototype.parsePolygonText_=function(){if(this.match(so)){var n=this.parseLineStringTextList_();if(this.match(ds))return n}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());};bi.prototype.parseMultiPointText_=function(){var n;if(this.match(so)){if(n=this.token_.type==so?this.parsePointTextList_():this.parsePointList_(),this.match(ds))return n}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());};bi.prototype.parseMultiLineStringText_=function(){if(this.match(so)){var n=this.parseLineStringTextList_();if(this.match(ds))return n}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());};bi.prototype.parseMultiPolygonText_=function(){if(this.match(so)){var n=this.parsePolygonTextList_();if(this.match(ds))return n}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());};bi.prototype.parsePoint_=function(){for(var r,n=[],t=this.layout_.length,i=0;i<t;++i){if(r=this.token_,!this.match(fwt))break;n.push(r.value)}if(n.length==t)return n;throw new Error(this.formatErrorMessage_());};bi.prototype.parsePointList_=function(){for(var n=[this.parsePoint_()];this.match(ua);)n.push(this.parsePoint_());return n};bi.prototype.parsePointTextList_=function(){for(var n=[this.parsePointText_()];this.match(ua);)n.push(this.parsePointText_());return n};bi.prototype.parseLineStringTextList_=function(){for(var n=[this.parseLineStringText_()];this.match(ua);)n.push(this.parseLineStringText_());return n};bi.prototype.parsePolygonTextList_=function(){for(var n=[this.parsePolygonText_()];this.match(ua);)n.push(this.parsePolygonText_());return n};bi.prototype.isEmptyGeometry_=function(){var n=this.isTokenType(vk)&&this.token_.value==iwt;return n&&this.consume_(),n};bi.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"};bi.prototype.parseGeometry_=function(){var u=this.token_,t,r,n,i;if(this.match(vk)){if(t=u.value,this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==t)return r=this.parseGeometryCollectionText_(),new ys(r);if(i=twt[t],!i)throw new Error("Invalid geometry type: "+t);switch(t){case"POINT":n=this.parsePointText_();break;case"LINESTRING":n=this.parseLineStringText_();break;case"POLYGON":n=this.parsePolygonText_();break;case"MULTIPOINT":n=this.parseMultiPointText_();break;case"MULTILINESTRING":n=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":n=this.parseMultiPolygonText_();break;default:throw new Error("Invalid geometry type: "+t);}return n||(n=i===twt.POINT?[NaN,NaN]:[]),new i(n,this.layout_)}throw new Error(this.formatErrorMessage_());};swt={Point:ewt,LineString:lrt,Polygon:owt,MultiPoint:function(n){for(var i=[],r=n.getPoints(),t=0,u=r.length;t<u;++t)i.push("("+ewt(r[t])+")");return i.join(",")},MultiLineString:function(n){for(var i=[],r=n.getLineStrings(),t=0,u=r.length;t<u;++t)i.push("("+lrt(r[t])+")");return i.join(",")},MultiPolygon:function(n){for(var i=[],r=n.getPolygons(),t=0,u=r.length;t<u;++t)i.push("("+owt(r[t])+")");return i.join(",")},GeometryCollection:function(n){for(var i=[],r=n.getGeometries(),t=0,u=r.length;t<u;++t)i.push(hwt(r[t]));return i.join(",")}};cwt=function(n){function t(t){n.call(this);var i=t||{};this.splitCollection_=void 0!==i.splitCollection&&i.splitCollection}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.parse_=function(n){var t=new ho(n);return new bi(t).parse()},t.prototype.readFeatureFromText=function(n,t){var r=this.readGeometryFromText(n,t),i;return r?(i=new fi,i.setGeometry(r),i):null},t.prototype.readFeaturesFromText=function(n,t){for(var u,e=[],i=this.readGeometryFromText(n,t),o=[],r=0,s=(e=this.splitCollection_&&i.getType()==f.GEOMETRY_COLLECTION?i.getGeometriesArray():[i]).length;r<s;++r)u=new fi,u.setGeometry(e[r]),o.push(u);return o},t.prototype.readGeometryFromText=function(n,t){var i=this.parse_(n);return i?si(i,!1,t):null},t.prototype.writeFeatureText=function(n,t){var i=n.getGeometry();return i?this.writeGeometryText(i,t):""},t.prototype.writeFeaturesText=function(n,t){var u;if(1==n.length)return this.writeFeatureText(n[0],t);for(var r=[],i=0,f=n.length;i<f;++i)r.push(n[i].getGeometry());return u=new ys(r),this.writeGeometryText(u,t)},t.prototype.writeGeometryText=function(n,t){return hwt(si(n,!0,t))},t}(lit);lwt="http://www.w3.org/1999/xlink";wy=function(){};wy.prototype.read=function(n){if(n){if("string"==typeof n){var t=ue(n);return this.readFromDocument(t)}return ye(n)?this.readFromDocument(n):this.readFromNode(n)}return null};wy.prototype.readFromDocument=function(){};wy.prototype.readFromNode=function(){};var art=wy,yr=[null,"http://www.opengis.net/wms"],rci=s(yr,{Service:u(function(n,t){return h({},eci,n,t)}),Capability:u(function(n,t){return h({},uci,n,t)})}),uci=s(yr,{Request:u(function(n,t){return h({},vci,n,t)}),Exception:u(function(n,t){return h([],cci,n,t)}),Layer:u(function(n,t){return h({},awt,n,t)})}),fci=function(n){function t(){n.call(this);this.version=void 0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFromDocument=function(n){for(var t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFromNode(t);return null},t.prototype.readFromNode=function(n){this.version=n.getAttribute("version").trim();var t=h({version:this.version},rci,n,[]);return t||null},t}(art),eci=s(yr,{Name:u(l),Title:u(l),Abstract:u(l),KeywordList:u(ywt),OnlineResource:u(fa),ContactInformation:u(function(n,t){return h({},oci,n,t)}),Fees:u(l),AccessConstraints:u(l),LayerLimit:u(cr),MaxWidth:u(cr),MaxHeight:u(cr)}),oci=s(yr,{ContactPersonPrimary:u(function(n,t){return h({},sci,n,t)}),ContactPosition:u(l),ContactAddress:u(function(n,t){return h({},hci,n,t)}),ContactVoiceTelephone:u(l),ContactFacsimileTelephone:u(l),ContactElectronicMailAddress:u(l)}),sci=s(yr,{ContactPerson:u(l),ContactOrganization:u(l)}),hci=s(yr,{AddressType:u(l),Address:u(l),City:u(l),StateOrProvince:u(l),PostCode:u(l),Country:u(l)}),cci=s(yr,{Format:b(l)}),awt=s(yr,{Name:u(l),Title:u(l),Abstract:u(l),KeywordList:u(ywt),CRS:ii(l),EX_GeographicBoundingBox:u(function(n,t){var i=h({},aci,n,t);if(i){var r=i.westBoundLongitude,u=i.southBoundLatitude,f=i.eastBoundLongitude,e=i.northBoundLatitude;if(void 0!==r&&void 0!==u&&void 0!==f&&void 0!==e)return[r,u,f,e]}}),BoundingBox:ii(function(n){var t=[fo(n.getAttribute("minx")),fo(n.getAttribute("miny")),fo(n.getAttribute("maxx")),fo(n.getAttribute("maxy"))],i=[fo(n.getAttribute("resx")),fo(n.getAttribute("resy"))];return{crs:n.getAttribute("CRS"),extent:t,res:i}}),Dimension:ii(function(n){return{name:n.getAttribute("name"),units:n.getAttribute("units"),unitSymbol:n.getAttribute("unitSymbol"),"default":n.getAttribute("default"),multipleValues:hc(n.getAttribute("multipleValues")),nearestValue:hc(n.getAttribute("nearestValue")),current:hc(n.getAttribute("current")),values:l(n)}}),Attribution:u(function(n,t){return h({},lci,n,t)}),AuthorityURL:ii(function(n,t){var i=co(n,t);if(i)return i.name=n.getAttribute("name"),i}),Identifier:ii(l),MetadataURL:ii(function(n,t){var i=co(n,t);if(i)return i.type=n.getAttribute("type"),i}),DataURL:ii(co),FeatureListURL:ii(co),Style:ii(function(n,t){return h({},bci,n,t)}),MinScaleDenominator:u(yt),MaxScaleDenominator:u(yt),Layer:ii(function(n,t){var r=t[t.length-1],i=h({},awt,n,t),u,o,f,e,s,c;if(i)return u=hc(n.getAttribute("queryable")),void 0===u&&(u=r.queryable),i.queryable=void 0!==u&&u,o=eo(n.getAttribute("cascaded")),void 0===o&&(o=r.cascaded),i.cascaded=o,f=hc(n.getAttribute("opaque")),void 0===f&&(f=r.opaque),i.opaque=void 0!==f&&f,e=hc(n.getAttribute("noSubsets")),void 0===e&&(e=r.noSubsets),i.noSubsets=void 0!==e&&e,s=fo(n.getAttribute("fixedWidth")),s||(s=r.fixedWidth),i.fixedWidth=s,c=fo(n.getAttribute("fixedHeight")),c||(c=r.fixedHeight),i.fixedHeight=c,["Style","CRS","AuthorityURL"].forEach(function(n){if(n in r){var t=i[n]||[];i[n]=t.concat(r[n])}}),["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(n){if(!(n in i)){var t=r[n];i[n]=t}}),i})}),lci=s(yr,{Title:u(l),OnlineResource:u(fa),LogoURL:u(vwt)}),aci=s(yr,{westBoundLongitude:u(yt),eastBoundLongitude:u(yt),southBoundLatitude:u(yt),northBoundLatitude:u(yt)}),vci=s(yr,{GetCapabilities:u(vrt),GetMap:u(vrt),GetFeatureInfo:u(vrt)}),yci=s(yr,{Format:ii(l),DCPType:ii(function(n,t){return h({},pci,n,t)})}),pci=s(yr,{HTTP:u(function(n,t){return h({},wci,n,t)})}),wci=s(yr,{Get:u(co),Post:u(co)}),bci=s(yr,{Name:u(l),Title:u(l),Abstract:u(l),LegendURL:ii(vwt),StyleSheetURL:u(co),StyleURL:u(co)}),kci=s(yr,{Format:u(l),OnlineResource:u(fa)}),dci=s(yr,{Keyword:b(l)});var gci=fci,nli=function(n){function t(t){n.call(this);var i=t||{};this.featureNS_="http://mapserver.gis.umn.edu/mapserver";this.gmlFormat_=new oy;this.layers_=i.layers?i.layers:null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getLayers=function(){return this.layers_},t.prototype.setLayers=function(n){this.layers_=n},t.prototype.readFeatures_=function(n,t){var u,i,r,y,f,c,l,w,a,v;if(n.setAttribute("namespaceURI",this.featureNS_),u=n.localName,i=[],0===n.childNodes.length)return i;if("msGMLOutput"==u)for(r=0,y=n.childNodes.length;r<y;r++)if(f=n.childNodes[r],f.nodeType===Node.ELEMENT_NODE){var e=f,o=t[0],p=e.localName.replace("_layer","");(!this.layers_||tr(this.layers_,p))&&(c=p+"_feature",o.featureType=c,o.featureNS=this.featureNS_,l={},l[c]=b(this.gmlFormat_.readFeatureElement,this.gmlFormat_),w=s([o.featureNS,null],l),e.setAttribute("namespaceURI",this.featureNS_),a=h([],w,e,t,this.gmlFormat_),a&&pt(i,a))}return"FeatureCollection"==u&&(v=h([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,n,[{}],this.gmlFormat_),v&&(i=v)),i},t.prototype.readFeaturesFromNode=function(n,t){var i={};return t&&nt(i,this.getReadOptions(n,t)),this.readFeatures_(n,[i])},t}(na),pu=[null,"http://www.opengis.net/ows/1.1"],tli=s(pu,{ServiceIdentification:u(function(n,t){return h({},yli,n,t)}),ServiceProvider:u(function(n,t){return h({},pli,n,t)}),OperationsMetadata:u(function(n,t){return h({},cli,n,t)})}),ili=function(n){function t(){n.call(this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFromDocument=function(n){for(var t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFromNode(t);return null},t.prototype.readFromNode=function(n){var t=h({},tli,n,[]);return t||null},t}(art),rli=s(pu,{DeliveryPoint:u(l),City:u(l),AdministrativeArea:u(l),PostalCode:u(l),Country:u(l),ElectronicMailAddress:u(l)}),uli=s(pu,{Value:ii(function(n){return l(n)})}),fli=s(pu,{AllowedValues:u(function(n,t){return h({},uli,n,t)})}),eli=s(pu,{Phone:u(function(n,t){return h({},lli,n,t)}),Address:u(function(n,t){return h({},rli,n,t)})}),oli=s(pu,{HTTP:u(function(n,t){return h({},sli,n,t)})}),sli=s(pu,{Get:ii(function(n,t){var i=fa(n);if(i)return h({href:i},ali,n,t)}),Post:void 0}),hli=s(pu,{DCP:u(function(n,t){return h({},oli,n,t)})}),cli=s(pu,{Operation:function(n,t){var r=n.getAttribute("name"),i=h({},hli,n,t);i&&(t[t.length-1][r]=i)}}),lli=s(pu,{Voice:u(l),Facsimile:u(l)}),ali=s(pu,{Constraint:ii(function(n,t){var i=n.getAttribute("name");if(i)return h({name:i},fli,n,t)})}),vli=s(pu,{IndividualName:u(l),PositionName:u(l),ContactInfo:u(function(n,t){return h({},eli,n,t)})}),yli=s(pu,{Abstract:u(l),AccessConstraints:u(l),Fees:u(l),Title:u(l),ServiceTypeVersion:u(l),ServiceType:u(l)}),pli=s(pu,{ProviderName:u(l),ProviderSite:u(fa),ServiceContact:u(function(n,t){return h({},vli,n,t)})}),wli=ili,ke=[null,"http://www.opengis.net/wmts/1.0"],ea=[null,"http://www.opengis.net/ows/1.1"],bli=s(ke,{Contents:u(function(n,t){return h({},dli,n,t)})}),kli=function(n){function t(){n.call(this);this.owsParser_=new wli}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.readFromDocument=function(n){for(var t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFromNode(t);return null},t.prototype.readFromNode=function(n){var i=n.getAttribute("version").trim(),t=this.owsParser_.readFromNode(n);return t?(t.version=i,(t=h(t,bli,n,[]))||null):null},t}(art),dli=s(ke,{Layer:ii(function(n,t){return h({},gli,n,t)}),TileMatrixSet:ii(function(n,t){return h({},eai,n,t)})}),gli=s(ke,{Style:ii(function(n,t){var i=h({},nai,n,t),r;if(i)return r="true"===n.getAttribute("isDefault"),i.isDefault=r,i}),Format:ii(l),TileMatrixSetLink:ii(function(n,t){return h({},tai,n,t)}),Dimension:ii(function(n,t){return h({},uai,n,t)}),ResourceURL:ii(function(n){var i=n.getAttribute("format"),r=n.getAttribute("template"),u=n.getAttribute("resourceType"),t={};return i&&(t.format=i),r&&(t.template=r),u&&(t.resourceType=u),t})},s(ea,{Title:u(l),Abstract:u(l),WGS84BoundingBox:u(function(n,t){var i=h([],fai,n,t);if(2==i.length)return hi(i)}),Identifier:u(l)})),nai=s(ke,{LegendURL:ii(function(n){var t={};return t.format=n.getAttribute("format"),t.href=fa(n),t})},s(ea,{Title:u(l),Identifier:u(l)})),tai=s(ke,{TileMatrixSet:u(l),TileMatrixSetLimits:u(function(n,t){return h([],iai,n,t)})}),iai=s(ke,{TileMatrixLimits:b(function(n,t){return h({},rai,n,t)})}),rai=s(ke,{TileMatrix:u(l),MinTileRow:u(cr),MaxTileRow:u(cr),MinTileCol:u(cr),MaxTileCol:u(cr)}),uai=s(ke,{Default:u(l),Value:ii(l)},s(ea,{Identifier:u(l)})),fai=s(ea,{LowerCorner:b(yrt),UpperCorner:b(yrt)}),eai=s(ke,{WellKnownScaleSet:u(l),TileMatrix:ii(function(n,t){return h({},oai,n,t)})},s(ea,{SupportedCRS:u(l),Identifier:u(l)})),oai=s(ke,{TopLeftCorner:u(yrt),ScaleDenominator:u(yt),TileWidth:u(cr),TileHeight:u(cr),MatrixWidth:u(cr),MatrixHeight:u(cr)},s(ea,{Identifier:u(l)}));pwt=kli;wwt=function(){var n;return function(){if(!n){var t=document.body;t.webkitRequestFullscreen?n="webkitfullscreenchange":t.mozRequestFullScreen?n="mozfullscreenchange":t.msRequestFullscreen?n="MSFullscreenChange":t.requestFullscreen&&(n="fullscreenchange")}return n}}();dwt=function(n){function t(t){var i=t||{},r,u,e,s,f;n.call(this,{element:document.createElement("div"),target:i.target});this.cssClassName_=void 0!==i.className?i.className:"ol-full-screen";r=void 0!==i.label?i.label:"⤢";this.labelNode_="string"==typeof r?document.createTextNode(r):r;u=void 0!==i.labelActive?i.labelActive:"×";this.labelActiveNode_="string"==typeof u?document.createTextNode(u):u;this.button_=document.createElement("button");e=i.tipLabel?i.tipLabel:"Toggle full-screen";this.setClassName_(this.button_,prt());this.button_.setAttribute("type","button");this.button_.title=e;this.button_.appendChild(this.labelNode_);o(this.button_,a.CLICK,this.handleClick_,this);s=this.cssClassName_+" "+ie+" "+gh+" "+(bwt()?"":rgt);f=this.element;f.className=s;f.appendChild(this.button_);this.keys_=void 0!==i.keys&&i.keys;this.source_=i.source}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleClick_=function(n){n.preventDefault();this.handleFullScreen_()},t.prototype.handleFullScreen_=function(){if(bwt()){var n,t=this.getMap();t&&(prt()?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(n=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(n){n.mozRequestFullScreenWithKeys?n.mozRequestFullScreenWithKeys():n.webkitRequestFullscreen?n.webkitRequestFullscreen():kwt(n)}(n):kwt(n)))}},t.prototype.handleFullScreenChange_=function(){var n=this.getMap();prt()?(this.setClassName_(this.button_,!0),fl(this.labelActiveNode_,this.labelNode_)):(this.setClassName_(this.button_,!1),fl(this.labelNode_,this.labelActiveNode_));n&&n.updateSize()},t.prototype.setClassName_=function(n,t){var i=this.cssClassName_+"-true",r=this.cssClassName_+"-false",u=t?i:r;n.classList.remove(i);n.classList.remove(r);n.classList.add(u)},t.prototype.setMap=function(t){n.prototype.setMap.call(this,t);t&&this.listenerKeys.push(o(document,wwt(),this.handleFullScreenChange_,this))},t}(le);yk="projection";nbt=function(n){function t(t){var i=t||{},r=document.createElement("div");r.className=void 0!==i.className?i.className:"ol-mouse-position";n.call(this,{element:r,render:i.render||gwt,target:i.target});o(this,ni(yk),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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleProjectionChanged_=function(){this.transform_=null},t.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},t.prototype.getProjection=function(){return this.get(yk)},t.prototype.handleMouseMove=function(n){var t=this.getMap();this.lastMouseMovePixel_=t.getEventPixel(n);this.updateHTML_(this.lastMouseMovePixel_)},t.prototype.handleMouseOut=function(){this.updateHTML_(null);this.lastMouseMovePixel_=null},t.prototype.setMap=function(t){if(n.prototype.setMap.call(this,t),t){var i=t.getViewport();this.listenerKeys.push(o(i,a.MOUSEMOVE,this.handleMouseMove,this),o(i,a.TOUCHSTART,this.handleMouseMove,this));this.renderOnMouseOut_&&this.listenerKeys.push(o(i,a.MOUSEOUT,this.handleMouseOut,this),o(i,a.TOUCHEND,this.handleMouseOut,this))}},t.prototype.setCoordinateFormat=function(n){this.set("coordinateFormat",n)},t.prototype.setProjection=function(n){this.set(yk,w(n))},t.prototype.updateHTML_=function(n){var i=this.undefinedHTML_,r,t,u;n&&this.mapProjection_&&(this.transform_||(r=this.getProjection(),this.transform_=r?wo(this.mapProjection_,r):ud),t=this.getMap().getCoordinateFromPixel(n),t&&(this.transform_(t,t),u=this.getCoordinateFormat(),i=u?u(t):t.toString()));this.renderedHTML_&&i===this.renderedHTML_||(this.element.innerHTML=i,this.renderedHTML_=i)},t}(le);var sai=function(n){function t(t){var i=t||{},u,l,r,f,e,v,s;n.call(this,{element:document.createElement("div"),render:i.render||tbt,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 w=void 0!==i.className?i.className:"ol-overviewmap",b=void 0!==i.tipLabel?i.tipLabel:"Overview map",h=void 0!==i.collapseLabel?i.collapseLabel:"«";"string"==typeof h?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=h):this.collapseLabel_=h;u=void 0!==i.label?i.label:"»";"string"==typeof u?(this.label_=document.createElement("span"),this.label_.textContent=u):this.label_=u;l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;r=document.createElement("button");r.setAttribute("type","button");r.title=b;r.appendChild(l);o(r,a.CLICK,this.handleClick_,this);this.ovmapDiv_=document.createElement("div");this.ovmapDiv_.className="ol-overviewmap-map";this.ovmap_=new yst({controls:new er,interactions:new er,view:i.view});f=this.ovmap_;i.layers&&i.layers.forEach(function(n){f.addLayer(n)}.bind(this));e=document.createElement("div");e.className="ol-overviewmap-box";e.style.boxSizing="border-box";this.boxOverlay_=new pst({position:[0,0],positioning:au.BOTTOM_LEFT,element:e});this.ovmap_.addOverlay(this.boxOverlay_);v=w+" "+ie+" "+gh+(this.collapsed_&&this.collapsible_?" "+cw:"")+(this.collapsible_?"":" ol-uncollapsible");s=this.element;s.className=v;s.appendChild(this.ovmapDiv_);s.appendChild(r);var k=this,d=this.boxOverlay_,c=this.boxOverlay_.getElement(),y=function(n){var t=function(n){return{clientX:n.clientX-c.offsetWidth/2,clientY:n.clientY+c.offsetHeight/2}}(n),i=f.getEventCoordinate(t);d.setPosition(i)},p=function(n){var t=f.getEventCoordinate(n);k.getMap().getView().setCenter(t);window.removeEventListener("mousemove",y);window.removeEventListener("mouseup",p)};c.addEventListener("mousedown",function(){window.addEventListener("mousemove",y);window.addEventListener("mouseup",p)})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setMap=function(t){var r=this.getMap(),u,i;t!==r&&(r&&(u=r.getView(),u&&this.unbindView_(u),this.ovmap_.setTarget(null)),(n.prototype.setMap.call(this,t),t)&&(this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(o(t,gs,this.handleMapPropertyChange_,this)),0===this.ovmap_.getLayers().getLength()&&this.ovmap_.setLayerGroup(t.getLayerGroup()),i=t.getView(),i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))))},t.prototype.handleMapPropertyChange_=function(n){var t,i;n.key===br.VIEW&&(t=n.oldValue,t&&this.unbindView_(t),i=this.getMap().getView(),this.bindView_(i))},t.prototype.bindView_=function(n){o(n,ni(ul),this.handleRotationChanged_,this)},t.prototype.unbindView_=function(n){ou(n,ni(ul),this.handleRotationChanged_,this)},t.prototype.handleRotationChanged_=function(){this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},t.prototype.validateExtent_=function(){var t=this.getMap(),n=this.ovmap_;if(t.isRendered()&&n.isRendered()){var c=t.getSize(),i=t.getView().calculateExtent(c),r=n.getSize(),l=n.getView().calculateExtent(r),u=n.getPixelFromCoordinate(bf(i)),f=n.getPixelFromCoordinate(fh(i)),e=Math.abs(u[0]-f[0]),o=Math.abs(u[1]-f[1]),s=r[0],h=r[1];e<.1*s||o<.1*h||e>.75*s||o>.75*h?this.resetExtent_():lr(l,i)||this.recenter_()}},t.prototype.resetExtent_=function(){var n=this.getMap(),i=this.ovmap_,r=n.getSize(),t=n.getView().calculateExtent(r),u=i.getView(),f=Math.log(7.5)/Math.LN2;fp(t,1/(.1*Math.pow(2,f/2)));u.fit(t)},t.prototype.recenter_=function(){var n=this.getMap(),t=this.ovmap_,i=n.getView();t.getView().setCenter(i.getCenter())},t.prototype.updateBox_=function(){var n=this.getMap(),r=this.ovmap_;if(n.isRendered()&&r.isRendered()){var s=n.getSize(),u=n.getView(),h=r.getView(),c=u.getRotation(),l=this.boxOverlay_,t=this.boxOverlay_.getElement(),f=u.calculateExtent(s),e=h.getResolution(),i=de(f),o=ao(f),a=this.calculateCoordinateRotate_(c,i);l.setPosition(a);t&&(t.style.width=Math.abs((i[0]-o[0])/e)+"px",t.style.height=Math.abs((o[1]-i[1])/e)+"px")}},t.prototype.calculateCoordinateRotate_=function(n,t){var r,i=this.getMap().getView().getCenter();return i&&(da(r=[t[0]-i[0],t[1]-i[1]],n),ka(r,i)),r},t.prototype.handleClick_=function(n){n.preventDefault();this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(cw);this.collapsed_?fl(this.collapseLabel_,this.label_):fl(this.label_,this.collapseLabel_);this.collapsed_=!this.collapsed_;var n=this.ovmap_;this.collapsed_||n.isRendered()||(n.updateSize(),this.resetExtent_(),ee(n,iw,function(){this.updateBox_()},this))},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(n){this.collapsible_!==n&&(this.collapsible_=n,this.element.classList.toggle("ol-uncollapsible"),!n&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(n){this.collapsible_&&this.collapsed_!==n&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t.prototype.getOverviewMap=function(){return this.ovmap_},t}(le),wrt="units",ac={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},hai=[1,2,5];rbt=function(n){function t(t){var i=t||{},r=void 0!==i.className?i.className:"ol-scale-line";n.call(this,{element:document.createElement("div"),render:i.render||ibt,target:i.target});this.innerElement_=document.createElement("div");this.innerElement_.className=r+"-inner";this.element.className=r+" "+ie;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_="";o(this,ni(wrt),this.handleUnitsChanged_,this);this.setUnits(i.units||ac.METRIC)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getUnits=function(){return this.get(wrt)},t.prototype.handleUnitsChanged_=function(){this.updateElement_()},t.prototype.setUnits=function(n){this.set(wrt,n)},t.prototype.updateElement_=function(){var o=this.viewState_,i,t,e,c,u,s,h;if(o){var a=o.center,f=o.projection,r=this.getUnits(),l=r==ac.DEGREES?pr.DEGREES:pr.METERS,n=hp(f,o.resolution,a,l);for(f.getUnits()!=pr.DEGREES&&f.getMetersPerUnit()&&l==pr.METERS&&(n*=f.getMetersPerUnit()),i=this.minWidth_*n,t="",r==ac.DEGREES?(e=gf[pr.DEGREES],f.getUnits()==pr.DEGREES?i*=e:n/=e,i<e/60?(t="″",n*=3600):i<e?(t="′",n*=60):t="°"):r==ac.IMPERIAL?i<.9144?(t="in",n/=.0254):i<1609.344?(t="ft",n/=.3048):(t="mi",n/=1609.344):r==ac.NAUTICAL?(n/=1852,t="nm"):r==ac.METRIC?i<.001?(t="μm",n*=1e6):i<1?(t="mm",n*=1e3):i<1e3?t="m":(t="km",n/=1e3):r==ac.US?i<.9144?(t="in",n*=39.37):i<1609.344?(t="ft",n/=.30480061):(t="mi",n/=1609.3472):g(!1,33),s=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){if(c=hai[(s%3+3)%3]*Math.pow(10,Math.floor(s/3)),u=Math.round(c/n),isNaN(u))return this.element.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++s}h=c+" "+t;this.renderedHTML_!=h&&(this.innerElement_.innerHTML=h,this.renderedHTML_=h);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)},t}(le);oa={VERTICAL:0,HORIZONTAL:1};var cai=function(n){function t(t){var i=t||{},f,r,u;n.call(this,{element:document.createElement("div"),render:i.render||ubt});this.dragListenerKeys_=[];this.currentResolution_=void 0;this.direction_=oa.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;f=void 0!==i.className?i.className:"ol-zoomslider";r=document.createElement("button");r.setAttribute("type","button");r.className=f+"-thumb "+ie;u=this.element;u.className=f+" "+ie+" "+gh;u.appendChild(r);this.dragger_=new rg(u);o(this.dragger_,tu.POINTERDOWN,this.handleDraggerStart_,this);o(this.dragger_,tu.POINTERMOVE,this.handleDraggerDrag_,this);o(this.dragger_,tu.POINTERUP,this.handleDraggerEnd_,this);o(u,a.CLICK,this.handleContainerClick_,this);o(r,a.CLICK,tut)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.disposeInternal=function(){this.dragger_.dispose();n.prototype.disposeInternal.call(this)},t.prototype.setMap=function(t){n.prototype.setMap.call(this,t);t&&t.render()},t.prototype.initSlider_=function(){var t=this.element,r=t.offsetWidth,u=t.offsetHeight,i=t.firstElementChild,n=getComputedStyle(i),f=i.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),e=i.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);this.thumbSize_=[f,e];r>u?(this.direction_=oa.HORIZONTAL,this.widthLimit_=r-f):(this.direction_=oa.VERTICAL,this.heightLimit_=u-e);this.sliderInitialized_=!0},t.prototype.handleContainerClick_=function(n){var t=this.getMap().getView(),i=this.getRelativePosition_(n.offsetX-this.thumbSize_[0]/2,n.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i);t.animate({resolution:t.constrainResolution(r),duration:this.duration_,easing:cf})},t.prototype.handleDraggerStart_=function(n){if(!this.dragging_&&n.originalEvent.target===this.element.firstElementChild&&(this.getMap().getView().setHint(oi,1),this.previousX_=n.clientX,this.previousY_=n.clientY,this.dragging_=!0,0===this.dragListenerKeys_.length)){var t=this.handleDraggerDrag_,i=this.handleDraggerEnd_;this.dragListenerKeys_.push(o(document,a.MOUSEMOVE,t,this),o(document,tu.POINTERMOVE,t,this),o(document,a.MOUSEUP,i,this),o(document,tu.POINTERUP,i,this))}},t.prototype.handleDraggerDrag_=function(n){if(this.dragging_){var t=this.element.firstElementChild,i=n.clientX-this.previousX_+parseFloat(t.style.left),r=n.clientY-this.previousY_+parseFloat(t.style.top),u=this.getRelativePosition_(i,r);this.currentResolution_=this.getResolutionForPosition_(u);this.getMap().getView().setResolution(this.currentResolution_);this.setThumbPosition_(this.currentResolution_);this.previousX_=n.clientX;this.previousY_=n.clientY}},t.prototype.handleDraggerEnd_=function(){if(this.dragging_){var n=this.getMap().getView();n.setHint(oi,-1);n.animate({resolution:n.constrainResolution(this.currentResolution_),duration:this.duration_,easing:cf});this.dragging_=!1;this.previousX_=void 0;this.previousY_=void 0;this.dragListenerKeys_.forEach(lt);this.dragListenerKeys_.length=0}},t.prototype.setThumbPosition_=function(n){var t=this.getPositionForResolution_(n),i=this.element.firstElementChild;this.direction_==oa.HORIZONTAL?i.style.left=this.widthLimit_*t+"px":i.style.top=this.heightLimit_*t+"px"},t.prototype.getRelativePosition_=function(n,t){return vi(this.direction_===oa.HORIZONTAL?n/this.widthLimit_:t/this.heightLimit_,0,1)},t.prototype.getResolutionForPosition_=function(n){return this.getMap().getView().getResolutionForValueFunction()(1-n)},t.prototype.getPositionForResolution_=function(n){return 1-this.getMap().getView().getValueForResolutionFunction()(n)},t}(le),lai=function(n){function t(t){var i=t||{},e,f;n.call(this,{element:document.createElement("div"),target:i.target});this.extent=i.extent?i.extent:null;var s=void 0!==i.className?i.className:"ol-zoom-extent",u=void 0!==i.label?i.label:"E",h=void 0!==i.tipLabel?i.tipLabel:"Fit to extent",r=document.createElement("button");r.setAttribute("type","button");r.title=h;r.appendChild("string"==typeof u?document.createTextNode(u):u);o(r,a.CLICK,this.handleClick_,this);e=s+" "+ie+" "+gh;f=this.element;f.className=e;f.appendChild(r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.handleClick_=function(n){n.preventDefault();this.handleZoomToExtent()},t.prototype.handleZoomToExtent=function(){var n=this.getMap().getView(),t=this.extent?this.extent:n.getProjection().getExtent();n.fit(t)},t}(le),r={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};r.events.condition={};r.extent={};r.featureloader={};r.format={};r.format.filter={};r.geom={};r.has={};r.interaction={};r.layer={};r.loadingstrategy={};r.proj={};r.proj.Units={};r.proj.proj4={};r.render={};r.render.canvas={};r.renderer={};r.renderer.canvas={};r.renderer.webgl={};r.size={};r.source={};r.sphere={};r.style={};r.style.IconImageCache={};r.tilegrid={};r.xml={};r.Collection=er;r.Feature=fi;r.Geolocation=rkt;r.Graticule=iet;r.Kinetic=ret;r.Map=yst;r.Object=rf;r.Observable=kk;r.Observable.unByKey=function(n){if(Array.isArray(n))for(var t=0,i=n.length;t<i;++t)lt(n[t]);else lt(n)};r.Overlay=pst;r.PluggableMap=hg;r.View=fg;r.WebGLMap=wti;r.array.stableSort=gk;r.color.asArray=yh;r.color.asString=vh;r.colorlike.asColorLike=du;r.control.Attribution=cg;r.control.Attribution.render=det;r.control.Control=le;r.control.FullScreen=dwt;r.control.MousePosition=nbt;r.control.MousePosition.render=gwt;r.control.OverviewMap=sai;r.control.OverviewMap.render=tbt;r.control.Rotate=lg;r.control.Rotate.render=get;r.control.ScaleLine=rbt;r.control.ScaleLine.render=ibt;r.control.Zoom=ag;r.control.ZoomSlider=cai;r.control.ZoomSlider.render=ubt;r.control.ZoomToExtent=lai;r.control.defaults=vg;r.coordinate.add=ka;r.coordinate.createStringXY=function(n){return function(t){return bft(t,n)}};r.coordinate.format=wft;r.coordinate.rotate=da;r.coordinate.toStringHDMS=function(n,t){return n?kp("NS",n[1],t)+" "+kp("EW",n[0],t):""};r.coordinate.toStringXY=bft;r.easing.easeIn=ug;r.easing.easeOut=cf;r.easing.inAndOut=fw;r.easing.linear=pet;r.easing.upAndDown=function(n){return n<.5?fw(2*n):1-fw(2*(n-.5))};r.events.condition.altKeyOnly=iot;r.events.condition.altShiftKeysOnly=rot;r.events.condition.always=iv;r.events.condition.click=function(n){return n.type==ht.CLICK};r.events.condition.doubleClick=function(n){return n.type==ht.DBLCLICK};r.events.condition.focus=wg;r.events.condition.mouseOnly=ae;r.events.condition.never=bg;r.events.condition.noModifierKeys=yw;r.events.condition.platformModifierKeyOnly=function(n){var t=n.originalEvent;return!t.altKey&&(vft?t.metaKey:t.ctrlKey)&&!t.shiftKey};r.events.condition.pointerMove=fot;r.events.condition.primaryAction=eot;r.events.condition.shiftKeyOnly=rv;r.events.condition.singleClick=kg;r.events.condition.targetNotEditable=dg;r.extent.applyTransform=la;r.extent.boundingExtent=hi;r.extent.buffer=ff;r.extent.containsCoordinate=tp;r.extent.containsExtent=lr;r.extent.containsXY=ip;r.extent.createEmpty=eut;r.extent.equals=oe;r.extent.extend=rp;r.extent.getArea=up;r.extent.getBottomLeft=de;r.extent.getBottomRight=fh;r.extent.getCenter=su;r.extent.getHeight=ti;r.extent.getIntersection=of;r.extent.getSize=function(n){return[n[2]-n[0],n[3]-n[1]]};r.extent.getTopLeft=bf;r.extent.getTopRight=ao;r.extent.getWidth=wt;r.extent.intersects=dt;r.extent.isEmpty=eh;r.featureloader.xhr=uct;r.format.EsriJSON=ffi;r.format.Feature=dl;r.format.GML=hfi;r.format.GML2=oy;r.format.GML3=et;r.format.GML32=afi;r.format.GPX=fat;r.format.GeoJSON=eat;r.format.IGC=gei;r.format.KML=ksi;r.format.MVT=uhi;r.format.OSMXML=eyt;r.format.Polyline=ayt;r.format.Polyline.decodeDeltas=hyt;r.format.Polyline.decodeFloats=lyt;r.format.Polyline.encodeDeltas=syt;r.format.Polyline.encodeFloats=cyt;r.format.TopoJSON=pyt;r.format.WFS=nci;r.format.WFS.writeFilter=function(n){var t=rt(lc,"Filter");return kpt(t,n,[]),t};r.format.WKT=cwt;r.format.WMSCapabilities=gci;r.format.WMSGetFeatureInfo=nli;r.format.WMTSCapabilities=pwt;r.format.filter.Bbox=byt;r.format.filter.Contains=kyt;r.format.filter.During=dyt;r.format.filter.EqualTo=gyt;r.format.filter.GreaterThan=npt;r.format.filter.GreaterThanOrEqualTo=tpt;r.format.filter.Intersects=ipt;r.format.filter.IsBetween=rpt;r.format.filter.IsLike=upt;r.format.filter.IsNull=fpt;r.format.filter.LessThan=ept;r.format.filter.LessThanOrEqualTo=opt;r.format.filter.Not=spt;r.format.filter.NotEqualTo=hpt;r.format.filter.Or=cpt;r.format.filter.Within=lpt;r.format.filter.and=apt;r.format.filter.bbox=vpt;r.format.filter.between=function(n,t,i){return new rpt(n,t,i)};r.format.filter.contains=function(n,t,i){return new kyt(n,t,i)};r.format.filter.during=function(n,t,i){return new dyt(n,t,i)};r.format.filter.equalTo=function(n,t,i){return new gyt(n,t,i)};r.format.filter.greaterThan=function(n,t){return new npt(n,t)};r.format.filter.greaterThanOrEqualTo=function(n,t){return new tpt(n,t)};r.format.filter.intersects=function(n,t,i){return new ipt(n,t,i)};r.format.filter.isNull=function(n){return new fpt(n)};r.format.filter.lessThan=function(n,t){return new ept(n,t)};r.format.filter.lessThanOrEqualTo=function(n,t){return new opt(n,t)};r.format.filter.like=function(n,t,i,r,u,f){return new upt(n,t,i,r,u,f)};r.format.filter.not=function(n){return new spt(n)};r.format.filter.notEqualTo=function(n,t,i){return new hpt(n,t,i)};r.format.filter.or=function(){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(cpt,n))};r.format.filter.within=function(n,t,i){return new lpt(n,t,i)};r.geom.Circle=ptt;r.geom.Geometry=yp;r.geom.GeometryCollection=ys;r.geom.LineString=yi;r.geom.LinearRing=lh;r.geom.MultiLineString=yf;r.geom.MultiPoint=pe;r.geom.MultiPolygon=we;r.geom.Point=ei;r.geom.Polygon=or;r.geom.Polygon.circular=lft;r.geom.Polygon.fromCircle=kd;r.geom.Polygon.fromExtent=ba;r.geom.SimpleGeometry=ce;r.getUid=y;r.has.DEVICE_PIXEL_RATIO=tl;r.has.GEOLOCATION=yft;r.has.TOUCH=dd;r.inherits=function(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n};r.interaction.DoubleClickZoom=tot;r.interaction.DragAndDrop=sui;r.interaction.DragBox=hot;r.interaction.DragPan=oot;r.interaction.DragRotate=sot;r.interaction.DragRotateAndZoom=hui;r.interaction.DragZoom=tn;r.interaction.Draw=lui;r.interaction.Draw.createBox=function(){return function(n,t){var i=hi(n),u=[[de(i),fh(i),ao(i),bf(i),de(i)]],r=t;return r?r.setCoordinates(u):r=new or(u),r}};r.interaction.Draw.createRegularPolygon=function(n,t){return function(i,r){var u=i[0],f=i[1],c=Math.sqrt(ku(u,f)),o=r||kd(new ptt(u),n),s=t,e,h;return t||(e=f[0]-u[0],h=f[1]-u[1],s=Math.atan(h/e)-(e<0?Math.PI:0)),aft(o,u,c,s),o}};r.interaction.Extent=yui;r.interaction.Interaction=ge;r.interaction.KeyboardPan=rn;r.interaction.KeyboardZoom=cot;r.interaction.Modify=bui;r.interaction.MouseWheelZoom=aot;r.interaction.PinchRotate=vot;r.interaction.PinchZoom=yot;r.interaction.Pointer=lf;r.interaction.Select=klt;r.interaction.Snap=nfi;r.interaction.Translate=ufi;r.interaction.defaults=un;r.layer.Base=eg;r.layer.Group=bet;r.layer.Heatmap=rui;r.layer.Image=tlt;r.layer.Tile=rlt;r.layer.Vector=vs;r.layer.VectorTile=uui;r.loadingstrategy.all=fct;r.loadingstrategy.bbox=function(n){return[n]};r.loadingstrategy.tile=function(n){return function(t,i){var f=n.getZForResolution(i),u=n.getTileRangeForExtentAndZ(t,f),e=[],r=[f,0,0];for(r[1]=u.minX;r[1]<=u.maxX;++r[1])for(r[2]=u.minY;r[2]<=u.maxY;++r[2])e.push(n.getTileCoordExtent(r));return e}};r.proj.Projection=va;r.proj.Units.METERS_PER_UNIT=gf;r.proj.addCoordinateTransforms=dut;r.proj.addEquivalentProjections=cp;r.proj.addProjection=fd;r.proj.equivalent=hu;r.proj.fromLonLat=function(n,t){return dc(n,"EPSG:4326",void 0!==t?t:"EPSG:3857")};r.proj.get=w;r.proj.getPointResolution=hp;r.proj.getTransform=he;r.proj.proj4.register=function(n){for(var u,f=Object.keys(n.defs),s=f.length,e,o,i,h,r,c,l,t=0;t<s;++t)e=f[t],w(e)||(o=n.defs(e),fd(new va({code:e,axisOrientation:o.axis,metersPerUnit:o.to_meter,units:o.units})));for(t=0;t<s;++t)for(i=f[t],h=w(i),u=0;u<s;++u)r=f[u],c=w(r),wut(i,r)||(n.defs[i]===n.defs[r]?cp([h,c]):(l=n(i,r),dut(h,c,l.forward,l.inverse)))};r.proj.toLonLat=function(n,t){var i=dc(n,void 0!==t?t:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||r>180)&&(i[0]=df(r+180,360)-180),i};r.proj.transform=dc;r.proj.transformExtent=bo;r.render.VectorContext=fv;r.render.canvas.labelCache=ve;r.render.toContext=function(n,t){var i=n.canvas,f=t||{},r=f.pixelRatio||tl,u=f.size,e,o;return u&&(i.width=u[0]*r,i.height=u[1]*r,i.style.width=u[0]+"px",i.style.height=u[1]+"px"),e=[0,0,i.width,i.height],o=sf([1,0,0,1,0,0],r,r),new cn(n,r,e,o,0)};r.renderer.canvas.ImageLayer=ov;r.renderer.canvas.Map=rst;r.renderer.canvas.TileLayer=sv;r.renderer.canvas.VectorLayer=ast;r.renderer.canvas.VectorTileLayer=vst;r.renderer.webgl.ImageLayer=pht;r.renderer.webgl.Map=wht;r.renderer.webgl.TileLayer=rtt;r.renderer.webgl.VectorLayer=ict;r.size.toSize=ru;r.source.BingMaps=uii;r.source.CartoDB=fii;r.source.Cluster=eii;r.source.Image=ls;r.source.ImageArcGISRest=lii;r.source.ImageCanvas=aii;r.source.ImageMapGuide=vii;r.source.ImageStatic=yii;r.source.ImageWMS=pii;r.source.OSM=wii;r.source.OSM.ATTRIBUTION=att;r.source.Raster=tri;r.source.Source=lb;r.source.Stamen=fri;r.source.Tile=gv;r.source.TileArcGISRest=ori;r.source.TileDebug=hri;r.source.TileImage=cs;r.source.TileJSON=cri;r.source.TileWMS=ari;r.source.UTFGrid=yri;r.source.Vector=ec;r.source.VectorTile=dri;r.source.WMTS=gri;r.source.WMTS.optionsFromCapabilities=function(n,t){var i=ha(n.Contents.Layer,function(n){return n.Identifier==t.layer}),u,g,tt,y,f,p,c,l,a,it,s,b,k,d;if(null===i)return null;g=n.Contents.TileMatrixSet;(u=i.TileMatrixSetLink.length>1?uut(i.TileMatrixSetLink,"projection"in t?function(n){var i=ha(g,function(t){return t.Identifier==n.TileMatrixSet}).SupportedCRS,r=w(i.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||w(i),u=w(t.projection);return r&&u?hu(r,u):i==t.projection}:function(n){return n.TileMatrixSet==t.matrixSet}):0)<0&&(u=0);var nt=i.TileMatrixSetLink[u].TileMatrixSet,rt=i.TileMatrixSetLink[u].TileMatrixSetLimits,v=i.Format[0];"format"in t&&(v=t.format);(u=uut(i.Style,function(n){return"style"in t?n.Title==t.style:n.isDefault}))<0&&(u=0);tt=i.Style[u].Identifier;y={};"Dimension"in i&&i.Dimension.forEach(function(n){var i=n.Identifier,t=n.Default;void 0===t&&(t=n.Value[0]);y[i]=t});p=ha(n.Contents.TileMatrixSet,function(n){return n.Identifier==nt});c=p.SupportedCRS;(c&&(f=w(c.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||w(c)),"projection"in t)&&(l=w(t.projection),l&&(f&&!hu(l,f)||(f=l)));s=i.WGS84BoundingBox;void 0!==s&&(b=w("EPSG:4326").getExtent(),it=s[0]==b[0]&&s[2]==b[2],a=bo(s,"EPSG:4326",f),k=f.getExtent(),k&&(lr(k,a)||(a=void 0)));var ut=cct(p,a,rt),h=[],r=t.requestEncoding;if(r=void 0!==r?r:"","OperationsMetadata"in n&&"GetTile"in n.OperationsMetadata)for(var o=n.OperationsMetadata.GetTile.DCP.HTTP.Get,e=0,ft=o.length;e<ft;++e)if(o[e].Constraint){if(d=ha(o[e].Constraint,function(n){return"GetEncoding"==n.name}).AllowedValues.Value,""===r&&(r=d[0]),r!==as.KVP)break;tr(d,as.KVP)&&h.push(o[e].href)}else o[e].href&&(r=as.KVP,h.push(o[e].href));return 0===h.length&&(r=as.REST,i.ResourceURL.forEach(function(n){"tile"===n.resourceType&&(v=n.format,h.push(n.template))})),{urls:h,layer:t.layer,matrixSet:nt,format:v,projection:f,requestEncoding:r,tileGrid:ut,style:tt,dimensions:y,wrapX:it,crossOrigin:t.crossOrigin}};r.source.XYZ=bb;r.source.Zoomify=tui;r.sphere.getArea=function n(t,i){var v=i||{},s=v.radius||aa,p=v.projection||"EPSG:3857",l=t.getType(),e,h,r,o,c,y,u,a;l!==f.GEOMETRY_COLLECTION&&(t=t.clone().transform(p,"EPSG:4326"));u=0;switch(l){case f.POINT:case f.MULTI_POINT:case f.LINE_STRING:case f.MULTI_LINE_STRING:case f.LINEAR_RING:break;case f.POLYGON:for(e=t.getCoordinates(),u=Math.abs(op(e[0],s)),r=1,o=e.length;r<o;++r)u-=Math.abs(op(e[r],s));break;case f.MULTI_POLYGON:for(r=0,o=(e=t.getCoordinates()).length;r<o;++r)for(h=e[r],u+=Math.abs(op(h[0],s)),c=1,y=h.length;c<y;++c)u-=Math.abs(op(h[c],s));break;case f.GEOMETRY_COLLECTION:for(a=t.getGeometries(),r=0,o=a.length;r<o;++r)u+=n(a[r],i);break;default:throw new Error("Unsupported geometry type: "+l);}return u};r.sphere.getDistance=ep;r.sphere.getLength=function n(t,i){var a=i||{},h=a.radius||aa,p=a.projection||"EPSG:3857",c=t.getType(),o,v,r,u,s,y,e,l;c!==f.GEOMETRY_COLLECTION&&(t=t.clone().transform(p,"EPSG:4326"));e=0;switch(c){case f.POINT:case f.MULTI_POINT:break;case f.LINE_STRING:case f.LINEAR_RING:e=id(o=t.getCoordinates(),h);break;case f.MULTI_LINE_STRING:case f.POLYGON:for(r=0,u=(o=t.getCoordinates()).length;r<u;++r)e+=id(o[r],h);break;case f.MULTI_POLYGON:for(r=0,u=(o=t.getCoordinates()).length;r<u;++r)for(s=0,y=(v=o[r]).length;s<y;++s)e+=id(v[s],h);break;case f.GEOMETRY_COLLECTION:for(l=t.getGeometries(),r=0,u=l.length;r<u;++r)e+=n(l[r],i);break;default:throw new Error("Unsupported geometry type: "+c);}return e};r.style.AtlasManager=aht;r.style.Circle=ett;r.style.Fill=te;r.style.Icon=vb;r.style.IconImageCache.shared=ev;r.style.Image=ftt;r.style.RegularShape=lct;r.style.Stroke=hf;r.style.Style=wl;r.style.Text=nv;r.tilegrid.TileGrid=yl;r.tilegrid.WMTS=hct;r.tilegrid.WMTS.createFromCapabilitiesMatrixSet=cct;r.tilegrid.createXYZ=pl;r.xml.getAllTextContent=fu;r.xml.parse=ue;t.default=r}]).default})