3 lines
439 KiB
JavaScript
3 lines
439 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).ol={})}(this,(function(t){"use strict";function e(){return function(){throw new Error("Unimplemented abstract method.")}()}var n=0;function i(t){return t.ol_uid||(t.ol_uid=String(++n))}var r,o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=this,i="Assertion failed. See https://openlayers.org/en/"+("v"+"6.4.3".split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,i)||this).code=e,n.name="AssertionError",n.message=i,n}return o(e,t),e}(Error),s=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),l="propertychange",u=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function h(t,e){return t>e?1:t<e?-1:0}function c(t,e){return t.indexOf(e)>=0}function p(t,e,n){var i=t.length;if(t[0]<=e)return 0;if(e<=t[i-1])return i-1;var r=void 0;if(n>0){for(r=1;r<i;++r)if(t[r]<e)return r-1}else if(n<0){for(r=1;r<i;++r)if(t[r]<=e)return r}else for(r=1;r<i;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return i-1}function f(t,e,n){for(;e<n;){var i=t[e];t[e]=t[n],t[n]=i,++e,--n}}function d(t,e){for(var n=Array.isArray(e)?e:[e],i=n.length,r=0;r<i;r++)t[t.length]=n[r]}function g(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function _(){return!0}function y(){return!1}function v(){}var m="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1,r=arguments.length;i<r;++i){var o=arguments[i];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])}return n};function x(t){for(var e in t)delete t[e]}var w="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function S(t){var e;for(e in t)return!1;return!e}var C=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return C(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);-1===i.indexOf(e)&&i.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new s(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var i,r=this.listeners_&&this.listeners_[n];if(r){var o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];for(var l=0,u=r.length;l<u;++l)if(!1===(i="handleEvent"in r[l]?r[l].handleEvent(e):r[l].call(this,e))||e.propagationStopped){i=!1;break}if(--o[n],0===o[n]){var h=a[n];for(delete a[n];h--;)this.removeEventListener(n,v);delete o[n]}return i}},e.prototype.disposeInternal=function(){this.listeners_&&x(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var i=n.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=v,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}},e}(u),E="change",T="error",P="contextmenu",R="click",F="dblclick",O="dragenter",I="dragover",A="drop",M="keydown",L="keypress",k="load",D="resize",G="touchmove",j="wheel";function N(t,e,n,i,r){if(i&&i!==t&&(n=n.bind(i)),r){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function z(t,e,n,i){return N(t,e,n,i,!0)}function B(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var U=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),X=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return U(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(E)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=N(this,t[r],e);return i}return N(this,t,e)},e.prototype.once=function(t,e){var n;if(Array.isArray(t)){var i=t.length;n=new Array(i);for(var r=0;r<i;++r)n[r]=z(this,t[r],e)}else n=z(this,t,e);return e.ol_key=n,n},e.prototype.un=function(t,e){var n=e.ol_key;if(n)W(n);else if(Array.isArray(t))for(var i=0,r=t.length;i<r;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)},e}(b);function W(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)B(t[e]);else B(t)}var V=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),K=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.key=n,r.oldValue=i,r}return V(e,t),e}(s),Y=function(t){function e(e){var n=t.call(this)||this;return i(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return V(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&m({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n=H(t),this.dispatchEvent(new K(n,t,e)),n=l,this.dispatchEvent(new K(n,t,e))},e.prototype.set=function(t,e,n){var i=this.values_||(this.values_={});if(n)i[t]=e;else{var r=i[t];i[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],S(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(X),Z={};function H(t){return Z.hasOwnProperty(t)?Z[t]:Z[t]="change:"+t}var q="add",J="remove",Q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$="length",tt=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.element=n,r.index=i,r}return Q(e,t),e}(s),et=function(t){function e(e,n){var i=t.call(this)||this,r=n||{};if(i.unique_=!!r.unique,i.array_=e||[],i.unique_)for(var o=0,a=i.array_.length;o<a;++o)i.assertUnique_(i.array_[o],o);return i.updateLength_(),i}return Q(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,n=0,i=e.length;n<i;++n)t(e[n],n,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get($)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new tt(q,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,n=0,i=e.length;n<i;++n)if(e[n]===t)return this.removeAt(n)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new tt(J,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new tt(J,i,t)),this.dispatchEvent(new tt(q,e,t))}else{for(var r=n;r<t;++r)this.insertAt(r,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set($,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var n=0,i=this.array_.length;n<i;++n)if(this.array_[n]===t&&n!==e)throw new a(58)},e}(Y);function nt(t,e){if(!t)throw new a(e)}var it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),rt=function(t){function e(e){var n=t.call(this)||this;if(n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addEventListener(H(n.geometryName_),n.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;n.setGeometry(i)}else{var r=e;n.setProperties(r)}return n}return it(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&t.setGeometry(n.clone());var i=this.getStyle();return i&&t.setStyle(i),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(B(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=N(t,E,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(nt("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(H(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(H(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Y);var ot="XY",at="XYZ",st="XYM",lt="XYZM",ut="Point",ht="LineString",ct="LinearRing",pt="Polygon",ft="MultiPoint",dt="MultiLineString",gt="MultiPolygon",_t="GeometryCollection",yt="Circle",vt="degrees",mt="ft",xt="m",wt="tile-pixels",St="us-ft",Ct={};Ct[vt]=2*Math.PI*6370997/360,Ct[mt]=.3048,Ct[xt]=1,Ct[St]=1200/3937;var bt=new Array(6);function Et(t){return Pt(t,1,0,0,1,0,0)}function Tt(t,e){var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=n*l+r*u,t[1]=i*l+o*u,t[2]=n*h+r*c,t[3]=i*h+o*c,t[4]=n*p+r*f+a,t[5]=i*p+o*f+s,t}function Pt(t,e,n,i,r,o,a){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=o,t[5]=a,t}function Rt(t,e){var n=e[0],i=e[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function Ft(t,e,n,i,r,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=i*u,t[1]=r*l,t[2]=-i*l,t[3]=r*u,t[4]=a*i*u-s*i*l+e,t[5]=a*r*l+s*r*u+n,t}function Ot(t,e){var n,i=(n=e)[0]*n[3]-n[1]*n[2];nt(0!==i,32);var r=e[0],o=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/i,t[1]=-o/i,t[2]=-a/i,t[3]=r/i,t[4]=(a*u-s*l)/i,t[5]=-(r*u-o*l)/i,t}function It(t){return"matrix("+t.join(", ")+")"}var At="bottom-left",Mt="bottom-right",Lt="top-left",kt="top-right",Dt=0,Gt=1,jt=2,Nt=4,zt=8,Bt=16;function Ut(t){for(var e=qt(),n=0,i=t.length;n<i;++n)re(e,t[n]);return e}function Xt(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Wt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Vt(t,e,n){var i,r;return(i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*i+(r=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*r}function Kt(t,e){return Zt(t,e[0],e[1])}function Yt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Zt(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function Ht(t,e){var n=t[0],i=t[1],r=t[2],o=t[3],a=e[0],s=e[1],l=Dt;return a<n?l|=Bt:a>r&&(l|=Nt),s<i?l|=zt:s>o&&(l|=jt),l===Dt&&(l=Gt),l}function qt(){return[1/0,1/0,-1/0,-1/0]}function Jt(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]}function Qt(t){return Jt(1/0,1/0,-1/0,-1/0,t)}function $t(t,e){var n=t[0],i=t[1];return Jt(n,i,n,i,e)}function te(t,e){return function(t,e){for(var n=0,i=e.length;n<i;++n)re(t,e[n]);return t}(Qt(e),t)}function ee(t,e,n,i,r){return oe(Qt(r),t,e,n,i)}function ne(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ie(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function re(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function oe(t,e,n,i,r){for(;n<i;n+=r)ae(t,e[n],e[n+1]);return t}function ae(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function se(t,e){var n;return(n=e(ue(t)))||(n=e(he(t)))||(n=e(ye(t)))?n:(n=e(_e(t)))||!1}function le(t){var e=0;return xe(t)||(e=ve(t)*de(t)),e}function ue(t){return[t[0],t[1]]}function he(t){return[t[2],t[1]]}function ce(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function pe(t,e){var n;return e===At?n=ue(t):e===Mt?n=he(t):e===Lt?n=_e(t):e===kt?n=ye(t):nt(!1,13),n}function fe(t,e,n,i,r){var o=e*i[0]/2,a=e*i[1]/2,s=Math.cos(n),l=Math.sin(n),u=o*s,h=o*l,c=a*s,p=a*l,f=t[0],d=t[1],g=f-u+p,_=f-u-p,y=f+u-p,v=f+u+p,m=d-h-c,x=d-h+c,w=d+h+c,S=d+h-c;return Jt(Math.min(g,_,y,v),Math.min(m,x,w,S),Math.max(g,_,y,v),Math.max(m,x,w,S),r)}function de(t){return t[3]-t[1]}function ge(t,e,n){var i=n||[1/0,1/0,-1/0,-1/0];return me(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):Qt(i),i}function _e(t){return[t[0],t[3]]}function ye(t){return[t[2],t[3]]}function ve(t){return t[2]-t[0]}function me(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function xe(t){return t[2]<t[0]||t[3]<t[1]}function we(t,e,n,i){var r=[];if(i>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<i;++s)r.push(t[0]+o*s/i,t[1],t[2],t[1]+a*s/i,t[2]-o*s/i,t[3],t[0],t[3]-a*s/i);else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);for(var l=[],u=[],h=(s=0,r.length);s<h;s+=2)l.push(r[s]),u.push(r[s+1]);return function(t,e,n){return Jt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(l,u,n)}var Se=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Ct[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function Ce(t,e,n){return Math.min(Math.max(t,e),n)}var be="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ee="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Te(t,e,n,i,r,o){var a=r-n,s=o-i;if(0!==a||0!==s){var l=((t-n)*a+(e-i)*s)/(a*a+s*s);l>1?(n=r,i=o):l>0&&(n+=a*l,i+=s*l)}return Pe(t,e,n,i)}function Pe(t,e,n,i){var r=n-t,o=i-e;return r*r+o*o}function Re(t){return 180*t/Math.PI}function Fe(t){return t*Math.PI/180}function Oe(t,e){var n=t%e;return n*e<0?n+e:n}function Ie(t,e,n){return t+n*(e-t)}var Ae=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Me=6378137*Math.PI,Le=[-Me,-Me,Me,Me],ke=[-180,-85,180,85],De=function(t){function e(e){return t.call(this,{code:e,units:xt,extent:Le,global:!0,worldExtent:ke,getPointResolution:function(t,e){return t/be(e[1]/6378137)}})||this}return Ae(e,t),e}(Se),Ge=[new De("EPSG:3857"),new De("EPSG:102100"),new De("EPSG:102113"),new De("EPSG:900913"),new De("urn:ogc:def:crs:EPSG:6.18:3:3857"),new De("urn:ogc:def:crs:EPSG::3857"),new De("http://www.opengis.net/gml/srs/epsg.xml#3857")];function je(t,e,n){var i=t.length,r=n>1?n:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(i));for(var a=Me,s=0;s<i;s+=r){o[s]=a*t[s]/180;var l=6378137*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));l>a?l=a:l<-a&&(l=-a),o[s+1]=l}return o}function Ne(t,e,n){var i=t.length,r=n>1?n:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(i));for(var a=0;a<i;a+=r)o[a]=180*t[a]/Me,o[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return o}var ze=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Be=[-180,-90,180,90],Ue=6378137*Math.PI/180,Xe=function(t){function e(e,n){return t.call(this,{code:e,units:vt,extent:Be,axisOrientation:n,global:!0,metersPerUnit:Ue,worldExtent:Be})||this}return ze(e,t),e}(Se),We=[new Xe("CRS:84"),new Xe("EPSG:4326","neu"),new Xe("urn:ogc:def:crs:EPSG::4326","neu"),new Xe("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Xe("urn:ogc:def:crs:OGC:1.3:CRS84"),new Xe("urn:ogc:def:crs:OGC:2:84"),new Xe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Xe("urn:x-ogc:def:crs:EPSG:4326","neu")],Ve={};var Ke={};function Ye(t,e,n){var i=t.getCode(),r=e.getCode();i in Ke||(Ke[i]={}),Ke[i][r]=n}function Ze(t,e,n){var i=n||6371008.8,r=Fe(t[1]),o=Fe(e[1]),a=(o-r)/2,s=Fe(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(r)*Math.cos(o);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function He(t,e){for(var n=0,i=0,r=t.length;i<r-1;++i)n+=Ze(t[i],t[i+1],e);return n}function qe(t,e){for(var n=0,i=t.length,r=t[i-1][0],o=t[i-1][1],a=0;a<i;a++){var s=t[a][0],l=t[a][1];n+=Fe(s-r)*(2+Math.sin(Fe(o))+Math.sin(Fe(l))),r=s,o=l}return n*e*e/2}var Je=Object.freeze({__proto__:null,DEFAULT_RADIUS:6371008.8,getDistance:Ze,getLength:function t(e,n){var i=n||{},r=i.radius||6371008.8,o=i.projection||"EPSG:3857",a=e.getType();a!==_t&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case ut:case ft:break;case ht:case ct:f=He(s=e.getCoordinates(),r);break;case dt:case pt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)f+=He(s[u],r);break;case gt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=s[u]).length;c<p;++c)f+=He(l[c],r);break;case _t:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],n);break;default:throw new Error("Unsupported geometry type: "+a)}return f},getArea:function t(e,n){var i=n||{},r=i.radius||6371008.8,o=i.projection||"EPSG:3857",a=e.getType();a!==_t&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case ut:case ft:case ht:case dt:case ct:break;case pt:for(s=e.getCoordinates(),f=Math.abs(qe(s[0],r)),u=1,h=s.length;u<h;++u)f-=Math.abs(qe(s[u],r));break;case gt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(l=s[u],f+=Math.abs(qe(l[0],r)),c=1,p=l.length;c<p;++c)f-=Math.abs(qe(l[c],r));break;case _t:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],n);break;default:throw new Error("Unsupported geometry type: "+a)}return f},offset:function(t,e,n,i){var r=i||6371008.8,o=Fe(t[1]),a=Fe(t[0]),s=e/r,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(n));return[Re(a+Math.atan2(Math.sin(n)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l))),Re(l)]}});function Qe(t,e){var n,i,r=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],h=s[0],c=s[1],p=h-l,f=c-u,d=0===p&&0===f?0:(p*(r-l)+f*(o-u))/(p*p+f*f||0);return d<=0?(n=l,i=u):d>=1?(n=h,i=c):(n=l+d*p,i=u+d*f),[n,i]}function $e(t,e){for(var n=!0,i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function tn(t,e){var n=Math.cos(e),i=Math.sin(e),r=t[0]*n-t[1]*i,o=t[1]*n+t[0]*i;return t[0]=r,t[1]=o,t}function en(t,e){var n=t[0]-e[0],i=t[1]-e[1];return n*n+i*i}function nn(t,e){return Math.sqrt(en(t,e))}function rn(t,e){return en(t,Qe(t,e))}function on(t,e){if(e.canWrapX()){var n=ve(e.getExtent()),i=function(t,e,n){var i=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){var o=n||ve(i);r=Math.floor((t[0]-i[0])/o)}return r}(t,e,n);i&&(t[0]-=i*n)}return t}function an(t,e,n){var i;if(void 0!==e){for(var r=0,o=t.length;r<o;++r)e[r]=t[r];i=e}else i=t.slice();return i}function sn(t,e,n){if(void 0!==e&&t!==e){for(var i=0,r=t.length;i<r;++i)e[i]=t[i];t=e}return t}function ln(t){!function(t,e){Ve[t]=e}(t.getCode(),t),Ye(t,t,an)}function un(t){return"string"==typeof t?Ve[t]||null:t||null}function hn(t,e,n,i){var r,o=(t=un(t)).getPointResolutionFunc();if(o)r=o(e,n),i&&i!==t.getUnits()&&(a=t.getMetersPerUnit())&&(r=r*a/Ct[i]);else if(t.getUnits()==vt&&!i||i==vt)r=e;else{var a,s=dn(t,un("EPSG:4326")),l=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];r=(Ze((l=s(l,l,2)).slice(0,2),l.slice(2,4))+Ze(l.slice(4,6),l.slice(6,8)))/2,void 0!==(a=i?Ct[i]:t.getMetersPerUnit())&&(r/=a)}return r}function cn(t){!function(t){t.forEach(ln)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ye(e,t,an)}))}))}function pn(t,e){return t?"string"==typeof t?un(t):t:un(e)}function fn(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||dn(t,e)===an)&&n}function dn(t,e){var n=function(t,e){var n;return t in Ke&&e in Ke[t]&&(n=Ke[t][e]),n}(t.getCode(),e.getCode());return n||(n=sn),n}function gn(t,e){return dn(un(t),un(e))}function _n(t,e,n){return gn(e,n)(t,void 0,t.length)}var yn,vn,mn;function xn(t,e){return t}function wn(t,e){return t}function Sn(t,e){return t}function Cn(t,e){return t}function bn(t,e,n,i,r,o){for(var a=o||[],s=0,l=e;l<n;l+=i){var u=t[l],h=t[l+1];a[s++]=r[0]*u+r[2]*h+r[4],a[s++]=r[1]*u+r[3]*h+r[5]}return o&&a.length!=s&&(a.length=s),a}function En(t,e,n,i,r,o,a){for(var s=a||[],l=Math.cos(r),u=Math.sin(r),h=o[0],c=o[1],p=0,f=e;f<n;f+=i){var d=t[f]-h,g=t[f+1]-c;s[p++]=h+d*l-g*u,s[p++]=c+d*u+g*l;for(var _=f+2;_<f+i;++_)s[p++]=t[_]}return a&&s.length!=p&&(s.length=p),s}function Tn(t,e,n,i,r,o,a){for(var s=a||[],l=0,u=e;u<n;u+=i){s[l++]=t[u]+r,s[l++]=t[u+1]+o;for(var h=u+2;h<u+i;++h)s[l++]=t[h]}return a&&s.length!=l&&(s.length=l),s}cn(Ge),cn(We),yn=Ge,vn=je,mn=Ne,We.forEach((function(t){yn.forEach((function(e){Ye(t,e,vn),Ye(e,t,mn)}))}));var Pn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rn=[1,0,0,1,0,0],Fn=function(t){function n(){var e,n,i,r,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,n){if(!n)return this.getSimplifiedGeometry(e);var i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===r&&g(t,i)||(o=!0,r=this,i=t,n=e.apply(this,arguments)),n}),a}return Pn(n,t),n.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},n.prototype.clone=function(){return e()},n.prototype.closestPointXY=function(t,n,i,r){return e()},n.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},n.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},n.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},n.prototype.computeExtent=function(t){return e()},n.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Qt(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},n.prototype.rotate=function(t,n){e()},n.prototype.scale=function(t,n,i){e()},n.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},n.prototype.getSimplifiedGeometry=function(t){return e()},n.prototype.getType=function(){return e()},n.prototype.applyTransform=function(t){e()},n.prototype.intersectsExtent=function(t){return e()},n.prototype.translate=function(t,n){e()},n.prototype.transform=function(t,e){var n=un(t),i=n.getUnits()==wt?function(t,i,r){var o=n.getExtent(),a=n.getWorldExtent(),s=de(a)/de(o);return Ft(Rn,a[0],a[3],s,-s,0,0,0),bn(t,0,t.length,r,Rn,i),gn(n,e)(t,i,r)}:gn(n,e);return this.applyTransform(i),this},n}(Y),On=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),In=function(t){function n(){var e=t.call(this)||this;return e.layout=ot,e.stride=2,e.flatCoordinates=null,e}return On(n,t),n.prototype.computeExtent=function(t){return ee(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinates=function(){return e()},n.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.getFlatCoordinates=function(){return this.flatCoordinates},n.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},n.prototype.getLayout=function(){return this.layout},n.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},n.prototype.getSimplifiedGeometryInternal=function(t){return this},n.prototype.getStride=function(){return this.stride},n.prototype.setFlatCoordinates=function(t,e){this.stride=An(t),this.layout=t,this.flatCoordinates=e},n.prototype.setCoordinates=function(t,n){e()},n.prototype.setLayout=function(t,e,n){var i;if(t)i=An(t);else{for(var r=0;r<n;++r){if(0===e.length)return this.layout=ot,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=ot:3==t?e=at:4==t&&(e=lt);return e}(i=e.length)}this.layout=t,this.stride=i},n.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},n.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();En(n,0,n.length,i,t,e,n),this.changed()}},n.prototype.scale=function(t,e,n){var i=e;void 0===i&&(i=t);var r=n;r||(r=ce(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,n,i,r,o,a,s){for(var l=s||[],u=a[0],h=a[1],c=0,p=e;p<n;p+=i){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+r*f,l[c++]=h+o*d;for(var g=p+2;g<p+i;++g)l[c++]=t[g]}s&&l.length!=c&&(l.length=c)}(o,0,o.length,a,t,i,r,o),this.changed()}},n.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();Tn(n,0,n.length,i,t,e,n),this.changed()}},n}(Fn);function An(t){var e;return t==ot?e=2:t==at||t==st?e=3:t==lt&&(e=4),e}function Mn(t,e,n,i,r,o,a){var s,l=t[e],u=t[e+1],h=t[n]-l,c=t[n+1]-u;if(0===h&&0===c)s=e;else{var p=((r-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)s=n;else{if(p>0){for(var f=0;f<i;++f)a[f]=Ie(t[e+f],t[n+f],p);return void(a.length=i)}s=e}}for(f=0;f<i;++f)a[f]=t[s+f];a.length=i}function Ln(t,e,n,i,r){var o=t[e],a=t[e+1];for(e+=i;e<n;e+=i){var s=t[e],l=t[e+1],u=Pe(o,a,s,l);u>r&&(r=u),o=s,a=l}return r}function kn(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o){var s=n[o];r=Ln(t,e,s,i,r),e=s}return r}function Dn(t,e,n,i,r,o,a,s,l,u,h){if(e==n)return u;var c,p;if(0===r){if((p=Pe(a,s,t[e],t[e+1]))<u){for(c=0;c<i;++c)l[c]=t[e+c];return l.length=i,p}return u}for(var f=h||[NaN,NaN],d=e+i;d<n;)if(Mn(t,d-i,d,i,a,s,f),(p=Pe(a,s,f[0],f[1]))<u){for(u=p,c=0;c<i;++c)l[c]=f[c];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(p)-Math.sqrt(u))/r|0,1);if(o&&(Mn(t,n-i,e,i,a,s,f),(p=Pe(a,s,f[0],f[1]))<u)){for(u=p,c=0;c<i;++c)l[c]=f[c];l.length=i}return u}function Gn(t,e,n,i,r,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=Dn(t,e,d,i,r,o,a,s,l,u,c),e=d}return u}function jn(t,e,n,i){for(var r=0,o=n.length;r<o;++r)t[e++]=n[r];return e}function Nn(t,e,n,i){for(var r=0,o=n.length;r<o;++r)for(var a=n[r],s=0;s<i;++s)t[e++]=a[s];return e}function zn(t,e,n,i,r){for(var o=r||[],a=0,s=0,l=n.length;s<l;++s){var u=Nn(t,e,n[s],i);o[a++]=u,e=u}return o.length=a,o}function Bn(t,e,n,i,r,o,a){var s=(n-e)/i;if(s<3){for(;e<n;e+=i)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,n-i],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),f=0,d=t[p],g=t[p+1],_=t[c],y=t[c+1],v=p+i;v<c;v+=i){var m=Te(t[v],t[v+1],d,g,_,y);m>f&&(h=v,f=m)}f>r&&(l[(h-e)/i]=1,p+i<h&&u.push(p,h),h+i<c&&u.push(h,c))}for(v=0;v<s;++v)l[v]&&(o[a++]=t[e+v*i],o[a++]=t[e+v*i+1]);return a}function Un(t,e){return e*Math.round(t/e)}function Xn(t,e,n,i,r,o,a){if(e==n)return a;var s,l,u=Un(t[e],r),h=Un(t[e+1],r);e+=i,o[a++]=u,o[a++]=h;do{if(s=Un(t[e],r),l=Un(t[e+1],r),(e+=i)==n)return o[a++]=s,o[a++]=l,a}while(s==u&&l==h);for(;e<n;){var c=Un(t[e],r),p=Un(t[e+1],r);if(e+=i,c!=s||p!=l){var f=s-u,d=l-h,g=c-u,_=p-h;f*_==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&_<d||d==_||d>0&&_>d)?(s=c,l=p):(o[a++]=s,o[a++]=l,u=s,h=l,s=c,l=p)}}return o[a++]=s,o[a++]=l,a}function Wn(t,e,n,i,r,o,a,s){for(var l=0,u=n.length;l<u;++l){var h=n[l];a=Xn(t,e,h,i,r,o,a),s.push(a),e=h}return a}function Vn(t,e,n,i,r){for(var o=void 0!==r?r:[],a=0,s=e;s<n;s+=i)o[a++]=t.slice(s,s+i);return o.length=a,o}function Kn(t,e,n,i,r){for(var o=void 0!==r?r:[],a=0,s=0,l=n.length;s<l;++s){var u=n[s];o[a++]=Vn(t,e,u,i,o[a]),e=u}return o.length=a,o}function Yn(t,e,n,i,r){for(var o=void 0!==r?r:[],a=0,s=0,l=n.length;s<l;++s){var u=n[s];o[a++]=Kn(t,e,u,i,o[a]),e=u[u.length-1]}return o.length=a,o}function Zn(t,e,n,i){for(var r=0,o=t[n-i],a=t[n-i+1];e<n;e+=i){var s=t[e],l=t[e+1];r+=a*s-o*l,o=s,a=l}return r/2}function Hn(t,e,n,i){for(var r=0,o=0,a=n.length;o<a;++o){var s=n[o];r+=Zn(t,e,s,i),e=s}return r}var qn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jn=function(t){function e(e,n){var i=t.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?i.setCoordinates(e,n):i.setFlatCoordinates(n,e),i}return qn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){return i<Vt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ln(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.getArea=function(){return Zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=Bn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,ot)},e.prototype.getType=function(){return ct},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(In),Qn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$n=function(t){function e(e,n){var i=t.call(this)||this;return i.setCoordinates(e,n),i}return Qn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){var r=this.flatCoordinates,o=Pe(t,e,r[0],r[1]);if(o<i){for(var a=this.stride,s=0;s<a;++s)n[s]=r[s];return n.length=a,o}return i},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return $t(this.flatCoordinates,t)},e.prototype.getType=function(){return ut},e.prototype.intersectsExtent=function(t){return Zt(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(In);function ti(t,e,n,i,r){return!se(r,(function(r){return!ei(t,e,n,i,r[0],r[1])}))}function ei(t,e,n,i,r,o){for(var a=0,s=t[n-i],l=t[n-i+1];e<n;e+=i){var u=t[e],h=t[e+1];l<=o?h>o&&(u-s)*(o-l)-(r-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(r-s)*(h-l)<0&&a--,s=u,l=h}return 0!==a}function ni(t,e,n,i,r,o){if(0===n.length)return!1;if(!ei(t,e,n[0],i,r,o))return!1;for(var a=1,s=n.length;a<s;++a)if(ei(t,n[a-1],n[a],i,r,o))return!1;return!0}function ii(t,e,n,i,r,o,a){for(var s,l,u,c,p,f,d,g=r[o+1],_=[],y=0,v=n.length;y<v;++y){var m=n[y];for(c=t[m-i],f=t[m-i+1],s=e;s<m;s+=i)p=t[s],d=t[s+1],(g<=f&&d<=g||f<=g&&g<=d)&&(u=(g-f)/(d-f)*(p-c)+c,_.push(u)),c=p,f=d}var x=NaN,w=-1/0;for(_.sort(h),c=_[0],s=1,l=_.length;s<l;++s){p=_[s];var S=Math.abs(p-c);S>w&&ni(t,e,n,i,u=(c+p)/2,g)&&(x=u,w=S),c=p}return isNaN(x)&&(x=r[o]),a?(a.push(x,g,w),a):[x,g,w]}function ri(t,e,n,i,r){for(var o,a=[t[e],t[e+1]],s=[];e+i<n;e+=i){if(s[0]=t[e+i],s[1]=t[e+i+1],o=r(a,s))return o;a[0]=s[0],a[1]=s[1]}return!1}function oi(t,e,n,i,r){var o=oe([1/0,1/0,-1/0,-1/0],t,e,n,i);return!!me(r,o)&&(!!Yt(r,o)||(o[0]>=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||ri(t,e,n,i,(function(t,e){return function(t,e,n){var i=!1,r=Ht(t,e),o=Ht(t,n);if(r===Gt||o===Gt)i=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=n[0],f=n[1],d=(f-c)/(p-h),g=void 0,_=void 0;o&jt&&!(r&jt)&&(i=(g=p-(f-u)/d)>=a&&g<=l),i||!(o&Nt)||r&Nt||(i=(_=f-(p-l)*d)>=s&&_<=u),i||!(o&zt)||r&zt||(i=(g=p-(f-s)/d)>=a&&g<=l),i||!(o&Bt)||r&Bt||(i=(_=f-(p-a)*d)>=s&&_<=u)}return i}(r,t,e)})))))}function ai(t,e,n,i,r){if(!function(t,e,n,i,r){return!!oi(t,e,n,i,r)||(!!ei(t,e,n,i,r[0],r[1])||(!!ei(t,e,n,i,r[0],r[3])||(!!ei(t,e,n,i,r[2],r[1])||!!ei(t,e,n,i,r[2],r[3]))))}(t,e,n[0],i,r))return!1;if(1===n.length)return!0;for(var o=1,a=n.length;o<a;++o)if(ti(t,n[o-1],n[o],i,r)&&!oi(t,n[o-1],n[o],i,r))return!1;return!0}function si(t,e,n,i){for(;e<n-i;){for(var r=0;r<i;++r){var o=t[e+r];t[e+r]=t[n-i+r],t[n-i+r]=o}e+=i,n-=i}}function li(t,e,n,i){for(var r=!0,o=0;o<i;++o)if(t[e+o]!==t[n-i+o]){r=!1;break}r&&(n-=i);var a=function(t,e,n,i){for(var r=-1,o=1/0,a=1/0,s=e;s<n;s+=i){var l=t[s],u=t[s+1];u>o||(u==o&&l>=a||(r=s,o=u,a=l))}return r}(t,e,n,i),s=a-i;s<e&&(s=n-i);var l=a+i;l>=n&&(l=e);var u=t[s],h=t[s+1],c=t[a],p=t[a+1],f=t[l],d=t[l+1];return c*d+u*p+h*f-(h*c+p*f+u*d)<0}function ui(t,e,n,i,r){for(var o=void 0!==r&&r,a=0,s=n.length;a<s;++a){var l=n[a],u=li(t,e,l,i);if(0===a){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function hi(t,e,n,i,r){for(var o=void 0!==r&&r,a=0,s=n.length;a<s;++a){var l=n[a],u=li(t,e,l,i);(0===a?o&&u||!o&&!u:o&&!u||!o&&u)&&si(t,e,l,i),e=l}return e}function ci(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o)e=hi(t,e,n[o],i,r);return e}var pi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fi=function(t){function e(e,n,i){var r=t.call(this)||this;return r.ends_=[],r.flatInteriorPointRevision_=-1,r.flatInteriorPoint_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,void 0!==n&&i?(r.setFlatCoordinates(n,e),r.ends_=i):r.setCoordinates(e,n),r}return pi(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,n,i){return i<Vt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(kn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.containsXY=function(t,e){return ni(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Hn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?hi(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Kn(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=ce(this.getExtent());this.flatInteriorPoint_=ii(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new $n(this.getFlatInteriorPoint(),st)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Jn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,i=[],r=0,o=0,a=n.length;o<a;++o){var s=n[o],l=new Jn(e.slice(r,s),t);i.push(l),r=s}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;ui(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=hi(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=Wn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,i),new e(n,ot,i)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return ai(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=zn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(In);function di(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=[e,n,e,r,i,r,i,n,e,n];return new fi(o,ot,[o.length])}function gi(t,e,n){for(var i=e||32,r=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=r*(i+1),l=new Array(s),u=0;u<s;u+=r){l[u]=0,l[u+1]=0;for(var h=2;h<r;h++)l[u+h]=a[h]}var c=[l.length],p=new fi(l,o,c);return function(t,e,n,i){for(var r=t.getFlatCoordinates(),o=t.getStride(),a=r.length/o-1,s=i||0,l=0;l<=a;++l){var u=l*o,h=s+2*Oe(l,a)*Math.PI/a;r[u]=e[0]+n*Math.cos(h),r[u+1]=e[1]+n*Math.sin(h)}t.changed()}(p,a,t.getRadius(),n),p}var _i="prerender",yi="postrender",vi="precompose",mi="postcompose",xi="rendercomplete",wi=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();function Si(t,e,n,i,r,o,a){var s,l,u=(n-e)/i;if(1===u)s=e;else if(2===u)s=e,l=r;else if(0!==u){for(var c=t[e],p=t[e+1],f=0,d=[0],g=e+i;g<n;g+=i){var _=t[g],y=t[g+1];f+=Math.sqrt((_-c)*(_-c)+(y-p)*(y-p)),d.push(f),c=_,p=y}var v=r*f,m=function(t,e,n){for(var i,r,o=n||h,a=0,s=t.length,l=!1;a<s;)(r=+o(t[i=a+(s-a>>1)],e))<0?a=i+1:(s=i,l=!r);return l?a:~a}(d,v);m<0?(l=(v-d[-m-2])/(d[-m-1]-d[-m-2]),s=e+(-m-2)*i):s=e+m*i}var x=a>1?a:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===s?NaN:void 0===l?t[s+g]:Ie(t[s+g],t[s+i+g],l);return w}function Ci(t,e,n,i,r,o){if(n==e)return null;var a;if(r<t[e+i-1])return o?((a=t.slice(e,e+i))[i-1]=r,a):null;if(t[n-1]<r)return o?((a=t.slice(n-i,n))[i-1]=r,a):null;if(r==t[e+i-1])return t.slice(e,e+i);for(var s=e/i,l=n/i;s<l;){var u=s+l>>1;r<t[(u+1)*i-1]?l=u:s=u+1}var h=t[s*i-1];if(r==h)return t.slice((s-1)*i,(s-1)*i+i);var c=(r-h)/(t[(s+1)*i-1]-h);a=[];for(var p=0;p<i-1;++p)a.push(Ie(t[(s-1)*i+p],t[s*i+p],c));return a.push(r),a}function bi(t,e,n,i){for(var r=t[e],o=t[e+1],a=0,s=e+i;s<n;s+=i){var l=t[s],u=t[s+1];a+=Math.sqrt((l-r)*(l-r)+(u-o)*(u-o)),r=l,o=u}return a}var Ei=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ti=function(t){function e(e,n){var i=t.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?i.setCoordinates(e,n):i.setFlatCoordinates(n,e),i}return Ei(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?d(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){return i<Vt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ln(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,i))},e.prototype.forEachSegment=function(t){return ri(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=st&&this.layout!=lt)return null;var n=void 0!==e&&e;return Ci(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return Vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Si(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return bi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=Bn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,ot)},e.prototype.getType=function(){return ht},e.prototype.intersectsExtent=function(t){return oi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(In),Pi=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Ri=0,Fi=1,Oi=2,Ii=3;function Ai(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]+2*e,n[1]=t[1]+2*e,n}function Mi(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function Li(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var ki=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Li(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return e()},t.prototype.getImage=function(t){return e()},t.prototype.getHitDetectionImage=function(){return e()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return e()},t.prototype.getImageSize=function(){return e()},t.prototype.getHitDetectionImageSize=function(){return e()},t.prototype.getOrigin=function(){return e()},t.prototype.getSize=function(){return e()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Li(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),Di=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Gi=/^([a-z]*)$|^hsla?\(.*\)$/i;function ji(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}return""}var Ni=function(){var t={},e=0;return function(n){var i;if(t.hasOwnProperty(n))i=t[n];else{if(e>=1024){var r=0;for(var o in t)0==(3&r++)&&(delete t[o],--e)}i=function(t){var e,n,i,r,o;Gi.exec(t)&&(t=ji(t));if(Di.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),n=parseInt(t.substr(1+1*s,s),16),i=parseInt(t.substr(1+2*s,s),16),r=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,l&&(r=(r<<4)+r)),o=[e,n,i,r/255]}else 0==t.indexOf("rgba(")?Bi(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Bi(o)):nt(!1,14);return o}(n),t[n]=i,++e}return i}}();function zi(t){return Array.isArray(t)?t:Ni(t)}function Bi(t){return t[0]=Ce(t[0]+.5|0,0,255),t[1]=Ce(t[1]+.5|0,0,255),t[2]=Ce(t[2]+.5|0,0,255),t[3]=Ce(t[3],0,1),t}function Ui(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+n+","+i+","+(void 0===t[3]?1:t[3])+")"}function Xi(t){return Array.isArray(t)?Ui(t):t}var Wi="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Vi=-1!==Wi.indexOf("firefox"),Ki=(-1!==Wi.indexOf("safari")&&Wi.indexOf("chrom"),-1!==Wi.indexOf("webkit")&&-1==Wi.indexOf("edge")),Yi=-1!==Wi.indexOf("macintosh"),Zi="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Hi="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,qi="undefined"!=typeof Image&&Image.prototype.decode,Ji=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function Qi(t,e,n){var i=n&&n.length?n.shift():Hi?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function $i(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function tr(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var er=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),nr=["style","variant","weight","size","lineHeight","family"],ir=function(t){var e=t.match(er);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,r=nr.length;i<r;++i){var o=e[i+1];void 0!==o&&(n[nr[i]]=o)}return n.families=n.family.split(/,\s?/),n},rr=[],or=[0,0,0,0],ar=new Y;(new b).setSize=function(){console.warn("labelCache is deprecated.")};var sr,lr,ur,hr=null,cr={},pr=function(){var t,e,n=["monospace","serif"],i=n.length,r="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,l=0;l<i;++l){var u=n[l];if(e=gr(t+" "+o+" 32px "+u,r),a!=u){var h=gr(t+" "+o+" 32px "+a+","+u,r);s=s&&h!=e}}return!!s}function a(){for(var e=!0,n=ar.getKeys(),i=0,r=n.length;i<r;++i){var a=n[i];ar.get(a)<100&&(o.apply(this,a.split("\n"))?(x(cr),hr=null,sr=void 0,ar.set(a,100)):(ar.set(a,ar.get(a)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=ir(e);if(n)for(var i=n.families,r=0,s=i.length;r<s;++r){var l=i[r],u=n.style+"\n"+n.weight+"\n"+l;void 0===ar.get(u)&&(ar.set(u,100,!0),o(n.style,n.weight,l)||(ar.set(u,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),fr=(ur=cr,function(t){var e=ur[t];if(null==e)if(Hi){var n=ir(t),i=dr(t,"Žg"),r=isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight);cr[t]=r*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else lr||((lr=document.createElement("div")).innerHTML="M",lr.style.margin="0 !important",lr.style.padding="0 !important",lr.style.position="absolute !important",lr.style.left="-99999px !important"),lr.style.font=t,document.body.appendChild(lr),e=lr.offsetHeight,ur[t]=e,document.body.removeChild(lr);return e});function dr(t,e){return hr||(hr=Qi(1,1)),t!=sr&&(hr.font=t,sr=hr.font),hr.measureText(e)}function gr(t,e){return dr(t,e).width}function _r(t,e,n){if(e in n)return n[e];var i=gr(t,e);return n[e]=i,i}function yr(t,e,n,i){0!==e&&(t.translate(n,i),t.rotate(e),t.translate(-n,-i))}function vr(t,e,n,i,r,o,a,s,l,u,h){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),i.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var n=t.contextInstructions,i=0,r=n.length;i<r;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}(i,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(i,r,o,a,s,0,0,a,s)):t.drawImage(i,r,o,a,s,l,u,a*h[0],s*h[1]),t.restore()}var mr=null;var xr=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),wr=function(t){function e(e){var n=this,i=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==e.rotation?e.rotation:0,scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.anchor_=null,n.size_=null,n.imageSize_=null,n.hitDetectionImageSize_=null,n.render(),n}return xr(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionCanvas_){var t=this.createRenderOptions();this.createHitDetectionCanvas_(t)}return this.hitDetectionCanvas_},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),n=Qi(e.size*t||1,e.size*t||1);this.draw_(e,n,0,0,t||1),this.canvas_[t||1]=n.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return Oi},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e="round",n="round",i=0,r=null,o=0,a=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Xi(t),void 0===(a=this.stroke_.getWidth())&&(a=1),r=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(n=this.stroke_.getLineJoin())&&(n="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10)),{strokeStyle:t,strokeWidth:a,size:2*(this.radius_+a)+1,lineCap:e,lineDash:r,lineDashOffset:o,lineJoin:n,miterLimit:i}},e.prototype.render=function(){var t=this.createRenderOptions(),e=Qi(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;var n=e.canvas.width,i=n,r=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[n/2-r[0],n/2+r[1]],this.size_=[n,n],this.imageSize_=[i,i]},e.prototype.draw_=function(t,e,n,i,r){var o,a,s;e.setTransform(r,0,0,r,0,0),e.translate(n,i),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var u=void 0!==this.radius2_?this.radius2_:this.radius_;for(u!==this.radius_&&(l*=2),o=0;o<=l;o++)a=2*o*Math.PI/l-Math.PI/2+this.angle_,s=o%2==0?this.radius_:u,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h="#000"),e.fillStyle=Xi(h),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionCanvas_=this.getImage(1),this.fill_){var e=this.fill_.getColor(),n=0;if("string"==typeof e&&(e=zi(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var i=Qi(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,n,i){e.translate(n,i),e.beginPath();var r=this.points_;if(r===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;o!==this.radius_&&(r*=2);var a=void 0,s=void 0,l=void 0;for(a=0;a<=r;a++)l=2*a*Math.PI/r-Math.PI/2+this.angle_,s=a%2==0?this.radius_:o,e.lineTo(t.size/2+s*Math.cos(l),t.size/2+s*Math.sin(l))}e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(ki),Sr=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Cr=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this}return Sr(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(wr),br=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Rr,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,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()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Rr,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Er=null;function Tr(t,e){if(!Er){var n=new wi({color:"rgba(255,255,255,0.4)"}),i=new Pi({color:"#3399CC",width:1.25});Er=[new br({image:new Cr({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return Er}function Pr(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t[pt]=[new br({fill:new wi({color:[255,255,255,.5]})})],t[gt]=t[pt],t[ht]=[new br({stroke:new Pi({color:e,width:5})}),new br({stroke:new Pi({color:n,width:3})})],t[dt]=t[ht],t[yt]=t[pt].concat(t[ht]),t[ut]=[new br({image:new Cr({radius:6,fill:new wi({color:n}),stroke:new Pi({color:e,width:1.5})}),zIndex:1/0})],t[ft]=t[ut],t[_t]=t[pt].concat(t[ht],t[ut]),t}function Rr(t){return t.getGeometry()}var Fr="point",Or="line",Ir=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Li(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new wi({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Fr,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Li(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Ar="opacity",Mr="visible",Lr="extent",kr="zIndex",Dr="maxResolution",Gr="minResolution",jr="maxZoom",Nr="minZoom",zr="source",Br=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ur=function(t){function n(e){var n=t.call(this)||this,i=m({},e);return i[Ar]=void 0!==e.opacity?e.opacity:1,nt("number"==typeof i[Ar],64),i[Mr]=void 0===e.visible||e.visible,i[kr]=e.zIndex,i[Dr]=void 0!==e.maxResolution?e.maxResolution:1/0,i[Gr]=void 0!==e.minResolution?e.minResolution:0,i[Nr]=void 0!==e.minZoom?e.minZoom:-1/0,i[jr]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==i.className?e.className:"ol-layer",delete i.className,n.setProperties(i),n.state_=null,n}return Br(n,t),n.prototype.getClassName=function(){return this.className_},n.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=Ce(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n?n:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},n.prototype.getLayersArray=function(t){return e()},n.prototype.getLayerStatesArray=function(t){return e()},n.prototype.getExtent=function(){return this.get(Lr)},n.prototype.getMaxResolution=function(){return this.get(Dr)},n.prototype.getMinResolution=function(){return this.get(Gr)},n.prototype.getMinZoom=function(){return this.get(Nr)},n.prototype.getMaxZoom=function(){return this.get(jr)},n.prototype.getOpacity=function(){return this.get(Ar)},n.prototype.getSourceState=function(){return e()},n.prototype.getVisible=function(){return this.get(Mr)},n.prototype.getZIndex=function(){return this.get(kr)},n.prototype.setExtent=function(t){this.set(Lr,t)},n.prototype.setMaxResolution=function(t){this.set(Dr,t)},n.prototype.setMinResolution=function(t){this.set(Gr,t)},n.prototype.setMaxZoom=function(t){this.set(jr,t)},n.prototype.setMinZoom=function(t){this.set(Nr,t)},n.prototype.setOpacity=function(t){nt("number"==typeof t,64),this.set(Ar,t)},n.prototype.setVisible=function(t){this.set(Mr,t)},n.prototype.setZIndex=function(t){this.set(kr,t)},n.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},n}(Y),Xr="undefined",Wr="loading",Vr="ready",Kr="error",Yr=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zr=function(t){function e(e){var n=this,i=m({},e);delete i.source,(n=t.call(this,i)||this).mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addEventListener(H(zr),n.handleSourcePropertyChange_);var r=e.source?e.source:null;return n.setSource(r),n}return Yr(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(zr)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Xr},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(B(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=N(t,E,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return n.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(B(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(B(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=N(t,vi,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);nt(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=N(this,E,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(zr,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ur);function Hr(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}var qr=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jr="renderOrder",Qr=function(t){function e(e){var n=this,i=e||{},r=m({},i);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(n=t.call(this,r)||this).declutter_=void 0!==i.declutter&&i.declutter,n.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(i.style),n.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,n.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,n}return qr(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Jr)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(Jr,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Tr,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;if(Array.isArray(t))n=t;else nt("function"==typeof t.getZIndex,41),n=[t];e=function(){return n}}return e}(this.style_),this.changed()},e}(Zr),$r=0,to=1,eo=2,no=3,io=4,ro=5,oo=6,ao=7,so=8,lo=9,uo=10,ho=11,co=12,po=[so],fo=[co],go=[to],_o=[no],yo=function(){function t(){}return t.prototype.drawCustom=function(t,e,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),vo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),mo=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=r,o.maxLineWidth=0,o.resolution=i,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return vo(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,n,i,r,o){var a=this.coordinates.length,s=this.getBufferedMaxExtent();o&&(e+=i);var l,u,h,c=t[e],p=t[e+1],f=this.tmpCoordinate_,d=!0;for(l=e+i;l<n;l+=i)f[0]=t[l],f[1]=t[l+1],(h=Ht(s,f))!==u?(d&&(this.coordinates[a++]=c,this.coordinates[a++]=p),this.coordinates[a++]=f[0],this.coordinates[a++]=f[1],d=!1):h===Gt?(this.coordinates[a++]=f[0],this.coordinates[a++]=f[1],d=!1):d=!0,c=f[0],p=f[1],u=h;return(r&&d||l===e+i)&&(this.coordinates[a++]=c,this.coordinates[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o){var s=n[o],l=this.appendFlatCoordinates(t,e,s,i,!1,!1);r.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,n){this.beginGeometry(t,e);var i,r,o,a,s,l=t.getType(),u=t.getStride(),h=this.coordinates.length;if(l==gt){i=t.getOrientedFlatCoordinates(),a=[];var c=t.getEndss();s=0;for(var p=0,f=c.length;p<f;++p){var d=[];s=this.drawCustomCoordinates_(i,s,c[p],u,d),a.push(d)}this.instructions.push([io,h,a,t,n,Yn])}else l==pt||l==dt?(o=[],i=l==pt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),s=this.drawCustomCoordinates_(i,0,t.getEnds(),u,o),this.instructions.push([io,h,o,t,n,Kn])):l==ht||l==ft?(i=t.getFlatCoordinates(),r=this.appendFlatCoordinates(i,0,i.length,u,!1,!1),this.instructions.push([io,h,r,t,n,Vn])):l==ut&&(i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),r=this.coordinates.length,this.instructions.push([io,h,r,t,n]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var n=t.getExtent();this.beginGeometryInstruction1_=[$r,e,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[$r,e,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,i,r=e.length,o=-1;for(t=0;t<r;++t)(i=(n=e[t])[0])==ao?o=t:i==$r&&(n[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var i=t.getColor();n.fillStyle=Xi(i||"#000")}else n.fillStyle=void 0;if(e){var r=e.getColor();n.strokeStyle=Xi(r||"#000");var o=e.getLineCap();n.lineCap=void 0!==o?o:"round";var a=e.getLineDash();n.lineDash=a?a.slice():rr;var s=e.getLineDashOffset();n.lineDashOffset=s||0;var l=e.getLineJoin();n.lineJoin=void 0!==l?l:"round";var u=e.getWidth();n.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();n.miterLimit=void 0!==h?h:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[uo,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ho,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,i=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||r!=t.currentLineDash&&!g(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[ao,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Wt(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Xt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(yo),xo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),wo=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o.declutterGroups_=null,o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o}return xo(e,t),e.prototype.drawCoordinates_=function(t,e,n,i){return this.appendFlatCoordinates(t,e,n,i,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(n,0,n.length,i);this.instructions.push([oo,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([oo,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(n,0,n.length,i);this.instructions.push([oo,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([oo,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),i=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.declutterGroups_=e,this.hitDetectionImage_=r,this.image_=o,this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0]},e}(mo),So=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Co=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return So(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,i){var r=this.coordinates.length,o=this.appendFlatCoordinates(t,e,n,i,!1,!1),a=[lo,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n},e.prototype.drawLineString=function(t,e){var n=this.state,i=n.strokeStyle,r=n.lineWidth;if(void 0!==i&&void 0!==r){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ho,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],go);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(fo),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,i=n.strokeStyle,r=n.lineWidth;if(void 0!==i&&void 0!==r){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ho,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],go);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],s);this.hitDetectionInstructions.push(fo),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(fo),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(fo),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(go)},e}(mo),bo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Eo=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return bo(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,i){var r=this.state,o=void 0!==r.fillStyle,a=void 0!==r.strokeStyle,s=n.length;this.instructions.push(go),this.hitDetectionInstructions.push(go);for(var l=0;l<s;++l){var u=n[l],h=this.coordinates.length,c=this.appendFlatCoordinates(t,e,u,i,!0,!a),p=[lo,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(_o),this.hitDetectionInstructions.push(_o)),e=u}return o&&(this.instructions.push(po),this.hitDetectionInstructions.push(po)),a&&(this.instructions.push(fo),this.hitDetectionInstructions.push(fo)),e},e.prototype.drawCircle=function(t,e){var n=this.state,i=n.fillStyle,r=n.strokeStyle;if(void 0!==i||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([uo,"#000"]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([ho,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,a,!1,!1);var l=[eo,s];this.instructions.push(go,l),this.hitDetectionInstructions.push(go,l),void 0!==n.fillStyle&&(this.instructions.push(po),this.hitDetectionInstructions.push(po)),void 0!==n.strokeStyle&&(this.instructions.push(fo),this.hitDetectionInstructions.push(fo)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,i=n.fillStyle,r=n.strokeStyle;if(void 0!==i||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([uo,"#000"]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([ho,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,i=n.fillStyle,r=n.strokeStyle;if(void 0!==i||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([uo,"#000"]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([ho,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,i=0,r=n.length;i<r;++i)n[i]=Un(n[i],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(mo);function To(t,e,n,i,r){var o,a,s,l,u,h,c,p,f,d=n,g=n,_=0,y=0,v=n;for(o=n;o<i;o+=r){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,s=Math.sqrt(p*p+f*f),void 0!==h&&(y+=a,Math.acos((h*p+c*f)/(a*s))>t&&(y>_&&(_=y,d=v,g=o),y=0,v=o-r)),a=s,h=p,c=f),l=m,u=x}return(y+=s)>_?[v,o]:[d,g]}var Po=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ro={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Fo={Circle:Eo,Default:mo,Image:wo,LineString:Co,Polygon:Eo,Text:function(t){function e(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return Po(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,i=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(n||i)){var o,a,s=this.coordinates.length,l=t.getType(),u=null,h=2,c=t.getStride();if(r.placement===Or){if(!me(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(u=t.getFlatCoordinates(),l==ht)p=[u.length];else if(l==dt)p=t.getEnds();else if(l==pt)p=t.getEnds().slice(0,1);else if(l==gt){var f=t.getEndss();for(p=[],o=0,a=f.length;o<a;++o)p.push(f[o][0])}this.beginGeometry(t,e);for(var d=r.textAlign,g=0,_=void 0,y=0,v=p.length;y<v;++y){if(null==d){var m=To(r.maxAngle,u,g,p[y],c);g=m[0],_=m[1]}else _=p[y];for(o=g;o<_;o+=c)this.coordinates.push(u[o],u[o+1]);h=this.coordinates.length,g=p[y];var x=this.declutterGroups_?0===y?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(s,h,x),s=h}this.endGeometry(e)}else{var w=null;switch(r.overflow||(w=[]),l){case ut:case ft:h=(u=t.getFlatCoordinates()).length;break;case ht:u=t.getFlatMidpoint();break;case yt:u=t.getCenter();break;case dt:c=2,h=(u=t.getFlatMidpoints()).length;break;case pt:u=t.getFlatInteriorPoint(),r.overflow||w.push(u[2]/this.resolution),c=3;break;case gt:var S=t.getFlatInteriorPoints();for(u=[],o=0,a=S.length;o<a;o+=3)r.overflow||w.push(S[o+2]/this.resolution),u.push(S[o],S[o+1]);if(c=2,0==(h=u.length))return}h=this.appendFlatCoordinates(u,0,h,c,!1,!1),this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var C=r.padding;if(C!=or&&(r.scale[0]<0||r.scale[1]<0)){var b=r.padding[0],E=r.padding[1],T=r.padding[2],P=r.padding[3];r.scale[0]<0&&(E=-E,P=-P),r.scale[1]<0&&(b=-b,T=-T),C=[b,E,T,P]}var R=this.pixelRatio;this.instructions.push([oo,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,C==or?or:C.map((function(t){return t*R})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]);var F=1/R;this.hitDetectionInstructions.push([oo,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[F,F],NaN,C,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]),this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e,n){var i=this.textStrokeState_,r=this.textState_,o=this.strokeKey_,a=this.textKey_,s=this.fillKey_;this.saveTextStates_();var l=this.pixelRatio,u=Ro[r.textBaseline],h=this.textOffsetY_*l,c=this.text_,p=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([ro,t,e,u,n,r.overflow,s,r.maxAngle,l,h,o,p*l,c,a,1]),this.hitDetectionInstructions.push([ro,t,e,u,n,r.overflow,s,r.maxAngle,1,h,o,p,c,a,1/l])},e.prototype.setTextStyle=function(t,e){var n,r,o;if(t){this.declutterGroups_=e;var a=t.getFill();a?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=Xi(a.getColor()||"#000")):(r=null,this.textFillState_=r);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var l=s.getLineDash(),u=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();o.lineCap=s.getLineCap()||"round",o.lineDash=l?l.slice():rr,o.lineDashOffset=void 0===u?0:u,o.lineJoin=s.getLineJoin()||"round",o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=Xi(s.getColor()||"#000")}else o=null,this.textStrokeState_=o;n=this.textState_;var p=t.getFont()||"10px sans-serif";pr(p);var f=t.getScaleArray();n.overflow=t.getOverflow(),n.font=p,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.textBaseline=t.getTextBaseline()||"middle",n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||or,n.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),_=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==_&&_,this.textRotation_=void 0===y?0:y,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:i(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+i(r.fillStyle):""}else this.text_=""},e}(mo)},Oo=function(){function t(t,e,n,i,r){this.declutter_=r,this.declutterGroups_=null,this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.addDeclutter=function(t){var e=null;return this.declutter_&&(t?(e=this.declutterGroups_)[0][0]++:(e=[[1]],this.declutterGroups_=e)),e},t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var i in n){var r=n[i].finish();t[e][i]=r}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",i=this.buildersByZIndex_[n];void 0===i&&(i={},this.buildersByZIndex_[n]=i);var r=i[e];void 0===r&&(r=new(0,Fo[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=r);return r},t}(),Io=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ao=function(t){function n(e){var n=t.call(this)||this;return n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n}return Io(n,t),n.prototype.getFeatures=function(t){return e()},n.prototype.prepareFrame=function(t){return e()},n.prototype.renderFrame=function(t,n){return e()},n.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},n.prototype.createLoadedTileFinder=function(t,e,n){return function(i,r){var o=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,r,o)}.bind(this)},n.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r){},n.prototype.getDataAtPixel=function(t,n,i){return e()},n.prototype.getLayer=function(){return this.layer_},n.prototype.handleFontsChanged=function(){},n.prototype.handleImageChange_=function(t){t.target.getState()===Oi&&this.renderIfReadyAndVisible()},n.prototype.loadImage=function(t){var e=t.getState();return e!=Oi&&e!=Ii&&t.addEventListener(E,this.boundHandleImageChange_),e==Ri&&(t.load(),e=t.getState()),e==Oi},n.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Vr&&t.changed()},n}(X),Mo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Lo=function(t){function e(e,n,i,r){var o=t.call(this,e)||this;return o.inversePixelTransform=n,o.frameState=i,o.context=r,o}return Mo(e,t),e}(s),ko=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Do=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n}return ko(e,t),e.prototype.useContainer=function(t,e,n){var i,r,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(r=s.getContext("2d")));if(!r||0!==r.canvas.width&&r.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=r,this.containerReused=!0),!this.container){(i=document.createElement("div")).className=o;var a=i.style;a.position="absolute",a.width="100%",a.height="100%";var s=(r=Qi()).canvas;i.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=i,this.context=r}},e.prototype.clip=function(t,e,n){var i=e.pixelRatio,r=e.size[0]*i/2,o=e.size[1]*i/2,a=e.viewState.rotation,s=_e(n),l=ye(n),u=he(n),h=ue(n);Rt(e.coordinateToPixelTransform,s),Rt(e.coordinateToPixelTransform,l),Rt(e.coordinateToPixelTransform,u),Rt(e.coordinateToPixelTransform,h),t.save(),yr(t,-a,r,o),t.beginPath(),t.moveTo(s[0]*i,s[1]*i),t.lineTo(l[0]*i,l[1]*i),t.lineTo(u[0]*i,u[1]*i),t.lineTo(h[0]*i,h[1]*i),t.clip(),yr(t,a,r,o)},e.prototype.clipUnrotated=function(t,e,n){var i=_e(n),r=ye(n),o=he(n),a=ue(n);Rt(e.coordinateToPixelTransform,i),Rt(e.coordinateToPixelTransform,r),Rt(e.coordinateToPixelTransform,o),Rt(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;Rt(s,i),Rt(s,r),Rt(s,o),Rt(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var i=this.getLayer();if(i.hasListener(t)){var r=new Lo(t,this.inversePixelTransform,n,e);i.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(_i,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(yi,t,e)},e.prototype.getRenderTransform=function(t,e,n,i,r,o,a){var s=r/2,l=o/2,u=i/e,h=-u,c=-t[0]+a,p=-t[1];return Ft(this.tempTransform,s,l,u,h,-n,c,p)},e.prototype.getDataAtPixel=function(t,e,n){var i,r=Rt(this.inversePixelTransform,t.slice()),o=this.context;try{var a=Math.round(r[0]),s=Math.round(r[1]),l=document.createElement("canvas"),u=l.getContext("2d");l.width=1,l.height=1,u.clearRect(0,0,1,1),u.drawImage(o.canvas,a,s,1,1,0,0,1,1),i=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:i}return 0===i[3]?null:i},e}(Ao),Go="Circle",jo="Default",No="Image",zo="LineString",Bo="Polygon",Uo="Text";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Xo(t,e){return t(e={exports:{}},e.exports),e.exports}var Wo=Xo((function(t,e){t.exports=function(){function t(t,i,r,o,a){!function t(n,i,r,o,a){for(;o>r;){if(o-r>600){var s=o-r+1,l=i-r+1,u=Math.log(s),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(s-h)/s)*(l-s/2<0?-1:1),p=Math.max(r,Math.floor(i-l*h/s+c)),f=Math.min(o,Math.floor(i+(s-l)*h/s+c));t(n,i,p,f,a)}var d=n[i],g=r,_=o;for(e(n,r,i),a(n[o],d)>0&&e(n,r,o);g<_;){for(e(n,g,_),g++,_--;a(n[g],d)<0;)g++;for(;a(n[_],d)>0;)_--}0===a(n[r],d)?e(n,r,_):(_++,e(n,_,o)),_<=i&&(r=_+1),i<=_&&(o=_-1)}}(t,i,r||0,o||t.length-1,a||n)}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,i,r){r||(r=d(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];s(r,t.leaf?i(a):a)}return r}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,i,r,o){for(var a=[n,i];a.length;)if(!((i=a.pop())-(n=a.pop())<=r)){var s=n+Math.ceil((i-n)/r/2)*r;t(e,s,n,i,o),a.push(n,s,s,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?i(a):a;f(t,s)&&(e.leaf?n.push(a):p(t,s)?this._all(a,n):r.push(a))}e=r.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var r=e.children[i],o=e.leaf?this.toBBox(r):r;if(f(t,o)){if(e.leaf||p(t,o))return!0;n.push(r)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=d([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,i,o,a=this.data,s=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),i=l[l.length-1],n=u.pop(),o=!0),a.leaf){var h=r(t,a.children,e);if(-1!==h)return a.children.splice(h,1),l.push(a),this._condense(l),this}o||a.leaf||!p(a,s)?i?(n++,a=i.children[n],o=!1):a=null:(l.push(a),u.push(n),n=0,i=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,i){var r,a=n-e+1,s=this._maxEntries;if(a<=s)return o(r=d(t.slice(e,n+1)),this.toBBox),r;i||(i=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,i-1))),(r=d([])).leaf=!1,r.height=i;var l=Math.ceil(a/s),u=l*Math.ceil(Math.sqrt(s));g(t,e,n,u,this.compareMinX);for(var h=e;h<=n;h+=u){var c=Math.min(h+u-1,n);g(t,h,c,l,this.compareMinY);for(var p=h;p<=c;p+=l){var f=Math.min(p+l-1,c);r.children.push(this._build(t,p,f,i-1))}}return o(r,this.toBBox),r},i.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var r=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var l=e.children[s],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<o?(o=c,r=u<r?u:r,a=l):c===o&&u<r&&(r=u,a=l)}e=a||e.children[0]}var p,f;return e},i.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(i,this.data,e,r);for(o.children.push(t),s(o,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},i.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var a=this._chooseSplitIndex(n,r,i),s=d(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var i,r,o,s,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=a(t,0,d,this.toBBox),_=a(t,d,n,this.toBBox),y=(r=g,o=_,s=void 0,l=void 0,u=void 0,c=void 0,s=Math.max(r.minX,o.minX),l=Math.max(r.minY,o.minY),u=Math.min(r.maxX,o.maxX),c=Math.min(r.maxY,o.maxY),Math.max(0,u-s)*Math.max(0,c-l)),v=h(g)+h(_);y<p?(p=y,i=d,f=v<f?v:f):y===p&&v<f&&(f=v,i=d)}return i||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var r=this.toBBox,o=a(t,0,e,r),l=a(t,n-e,n,r),u=c(o)+c(l),h=e;h<n-e;h++){var p=t.children[h];s(o,t.leaf?r(p):p),u+=c(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];s(l,t.leaf?r(d):d),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)s(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}));function Vo(t,e,n,i,r,o,a,s,l,u,h,c){var p,f=[];if(c){var d=En(t,e,n,i,c,[t[e],t[e+1]]);p=d[0]>d[d.length-i]}else p=t[e]>t[n-i];for(var g,_,y=r.length,v=t[e],m=t[e+1],x=t[e+=i],w=t[e+1],S=0,C=Math.sqrt(Math.pow(x-v,2)+Math.pow(w-m,2)),b=!1,E=0;E<y;++E){for(var T=r[g=p?y-E-1:E],P=s*l(u,T,h),R=o+P/2;e<n-i&&S+C<R;)v=x,m=w,x=t[e+=i],w=t[e+1],S+=C,C=Math.sqrt(Math.pow(x-v,2)+Math.pow(w-m,2));var F=R-S,O=Math.atan2(w-m,x-v);if(p&&(O+=O>0?-Math.PI:Math.PI),void 0!==_){var I=O-_;if(b=b||0!==I,I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>a)return null}_=O;var A=F/C,M=Ie(v,x,A),L=Ie(m,w,A);f[g]=[M,L,P/2,O,T],o+=P}return b?f:[[f[0][0],f[0][1],f[0][2],f[0][3],r]]}var Ko=[1/0,1/0,-1/0,-1/0],Yo=[1,0,0,1,0,0],Zo=[],Ho=[],qo=[],Jo=[],Qo=function(){function t(t,e,n,i,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderBuffer_=r,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,i){var r=t+e+n+i;if(this.labels_[r])return this.labels_[r];var o=i?this.strokeStates[i]:null,a=n?this.fillStates[n]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],h=Ro[s.textAlign||"center"],c=i&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],g=function(t,e,n){for(var i=e.length,r=0,o=0;o<i;++o){var a=gr(t,e[o]);r=Math.max(r,a),n.push(a)}return r}(s.font,p,d),_=fr(s.font),y=g+c,v=[],m=(y+2)*u[0],x=(_*f+c)*u[1],w={width:m<0?Math.floor(m):Math.ceil(m),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",s.font),i)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(Hi?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));n&&v.push("fillStyle",a.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var S,C=.5-h,b=h*y+C*c;if(i)for(S=0;S<f;++S)v.push("strokeText",[p[S],b+C*d[S],.5*(c+_)+S*_]);if(n)for(S=0;S<f;++S)v.push("fillText",[p[S],b+C*d[S],.5*(c+_)+S*_]);return this.labels_[r]=w,w},t.prototype.replayTextBackground_=function(t,e,n,i,r,o,a,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],s&&(t.fillStyle=o[1]),this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.replayImageOrLabel_=function(t,e,n,i,r,o,a,s,l,u,h,c,p,f,d,g,_,y,v){var m=y||v;n-=o*=f[0],i-=a*=f[1];var x=g+h>r.width?r.width-h:g,w=l+c>r.height?r.height-c:l,S=_[3]+x*f[0]+_[1],C=_[0]+w*f[1]+_[2],b=n-_[3],E=i-_[0];(m||0!==p)&&(Zo[0]=b,Jo[0]=b,Zo[1]=E,Ho[1]=E,Ho[0]=b+S,qo[0]=Ho[0],qo[1]=E+C,Jo[1]=qo[1]);var T=null;if(0!==p){var P=n+o,R=i+a;T=Ft(Yo,P,R,1,1,p,-P,-R),Rt(Yo,Zo),Rt(Yo,Ho),Rt(Yo,qo),Rt(Yo,Jo),Jt(Math.min(Zo[0],Ho[0],qo[0],Jo[0]),Math.min(Zo[1],Ho[1],qo[1],Jo[1]),Math.max(Zo[0],Ho[0],qo[0],Jo[0]),Math.max(Zo[1],Ho[1],qo[1],Jo[1]),Ko)}else Jt(b,E,b+S,E+C,Ko);var F=0,O=0;if(s){var I=this.renderBuffer_;I[0]=Math.max(I[0],ve(Ko)),F=I[0],I[1]=Math.max(I[1],de(Ko)),O=I[1]}var A=t.canvas,M=v?v[2]*f[0]/2:0,L=Ko[0]-M<=(A.width+F)/e&&Ko[2]+M>=-F/e&&Ko[1]-M<=(A.height+O)/e&&Ko[3]+M>=-O/e;if(d&&(n=Math.round(n),i=Math.round(i)),s){if(!L&&1==s[0])return!1;var k=L?[t,T?T.slice(0):null,u,r,h,c,x,w,n,i,f,Ko.slice()]:null;k&&(m&&k.push(y,v,Zo.slice(0),Ho.slice(0),qo.slice(0),Jo.slice(0)),s.push(k))}else L&&(m&&this.replayTextBackground_(t,Zo,Ho,qo,Jo,y,v,!1),vr(t,T,u,r,h,c,x,w,n,i,f));return!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Rt(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,n,i){for(var r=[],o=1,a=t.length;o<a;++o){var s=(c=t[o])[11];r.push({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:e})}i||(i=new Wo(9));var l=!1;for(o=0,a=r.length;o<a;++o)if(i.collides(r[o])){l=!0;break}if(!l){i.load(r);for(var u=1,h=t.length;u<h;++u){var c,p=(c=t[u])[0],f=p.globalAlpha;f!==n&&(p.globalAlpha=n),c.length>12&&this.replayTextBackground_(c[0],c[14],c[15],c[16],c[17],c[12],c[13],!0),vr.apply(void 0,c),f!==n&&(p.globalAlpha=f)}}return t.length=1,i},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,i){var r=this.textStates[e],o=this.createLabel(t,e,i,n),a=this.strokeStates[n],s=this.pixelRatio,l=Ro[r.textAlign||"center"],u=Ro[r.textBaseline||"middle"],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*r.scale[0])+2*(.5-l)*h,anchorY:u*o.height/s+2*(.5-u)*h}},t.prototype.execute_=function(t,e,n,i,r,o,a){var s,l,u;this.declutterItems.length=0,this.pixelCoordinates_&&g(n,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=bn(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),l=this.renderedTransform_,u=n,l[0]=u[0],l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5]);for(var h,c,p,f,d,_,y,v,m,x,w,S,C,b,E,T,P,R=0,F=i.length,O=0,I=0,A=0,M=null,L=null,k=this.coordinateCache_,D=this.viewRotation_,G=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},N=this.instructions!=i||this.overlaps?0:200;R<F;){var z=i[R];switch(z[0]){case $r:(E=z[1]).getGeometry()?void 0===a||me(a,z[3])?++R:R=z[2]+1:R=z[2];break;case to:I>N&&(this.fill_(t),I=0),A>N&&(t.stroke(),A=0),I||A||(t.beginPath(),f=NaN,d=NaN),++R;break;case eo:var B=s[O=z[1]],U=s[O+1],X=s[O+2]-B,W=s[O+3]-U,V=Math.sqrt(X*X+W*W);t.moveTo(B+V,U),t.arc(B,U,V,0,2*Math.PI,!0),++R;break;case no:t.closePath(),++R;break;case io:O=z[1],h=z[2];var K=z[3],Y=z[4],Z=6==z.length?z[5]:void 0;j.geometry=K,j.feature=E,R in k||(k[R]=[]);var H=k[R];Z?Z(s,O,h,2,H):(H[0]=s[O],H[1]=s[O+1],H.length=2),Y(H,j),++R;break;case oo:O=z[1],h=z[2],x=z[3],c=z[4],p=z[5],m=o?null:z[6];var q=z[7],J=z[8],Q=z[9],$=z[10],tt=z[11],et=z[12],nt=z[13],it=z[14];if(!x&&z.length>=19){w=z[18],S=z[19],C=z[20],b=z[21];var rt=this.drawLabelWithPointPlacement_(w,S,C,b);x=rt.label,z[3]=x;var ot=z[22];c=(rt.anchorX-ot)*this.pixelRatio,z[4]=c;var at=z[23];p=(rt.anchorY-at)*this.pixelRatio,z[5]=p,q=x.height,z[7]=q,it=x.width,z[14]=it}var st=void 0;z.length>24&&(st=z[24]);var lt=void 0,ut=void 0,ht=void 0;z.length>16?(lt=z[15],ut=z[16],ht=z[17]):(lt=or,ut=!1,ht=!1),tt&&G?et+=D:tt||G||(et-=D);for(var ct=0,pt=0;O<h;O+=2)if(!(st&&st[ct++]<it/this.pixelRatio)){if(m){var ft=Math.floor(pt);v=m.length<ft+1?[m[0][0]]:m[ft]}(It=this.replayImageOrLabel_(t,e,s[O],s[O+1],x,c,p,v,q,J,Q,$,et,nt,r,it,lt,ut?M:null,ht?L:null))&&v&&m[m.length-1]!==v&&m.push(v),v&&(v.length-1===v[0]&&this.declutterItems.push(this,v,E),pt+=1/v[0])}++R;break;case ro:var dt=z[1],gt=z[2],_t=z[3];v=o?null:z[4];var yt=z[5];b=z[6];var vt=z[7],mt=z[8],xt=z[9];C=z[10];var wt=z[11];w=z[12],S=z[13];var St=[z[14],z[14]],Ct=this.textStates[S],bt=Ct.font,Et=[Ct.scale[0]*mt,Ct.scale[1]*mt],Tt=void 0;bt in this.widths_?Tt=this.widths_[bt]:(Tt={},this.widths_[bt]=Tt);var Pt=bi(s,dt,gt,2),Rt=Math.abs(Et[0])*_r(bt,w,Tt);if(yt||Rt<=Pt){var Ft=this.textStates[S].textAlign,Ot=Vo(s,dt,gt,2,w,(Pt-Rt)*Ro[Ft],vt,Math.abs(Et[0]),_r,bt,Tt,G?0:this.viewRotation_);if(Ot){var It=!1,At=void 0,Mt=void 0,Lt=void 0,kt=void 0,Dt=void 0;if(C)for(At=0,Mt=Ot.length;At<Mt;++At)Lt=(Dt=Ot[At])[4],kt=this.createLabel(Lt,S,"",C),c=Dt[2]+wt,p=_t*kt.height+2*(.5-_t)*wt*Et[1]/Et[0]-xt,It=this.replayImageOrLabel_(t,e,Dt[0],Dt[1],kt,c,p,v,kt.height,1,0,0,Dt[3],St,!1,kt.width,or,null,null)||It;if(b)for(At=0,Mt=Ot.length;At<Mt;++At)Lt=(Dt=Ot[At])[4],kt=this.createLabel(Lt,S,b,""),c=Dt[2],p=_t*kt.height-xt,It=this.replayImageOrLabel_(t,e,Dt[0],Dt[1],kt,c,p,v,kt.height,1,0,0,Dt[3],St,!1,kt.width,or,null,null)||It;It&&this.declutterItems.push(this,v,E)}}++R;break;case ao:if(void 0!==o){var Gt=o(E=z[1]);if(Gt)return Gt}++R;break;case so:N?I++:this.fill_(t),++R;break;case lo:for(O=z[1],h=z[2],T=s[O],y=(P=s[O+1])+.5|0,(_=T+.5|0)===f&&y===d||(t.moveTo(T,P),f=_,d=y),O+=2;O<h;O+=2)_=(T=s[O])+.5|0,y=(P=s[O+1])+.5|0,O!=h-2&&_===f&&y===d||(t.lineTo(T,P),f=_,d=y);++R;break;case uo:M=z,this.alignFill_=z[2],I&&(this.fill_(t),I=0,A&&(t.stroke(),A=0)),t.fillStyle=z[1],++R;break;case ho:L=z,A&&(t.stroke(),A=0),this.setStrokeStyle_(t,z),++R;break;case co:N?A++:t.stroke(),++R;break;default:++R}}I&&this.fill_(t),A&&t.stroke()},t.prototype.execute=function(t,e,n,i,r){this.viewRotation_=i,this.execute_(t,e,n,this.instructions,r,void 0,void 0)},t.prototype.executeHitDetection=function(t,e,n,i,r){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,i,r)},t}(),$o=[Bo,Go,zo,No,Uo,jo],ta=function(){function t(t,e,n,i,r,o){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var i=t[e],r=[this.renderBuffer_||0,this.renderBuffer_||0];for(var o in i){var a=i[o];n[o]=new Qo(this.resolution_,this.pixelRatio_,this.overlaps_,a,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],i=0,r=t.length;i<r;++i)if(t[i]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r,o){var a=2*(i=Math.round(i))+1,s=Ft(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=Qi(a,a));var l,u=this.hitDetectionContext_;u.canvas.width!==a||u.canvas.height!==a?(u.canvas.width=a,u.canvas.height=a):u.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(re(l=[1/0,1/0,-1/0,-1/0],t),Xt(l,e*(this.renderBuffer_+i),l));var c,p=function(t){if(void 0!==ea[t])return ea[t];for(var e=2*t+1,n=new Array(e),i=0;i<e;i++)n[i]=new Array(e);var r=t,o=0,a=0;for(;r>=o;)na(n,t+r,t+o),na(n,t+o,t+r),na(n,t-o,t+r),na(n,t-r,t+o),na(n,t-r,t-o),na(n,t-o,t-r),na(n,t+o,t-r),na(n,t+r,t-o),o++,2*((a+=1+2*o)-r)+1>0&&(a+=1-2*(r-=1));return ea[t]=n,n}(i);function f(t){for(var e=u.getImageData(0,0,a,a).data,n=0;n<a;n++)for(var i=0;i<a;i++)if(p[n][i]&&e[4*(i*a+n)+3]>0){var s=void 0;return(!o||c!=No&&c!=Uo||-1!==o.indexOf(t))&&(s=r(t)),s||void u.clearRect(0,0,a,a)}}var d,g,_,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(h),d=m.length-1;d>=0;--d){var x=m[d].toString();for(_=this.executorsByZIndex_[x],g=$o.length-1;g>=0;--g)if(void 0!==(y=_[c=$o[g]])&&(v=y.executeHitDetection(u,s,n,f,l)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],i=e[1],r=e[2],o=e[3],a=[n,i,n,o,r,o,r,i];return bn(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return S(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,i,r,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(h),this.maxExtent_&&(t.save(),this.clip(t,n));var l,u,c,p,f,d,g=o||$o;for(l=0,u=s.length;l<u;++l){var _=s[l].toString();for(f=this.executorsByZIndex_[_],c=0,p=g.length;c<p;++c){var y=g[c];if(void 0!==(d=f[y]))if(!a||y!=No&&y!=Uo)d.execute(t,e,n,i,r);else{var v=a[_];v?v.push(d,n.slice(0)):a[_]=[d,n.slice(0)]}}}this.maxExtent_&&t.restore()},t}(),ea={0:[[!0]]};function na(t,e,n){var i,r=Math.floor(t.length/2);if(e>=r)for(i=r;i<e;i++)t[i][n]=!0;else if(e<r)for(i=e+1;i<r;i++)t[i][n]=!0}var ia=0,ra=1,oa=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),aa=function(t){function e(e,n,i,r,o,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=n,l.extent_=i,l.transform_=r,l.viewRotation_=o,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return oa(e,t),e.prototype.drawImages_=function(t,e,n,i){if(this.image_){var r=bn(t,e,n,2,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;u<h;u+=2){var c=r[u]-this.imageAnchorX_,p=r[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;Ft(a,f,d,1,1,l,-f,-d),o.setTransform.apply(o,a),o.translate(f,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,n,i){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var r=bn(t,e,n,i,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<n;e+=i){var s=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Ft(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);o.setTransform.apply(o,u),o.translate(s,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,s,l),this.textFillState_&&o.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,n,i,r){var o=this.context_,a=bn(t,e,n,i,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;r&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return r&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,i){for(var r=0,o=n.length;r<o;++r)e=this.moveToLineTo_(t,e,n[r],i,!0);return e},e.prototype.drawCircle=function(t){if(me(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,n){var i=t.getFlatCoordinates();if(i){var r=t.getStride();return bn(i,0,i.length,r,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],i=e[3]-e[1],r=Math.sqrt(n*n+i*i),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case ut:this.drawPoint(t);break;case ht:this.drawLineString(t);break;case pt:this.drawPolygon(t);break;case ft:this.drawMultiPoint(t);break;case dt:this.drawMultiLineString(t);break;case gt:this.drawMultiPolygon(t);break;case _t:this.drawGeometryCollection(t);break;case yt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&me(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,i=e.length;n<i;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),me(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var i=t.getFlatMidpoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(me(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,i=t.getFlatCoordinates(),r=0,o=t.getEnds(),a=t.getStride();n.beginPath();for(var s=0,l=o.length;s<l;++s)r=this.moveToLineTo_(i,r,o[s],a,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),me(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),me(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),i=0,r=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=r.length;a<s;++a){var l=r[a];i=this.drawRings_(n,i,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,i=t.textAlign?t.textAlign:"center";n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=i&&(n.textAlign=i,e.textAlign=i),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var n=t.getColor();this.fillState_={fillStyle:Xi(n||"#000")}}else this.fillState_=null;if(e){var i=e.getColor(),r=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),s=e.getLineJoin(),l=e.getWidth(),u=e.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:o||rr,lineDashOffset:a||0,lineJoin:void 0!==s?s:"round",lineWidth:this.pixelRatio_*(void 0!==l?l:1),miterLimit:void 0!==u?u:10,strokeStyle:Xi(i||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getSize();if(e){var n=t.getAnchor(),i=t.getImage(1),r=t.getOrigin(),o=t.getScaleArray();this.imageAnchorX_=n[0],this.imageAnchorY_=n[1],this.imageHeight_=e[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=[this.pixelRatio_*o[0],this.pixelRatio_*o[1]],this.imageWidth_=e[0]}else this.image_=null}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var n=e.getColor();this.textFillState_={fillStyle:Xi(n||"#000")}}else this.textFillState_=null;var i=t.getStroke();if(i){var r=i.getColor(),o=i.getLineCap(),a=i.getLineDash(),s=i.getLineDashOffset(),l=i.getLineJoin(),u=i.getWidth(),h=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:a||rr,lineDashOffset:s||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Xi(r||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),_=t.getScaleArray(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==y?y:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*_[0],this.pixelRatio_*_[1]]}else this.text_=""},e}(yo),sa="fraction",la="pixels",ua="bottom-left",ha="bottom-right",ca="top-left",pa="top-right";function fa(t,e,n){return e+":"+t+":"+(n?function(t){return"string"==typeof t?t:Ui(t)}(n):"null")}var da=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var i=fa(t,e,n);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(t,e,n,i){var r=fa(t,e,n);this.cache_[r]=i,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),ga=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_a=function(t){function n(e,n,i,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=i,o.resolution=n,o.state=r,o}return ga(n,t),n.prototype.changed=function(){this.dispatchEvent(E)},n.prototype.getExtent=function(){return this.extent},n.prototype.getImage=function(){return e()},n.prototype.getPixelRatio=function(){return this.pixelRatio_},n.prototype.getResolution=function(){return this.resolution},n.prototype.getState=function(){return this.state},n.prototype.load=function(){e()},n}(b),ya=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(t){function e(e,n,i,r,o,a){var s=t.call(this,e,n,i,Ri)||this;return s.src_=r,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=Ri,s.imageLoadFunction_=a,s}ya(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ii,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=de(this.extent)/this.image_.height),this.state=Oi,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ri&&this.state!=Ii||(this.state=Fi,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=va(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(_a);function va(t,e,n){var i=t;if(i.src&&qi){var r=i.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())})),function(){o=!1}}var a=[z(i,k,e),z(i,T,n)];return function(){a.forEach(B)}}var ma=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xa=null,wa=function(t){function e(e,n,i,r,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==r&&(s.image_.crossOrigin=r),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=i,s.src_=n,s.tainted_,s}return ma(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Oi){xa||(xa=Qi(1,1)),xa.drawImage(this.image_,0,0);try{xa.getImageData(0,0,1,1),this.tainted_=!1}catch(t){xa=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(E)},e.prototype.handleImageError_=function(){this.imageState_=Ii,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Oi,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.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=Qi(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ri){this.imageState_=Fi;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=va(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),this.isTainted_()){var i=this.color_;return n.globalCompositeOperation="multiply",n.fillStyle="rgb("+i[0]+","+i[1]+","+i[2]+")",n.fillRect(0,0,e.width,e.height),n.globalCompositeOperation="destination-in",void n.drawImage(this.image_,0,0)}for(var r=n.getImageData(0,0,e.width,e.height),o=r.data,a=this.color_[0]/255,s=this.color_[1]/255,l=this.color_[2]/255,u=0,h=o.length;u<h;u+=4)o[u]*=a,o[u+1]*=s,o[u+2]*=l;n.putImageData(r,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(b);var Sa=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ca=function(t){function e(e){var n=this,r=e||{},o=void 0!==r.opacity?r.opacity:1,a=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,l=void 0!==r.rotateWithView&&r.rotateWithView;(n=t.call(this,{opacity:o,rotation:a,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:ca,n.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:sa,n.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:sa,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var u=void 0!==r.img?r.img:null,h=void 0!==r.imgSize?r.imgSize:null,c=r.src;nt(!(void 0!==c&&u),4),nt(!u||u&&h,5),void 0!==c&&0!==c.length||!u||(c=u.src||i(u)),nt(void 0!==c&&c.length>0,6);var p=void 0!==r.src?Ri:Oi;return n.color_=void 0!==r.color?zi(r.color):null,n.iconImage_=function(t,e,n,i,r,o){var a=da.get(e,i,o);return a||(a=new wa(t,e,n,i,r,o),da.set(e,i,o,a)),a}(u,c,h,n.crossOrigin_,p,n.color_),n.offset_=void 0!==r.offset?r.offset:[0,0],n.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:ca,n.origin_=null,n.size_=void 0!==r.size?r.size:null,n}return Sa(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==sa||this.anchorYUnits_==sa){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==sa&&(t[0]*=e[0]),this.anchorYUnits_==sa&&(t[1]*=e[1])}if(this.anchorOrigin_!=ca){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=pa&&this.anchorOrigin_!=ha||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=ua&&this.anchorOrigin_!=ha||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=ca){var n=this.getSize(),i=this.iconImage_.getSize();if(!n||!i)return null;t=t.slice(),this.offsetOrigin_!=pa&&this.offsetOrigin_!=ha||(t[0]=i[0]-n[0]-t[0]),this.offsetOrigin_!=ua&&this.offsetOrigin_!=ha||(t[1]=i[1]-n[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(E,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(E,t)},e}(ki);var ba={Point:function(t,e,n,i){var r=n.getImage();if(r){if(r.getImageState()!=Oi)return;var o=t.getBuilder(n.getZIndex(),No);o.setImageStyle(r,t.addDeclutter(!1)),o.drawPoint(e,i)}var a=n.getText();if(a){var s=t.getBuilder(n.getZIndex(),Uo);s.setTextStyle(a,t.addDeclutter(!!r)),s.drawText(e,i)}},LineString:function(t,e,n,i){var r=n.getStroke();if(r){var o=t.getBuilder(n.getZIndex(),zo);o.setFillStrokeStyle(null,r),o.drawLineString(e,i)}var a=n.getText();if(a){var s=t.getBuilder(n.getZIndex(),Uo);s.setTextStyle(a,t.addDeclutter(!1)),s.drawText(e,i)}},Polygon:function(t,e,n,i){var r=n.getFill(),o=n.getStroke();if(r||o){var a=t.getBuilder(n.getZIndex(),Bo);a.setFillStrokeStyle(r,o),a.drawPolygon(e,i)}var s=n.getText();if(s){var l=t.getBuilder(n.getZIndex(),Uo);l.setTextStyle(s,t.addDeclutter(!1)),l.drawText(e,i)}},MultiPoint:function(t,e,n,i){var r=n.getImage();if(r){if(r.getImageState()!=Oi)return;var o=t.getBuilder(n.getZIndex(),No);o.setImageStyle(r,t.addDeclutter(!1)),o.drawMultiPoint(e,i)}var a=n.getText();if(a){var s=t.getBuilder(n.getZIndex(),Uo);s.setTextStyle(a,t.addDeclutter(!!r)),s.drawText(e,i)}},MultiLineString:function(t,e,n,i){var r=n.getStroke();if(r){var o=t.getBuilder(n.getZIndex(),zo);o.setFillStrokeStyle(null,r),o.drawMultiLineString(e,i)}var a=n.getText();if(a){var s=t.getBuilder(n.getZIndex(),Uo);s.setTextStyle(a,t.addDeclutter(!1)),s.drawText(e,i)}},MultiPolygon:function(t,e,n,i){var r=n.getFill(),o=n.getStroke();if(o||r){var a=t.getBuilder(n.getZIndex(),Bo);a.setFillStrokeStyle(r,o),a.drawMultiPolygon(e,i)}var s=n.getText();if(s){var l=t.getBuilder(n.getZIndex(),Uo);l.setTextStyle(s,t.addDeclutter(!1)),l.drawText(e,i)}},GeometryCollection:function(t,e,n,i){var r,o,a=e.getGeometriesArray();for(r=0,o=a.length;r<o;++r){(0,ba[a[r].getType()])(t,a[r],n,i)}},Circle:function(t,e,n,i){var r=n.getFill(),o=n.getStroke();if(r||o){var a=t.getBuilder(n.getZIndex(),Go);a.setFillStrokeStyle(r,o),a.drawCircle(e,i)}var s=n.getText();if(s){var l=t.getBuilder(n.getZIndex(),Uo);l.setTextStyle(s,t.addDeclutter(!1)),l.drawText(e,i)}}};function Ea(t,e){return parseInt(i(t),10)-parseInt(i(e),10)}function Ta(t,e){return.5*t/e}function Pa(t,e,n,i,r,o){var a=!1,s=n.getImage();if(s){var l=s.getImageState();l==Oi||l==Ii?s.unlistenImageChange(r):(l==Ri&&s.load(),l=s.getImageState(),s.listenImageChange(r),a=!0)}return function(t,e,n,i,r){var o=n.getGeometryFunction()(e);if(!o)return;var a=o.simplifyTransformed(i,r);if(n.getRenderer())!function t(e,n,i,r){if(n.getType()==_t){for(var o=n.getGeometries(),a=0,s=o.length;a<s;++a)t(e,o[a],i,r);return}e.getBuilder(i.getZIndex(),jo).drawCustom(n,r,i.getRenderer())}(t,a,n,e);else{(0,ba[a.getType()])(t,a,n,e)}}(t,e,n,i,o),a}var Ra=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fa=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.dirty_=!1,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.clipping=!0,n}return Ra(e,t),e.prototype.useContainer=function(e,n,i){i<1&&(e=null),t.prototype.useContainer.call(this,e,n,i)},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,i=t.layerStatesArray[t.layerIndex];!function(t,e,n){Pt(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),Ot(this.inversePixelTransform,this.pixelTransform);var r=It(this.pixelTransform);this.useContainer(e,r,i.opacity);var o=this.context,a=o.canvas,s=this.replayGroup_;if(!s||s.isEmpty())return!this.containerReused&&a.width>0&&(a.width=0),this.container;var l=Math.round(t.size[0]*n),u=Math.round(t.size[1]*n);a.width!=l||a.height!=u?(a.width=l,a.height=u,a.style.transform!==r&&(a.style.transform=r)):this.containerReused||o.clearRect(0,0,l,u),this.preRender(o,t);var c=t.extent,p=t.viewState,f=p.center,d=p.resolution,g=p.projection,_=p.rotation,y=g.getExtent(),v=this.getLayer().getSource(),m=!1;if(i.extent&&this.clipping){var x=Cn(i.extent);(m=!Yt(x,t.extent)&&me(x,t.extent))&&this.clipUnrotated(o,t,x)}var w=t.viewHints,S=!(w[ia]||w[ra]),C=this.getRenderTransform(f,d,_,n,l,u,0),b=this.getLayer().getDeclutter()?{}:null;if(s.execute(o,1,C,_,S,void 0,b),v.getWrapX()&&g.canWrapX()&&!Yt(y,c)){for(var E=c[0],T=ve(y),P=0,R=void 0;E<y[0];){R=T*--P;var F=this.getRenderTransform(f,d,_,n,l,u,R);s.execute(o,1,F,_,S,void 0,b),E+=T}for(P=0,E=c[2];E>y[2];){R=T*++P;var O=this.getRenderTransform(f,d,_,n,l,u,R);s.execute(o,1,O,_,S,void 0,b),E-=T}}if(b){var I=t.viewHints;!function(t,e,n,i,r,o){for(var a=Object.keys(t).map(Number).sort(h),s=0,l=a.length;s<l;++s)for(var u=t[a[s].toString()],c=void 0,p=0,f=u.length;p<f;){var d=u[p++],g=u[p++];d.execute(e,1,g,n,r),d!==c&&d.declutterItems.length>0&&(c=d,o.push({items:d.declutterItems,opacity:i}))}}(b,o,_,1,!(I[ia]||I[ra]),t.declutterItems)}m&&o.restore(),this.postRender(o,t);var A=i.opacity,M=this.container;return A!==parseFloat(M.style.opacity)&&(M.style.opacity=1===A?"":String(A)),this.renderedRotation_!==p.rotation&&(this.renderedRotation_=p.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e,n){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Rt(this.pixelTransform,i);var r=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,s=this.renderedProjection_,l=this.renderedExtent_,u=this.getLayer(),c=[],p=i[0]/2,f=i[1]/2;c.push(this.getRenderTransform(r,o,a,.5,p,f,0).slice());var d=u.getSource(),g=s.getExtent();if(d.getWrapX()&&s.canWrapX()&&!Yt(g,l)){for(var _=l[0],y=ve(g),v=0,m=void 0;_<g[0];)m=y*--v,c.push(this.getRenderTransform(r,o,a,.5,p,f,m).slice()),_+=y;for(v=0,_=l[2];_>g[2];)m=y*++v,c.push(this.getRenderTransform(r,o,a,.5,p,f,m).slice()),_-=y}this.hitDetectionImageData_=function(t,e,n,i,r,o,a){var s=Qi(t[0]/2,t[1]/2);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new aa(s,.5,r,null,a),c=n.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var g=n[d-1],_=g.getStyleFunction()||i;if(i){var y=_(g,o);if(y){Array.isArray(y)||(y=[y]);for(var v="#"+("000000"+(d*p).toString(16)).slice(-6),m=0,x=y.length;m<x;++m){var w=y[m],S=w.clone(),C=S.getFill();C&&C.setColor(v);var b=S.getStroke();b&&b.setColor(v),S.setText(void 0);var E=w.getImage();if(E){var T=E.getImageSize();if(!T)continue;var P=document.createElement("canvas");P.width=T[0],P.height=T[1];var R=P.getContext("2d",{alpha:!1});R.fillStyle=v;var F=R.canvas;R.fillRect(0,0,F.width,F.height),Qi(T?T[0]:F.width,T?T[1]:F.height).drawImage(F,0,0),S.setImage(new Ca({img:F,imgSize:T,anchor:E.getAnchor(),anchorXUnits:la,anchorYUnits:la,offset:E.getOrigin(),size:E.getSize(),opacity:E.getOpacity(),scale:E.getScale(),rotation:E.getRotation(),rotateWithView:E.getRotateWithView()}))}var O=Number(S.getZIndex());(L=f[O])||(L={},f[O]=L,L[pt]=[],L[yt]=[],L[ht]=[],L[ut]=[]);var I=S.getGeometryFunction()(g);I&&me(r,I.getExtent())&&L[I.getType().replace("Multi","")].push(I,S)}}}}for(var A=Object.keys(f).map(Number).sort(h),M=(d=0,A.length);d<M;++d){var L=f[A[d]];for(var k in L){var D=L[k];for(m=0,x=D.length;m<x;m+=2){u.setStyle(D[m+1]);for(var G=0,j=e.length;G<j;++G)u.setTransform(e[G]),u.drawGeometry(D[m])}}}return s.getImageData(0,0,l.width,l.height)}(i,c,this.renderedFeatures_,u.getStyleFunction(),l,o,a)}e(function(t,e,n){var i=[];if(n){var r=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*n.width),o=n.data[r],a=n.data[r+1],s=n.data[r+2]+256*(a+256*o),l=Math.floor(16777215/e.length);s&&s%l==0&&i.push(e[s/l-1])}return i}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,o){if(this.replayGroup_){var a=e.viewState.resolution,s=e.viewState.rotation,l=this.getLayer(),u={};return this.replayGroup_.forEachFeatureAtCoordinate(t,a,s,n,(function(t){var e=i(t);if(!(e in u))return u[e]=!0,r(t,l)}),l.getDeclutter()?o:null)}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var i=t.viewHints[ia],r=t.viewHints[ra],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&i||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Ea);var g=l.center.slice(),_=Xt(s,f*h),y=[_.slice()],v=u.getExtent();if(n.getWrapX()&&u.canWrapX()&&!Yt(v,t.extent)){var m=ve(v),x=Math.max(ve(_)/2,m);_[0]=v[0]-x,_[2]=v[2]+x,on(g,u);var w=function(t,e){var n=e.getExtent(),i=ce(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){var r=ve(n),o=Math.floor((i[0]-n[0])/r)*r;t[0]-=o,t[2]-=o}return t}(y[0],u);w[0]<v[0]&&w[2]<v[2]?y.push([w[0]+m,w[1],w[2]+m,w[3]]):w[0]>v[0]&&w[2]>v[2]&&y.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&Yt(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;for(var S=new Oo(Ta(h,c),_,h,c,e.getDeclutter()),C=0,b=y.length;C<b;++C)n.loadFeatures(y[C],h,u);var E=function(t,e){var n=Ta(t,e);return n*n}(h,c),T=function(t){var n,i=t.getStyleFunction()||e.getStyleFunction();if(i&&(n=i(t,h)),n){var r=this.renderFeature(t,E,n,S,void 0);this.dirty_=this.dirty_||r}}.bind(this),P=Sn(_),R=n.getFeaturesInExtent(P);d&&R.sort(d);for(C=0,b=R.length;C<b;++C)T(R[C]);this.renderedFeatures_=R;var F=S.finish(),O=new ta(_,h,c,n.getOverlaps(),F,e.getRenderBuffer());return this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=_,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=O,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,i,r){if(!n)return!1;var o=!1;if(Array.isArray(n))for(var a=0,s=n.length;a<s;++a)o=Pa(i,t,n[a],e,this.boundHandleStyleImageChange_,r)||o;else o=Pa(i,t,n,e,this.boundHandleStyleImageChange_,r);return o},e}(Do),Oa=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ia=function(t){function e(e){return t.call(this,e)||this}return Oa(e,t),e.prototype.createRenderer=function(){return new Fa(this)},e}(Qr),Aa=function(){function t(t){this.rbush_=new Wo(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[i(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),r=0,o=e.length;r<o;r++){var a=t[r],s=e[r],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};n[r]=l,this.items_[i(s)]=l}this.rbush_.load(n)},t.prototype.remove=function(t){var e=i(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[i(e)];ne([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var n,i=0,r=t.length;i<r;i++)if(n=e(t[i]))return n;return n},t.prototype.isEmpty=function(){return S(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Jt(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Ma=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),La=function(t){function n(e){var n=t.call(this)||this;return n.projection_=un(e.projection),n.attributions_=ka(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:Vr,n.wrapX_=void 0!==e.wrapX&&e.wrapX,n}return Ma(n,t),n.prototype.getAttributions=function(){return this.attributions_},n.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},n.prototype.getProjection=function(){return this.projection_},n.prototype.getResolutions=function(){return e()},n.prototype.getState=function(){return this.state_},n.prototype.getWrapX=function(){return this.wrapX_},n.prototype.getContextOptions=function(){},n.prototype.refresh=function(){this.changed()},n.prototype.setAttributions=function(t){this.attributions_=ka(t),this.changed()},n.prototype.setState=function(t){this.state_=t,this.changed()},n}(Y);function ka(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Da="addfeature",Ga="changefeature",ja="clear",Na="removefeature";function za(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Ba="arraybuffer",Ua="json",Xa="text",Wa="xml";function Va(t,e){return function(t,e,n,i){return function(r,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(r,o,a):t,!0),e.getType()==Ba&&(s.responseType="arraybuffer"),s.withCredentials=!1,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==Ua||o==Xa?l=s.responseText:o==Wa?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==Ba&&(l=s.response),l?n.call(this,e.readFeatures(l,{extent:r,featureProjection:a}),e.readProjection(l)):i.call(this)}else i.call(this)}.bind(this),s.onerror=function(){i.call(this)}.bind(this),s.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),v)}var Ka=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ya=function(t){function e(e,n){var i=t.call(this,e)||this;return i.feature=n,i}return Ka(e,t),e}(s),Za=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,projection:void 0,state:Vr,wrapX:void 0===i.wrapX||i.wrapX})||this).loader_=v,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(nt(n.format_,7),n.loader_=Va(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:za;var r,o,a=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=a?new Aa:null,n.loadedExtentsRtree_=new Aa,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?o=i.features:i.features&&(o=(r=i.features).getArray()),a||void 0!==r||(r=new et(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==r&&n.bindFeaturesCollection_(r),n}return Ka(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=i(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ya(Da,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[N(e,E,this.handleFeatureChange_,this),N(e,l,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,i=e.getId();return void 0!==i&&(i.toString()in this.idIndex_?n=!1:this.idIndex_[i.toString()]=e),n&&(nt(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],o=0,a=t.length;o<a;o++){var s=i(u=t[o]);this.addToIndex_(s,u)&&n.push(u)}o=0;for(var l=n.length;o<l;o++){var u;s=i(u=n[o]);this.setupChangeEvents_(s,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),r.push(u)}else this.nullGeometryFeatures_[s]=u}this.featuresRtree_&&this.featuresRtree_.load(e,r);o=0;for(var p=n.length;o<p;o++)this.dispatchEvent(new Ya(Da,n[o]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Da,(function(n){e||(e=!0,t.push(n.feature),e=!1)})),this.addEventListener(Na,(function(n){e||(e=!0,t.remove(n.feature),e=!1)})),t.addEventListener(q,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(J,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(B)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var n in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Ya(ja);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,(function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(n){if(n.getGeometry().intersectsExtent(t)){var i=e(n);if(i)return i}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),S(this.nullGeometryFeatures_)||d(t,w(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray():[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],i=t[1],r=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||_;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(n,i,o,a))<u){r=t;var h=Math.sqrt(a);s[0]=n-h,s[1]=i-h,s[2]=n+h,s[3]=i+h}}})),r},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,n=i(e),r=e.getGeometry();if(r){var o=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var a=e.getId();if(void 0!==a){var s=a.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Ya(Ga,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:i(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&S(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,n){var i=this.loadedExtentsRtree_,r=this.strategy_(t,e);this.loading=!1;for(var o=function(t,o){var s=r[t];i.forEachInExtent(s,(function(t){return Yt(t.extent,s)}))||(a.loader_.call(a,s,e,n),i.insert(s,{extent:s.slice()}),a.loading=a.loader_!==v)},a=this,s=0,l=r.length;s<l;++s)o(s)},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(ne(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=i(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=i(t);this.featureChangeKeys_[e].forEach(B),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ya(Na,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){nt(this.format_,7),this.setLoader(Va(t,this.format_))},e}(La);var Ha=0,qa=1,Ja=2,Qa=3,$a=4;function ts(t){return Math.pow(t,3)}function es(t){return 1-ts(1-t)}function ns(t){return 3*t*t-2*t*t*t}function is(t){return t}var rs=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),os=function(t){function n(e,n,i){var r=t.call(this)||this,o=i||{};return r.tileCoord=e,r.state=n,r.interimTile=null,r.hifi=!0,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return rs(n,t),n.prototype.changed=function(){this.dispatchEvent(E)},n.prototype.release=function(){},n.prototype.getKey=function(){return this.key+"/"+this.tileCoord},n.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Ja)return this.transition_=0,t;t=t.interimTile}while(t);return this},n.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Ja){t.interimTile=null;break}t.getState()==qa?e=t:t.getState()==Ha?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},n.prototype.getTileCoord=function(){return this.tileCoord},n.prototype.getState=function(){return this.state},n.prototype.setState=function(t){if(this.state!==Qa&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){e()},n.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var i=e-n+1e3/60;return i>=this.transition_?1:ts(i/this.transition_)},n.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},n.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},n}(b),as=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ss=function(t){function e(e,n,i,r,o,a){var s=t.call(this,e,n,a)||this;return s.crossOrigin_=r,s.src_=i,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.tileLoadFunction_=o,s}return as(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=Qa,this.unlistenImage_(),this.image_=((t=Qi(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Ja:this.state=$a,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Qa&&(this.state=Ha,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Ha&&(this.state=qa,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=va(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(os);var ls=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var n=e-3;n>0&&this.points_[n+2]>t;)n-=3;var i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60)return!1;var r=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),us=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),hs=function(t){function n(e){var n=t.call(this)||this;return n.map_=e,n.declutterTree_=null,n}return us(n,t),n.prototype.dispatchRenderEvent=function(t,n){e()},n.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;Ft(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ot(i,n)},n.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r,o,a,s){var l,u=e.viewState;function h(t,e,n){return r.call(o,e,t?n:null)}var c=u.projection,p=on(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&i){var d=ve(c.getExtent());f.push([-d,0],[d,0])}var g,_=e.layerStatesArray,y=_.length;this.declutterTree_&&(g=this.declutterTree_.all().map((function(t){return t.value})));for(var v=[],m=0;m<f.length;m++)for(var x=y-1;x>=0;--x){var w=_[x],S=w.layer;if(S.hasRenderer()&&Hr(w,u)&&a.call(s,S)){var C=S.getRenderer(),b=S.getSource();if(C&&b){var E=b.getWrapX()?p:t,T=h.bind(null,w.managed);v[0]=E[0]+f[m][0],v[1]=E[1]+f[m][1],l=C.forEachFeatureAtCoordinate(v,e,n,T,g)}if(l)return l}}},n.prototype.forEachLayerAtPixel=function(t,n,i,r,o){return e()},n.prototype.hasFeatureAtCoordinate=function(t,e,n,i,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,i,_,this,r,o)},n.prototype.getMap=function(){return this.map_},n.prototype.renderFrame=function(t){this.declutterTree_=function(t,e){e&&e.clear();for(var n=t.declutterItems,i=n.length-1;i>=0;--i)for(var r=n[i],o=r.items,a=0,s=o.length;a<s;a+=3)e=o[a].renderDeclutter(o[a+1],o[a+2],r.opacity,e);return n.length=0,e}(t,this.declutterTree_)},n.prototype.scheduleExpireIconCache=function(t){da.canExpireCache()&&t.postRenderFunctions.push(cs)},n}(u);function cs(t,e){da.expire()}var ps=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fs=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=N(ar,l,e.redrawText.bind(e)),n.element_=document.createElement("div");var i=n.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",n.element_.className="ol-unselectable ol-layers";var r=e.getViewport();return r.insertBefore(n.element_,r.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return ps(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var i=new Lo(t,void 0,e);n.dispatchEvent(i)}},e.prototype.disposeInternal=function(){B(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(e){if(e){this.calculateMatrices2D(e),this.dispatchRenderEvent(vi,e);var n=e.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=e.viewState;this.children_.length=0;for(var r=null,o=0,a=n.length;o<a;++o){var s=n[o];if(e.layerIndex=o,Hr(s,i)&&(s.sourceState==Vr||s.sourceState==Xr)){var l=s.layer.render(e,r);l&&l!==r&&(this.children_.push(l),r=l)}}t.prototype.renderFrame.call(this,e),function(t,e){for(var n=t.childNodes,i=0;;++i){var r=n[i],o=e[i];if(!r&&!o)break;r!==o&&(r?o?t.insertBefore(o,r):(t.removeChild(r),--i):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(mi,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,i,r){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&Hr(l,o)&&r(u)){var h=u.getRenderer().getDataAtPixel(t,e,n);if(h){var c=i(u,h);if(c)return c}}}},e}(hs),ds=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),gs="layers",_s=function(t){function e(e){var n=this,i=e||{},r=m({},i);delete r.layers;var o=i.layers;return(n=t.call(this,r)||this).layersListenerKeys_=[],n.listenerKeys_={},n.addEventListener(H(gs),n.handleLayersChanged_),o?Array.isArray(o)?o=new et(o.slice(),{unique:!0}):nt("function"==typeof o.getArray,43):o=new et(void 0,{unique:!0}),n.setLayers(o),n}return ds(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(B),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(N(t,q,this.handleLayersAdd_,this),N(t,J,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(B);x(this.listenerKeys_);for(var n=t.getArray(),r=0,o=n.length;r<o;r++){var a=n[r];this.listenerKeys_[i(a)]=[N(a,l,this.handleLayerChange_,this),N(a,E,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[i(e)]=[N(e,l,this.handleLayerChange_,this),N(e,E,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=i(t.element);this.listenerKeys_[e].forEach(B),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(gs)},e.prototype.setLayers=function(t){this.set(gs,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],n=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));for(var i=this.getLayerState(),r=n,o=e.length;r<o;r++){var a=e[r];a.opacity*=i.opacity,a.visible=a.visible&&i.visible,a.maxResolution=Math.min(a.maxResolution,i.maxResolution),a.minResolution=Math.max(a.minResolution,i.minResolution),a.minZoom=Math.max(a.minZoom,i.minZoom),a.maxZoom=Math.min(a.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==a.extent?a.extent=ge(a.extent,i.extent):a.extent=i.extent)}return e},e.prototype.getSourceState=function(){return Vr},e}(Ur),ys=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vs=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.map=n,r.frameState=void 0!==i?i:null,r}return ys(e,t),e}(s),ms=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xs=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,o)||this;return a.originalEvent=i,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==r&&r,a}return ms(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(vs),ws={SINGLECLICK:"singleclick",CLICK:R,DBLCLICK:F,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ss="pointermove",Cs="pointerdown",bs=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Es=function(t){function e(e,n){var i=t.call(this,e)||this;i.map_=e,i.clickTimeoutId_,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=n?n*Zi:Zi,i.down_=null;var r=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=r,i.pointerdownListenerKey_=N(r,Cs,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=N(r,Ss,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(G,i.boundHandleTouchMove_,!!Ji&&{passive:!1}),i}return bs(e,t),e.prototype.emulateClick_=function(t){var e=new xs(ws.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new xs(ws.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new xs(ws.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==ws.POINTERUP||e.type==ws.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==ws.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new xs(ws.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(B),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new xs(ws.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.dragListenerKeys_.push(N(document,ws.POINTERMOVE,this.handlePointerMove_,this),N(document,ws.POINTERUP,this.handlePointerUp_,this),N(this.element_,ws.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==document&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),ws.POINTERUP,this.handlePointerUp_,this)))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new xs(ws.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new xs(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(B(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(G,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(B(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(B),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(b),Ts="postrender",Ps="movestart",Rs="moveend",Fs="layergroup",Os="size",Is="target",As="view",Ms=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,x(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var i=this.keyFunction_(n);return delete this.queuedElements_[i],n},t.prototype.enqueue=function(t){nt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,i=e.length,r=e[t],o=n[t],a=t;t<i>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<i&&n[l]<n[s]?l:s;e[t]=e[u],n[t]=n[u],t=u}e[t]=r,n[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,i=this.priorities_,r=n[e],o=i[e];e>t;){var a=this.getParentIndex_(e);if(!(i[a]>o))break;n[e]=n[a],i[e]=i[a],e=a}n[e]=r,i[e]=o},t.prototype.reprioritize=function(){var t,e,n,i=this.priorityFunction_,r=this.elements_,o=this.priorities_,a=0,s=r.length;for(e=0;e<s;++e)(n=i(t=r[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=n,r[a++]=t);r.length=a,o.length=a,this.heapify_()},t}(),Ls=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ks=function(t){function e(e,n){var i=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=n,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return Ls(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(E,this.boundHandleTileChange_);return n},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(e.hifi&&n===Ja||n===Qa||n===$a){e.removeEventListener(E,this.boundHandleTileChange_);var i=e.getKey();i in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[i],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,i,r=0;this.tilesLoading_<t&&r<e&&this.getCount()>0;)i=(n=this.dequeue()[0]).getKey(),n.getState()!==Ha||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++r,n.load())},e}(Ms);var Ds="center",Gs="resolution",js="rotation";function Ns(t,e,n){return function(i,r,o,a){if(i){var s=e?0:o[0]*r,l=e?0:o[1]*r,u=t[0]+s/2,h=t[2]-s/2,c=t[1]+l/2,p=t[3]-l/2;u>h&&(h=u=(h+u)/2),c>p&&(p=c=(p+c)/2);var f=Ce(i[0],u,h),d=Ce(i[1],c,p),g=30*r;return a&&n&&(f+=-g*Math.log(1+Math.max(0,u-i[0])/g)+g*Math.log(1+Math.max(0,i[0]-h)/g),d+=-g*Math.log(1+Math.max(0,c-i[1])/g)+g*Math.log(1+Math.max(0,i[1]-p)/g)),[f,d]}}}function zs(t){return t}function Bs(t,e,n,i){var r=ve(e)/n[0],o=de(e)/n[1];return i?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function Us(t,e,n){var i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(i=Math.max(i,n),i/=Math.log(1+50*Math.max(0,n/t-1))/50+1),Ce(i,n/2,2*e)}function Xs(t,e,n,i,r){return function(o,a,s,l){if(void 0!==o){var u=i?Bs(t,i,s,r):t;return(void 0===n||n)&&l?Us(o,u,e):Ce(o,e,u)}}}function Ws(t){return void 0!==t?0:void 0}function Vs(t){return void 0!==t?t:void 0}var Ks=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ys=function(t){function e(e){var n=t.call(this)||this,i=m({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=pn(i.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.cancelAnchor_=void 0,i.center&&(i.center=wn(i.center,n.projection_)),i.extent&&(i.extent=Cn(i.extent,n.projection_)),n.applyOptions_(i),n}return Ks(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,i,r=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,a=void 0!==t.zoomFactor?t.zoomFactor:2,s=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,u=void 0!==t.showFullExtent&&t.showFullExtent,h=pn(t.projection,"EPSG:3857"),c=h.getExtent(),f=t.constrainOnlyCenter,d=t.extent;s||d||!h.isGlobal()||(f=!1,d=c);if(void 0!==t.resolutions){var g=t.resolutions;n=g[r],i=void 0!==g[o]?g[o]:g[g.length-1],e=t.constrainResolution?function(t,e,n,i){return function(r,o,a,s){if(void 0!==r){var l=t[0],u=t[t.length-1],h=n?Bs(l,n,a,i):l;if(s)return void 0===e||e?Us(r,h,u):Ce(r,u,h);var c=Math.min(h,r),f=Math.floor(p(t,c,o));return t[f]>h&&f<t.length-1?t[f+1]:t[f]}}}(g,l,!f&&d,u):Xs(n,i,l,!f&&d,u)}else{var _=(c?Math.max(ve(c),de(c)):360*Ct[vt]/h.getMetersPerUnit())/256/Math.pow(2,0),y=_/Math.pow(2,28);void 0!==(n=t.maxResolution)?r=0:n=_/Math.pow(a,r),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(a,o):_/Math.pow(a,o):y),o=r+Math.floor(Math.log(n/i)/Math.log(a)),i=n/Math.pow(a,o-r),e=t.constrainResolution?function(t,e,n,i,r,o){return function(a,s,l,u){if(void 0!==a){var h=r?Bs(e,r,l,o):e,c=void 0!==n?n:0;if(u)return void 0===i||i?Us(a,h,c):Ce(a,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-s*(.5-1e-9)+.5,d=Math.min(h,a),g=Math.floor(Math.log(e/d)/Math.log(t)+f),_=Math.max(p,g);return Ce(e/Math.pow(t,_),c,h)}}}(a,n,i,l,!f&&d,u):Xs(n,i,l,!f&&d,u)}return{constraint:e,maxResolution:n,minResolution:i,minZoom:r,zoomFactor:a}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=e.minZoom;var n=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ns(t.extent,t.constrainOnlyCenter,e)}var n=pn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var i=n.getExtent().slice();return i[0]=-1/0,i[2]=1/0,Ns(i,!1,!1)}return zs}(t),i=e.constraint,r=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=r||Fe(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Vs:"number"==typeof e?(n=e,i=2*Math.PI/n,function(t,e){return e?t:void 0!==t?t=Math.floor(t/i+.5)*i:void 0}):Vs}return Ws;var n,i;var r,o}(t);this.constraints_={center:n,resolution:i,rotation:r},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=m({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),m({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),n=0;n<e.length;++n){var i=arguments[n];i.center&&((i=m({},i)).center=wn(i.center,this.getProjection())),i.anchor&&((i=m({},i)).anchor=wn(i.anchor,this.getProjection())),e[n]=i}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,n=arguments.length;if(n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var i=arguments[n-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(e&&Zs(e,!0))}for(var r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_,l=[],u=0;u<n;++u){var h=arguments[u],c={start:r,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||ns,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=c.targetResolution),void 0!==h.rotation){c.sourceRotation=s;var p=Oe(h.rotation-s+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=s+p,s=c.targetRotation}Hs(c)?c.complete=!0:r+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(ia,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[ia]>0},e.prototype.getInteracting=function(){return this.hints_[ra]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ia,-this.hints_[ia]);for(var e=0,n=this.animations_.length;e<n;++e){var i=this.animations_[e];if(i[0].callback&&Zs(i[0].callback,!1),!t)for(var r=0,o=i.length;r<o;++r){var a=i[r];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,n=this.animations_.length-1;n>=0;--n){for(var i=this.animations_[n],r=!0,o=0,a=i.length;o<a;++o){var s=i[o];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):r=!1;var h=s.easing(u);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=c+h*(s.targetCenter[0]-c),d=p+h*(s.targetCenter[1]-p);this.targetCenter_=[f,d]}if(s.sourceResolution&&s.targetResolution){var g=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var _=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(g,0,_,!0);this.targetCenter_=this.calculateCenterZoom(y,s.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var v=1===h?Oe(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var m=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(m,s.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(r){this.animations_[n]=null,this.setHint(ia,-1);var x=i[0].callback;x&&Zs(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,i,r,o=this.getCenterInternal();return void 0!==o&&(tn(n=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),r=e,(i=n)[0]+=+r[0],i[1]+=+r[1]),n},e.prototype.calculateCenterZoom=function(t,e){var n,i=this.getCenterInternal(),r=this.getResolution();void 0!==i&&void 0!==r&&(n=[e[0]-t*(e[0]-i[0])/r,e[1]-t*(e[1]-i[1])/r]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?xn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Ds)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Sn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),n=this.getCenterInternal();nt(n,1);var i=this.getResolution();nt(void 0!==i,2);var r=this.getRotation();return nt(void 0!==r,3),fe(n,i,r,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Gs)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Cn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSize_(),i=ve(t)/n[0],r=de(t)/n[1];return Math.max(i,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(n/i)/Math.log(e);return function(t){return n/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(js)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(n/i)/e;return function(t){return Math.log(n/t)/e/r}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),n=this.getResolution(),i=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:n,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,i=this.minZoom_||0;if(this.resolutions_){var r=p(this.resolutions_,t,1);i=r,e=this.resolutions_[r],n=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,n=this.zoomFactor_;return i+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Ce(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Ce(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n,i=m({size:this.getViewportSize_()},e||{});if(nt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))nt(!xe(t),25),n=di(r=Cn(t,this.getProjection()));else if(t.getType()===yt){var r;(n=di(r=Cn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ce(r))}else{n=t}this.fitInternal(n,i)},e.prototype.fitInternal=function(t,e){var n=e||{},i=n.size;i||(i=this.getViewportSize_());var r,o=void 0!==n.padding?n.padding:[0,0,0,0],a=void 0!==n.nearest&&n.nearest;r=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;for(var s=t.getFlatCoordinates(),l=this.getRotation(),u=Math.cos(-l),h=Math.sin(-l),c=1/0,p=1/0,f=-1/0,d=-1/0,g=t.getStride(),_=0,y=s.length;_<y;_+=g){var m=s[_]*u-s[_+1]*h,x=s[_]*h+s[_+1]*u;c=Math.min(c,m),p=Math.min(p,x),f=Math.max(f,m),d=Math.max(d,x)}var w=this.getResolutionForExtentInternal([c,p,f,d],[i[0]-o[1]-o[3],i[1]-o[0]-o[2]]);w=isNaN(w)?r:Math.max(w,r),w=this.getConstrainedResolution(w,a?0:1),h=-h;var S=(c+f)/2,C=(p+d)/2,b=[(S+=(o[1]-o[3])/2*w)*u-(C+=(o[0]-o[2])/2*w)*h,C*u+S*h],E=n.callback?n.callback:v;void 0!==n.duration?this.animateInternal({resolution:w,center:this.getConstrainedCenter(b,w),duration:n.duration,easing:n.easing},E):(this.targetResolution_=w,this.targetCenter_=b,this.applyTargetState_(!1,!0),Zs(E,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(wn(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){var i=this.getRotation(),r=Math.cos(-i),o=Math.sin(-i),a=t[0]*r-t[1]*o,s=t[1]*r+t[0]*o,l=this.getResolution(),u=(a+=(e[0]/2-n[0])*l)*r-(s+=(n[1]-e[1]/2)*l)*(o=-o),h=s*r+a*o;this.setCenterInternal([u,h])},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=xn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var n=e&&wn(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,i,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=wn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(wn(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var n=this.getAnimating()||this.getInteracting()||e,i=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,0,r,n),a=this.constraints_.center(this.targetCenter_,o,r,n);this.get(js)!==i&&this.set(js,i),this.get(Gs)!==o&&this.set(Gs,o),this.get(Ds)&&$e(this.get(Ds),a)||this.set(Ds,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var i=void 0!==t?t:200,r=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,r,a),l=this.constraints_.center(this.targetCenter_,s,a);if(0===i&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=n||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&$e(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:i,easing:es,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(ra,1)},e.prototype.endInteraction=function(t,e,n){var i=n&&wn(n,this.getProjection());this.endInteractionInternal(t,e,i)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(ra,-1),this.resolveConstraints(t,e,n)},e.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},e.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},e.prototype.getConstrainedResolution=function(t,e){var n=e||0,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,i)},e}(Y);function Zs(t,e){setTimeout((function(){t(e)}),0)}function Hs(t){return!(t.sourceCenter&&t.targetCenter&&!$e(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var qs=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Js=function(t){function e(e){var n=t.call(this)||this,i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,i,r,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new _s({layers:t.layers});o[Fs]=a,o[Is]=t.target,o[As]=void 0!==t.view?t.view:new Ys,void 0!==t.controls&&(Array.isArray(t.controls)?n=new et(t.controls.slice()):(nt("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new et(t.interactions.slice()):(nt("function"==typeof t.interactions.getArray,48),i=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?r=new et(t.overlays.slice()):(nt("function"==typeof t.overlays.getArray,49),r=t.overlays):r=new et;return{controls:n,interactions:i,keyboardEventTarget:e,overlays:r,values:o}}(e);return n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Zi,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=[1,0,0,1,0,0],n.pixelToCoordinateTransform_=[1,0,0,1,0,0],n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=i.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=i.controls||new et,n.interactions=i.interactions||new et,n.overlays_=i.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new ks(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addEventListener(H(Fs),n.handleLayerGroupChanged_),n.addEventListener(H(As),n.handleViewChanged_),n.addEventListener(H(Os),n.handleSizeChanged_),n.addEventListener(H(Is),n.handleTargetChanged_),n.setProperties(i.values),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.controls.addEventListener(q,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(J,function(t){t.element.setMap(null)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.addEventListener(q,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(J,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n.overlays_.addEventListener(q,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(J,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n}return qs(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_){var i=this.getCoordinateFromPixelInternal(t),r=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==n.layerFilter?n.layerFilter:_,a=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,r,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var i=n||{},r=void 0!==i.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=i.layerFilter||_;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,r,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:_,r=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,o,i,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Is)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return xn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Rt(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Fs)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e].layer.getSource();if(i&&i.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=wn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?Rt(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Os)},e.prototype.getView=function(){return this.get(As)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,n,i){return function(t,e,n,i,r){if(!t||!(n in t.wantedTiles))return 1/0;if(!t.wantedTiles[n][e.getKey()])return 1/0;var o=t.viewState.center,a=i[0]-o[0],s=i[1]-o[1];return 65536*Math.log(r)+Math.sqrt(a*a+s*s)/r}(this.frameState_,t,e,n,i)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,i=new xs(n,this,t);this.handleMapBrowserEvent(i)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===Cs||n===j||n===M){var i=this.viewport_.getRootNode?this.viewport_.getRootNode():document,r=i===document?e.target:i.elementFromPoint(e.clientX,e.clientY);if(this.overlayContainerStopEvent_.contains(r)||!(i===document?document.documentElement:i).contains(r))return}t.frameState=this.frameState_;var o=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var a=o.length-1;a>=0;a--){var s=o[a];if(s.getActive())if(!s.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,i=n;if(t){var r=t.viewHints;if(r[ia]||r[ra]){var o=!qi&&Date.now()-t.time>8;n=o?0:8,i=o?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,i))}!t||!this.hasListener(xi)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(xi,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,n=this.keyHandlerKeys_.length;e<n;++e)B(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(P,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(j,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(D,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,tr(this.viewport_)}if(t){for(var i in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Es(this,this.moveTolerance_),ws)this.mapBrowserEventHandler_.addEventListener(ws[i],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(P,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(j,this.boundHandleBrowserEvent_,!!Ji&&{passive:!1});var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[N(r,M,this.handleBrowserEvent,this),N(r,L,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(D,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(B(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(B(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=N(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(t,E,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(B),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[N(t,l,this.render,this),N(t,E,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this.getSize(),n=this.getView(),i=this.frameState_,r=null;if(void 0!==e&&function(t){return t[0]>0&&t[1]>0}(e)&&n&&n.isDef()){var o=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:i?i.declutterItems:[],extent:fe(a.center,a.resolution,a.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{}}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),i)(!this.previousExtent_||!xe(this.previousExtent_)&&!ne(r.extent,this.previousExtent_))&&(this.dispatchEvent(new vs(Ps,this,i)),this.previousExtent_=Qt(this.previousExtent_));this.previousExtent_&&!r.viewHints[ia]&&!r.viewHints[ra]&&!ne(r.extent,this.previousExtent_)&&(this.dispatchEvent(new vs(Rs,this,r)),Wt(r.extent,this.previousExtent_))}this.dispatchEvent(new vs(Ts,this,r)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(Fs,t)},e.prototype.setSize=function(t){this.set(Os,t)},e.prototype.setTarget=function(t){this.set(Is,t)},e.prototype.setView=function(t){this.set(As,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},e}(Y);var Qs=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$s=function(t){function e(e){var n=t.call(this)||this,i=e.element;return!i||e.target||i.style.pointerEvents||(i.style.pointerEvents="auto"),n.element=i||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return Qs(e,t),e.prototype.disposeInternal=function(){tr(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&tr(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)B(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==v&&this.listenerKeys.push(N(t,Ts,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(Y),tl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),el=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===i.collapsed||i.collapsed,n.overrideCollapsible_=void 0!==i.collapsible,n.collapsible_=void 0===i.collapsible||i.collapsible,n.collapsible_||(n.collapsed_=!1);var r=void 0!==i.className?i.className:"ol-attribution",o=void 0!==i.tipLabel?i.tipLabel:"Attributions",a=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a):n.collapseLabel_=a;var s=void 0!==i.label?i.label:"i";"string"==typeof s?(n.label_=document.createElement("span"),n.label_.textContent=s):n.label_=s;var l=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_,u=document.createElement("button");u.setAttribute("type","button"),u.title=o,u.appendChild(l),u.addEventListener(R,n.handleClick_.bind(n),!1);var h=r+" ol-unselectable ol-control"+(n.collapsed_&&n.collapsible_?" ol-collapsed":"")+(n.collapsible_?"":" ol-uncollapsible"),c=n.element;return c.className=h,c.appendChild(n.ulElement_),c.appendChild(u),n.renderedAttributions_=[],n.renderedVisible_=!0,n}return tl(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],i=t.layerStatesArray,r=0,o=i.length;r<o;++r){var a=i[r];if(Hr(a,t.viewState)){var s=a.layer.getSource();if(s){var l=s.getAttributions();if(l){var u=l(t);if(u)if(this.overrideCollapsible_||!1!==s.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(u))for(var h=0,c=u.length;h<c;++h)u[h]in e||(n.push(u[h]),e[u[h]]=!0);else u in e||(n.push(u),e[u]=!0)}}}}return n},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var i=0,r=e.length;i<r;++i){var o=document.createElement("li");o.innerHTML=e[i],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?$i(this.collapseLabel_,this.label_):$i(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}($s),nl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),il=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var r=void 0!==i.className?i.className:"ol-rotate",o=void 0!==i.label?i.label:"⇧";n.label_=null,"string"==typeof o?(n.label_=document.createElement("span"),n.label_.className="ol-compass",n.label_.textContent=o):(n.label_=o,n.label_.classList.add("ol-compass"));var a=i.tipLabel?i.tipLabel:"Reset rotation",s=document.createElement("button");s.className=r+"-reset",s.setAttribute("type","button"),s.title=a,s.appendChild(n.label_),s.addEventListener(R,n.handleClick_.bind(n),!1);var l=r+" ol-unselectable ol-control",u=n.element;return u.className=l,u.appendChild(s),n.callResetNorth_=i.resetNorth?i.resetNorth:void 0,n.duration_=void 0!==i.duration?i.duration:250,n.autoHide_=void 0===i.autoHide||i.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add("ol-hidden"),n}return nl(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:es}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var i="rotate("+n+"rad)";if(this.autoHide_){var r=this.element.classList.contains("ol-hidden");r||0!==n?r&&0!==n&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=i}this.rotation_=n}},e}($s),rl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ol=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),target:i.target})||this;var r=void 0!==i.className?i.className:"ol-zoom",o=void 0!==i.delta?i.delta:1,a=void 0!==i.zoomInLabel?i.zoomInLabel:"+",s=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",l=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",u=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=r+"-in",h.setAttribute("type","button"),h.title=l,h.appendChild("string"==typeof a?document.createTextNode(a):a),h.addEventListener(R,n.handleClick_.bind(n,o),!1);var c=document.createElement("button");c.className=r+"-out",c.setAttribute("type","button"),c.title=u,c.appendChild("string"==typeof s?document.createTextNode(s):s),c.addEventListener(R,n.handleClick_.bind(n,-o),!1);var p=r+" ol-unselectable ol-control",f=n.element;return f.className=p,f.appendChild(h),f.appendChild(c),n.duration_=void 0!==i.duration?i.duration:250,n}return rl(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var i=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:es})):e.setZoom(i)}}},e}($s),al=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sl="degrees",ll="imperial",ul="nautical",hl="metric",cl="us",pl=[1,2,5],fl=function(t){function e(e){var n=this,i=e||{},r=void 0!==i.className?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).innerElement_=document.createElement("div"),n.innerElement_.className=r+"-inner",n.element.className=r+" ol-unselectable",n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==i.minWidth?i.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addEventListener(H("units"),n.handleUnitsChanged_),n.setUnits(i.units||hl),n.scaleBar_=i.bar||!1,n.scaleBarSteps_=i.steps||4,n.scaleBarText_=i.text||!1,n.dpi_=i.dpi||void 0,n}return al(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,i=this.getUnits(),r=i==sl?vt:xt,o=hn(n,t.resolution,e,r),a=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),s=a*o,l="";if(i==sl){var u=Ct[vt];(s*=u)<u/60?(l="″",o*=3600):s<u?(l="′",o*=60):l="°"}else i==ll?s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):i==ul?(o/=1852,l="nm"):i==hl?s<.001?(l="μm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3):i==cl?s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):nt(!1,33);for(var h,c,p,f,d=3*Math.floor(Math.log(a*o)/Math.log(10));;){p=Math.floor(d/3);var g=Math.pow(10,p);if(h=pl[(d%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=a)break;++d}f=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var i="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),r=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&r.push(this.createMarker("absolute",s)),r.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,n):"")+"</div>"),s===this.scaleBarSteps_-1&&r.push(this.createStepText(s+1,t,!0,e,n)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+i+"</div>":"")+r.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,n,i,r){var o=(0===t?0:Math.round(i/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+r);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(n?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=hn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*39.37*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}($s);var dl="active",gl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_l=function(t){function e(e){var n=t.call(this)||this;return e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return gl(e,t),e.prototype.getActive=function(){return this.get(dl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(dl,t)},e.prototype.setMap=function(t){this.map_=t},e}(Y);function yl(t,e,n,i){var r=t.getZoom();if(void 0!==r){var o=t.getConstrainedZoom(r+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:n,duration:void 0!==i?i:250,easing:es})}}var vl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ml=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:250,n}return vl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ws.DBLCLICK){var n=t.originalEvent,i=t.map,r=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_;yl(i.getView(),o,r,this.duration_),t.preventDefault(),e=!0}return!e},e}(_l),xl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),wl=function(t){function e(e){var n=this,i=e||{};return n=t.call(this,i)||this,i.handleDownEvent&&(n.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(n.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(n.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(n.handleUpEvent=i.handleUpEvent),i.stopDown&&(n.stopDown=i.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return xl(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ws.POINTERDRAG)this.handleDragEvent(t),t.preventDefault();else if(t.type==ws.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==ws.POINTERDOWN){var i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==ws.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===ws.POINTERDOWN||e===ws.POINTERDRAG||e===ws.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==ws.POINTERUP?delete this.trackedPointers_[n]:(t.type==ws.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=w(this.trackedPointers_)}},e}(_l);function Sl(t){for(var e=t.length,n=0,i=0,r=0;r<e;r++)n+=t[r].clientX,i+=t[r].clientY;return[n/e,i/e]}function Cl(t){var e=arguments;return function(t){for(var n=!0,i=0,r=e.length;i<r&&(n=n&&e[i](t));++i);return n}}var bl=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},El=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Tl=_,Pl=function(t){var e=t.originalEvent;return 0==e.button&&!(Ki&&Yi&&e.ctrlKey)},Rl=y,Fl=function(t){return t.type==ws.SINGLECLICK},Ol=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Il=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Al=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Ml=function(t){var e=t.originalEvent;return nt(void 0!==e,56),"mouse"==e.pointerType},Ll=function(t){var e=t.originalEvent;return nt(void 0!==e,56),e.isPrimary&&0===e.button},kl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dl=function(t){function e(e){var n=t.call(this,{stopDown:y})||this,i=e||{};n.kinetic_=i.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var r=i.condition?i.condition:Cl(Ol,Ll);return n.condition_=i.onFocusOnly?Cl(El,r):r,n.noKinetic_=!1,n}return kl(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=Sl(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var i=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],r=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(i,r.getResolution()),tn(i,r.getRotation()),r.adjustCenterInternal(i)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var i=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-i*Math.cos(r),a[1]-i*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(s),duration:500,easing:es})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(wl),Gl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),jl=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,{stopDown:y})||this).condition_=i.condition?i.condition:bl,n.lastAngle_=void 0,n.duration_=void 0!==i.duration?i.duration:250,n}return Gl(e,t),e.prototype.handleDragEvent=function(t){if(Ml(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Ws){var i=e.getSize(),r=t.pixel,o=Math.atan2(i[1]/2-r[1],r[0]-i[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Ml(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Ml(t)&&(!(!Pl(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(wl),Nl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zl=function(t){function e(e){var n=t.call(this)||this;return n.geometry_=null,n.element_=document.createElement("div"),n.element_.style.position="absolute",n.element_.style.pointerEvents="auto",n.element_.className="ol-box "+e,n.map_=null,n.startPixel_=null,n.endPixel_=null,n}return Nl(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n=this.element_.style;n.left=Math.min(t[0],e[0])+"px",n.top=Math.min(t[1],e[1])+"px",n.width=Math.abs(e[0]-t[0])+"px",n.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new fi([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(u),Bl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ul="boxstart",Xl="boxdrag",Wl="boxend",Vl=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.coordinate=n,r.mapBrowserEvent=i,r}return Bl(e,t),e}(s),Kl=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.box_=new zl(i.className||"ol-dragbox"),n.minArea_=void 0!==i.minArea?i.minArea:64,i.onBoxEnd&&(n.onBoxEnd=i.onBoxEnd),n.startPixel_=null,n.condition_=i.condition?i.condition:Pl,n.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:n.defaultBoxEndCondition,n}return Bl(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var i=n[0]-e[0],r=n[1]-e[1];return i*i+r*r>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Vl(Xl,t.coordinate,t))},e.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new Vl(Wl,t.coordinate,t))),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Vl(Ul,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(wl),Yl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zl=function(t){function e(e){var n=this,i=e||{},r=i.condition?i.condition:Il;return(n=t.call(this,{condition:r,className:i.className||"ol-dragzoom",minArea:i.minArea})||this).duration_=void 0!==i.duration?i.duration:200,n.out_=void 0!==i.out&&i.out,n}return Yl(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),n=e.getView(),i=e.getSize(),r=this.getGeometry().getExtent();if(this.out_){var o=n.calculateExtentInternal(i),a=te([e.getPixelFromCoordinateInternal(ue(r)),e.getPixelFromCoordinateInternal(ye(r))]);!function(t,e){var n=(t[2]-t[0])/2*(e-1),i=(t[3]-t[1])/2*(e-1);t[0]-=n,t[2]+=n,t[1]-=i,t[3]+=i}(o,1/n.getResolutionForExtentInternal(a,i)),r=o}var s=n.getConstrainedResolution(n.getResolutionForExtentInternal(r,i)),l=n.getConstrainedCenter(ce(r),s);n.animateInternal({resolution:s,center:l,duration:this.duration_,easing:es})},e}(Kl),Hl=37,ql=38,Jl=39,Ql=40,$l=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),tu=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.defaultCondition_=function(t){return Ol(t)&&Al(t)},n.condition_=void 0!==i.condition?i.condition:n.defaultCondition_,n.duration_=void 0!==i.duration?i.duration:100,n.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128,n}return $l(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M){var n=t.originalEvent.keyCode;if(this.condition_(t)&&(n==Ql||n==Hl||n==Jl||n==ql)){var i=t.map.getView(),r=i.getResolution()*this.pixelDelta_,o=0,a=0;n==Ql?a=-r:n==Hl?o=-r:n==Jl?o=r:a=r;var s=[o,a];tn(s,i.getRotation()),function(t,e,n){var i=t.getCenterInternal();if(i){var r=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:is,center:t.getConstrainedCenter(r)})}}(i,s,this.duration_),t.preventDefault(),e=!0}}return!e},e}(_l),eu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nu=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.condition_=i.condition?i.condition:Al,n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:100,n}return eu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M||t.type==L){var n=t.originalEvent.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var i=t.map,r=n=="+".charCodeAt(0)?this.delta_:-this.delta_;yl(i.getView(),r,void 0,this.duration_),t.preventDefault(),e=!0}}return!e},e}(_l),iu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ru="trackpad",ou="wheel",au=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,i)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,n.duration_=void 0!==i.duration?i.duration:250,n.timeout_=void 0!==i.timeout?i.timeout:80,n.useAnchor_=void 0===i.useAnchor||i.useAnchor,n.constrainResolution_=void 0!==i.constrainResolution&&i.constrainResolution;var r=i.condition?i.condition:Tl;return n.condition_=i.onFocusOnly?Cl(El,r):r,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return iu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==j)return!0;t.preventDefault();var e,n=t.map,i=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==j&&(e=i.deltaY,Vi&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Zi),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?ru:ou);var o=n.getView();if(this.mode_===ru&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-Ce(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),yl(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(_l),su=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),lu=function(t){function e(e){var n=this,i=e||{},r=i;return r.stopDown||(r.stopDown=y),(n=t.call(this,r)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==i.threshold?i.threshold:.3,n.duration_=void 0!==i.duration?i.duration:250,n}return su(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],i=this.targetPointers[1],r=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Ws){var l=a.getViewport().getBoundingClientRect(),u=Sl(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(wl),uu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),hu=function(t){function e(e){var n=this,i=e||{},r=i;return r.stopDown||(r.stopDown=y),(n=t.call(this,r)||this).anchor_=null,n.duration_=void 0!==i.duration?i.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return uu(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],i=this.targetPointers[1],r=n.clientX-i.clientX,o=n.clientY-i.clientY,a=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),h=Sl(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(wl),cu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pu="addfeatures",fu=function(t){function e(e,n,i,r){var o=t.call(this,e)||this;return o.features=i,o.file=n,o.projection=r,o}return cu(e,t),e}(s),du=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,{handleEvent:_})||this).formatConstructors_=i.formatConstructors?i.formatConstructors:[],n.projection_=i.projection?un(i.projection):null,n.dropListenKeys_=null,n.source_=i.source||null,n.target=i.target?i.target:null,n}return cu(e,t),e.prototype.handleResult_=function(t,e){var n=e.target.result,i=this.getMap(),r=this.projection_;r||(r=i.getView().getProjection());for(var o=this.formatConstructors_,a=0,s=o.length;a<s;++a){var l=new o[a],u=this.tryReadFeatures_(l,n,{featureProjection:r});if(u&&u.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(u)),this.dispatchEvent(new fu(pu,t,u,r));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[N(e,A,this.handleDrop,this),N(e,O,this.handleStop,this),N(e,I,this.handleStop,this),N(e,A,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,n){try{return t.readFeatures(e,n)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(B),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,n=0,i=e.length;n<i;++n){var r=e.item(n),o=new FileReader;o.addEventListener(k,this.handleResult_.bind(this,r)),o.readAsText(r)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(_l),gu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_u=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,i)||this).condition_=i.condition?i.condition:Il,n.lastAngle_=void 0,n.lastMagnitude_=void 0,n.lastScaleDelta_=0,n.duration_=void 0!==i.duration?i.duration:400,n}return gu(e,t),e.prototype.handleDragEvent=function(t){if(Ml(t)){var e=t.map,n=e.getSize(),i=t.pixel,r=i[0]-n[0]/2,o=n[1]/2-i[1],a=Math.atan2(o,r),s=Math.sqrt(r*r+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!Ml(t))return!0;var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!Ml(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(wl),yu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vu=function(t){function e(e,n,i){var r=t.call(this)||this;if(void 0!==i&&void 0===n)r.setFlatCoordinates(i,e);else{var o=n||0;r.setCenterAndRadius(e,o,i)}return r}return yu(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,n,i){var r=this.flatCoordinates,o=t-r[0],a=e-r[1],s=o*o+a*a;if(s<i){if(0===s)for(var l=0;l<this.stride;++l)n[l]=r[l];else{var u=this.getRadius()/Math.sqrt(s);n[0]=r[0]+u*o,n[1]=r[1]+u*a;for(l=2;l<this.stride;++l)n[l]=r[l]}return n.length=this.stride,s}return i},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,i=t-n[0],r=e-n[1];return i*i+r*r<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return Jt(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return yt},e.prototype.intersectsExtent=function(t){if(me(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||se(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],i=t.slice();i[e]=i[0]+n;for(var r=1;r<e;++r)i[e+r]=t[r];this.setFlatCoordinates(this.layout,i),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var i=this.flatCoordinates,r=jn(i,0,t,this.stride);i[r++]=i[0]+e;for(var o=1,a=this.stride;o<a;++o)i[r++]=i[o];i.length=r,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var n=this.getCenter(),i=this.getStride();this.setCenter(En(n,0,n.length,i,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),i=this.getStride();this.setCenter(Tn(n,0,n.length,i,t,e,n)),this.changed()},e}(In);vu.prototype.transform;var mu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xu=function(t){function e(e,n,i){var r=t.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(e[0]))r.setCoordinates(e,n);else if(void 0!==n&&i)r.setFlatCoordinates(n,e),r.ends_=i;else{for(var o=r.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout()),d(s,c.getFlatCoordinates()),l.push(s.length)}r.setFlatCoordinates(o,s),r.ends_=l}return r}return mu(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,n,i){return i<Vt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(kn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,i))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=st&&this.layout!=lt||0===this.flatCoordinates.length)return null;var i=void 0!==e&&e,r=void 0!==n&&n;return function(t,e,n,i,r,o,a){if(a)return Ci(t,e,n[n.length-1],i,r,o);var s;if(r<t[i-1])return o?((s=t.slice(0,i))[i-1]=r,s):null;if(t[t.length-1]<r)return o?((s=t.slice(t.length-i))[i-1]=r,s):null;for(var l=0,u=n.length;l<u;++l){var h=n[l];if(e!=h){if(r<t[e+i-1])return null;if(r<=t[h-1])return Ci(t,e,h,i,r,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,i,r)},e.prototype.getCoordinates=function(){return Kn(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Ti(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,i=[],r=0,o=0,a=e.length;o<a;++o){var s=e[o],l=new Ti(t.slice(r,s),n);i.push(l),r=s}return i},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,i=this.ends_,r=this.stride,o=0,a=i.length;o<a;++o){var s=i[o];d(t,Si(e,n,s,r,.5)),n=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=function(t,e,n,i,r,o,a,s){for(var l=0,u=n.length;l<u;++l){var h=n[l];a=Bn(t,e,h,i,r,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,i),new e(n,ot,i)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return function(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o){if(oi(t,e,n[o],i,r))return!0;e=n[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=zn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(In),wu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Su=function(t){function e(e,n){var i=t.call(this)||this;return n&&!Array.isArray(e[0])?i.setFlatCoordinates(n,e):i.setCoordinates(e,n),i}return wu(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){if(i<Vt(this.getExtent(),t,e))return i;for(var r=this.flatCoordinates,o=this.stride,a=0,s=r.length;a<s;a+=o){var l=Pe(t,e,r[a],r[a+1]);if(l<i){i=l;for(var u=0;u<o;++u)n[u]=r[a+u];n.length=o}}return i},e.prototype.getCoordinates=function(){return Vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new $n(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,i=[],r=0,o=t.length;r<o;r+=n){var a=new $n(t.slice(r,r+n),e);i.push(a)}return i},e.prototype.getType=function(){return ft},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,i=0,r=e.length;i<r;i+=n){if(Zt(t,e[i],e[i+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(In);var Cu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bu=function(t){function e(e,n,i){var r=t.call(this)||this;if(r.endss_=[],r.flatInteriorPointsRevision_=-1,r.flatInteriorPoints_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){for(var o=r.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),g=0,_=f.length;g<_;++g)f[g]+=p;d(s,c.getFlatCoordinates()),l.push(f)}n=o,e=s,i=l}return void 0!==n&&i?(r.setFlatCoordinates(n,e),r.endss_=i):r.setCoordinates(e,n),r}return Cu(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;d(this.flatCoordinates,t.getFlatCoordinates());for(var i=0,r=(e=t.getEnds().slice()).length;i<r;++i)e[i]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),i=0;i<t;++i)n[i]=this.endss_[i].slice();return new e(this.flatCoordinates.slice(),this.layout,n)},e.prototype.closestPointXY=function(t,e,n,i){return i<Vt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o){var s=n[o];r=kn(t,e,s,i,r),e=s[s.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,i,r,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=Gn(t,e,d,i,r,o,a,s,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.containsXY=function(t,e){return function(t,e,n,i,r,o){if(0===n.length)return!1;for(var a=0,s=n.length;a<s;++a){var l=n[a];if(ni(t,e,l,i,r,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,i){for(var r=0,o=0,a=n.length;o<a;++o){var s=n[o];r+=Hn(t,e,s,i),e=s[s.length-1]}return r}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ci(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Yn(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=function(t,e,n,i){for(var r=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=n.length;a<s;++a){var l=n[a];o=ee(t,e,l[0],i),r.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,n,i,r){for(var o=[],a=0,s=n.length;a<s;++a){var l=n[a];o=ii(t,e,l,i,r,2*a,o),e=l[l.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Su(this.getFlatInteriorPoints().slice(),st)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o){var s=n[o];if(!ui(t,e,s,i,r))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ci(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=function(t,e,n,i,r,o,a,s){for(var l=0,u=n.length;l<u;++l){var h=n[l],c=[];a=Wn(t,e,h,i,r,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,i),new e(n,ot,i)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var i=this.endss_[t].slice(),r=i[i.length-1];if(0!==e)for(var o=0,a=i.length;o<a;++o)i[o]-=e;return new fi(this.flatCoordinates.slice(e,r),this.layout,i)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,i=[],r=0,o=0,a=n.length;o<a;++o){var s=n[o].slice(),l=s[s.length-1];if(0!==r)for(var u=0,h=s.length;u<h;++u)s[u]-=r;var c=new fi(e.slice(r,l),t,s);i.push(c),r=l}return i},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){return function(t,e,n,i,r){for(var o=0,a=n.length;o<a;++o){var s=n[o];if(ai(t,e,s,i,r))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=function(t,e,n,i,r){for(var o=r||[],a=0,s=0,l=n.length;s<l;++s){var u=zn(t,e,n[s],i,o[a]);o[a++]=u,e=u[u.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var i=n[n.length-1];this.flatCoordinates.length=0===i.length?0:i[i.length-1]}this.changed()},e}(In),Eu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Tu="Point",Pu="LineString",Ru="Polygon",Fu="Circle",Ou="drawstart",Iu="drawend",Au="drawabort",Mu=function(t){function e(e,n){var i=t.call(this,e)||this;return i.feature=n,i}return Eu(e,t),e}(s),Lu=function(t){function e(e){var n=this,i=e;i.stopDown||(i.stopDown=y),(n=t.call(this,i)||this).shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){var e;t===ut||t===ft?e=Tu:t===ht||t===dt?e=Pu:t===pt||t===gt?e=Ru:t===yt&&(e=Fu);return e}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===Ru?3:2,n.maxPoints_=e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:_;var r,o=e.geometryFunction;if(!o)if(n.type_===yt)o=function(t,e,n){var i=e||new vu([NaN,NaN]),r=wn(t[0]),o=en(r,wn(t[1]));return i.setCenterAndRadius(r,Math.sqrt(o)),i};else{var a,s=n.mode_;s===Tu?a=$n:s===Pu?a=Ti:s===Ru&&(a=fi),o=function(t,e,n){var i=e;return i?s===Ru?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new a(t),i}}return n.geometryFunction_=o,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new Ia({source:new Za({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(r=Pr(),function(t,e){return r[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:Ol,n.freehandCondition_,e.freehand?n.freehandCondition_=Tl:n.freehandCondition_=e.freehandCondition?e.freehandCondition:Il,n.addEventListener(H(dl),n.updateState_),n}return Eu(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===P&&e.preventDefault(),this.freehand_=this.mode_!==Tu&&this.freehandCondition_(e);var n=e.type===ws.POINTERMOVE,i=!0;!this.freehand_&&this.lastDragTime_&&e.type===ws.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===ws.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===ws.POINTERDOWN?i=!1:n?(i=e.type===ws.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.preventDefault()):("mouse"==e.originalEvent.pointerType||e.type===ws.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===ws.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,e)&&i},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new xs(ws.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var n=this.mode_===Fu;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||n?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===Tu&&this.finishDrawing()),e=!1):this.freehand_&&this.abortDrawing(),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,i=e[0]-n[0],r=e[1]-n[1],o=i*i+r*r;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t)},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,i=[this.finishCoordinate_];if(this.mode_===Pu)n=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Ru){var r=this.sketchCoords_;n=r[0].length>this.minPoints_,i=[r[0][0],r[0][r[0].length-2]]}if(n)for(var o=t.map,a=0,s=i.length;a<s;a++){var l=i[a],u=o.getPixelFromCoordinate(l),h=t.pixel,c=h[0]-u[0],p=h[1]-u[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=l;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new rt(new $n(e)),this.updateSketchFeatures_())},e.prototype.startDrawing_=function(t){var e=t.coordinate,n=t.map.getView().getProjection();this.finishCoordinate_=e,this.mode_===Tu?this.sketchCoords_=e.slice():this.mode_===Ru?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new rt(new Ti(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,n);this.sketchFeature_=new rt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Mu(Ou,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,n,i,r=t.coordinate,o=this.sketchFeature_.getGeometry(),a=t.map.getView().getProjection();(this.mode_===Tu?n=this.sketchCoords_:this.mode_===Ru?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(r=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=r[0],n[1]=r[1],this.geometryFunction_(this.sketchCoords_,o,a),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(r);if(o.getType()==pt&&this.mode_!==Ru){this.sketchLine_||(this.sketchLine_=new rt);var s=o.getLinearRing(0);(i=this.sketchLine_.getGeometry())?(i.setFlatCoordinates(s.getLayout(),s.getFlatCoordinates()),i.changed()):(i=new Ti(s.getFlatCoordinates(),s.getLayout()),this.sketchLine_.setGeometry(i))}else this.sketchLineCoords_&&(i=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,i=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Pu?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,i,r)):this.mode_===Ru&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,i,r)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===Pu?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,n),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Ru&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)),0===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===Pu?(e.pop(),this.geometryFunction_(e,n,i)):this.mode_===Ru&&(e[0].pop(),this.geometryFunction_(e,n,i),e=n.getCoordinates()),this.type_===ft?t.setGeometry(new Su([e])):this.type_===dt?t.setGeometry(new xu([e])):this.type_===gt&&t.setGeometry(new bu([e])),this.dispatchEvent(new Mu(Iu,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Mu(Au,t))},e.prototype.appendCoordinates=function(t){var e=this.mode_,n=[];e===Pu?n=this.sketchCoords_:e===Ru&&(n=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var i=n.pop(),r=0;r<t.length;r++)this.addToDrawing_(t[r]);this.addToDrawing_(i)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new Mu(Ou,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(wl);var ku=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Du="extentchanged",Gu=function(t){function e(e){var n=t.call(this,Du)||this;return n.extent=e,n}return ku(e,t),e}(s),ju=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,i)||this).condition_=i.condition?i.condition:Tl,n.extent_=null,n.pointerHandler_=null,n.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,n.snappedToVertex_=!1,n.extentFeature_=null,n.vertexFeature_=null,e||(e={}),n.extentOverlay_=new Ia({source:new Za({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:Nu(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.vertexOverlay_=new Ia({source:new Za({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:zu(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&n.setExtent(e.extent),n}return ku(e,t),e.prototype.snapToVertex_=function(t,e){var n=e.getCoordinateFromPixelInternal(t),i=this.getExtentInternal();if(i){var r=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(i);r.sort((function(t,e){return rn(n,t)-rn(n,e)}));var o=r[0],a=Qe(n,o),s=e.getPixelFromCoordinateInternal(a);if(nn(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=en(s,l),c=en(s,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,n=t.map,i=this.snapToVertex_(e,n);i||(i=n.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(i)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(di(t)):e.setGeometry(void 0):(e=new rt(t?di(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new rt(new $n(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=ws.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,n=t.map,i=this.getExtentInternal(),r=this.snapToVertex_(e,n),o=function(t){var e=null,n=null;return t[0]==i[0]?e=i[2]:t[0]==i[2]&&(e=i[0]),t[1]==i[1]?n=i[3]:t[1]==i[3]&&(n=i[1]),null!==e&&null!==n?[e,n]:null};if(r&&i){var a=r[0]==i[0]||r[0]==i[2]?r[0]:null,s=r[1]==i[1]||r[1]==i[3]?r[1]:null;null!==a&&null!==s?this.pointerHandler_=Bu(o(r)):null!==a?this.pointerHandler_=Uu(o([a,i[1]]),o([a,i[3]])):null!==s&&(this.pointerHandler_=Uu(o([i[0],s]),o([i[2],s])))}else r=n.getCoordinateFromPixelInternal(e),this.setExtent([r[0],r[1],r[0],r[1]]),this.pointerHandler_=Bu(r);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==le(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return Sn(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new Gu(this.extent_))},e}(wl);function Nu(){var t=Pr();return function(e,n){return t[pt]}}function zu(){var t=Pr();return function(e,n){return t[ut]}}function Bu(t){return function(e){return Ut([t,e])}}function Uu(t,e){return t[0]==e[0]?function(n){return Ut([t,[n[0],e[1]]])}:t[1]==e[1]?function(n){return Ut([t,[e[0],n[1]]])}:null}var Xu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wu=[0,0,0,0],Vu=[],Ku="modifystart",Yu="modifyend",Zu=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.features=n,r.mapBrowserEvent=i,r}return Xu(e,t),e}(s),Hu=function(t){function e(e){var n,i=t.call(this,e)||this;if(i.boundHandleFeatureChange_=i.handleFeatureChange_.bind(i),i.condition_=e.condition?e.condition:Ll,i.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&Fl(t)},i.deleteCondition_=e.deleteCondition?e.deleteCondition:i.defaultDeleteCondition_,i.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Tl,i.vertexFeature_=null,i.vertexSegments_=null,i.lastPixel_=[0,0],i.ignoreNextSingleClick_=!1,i.modified_=!1,i.rBush_=new Aa,i.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,i.snappedToVertex_=!1,i.changingFeature_=!1,i.dragSegments_=[],i.overlay_=new Ia({source:new Za({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:$u(),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i)},i.source_=null,e.source?(i.source_=e.source,n=new et(i.source_.getFeatures()),i.source_.addEventListener(Da,i.handleSourceAdd_.bind(i)),i.source_.addEventListener(Na,i.handleSourceRemove_.bind(i))):n=e.features,!n)throw new Error("The modify interaction requires features or a source");return i.features_=n,i.features_.forEach(i.addFeature_.bind(i)),i.features_.addEventListener(q,i.handleFeatureAdd_.bind(i)),i.features_.addEventListener(J,i.handleFeatureRemove_.bind(i)),i.lastPointerEvent_=null,i}return Xu(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(E,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Zu(Ku,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(E,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,n=[];e.forEach((function(e){t===e.feature&&n.push(e)}));for(var i=n.length-1;i>=0;--i){for(var r=n[i],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);e.remove(r)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),i={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),i)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i){var o=n[i],a={feature:t,geometry:e,depth:[i],index:i,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length-1;i<r;++i){var o=n.slice(i,i+2),a={feature:t,geometry:e,index:i,segment:o};this.rBush_.insert(Ut(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i)for(var o=n[i],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[i],index:a,segment:l};this.rBush_.insert(Ut(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i)for(var o=n[i],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[i],index:a,segment:l};this.rBush_.insert(Ut(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i)for(var o=n[i],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,i],index:u,segment:c};this.rBush_.insert(Ut(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),i={feature:t,geometry:e,index:0,segment:[n,n]},r={feature:t,geometry:e,index:1,segment:[n,n]},o=[i,r];i.featureSegments=o,r.featureSegments=o,this.rBush_.insert($t(n),i);var a=e;this.rBush_.insert(a.getExtent(),r)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),i=0;i<n.length;++i){var r=n[i];(0,this.SEGMENT_WRITERS_[r.getType()])(t,r)}},e.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new rt(new $n(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=ws.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=ws.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==ws.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,n=0,i=this.dragSegments_.length;n<i;++n){for(var r=this.dragSegments_[n],o=r[0],a=o.depth,s=o.geometry,l=void 0,u=o.segment,h=r[1];e.length<s.getStride();)e.push(u[h][e.length]);switch(s.getType()){case ut:l=e,u[0]=e,u[1]=e;break;case ft:(l=s.getCoordinates())[o.index]=e,u[0]=e,u[1]=e;break;case ht:(l=s.getCoordinates())[o.index+h]=e,u[h]=e;break;case dt:case pt:(l=s.getCoordinates())[a[0]][o.index+h]=e,u[h]=e;break;case gt:(l=s.getCoordinates())[a[1]][a[0]][o.index+h]=e,u[h]=e;break;case yt:if(u[0]=e,u[1]=e,0===o.index)this.changingFeature_=!0,s.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var c=nn(wn(s.getCenter()),wn(e));s.setRadius(c),this.changingFeature_=!1}}l&&this.setGeometryCoordinates_(s,l)}this.createOrUpdateVertexFeature_(e)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.modified_=!1;var n=this.vertexFeature_;if(n){var r=t.map.getView().getProjection(),o=[],a=n.getGeometry().getCoordinates(),s=Ut([a]),l=this.rBush_.getInExtent(s),u={};l.sort(qu);for(var h=0,c=l.length;h<c;++h){var p=l[h],f=p.segment,d=i(p.geometry),g=p.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),p.geometry.getType()!==yt||1!==p.index)if(!$e(f[0],a)||u[d][0])if(!$e(f[1],a)||u[d][1])i(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&o.push([p,a]);else{if((p.geometry.getType()===ht||p.geometry.getType()===dt)&&u[d][0]&&0===u[d][0].index)continue;this.dragSegments_.push([p,1]),u[d][1]=p}else this.dragSegments_.push([p,0]),u[d][0]=p;else $e(Qu(e,p,r),a)&&!u[d][0]&&(this.dragSegments_.push([p,0]),u[d][0]=p)}o.length&&this.willModifyFeatures_(t);for(var _=o.length-1;_>=0;--_)this.insertVertex_.apply(this,o[_])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],i=n.geometry;if(i.getType()===yt){var r=i.getCenter(),o=n.featureSegments[0],a=n.featureSegments[1];o.segment[0]=r,o.segment[1]=r,a.segment[0]=r,a.segment[1]=r,this.rBush_.update($t(r),o);var s=i;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Ut(n.segment),n)}return this.modified_&&(this.dispatchEvent(new Zu(Yu,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,n){var r=n||e.getCoordinateFromPixel(t),o=e.getView().getProjection(),a=Sn(Xt(Cn($t(r,Wu)),e.getView().getResolution()*this.pixelTolerance_,Wu)),s=this.rBush_.getInExtent(a);if(s.length>0){s.sort((function(t,e){return Ju(r,t,o)-Ju(r,e,o)}));var l=s[0],u=l.segment,h=Qu(r,l,o),c=e.getPixelFromCoordinate(h),p=nn(t,c);if(p<=this.pixelTolerance_){var f={};if(l.geometry.getType()===yt&&1===l.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var d=e.getPixelFromCoordinate(u[0]),g=e.getPixelFromCoordinate(u[1]),_=en(c,d),y=en(c,g);p=Math.sqrt(Math.min(_,y)),this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(h=_>y?u[1]:u[0]),this.createOrUpdateVertexFeature_(h);for(var v=1,m=s.length;v<m;++v){var x=s[v].segment;if(!($e(u[0],x[0])&&$e(u[1],x[1])||$e(u[0],x[1])&&$e(u[1],x[0])))break;f[i(x)]=!0}}return f[i(u)]=!0,void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var n,i=t.segment,r=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case dt:case pt:(n=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case gt:(n=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case ht:(n=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var u={segment:[i[0],e],feature:r,geometry:o,depth:a,index:s};l.insert(Ut(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,i[1]],feature:r,geometry:o,depth:a,index:s+1};l.insert(Ut(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ws.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t);var e=this.removeVertex_();return this.dispatchEvent(new Zu(Yu,this.features_,t)),this.modified_=!1,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,r,o,a,s,l,u,h,c,p=this.dragSegments_,f={},d=!1;for(o=p.length-1;o>=0;--o)c=i((h=(n=p[o])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===n[1]?(f[c].right=h,f[c].index=h.index):1==n[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(l=(a=f[c].index)-1)<0&&(l=0),t=e=(r=(h=void 0!==s?s:u).geometry).getCoordinates(),d=!1,r.getType()){case dt:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),d=!0);break;case ht:e.length>2&&(e.splice(a,1),d=!0);break;case gt:t=t[h.depth[1]];case pt:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),d=!0,0===a&&(t.pop(),t.push(t[0]),l=t.length-1))}if(d){this.setGeometryCoordinates_(r,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var _={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert(Ut(_.segment),_)}this.updateSegmentIndices_(r,a,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,n,i){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===n||void 0===r.depth||g(r.depth,n))&&r.index>e&&(r.index+=i)}))},e}(wl);function qu(t,e){return t.index-e.index}function Ju(t,e,n){var i=e.geometry;if(i.getType()===yt){var r=i;if(1===e.index){null;var o=en(r.getCenter(),wn(t)),a=Math.sqrt(o)-r.getRadius();return a*a}}var s=wn(t);return Vu[0]=wn(e.segment[0]),Vu[1]=wn(e.segment[1]),rn(s,Vu)}function Qu(t,e,n){var i=e.geometry;if(i.getType()===yt&&1===e.index){var r=i;return xn(r.getClosestPoint(wn(t)))}var o=wn(t);return Vu[0]=wn(e.segment[0]),Vu[1]=wn(e.segment[1]),xn(Qe(o,Vu))}function $u(){var t=Pr();return function(e,n){return t[ut]}}var th=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),eh="select",nh=function(t){function e(e,n,i,r){var o=t.call(this,e)||this;return o.selected=n,o.deselected=i,o.mapBrowserEvent=r,o}return th(e,t),e}(s),ih={},rh=function(t){function e(e){var n,i,r=t.call(this)||this,o=e||{};if(r.boundAddFeature_=r.addFeature_.bind(r),r.boundRemoveFeature_=r.removeFeature_.bind(r),r.condition_=o.condition?o.condition:Fl,r.addCondition_=o.addCondition?o.addCondition:Rl,r.removeCondition_=o.removeCondition?o.removeCondition:Rl,r.toggleCondition_=o.toggleCondition?o.toggleCondition:Il,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:_,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(d((n=Pr())[pt],n[ht]),d(n[_t],n[ht]),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new et,o.layers)if("function"==typeof o.layers)i=o.layers;else{var a=o.layers;i=function(t){return c(a,t)}}else i=_;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return th(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[i(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[i(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(q,this.boundAddFeature_),this.features_.addEventListener(J,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(q,this.boundAddFeature_),this.features_.removeEventListener(J,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=i(t);e in ih||(ih[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){var n=i(t),r=this.getMap().getInteractions().getArray().filter((function(n){return n instanceof e&&n.getStyle()&&-1!==n.getFeatures().getArray().indexOf(t)}));r.length>0?t.setStyle(r[r.length-1].getStyle()):(t.setStyle(ih[n]),delete ih[n])},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[i(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),n=this.removeCondition_(t),i=this.toggleCondition_(t),r=!e&&!n&&!i,o=t.map,a=this.getFeatures(),s=[],l=[];if(r){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),p=l.indexOf(h);p>-1?l.splice(p,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,r){if(this.filter_(t,r))return!e&&!i||c(a.getArray(),t)?(n||i)&&c(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,r)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var f=s.length-1;f>=0;--f)a.remove(s[f]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new nh(eh,l,s,t)),!0},e}(_l);var oh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ah(t){return t.feature?t.feature:t.element?t.element:void 0}var sh=[],lh=function(t){function e(e){var n=this,i=e||{},r=i;return r.handleDownEvent||(r.handleDownEvent=_),r.stopDown||(r.stopDown=y),(n=t.call(this,r)||this).source_=i.source?i.source:null,n.vertex_=void 0===i.vertex||i.vertex,n.edge_=void 0===i.edge||i.edge,n.features_=i.features?i.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,n.rBush_=new Aa,n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n)},n}return oh(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,r=i(t),o=t.getGeometry();if(o){var a=this.SEGMENT_WRITERS_[o.getType()];a&&(this.indexedFeaturesExtents_[r]=o.getExtent([1/0,1/0,-1/0,-1/0]),a(t,o))}n&&(this.featureChangeListenerKeys_[r]=N(t,E,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var n=this.snapTo(e.pixel,e.coordinate,e.map);return n.snapped&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=ah(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=ah(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=i(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=w(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var n=void 0===e||e,r=i(t),o=this.indexedFeaturesExtents_[r];if(o){var a=this.rBush_,s=[];a.forEachInExtent(o,(function(e){t===e.feature&&s.push(e)}));for(var l=s.length-1;l>=0;--l)a.remove(s[l])}n&&(B(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var n=this.getMap(),i=this.featuresListenerKeys_,r=this.getFeatures_();n&&(i.forEach(B),i.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?i.push(N(this.features_,q,this.handleFeatureAdd_,this),N(this.features_,J,this.handleFeatureRemove_,this)):this.source_&&i.push(N(this.source_,Da,this.handleFeatureAdd_,this),N(this.source_,Na,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var i=Ut([n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),r=this.rBush_.getInExtent(i);this.vertex_&&!this.edge_&&(r=r.filter((function(t){return t.feature.getGeometry().getType()!==yt})));var o=!1,a=null,s=null;if(0===r.length)return{snapped:o,vertex:a,vertexPixel:s};n.getView().getProjection();for(var l,u=wn(e),h=1/0,c=0;c<r.length;++c){var p=r[c];sh[0]=wn(p.segment[0]),sh[1]=wn(p.segment[1]);var f=rn(u,sh);f<h&&(l=p,h=f)}var d=l.segment;if(this.vertex_&&!this.edge_){var g=n.getPixelFromCoordinate(d[0]),_=n.getPixelFromCoordinate(d[1]),y=en(t,g),v=en(t,_);Math.sqrt(Math.min(y,v))<=this.pixelTolerance_&&(o=!0,a=y>v?d[1]:d[0],s=n.getPixelFromCoordinate(a))}else if(this.edge_){var m=l.feature.getGeometry().getType()===yt;if(m){var x=l.feature.getGeometry();null,a=xn(function(t,e){var n=e.getRadius(),i=e.getCenter(),r=i[0],o=i[1],a=t[0]-r,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[r+n*a/l,o+n*s/l]}(u,x))}else sh[0]=wn(d[0]),sh[1]=wn(d[1]),a=xn(Qe(u,sh));if(nn(t,s=n.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!m)){g=n.getPixelFromCoordinate(d[0]),_=n.getPixelFromCoordinate(d[1]),y=en(s,g),v=en(s,_);Math.sqrt(Math.min(y,v))<=this.pixelTolerance_&&(a=y>v?d[1]:d[0],s=n.getPixelFromCoordinate(a))}}return o&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:o,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var n=gi(e).getCoordinates()[0],i=0,r=n.length-1;i<r;++i){var o=n.slice(i,i+2),a={feature:t,segment:o};this.rBush_.insert(Ut(o),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),i=0;i<n.length;++i){var r=this.SEGMENT_WRITERS_[n[i].getType()];r&&r(t,n[i])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length-1;i<r;++i){var o=n.slice(i,i+2),a={feature:t,segment:o};this.rBush_.insert(Ut(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i)for(var o=n[i],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Ut(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i){var o=n[i],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i)for(var o=n[i],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Ut(c),p)}},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),i={feature:t,segment:[n,n]};this.rBush_.insert(e.getExtent(),i)},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),i=0,r=n.length;i<r;++i)for(var o=n[i],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Ut(l),u)}},e}(wl),uh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),hh="translatestart",ch="translating",ph="translateend",fh=function(t){function e(e,n,i,r,o){var a=t.call(this,e)||this;return a.features=n,a.coordinate=i,a.startCoordinate=r,a.mapBrowserEvent=o,a}return uh(e,t),e}(s),dh=function(t){function e(e){var n,i=this,r=e||{};if((i=t.call(this,r)||this).lastCoordinate_=null,i.startCoordinate_=null,i.features_=void 0!==r.features?r.features:null,r.layers)if("function"==typeof r.layers)n=r.layers;else{var o=r.layers;n=function(t){return c(o,t)}}else n=_;return i.layerFilter_=n,i.filter_=r.filter?r.filter:_,i.hitTolerance_=r.hitTolerance?r.hitTolerance:0,i.lastFeature_=null,i.addEventListener(H(dl),i.handleActiveChanged_),i}return uh(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new et([this.lastFeature_]);return this.dispatchEvent(new fh(hh,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new et([this.lastFeature_]);return this.dispatchEvent(new fh(ph,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,n=e[0]-this.lastCoordinate_[0],i=e[1]-this.lastCoordinate_[1],r=this.features_||new et([this.lastFeature_]);r.forEach((function(t){var e=t.getGeometry();e.translate(n,i),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new fh(ch,r,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||c(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var n=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(n)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),n=this.getActive();e&&n||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(wl);function gh(t){var e=t||{},n=new et,i=new ls(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new jl),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new ml({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new Dl({onFocusOnly:e.onFocusOnly,kinetic:i})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new lu),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new hu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new tu),n.push(new nu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new au({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new Zl({duration:e.zoomDuration})),n}var _h=Object.freeze({__proto__:null,defaults:gh,DoubleClickZoom:ml,DragAndDrop:du,DragBox:Kl,DragPan:Dl,DragRotate:jl,DragRotateAndZoom:_u,DragZoom:Zl,Draw:Lu,Extent:ju,Interaction:_l,KeyboardPan:tu,KeyboardZoom:nu,Modify:Hu,MouseWheelZoom:au,PinchRotate:lu,PinchZoom:hu,Pointer:wl,Select:rh,Snap:lh,Translate:dh}),yh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vh=function(t){function e(e){return(e=m({},e)).controls||(e.controls=function(t){var e=t||{},n=new et;return(void 0===e.zoom||e.zoom)&&n.push(new ol(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new il(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new el(e.attributionOptions)),n}()),e.interactions||(e.interactions=gh({onFocusOnly:!0})),t.call(this,e)||this}return yh(e,t),e.prototype.createRenderer=function(){return new fs(this)},e}(Js),mh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return nt(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return nt(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){nt(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function xh(t,e,n,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function wh(t,e,n){return t+"/"+e+"/"+n}function Sh(t){return wh(t[0],t[1],t[2])}function Ch(t){return(t[1]<<t[0])+t[2]}var bh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Eh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Sh(e.tileCoord)),e.release())}.bind(this))}},e}(mh),Th=function(){function t(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Ph(t,e,n,i,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=n,r.maxY=i,r):new Th(t,e,n,i)}var Rh=Xo((function(t,e){t.exports=function(t,e){t="default"in t?t.default:t;var n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),i="layer-switcher-",r=function(t){function r(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var e=t||{},n=e.tipLabel?e.tipLabel:"Legend",o=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",a=document.createElement("div"),s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,{element:a,target:e.target}));s.activationMode=e.activationMode||"mouseover",s.startActive=!0===e.startActive;var l=void 0!==e.label?e.label:"",u=void 0!==e.collapseLabel?e.collapseLabel:"»";s.groupSelectStyle=r.getGroupSelectStyle(e.groupSelectStyle),s.reverse=!1!==e.reverse,s.mapListeners=[],s.hiddenClassName="ol-unselectable ol-control layer-switcher",r.isTouchDevice_()&&(s.hiddenClassName+=" touch"),s.shownClassName="shown",a.className=s.hiddenClassName;var h=document.createElement("button");h.setAttribute("title",n),h.setAttribute("aria-label",n),a.appendChild(h),s.panel=document.createElement("div"),s.panel.className="panel",a.appendChild(s.panel),r.enableTouchScroll_(s.panel);var c=s;return h.textContent=l,a.classList.add(i+"group-select-style-"+s.groupSelectStyle),a.classList.add(i+"activation-mode-"+s.activationMode),"click"===s.activationMode?(a.classList.add("activationModeClick"),s.startActive&&(h.textContent=u,h.setAttribute("title",o),h.setAttribute("aria-label",o)),h.onclick=function(t){t=t||window.event,c.element.classList.contains(c.shownClassName)?(c.hidePanel(),h.textContent=l,h.setAttribute("title",n),h.setAttribute("aria-label",n)):(c.showPanel(),h.textContent=u,h.setAttribute("title",o),h.setAttribute("aria-label",o)),t.preventDefault()}):(h.onmouseover=function(t){c.showPanel()},h.onclick=function(t){t=t||window.event,c.showPanel(),t.preventDefault()},c.panel.onmouseout=function(t){t=t||window.event,c.panel.contains(t.toElement||t.relatedTarget)||c.hidePanel()}),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),n(r,[{key:"setMap",value:function(t){for(var n=0;n<this.mapListeners.length;n++)e.unByKey(this.mapListeners[n]);if(this.mapListeners.length=0,function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"setMap",this).call(this,t),t&&(this.startActive?this.showPanel():this.renderPanel(),"click"!==this.activationMode)){var i=this;this.mapListeners.push(t.on("pointerdown",(function(){i.hidePanel()})))}}},{key:"showPanel",value:function(){this.element.classList.contains(this.shownClassName)||(this.element.classList.add(this.shownClassName),this.renderPanel())}},{key:"hidePanel",value:function(){this.element.classList.contains(this.shownClassName)&&this.element.classList.remove(this.shownClassName)}},{key:"renderPanel",value:function(){this.dispatchEvent({type:"render"}),r.renderPanel(this.getMap(),this.panel,{groupSelectStyle:this.groupSelectStyle,reverse:this.reverse}),this.dispatchEvent({type:"rendercomplete"})}}],[{key:"renderPanel",value:function(t,e,n){var i=new Event("render");for(e.dispatchEvent(i),(n=n||{}).groupSelectStyle=r.getGroupSelectStyle(n.groupSelectStyle),r.ensureTopVisibleBaseLayerShown_(t);e.firstChild;)e.removeChild(e.firstChild);r.forEachRecursive(t,(function(t,e,n){t.set("indeterminate",!1)})),"children"===n.groupSelectStyle||"none"===n.groupSelectStyle?r.setGroupVisibility(t):"group"===n.groupSelectStyle&&r.setChildVisibility(t);var o=document.createElement("ul");e.appendChild(o),r.renderLayers_(t,t,o,n,(function(i){r.renderPanel(t,e,n)}));var a=new Event("rendercomplete");e.dispatchEvent(a)}},{key:"isBaseGroup",value:function(t){var e=t.getLayers?t.getLayers().getArray():[];return e.length&&"base"===e[0].get("type")}},{key:"setGroupVisibility",value:function(t){r.getGroupsAndLayers(t,(function(t){return t.getLayers&&!t.get("combine")&&!r.isBaseGroup(t)})).reverse().forEach((function(t){var e=t.getLayersArray().map((function(t){return t.getVisible()}));e.every((function(t){return!0===t}))?(t.setVisible(!0),t.set("indeterminate",!1)):e.every((function(t){return!1===t}))?(t.setVisible(!1),t.set("indeterminate",!1)):(t.setVisible(!0),t.set("indeterminate",!0))}))}},{key:"setChildVisibility",value:function(t){r.getGroupsAndLayers(t,(function(t){return t.getLayers&&!t.get("combine")&&!r.isBaseGroup(t)})).forEach((function(t){var e=t.getVisible(),n=t.get("indeterminate");t.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),e&&!n||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown_",value:function(t){var e;r.forEachRecursive(t,(function(t,n,i){"base"===t.get("type")&&t.getVisible()&&(e=t)})),e&&r.setVisible_(t,e,!0)}},{key:"getGroupsAndLayers",value:function(t,e){var n=[];return e=e||function(t,e,n){return!0},r.forEachRecursive(t,(function(t,i,r){t.get("title")&&e(t,i,r)&&n.push(t)})),n}},{key:"setVisible_",value:function(t,e,n,i){e.setVisible(n),n&&"base"===e.get("type")&&r.forEachRecursive(t,(function(t,n,i){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e.getLayers&&!e.get("combine")&&"children"===i&&e.getLayers().forEach((function(n){r.setVisible_(t,n,e.getVisible(),i)}))}},{key:"renderLayer_",value:function(t,e,n,o,a){var s=document.createElement("li"),l=e.get("title"),u=r.uuid(),h=document.createElement("label");if(e.getLayers&&!e.get("combine")){var c=r.isBaseGroup(e);if(s.classList.add("group"),c&&s.classList.add(i+"base-group"),e.get("fold")){s.classList.add(i+"fold"),s.classList.add(i+e.get("fold"));var p=document.createElement("button");p.onclick=function(t){t=t||window.event,r.toggleFold_(e,s),t.preventDefault()},s.appendChild(p)}if(!c&&"none"!=o.groupSelectStyle){var f=document.createElement("input");f.type="checkbox",f.id=u,f.checked=e.getVisible(),f.indeterminate=e.get("indeterminate"),f.onchange=function(n){r.setVisible_(t,e,n.target.checked,o.groupSelectStyle),a(e)},s.appendChild(f),h.htmlFor=u}h.innerHTML=l,s.appendChild(h);var d=document.createElement("ul");s.appendChild(d),r.renderLayers_(t,e,d,o,a)}else{s.className="layer";var g=document.createElement("input");"base"===e.get("type")?(g.type="radio",g.name="base"):g.type="checkbox",g.id=u,g.checked=e.get("visible"),g.indeterminate=e.get("indeterminate"),g.onchange=function(n){r.setVisible_(t,e,n.target.checked,o.groupSelectStyle),a(e)},s.appendChild(g),h.htmlFor=u,h.innerHTML=l;var _=t.getView().getResolution();(_>e.getMaxResolution()||_<e.getMinResolution())&&(h.className+=" disabled"),s.appendChild(h)}return s}},{key:"renderLayers_",value:function(t,e,n,i,o){var a=e.getLayers().getArray().slice();i.reverse&&(a=a.reverse());for(var s,l=0;l<a.length;l++)(s=a[l]).get("title")&&n.appendChild(r.renderLayer_(t,s,l,i,o))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,n,i){e(t,n,i),t.getLayers&&r.forEachRecursive(t,e)}))}},{key:"uuid",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}},{key:"enableTouchScroll_",value:function(t){if(r.isTouchDevice_()){var e=0;t.addEventListener("touchstart",(function(t){e=this.scrollTop+t.touches[0].pageY}),!1),t.addEventListener("touchmove",(function(t){this.scrollTop=e-t.touches[0].pageY}),!1)}}},{key:"isTouchDevice_",value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},{key:"toggleFold_",value:function(t,e){e.classList.remove(i+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(i+t.get("fold"))}},{key:"getGroupSelectStyle",value:function(t){return["none","children","group"].indexOf(t)>=0?t:"children"}}]),r}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=r),r}($s,X)})),Fh=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,e){var n;if(e){var i=e.dataProjection?un(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()===wt&&(i=un(i)).setWorldExtent(e.extent),n={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(n)},t.prototype.adaptOptions=function(t){return m({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return e()},t.prototype.readFeature=function(t,n){return e()},t.prototype.readFeatures=function(t,n){return e()},t.prototype.readGeometry=function(t,n){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,n){return e()},t.prototype.writeFeatures=function(t,n){return e()},t.prototype.writeGeometry=function(t,n){return e()},t}();function Oh(t,e,n){var i,r=n?un(n.featureProjection):null,o=n?un(n.dataProjection):null;if(i=r&&o&&!fn(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&n&&void 0!==n.decimals){var a=Math.pow(10,n.decimals);i===t&&(i=t.clone()),i.applyTransform((function(t){for(var e=0,n=t.length;e<n;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return i}var Ih=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ah=function(t){function n(){return t.call(this)||this}return Ih(n,t),n.prototype.getType=function(){return Ua},n.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Mh(t),this.getReadOptions(t,e))},n.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Mh(t),this.getReadOptions(t,e))},n.prototype.readFeatureFromObject=function(t,n){return e()},n.prototype.readFeaturesFromObject=function(t,n){return e()},n.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Mh(t),this.getReadOptions(t,e))},n.prototype.readGeometryFromObject=function(t,n){return e()},n.prototype.readProjection=function(t){return this.readProjectionFromObject(Mh(t))},n.prototype.readProjectionFromObject=function(t){return e()},n.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},n.prototype.writeFeatureObject=function(t,n){return e()},n.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},n.prototype.writeFeaturesObject=function(t,n){return e()},n.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},n.prototype.writeGeometryObject=function(t,n){return e()},n}(Fh);function Mh(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Lh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kh=function(t){function e(e){var n=t.call(this)||this;return n.geometries_=e||null,n.changeEventsKeys_=[],n.listenGeometriesChange_(),n}return Lh(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(B),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(N(this.geometries_[t],E,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t},e.prototype.closestPointXY=function(t,e,n,i){if(i<Vt(this.getExtent(),t,e))return i;for(var r=this.geometries_,o=0,a=r.length;o<a;++o)i=r[o].closestPointXY(t,e,n,i);return i},e.prototype.containsXY=function(t,e){for(var n=this.geometries_,i=0,r=n.length;i<r;++i)if(n[i].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){Qt(t);for(var e=this.geometries_,n=0,i=e.length;n<i;++n)ie(t,e[n].getExtent());return t},e.prototype.getGeometries=function(){return Dh(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,n=0,i=e.length;n<i;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var n=[],i=this.geometries_,r=!1,o=0,a=i.length;o<a;++o){var s=i[o],l=s.getSimplifiedGeometry(t);n.push(l),l!==s&&(r=!0)}if(r){var u=new e(null);return u.setGeometriesArray(n),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return _t},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,n=0,i=e.length;n<i;++n)if(e[n].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var n=this.geometries_,i=0,r=n.length;i<r;++i)n[i].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,n){var i=n;i||(i=ce(this.getExtent()));for(var r=this.geometries_,o=0,a=r.length;o<a;++o)r[o].scale(t,e,i);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Dh(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,n=0,i=e.length;n<i;++n)e[n].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var n=this.geometries_,i=0,r=n.length;i<r;++i)n[i].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Fn);function Dh(t){for(var e=[],n=0,i=t.length;n<i;++n)e.push(t[n].clone());return e}var Gh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),jh=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this)||this).dataProjection=un(i.dataProjection?i.dataProjection:"EPSG:4326"),i.featureProjection&&(n.defaultFeatureProjection=un(i.featureProjection)),n.geometryName_=i.geometryName,n.extractGeometryName_=i.extractGeometryName,n}return Gh(e,t),e.prototype.readFeatureFromObject=function(t,e){var n=null,i=Nh((n="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),r=new rt;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in n!==void 0&&r.setGeometryName(n.geometry_name),r.setGeometry(i),"id"in n&&r.setId(n.id),n.properties&&r.setProperties(n.properties,!0),r},e.prototype.readFeaturesFromObject=function(t,e){var n=null;if("FeatureCollection"===t.type){n=[];for(var i=t.features,r=0,o=i.length;r<o;++r)n.push(this.readFeatureFromObject(i[r],e))}else n=[this.readFeatureFromObject(t,e)];return n},e.prototype.readGeometryFromObject=function(t,e){return Nh(t,e)},e.prototype.readProjectionFromObject=function(t){var e,n=t.crs;return n?"name"==n.type?e=un(n.properties.name):"EPSG"===n.type?e=un("EPSG:"+n.properties.code):nt(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var n={type:"Feature",geometry:null,properties:null},i=t.getId();if(void 0!==i&&(n.id=i),!t.hasProperties())return n;var r=t.getProperties(),o=t.getGeometry();return o&&(n.geometry=zh(o,e),delete r[t.getGeometryName()]),S(r)||(n.properties=r),n},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var n=[],i=0,r=t.length;i<r;++i)n.push(this.writeFeatureObject(t[i],e));return{type:"FeatureCollection",features:n}},e.prototype.writeGeometryObject=function(t,e){return zh(t,this.adaptOptions(e))},e}(Ah);function Nh(t,e){if(!t)return null;var n;switch(t.type){case ut:n=function(t){return new $n(t.coordinates)}(t);break;case ht:n=function(t){return new Ti(t.coordinates)}(t);break;case pt:n=function(t){return new fi(t.coordinates)}(t);break;case ft:n=function(t){return new Su(t.coordinates)}(t);break;case dt:n=function(t){return new xu(t.coordinates)}(t);break;case gt:n=function(t){return new bu(t.coordinates)}(t);break;case _t:n=function(t,e){var n=t.geometries.map((function(t){return Nh(t,e)}));return new kh(n)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Oh(n,!1,e)}function zh(t,e){var n,i=(t=Oh(t,!0,e)).getType();switch(i){case ut:n=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case ht:n=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case pt:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(n)}}(t,e);break;case ft:n=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case dt:n=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case gt:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}(t,e);break;case _t:n=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var n=m({},e);return delete n.featureProjection,zh(t,n)}))}}(t,e);break;case yt:n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+i)}return n}function Bh(t,e){return oc().createElementNS(t,e)}function Uh(t,e){return function t(e,n,i){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n?i.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(e.nodeValue);else{var r=void 0;for(r=e.firstChild;r;r=r.nextSibling)t(r,n,i)}return i}(t,e,[]).join("")}function Xh(t){return"documentElement"in t}function Wh(t){return(new DOMParser).parseFromString(t,"application/xml")}function Vh(t,e){return function(n,i){var r=t.call(void 0!==e?e:this,n,i);void 0!==r&&d(i[i.length-1],r)}}function Kh(t,e){return function(n,i){var r=t.call(void 0!==e?e:this,n,i);void 0!==r&&i[i.length-1].push(r)}}function Yh(t,e){return function(n,i){var r=t.call(void 0!==e?e:this,n,i);void 0!==r&&(i[i.length-1]=r)}}function Zh(t,e,n){return function(i,r){var o=t.call(void 0!==n?n:this,i,r);void 0!==o&&(r[r.length-1][void 0!==e?e:i.localName]=o)}}function Hh(t,e){return function(n,i,r){t.call(void 0!==e?e:this,n,i,r),r[r.length-1].node.appendChild(n)}}function qh(t,e){var n=t;return function(t,i,r){var o=i[i.length-1].node,a=n;return void 0===a&&(a=r),Bh(void 0!==e?e:o.namespaceURI,a)}}var Jh=qh();function Qh(t,e){for(var n=e.length,i=new Array(n),r=0;r<n;++r)i[r]=t[e[r]];return i}function $h(t,e,n){var i,r,o=void 0!==n?n:{};for(i=0,r=t.length;i<r;++i)o[t[i]]=e;return o}function tc(t,e,n,i){var r;for(r=e.firstElementChild;r;r=r.nextElementSibling){var o=t[r.namespaceURI];if(void 0!==o){var a=o[r.localName];void 0!==a&&a.call(i,r,n)}}}function ec(t,e,n,i,r){return i.push(t),tc(e,n,i,r),i.pop()}function nc(t,e,n,i,r,o,a){return r.push(t),function(t,e,n,i,r,o){for(var a,s,l=(void 0!==r?r:n).length,u=0;u<l;++u)void 0!==(a=n[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,i,void 0!==r?r[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,i)}(e,n,i,r,o,a),r.pop()}var ic=void 0;var rc=void 0;function oc(){return void 0===rc&&"undefined"!=typeof document&&(rc=document.implementation.createDocument("","",null)),rc}var ac=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sc=function(t){function n(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===ic&&"undefined"!=typeof XMLSerializer&&(ic=new XMLSerializer),ic),e}return ac(n,t),n.prototype.getType=function(){return Wa},n.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var n=Wh(t);return this.readFeatureFromDocument(n,e)}return Xh(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},n.prototype.readFeatureFromDocument=function(t,e){var n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null},n.prototype.readFeatureFromNode=function(t,e){return null},n.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var n=Wh(t);return this.readFeaturesFromDocument(n,e)}return Xh(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},n.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&d(n,this.readFeaturesFromNode(i,e));return n},n.prototype.readFeaturesFromNode=function(t,n){return e()},n.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var n=Wh(t);return this.readGeometryFromDocument(n,e)}return Xh(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},n.prototype.readGeometryFromDocument=function(t,e){return null},n.prototype.readGeometryFromNode=function(t,e){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Wh(t);return this.readProjectionFromDocument(e)}return Xh(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},n.prototype.writeFeatureNode=function(t,e){return null},n.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},n.prototype.writeFeaturesNode=function(t,e){return null},n.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},n.prototype.writeGeometryNode=function(t,e){return null},n}(Fh);function lc(t){var e,n=Uh(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(n))?void 0!==e[1]||!1:void 0}function uc(t){var e,n=Uh(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n))?parseFloat(e[1]):void 0}function hc(t){return Uh(t,!1).trim()}function cc(t,e){fc(t,e?"1":"0")}function pc(t,e){var n=e.toPrecision();t.appendChild(oc().createTextNode(n))}function fc(t,e){t.appendChild(oc().createTextNode(e))}var dc,gc,_c,yc,vc,mc,xc,wc,Sc,Cc,bc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ec=["http://www.google.com/kml/ext/2.2"],Tc=[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"],Pc={fraction:sa,pixels:la,insetPixels:la},Rc=$h(Tc,{ExtendedData:vp,Region:mp,MultiGeometry:Zh(up,"geometry"),LineString:Zh(ap,"geometry"),LinearRing:Zh(sp,"geometry"),Point:Zh(hp,"geometry"),Polygon:Zh(pp,"geometry"),Style:Zh(dp),StyleMap:function(t,e){var n=Kc.call(this,t,e);if(!n)return;var i=e[e.length-1];Array.isArray(n)?i.Style=n:"string"==typeof n?i.styleUrl=n:nt(!1,38)},address:Zh(hc),description:Zh(hc),name:Zh(hc),open:Zh(lc),phoneNumber:Zh(hc),styleUrl:Zh(Xc),visibility:Zh(lc)},$h(Ec,{MultiTrack:Zh((function(t,e){var n=ec([],$c,t,e);if(!n)return;return new xu(n)}),"geometry"),Track:Zh(ep,"geometry")})),Fc=$h(Tc,{ExtendedData:vp,Region:mp,Link:function(t,e){tc(Oc,t,e)},address:Zh(hc),description:Zh(hc),name:Zh(hc),open:Zh(lc),phoneNumber:Zh(hc),visibility:Zh(lc)}),Oc=$h(Tc,{href:Zh(Xc)}),Ic=$h(Tc,{LatLonAltBox:function(t,e){var n=ec({},Sp,t,e);if(!n)return;var i=e[e.length-1],r=[parseFloat(n.west),parseFloat(n.south),parseFloat(n.east),parseFloat(n.north)];i.extent=r,i.altitudeMode=n.altitudeMode,i.minAltitude=parseFloat(n.minAltitude),i.maxAltitude=parseFloat(n.maxAltitude)},Lod:function(t,e){var n=ec({},Cp,t,e);if(!n)return;var i=e[e.length-1];i.minLodPixels=parseFloat(n.minLodPixels),i.maxLodPixels=parseFloat(n.maxLodPixels),i.minFadeExtent=parseFloat(n.minFadeExtent),i.maxFadeExtent=parseFloat(n.maxFadeExtent)}}),Ac=$h(Tc,["Document","Placemark"]),Mc=$h(Tc,{Document:Hh((function(t,e,n){nc({node:t},Rp,Fp,e,n,void 0,this)})),Placemark:Hh($p)}),Lc=null,kc=null,Dc=null,Gc=null,jc=null,Nc=null;var zc=function(t){function e(e){var n=t.call(this)||this,i=e||{};return Nc||(Lc=new wi({color:dc=[255,255,255,1]}),kc=new Ca({anchor:gc=[20,2],anchorOrigin:ua,anchorXUnits:_c=la,anchorYUnits:yc=la,crossOrigin:"anonymous",rotation:0,scale:xc=.5,size:vc=[64,64],src:mc="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),wc="NO_IMAGE",Dc=new Pi({color:dc,width:1}),Sc=new Pi({color:[51,51,51,1],width:2}),Gc=new Ir({font:"bold 16px Helvetica",fill:Lc,stroke:Sc,scale:.8}),jc=new br({fill:Lc,image:kc,text:Gc,stroke:Dc,zIndex:0}),Nc=[jc]),n.dataProjection=un("EPSG:4326"),n.defaultStyle_=i.defaultStyle?i.defaultStyle:Nc,n.extractStyles_=void 0===i.extractStyles||i.extractStyles,n.writeStyles_=void 0===i.writeStyles||i.writeStyles,n.sharedStyles_={},n.showPointNames_=void 0===i.showPointNames||i.showPointNames,n.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",n}return bc(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var n=ec([],$h(Tc,{Document:Vh(this.readDocumentOrFolder_,this),Folder:Vh(this.readDocumentOrFolder_,this),Placemark:Kh(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return n||void 0},e.prototype.readPlacemark_=function(t,e){var n=ec({geometry:null},Rc,t,e,this);if(n){var i=new rt,r=t.getAttribute("id");null!==r&&i.setId(r);var o=e[0],a=n.geometry;if(a&&Oh(a,!1,o),i.setGeometry(a),delete n.geometry,this.extractStyles_){var s=function(t,e,n,i,r){return function(o,a){var s=r,l="",u=[];if(s){var h=o.getGeometry();if(h){var c=h.getType();s=c===_t?(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ut||e===ft}))).length>0:c===ut||c===ft}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(Cc||(Cc=document.createElement("textarea")),Cc.innerHTML=l,l=Cc.value));var p=n;if(t?p=t:e&&(p=function t(e,n,i){return Array.isArray(e)?e:"string"==typeof e?(!(e in i)&&"#"+e in i&&(e="#"+e),t(i[e],n,i)):n}(e,n,i)),s){var f=function(t,e){var n=[0,0],i="start",r=t.getImage();if(r){var o=r.getImageSize();if(null===o&&(o=vc),2==o.length){var a=r.getScaleArray();n[0]=a[0]*o[0]/2,n[1]=-a[1]*o[1]/2,i="left"}}var s=t.getText();s?((s=s.clone()).setFont(s.getFont()||Gc.getFont()),s.setScale(s.getScale()||Gc.getScale()),s.setFill(s.getFill()||Gc.getFill()),s.setStroke(s.getStroke()||Sc)):s=Gc.clone();return s.setText(e),s.setOffsetX(n[0]),s.setOffsetY(n[1]),s.setTextAlign(i),new br({image:r,text:s})}(p[0],l);return u.length>0?(f.setGeometry(new kh(u)),[f,new br({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(n.Style,n.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);i.setStyle(s)}return delete n.Style,i.setProperties(n,!0),i}},e.prototype.readSharedStyle_=function(t,e){var n=t.getAttribute("id");if(null!==n){var i=dp.call(this,t,e);if(i){var r=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)r=new URL("#"+n,o).href;else r="#"+n;this.sharedStyles_[r]=i}}},e.prototype.readSharedStyleMap_=function(t,e){var n=t.getAttribute("id");if(null!==n){var i=Kc.call(this,t,e);if(i){var r,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)r=new URL("#"+n,o).href;else r="#"+n;this.sharedStyles_[r]=i}}},e.prototype.readFeatureFromNode=function(t,e){if(!c(Tc,t.namespaceURI))return null;var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(Tc,t.namespaceURI))return[];var n,i=t.localName;if("Document"==i||"Folder"==i)return(n=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==i){var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r?[r]:[]}if("kml"==i){n=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&d(n,a)}return n}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Wh(t);return this.readNameFromDocument(e)}return Xh(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var n=this.readNameFromNode(e);if(n)return n}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(c(Tc,e.namespaceURI)&&"name"==e.localName)return hc(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var n=e.localName;if(c(Tc,e.namespaceURI)&&("Document"==n||"Folder"==n||"Placemark"==n||"kml"==n)){var i=this.readNameFromNode(e);if(i)return i}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var n=Wh(t);d(e,this.readNetworkLinksFromDocument(n))}else Xh(t)?d(e,this.readNetworkLinksFromDocument(t)):d(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(e,this.readNetworkLinksFromNode(n));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],n=t.firstElementChild;n;n=n.nextElementSibling)if(c(Tc,n.namespaceURI)&&"NetworkLink"==n.localName){var i=ec({},Fc,n,[]);e.push(i)}for(n=t.firstElementChild;n;n=n.nextElementSibling){var r=n.localName;!c(Tc,n.namespaceURI)||"Document"!=r&&"Folder"!=r&&"kml"!=r||d(e,this.readNetworkLinksFromNode(n))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var n=Wh(t);d(e,this.readRegionFromDocument(n))}else Xh(t)?d(e,this.readRegionFromDocument(t)):d(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(e,this.readRegionFromNode(n));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],n=t.firstElementChild;n;n=n.nextElementSibling)if(c(Tc,n.namespaceURI)&&"Region"==n.localName){var i=ec({},Ic,n,[]);e.push(i)}for(n=t.firstElementChild;n;n=n.nextElementSibling){var r=n.localName;!c(Tc,n.namespaceURI)||"Document"!=r&&"Folder"!=r&&"kml"!=r||d(e,this.readRegionFromNode(n))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var n=Bh(Tc[4],"kml"),i="http://www.w3.org/2000/xmlns/";n.setAttributeNS(i,"xmlns:gx",Ec[0]),n.setAttributeNS(i,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),n.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var r={node:n},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=Ac[n.namespaceURI],s=Qh(o,a);return nc(r,Mc,Jh,s,[e],a,this),n},e}(sc);function Bc(t){var e=Uh(t,!1),n=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(n){var i=n[1];return[parseInt(i.substr(6,2),16),parseInt(i.substr(4,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(0,2),16)/255]}}function Uc(t){for(var e,n=Uh(t,!1),i=[],r=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=r.exec(n);){var o=parseFloat(e[1]),a=parseFloat(e[2]),s=e[3]?parseFloat(e[3]):0;i.push(o,a,s),n=n.substr(e[0].length)}if(""===n)return i}function Xc(t){var e=Uh(t,!1).trim(),n=t.baseURI;return n&&"about:blank"!=n||(n=window.location.href),n?new URL(e,n).href:e}function Wc(t){return uc(t)}var Vc=$h(Tc,{Pair:function(t,e){var n=ec({},xp,t,e,this);if(!n)return;var i=n.key;if(i&&"normal"==i){var r=n.styleUrl;r&&(e[e.length-1]=r);var o=n.Style;o&&(e[e.length-1]=o)}}});function Kc(t,e){return ec(void 0,Vc,t,e,this)}var Yc=$h(Tc,{Icon:Zh((function(t,e){var n=ec({},np,t,e);return n||null})),color:Zh(Bc),heading:Zh(uc),hotSpot:Zh((function(t){var e,n=t.getAttribute("xunits"),i=t.getAttribute("yunits");return e="insetPixels"!==n?"insetPixels"!==i?ua:ca:"insetPixels"!==i?ha:pa,{x:parseFloat(t.getAttribute("x")),xunits:Pc[n],y:parseFloat(t.getAttribute("y")),yunits:Pc[i],origin:e}})),scale:Zh(Wc)});var Zc=$h(Tc,{color:Zh(Bc),scale:Zh(Wc)});var Hc=$h(Tc,{color:Zh(Bc),width:Zh(uc)});var qc=$h(Tc,{color:Zh(Bc),fill:Zh(lc),outline:Zh(lc)});var Jc=$h(Tc,{coordinates:Yh(Uc)});function Qc(t,e){return ec(null,Jc,t,e)}var $c=$h(Ec,{Track:Kh(ep)});var tp=$h(Tc,{when:function(t,e){var n=e[e.length-1].whens,i=Uh(t,!1),r=Date.parse(i);n.push(isNaN(r)?0:r)}},$h(Ec,{coord:function(t,e){var n=e[e.length-1].flatCoordinates,i=Uh(t,!1),r=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(i);if(r){var o=parseFloat(r[1]),a=parseFloat(r[2]),s=parseFloat(r[3]);n.push(o,a,s,0)}else n.push(0,0,0,0)}}));function ep(t,e){var n=ec({flatCoordinates:[],whens:[]},tp,t,e);if(n){for(var i=n.flatCoordinates,r=n.whens,o=0,a=Math.min(i.length,r.length);o<a;++o)i[4*o+3]=r[o];return new Ti(i,lt)}}var np=$h(Tc,{href:Zh(Xc)},$h(Ec,{x:Zh(uc),y:Zh(uc),w:Zh(uc),h:Zh(uc)}));var ip=$h(Tc,{coordinates:Yh(Uc)});function rp(t,e){return ec(null,ip,t,e)}var op=$h(Tc,{extrude:Zh(lc),tessellate:Zh(lc),altitudeMode:Zh(hc)});function ap(t,e){var n=ec({},op,t,e),i=rp(t,e);if(i){var r=new Ti(i,at);return r.setProperties(n,!0),r}}function sp(t,e){var n=ec({},op,t,e),i=rp(t,e);if(i){var r=new fi(i,at,[i.length]);return r.setProperties(n,!0),r}}var lp=$h(Tc,{LineString:Kh(ap),LinearRing:Kh(sp),MultiGeometry:Kh(up),Point:Kh(hp),Polygon:Kh(pp)});function up(t,e){var n,i=ec([],lp,t,e);if(!i)return null;if(0===i.length)return new kh(i);for(var r=!0,o=i[0].getType(),a=1,s=i.length;a<s;++a)if(i[a].getType()!=o){r=!1;break}if(r){var l=void 0,u=void 0;if(o==ut){var h=i[0];l=h.getLayout(),u=h.getFlatCoordinates();for(a=1,s=i.length;a<s;++a)d(u,i[a].getFlatCoordinates());gp(n=new Su(u,l),i)}else o==ht?gp(n=new xu(i),i):o==pt?gp(n=new bu(i),i):o==_t?n=new kh(i):nt(!1,37)}else n=new kh(i);return n}function hp(t,e){var n=ec({},op,t,e),i=rp(t,e);if(i){var r=new $n(i,at);return r.setProperties(n,!0),r}}var cp=$h(Tc,{innerBoundaryIs:function(t,e){var n=ec(void 0,bp,t,e);if(n){e[e.length-1].push(n)}},outerBoundaryIs:function(t,e){var n=ec(void 0,Ep,t,e);if(n){e[e.length-1][0]=n}}});function pp(t,e){var n=ec({},op,t,e),i=ec([null],cp,t,e);if(i&&i[0]){for(var r=i[0],o=[r.length],a=1,s=i.length;a<s;++a)d(r,i[a]),o.push(r.length);var l=new fi(r,at,o);return l.setProperties(n,!0),l}}var fp=$h(Tc,{IconStyle:function(t,e){var n=ec({},Yc,t,e);if(n){var i,r,o,a,s=e[e.length-1],l="Icon"in n?n.Icon:{},u=!("Icon"in n)||Object.keys(l).length>0,h=l.href;h?i=h:u&&(i=mc);var c,p=ua,f=n.hotSpot;f?(r=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):i===mc?(r=gc,o=_c,a=yc):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(i)&&(r=[.5,0],o=sa,a=sa);var d,g=l.x,_=l.y;void 0!==g&&void 0!==_&&(c=[g,_]);var y,v=l.w,m=l.h;void 0!==v&&void 0!==m&&(d=[v,m]);var x=n.heading;void 0!==x&&(y=Fe(x));var w=n.scale,S=n.color;if(u){i==mc&&(d=vc,void 0===w&&(w=xc));var C=new Ca({anchor:r,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:ua,rotation:y,scale:w,size:d,src:i,color:S});s.imageStyle=C}else s.imageStyle=wc}},LabelStyle:function(t,e){var n=ec({},Zc,t,e);if(n){var i=e[e.length-1],r=new Ir({fill:new wi({color:"color"in n?n.color:dc}),scale:n.scale});i.textStyle=r}},LineStyle:function(t,e){var n=ec({},Hc,t,e);if(n){var i=e[e.length-1],r=new Pi({color:"color"in n?n.color:dc,width:"width"in n?n.width:1});i.strokeStyle=r}},PolyStyle:function(t,e){var n=ec({},qc,t,e);if(n){var i=e[e.length-1],r=new wi({color:"color"in n?n.color:dc});i.fillStyle=r;var o=n.fill;void 0!==o&&(i.fill=o);var a=n.outline;void 0!==a&&(i.outline=a)}}});function dp(t,e){var n=ec({},fp,t,e,this);if(!n)return null;var i,r="fillStyle"in n?n.fillStyle:Lc,o=n.fill;void 0===o||o||(r=null),"imageStyle"in n?n.imageStyle!=wc&&(i=n.imageStyle):i=kc;var a="textStyle"in n?n.textStyle:Gc,s="strokeStyle"in n?n.strokeStyle:Dc,l=n.outline;return void 0===l||l?[new br({fill:r,image:i,stroke:s,text:a,zIndex:void 0})]:[new br({geometry:function(t){var e=t.getGeometry(),n=e.getType();return n===_t?new kh(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==pt&&e!==gt}))):n!==pt&&n!==gt?e:void 0},fill:r,image:i,stroke:s,text:a,zIndex:void 0}),new br({geometry:function(t){var e=t.getGeometry(),n=e.getType();return n===_t?new kh(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===gt}))):n===pt||n===gt?e:void 0},fill:r,stroke:null,zIndex:void 0})]}function gp(t,e){var n,i,r,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);n=!1,i=!1,r=!1;for(var u=0;u<o;++u){var h=e[u];a[u]=h.get("extrude"),s[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),n=n||void 0!==a[u],i=i||void 0!==s[u],r=r||l[u]}n&&t.set("extrude",a),i&&t.set("tessellate",s),r&&t.set("altitudeMode",l)}var _p=$h(Tc,{displayName:Zh(hc),value:Zh(hc)});var yp=$h(Tc,{Data:function(t,e){var n=t.getAttribute("name");tc(_p,t,e);var i=e[e.length-1];n&&i.displayName?i[n]={value:i.value,displayName:i.displayName,toString:function(){return i.value}}:null!==n?i[n]=i.value:null!==i.displayName&&(i[i.displayName]=i.value),delete i.value},SchemaData:function(t,e){tc(wp,t,e)}});function vp(t,e){tc(yp,t,e)}function mp(t,e){tc(Ic,t,e)}var xp=$h(Tc,{Style:Zh(dp),key:Zh(hc),styleUrl:Zh(Xc)});var wp=$h(Tc,{SimpleData:function(t,e){var n=t.getAttribute("name");if(null!==n){var i=hc(t);e[e.length-1][n]=i}}});var Sp=$h(Tc,{altitudeMode:Zh(hc),minAltitude:Zh(uc),maxAltitude:Zh(uc),north:Zh(uc),south:Zh(uc),east:Zh(uc),west:Zh(uc)});var Cp=$h(Tc,{minLodPixels:Zh(uc),maxLodPixels:Zh(uc),minFadeExtent:Zh(uc),maxFadeExtent:Zh(uc)});var bp=$h(Tc,{LinearRing:Yh(Qc)});var Ep=$h(Tc,{LinearRing:Yh(Qc)});function Tp(t,e){for(var n=zi(e),i=[255*(4==n.length?n[3]:1),n[2],n[1],n[0]],r=0;r<4;++r){var o=Math.floor(i[r]).toString(16);i[r]=1==o.length?"0"+o:o}fc(t,i.join(""))}var Pp=$h(Tc,{Data:Hh((function(t,e,n){t.setAttribute("name",e.name);var i={node:t},r=e.value;"object"==typeof r?(null!==r&&r.displayName&&nc(i,Pp,Jh,[r.displayName],n,["displayName"]),null!==r&&r.value&&nc(i,Pp,Jh,[r.value],n,["value"])):nc(i,Pp,Jh,[r],n,["value"])})),value:Hh((function(t,e){fc(t,e)})),displayName:Hh((function(t,e){!function(t,e){t.appendChild(oc().createCDATASection(e))}(t,e)}))});var Rp=$h(Tc,{Placemark:Hh($p)}),Fp=function(t,e,n){return Bh(e[e.length-1].node.namespaceURI,"Placemark")};var Op=qh("Data");var Ip=$h(Tc,["href"],$h(Ec,["x","y","w","h"])),Ap=$h(Tc,{href:Hh(fc)},$h(Ec,{x:Hh(pc),y:Hh(pc),w:Hh(pc),h:Hh(pc)})),Mp=function(t,e,n){return Bh(Ec[0],"gx:"+n)};var Lp=$h(Tc,["scale","heading","Icon","color","hotSpot"]),kp=$h(Tc,{Icon:Hh((function(t,e,n){var i={node:t},r=n[n.length-1].node,o=Ip[r.namespaceURI],a=Qh(e,o);nc(i,Ap,Jh,a,n,o),a=Qh(e,o=Ip[Ec[0]]),nc(i,Ap,Mp,a,n,o)})),color:Hh(Tp),heading:Hh(pc),hotSpot:Hh((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Hh(hf)});var Dp=$h(Tc,["color","scale"]),Gp=$h(Tc,{color:Hh(Tp),scale:Hh(hf)});var jp=$h(Tc,["color","width"]),Np=$h(Tc,{color:Hh(Tp),width:Hh(pc)});var zp={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Bp=function(t,e,n){if(t)return Bh(e[e.length-1].node.namespaceURI,zp[t.getType()])},Up=qh("Point"),Xp=qh("LineString"),Wp=qh("LinearRing"),Vp=qh("Polygon"),Kp=$h(Tc,{LineString:Hh(nf),Point:Hh(nf),Polygon:Hh(lf),GeometryCollection:Hh(Yp)});function Yp(t,e,n){var i,r={node:t},o=e.getType(),a=[];o===_t?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===ft?a=a.concat(t.getPoints()):e===dt?a=a.concat(t.getLineStrings()):e===gt?a=a.concat(t.getPolygons()):e===ut||e===ht||e===pt?a.push(t):nt(!1,39)})),i=Bp):o===ft?(a=e.getPoints(),i=Up):o===dt?(a=e.getLineStrings(),i=Xp):o===gt?(a=e.getPolygons(),i=Vp):nt(!1,39),nc(r,Kp,i,a,n)}var Zp=$h(Tc,{LinearRing:Hh(nf)});function Hp(t,e,n){nc({node:t},Zp,Wp,[e],n)}var qp=$h(Tc,{ExtendedData:Hh((function(t,e,n){for(var i={node:t},r=e.names,o=e.values,a=r.length,s=0;s<a;s++)nc(i,Pp,Op,[{name:r[s],value:o[s]}],n)})),MultiGeometry:Hh(Yp),LineString:Hh(nf),LinearRing:Hh(nf),Point:Hh(nf),Polygon:Hh(lf),Style:Hh((function(t,e,n){var i={node:t},r={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(r.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(r.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(r.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!r.LineStyle&&(r.LineStyle=s),r.PolyStyle=e.polyStyles[0]}var l=n[n.length-1].node,u=cf[l.namespaceURI],h=Qh(r,u);nc(i,pf,Jh,h,n,u)})),address:Hh(fc),description:Hh(fc),name:Hh(fc),open:Hh(cc),phoneNumber:Hh(fc),styleUrl:Hh(fc),visibility:Hh(cc)}),Jp=$h(Tc,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Qp=qh("ExtendedData");function $p(t,e,n){var i={node:t};e.getId()&&t.setAttribute("id",e.getId());var r=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var a=Object.keys(r||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var l=s(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var i=n.getType();return i===_t?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ut||e===ft})).length:i===ut||i===ft}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var i=n.getType();return i===_t?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ht||e===dt})).length:i===ht||i===dt}})),p=u.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var i=n.getType();return i===_t?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===gt})).length:i===pt||i===gt}}))),r.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===r.name){var f=h[0].getText();f&&(r.name=f.getText())}}}var d=n[n.length-1].node,g=Jp[d.namespaceURI],_=Qh(r,g);if(nc(i,qp,Jh,_,n,g),a.length>0){var y=Qh(r,a);nc(i,qp,Qp,[{names:a,values:y}],n)}var v=n[0],m=e.getGeometry();m&&(m=Oh(m,!0,v)),nc(i,qp,Bp,[m],n)}var tf=$h(Tc,["extrude","tessellate","altitudeMode","coordinates"]),ef=$h(Tc,{extrude:Hh(cc),tessellate:Hh(cc),altitudeMode:Hh(fc),coordinates:Hh((function(t,e,n){var i,r=n[n.length-1],o=r.layout,a=r.stride;o==ot||o==st?i=2:o==at||o==lt?i=3:nt(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u<i;++u)l+=","+e[u];for(var h=a;h<s;h+=a){l+=" "+e[h];for(u=1;u<i;++u)l+=","+e[h+u]}}fc(t,l)}))});function nf(t,e,n){var i=e.getFlatCoordinates(),r={node:t};r.layout=e.getLayout(),r.stride=e.getStride();var o=e.getProperties();o.coordinates=i;var a=n[n.length-1].node,s=tf[a.namespaceURI],l=Qh(o,s);nc(r,ef,Jh,l,n,s)}var rf=$h(Tc,["color","fill","outline"]),of=$h(Tc,{outerBoundaryIs:Hh(Hp),innerBoundaryIs:Hh(Hp)}),af=qh("innerBoundaryIs"),sf=qh("outerBoundaryIs");function lf(t,e,n){var i=e.getLinearRings(),r=i.shift(),o={node:t};nc(o,of,af,i,n),nc(o,of,sf,[r],n)}var uf=$h(Tc,{color:Hh(Tp),fill:Hh(cc),outline:Hh(cc)});function hf(t,e){pc(t,Math.round(1e6*e)/1e6)}var cf=$h(Tc,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),pf=$h(Tc,{IconStyle:Hh((function(t,e,n){var i={node:t},r={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(l.x=h[0],l.y=s[1]-(h[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var c={x:u[0],xunits:la,y:a[1]-u[1],yunits:la};r.hotSpot=c}}r.Icon=l;var p=e.getScale();1!==p&&(r.scale=p);var f=e.getRotation();0!==f&&(r.heading=f);var d=e.getColor();d&&(r.color=d);var g=n[n.length-1].node,_=Lp[g.namespaceURI],y=Qh(r,_);nc(i,kp,Jh,y,n,_)})),LabelStyle:Hh((function(t,e,n){var i={node:t},r={},o=e.getFill();o&&(r.color=o.getColor());var a=e.getScale();a&&1!==a&&(r.scale=a);var s=n[n.length-1].node,l=Dp[s.namespaceURI],u=Qh(r,l);nc(i,Gp,Jh,u,n,l)})),LineStyle:Hh((function(t,e,n){var i={node:t},r={color:e.getColor(),width:Number(e.getWidth())||1},o=n[n.length-1].node,a=jp[o.namespaceURI],s=Qh(r,a);nc(i,Np,Jh,s,n,a)})),PolyStyle:Hh((function(t,e,n){var i={node:t},r=e.getFill(),o=e.getStroke(),a={color:r?r.getColor():void 0,fill:!!r&&void 0,outline:!!o&&void 0},s=n[n.length-1].node,l=rf[s.namespaceURI],u=Qh(a,l);nc(i,uf,Jh,u,n,l)}))});var ff,df=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function gf(t,e){for(var n=df.length,i=0;i<n;++i)try{var r=t.getContext(df[i],e);if(r)return r}catch(t){}return null}var _f=35044,yf=function(){function t(t,e){this.array=null,this.type=t,nt(34962===t||34963===t,62),this.usage=void 0!==e?e:_f}return t.prototype.ofSize=function(t){this.array=new(vf(this.type))(t)},t.prototype.fromArray=function(t){this.array=vf(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(vf(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function vf(t){switch(t){case 34962:return Float32Array;case 34963:return Uint32Array;default:return Float32Array}}var mf="webglcontextlost",xf="webglcontextrestored",wf=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(n);var i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n"),e.compileShader(i),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,n),e.attachShader(this.renderTargetProgram_,i),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(n){this.uniforms_.push({value:t.uniforms[n],location:e.getUniformLocation(this.renderTargetProgram_,n)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;var i=e.RGBA,r=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,i,n[0],n[1],0,r,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e){var n=this.getGL(),i=t.size;n.bindFramebuffer(n.FRAMEBUFFER,e?e.getFrameBuffer():null),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this.renderTargetTexture_),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.viewport(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n.bindBuffer(n.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),n.useProgram(this.renderTargetProgram_),n.enableVertexAttribArray(this.renderTargetAttribLocation_),n.vertexAttribPointer(this.renderTargetAttribLocation_,2,n.FLOAT,!1,0,0),n.uniform2f(this.renderTargetUniformLocation_,i[0],i[1]),n.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),n.drawArrays(n.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,n=this.getGL(),i=1;this.uniforms_.forEach((function(r){if((e="function"==typeof r.value?r.value(t):r.value)instanceof HTMLCanvasElement||e instanceof ImageData)r.texture||(r.texture=n.createTexture()),n.activeTexture(n["TEXTURE"+i]),n.bindTexture(n.TEXTURE_2D,r.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),e instanceof ImageData?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,e.width,e.height,0,n.UNSIGNED_BYTE,new Uint8Array(e.data)):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),n.uniform1i(r.location,i++);else if(Array.isArray(e))switch(e.length){case 2:return void n.uniform2f(r.location,e[0],e[1]);case 3:return void n.uniform3f(r.location,e[0],e[1],e[2]);case 4:return void n.uniform4f(r.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(r.location,e)}))},t}();function Sf(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var Cf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bf="u_projectionMatrix",Ef="u_offsetScaleMatrix",Tf="u_offsetRotateMatrix",Pf="u_time",Rf="u_zoom",Ff="u_resolution",Of={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},If=function(t){function e(e){var n=t.call(this)||this,i=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvas_=document.createElement("canvas"),n.canvas_.style.position="absolute",n.canvas_.style.left="0",n.gl_=gf(n.canvas_);var r=n.getGL();if(n.bufferCache_={},n.currentProgram_=null,nt(c(function(){if(!ff){var t=gf(document.createElement("canvas"));t&&(ff=t.getSupportedExtensions())}return ff}(),"OES_element_index_uint"),63),r.getExtension("OES_element_index_uint"),n.canvas_.addEventListener(mf,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(xf,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=[1,0,0,1,0,0],n.offsetScaleMatrix_=[1,0,0,1,0,0],n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],i.uniforms)for(var o in i.uniforms)n.uniforms_.push({name:o,value:i.uniforms[o]});return n.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new wf({webGlContext:r,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new wf({webGlContext:r})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return Cf(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),n=i(t),r=this.bufferCache_[n];r||(r={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[n]=r);e.bindBuffer(t.getType(),r.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),n=i(t),r=this.bufferCache_[n];e.isContextLost()||e.deleteBuffer(r.buffer),delete this.bufferCache_[n]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(mf,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(xf,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),n=this.getCanvas(),i=t.size,r=t.pixelRatio;n.width=i[0]*r,n.height=i[1]*r,n.style.width=i[0]+"px",n.style.height=i[1]+"px",e.useProgram(this.currentProgram_);for(var o=this.postProcessPasses_.length-1;o>=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,n){var i=this.getGL(),r=e.getSize();i.bindFramebuffer(i.FRAMEBUFFER,e.getFramebuffer()),i.viewport(0,0,r[0],r[1]),i.bindTexture(i.TEXTURE_2D,e.getTexture()),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,n?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var n=this.getGL(),i=n.UNSIGNED_INT,r=e-t,o=4*t;n.drawElements(n.TRIANGLES,r,i,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,n=t.viewState.rotation,i=Et(this.offsetScaleMatrix_);!function(t,e,n){Tt(t,Pt(bt,e,0,0,n,0,0))}(i,2/e[0],2/e[1]);var r=Et(this.offsetRotateMatrix_);0!==n&&function(t,e){var n=Math.cos(e),i=Math.sin(e);Tt(t,Pt(bt,n,i,-i,n,0,0))}(r,-n),this.setUniformMatrixValue(Ef,Sf(this.tmpMat4_,i)),this.setUniformMatrixValue(Tf,Sf(this.tmpMat4_,r)),this.setUniformFloatValue(Pf,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Rf,t.viewState.zoom),this.setUniformFloatValue(Ff,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,n=this.getGL(),i=0;this.uniforms_.forEach(function(r){if((e="function"==typeof r.value?r.value(t):r.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)r.texture||(r.prevValue=void 0,r.texture=n.createTexture()),n.activeTexture(n["TEXTURE"+i]),n.bindTexture(n.TEXTURE_2D,r.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&r.prevValue!==e&&(r.prevValue=e,n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e)),n.uniform1i(this.getUniformLocation(r.name),i++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(r.name,Sf(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void n.uniform2f(this.getUniformLocation(r.name),e[0],e[1]);case 3:return void n.uniform3f(this.getUniformLocation(r.name),e[0],e[1],e[2]);case 4:return void n.uniform4f(this.getUniformLocation(r.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(this.getUniformLocation(r.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var n=this.getGL(),i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i},e.prototype.getProgram=function(t,e){var n=this.getGL(),i=this.compileShader(t,n.FRAGMENT_SHADER),r=this.compileShader(e,n.VERTEX_SHADER);this.shaderCompileErrors_=null,n.getShaderInfoLog(i)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+n.getShaderInfoLog(i)),n.getShaderInfoLog(r)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+n.getShaderInfoLog(r));var o=n.createProgram();return n.attachShader(o,i),n.attachShader(o,r),n.linkProgram(o),o},e.prototype.getShaderCompileErrors=function(){return this.shaderCompileErrors_},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var n=t.size,i=t.viewState.rotation,r=t.viewState.resolution,o=t.viewState.center;return Et(e),Ft(e,0,0,2/(r*n[0]),2/(r*n[1]),-i,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,n,i,r){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,n,!1,i,r))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,n=0;n<t.length;n++){var i=t[n];e+=i.size*Af(i.type)}return e}(t),n=0,i=0;i<t.length;i++){var r=t[i];this.enableAttributeArray_(r.name,r.size,r.type||5126,e,n),n+=r.size*Af(r.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,n){var i=this.getGL(),r=n||i.createTexture(),o=i.RGBA,a=i.RGBA,s=i.UNSIGNED_BYTE;return i.bindTexture(i.TEXTURE_2D,r),e?i.texImage2D(i.TEXTURE_2D,0,o,a,s,e):i.texImage2D(i.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),r},e}(u);function Af(t){switch(t){case Of.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Of.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Of.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Of.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var Mf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Lf="GENERATE_BUFFERS",kf=function(t){function e(e,n){var i=t.call(this,e)||this,r=n||{};return i.helper=new If({postProcesses:r.postProcesses,uniforms:r.uniforms}),i}return Mf(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e}(Ao);var Df=new Uint8Array(4),Gf=function(){function t(t,e){this.helper_=t;var n=t.getGL();this.texture_=n.createTexture(),this.framebuffer_=n.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){g(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Df[0]=0,Df[1]=0,Df[2]=0,Df[3]=0,Df;this.readAll();var n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Df[0]=this.data_[4*n],Df[1]=this.data_[4*n+1],Df[2]=this.data_[4*n+2],Df[3]=this.data_[4*n+3],Df},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),jf=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),Nf=URL.createObjectURL(jf);var zf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bf=function(t){function e(e,n){var r=this,o=n.uniforms||{},a=[1,0,0,1,0,0];o[bf]=a,(r=t.call(this,e,{uniforms:o,postProcesses:n.postProcesses})||this).sourceRevision_=-1,r.verticesBuffer_=new yf(34962,35048),r.hitVerticesBuffer_=new yf(34962,35048),r.indicesBuffer_=new yf(34963,35048),r.program_=r.helper.getProgram(n.fragmentShader,n.vertexShader),r.hitDetectionEnabled_=!(!n.hitFragmentShader||!n.hitVertexShader),r.hitProgram_=r.hitDetectionEnabled_&&r.helper.getProgram(n.hitFragmentShader,n.hitVertexShader);var s=n.attributes?n.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Of.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:Of.FLOAT},{name:"a_index",size:1,type:Of.FLOAT}].concat(s),r.hitDetectionAttributes=[{name:"a_position",size:2,type:Of.FLOAT},{name:"a_index",size:1,type:Of.FLOAT},{name:"a_hitColor",size:4,type:Of.FLOAT},{name:"a_featureUid",size:1,type:Of.FLOAT}].concat(s),r.customAttributes=n.attributes?n.attributes:[],r.previousExtent_=[1/0,1/0,-1/0,-1/0],r.currentTransform_=a,r.renderTransform_=[1,0,0,1,0,0],r.invertRenderTransform_=[1,0,0,1,0,0],r.renderInstructions_=new Float32Array(0),r.hitRenderInstructions_=new Float32Array(0),r.hitRenderTarget_=r.hitDetectionEnabled_&&new Gf(r.helper),r.worker_=new Worker(Nf),r.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===Lf){var n=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=n,Ot(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(r)),r.featureCache_={},r.featureCount_=0;var l=r.getLayer().getSource();return r.sourceListenKeys_=[N(l,Da,r.handleSourceFeatureAdded_,r),N(l,Ga,r.handleSourceFeatureChanged_,r),N(l,Na,r.handleSourceFeatureDelete_,r),N(l,ja,r.handleSourceFeatureClear_,r)],l.forEachFeature(function(t){this.featureCache_[i(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(r)),r}return zf(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[i(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[i(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[i(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var n=this.helper.getCanvas(),i=t.layerStatesArray[t.layerIndex].opacity;return i!==parseFloat(n.style.opacity)&&(n.style.opacity=String(i)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),n},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource(),i=t.viewState,r=!t.viewHints[ia]&&!t.viewHints[ra],o=!ne(this.previousExtent_,t.extent),a=this.sourceRevision_<n.getRevision();if(a&&(this.sourceRevision_=n.getRevision()),r&&(o||a)){var s=i.projection,l=i.resolution,u=e instanceof Qr?e.getRenderBuffer():0,h=Xt(t.extent,u*l);n.loadFeatures(h,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),Tt(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var n,i,r=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===r||(this.renderInstructions_=new Float32Array(r)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s,l,u=[],h=[],c=0,p=0;for(var f in this.featureCache_)if((i=(n=this.featureCache_[f]).geometry)&&i.getType()===ut){u[0]=i.getFlatCoordinates()[0],u[1]=i.getFlatCoordinates()[1],Rt(e,u),s=p+6,l=void 0,(l=h||[])[0]=Math.floor(s/256/256/256)/255,l[1]=Math.floor(s/256/256)%256/255,l[2]=Math.floor(s/256)%256/255,l[3]=s%256/255,a=l,this.renderInstructions_[c++]=u[0],this.renderInstructions_[c++]=u[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=u[0],this.hitRenderInstructions_[p++]=u[1],this.hitRenderInstructions_[p++]=a[0],this.hitRenderInstructions_[p++]=a[1],this.hitRenderInstructions_[p++]=a[2],this.hitRenderInstructions_[p++]=a[3],this.hitRenderInstructions_[p++]=Number(f));for(var d=void 0,g=0;g<this.customAttributes.length;g++)d=this.customAttributes[g].callback(n.feature,n.properties),this.renderInstructions_[c++]=d,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=d)}var _={type:Lf,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(_.projectionTransform=e,this.worker_.postMessage(_,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var y={type:Lf,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};y.projectionTransform=e,y.hitDetection=!0,this.worker_.postMessage(y,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r){if(nt(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=Rt(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0;return e+=Math.round(256*t[0]*256*256*255),e+=Math.round(256*t[1]*256*255),e+=Math.round(256*t[2]*255),e+=Math.round(255*t[3])}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?i(h,this.getLayer()):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){B(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(kf),Uf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xf="blur",Wf="gradient",Vf="radius",Kf=["#00f","#0ff","#0f0","#ff0","#f00"],Yf=function(t){function e(e){var n=this,i=e||{},r=m({},i);delete r.gradient,delete r.radius,delete r.blur,delete r.weight,(n=t.call(this,r)||this).gradient_=null,n.addEventListener(H(Wf),n.handleGradientChanged_),n.setGradient(i.gradient?i.gradient:Kf),n.setBlur(void 0!==i.blur?i.blur:15),n.setRadius(void 0!==i.radius?i.radius:8);var o=i.weight?i.weight:"weight";return n.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,n.setRenderOrder(null),n}return Uf(e,t),e.prototype.getBlur=function(){return this.get(Xf)},e.prototype.getGradient=function(){return this.get(Wf)},e.prototype.getRadius=function(){return this.get(Vf)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=Qi(1,256),n=e.createLinearGradient(0,0,1,256),i=1/(t.length-1),r=0,o=t.length;r<o;++r)n.addColorStop(r*i,t[r]);return e.fillStyle=n,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Xf,t)},e.prototype.setGradient=function(t){this.set(Wf,t)},e.prototype.setRadius=function(t){this.set(Vf,t)},e.prototype.createRenderer=function(){return new Bf(this,{attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Ce(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Vf)+this.get(Xf))}.bind(this),u_blurSlope:function(){return this.get(Vf)/Math.max(1,this.get(Xf))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this)}}]})},e}(Ia);var Zf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Hf=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new Th(0,0,0,0),n}return Zf(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==Ja||n==$a||n==Qa&&!i},e.prototype.getTile=function(t,e,n,i){var r=i.pixelRatio,o=i.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,n,r,o);return s.getState()==Qa&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(Ja)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,n,i){return!!this.isDrawableTile(i)&&t.prototype.loadedTileCallback.call(this,e,n,i)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],r=t.viewState,o=r.projection,a=r.resolution,s=r.center,l=r.rotation,u=t.pixelRatio,c=this.getLayer(),p=c.getSource(),f=p.getRevision(),d=p.getTileGridForProjection(o),g=d.getZForResolution(a,p.zDirection),_=d.getResolution(g),y=t.extent,v=n.extent&&Cn(n.extent);v&&(y=ge(y,Cn(n.extent)));var x=p.getTilePixelRatio(u),w=Math.round(t.size[0]*x),S=Math.round(t.size[1]*x);if(l){var C=Math.round(Math.sqrt(w*w+S*S));w=C,S=C}var b=_*w/2/x,E=_*S/2/x,T=[s[0]-b,s[1]-E,s[0]+b,s[1]+E],P=d.getTileRangeForExtentAndZ(y,g),R={};R[g]={};var F=this.createLoadedTileFinder(p,o,R),O=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var A=P.minX;A<=P.maxX;++A)for(var M=P.minY;M<=P.maxY;++M){var L=this.getTile(g,A,M,t);if(this.isDrawableTile(L)){var k=i(this);if(L.getState()==Ja){R[g][L.tileCoord.toString()]=L;var D=L.inTransition(k);this.newTiles_||!D&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0)}if(1===L.getAlpha(k,t.time))continue}var G=d.getTileCoordChildTileRange(L.tileCoord,I,O),j=!1;G&&(j=F(g+1,G)),j||d.forEachTileCoordParentTileRange(L.tileCoord,F,I,O)}var N=_/a;Ft(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-w/2,-S/2);var z=function(t){return Hi?It(t):(mr||(mr=Qi(1,1).canvas),mr.style.transform=It(t),mr.style.transform)}(this.pixelTransform);this.useContainer(e,z,n.opacity);var B=this.context,U=B.canvas;Ot(this.inversePixelTransform,this.pixelTransform),Ft(this.tempTransform,w/2,S/2,N,N,0,-w/2,-S/2),U.width!=w||U.height!=S?(U.width=w,U.height=S):this.containerReused||B.clearRect(0,0,w,S),v&&this.clipUnrotated(B,t,v),m(B,p.getContextOptions()),this.preRender(B,t),this.renderedTiles.length=0;var X,W,V,K=Object.keys(R).map(Number);K.sort(h),1!==n.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(X=[],W=[]):K=K.reverse();for(var Y=K.length-1;Y>=0;--Y){var Z=K[Y],H=p.getTilePixelSize(Z,u,o),q=d.getResolution(Z)/_,J=H[0]*q*N,Q=H[1]*q*N,$=d.getTileCoordForCoordAndZ(_e(T),Z),tt=d.getTileCoordExtent($),et=Rt(this.tempTransform,[x*(tt[0]-T[0])/_,x*(T[3]-tt[3])/_]),nt=x*p.getGutterForProjection(o),it=R[Z];for(var rt in it){var ot=(L=it[rt]).tileCoord,at=et[0]-($[1]-ot[1])*J,st=Math.round(at+J),lt=et[1]-($[2]-ot[2])*Q,ut=Math.round(lt+Q),ht=st-(A=Math.round(at)),ct=ut-(M=Math.round(lt)),pt=g===Z;if(!(D=pt&&1!==L.getAlpha(i(this),t.time)))if(X){B.save(),V=[A,M,A+ht,M,A+ht,M+ct,A,M+ct];for(var ft=0,dt=X.length;ft<dt;++ft)if(g!==Z&&Z<W[ft]){var gt=X[ft];B.beginPath(),B.moveTo(V[0],V[1]),B.lineTo(V[2],V[3]),B.lineTo(V[4],V[5]),B.lineTo(V[6],V[7]),B.moveTo(gt[6],gt[7]),B.lineTo(gt[4],gt[5]),B.lineTo(gt[2],gt[3]),B.lineTo(gt[0],gt[1]),B.clip()}X.push(V),W.push(Z)}else B.clearRect(A,M,ht,ct);this.drawTileImage(L,t,A,M,ht,ct,nt,pt,n.opacity),X&&!D&&B.restore(),this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,p,L)}}return this.renderedRevision=f,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!ne(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=u,this.renderedProjection=o,this.manageTilePyramid(t,p,d,u,o,y,g,c.getPreload()),this.scheduleExpireCache(t,p),this.postRender(B,t),n.extent&&B.restore(),z!==U.style.transform&&(U.style.transform=z),this.container},e.prototype.drawTileImage=function(t,e,n,r,o,a,s,l,u){var h=this.getTileImage(t);if(h){var c=i(this),p=l?t.getAlpha(c,e.time):1,f=u*p,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(h,s,s,h.width-2*s,h.height-2*s,n,r,o,a),d&&this.context.restore(),1!==p?e.animate=!0:l&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var r=i(t);r in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var r=i(e);r in t||(t[r]={}),t[r][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,r,o,a,s,l,u){var h=i(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,_,y=t.wantedTiles[h],v=t.tileQueue,m=0;for(_=n.getMinZoom();_<=s;++_)for(p=n.getTileRangeForExtentAndZ(a,_,p),f=n.getResolution(_),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)s-_<=l?(++m,(c=e.getTile(_,d,g,r,o)).getState()==Ha&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,n.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(_,d,g,o);e.updateCacheSize(m,o)},e}(Do);Hf.prototype.getLayer;var qf="preload",Jf="useInterimTilesOnError",Qf="tileloadstart",$f="tileloadend",td="tileloaderror",ed=[0,0,0],nd=function(){function t(t){var e,n,i,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,nt((e=this.resolutions_,n=!0,i=function(t,e){return e-t}||h,e.every((function(t,r){if(0===r)return!0;var o=i(e[r-1],t);return!(o>0||n&&0===o)}))),17),!t.origins)for(var o=0,a=this.resolutions_.length-1;o<a;++o)if(r){if(this.resolutions_[o]/this.resolutions_[o+1]!==r){r=void 0;break}}else r=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=r,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,nt(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=_e(s)),nt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,nt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,nt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){return new Th(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,n){for(var i=this.getTileRangeForExtentAndZ(t,e),r=i.minX,o=i.maxX;r<=o;++r)for(var a=i.minY,s=i.maxY;a<=s;++a)n([e,r,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,i){var r,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):a=this.getTileCoordExtent(t,i);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?Ph(r=Math.floor(r/2),r,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(a,s,n)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var i=2*t[1],r=2*t[2];return Ph(i,i+1,r,r+1,e)}var o=this.getTileCoordExtent(t,n);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeExtent=function(t,e,n){var i=this.getOrigin(t),r=this.getResolution(t),o=Li(this.getTileSize(t),this.tmpSize_),a=i[0]+e.minX*o[0]*r,s=i[0]+(e.maxX+1)*o[0]*r;return Jt(a,i[1]+e.minY*o[1]*r,s,i[1]+(e.maxY+1)*o[1]*r,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var i=ed;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,i);var r=i[1],o=i[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,i),Ph(r,i[1],o,i[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=Li(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=Li(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*r[0]*i,a=n[1]-(t[2]+1)*r[1]*i;return Jt(o,a,o+r[0]*i,a+r[1]*i,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,i,r){var o=this.getZForResolution(n),a=n/this.getResolution(o),s=this.getOrigin(o),l=Li(this.getTileSize(o),this.tmpSize_),u=i?.5:0,h=i?.5:0,c=Math.floor((t-s[0])/n+u),p=Math.floor((s[1]-e)/n+h),f=a*c/l[0],d=a*p/l[1];return i?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),xh(o,f,d,r)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,i,r){var o=this.getOrigin(n),a=this.getResolution(n),s=Li(this.getTileSize(n),this.tmpSize_),l=i?.5:0,u=i?.5:0,h=Math.floor((t-o[0])/a+l),c=Math.floor((o[1]-e)/a+u),p=h/s[0],f=c/s[1];return i?(p=Math.ceil(p)-1,f=Math.ceil(f)-1):(p=Math.floor(p),f=Math.floor(f)),xh(n,p,f,r)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},t.prototype.getZForResolution=function(t,e){return Ce(p(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),i=this.minZoom;i<e;++i)n[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=n},t}();function id(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,i){return function(t,e,n,i){var r=void 0!==i?i:Lt,o=od(t,e,n);return new nd({extent:t,origin:pe(t,r),resolutions:o,tileSize:n})}(ad(t),e,n,i)}(t),t.setDefaultTileGrid(e)),e}function rd(t){var e=t||{},n=e.extent||un("EPSG:3857").getExtent(),i={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:od(n,e.maxZoom,e.tileSize,e.maxResolution)};return new nd(i)}function od(t,e,n,i){for(var r=void 0!==e?e:42,o=de(t),a=ve(t),s=Li(void 0!==n?n:256),l=i>0?i:Math.max(a/s[0],o/s[1]),u=r+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function ad(t){var e=(t=un(t)).getExtent();if(!e){var n=180*Ct[vt]/t.getMetersPerUnit();e=Jt(-n,-n,n,n)}return e}var sd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ld=function(t){function n(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var i=e.tileGrid;return i&&Li(i.getTileSize(i.getMinZoom()),[256,256]),n.tileCache=new Eh(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return sd(n,t),n.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},n.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},n.prototype.forEachLoadedTile=function(t,e,n,i){var r=this.getTileCacheForProjection(t);if(!r)return!1;for(var o,a,s,l=!0,u=n.minX;u<=n.maxX;++u)for(var h=n.minY;h<=n.maxY;++h)a=wh(e,u,h),s=!1,r.containsKey(a)&&(s=(o=r.get(a)).getState()===Ja)&&(s=!1!==i(o)),s||(l=!1);return l},n.prototype.getGutterForProjection=function(t){return 0},n.prototype.getKey=function(){return this.key_},n.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},n.prototype.getOpaque=function(t){return this.opaque_},n.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},n.prototype.getTile=function(t,n,i,r,o){return e()},n.prototype.getTileGrid=function(){return this.tileGrid},n.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:id(t)},n.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!fn(e,t)?null:this.tileCache},n.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},n.prototype.getTilePixelSize=function(t,e,n){var i=this.getTileGridForProjection(n),r=this.getTilePixelRatio(e),o=Li(i.getTileSize(t),this.tmpSize);return 1==r?o:Mi(o,r,this.tmpSize)},n.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),i=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var i=e[0],r=t.getTileCoordCenter(e),o=ad(n);if(Kt(o,r))return e;var a=ve(o),s=Math.ceil((o[0]-r[0])/a);return r[0]+=a*s,t.getTileCoordForCoordAndZ(r,i)}(i,t,n)),function(t,e){var n=t[0],i=t[1],r=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o,a=e.getExtent();return!(o=a?e.getTileRangeForExtentAndZ(a,n):e.getFullTileRange(n))||o.containsXY(i,r)}(t,i)?t:null},n.prototype.clear=function(){this.tileCache.clear()},n.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},n.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},n.prototype.useTile=function(t,e,n,i){},n}(La),ud=function(t){function e(e,n){var i=t.call(this,e)||this;return i.tile=n,i}return sd(e,t),e}(s);function hd(t,e){var n=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){return a?t.replace(n,a[0].toString()).replace(i,a[1].toString()).replace(r,a[2].toString()).replace(o,(function(){var t=a[0],n=e.getFullTileRange(t);return nt(n,55),(n.getHeight()-a[2]-1).toString()})):void 0}}function cd(t){return 1===t.length?t[0]:function(e,n,i){if(e){var r=Oe(Ch(e),t.length);return t[r](e,n,i)}}}var pd,fd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),dd=function(t){function e(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return i.generateTileUrlFunction_=i.tileUrlFunction===e.prototype.tileUrlFunction,i.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(i.tileUrlFunction=n.tileUrlFunction.bind(i)),i.urls=null,n.urls?i.setUrls(n.urls):n.url&&i.setUrl(n.url),i.tileLoadingKeys_={},i}return fd(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,n=t.target,r=i(n),o=n.getState();o==qa?(this.tileLoadingKeys_[r]=!0,e=Qf):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=o==Qa?td:o==Ja?$f:void 0),null!=e&&this.dispatchEvent(new ud(e,n))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var i=n[1].charCodeAt(0),r=n[2].charCodeAt(0),o=void 0;for(o=i;o<=r;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(n[2],10),s=parseInt(n[1],10);s<=a;s++)e.push(t.replace(n[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=hd(t[r],e);return cd(i)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var i=wh(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(ld),gd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_d=function(t){function e(e){var n=this,i=e||{},r=m({},i);return delete r.preload,delete r.useInterimTilesOnError,(n=t.call(this,r)||this).setPreload(void 0!==i.preload?i.preload:0),n.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),n}return gd(e,t),e.prototype.getPreload=function(){return this.get(qf)},e.prototype.setPreload=function(t){this.set(qf,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Jf)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Jf,t)},e}(Zr),yd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vd=function(t){function e(e){return t.call(this,e)||this}return yd(e,t),e.prototype.createRenderer=function(){return new Hf(this)},e}(_d),md=function(){function t(t,e,n,i,r,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=gn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=i,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&ve(i)==ve(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ve(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ve(this.targetProj_.getExtent()):null;var l=_e(n),u=ye(n),h=he(n),c=ue(n),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(Ee(le(n)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,f,d,g,_),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,n){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,n,i,r,o){this.triangles_.push({source:[i,r,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,i,r,o,a,s,l){var u=Ut([r,o,a,s]),h=this.sourceWorldWidth_?ve(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=ve(Ut([t,e,n,i]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||me(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(g),y=void 0;if(p)y=(Oe(r[0],c)+Oe(a[0],c))/2-Oe(_[0],c);else y=(r[0]+a[0])/2-_[0];var v=(r[1]+a[1])/2-_[1];f=y*y+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),w=[(i[0]+t[0])/2,(i[1]+t[1])/2],S=this.transformInv_(w);this.addQuad_(t,e,m,w,r,o,x,S,l-1),this.addQuad_(w,m,n,i,S,x,a,s,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],b=this.transformInv_(C),E=[(n[0]+i[0])/2,(n[1]+i[1])/2],T=this.transformInv_(E);this.addQuad_(t,C,E,i,r,b,T,s,l-1),this.addQuad_(C,e,n,E,b,o,a,T,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,n,i,r,a,s),0==(14&d)&&this.addTriangle_(t,n,e,r,a,o),d&&(0==(13&d)&&this.addTriangle_(e,i,t,o,s,r),0==(7&d)&&this.addTriangle_(e,i,n,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,n,i){var r=e.source;re(t,r[0]),re(t,r[1]),re(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),xd={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function wd(t,e,n,i,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,r)),t.restore()}function Sd(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Cd(t,e,n,i){var r=_n(n,e,t),o=hn(e,i,n),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var l=t.getExtent();if(!l||Kt(l,r)){var u=hn(t,o,r)/o;isFinite(u)&&u>0&&(o/=u)}return o}function bd(t,e,n,i,r,o,a,s,l,u,h,c){var p=Qi(Math.round(n*t),Math.round(n*e));if(m(p,c),0===l.length)return p.canvas;function f(t){return Math.round(t*n)/n}p.scale(n,n),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,n){ie(d,t.extent)}));var g=ve(d),_=de(d),y=Qi(Math.round(n*g/i),Math.round(n*_/i));m(y,c);var v=n/i;l.forEach((function(t,e,n){var i=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=ve(t.extent),a=de(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*v,r*v,o*v,a*v)}));var x=_e(a);return s.getTriangles().forEach((function(t,e,r){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],h=a[1][0],g=a[1][1],_=a[2][0],v=a[2][1],m=f((s[0][0]-x[0])/o),w=f(-(s[0][1]-x[1])/o),S=f((s[1][0]-x[0])/o),C=f(-(s[1][1]-x[1])/o),b=f((s[2][0]-x[0])/o),E=f(-(s[2][1]-x[1])/o),T=l,P=u;l=0,u=0;var R=function(t){for(var e=t.length,n=0;n<e;n++){for(var i=n,r=Math.abs(t[n][n]),o=n+1;o<e;o++){var a=Math.abs(t[o][n]);a>r&&(r=a,i=o)}if(0===r)return null;var s=t[i];t[i]=t[n],t[n]=s;for(var l=n+1;l<e;l++)for(var u=-t[l][n]/t[n][n],h=n;h<e+1;h++)n==h?t[l][h]=0:t[l][h]+=u*t[n][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,g-=P,0,0,S-m],[_-=T,v-=P,0,0,b-m],[0,0,h,g,C-w],[0,0,_,v,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===pd){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",wd(t,4,5,4,0),wd(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;pd=Sd(e,0)||Sd(e,4)||Sd(e,8)}return pd}()||c===xd){p.moveTo(S,C);for(var F=m-S,O=w-C,I=0;I<4;I++)p.lineTo(S+f((I+1)*F/4),C+f(I*O/3)),3!=I&&p.lineTo(S+f((I+1)*F/4),C+f((I+1)*O/3));p.lineTo(b,E)}else p.moveTo(S,C),p.lineTo(m,w),p.lineTo(b,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],m,w),p.translate(d[0]-T,d[3]-P),p.scale(i/n,-i/n),p.drawImage(y.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,n){var i=t.target,r=(i[0][0]-x[0])/o,a=-(i[0][1]-x[1])/o,s=(i[1][0]-x[0])/o,l=-(i[1][1]-x[1])/o,u=(i[2][0]-x[0])/o,h=-(i[2][1]-x[1])/o;p.beginPath(),p.moveTo(s,l),p.lineTo(r,a),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var Ed=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Td=function(t){function e(e,n,i,r,o,a,s,l,u,h,c,p){var f=t.call(this,o,Ha)||this;f.renderEdges_=void 0!==c&&c,f.contextOptions_=p,f.pixelRatio_=s,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=n,f.targetTileGrid_=r,f.wrappedTileCoord_=a||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=r.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),_=f.sourceTileGrid_.getExtent(),y=g?ge(d,g):d;if(0===le(y))return f.state=$a,f;var v=e.getExtent();v&&(_=_?ge(_,v):v);var m=r.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,n,i){var r=ce(n),o=Cd(t,e,r,i);return(!isFinite(o)||o<=0)&&se(n,(function(n){return o=Cd(t,e,n,i),isFinite(o)&&o>0})),o}(e,i,y,m);if(!isFinite(x)||x<=0)return f.state=$a,f;var w=void 0!==h?h:.5;if(f.triangulation_=new md(e,i,y,_,x*w,m),0===f.triangulation_.getTriangles().length)return f.state=$a,f;f.sourceZ_=n.getZForResolution(x);var S=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(S[1]=Ce(S[1],_[1],_[3]),S[3]=Ce(S[3],_[1],_[3])):S=ge(S,_)),le(S)){for(var C=n.getTileRangeForExtentAndZ(S,f.sourceZ_),b=C.minX;b<=C.maxX;b++)for(var E=C.minY;E<=C.maxY;E++){var T=u(f.sourceZ_,b,E,s);T&&f.sourceTiles_.push(T)}0===f.sourceTiles_.length&&(f.state=$a)}else f.state=$a;return f}return Ed(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,i){e&&e.getState()==Ja&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Qa;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i="number"==typeof n?n:n[0],r="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=bd(i,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=Ja}this.changed()},e.prototype.load=function(){if(this.state==Ha){this.state=qa,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,i){var r=e.getState();if(r==Ha||r==qa){t++;var o=N(e,E,(function(n){var i=e.getState();i!=Ja&&i!=Qa&&i!=$a||(B(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,n){t.getState()==Ha&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(B),this.sourcesListenerKeys_=null},e}(os),Pd=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rd=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Fd,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return n.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:ss,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.contextOptions_=!1===e.imageSmoothing?xd:void 0,n.renderReprojectionEdges_=!1,n}return Pd(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);for(var i in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[i];r.expireCache(r==n?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!fn(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!fn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!fn(e,t)){var n=i(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=id(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||fn(e,t))return this.tileCache;var n=i(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new Eh(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,i,r,o){var a=[t,e,n],s=this.getTileCoordForTileUrlFunction(a,r),l=s?this.tileUrlFunction(s,i,r):void 0,u=new this.tileClass(a,void 0!==l?Ha:$a,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(E,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,n,i,r){var o=this.getProjection();if(o&&r&&!fn(o,r)){var a=this.getTileCacheForProjection(r),s=[t,e,n],l=void 0,u=Sh(s);a.containsKey(u)&&(l=a.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(s,r),d=new Td(o,c,r,p,s,f,this.getTilePixelRatio(i),this.getGutter(),function(t,e,n,i){return this.getTileInternal(t,e,n,i,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return d.key=h,l?(d.interimTile=l,d.refreshInterimChain(),a.replace(u,d)):a.set(u,d),d}return this.getTileInternal(t,e,n,i,o||r)},e.prototype.getTileInternal=function(t,e,n,i,r){var o=null,a=wh(t,e,n),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var l=o;o=this.createTile_(t,e,n,i,r,s),l.getState()==Ha?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,n,i,r,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var n=un(t);if(n){var r=i(n);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(dd);function Fd(t,e){t.getImage().src=e}var Od=1,Id=2,Ad=4,Md=8,Ld=16,kd=31,Dd={};function Gd(t){if("number"==typeof t)return Od;if("boolean"==typeof t)return Md;if("string"==typeof t)return e=t,Gi.test(e)&&(e=ji(e)),Di.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?Ad|Id:Id;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?Ad|Ld:Ld;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(n));var i=Dd[n[0]];if(void 0===i)throw new Error("Unrecognized expression operator: "+JSON.stringify(n));return i.getReturnType(n.slice(1))}function jd(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Nd(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(jd).join(", ")+")"}function zd(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Bd(t,e,n){if(Array.isArray(e)&&"string"==typeof e[0]){var i=Dd[e[0]];if(void 0===i)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return i.toGlsl(t,e.slice(1),n)}return(Gd(e)&Od)>0?jd(e):(Gd(e)&Md)>0?e.toString():(Gd(e)&Id)>0&&(void 0===n||n==Id)?function(t,e){return jd(zd(t,e))}(t,e.toString()):(Gd(e)&Ad)>0&&(void 0===n||n==Ad)?((r=zi(e).slice()).length<4&&r.push(1),Nd(r.map((function(t,e){return e<3?t/255:t})))):(Gd(e)&Ld)>0?Nd(e):void 0;var r}function Ud(t){if(!(Gd(t)&Od))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function Xd(t){for(var e=0;e<t.length;e++)Ud(t[e])}function Wd(t){if(!(Gd(t)&Id))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function Vd(t){if(!(Gd(t)&Md))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function Kd(t,e){if(t.length!==e)throw new Error("Exactly "+e+" arguments were expected, got "+t.length+" instead")}function Yd(t,e){if(t.length<e)throw new Error("At least "+e+" arguments were expected, got "+t.length+" instead")}function Zd(t,e){if(t.length>e)throw new Error("At most "+e+" arguments were expected, got "+t.length+" instead")}function Hd(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function qd(t,e){if(n=e,Math.log2(n)%1!=0)throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t));var n}function Jd(t){return{getReturnType:function(t){return Md},toGlsl:function(e,n){Kd(n,2);for(var i=kd,r=0;r<n.length;r++)i&=Gd(n[r]);if(0===i)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(n)+" instead");return"("+Bd(e,n[0],i)+" "+t+" "+Bd(e,n[1],i)+")"}}}function Qd(t){return{getReturnType:function(t){return Md},toGlsl:function(e,n){Yd(n,2);for(var i=0;i<n.length;i++)Vd(n[i]);return"("+n.map((function(t){return Bd(e,t)})).join(" "+t+" ")+")"}}}Dd.get={getReturnType:function(t){return kd},toGlsl:function(t,e){Kd(e,1),Wd(e[0]);var n=e[0].toString();return-1===t.attributes.indexOf(n)&&t.attributes.push(n),(t.inFragmentShader?"v_":"a_")+n}},Dd.var={getReturnType:function(t){return kd},toGlsl:function(t,e){Kd(e,1),Wd(e[0]);var n=e[0].toString();return-1===t.variables.indexOf(n)&&t.variables.push(n),"u_"+n}},Dd.time={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,0),"u_time"}},Dd.zoom={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,0),"u_zoom"}},Dd.resolution={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,0),"u_resolution"}},Dd["*"]={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" * "+Bd(t,e[1])+")"}},Dd["/"]={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" / "+Bd(t,e[1])+")"}},Dd["+"]={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" + "+Bd(t,e[1])+")"}},Dd["-"]={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" - "+Bd(t,e[1])+")"}},Dd.clamp={getReturnType:function(t){return Od},toGlsl:function(t,e){Kd(e,3),Xd(e);var n=Bd(t,e[1]),i=Bd(t,e[2]);return"clamp("+Bd(t,e[0])+", "+n+", "+i+")"}},Dd["%"]={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,2),Xd(e),"mod("+Bd(t,e[0])+", "+Bd(t,e[1])+")"}},Dd["^"]={getReturnType:function(t){return Od},toGlsl:function(t,e){return Kd(e,2),Xd(e),"pow("+Bd(t,e[0])+", "+Bd(t,e[1])+")"}},Dd[">"]={getReturnType:function(t){return Md},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" > "+Bd(t,e[1])+")"}},Dd[">="]={getReturnType:function(t){return Md},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" >= "+Bd(t,e[1])+")"}},Dd["<"]={getReturnType:function(t){return Md},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" < "+Bd(t,e[1])+")"}},Dd["<="]={getReturnType:function(t){return Md},toGlsl:function(t,e){return Kd(e,2),Xd(e),"("+Bd(t,e[0])+" <= "+Bd(t,e[1])+")"}},Dd["=="]=Jd("=="),Dd["!="]=Jd("!="),Dd["!"]={getReturnType:function(t){return Md},toGlsl:function(t,e){return Kd(e,1),Vd(e[0]),"(!"+Bd(t,e[0])+")"}},Dd.all=Qd("&&"),Dd.any=Qd("||"),Dd.between={getReturnType:function(t){return Md},toGlsl:function(t,e){Kd(e,3),Xd(e);var n=Bd(t,e[1]),i=Bd(t,e[2]),r=Bd(t,e[0]);return"("+r+" >= "+n+" && "+r+" <= "+i+")"}},Dd.array={getReturnType:function(t){return Ld},toGlsl:function(t,e){Yd(e,2),Zd(e,4),Xd(e);var n=e.map((function(e){return Bd(t,e,Od)}));return"vec"+e.length+"("+n.join(", ")+")"}},Dd.color={getReturnType:function(t){return Ad},toGlsl:function(t,e){Yd(e,3),Zd(e,4),Xd(e);var n=e;3===e.length&&n.push(1);var i=e.map((function(e,n){return Bd(t,e,Od)+(n<3?" / 255.0":"")}));return"vec"+e.length+"("+i.join(", ")+")"}},Dd.interpolate={getReturnType:function(t){for(var e=Ad|Od,n=3;n<t.length;n+=2)e&=Gd(t[n]);return e},toGlsl:function(t,e,n){Hd(e),Yd(e,6);var i,r=e[0];switch(r[0]){case"linear":i=1;break;case"exponential":i=r[1];break;default:i=null}if(!i)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(r));var o=void 0!==n?n:kd,a=Dd.interpolate.getReturnType(e)&o;qd(e,a);for(var s=Bd(t,e[1]),l=null,u=2;u<e.length-2;u+=2){var h=Bd(t,e[u]),c=Bd(t,e[u+1],a),p=Bd(t,e[u+2]);l="mix("+(l||c)+", "+Bd(t,e[u+3],a)+", pow(clamp(("+s+" - "+h+") / ("+p+" - "+h+"), 0.0, 1.0), "+jd(i)+"))"}return l}},Dd.match={getReturnType:function(t){for(var e=kd,n=2;n<t.length;n+=2)e&=Gd(t[n]);return e&=Gd(t[t.length-1])},toGlsl:function(t,e,n){Hd(e),Yd(e,4);var i=void 0!==n?n:kd,r=Dd.match.getReturnType(e)&i;qd(e,r);for(var o=Bd(t,e[0]),a=Bd(t,e[e.length-1],r),s=null,l=e.length-3;l>=1;l-=2){s="("+o+" == "+Bd(t,e[l])+" ? "+Bd(t,e[l+1],r)+" : "+(s||a)+")"}return s}},Dd.case={getReturnType:function(t){for(var e=kd,n=1;n<t.length;n+=2)e&=Gd(t[n]);return e&=Gd(t[t.length-1])},toGlsl:function(t,e,n){!function(t){if(t.length%2==0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}(e),Yd(e,3);var i=void 0!==n?n:kd,r=Dd.case.getReturnType(e)&i;qd(e,r);for(var o=0;o<e.length-1;o+=2)Vd(e[o]);var a=Bd(t,e[e.length-1],r),s=null;for(o=e.length-3;o>=0;o-=2){s="("+Bd(t,e[o])+" ? "+Bd(t,e[o+1],r)+" : "+(s||a)+")"}return s}};var $d=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,n){return this.varyings.push({name:t,type:e,expression:n}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",n=this.attributes,i=this.varyings;return t&&(n=n.concat("vec4 a_hitColor"),i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+n.map((function(t){return"attribute "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+e+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+this.rotationExpression+";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = "+this.texCoordExpression+";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n"+i.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")+"\n}"},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",n=this.varyings;return t&&(n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+e+"\n}"},t}();var tg=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),eg=function(t){function e(e){var n=this,i=m({},e);return(n=t.call(this,i)||this).parseResult_=function(t){var e=t.symbol,n=void 0!==e.size?e.size:1,i=e.color||"white",r=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},u=Bd(l,n,Ld|Od),h=Bd(l,o,Ld),c=Bd(l,r,Ld),p=Bd(l,s,Od),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap},d=Bd(f,i,Ad),g=Bd(f,a,Od),_="1.0",y="vec2("+Bd(f,n,Ld|Od)+").x";switch(e.symbolType){case"square":case"image":break;case"circle":_="(1.0-smoothstep(1.-4./"+y+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var v="(v_quadCoord*2.-1.)",m="(atan("+v+".x,"+v+".y))";_="(1.0-smoothstep(.5-3./"+y+",.5,cos(floor(.5+"+m+"/2.094395102)*2.094395102-"+m+")*length("+v+")))";break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new $d).setSizeExpression("vec2("+u+")").setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4("+d+".rgb, "+d+".a * "+g+" * "+_+")");if(t.filter){var w=Bd(f,t.filter,Md);x.setFragmentDiscardExpression("!"+w)}var S={};if(f.variables.forEach((function(e){x.addUniform("float u_"+e),S["u_"+e]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: "+e);var n=t.variables[e];return"string"==typeof n&&(n=zd(l,n)),void 0!==n?n:-9999999}})),"image"===e.symbolType&&e.src){var C=new Image;C.src=e.src,x.addUniform("sampler2D u_texture").setColorExpression(x.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),S.u_texture=C}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),x.addVarying("v_"+t,"float","a_"+t)})),l.attributes.forEach((function(t){x.addAttribute("float a_"+t)})),{builder:x,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,n){var i=n[t];return"string"==typeof i&&(i=zd(l,i)),void 0!==i?i:-9999999}}})),uniforms:S}}(e.style),n.hitDetectionDisabled_=!!e.disableHitDetection,n}return tg(e,t),e.prototype.createRenderer=function(){return new Bf(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.disposeInternal=function(){this.getRenderer().disposeInternal(),t.prototype.disposeInternal.call(this)},e}(Zr),ng=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();var ig=function(t){function e(e){var n=this,r=void 0!==e.hidpi&&e.hidpi;return(n=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,opaque:!0,projection:un("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Wr,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this).hidpi_=r,n.culture_=void 0!==e.culture?e.culture:"en-us",n.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,n.apiKey_=e.key,n.imagerySet_=e.imagerySet,function(t,e,n,r){var o=document.createElement("script"),a="olc_"+i(e);function s(){delete window[a],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+a;var l=setTimeout((function(){s(),n&&n()}),1e4);window[a]=function(t){clearTimeout(l),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+n.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+n.apiKey_+"&c="+n.culture_,n.handleImageryMetadataResponse.bind(n),void 0,"jsonp"),n}return ng(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],n=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,i=ad(this.getProjection()),r=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/r:[e.imageWidth/r,e.imageHeight/r],a=rd({extent:i,minZoom:e.zoomMin,maxZoom:n,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=cd(e.imageUrlSubdomains.map((function(t){var n=[0,0,0],i=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,r){if(t){xh(t[0],t[1],t[2],n);var o=i;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,n,i=t[0],r=new Array(i),o=1<<i-1;for(e=0;e<i;++e)n=48,t[1]&o&&(n+=1),t[2]&o&&(n+=2),r[e]=String.fromCharCode(n),o>>=1;return r.join("")}(n))}}}))),e.imageryProviders){var u=dn(un("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var n=[],i=t.viewState,r=this.getTileGrid(),o=r.getZForResolution(i.resolution,this.zDirection),a=r.getTileCoordForCoordAndZ(i.center,o)[0];return e.imageryProviders.map((function(e){for(var i=!1,r=e.coverageAreas,o=0,s=r.length;o<s;++o){var l=r[o];if(a>=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(me(we([h[1],h[0],h[3],h[2]],u),t.extent)){i=!0;break}}}i&&n.push(e.attribution)})),n.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),n}.bind(this))}this.setState(Vr)}else this.setState(Kr)},e}(Rd),rg=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),og=function(t){function e(e){var n=e||{},i=void 0!==n.projection?n.projection:"EPSG:3857",r=void 0!==n.tileGrid?n.tileGrid:rd({extent:ad(i),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:n.opaque,projection:i,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this}return rg(e,t),e}(Rd);function ag(t,e){var n=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))}));var i=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+i}var sg="carmentaserver",lg="geoserver",ug="mapserver",hg="qgis",cg=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pg=function(t){function e(e){var n,i=e||{};n=void 0!==i.attributions?i.attributions:['© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var r=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",o=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:n,cacheSize:i.cacheSize,crossOrigin:r,imageSmoothing:i.imageSmoothing,opaque:void 0===i.opaque||i.opaque,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,url:o,wrapX:i.wrapX,attributionsCollapsible:!1})||this}return cg(e,t),e}(og),fg=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),dg=function(t){function e(e){var n=this,i=e||{},r=i.params||{},o=!("TRANSPARENT"in r)||r.TRANSPARENT;return(n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:!o,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,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,n.params_=r,n.v13_=!0,n.serverType_=i.serverType,n.hidpi_=void 0===i.hidpi||i.hidpi,n.tmpExtent_=[1/0,1/0,-1/0,-1/0],n.updateV13_(),n.setKey(n.getKeyForParams_()),n}return fg(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,i){var r=un(n),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(r));var s=a.getZForResolution(e,this.zDirection),l=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=l[0])){var u=a.getResolution(l[0]),h=a.getTileCoordExtent(l,this.tmpExtent_),c=Li(a.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=Ai(c,p,this.tmpSize),h=Xt(h,u*p,h)),o&&o!==r&&(u=Cd(o,r,t,u),h=function(t,e,n,i){return we(t,gn(e,n),void 0,i)}(h,r,o),t=_n(t,r,o));var f={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(f,this.params_,i);var d=Math.floor((t[0]-h[0])/u),g=Math.floor((h[3]-t[1])/u);return f[this.v13_?"I":"X"]=d,f[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||r,f)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var n={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var i=this.params_.LAYERS;if(!(!Array.isArray(i)||1===i.length))return;n.LAYER=i}if(void 0!==t){var r=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*r*39.37*(25.4/.28)}return m(n,e),ag(this.urls[0],n)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,n,i,r,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=i)switch(this.serverType_){case lg:var s=90*i+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case ug:o.MAP_RESOLUTION=90*i;break;case sg:case hg:o.DPI=90*i;break;default:nt(!1,52)}var l,u=r.getAxisOrientation(),h=n;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=n[0],h[0]=n[1],h[1]=c,c=n[2],h[2]=n[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)l=a[0];else l=a[Oe(Ch(t),a.length)];return ag(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")},e.prototype.updateParams=function(t){m(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=function(t,e){for(var n=(""+t).split("."),i=(""+e).split("."),r=0;r<Math.max(n.length,i.length);r++){var o=parseInt(n[r]||"0",10),a=parseInt(i[r]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,n){var i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),!(i.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var r=i.getResolution(t[0]),o=i.getTileCoordExtent(t,this.tmpExtent_),a=Li(i.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=Ai(a,s,this.tmpSize),o=Xt(o,r*s,o)),1!=e&&(a=Mi(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return m(l,this.params_),this.getRequestUrl_(t,a,o,e,n,l)}},e}(Rd);X.unByKey=W;let gg={Control:$s,Zoom:ol,Attribution:el,ScaleLine:fl,LayerSwitcher:Rh},_g={GeoJSON:jh,KML:zc},yg={Group:_s,Tile:vd,Vector:Ia,WebGLPoints:eg,Heatmap:Yf},vg={toLonLat:function(t,e){var n=_n(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),i=n[0];return(i<-180||i>180)&&(n[0]=Oe(i+180,360)-180),n},fromLonLat:function(t,e){return _n(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}},mg={LineString:Ti,Point:$n,MultiPoint:Su},xg={Icon:Ca,Style:br,Text:Ir,Stroke:Pi,Fill:wi,Circle:Cr},wg={OSM:pg,XYZ:og,TileWMS:dg,BingMaps:ig,Vector:Za};t.Collection=et,t.Feature=rt,t.Map=vh,t.Observable=X,t.View=Ys,t.control=gg,t.format=_g,t.geom=mg,t.interaction=_h,t.layer=yg,t.proj=vg,t.source=wg,t.sphere=Je,t.style=xg,Object.defineProperty(t,"__esModule",{value:!0})}));
|
||
//# sourceMappingURL=ol-custom.js.map
|