Files
tar1090/html/libs/ol-custom006.js
2020-12-30 03:12:17 +01:00

3 lines
449 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!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 i=0;function n(t){return t.ol_uid||(t.ol_uid=String(++i))}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 i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),a=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.4.3".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}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}(),u="propertychange",l=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,i){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var r=void 0;if(i>0){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return n-1}function f(t,e,i){for(;e<i;){var n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function d(t,e){for(var i=Array.isArray(e)?e:[e],n=i.length,r=0;r<n;r++)t[t.length]=i[r]}function g(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function _(){return!0}function v(){return!1}function y(){}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 i=Object(t),n=1,r=arguments.length;n<r;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(i[a]=o[a])}return i};function x(t){for(var e in t)delete t[e]}var S="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function w(t){var e;for(e in t)return!1;return!e}var C=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),b=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return C(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new s(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var n,r=this.listeners_&&this.listeners_[i];if(r){var o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];for(var u=0,l=r.length;u<l;++u)if(!1===(n="handleEvent"in r[u]?r[u].handleEvent(e):r[u].call(this,e))||e.propagationStopped){n=!1;break}if(--o[i],0===o[i]){var h=a[i];for(delete a[i];h--;)this.removeEventListener(i,y);delete o[i]}return n}},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 i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=y,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(l),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,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){var o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function z(t,e,i,n){return N(t,e,i,n,!0)}function B(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var U=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),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 i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=N(this,t[r],e);return n}return N(this,t,e)},e.prototype.once=function(t,e){var i;if(Array.isArray(t)){var n=t.length;i=new Array(n);for(var r=0;r<n;++r)i[r]=z(this,t[r],e)}else i=z(this,t,e);return e.ol_key=i,i},e.prototype.un=function(t,e){var i=e.ol_key;if(i)V(i);else if(Array.isArray(t))for(var n=0,r=t.length;n<r;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(b);function V(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)B(t[e]);else B(t)}var W=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Y=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.key=i,r.oldValue=n,r}return W(e,t),e}(s),K=function(t){function e(e){var i=t.call(this)||this;return n(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return W(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 i;i=H(t),this.dispatchEvent(new Y(i,t,e)),i=u,this.dispatchEvent(new Y(i,t,e))},e.prototype.set=function(t,e,i){var n=this.values_||(this.values_={});if(i)n[t]=e;else{var r=n[t];n[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],w(this.values_)&&(this.values_=null),e||this.notify(t,i)}},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,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$="length",tt=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.element=i,r.index=n,r}return Q(e,t),e}(s),et=function(t){function e(e,i){var n=t.call(this)||this,r=i||{};if(n.unique_=!!r.unique,n.array_=e||[],n.unique_)for(var o=0,a=n.array_.length;o<a;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return Q(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get($)},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_,i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new tt(J,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new tt(J,n,t)),this.dispatchEvent(new tt(q,e,t))}else{for(var r=i;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 i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new a(58)},e}(K);function it(t,e){if(!t)throw new a(e)}var nt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),rt=function(t){function e(e){var i=t.call(this)||this;if(i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addEventListener(H(i.geometryName_),i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;i.setGeometry(n)}else{var r=e;i.setProperties(r)}return i}return nt(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),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:(it("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}(K);var ot="XY",at="XYZ",st="XYM",ut="XYZM",lt="Point",ht="LineString",ct="LinearRing",pt="Polygon",ft="MultiPoint",dt="MultiLineString",gt="MultiPolygon",_t="GeometryCollection",vt="Circle",yt="degrees",mt="ft",xt="m",St="tile-pixels",wt="us-ft",Ct={};Ct[yt]=2*Math.PI*6370997/360,Ct[mt]=.3048,Ct[xt]=1,Ct[wt]=1200/3937;var bt=new Array(6);function Et(t){return Pt(t,1,0,0,1,0,0)}function Tt(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],u=e[0],l=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=i*u+r*l,t[1]=n*u+o*l,t[2]=i*h+r*c,t[3]=n*h+o*c,t[4]=i*p+r*f+a,t[5]=n*p+o*f+s,t}function Pt(t,e,i,n,r,o,a){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=a,t}function Rt(t,e){var i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Ft(t,e,i,n,r,o,a,s){var u=Math.sin(o),l=Math.cos(o);return t[0]=n*l,t[1]=r*u,t[2]=-n*u,t[3]=r*l,t[4]=a*n*l-s*n*u+e,t[5]=a*r*u+s*r*l+i,t}function Ot(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];it(0!==n,32);var r=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=r/n,t[4]=(a*l-s*u)/n,t[5]=-(r*l-o*u)/n,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(),i=0,n=t.length;i<n;++i)re(e,t[i]);return e}function Xt(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Vt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Wt(t,e,i){var n,r;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*r}function Yt(t,e){return Zt(t,e[0],e[1])}function Kt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Zt(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function Ht(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],a=e[0],s=e[1],u=Dt;return a<i?u|=Bt:a>r&&(u|=Nt),s<n?u|=zt:s>o&&(u|=jt),u===Dt&&(u=Gt),u}function qt(){return[1/0,1/0,-1/0,-1/0]}function Jt(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function Qt(t){return Jt(1/0,1/0,-1/0,-1/0,t)}function $t(t,e){var i=t[0],n=t[1];return Jt(i,n,i,n,e)}function te(t,e){return function(t,e){for(var i=0,n=e.length;i<n;++i)re(t,e[i]);return t}(Qt(e),t)}function ee(t,e,i,n,r){return oe(Qt(r),t,e,i,n)}function ie(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ne(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,i,n,r){for(;i<n;i+=r)ae(t,e[i],e[i+1]);return t}function ae(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function se(t,e){var i;return(i=e(le(t)))||(i=e(he(t)))||(i=e(ve(t)))?i:(i=e(_e(t)))||!1}function ue(t){var e=0;return xe(t)||(e=ye(t)*de(t)),e}function le(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 i;return e===At?i=le(t):e===Mt?i=he(t):e===Lt?i=_e(t):e===kt?i=ve(t):it(!1,13),i}function fe(t,e,i,n,r){var o=e*n[0]/2,a=e*n[1]/2,s=Math.cos(i),u=Math.sin(i),l=o*s,h=o*u,c=a*s,p=a*u,f=t[0],d=t[1],g=f-l+p,_=f-l-p,v=f+l-p,y=f+l+p,m=d-h-c,x=d-h+c,S=d+h+c,w=d+h-c;return Jt(Math.min(g,_,v,y),Math.min(m,x,S,w),Math.max(g,_,v,y),Math.max(m,x,S,w),r)}function de(t){return t[3]-t[1]}function ge(t,e,i){var n=i||[1/0,1/0,-1/0,-1/0];return me(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):Qt(n),n}function _e(t){return[t[0],t[3]]}function ve(t){return[t[2],t[3]]}function ye(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 Se(t,e,i,n){var r=[];if(n>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<n;++s)r.push(t[0]+o*s/n,t[1],t[2],t[1]+a*s/n,t[2]-o*s/n,t[3],t[0],t[3]-a*s/n);else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);for(var u=[],l=[],h=(s=0,r.length);s<h;s+=2)u.push(r[s]),l.push(r[s+1]);return function(t,e,i){return Jt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(u,l,i)}var we=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,i){return Math.min(Math.max(t,e),i)}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,i,n,r,o){var a=r-i,s=o-n;if(0!==a||0!==s){var u=((t-i)*a+(e-n)*s)/(a*a+s*s);u>1?(i=r,n=o):u>0&&(i+=a*u,n+=s*u)}return Pe(t,e,i,n)}function Pe(t,e,i,n){var r=i-t,o=n-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 i=t%e;return i*e<0?i+e:i}function Ie(t,e,i){return t+i*(e-t)}var Ae=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),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}(we),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,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var a=Me,s=0;s<n;s+=r){o[s]=a*t[s]/180;var u=6378137*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));u>a?u=a:u<-a&&(u=-a),o[s+1]=u}return o}function Ne(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var a=0;a<n;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,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Be=[-180,-90,180,90],Ue=6378137*Math.PI/180,Xe=function(t){function e(e,i){return t.call(this,{code:e,units:yt,extent:Be,axisOrientation:i,global:!0,metersPerUnit:Ue,worldExtent:Be})||this}return ze(e,t),e}(we),Ve=[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")],We={};var Ye={};function Ke(t,e,i){var n=t.getCode(),r=e.getCode();n in Ye||(Ye[n]={}),Ye[n][r]=i}function Ze(t,e,i){var n=i||6371008.8,r=Fe(t[1]),o=Fe(e[1]),a=(o-r)/2,s=Fe(e[0]-t[0])/2,u=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(r)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function He(t,e){for(var i=0,n=0,r=t.length;n<r-1;++n)i+=Ze(t[n],t[n+1],e);return i}function qe(t,e){for(var i=0,n=t.length,r=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],u=t[a][1];i+=Fe(s-r)*(2+Math.sin(Fe(o))+Math.sin(Fe(u))),r=s,o=u}return i*e*e/2}var Je=Object.freeze({__proto__:null,DEFAULT_RADIUS:6371008.8,getDistance:Ze,getLength:function t(e,i){var n=i||{},r=n.radius||6371008.8,o=n.projection||"EPSG:3857",a=e.getType();a!==_t&&(e=e.clone().transform(o,"EPSG:4326"));var s,u,l,h,c,p,f=0;switch(a){case lt:case ft:break;case ht:case ct:f=He(s=e.getCoordinates(),r);break;case dt:case pt:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)f+=He(s[l],r);break;case gt:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)for(c=0,p=(u=s[l]).length;c<p;++c)f+=He(u[c],r);break;case _t:var d=e.getGeometries();for(l=0,h=d.length;l<h;++l)f+=t(d[l],i);break;default:throw new Error("Unsupported geometry type: "+a)}return f},getArea:function t(e,i){var n=i||{},r=n.radius||6371008.8,o=n.projection||"EPSG:3857",a=e.getType();a!==_t&&(e=e.clone().transform(o,"EPSG:4326"));var s,u,l,h,c,p,f=0;switch(a){case lt:case ft:case ht:case dt:case ct:break;case pt:for(s=e.getCoordinates(),f=Math.abs(qe(s[0],r)),l=1,h=s.length;l<h;++l)f-=Math.abs(qe(s[l],r));break;case gt:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)for(u=s[l],f+=Math.abs(qe(u[0],r)),c=1,p=u.length;c<p;++c)f-=Math.abs(qe(u[c],r));break;case _t:var d=e.getGeometries();for(l=0,h=d.length;l<h;++l)f+=t(d[l],i);break;default:throw new Error("Unsupported geometry type: "+a)}return f},offset:function(t,e,i,n){var r=n||6371008.8,o=Fe(t[1]),a=Fe(t[0]),s=e/r,u=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(i));return[Re(a+Math.atan2(Math.sin(i)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(u))),Re(u)]}});function Qe(t,e){for(var i=(""+t).split("."),n=(""+e).split("."),r=0;r<Math.max(i.length,n.length);r++){var o=parseInt(i[r]||"0",10),a=parseInt(n[r]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function $e(t,e){var i,n,r=t[0],o=t[1],a=e[0],s=e[1],u=a[0],l=a[1],h=s[0],c=s[1],p=h-u,f=c-l,d=0===p&&0===f?0:(p*(r-u)+f*(o-l))/(p*p+f*f||0);return d<=0?(i=u,n=l):d>=1?(i=h,n=c):(i=u+d*p,n=l+d*f),[i,n]}function ti(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function ei(t,e){var i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,o=t[1]*i+t[0]*n;return t[0]=r,t[1]=o,t}function ii(t,e){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function ni(t,e){return Math.sqrt(ii(t,e))}function ri(t,e){return ii(t,$e(t,e))}function oi(t,e){if(e.canWrapX()){var i=ye(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=i||ye(n);r=Math.floor((t[0]-n[0])/o)}return r}(t,e,i);n&&(t[0]-=n*i)}return t}function ai(t,e,i){var n;if(void 0!==e){for(var r=0,o=t.length;r<o;++r)e[r]=t[r];n=e}else n=t.slice();return n}function si(t,e,i){if(void 0!==e&&t!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];t=e}return t}function ui(t){!function(t,e){We[t]=e}(t.getCode(),t),Ke(t,t,ai)}function li(t){return"string"==typeof t?We[t]||null:t||null}function hi(t,e,i,n){var r,o=(t=li(t)).getPointResolutionFunc();if(o)r=o(e,i),n&&n!==t.getUnits()&&(a=t.getMetersPerUnit())&&(r=r*a/Ct[n]);else if(t.getUnits()==yt&&!n||n==yt)r=e;else{var a,s=di(t,li("EPSG:4326")),u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];r=(Ze((u=s(u,u,2)).slice(0,2),u.slice(2,4))+Ze(u.slice(4,6),u.slice(6,8)))/2,void 0!==(a=n?Ct[n]:t.getMetersPerUnit())&&(r/=a)}return r}function ci(t){!function(t){t.forEach(ui)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ke(e,t,ai)}))}))}function pi(t,e){return t?"string"==typeof t?li(t):t:li(e)}function fi(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||di(t,e)===ai)&&i}function di(t,e){var i=function(t,e){var i;return t in Ye&&e in Ye[t]&&(i=Ye[t][e]),i}(t.getCode(),e.getCode());return i||(i=si),i}function gi(t,e){return di(li(t),li(e))}function _i(t,e,i){return gi(e,i)(t,void 0,t.length)}var vi,yi,mi;function xi(t,e){return t}function Si(t,e){return t}function wi(t,e){return t}function Ci(t,e){return t}function bi(t,e,i,n,r,o){for(var a=o||[],s=0,u=e;u<i;u+=n){var l=t[u],h=t[u+1];a[s++]=r[0]*l+r[2]*h+r[4],a[s++]=r[1]*l+r[3]*h+r[5]}return o&&a.length!=s&&(a.length=s),a}function Ei(t,e,i,n,r,o,a){for(var s=a||[],u=Math.cos(r),l=Math.sin(r),h=o[0],c=o[1],p=0,f=e;f<i;f+=n){var d=t[f]-h,g=t[f+1]-c;s[p++]=h+d*u-g*l,s[p++]=c+d*l+g*u;for(var _=f+2;_<f+n;++_)s[p++]=t[_]}return a&&s.length!=p&&(s.length=p),s}function Ti(t,e,i,n,r,o,a){for(var s=a||[],u=0,l=e;l<i;l+=n){s[u++]=t[l]+r,s[u++]=t[l+1]+o;for(var h=l+2;h<l+n;++h)s[u++]=t[h]}return a&&s.length!=u&&(s.length=u),s}ci(Ge),ci(Ve),vi=Ge,yi=je,mi=Ne,Ve.forEach((function(t){vi.forEach((function(e){Ke(t,e,yi),Ke(e,t,mi)}))}));var Pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ri=[1,0,0,1,0,0],Fi=function(t){function i(){var e,i,n,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,i){if(!i)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===r&&g(t,n)||(o=!0,r=this,n=t,i=e.apply(this,arguments)),i}),a}return Pi(i,t),i.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},i.prototype.clone=function(){return e()},i.prototype.closestPointXY=function(t,i,n,r){return e()},i.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},i.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},i.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},i.prototype.computeExtent=function(t){return e()},i.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)},i.prototype.rotate=function(t,i){e()},i.prototype.scale=function(t,i,n){e()},i.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},i.prototype.getSimplifiedGeometry=function(t){return e()},i.prototype.getType=function(){return e()},i.prototype.applyTransform=function(t){e()},i.prototype.intersectsExtent=function(t){return e()},i.prototype.translate=function(t,i){e()},i.prototype.transform=function(t,e){var i=li(t),n=i.getUnits()==St?function(t,n,r){var o=i.getExtent(),a=i.getWorldExtent(),s=de(a)/de(o);return Ft(Ri,a[0],a[3],s,-s,0,0,0),bi(t,0,t.length,r,Ri,n),gi(i,e)(t,n,r)}:gi(i,e);return this.applyTransform(n),this},i}(K),Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ii=function(t){function i(){var e=t.call(this)||this;return e.layout=ot,e.stride=2,e.flatCoordinates=null,e}return Oi(i,t),i.prototype.computeExtent=function(t){return ee(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},i.prototype.getCoordinates=function(){return e()},i.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},i.prototype.getFlatCoordinates=function(){return this.flatCoordinates},i.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},i.prototype.getLayout=function(){return this.layout},i.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)},i.prototype.getSimplifiedGeometryInternal=function(t){return this},i.prototype.getStride=function(){return this.stride},i.prototype.setFlatCoordinates=function(t,e){this.stride=Ai(t),this.layout=t,this.flatCoordinates=e},i.prototype.setCoordinates=function(t,i){e()},i.prototype.setLayout=function(t,e,i){var n;if(t)n=Ai(t);else{for(var r=0;r<i;++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=ut);return e}(n=e.length)}this.layout=t,this.stride=n},i.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},i.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();Ei(i,0,i.length,n,t,e,i),this.changed()}},i.prototype.scale=function(t,e,i){var n=e;void 0===n&&(n=t);var r=i;r||(r=ce(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,i,n,r,o,a,s){for(var u=s||[],l=a[0],h=a[1],c=0,p=e;p<i;p+=n){var f=t[p]-l,d=t[p+1]-h;u[c++]=l+r*f,u[c++]=h+o*d;for(var g=p+2;g<p+n;++g)u[c++]=t[g]}s&&u.length!=c&&(u.length=c)}(o,0,o.length,a,t,n,r,o),this.changed()}},i.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();Ti(i,0,i.length,n,t,e,i),this.changed()}},i}(Fi);function Ai(t){var e;return t==ot?e=2:t==at||t==st?e=3:t==ut&&(e=4),e}function Mi(t,e,i,n,r,o,a){var s,u=t[e],l=t[e+1],h=t[i]-u,c=t[i+1]-l;if(0===h&&0===c)s=e;else{var p=((r-u)*h+(o-l)*c)/(h*h+c*c);if(p>1)s=i;else{if(p>0){for(var f=0;f<n;++f)a[f]=Ie(t[e+f],t[i+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function Li(t,e,i,n,r){var o=t[e],a=t[e+1];for(e+=n;e<i;e+=n){var s=t[e],u=t[e+1],l=Pe(o,a,s,u);l>r&&(r=l),o=s,a=u}return r}function ki(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o){var s=i[o];r=Li(t,e,s,n,r),e=s}return r}function Di(t,e,i,n,r,o,a,s,u,l,h){if(e==i)return l;var c,p;if(0===r){if((p=Pe(a,s,t[e],t[e+1]))<l){for(c=0;c<n;++c)u[c]=t[e+c];return u.length=n,p}return l}for(var f=h||[NaN,NaN],d=e+n;d<i;)if(Mi(t,d-n,d,n,a,s,f),(p=Pe(a,s,f[0],f[1]))<l){for(l=p,c=0;c<n;++c)u[c]=f[c];u.length=n,d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(l))/r|0,1);if(o&&(Mi(t,i-n,e,n,a,s,f),(p=Pe(a,s,f[0],f[1]))<l)){for(l=p,c=0;c<n;++c)u[c]=f[c];u.length=n}return l}function Gi(t,e,i,n,r,o,a,s,u,l,h){for(var c=h||[NaN,NaN],p=0,f=i.length;p<f;++p){var d=i[p];l=Di(t,e,d,n,r,o,a,s,u,l,c),e=d}return l}function ji(t,e,i,n){for(var r=0,o=i.length;r<o;++r)t[e++]=i[r];return e}function Ni(t,e,i,n){for(var r=0,o=i.length;r<o;++r)for(var a=i[r],s=0;s<n;++s)t[e++]=a[s];return e}function zi(t,e,i,n,r){for(var o=r||[],a=0,s=0,u=i.length;s<u;++s){var l=Ni(t,e,i[s],n);o[a++]=l,e=l}return o.length=a,o}function Bi(t,e,i,n,r,o,a){var s=(i-e)/n;if(s<3){for(;e<i;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var u=new Array(s);u[0]=1,u[s-1]=1;for(var l=[e,i-n],h=0;l.length>0;){for(var c=l.pop(),p=l.pop(),f=0,d=t[p],g=t[p+1],_=t[c],v=t[c+1],y=p+n;y<c;y+=n){var m=Te(t[y],t[y+1],d,g,_,v);m>f&&(h=y,f=m)}f>r&&(u[(h-e)/n]=1,p+n<h&&l.push(p,h),h+n<c&&l.push(h,c))}for(y=0;y<s;++y)u[y]&&(o[a++]=t[e+y*n],o[a++]=t[e+y*n+1]);return a}function Ui(t,e){return e*Math.round(t/e)}function Xi(t,e,i,n,r,o,a){if(e==i)return a;var s,u,l=Ui(t[e],r),h=Ui(t[e+1],r);e+=n,o[a++]=l,o[a++]=h;do{if(s=Ui(t[e],r),u=Ui(t[e+1],r),(e+=n)==i)return o[a++]=s,o[a++]=u,a}while(s==l&&u==h);for(;e<i;){var c=Ui(t[e],r),p=Ui(t[e+1],r);if(e+=n,c!=s||p!=u){var f=s-l,d=u-h,g=c-l,_=p-h;f*_==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&_<d||d==_||d>0&&_>d)?(s=c,u=p):(o[a++]=s,o[a++]=u,l=s,h=u,s=c,u=p)}}return o[a++]=s,o[a++]=u,a}function Vi(t,e,i,n,r,o,a,s){for(var u=0,l=i.length;u<l;++u){var h=i[u];a=Xi(t,e,h,n,r,o,a),s.push(a),e=h}return a}function Wi(t,e,i,n,r){for(var o=void 0!==r?r:[],a=0,s=e;s<i;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function Yi(t,e,i,n,r){for(var o=void 0!==r?r:[],a=0,s=0,u=i.length;s<u;++s){var l=i[s];o[a++]=Wi(t,e,l,n,o[a]),e=l}return o.length=a,o}function Ki(t,e,i,n,r){for(var o=void 0!==r?r:[],a=0,s=0,u=i.length;s<u;++s){var l=i[s];o[a++]=Yi(t,e,l,n,o[a]),e=l[l.length-1]}return o.length=a,o}function Zi(t,e,i,n){for(var r=0,o=t[i-n],a=t[i-n+1];e<i;e+=n){var s=t[e],u=t[e+1];r+=a*s-o*u,o=s,a=u}return r/2}function Hi(t,e,i,n){for(var r=0,o=0,a=i.length;o<a;++o){var s=i[o];r+=Zi(t,e,s,n),e=s}return r}var qi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ji=function(t){function e(e,i){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?n.setCoordinates(e,i):n.setFlatCoordinates(i,e),n}return qi(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.getArea=function(){return Zi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=Bi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,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=Ni(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ii),Qi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$i=function(t){function e(e,i){var n=t.call(this)||this;return n.setCoordinates(e,i),n}return Qi(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){var r=this.flatCoordinates,o=Pe(t,e,r[0],r[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)i[s]=r[s];return i.length=a,o}return n},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 lt},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=ji(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ii);function tn(t,e,i,n,r){return!se(r,(function(r){return!en(t,e,i,n,r[0],r[1])}))}function en(t,e,i,n,r,o){for(var a=0,s=t[i-n],u=t[i-n+1];e<i;e+=n){var l=t[e],h=t[e+1];u<=o?h>o&&(l-s)*(o-u)-(r-s)*(h-u)>0&&a++:h<=o&&(l-s)*(o-u)-(r-s)*(h-u)<0&&a--,s=l,u=h}return 0!==a}function nn(t,e,i,n,r,o){if(0===i.length)return!1;if(!en(t,e,i[0],n,r,o))return!1;for(var a=1,s=i.length;a<s;++a)if(en(t,i[a-1],i[a],n,r,o))return!1;return!0}function rn(t,e,i,n,r,o,a){for(var s,u,l,c,p,f,d,g=r[o+1],_=[],v=0,y=i.length;v<y;++v){var m=i[v];for(c=t[m-n],f=t[m-n+1],s=e;s<m;s+=n)p=t[s],d=t[s+1],(g<=f&&d<=g||f<=g&&g<=d)&&(l=(g-f)/(d-f)*(p-c)+c,_.push(l)),c=p,f=d}var x=NaN,S=-1/0;for(_.sort(h),c=_[0],s=1,u=_.length;s<u;++s){p=_[s];var w=Math.abs(p-c);w>S&&nn(t,e,i,n,l=(c+p)/2,g)&&(x=l,S=w),c=p}return isNaN(x)&&(x=r[o]),a?(a.push(x,g,S),a):[x,g,S]}function on(t,e,i,n,r){for(var o,a=[t[e],t[e+1]],s=[];e+n<i;e+=n){if(s[0]=t[e+n],s[1]=t[e+n+1],o=r(a,s))return o;a[0]=s[0],a[1]=s[1]}return!1}function an(t,e,i,n,r){var o=oe([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!me(r,o)&&(!!Kt(r,o)||(o[0]>=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||on(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=Ht(t,e),o=Ht(t,i);if(r===Gt||o===Gt)n=!0;else{var a=t[0],s=t[1],u=t[2],l=t[3],h=e[0],c=e[1],p=i[0],f=i[1],d=(f-c)/(p-h),g=void 0,_=void 0;o&jt&&!(r&jt)&&(n=(g=p-(f-l)/d)>=a&&g<=u),n||!(o&Nt)||r&Nt||(n=(_=f-(p-u)*d)>=s&&_<=l),n||!(o&zt)||r&zt||(n=(g=p-(f-s)/d)>=a&&g<=u),n||!(o&Bt)||r&Bt||(n=(_=f-(p-a)*d)>=s&&_<=l)}return n}(r,t,e)})))))}function sn(t,e,i,n,r){if(!function(t,e,i,n,r){return!!an(t,e,i,n,r)||(!!en(t,e,i,n,r[0],r[1])||(!!en(t,e,i,n,r[0],r[3])||(!!en(t,e,i,n,r[2],r[1])||!!en(t,e,i,n,r[2],r[3]))))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,a=i.length;o<a;++o)if(tn(t,i[o-1],i[o],n,r)&&!an(t,i[o-1],i[o],n,r))return!1;return!0}function un(t,e,i,n){for(;e<i-n;){for(var r=0;r<n;++r){var o=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=o}e+=n,i-=n}}function ln(t,e,i,n){for(var r=!0,o=0;o<n;++o)if(t[e+o]!==t[i-n+o]){r=!1;break}r&&(i-=n);var a=function(t,e,i,n){for(var r=-1,o=1/0,a=1/0,s=e;s<i;s+=n){var u=t[s],l=t[s+1];l>o||(l==o&&u>=a||(r=s,o=l,a=u))}return r}(t,e,i,n),s=a-n;s<e&&(s=i-n);var u=a+n;u>=i&&(u=e);var l=t[s],h=t[s+1],c=t[a],p=t[a+1],f=t[u],d=t[u+1];return c*d+l*p+h*f-(h*c+p*f+l*d)<0}function hn(t,e,i,n,r){for(var o=void 0!==r&&r,a=0,s=i.length;a<s;++a){var u=i[a],l=ln(t,e,u,n);if(0===a){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=u}return!0}function cn(t,e,i,n,r){for(var o=void 0!==r&&r,a=0,s=i.length;a<s;++a){var u=i[a],l=ln(t,e,u,n);(0===a?o&&l||!o&&!l:o&&!l||!o&&l)&&un(t,e,u,n),e=u}return e}function pn(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o)e=cn(t,e,i[o],n,r);return e}var fn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dn=function(t){function e(e,i,n){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!==i&&n?(r.setFlatCoordinates(i,e),r.ends_=n):r.setCoordinates(e,i),r}return fn(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,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ki(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gi(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return nn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Hi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?cn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Yi(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_=rn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new $i(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 Ji(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],r=0,o=0,a=i.length;o<a;++o){var s=i[o],u=new Ji(e.slice(r,s),t);n.push(u),r=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;hn(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=cn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=Vi(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new e(i,ot,n)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return sn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=zi(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Ii);function gn(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=[e,i,e,r,n,r,n,i,e,i];return new dn(o,ot,[o.length])}function _n(t,e,i){for(var n=e||32,r=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=r*(n+1),u=new Array(s),l=0;l<s;l+=r){u[l]=0,u[l+1]=0;for(var h=2;h<r;h++)u[l+h]=a[h]}var c=[u.length],p=new dn(u,o,c);return function(t,e,i,n){for(var r=t.getFlatCoordinates(),o=t.getStride(),a=r.length/o-1,s=n||0,u=0;u<=a;++u){var l=u*o,h=s+2*Oe(u,a)*Math.PI/a;r[l]=e[0]+i*Math.cos(h),r[l+1]=e[1]+i*Math.sin(h)}t.changed()}(p,a,t.getRadius(),i),p}var vn="prerender",yn="postrender",mn="precompose",xn="postcompose",Sn="rendercomplete",wn=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 Cn(t,e,i,n,r,o,a){var s,u,l=(i-e)/n;if(1===l)s=e;else if(2===l)s=e,u=r;else if(0!==l){for(var c=t[e],p=t[e+1],f=0,d=[0],g=e+n;g<i;g+=n){var _=t[g],v=t[g+1];f+=Math.sqrt((_-c)*(_-c)+(v-p)*(v-p)),d.push(f),c=_,p=v}var y=r*f,m=function(t,e,i){for(var n,r,o=i||h,a=0,s=t.length,u=!1;a<s;)(r=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,u=!r);return u?a:~a}(d,y);m<0?(u=(y-d[-m-2])/(d[-m-1]-d[-m-2]),s=e+(-m-2)*n):s=e+m*n}var x=a>1?a:2,S=o||new Array(x);for(g=0;g<x;++g)S[g]=void 0===s?NaN:void 0===u?t[s+g]:Ie(t[s+g],t[s+n+g],u);return S}function bn(t,e,i,n,r,o){if(i==e)return null;var a;if(r<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=r,a):null;if(t[i-1]<r)return o?((a=t.slice(i-n,i))[n-1]=r,a):null;if(r==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,u=i/n;s<u;){var l=s+u>>1;r<t[(l+1)*n-1]?u=l:s=l+1}var h=t[s*n-1];if(r==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(r-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(Ie(t[(s-1)*n+p],t[s*n+p],c));return a.push(r),a}function En(t,e,i,n){for(var r=t[e],o=t[e+1],a=0,s=e+n;s<i;s+=n){var u=t[s],l=t[s+1];a+=Math.sqrt((u-r)*(u-r)+(l-o)*(l-o)),r=u,o=l}return a}var Tn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pn=function(t){function e(e,i){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?n.setCoordinates(e,i):n.setFlatCoordinates(i,e),n}return Tn(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,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))},e.prototype.forEachSegment=function(t){return on(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=st&&this.layout!=ut)return null;var i=void 0!==e&&e;return bn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Cn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return En(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=Bi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,ot)},e.prototype.getType=function(){return ht},e.prototype.intersectsExtent=function(t){return an(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=Ni(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ii),Rn=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}(),Fn=0,On=1,In=2,An=3,Mn=4;function Ln(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i}function kn(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function Dn(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Gn=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Dn(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_=Dn(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),jn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Nn=/^([a-z]*)$|^hsla?\(.*\)$/i;function zn(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}var Bn=function(){var t={},e=0;return function(i){var n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){var r=0;for(var o in t)0==(3&r++)&&(delete t[o],--e)}n=function(t){var e,i,n,r,o;Nn.exec(t)&&(t=zn(t));if(jn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var u=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),r=u?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,u&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?Xn(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Xn(o)):it(!1,14);return o}(i),t[i]=n,++e}return n}}();function Un(t){return Array.isArray(t)?t:Bn(t)}function Xn(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 Vn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function Wn(t){return Array.isArray(t)?Vn(t):t}var Yn="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Kn=-1!==Yn.indexOf("firefox"),Zn=(-1!==Yn.indexOf("safari")&&Yn.indexOf("chrom"),-1!==Yn.indexOf("webkit")&&-1==Yn.indexOf("edge")),Hn=-1!==Yn.indexOf("macintosh"),qn="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Jn="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Qn="undefined"!=typeof Image&&Image.prototype.decode,$n=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 tr(t,e,i){var n=i&&i.length?i.shift():Jn?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(n.width=t),e&&(n.height=e),n.getContext("2d")}function er(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ir(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var nr=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"),rr=["style","variant","weight","size","lineHeight","family"],or=function(t){var e=t.match(nr);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,r=rr.length;n<r;++n){var o=e[n+1];void 0!==o&&(i[rr[n]]=o)}return i.families=i.family.split(/,\s?/),i},ar=[],sr=[0,0,0,0],ur=new K;(new b).setSize=function(){console.warn("labelCache is deprecated.")};var lr,hr,cr,pr=null,fr={},dr=function(){var t,e,i=["monospace","serif"],n=i.length,r="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,u=0;u<n;++u){var l=i[u];if(e=vr(t+" "+o+" 32px "+l,r),a!=l){var h=vr(t+" "+o+" 32px "+a+","+l,r);s=s&&h!=e}}return!!s}function a(){for(var e=!0,i=ur.getKeys(),n=0,r=i.length;n<r;++n){var a=i[n];ur.get(a)<100&&(o.apply(this,a.split("\n"))?(x(fr),pr=null,lr=void 0,ur.set(a,100)):(ur.set(a,ur.get(a)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=or(e);if(i)for(var n=i.families,r=0,s=n.length;r<s;++r){var u=n[r],l=i.style+"\n"+i.weight+"\n"+u;void 0===ur.get(l)&&(ur.set(l,100,!0),o(i.style,i.weight,u)||(ur.set(l,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),gr=(cr=fr,function(t){var e=cr[t];if(null==e)if(Jn){var i=or(t),n=_r(t,"Žg"),r=isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight);fr[t]=r*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else hr||((hr=document.createElement("div")).innerHTML="M",hr.style.margin="0 !important",hr.style.padding="0 !important",hr.style.position="absolute !important",hr.style.left="-99999px !important"),hr.style.font=t,document.body.appendChild(hr),e=hr.offsetHeight,cr[t]=e,document.body.removeChild(hr);return e});function _r(t,e){return pr||(pr=tr(1,1)),t!=lr&&(pr.font=t,lr=pr.font),pr.measureText(e)}function vr(t,e){return _r(t,e).width}function yr(t,e,i){if(e in i)return i[e];var n=vr(t,e);return i[e]=n,n}function mr(t,e,i,n){0!==e&&(t.translate(i,n),t.rotate(e),t.translate(-i,-n))}function xr(t,e,i,n,r,o,a,s,u,l,h){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(u,l),t.scale(h[0],h[1]),function(t,e){for(var i=t.contextInstructions,n=0,r=i.length;n<r;n+=2)Array.isArray(i[n+1])?e[i[n]].apply(e,i[n+1]):e[i[n]]=i[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(u,l),t.scale(h[0],h[1]),t.drawImage(n,r,o,a,s,0,0,a,s)):t.drawImage(n,r,o,a,s,u,l,a*h[0],s*h[1]),t.restore()}var Sr=null;function wr(t){return Jn?It(t):(Sr||(Sr=tr(1,1).canvas),Sr.style.transform=It(t),Sr.style.transform)}var Cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),br=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.imageSize_=null,i.hitDetectionImageSize_=null,i.render(),i}return Cr(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(),i=tr(e.size*t||1,e.size*t||1);this.draw_(e,i,0,0,t||1),this.canvas_[t||1]=i.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 In},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",i="round",n=0,r=null,o=0,a=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Wn(t),void 0===(a=this.stroke_.getWidth())&&(a=1),r=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(n=this.stroke_.getMiterLimit())&&(n=10)),{strokeStyle:t,strokeWidth:a,size:2*(this.radius_+a)+1,lineCap:e,lineDash:r,lineDashOffset:o,lineJoin:i,miterLimit:n}},e.prototype.render=function(){var t=this.createRenderOptions(),e=tr(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;var i=e.canvas.width,n=i,r=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[i/2-r[0],i/2+r[1]],this.size_=[i,i],this.imageSize_=[n,n]},e.prototype.draw_=function(t,e,i,n,r){var o,a,s;e.setTransform(r,0,0,r,0,0),e.translate(i,n),e.beginPath();var u=this.points_;if(u===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(u*=2),o=0;o<=u;o++)a=2*o*Math.PI/u-Math.PI/2+this.angle_,s=o%2==0?this.radius_:l,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=Wn(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(),i=0;if("string"==typeof e&&(e=Un(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=tr(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,n){e.translate(i,n),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,u=void 0;for(a=0;a<=r;a++)u=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(u),t.size/2+s*Math.sin(u))}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}(Gn),Er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Tr=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Er(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}(br),Pr=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Ir,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_=Ir,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Rr=null;function Fr(t,e){if(!Rr){var i=new wn({color:"rgba(255,255,255,0.4)"}),n=new Rn({color:"#3399CC",width:1.25});Rr=[new Pr({image:new Tr({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Rr}function Or(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[pt]=[new Pr({fill:new wn({color:[255,255,255,.5]})})],t[gt]=t[pt],t[ht]=[new Pr({stroke:new Rn({color:e,width:5})}),new Pr({stroke:new Rn({color:i,width:3})})],t[dt]=t[ht],t[vt]=t[pt].concat(t[ht]),t[lt]=[new Pr({image:new Tr({radius:6,fill:new wn({color:i}),stroke:new Rn({color:e,width:1.5})}),zIndex:1/0})],t[ft]=t[lt],t[_t]=t[pt].concat(t[ht],t[lt]),t}function Ir(t){return t.getGeometry()}var Ar="point",Mr="line",Lr=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_=Dn(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 wn({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Ar,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_=Dn(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}(),kr="opacity",Dr="visible",Gr="extent",jr="zIndex",Nr="maxResolution",zr="minResolution",Br="maxZoom",Ur="minZoom",Xr="source",Vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wr=function(t){function i(e){var i=t.call(this)||this,n=m({},e);return n[kr]=void 0!==e.opacity?e.opacity:1,it("number"==typeof n[kr],64),n[Dr]=void 0===e.visible||e.visible,n[jr]=e.zIndex,n[Nr]=void 0!==e.maxResolution?e.maxResolution:1/0,n[zr]=void 0!==e.minResolution?e.minResolution:0,n[Ur]=void 0!==e.minZoom?e.minZoom:-1/0,n[Br]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,i.setProperties(n),i.state_=null,i}return Vr(i,t),i.prototype.getClassName=function(){return this.className_},i.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=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!==i?i:!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},i.prototype.getLayersArray=function(t){return e()},i.prototype.getLayerStatesArray=function(t){return e()},i.prototype.getExtent=function(){return this.get(Gr)},i.prototype.getMaxResolution=function(){return this.get(Nr)},i.prototype.getMinResolution=function(){return this.get(zr)},i.prototype.getMinZoom=function(){return this.get(Ur)},i.prototype.getMaxZoom=function(){return this.get(Br)},i.prototype.getOpacity=function(){return this.get(kr)},i.prototype.getSourceState=function(){return e()},i.prototype.getVisible=function(){return this.get(Dr)},i.prototype.getZIndex=function(){return this.get(jr)},i.prototype.setExtent=function(t){this.set(Gr,t)},i.prototype.setMaxResolution=function(t){this.set(Nr,t)},i.prototype.setMinResolution=function(t){this.set(zr,t)},i.prototype.setMaxZoom=function(t){this.set(Br,t)},i.prototype.setMinZoom=function(t){this.set(Ur,t)},i.prototype.setOpacity=function(t){it("number"==typeof t,64),this.set(kr,t)},i.prototype.setVisible=function(t){this.set(Dr,t)},i.prototype.setZIndex=function(t){this.set(jr,t)},i.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},i}(K),Yr="undefined",Kr="loading",Zr="ready",Hr="error",qr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jr=function(t){function e(e){var i=this,n=m({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(H(Xr),i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return qr(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(Xr)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Yr},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 i=this.getRenderer();if(i.prepareFrame(t))return i.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,mn,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);it(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=N(this,E,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xr,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}(Wr);function Qr(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var $r=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),to="renderOrder",eo=function(t){function e(e){var i=this,n=e||{},r=m({},n);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(i=t.call(this,r)||this).declutter_=void 0!==n.declutter&&n.declutter,i.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(n.style),i.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,i.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,i}return $r(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(to)},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(to,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Fr,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;if(Array.isArray(t))i=t;else it("function"==typeof t.getZIndex,41),i=[t];e=function(){return i}}return e}(this.style_),this.changed()},e}(Jr),io=0,no=1,ro=2,oo=3,ao=4,so=5,uo=6,lo=7,ho=8,co=9,po=10,fo=11,go=12,_o=[ho],vo=[go],yo=[no],mo=[oo],xo=function(){function t(){}return t.prototype.drawCustom=function(t,e,i){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),So=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wo=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=r,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return So(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,i,n,r,o){var a=this.coordinates.length,s=this.getBufferedMaxExtent();o&&(e+=n);var u,l,h,c=t[e],p=t[e+1],f=this.tmpCoordinate_,d=!0;for(u=e+n;u<i;u+=n)f[0]=t[u],f[1]=t[u+1],(h=Ht(s,f))!==l?(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],l=h;return(r&&d||u===e+n)&&(this.coordinates[a++]=c,this.coordinates[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o){var s=i[o],u=this.appendFlatCoordinates(t,e,s,n,!1,!1);r.push(u),e=s}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var n,r,o,a,s,u=t.getType(),l=t.getStride(),h=this.coordinates.length;if(u==gt){n=t.getOrientedFlatCoordinates(),a=[];var c=t.getEndss();s=0;for(var p=0,f=c.length;p<f;++p){var d=[];s=this.drawCustomCoordinates_(n,s,c[p],l,d),a.push(d)}this.instructions.push([ao,h,a,t,i,Ki])}else u==pt||u==dt?(o=[],n=u==pt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),s=this.drawCustomCoordinates_(n,0,t.getEnds(),l,o),this.instructions.push([ao,h,o,t,i,Yi])):u==ht||u==ft?(n=t.getFlatCoordinates(),r=this.appendFlatCoordinates(n,0,n.length,l,!1,!1),this.instructions.push([ao,h,r,t,i,Wi])):u==lt&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([ao,h,r,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var i=t.getExtent();this.beginGeometryInstruction1_=[io,e,0,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[io,e,0,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,r=e.length,o=-1;for(t=0;t<r;++t)(n=(i=e[t])[0])==lo?o=t:n==io&&(i[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Wn(n||"#000")}else i.fillStyle=void 0;if(e){var r=e.getColor();i.strokeStyle=Wn(r||"#000");var o=e.getLineCap();i.lineCap=void 0!==o?o:"round";var a=e.getLineDash();i.lineDash=a?a.slice():ar;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var u=e.getLineJoin();i.lineJoin=void 0!==u?u:"round";var l=e.getWidth();i.lineWidth=void 0!==l?l:1;var h=e.getMiterLimit();i.miterLimit=void 0!==h?h:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[po,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[fo,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!g(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=u)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=u)},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=[lo,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Vt(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Xt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(xo),Co=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bo=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,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 Co(e,t),e.prototype.drawCoordinates_=function(t,e,i,n){return this.appendFlatCoordinates(t,e,i,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([uo,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([uo,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 i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([uo,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([uo,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 i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroups_=e,this.hitDetectionImage_=r,this.image_=o,this.height_=n[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_=n[0]},e}(wo),Eo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),To=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return Eo(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,n,!1,!1),a=[co,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([fo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],yo);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(vo),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([fo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],yo);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),u=0,l=0,h=o.length;l<h;++l)u=this.drawFlatCoordinates_(a,u,o[l],s);this.hitDetectionInstructions.push(vo),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(vo),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(vo),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(yo)},e}(wo),Po=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ro=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return Po(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var r=this.state,o=void 0!==r.fillStyle,a=void 0!==r.strokeStyle,s=i.length;this.instructions.push(yo),this.hitDetectionInstructions.push(yo);for(var u=0;u<s;++u){var l=i[u],h=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,n,!0,!a),p=[co,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(mo),this.hitDetectionInstructions.push(mo)),e=l}return o&&(this.instructions.push(_o),this.hitDetectionInstructions.push(_o)),a&&(this.instructions.push(vo),this.hitDetectionInstructions.push(vo)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([po,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([fo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,a,!1,!1);var u=[ro,s];this.instructions.push(yo,u),this.hitDetectionInstructions.push(yo,u),void 0!==i.fillStyle&&(this.instructions.push(_o),this.hitDetectionInstructions.push(_o)),void 0!==i.strokeStyle&&(this.instructions.push(vo),this.hitDetectionInstructions.push(vo)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([po,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([fo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.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 i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([po,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([fo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),u=0,l=0,h=o.length;l<h;++l)u=this.drawFlatCoordinatess_(a,u,o[l],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,n=0,r=i.length;n<r;++n)i[n]=Ui(i[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(wo);function Fo(t,e,i,n,r){var o,a,s,u,l,h,c,p,f,d=i,g=i,_=0,v=0,y=i;for(o=i;o<n;o+=r){var m=e[o],x=e[o+1];void 0!==u&&(p=m-u,f=x-l,s=Math.sqrt(p*p+f*f),void 0!==h&&(v+=a,Math.acos((h*p+c*f)/(a*s))>t&&(v>_&&(_=v,d=y,g=o),v=0,y=o-r)),a=s,h=p,c=f),u=m,l=x}return(v+=s)>_?[y,o]:[d,g]}var Oo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Io={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ao={Circle:Ro,Default:wo,Image:bo,LineString:To,Polygon:Ro,Text:function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,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 Oo(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o,a,s=this.coordinates.length,u=t.getType(),l=null,h=2,c=t.getStride();if(r.placement===Mr){if(!me(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(l=t.getFlatCoordinates(),u==ht)p=[l.length];else if(u==dt)p=t.getEnds();else if(u==pt)p=t.getEnds().slice(0,1);else if(u==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,v=0,y=p.length;v<y;++v){if(null==d){var m=Fo(r.maxAngle,l,g,p[v],c);g=m[0],_=m[1]}else _=p[v];for(o=g;o<_;o+=c)this.coordinates.push(l[o],l[o+1]);h=this.coordinates.length,g=p[v];var x=this.declutterGroups_?0===v?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(s,h,x),s=h}this.endGeometry(e)}else{var S=null;switch(r.overflow||(S=[]),u){case lt:case ft:h=(l=t.getFlatCoordinates()).length;break;case ht:l=t.getFlatMidpoint();break;case vt:l=t.getCenter();break;case dt:c=2,h=(l=t.getFlatMidpoints()).length;break;case pt:l=t.getFlatInteriorPoint(),r.overflow||S.push(l[2]/this.resolution),c=3;break;case gt:var w=t.getFlatInteriorPoints();for(l=[],o=0,a=w.length;o<a;o+=3)r.overflow||S.push(w[o+2]/this.resolution),l.push(w[o],w[o+1]);if(c=2,0==(h=l.length))return}h=this.appendFlatCoordinates(l,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!=sr&&(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([uo,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,C==sr?sr:C.map((function(t){return t*R})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,S]);var F=1/R;this.hitDetectionInstructions.push([uo,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_,S]),this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e,i){var n=this.textStrokeState_,r=this.textState_,o=this.strokeKey_,a=this.textKey_,s=this.fillKey_;this.saveTextStates_();var u=this.pixelRatio,l=Io[r.textBaseline],h=this.textOffsetY_*u,c=this.text_,p=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([so,t,e,l,i,r.overflow,s,r.maxAngle,u,h,o,p*u,c,a,1]),this.hitDetectionInstructions.push([so,t,e,l,i,r.overflow,s,r.maxAngle,1,h,o,p,c,a,1/u])},e.prototype.setTextStyle=function(t,e){var i,r,o;if(t){this.declutterGroups_=e;var a=t.getFill();a?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=Wn(a.getColor()||"#000")):(r=null,this.textFillState_=r);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var u=s.getLineDash(),l=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();o.lineCap=s.getLineCap()||"round",o.lineDash=u?u.slice():ar,o.lineDashOffset=void 0===l?0:l,o.lineJoin=s.getLineJoin()||"round",o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=Wn(s.getColor()||"#000")}else o=null,this.textStrokeState_=o;i=this.textState_;var p=t.getFont()||"10px sans-serif";dr(p);var f=t.getScaleArray();i.overflow=t.getOverflow(),i.font=p,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||sr,i.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),_=t.getRotateWithView(),v=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===v?0:v,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:n(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+n(r.fillStyle):""}else this.text_=""},e}(wo)},Mo=function(){function t(t,e,i,n,r){this.declutter_=r,this.declutterGroups_=null,this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,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 i=this.buildersByZIndex_[e];for(var n in i){var r=i[n].finish();t[e][n]=r}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);var r=n[e];void 0===r&&(r=new(0,Ao[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r);return r},t}(),Lo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ko=function(t){function i(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i}return Lo(i,t),i.prototype.getFeatures=function(t){return e()},i.prototype.prepareFrame=function(t){return e()},i.prototype.renderFrame=function(t,i){return e()},i.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},i.prototype.createLoadedTileFinder=function(t,e,i){return function(n,r){var o=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,r,o)}.bind(this)},i.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){},i.prototype.getDataAtPixel=function(t,i,n){return e()},i.prototype.getLayer=function(){return this.layer_},i.prototype.handleFontsChanged=function(){},i.prototype.handleImageChange_=function(t){t.target.getState()===In&&this.renderIfReadyAndVisible()},i.prototype.loadImage=function(t){var e=t.getState();return e!=In&&e!=An&&t.addEventListener(E,this.boundHandleImageChange_),e==Fn&&(t.load(),e=t.getState()),e==In},i.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Zr&&t.changed()},i}(X),Do=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Go=function(t){function e(e,i,n,r){var o=t.call(this,e)||this;return o.inversePixelTransform=i,o.frameState=n,o.context=r,o}return Do(e,t),e}(s),jo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),No=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return jo(e,t),e.prototype.useContainer=function(t,e,i){var n,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){(n=document.createElement("div")).className=o;var a=n.style;a.position="absolute",a.width="100%",a.height="100%";var s=(r=tr()).canvas;n.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=n,this.context=r}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,r=e.size[0]*n/2,o=e.size[1]*n/2,a=e.viewState.rotation,s=_e(i),u=ve(i),l=he(i),h=le(i);Rt(e.coordinateToPixelTransform,s),Rt(e.coordinateToPixelTransform,u),Rt(e.coordinateToPixelTransform,l),Rt(e.coordinateToPixelTransform,h),t.save(),mr(t,-a,r,o),t.beginPath(),t.moveTo(s[0]*n,s[1]*n),t.lineTo(u[0]*n,u[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.clip(),mr(t,a,r,o)},e.prototype.clipUnrotated=function(t,e,i){var n=_e(i),r=ve(i),o=he(i),a=le(i);Rt(e.coordinateToPixelTransform,n),Rt(e.coordinateToPixelTransform,r),Rt(e.coordinateToPixelTransform,o),Rt(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;Rt(s,n),Rt(s,r),Rt(s,o),Rt(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var r=new Go(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(vn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(yn,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,r,o,a){var s=r/2,u=o/2,l=n/e,h=-l,c=-t[0]+a,p=-t[1];return Ft(this.tempTransform,s,u,l,h,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,r=Rt(this.inversePixelTransform,t.slice()),o=this.context;try{var a=Math.round(r[0]),s=Math.round(r[1]),u=document.createElement("canvas"),l=u.getContext("2d");u.width=1,u.height=1,l.clearRect(0,0,1,1),l.drawImage(o.canvas,a,s,1,1,0,0,1,1),n=l.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(ko),zo="Circle",Bo="Default",Uo="Image",Xo="LineString",Vo="Polygon",Wo="Text";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Yo(t,e){return t(e={exports:{}},e.exports),e.exports}var Ko=Yo((function(t,e){t.exports=function(){function t(t,n,r,o,a){!function t(i,n,r,o,a){for(;o>r;){if(o-r>600){var s=o-r+1,u=n-r+1,l=Math.log(s),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(s-h)/s)*(u-s/2<0?-1:1),p=Math.max(r,Math.floor(n-u*h/s+c)),f=Math.min(o,Math.floor(n+(s-u)*h/s+c));t(i,n,p,f,a)}var d=i[n],g=r,_=o;for(e(i,r,n),a(i[o],d)>0&&e(i,r,o);g<_;){for(e(i,g,_),g++,_--;a(i[g],d)<0;)g++;for(;a(i[_],d)>0;)_--}0===a(i[r],d)?e(i,r,_):(_++,e(i,_,o)),_<=n&&(r=_+1),n<=_&&(o=_-1)}}(t,n,r||0,o||t.length-1,a||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return t<e?-1:t>e?1:0}var n=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,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,n,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<i;o++){var a=t.children[o];s(r,t.leaf?n(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 u(t,e){return t.minX-e.minX}function l(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,i,n,r,o){for(var a=[i,n];a.length;)if(!((n=a.pop())-(i=a.pop())<=r)){var s=i+Math.ceil((n-i)/r/2)*r;t(e,s,i,n,o),a.push(i,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!f(t,e))return i;for(var n=this.toBBox,r=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?n(a):a;f(t,s)&&(e.leaf?i.push(a):p(t,s)?this._all(a,i):r.push(a))}e=r.pop()}return i},n.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var i=[];e;){for(var n=0;n<e.children.length;n++){var r=e.children[n],o=e.leaf?this.toBBox(r):r;if(f(t,o)){if(e.leaf||p(t,o))return!0;i.push(r)}}e=i.pop()}return!1},n.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 i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=d([]),this},n.prototype.remove=function(t,e){if(!t)return this;for(var i,n,o,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],i=l.pop(),o=!0),a.leaf){var h=r(t,a.children,e);if(-1!==h)return a.children.splice(h,1),u.push(a),this._condense(u),this}o||a.leaf||!p(a,s)?n?(i++,a=n.children[i],o=!1):a=null:(u.push(a),l.push(i),i=0,n=a,a=a.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},n.prototype._build=function(t,e,i,n){var r,a=i-e+1,s=this._maxEntries;if(a<=s)return o(r=d(t.slice(e,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),(r=d([])).leaf=!1,r.height=n;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));g(t,e,i,l,this.compareMinX);for(var h=e;h<=i;h+=l){var c=Math.min(h+l-1,i);g(t,h,c,u,this.compareMinY);for(var p=h;p<=c;p+=u){var f=Math.min(p+u-1,c);r.children.push(this._build(t,p,f,n-1))}}return o(r,this.toBBox),r},n.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){for(var r=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var u=e.children[s],l=h(u),c=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);c<o?(o=c,r=l<r?l:r,a=u):c===o&&l<r&&(r=l,a=u)}e=a||e.children[0]}var p,f;return e},n.prototype._insert=function(t,e,i){var n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),s(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var a=this._chooseSplitIndex(i,r,n),s=d(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,o(i,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},n.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)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,r,o,s,u,l,c,p=1/0,f=1/0,d=e;d<=i-e;d++){var g=a(t,0,d,this.toBBox),_=a(t,d,i,this.toBBox),v=(r=g,o=_,s=void 0,u=void 0,l=void 0,c=void 0,s=Math.max(r.minX,o.minX),u=Math.max(r.minY,o.minY),l=Math.min(r.maxX,o.maxX),c=Math.min(r.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,c-u)),y=h(g)+h(_);v<p?(p=v,n=d,f=y<f?y:f):v===p&&y<f&&(f=y,n=d)}return n||i-e},n.prototype._chooseSplitAxis=function(t,e,i){var n=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);for(var r=this.toBBox,o=a(t,0,e,r),u=a(t,i-e,i,r),l=c(o)+c(u),h=e;h<i-e;h++){var p=t.children[h];s(o,t.leaf?r(p):p),l+=c(o)}for(var f=i-e-1;f>=e;f--){var d=t.children[f];s(u,t.leaf?r(d):d),l+=c(u)}return l},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)s(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},n}()}));function Zo(t,e,i,n,r,o,a,s,u,l,h,c){var p,f=[];if(c){var d=Ei(t,e,i,n,c,[t[e],t[e+1]]);p=d[0]>d[d.length-n]}else p=t[e]>t[i-n];for(var g,_,v=r.length,y=t[e],m=t[e+1],x=t[e+=n],S=t[e+1],w=0,C=Math.sqrt(Math.pow(x-y,2)+Math.pow(S-m,2)),b=!1,E=0;E<v;++E){for(var T=r[g=p?v-E-1:E],P=s*u(l,T,h),R=o+P/2;e<i-n&&w+C<R;)y=x,m=S,x=t[e+=n],S=t[e+1],w+=C,C=Math.sqrt(Math.pow(x-y,2)+Math.pow(S-m,2));var F=R-w,O=Math.atan2(S-m,x-y);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(y,x,A),L=Ie(m,S,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 Ho=[1/0,1/0,-1/0,-1/0],qo=[1,0,0,1,0,0],Jo=[],Qo=[],$o=[],ta=[],ea=function(){function t(t,e,i,n,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderBuffer_=r,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,n){var r=t+e+i+n;if(this.labels_[r])return this.labels_[r];var o=n?this.strokeStates[n]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],u=this.pixelRatio,l=[s.scale[0]*u,s.scale[1]*u],h=Io[s.textAlign||"center"],c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],g=function(t,e,i){for(var n=e.length,r=0,o=0;o<n;++o){var a=vr(t,e[o]);r=Math.max(r,a),i.push(a)}return r}(s.font,p,d),_=gr(s.font),v=g+c,y=[],m=(v+2)*l[0],x=(_*f+c)*l[1],S={width:m<0?Math.floor(m):Math.ceil(m),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(1==l[0]&&1==l[1]||y.push("scale",l),y.push("font",s.font),n)&&(y.push("strokeStyle",o.strokeStyle),y.push("lineWidth",c),y.push("lineCap",o.lineCap),y.push("lineJoin",o.lineJoin),y.push("miterLimit",o.miterLimit),(Jn?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[o.lineDash]),y.push("lineDashOffset",o.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var w,C=.5-h,b=h*v+C*c;if(n)for(w=0;w<f;++w)y.push("strokeText",[p[w],b+C*d[w],.5*(c+_)+w*_]);if(i)for(w=0;w<f;++w)y.push("fillText",[p[w],b+C*d[w],.5*(c+_)+w*_]);return this.labels_[r]=S,S},t.prototype.replayTextBackground_=function(t,e,i,n,r,o,a,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],s&&(t.fillStyle=o[1]),this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.replayImageOrLabel_=function(t,e,i,n,r,o,a,s,u,l,h,c,p,f,d,g,_,v,y){var m=v||y;i-=o*=f[0],n-=a*=f[1];var x=g+h>r.width?r.width-h:g,S=u+c>r.height?r.height-c:u,w=_[3]+x*f[0]+_[1],C=_[0]+S*f[1]+_[2],b=i-_[3],E=n-_[0];(m||0!==p)&&(Jo[0]=b,ta[0]=b,Jo[1]=E,Qo[1]=E,Qo[0]=b+w,$o[0]=Qo[0],$o[1]=E+C,ta[1]=$o[1]);var T=null;if(0!==p){var P=i+o,R=n+a;T=Ft(qo,P,R,1,1,p,-P,-R),Rt(qo,Jo),Rt(qo,Qo),Rt(qo,$o),Rt(qo,ta),Jt(Math.min(Jo[0],Qo[0],$o[0],ta[0]),Math.min(Jo[1],Qo[1],$o[1],ta[1]),Math.max(Jo[0],Qo[0],$o[0],ta[0]),Math.max(Jo[1],Qo[1],$o[1],ta[1]),Ho)}else Jt(b,E,b+w,E+C,Ho);var F=0,O=0;if(s){var I=this.renderBuffer_;I[0]=Math.max(I[0],ye(Ho)),F=I[0],I[1]=Math.max(I[1],de(Ho)),O=I[1]}var A=t.canvas,M=y?y[2]*f[0]/2:0,L=Ho[0]-M<=(A.width+F)/e&&Ho[2]+M>=-F/e&&Ho[1]-M<=(A.height+O)/e&&Ho[3]+M>=-O/e;if(d&&(i=Math.round(i),n=Math.round(n)),s){if(!L&&1==s[0])return!1;var k=L?[t,T?T.slice(0):null,l,r,h,c,x,S,i,n,f,Ho.slice()]:null;k&&(m&&k.push(v,y,Jo.slice(0),Qo.slice(0),$o.slice(0),ta.slice(0)),s.push(k))}else L&&(m&&this.replayTextBackground_(t,Jo,Qo,$o,ta,v,y,!1),xr(t,T,l,r,h,c,x,S,i,n,f));return!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Rt(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,i,n){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})}n||(n=new Ko(9));var u=!1;for(o=0,a=r.length;o<a;++o)if(n.collides(r[o])){u=!0;break}if(!u){n.load(r);for(var l=1,h=t.length;l<h;++l){var c,p=(c=t[l])[0],f=p.globalAlpha;f!==i&&(p.globalAlpha=i),c.length>12&&this.replayTextBackground_(c[0],c[14],c[15],c[16],c[17],c[12],c[13],!0),xr.apply(void 0,c),f!==i&&(p.globalAlpha=f)}}return t.length=1,n},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),a=this.strokeStates[i],s=this.pixelRatio,u=Io[r.textAlign||"center"],l=Io[r.textBaseline||"middle"],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:u*(o.width/s-2*r.scale[0])+2*(.5-u)*h,anchorY:l*o.height/s+2*(.5-l)*h}},t.prototype.execute_=function(t,e,i,n,r,o,a){var s,u,l;this.declutterItems.length=0,this.pixelCoordinates_&&g(i,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=bi(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),u=this.renderedTransform_,l=i,u[0]=l[0],u[1]=l[1],u[2]=l[2],u[3]=l[3],u[4]=l[4],u[5]=l[5]);for(var h,c,p,f,d,_,v,y,m,x,S,w,C,b,E,T,P,R=0,F=n.length,O=0,I=0,A=0,M=null,L=null,k=this.coordinateCache_,D=this.viewRotation_,G=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},N=this.instructions!=n||this.overlaps?0:200;R<F;){var z=n[R];switch(z[0]){case io:(E=z[1]).getGeometry()?void 0===a||me(a,z[3])?++R:R=z[2]+1:R=z[2];break;case no:I>N&&(this.fill_(t),I=0),A>N&&(t.stroke(),A=0),I||A||(t.beginPath(),f=NaN,d=NaN),++R;break;case ro:var B=s[O=z[1]],U=s[O+1],X=s[O+2]-B,V=s[O+3]-U,W=Math.sqrt(X*X+V*V);t.moveTo(B+W,U),t.arc(B,U,W,0,2*Math.PI,!0),++R;break;case oo:t.closePath(),++R;break;case ao:O=z[1],h=z[2];var Y=z[3],K=z[4],Z=6==z.length?z[5]:void 0;j.geometry=Y,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),K(H,j),++R;break;case uo: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],it=z[13],nt=z[14];if(!x&&z.length>=19){S=z[18],w=z[19],C=z[20],b=z[21];var rt=this.drawLabelWithPointPlacement_(S,w,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,nt=x.width,z[14]=nt}var st=void 0;z.length>24&&(st=z[24]);var ut=void 0,lt=void 0,ht=void 0;z.length>16?(ut=z[15],lt=z[16],ht=z[17]):(ut=sr,lt=!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++]<nt/this.pixelRatio)){if(m){var ft=Math.floor(pt);y=m.length<ft+1?[m[0][0]]:m[ft]}(It=this.replayImageOrLabel_(t,e,s[O],s[O+1],x,c,p,y,q,J,Q,$,et,it,r,nt,ut,lt?M:null,ht?L:null))&&y&&m[m.length-1]!==y&&m.push(y),y&&(y.length-1===y[0]&&this.declutterItems.push(this,y,E),pt+=1/y[0])}++R;break;case so:var dt=z[1],gt=z[2],_t=z[3];y=o?null:z[4];var vt=z[5];b=z[6];var yt=z[7],mt=z[8],xt=z[9];C=z[10];var St=z[11];S=z[12],w=z[13];var wt=[z[14],z[14]],Ct=this.textStates[w],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=En(s,dt,gt,2),Rt=Math.abs(Et[0])*yr(bt,S,Tt);if(vt||Rt<=Pt){var Ft=this.textStates[w].textAlign,Ot=Zo(s,dt,gt,2,S,(Pt-Rt)*Io[Ft],yt,Math.abs(Et[0]),yr,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,w,"",C),c=Dt[2]+St,p=_t*kt.height+2*(.5-_t)*St*Et[1]/Et[0]-xt,It=this.replayImageOrLabel_(t,e,Dt[0],Dt[1],kt,c,p,y,kt.height,1,0,0,Dt[3],wt,!1,kt.width,sr,null,null)||It;if(b)for(At=0,Mt=Ot.length;At<Mt;++At)Lt=(Dt=Ot[At])[4],kt=this.createLabel(Lt,w,b,""),c=Dt[2],p=_t*kt.height-xt,It=this.replayImageOrLabel_(t,e,Dt[0],Dt[1],kt,c,p,y,kt.height,1,0,0,Dt[3],wt,!1,kt.width,sr,null,null)||It;It&&this.declutterItems.push(this,y,E)}}++R;break;case lo:if(void 0!==o){var Gt=o(E=z[1]);if(Gt)return Gt}++R;break;case ho:N?I++:this.fill_(t),++R;break;case co:for(O=z[1],h=z[2],T=s[O],v=(P=s[O+1])+.5|0,(_=T+.5|0)===f&&v===d||(t.moveTo(T,P),f=_,d=v),O+=2;O<h;O+=2)_=(T=s[O])+.5|0,v=(P=s[O+1])+.5|0,O!=h-2&&_===f&&v===d||(t.lineTo(T,P),f=_,d=v);++R;break;case po:M=z,this.alignFill_=z[2],I&&(this.fill_(t),I=0,A&&(t.stroke(),A=0)),t.fillStyle=z[1],++R;break;case fo:L=z,A&&(t.stroke(),A=0),this.setStrokeStyle_(t,z),++R;break;case go:N?A++:t.stroke(),++R;break;default:++R}}I&&this.fill_(t),A&&t.stroke()},t.prototype.execute=function(t,e,i,n,r){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,r,void 0,void 0)},t.prototype.executeHitDetection=function(t,e,i,n,r){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,r)},t}(),ia=[Vo,zo,Xo,Uo,Wo,Bo],na=function(){function t(t,e,i,n,r,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var n=t[e],r=[this.renderBuffer_||0,this.renderBuffer_||0];for(var o in n){var a=n[o];i[o]=new ea(this.resolution_,this.pixelRatio_,this.overlaps_,a,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],n=0,r=t.length;n<r;++n)if(t[n]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o){var a=2*(n=Math.round(n))+1,s=Ft(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=tr(a,a));var u,l=this.hitDetectionContext_;l.canvas.width!==a||l.canvas.height!==a?(l.canvas.width=a,l.canvas.height=a):l.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(re(u=[1/0,1/0,-1/0,-1/0],t),Xt(u,e*(this.renderBuffer_+n),u));var c,p=function(t){if(void 0!==ra[t])return ra[t];for(var e=2*t+1,i=new Array(e),n=0;n<e;n++)i[n]=new Array(e);var r=t,o=0,a=0;for(;r>=o;)oa(i,t+r,t+o),oa(i,t+o,t+r),oa(i,t-o,t+r),oa(i,t-r,t+o),oa(i,t-r,t-o),oa(i,t-o,t-r),oa(i,t+o,t-r),oa(i,t+r,t-o),o++,2*((a+=1+2*o)-r)+1>0&&(a+=1-2*(r-=1));return ra[t]=i,i}(n);function f(t){for(var e=l.getImageData(0,0,a,a).data,i=0;i<a;i++)for(var n=0;n<a;n++)if(p[i][n]&&e[4*(n*a+i)+3]>0){var s=void 0;return(!o||c!=Uo&&c!=Wo||-1!==o.indexOf(t))&&(s=r(t)),s||void l.clearRect(0,0,a,a)}}var d,g,_,v,y,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=ia.length-1;g>=0;--g)if(void 0!==(v=_[c=ia[g]])&&(y=v.executeHitDetection(l,s,i,f,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],a=[i,n,i,o,r,o,r,n];return bi(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return w(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(h),this.maxExtent_&&(t.save(),this.clip(t,i));var u,l,c,p,f,d,g=o||ia;for(u=0,l=s.length;u<l;++u){var _=s[u].toString();for(f=this.executorsByZIndex_[_],c=0,p=g.length;c<p;++c){var v=g[c];if(void 0!==(d=f[v]))if(!a||v!=Uo&&v!=Wo)d.execute(t,e,i,n,r);else{var y=a[_];y?y.push(d,i.slice(0)):a[_]=[d,i.slice(0)]}}}this.maxExtent_&&t.restore()},t}(),ra={0:[[!0]]};function oa(t,e,i){var n,r=Math.floor(t.length/2);if(e>=r)for(n=r;n<e;n++)t[n][i]=!0;else if(e<r)for(n=e+1;n<r;n++)t[n][i]=!0}var aa=0,sa=1,ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),la=function(t){function e(e,i,n,r,o,a,s){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=i,u.extent_=n,u.transform_=r,u.viewRotation_=o,u.squaredTolerance_=a,u.userTransform_=s,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return ua(e,t),e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var r=bi(t,e,i,2,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,h=r.length;l<h;l+=2){var c=r[l]-this.imageAnchorX_,p=r[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;Ft(a,f,d,1,1,u,-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,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var r=bi(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=n){var s=r[e]+this.textOffsetX_,u=r[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var l=Ft(this.tmpLocalTransform_,s,u,1,1,a,-s,-u);o.setTransform.apply(o,l),o.translate(s,u),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,u),this.textFillState_&&o.fillText(this.text_,s,u)}}},e.prototype.moveToLineTo_=function(t,e,i,n,r){var o=this.context_,a=bi(t,e,i,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;r&&(s-=2);for(var u=2;u<s;u+=2)o.lineTo(a[u],a[u+1]);return r&&o.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var r=0,o=i.length;r<o;++r)e=this.moveToLineTo_(t,e,i[r],n,!0);return e},e.prototype.drawCircle=function(t){if(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,i){var n=t.getFlatCoordinates();if(n){var r=t.getStride();return bi(n,0,n.length,r,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],r=Math.sqrt(i*i+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case lt: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 vt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&me(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),me(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(me(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),r=0,o=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,u=o.length;s<u;++s)r=this.moveToLineTo_(n,r,o[s],a,!1);i.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.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 i=t.getFlatInteriorPoint();this.drawText_(i,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_,i=t.getOrientedFlatCoordinates(),n=0,r=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=r.length;a<s;++a){var u=r[a];n=this.drawRings_(i,n,u,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:Wn(i||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),s=e.getLineJoin(),u=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:o||ar,lineDashOffset:a||0,lineJoin:void 0!==s?s:"round",lineWidth:this.pixelRatio_*(void 0!==u?u:1),miterLimit:void 0!==l?l:10,strokeStyle:Wn(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getSize();if(e){var i=t.getAnchor(),n=t.getImage(1),r=t.getOrigin(),o=t.getScaleArray();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=e[1],this.image_=n,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 i=e.getColor();this.textFillState_={fillStyle:Wn(i||"#000")}}else this.textFillState_=null;var n=t.getStroke();if(n){var r=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),u=n.getLineJoin(),l=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:a||ar,lineDashOffset:s||0,lineJoin:void 0!==u?u:"round",lineWidth:void 0!==l?l:1,miterLimit:void 0!==h?h:10,strokeStyle:Wn(r||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),_=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==v?v:"",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}(xo),ha="fraction",ca="pixels",pa="bottom-left",fa="bottom-right",da="top-left",ga="top-right";function _a(t,e,i){return e+":"+t+":"+(i?function(t){return"string"==typeof t?t:Vn(t)}(i):"null")}var va=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 i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=_a(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=_a(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),ya=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ma=function(t){function i(e,i,n,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=i,o.state=r,o}return ya(i,t),i.prototype.changed=function(){this.dispatchEvent(E)},i.prototype.getExtent=function(){return this.extent},i.prototype.getImage=function(){return e()},i.prototype.getPixelRatio=function(){return this.pixelRatio_},i.prototype.getResolution=function(){return this.resolution},i.prototype.getState=function(){return this.state},i.prototype.load=function(){e()},i}(b),xa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sa=function(t){function e(e,i,n,r,o,a){var s=t.call(this,e,i,n,Fn)||this;return s.src_=r,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=Fn,s.imageLoadFunction_=a,s}return xa(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=An,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=de(this.extent)/this.image_.height),this.state=In,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Fn&&this.state!=An||(this.state=On,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=wa(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)},e}(ma);function wa(t,e,i){var n=t;if(n.src&&Qn){var r=n.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var a=[z(n,k,e),z(n,T,i)];return function(){a.forEach(B)}}var Ca=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ba=null,Ea=function(t){function e(e,i,n,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_=n,s.src_=i,s.tainted_,s}return Ca(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===In){ba||(ba=tr(1,1)),ba.drawImage(this.image_,0,0);try{ba.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ba=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(E)},e.prototype.handleImageError_=function(){this.imageState_=An,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=In,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],i=tr(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.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_==Fn){this.imageState_=On;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=wa(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 i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),this.isTainted_()){var n=this.color_;return i.globalCompositeOperation="multiply",i.fillStyle="rgb("+n[0]+","+n[1]+","+n[2]+")",i.fillRect(0,0,e.width,e.height),i.globalCompositeOperation="destination-in",void i.drawImage(this.image_,0,0)}for(var r=i.getImageData(0,0,e.width,e.height),o=r.data,a=this.color_[0]/255,s=this.color_[1]/255,u=this.color_[2]/255,l=0,h=o.length;l<h;l+=4)o[l]*=a,o[l+1]*=s,o[l+2]*=u;i.putImageData(r,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(b);var Ta=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pa=function(t){function e(e){var i=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,u=void 0!==r.rotateWithView&&r.rotateWithView;(i=t.call(this,{opacity:o,rotation:a,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:u})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:da,i.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:ha,i.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:ha,i.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var l=void 0!==r.img?r.img:null,h=void 0!==r.imgSize?r.imgSize:null,c=r.src;it(!(void 0!==c&&l),4),it(!l||l&&h,5),void 0!==c&&0!==c.length||!l||(c=l.src||n(l)),it(void 0!==c&&c.length>0,6);var p=void 0!==r.src?Fn:In;return i.color_=void 0!==r.color?Un(r.color):null,i.iconImage_=function(t,e,i,n,r,o){var a=va.get(e,n,o);return a||(a=new Ea(t,e,i,n,r,o),va.set(e,n,o,a)),a}(l,c,h,i.crossOrigin_,p,i.color_),i.offset_=void 0!==r.offset?r.offset:[0,0],i.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:da,i.origin_=null,i.size_=void 0!==r.size?r.size:null,i}return Ta(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_==ha||this.anchorYUnits_==ha){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ha&&(t[0]*=e[0]),this.anchorYUnits_==ha&&(t[1]*=e[1])}if(this.anchorOrigin_!=da){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ga&&this.anchorOrigin_!=fa||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=pa&&this.anchorOrigin_!=fa||(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_!=da){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=ga&&this.offsetOrigin_!=fa||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=pa&&this.offsetOrigin_!=fa||(t[1]=n[1]-i[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}(Gn);var Ra={Point:function(t,e,i,n){var r=i.getImage();if(r){if(r.getImageState()!=In)return;var o=t.getBuilder(i.getZIndex(),Uo);o.setImageStyle(r,t.addDeclutter(!1)),o.drawPoint(e,n)}var a=i.getText();if(a){var s=t.getBuilder(i.getZIndex(),Wo);s.setTextStyle(a,t.addDeclutter(!!r)),s.drawText(e,n)}},LineString:function(t,e,i,n){var r=i.getStroke();if(r){var o=t.getBuilder(i.getZIndex(),Xo);o.setFillStrokeStyle(null,r),o.drawLineString(e,n)}var a=i.getText();if(a){var s=t.getBuilder(i.getZIndex(),Wo);s.setTextStyle(a,t.addDeclutter(!1)),s.drawText(e,n)}},Polygon:function(t,e,i,n){var r=i.getFill(),o=i.getStroke();if(r||o){var a=t.getBuilder(i.getZIndex(),Vo);a.setFillStrokeStyle(r,o),a.drawPolygon(e,n)}var s=i.getText();if(s){var u=t.getBuilder(i.getZIndex(),Wo);u.setTextStyle(s,t.addDeclutter(!1)),u.drawText(e,n)}},MultiPoint:function(t,e,i,n){var r=i.getImage();if(r){if(r.getImageState()!=In)return;var o=t.getBuilder(i.getZIndex(),Uo);o.setImageStyle(r,t.addDeclutter(!1)),o.drawMultiPoint(e,n)}var a=i.getText();if(a){var s=t.getBuilder(i.getZIndex(),Wo);s.setTextStyle(a,t.addDeclutter(!!r)),s.drawText(e,n)}},MultiLineString:function(t,e,i,n){var r=i.getStroke();if(r){var o=t.getBuilder(i.getZIndex(),Xo);o.setFillStrokeStyle(null,r),o.drawMultiLineString(e,n)}var a=i.getText();if(a){var s=t.getBuilder(i.getZIndex(),Wo);s.setTextStyle(a,t.addDeclutter(!1)),s.drawText(e,n)}},MultiPolygon:function(t,e,i,n){var r=i.getFill(),o=i.getStroke();if(o||r){var a=t.getBuilder(i.getZIndex(),Vo);a.setFillStrokeStyle(r,o),a.drawMultiPolygon(e,n)}var s=i.getText();if(s){var u=t.getBuilder(i.getZIndex(),Wo);u.setTextStyle(s,t.addDeclutter(!1)),u.drawText(e,n)}},GeometryCollection:function(t,e,i,n){var r,o,a=e.getGeometriesArray();for(r=0,o=a.length;r<o;++r){(0,Ra[a[r].getType()])(t,a[r],i,n)}},Circle:function(t,e,i,n){var r=i.getFill(),o=i.getStroke();if(r||o){var a=t.getBuilder(i.getZIndex(),zo);a.setFillStrokeStyle(r,o),a.drawCircle(e,n)}var s=i.getText();if(s){var u=t.getBuilder(i.getZIndex(),Wo);u.setTextStyle(s,t.addDeclutter(!1)),u.drawText(e,n)}}};function Fa(t,e){return parseInt(n(t),10)-parseInt(n(e),10)}function Oa(t,e){return.5*t/e}function Ia(t,e,i,n,r,o){var a=!1,s=i.getImage();if(s){var u=s.getImageState();u==In||u==An?s.unlistenImageChange(r):(u==Fn&&s.load(),u=s.getImageState(),s.listenImageChange(r),a=!0)}return function(t,e,i,n,r){var o=i.getGeometryFunction()(e);if(!o)return;var a=o.simplifyTransformed(n,r);if(i.getRenderer())!function t(e,i,n,r){if(i.getType()==_t){for(var o=i.getGeometries(),a=0,s=o.length;a<s;++a)t(e,o[a],n,r);return}e.getBuilder(n.getZIndex(),Bo).drawCustom(i,r,n.getRenderer())}(t,a,i,e);else{(0,Ra[a.getType()])(t,a,i,e)}}(t,e,i,n,o),a}var Aa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ma=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.clipping=!0,i}return Aa(e,t),e.prototype.useContainer=function(e,i,n){n<1&&(e=null),t.prototype.useContainer.call(this,e,i,n)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,i){Pt(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),Ot(this.inversePixelTransform,this.pixelTransform);var r=It(this.pixelTransform);this.useContainer(e,r,n.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 u=Math.round(t.size[0]*i),l=Math.round(t.size[1]*i);a.width!=u||a.height!=l?(a.width=u,a.height=l,a.style.transform!==r&&(a.style.transform=r)):this.containerReused||o.clearRect(0,0,u,l),this.preRender(o,t);var c=t.extent,p=t.viewState,f=p.center,d=p.resolution,g=p.projection,_=p.rotation,v=g.getExtent(),y=this.getLayer().getSource(),m=!1;if(n.extent&&this.clipping){var x=Ci(n.extent);(m=!Kt(x,t.extent)&&me(x,t.extent))&&this.clipUnrotated(o,t,x)}var S=t.viewHints,w=!(S[aa]||S[sa]),C=this.getRenderTransform(f,d,_,i,u,l,0),b=this.getLayer().getDeclutter()?{}:null;if(s.execute(o,1,C,_,w,void 0,b),y.getWrapX()&&g.canWrapX()&&!Kt(v,c)){for(var E=c[0],T=ye(v),P=0,R=void 0;E<v[0];){R=T*--P;var F=this.getRenderTransform(f,d,_,i,u,l,R);s.execute(o,1,F,_,w,void 0,b),E+=T}for(P=0,E=c[2];E>v[2];){R=T*++P;var O=this.getRenderTransform(f,d,_,i,u,l,R);s.execute(o,1,O,_,w,void 0,b),E-=T}}if(b){var I=t.viewHints;!function(t,e,i,n,r,o){for(var a=Object.keys(t).map(Number).sort(h),s=0,u=a.length;s<u;++s)for(var l=t[a[s].toString()],c=void 0,p=0,f=l.length;p<f;){var d=l[p++],g=l[p++];d.execute(e,1,g,i,r),d!==c&&d.declutterItems.length>0&&(c=d,o.push({items:d.declutterItems,opacity:n}))}}(b,o,_,1,!(I[aa]||I[sa]),t.declutterItems)}m&&o.restore(),this.postRender(o,t);var A=n.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,i){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];Rt(this.pixelTransform,n);var r=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,s=this.renderedProjection_,u=this.renderedExtent_,l=this.getLayer(),c=[],p=n[0]/2,f=n[1]/2;c.push(this.getRenderTransform(r,o,a,.5,p,f,0).slice());var d=l.getSource(),g=s.getExtent();if(d.getWrapX()&&s.canWrapX()&&!Kt(g,u)){for(var _=u[0],v=ye(g),y=0,m=void 0;_<g[0];)m=v*--y,c.push(this.getRenderTransform(r,o,a,.5,p,f,m).slice()),_+=v;for(y=0,_=u[2];_>g[2];)m=v*++y,c.push(this.getRenderTransform(r,o,a,.5,p,f,m).slice()),_-=v}this.hitDetectionImageData_=function(t,e,i,n,r,o,a){var s=tr(t[0]/2,t[1]/2);s.imageSmoothingEnabled=!1;for(var u=s.canvas,l=new la(s,.5,r,null,a),c=i.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var g=i[d-1],_=g.getStyleFunction()||n;if(n){var v=_(g,o);if(v){Array.isArray(v)||(v=[v]);for(var y="#"+("000000"+(d*p).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var S=v[m],w=S.clone(),C=w.getFill();C&&C.setColor(y);var b=w.getStroke();b&&b.setColor(y),w.setText(void 0);var E=S.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=y;var F=R.canvas;R.fillRect(0,0,F.width,F.height),tr(T?T[0]:F.width,T?T[1]:F.height).drawImage(F,0,0),w.setImage(new Pa({img:F,imgSize:T,anchor:E.getAnchor(),anchorXUnits:ca,anchorYUnits:ca,offset:E.getOrigin(),size:E.getSize(),opacity:E.getOpacity(),scale:E.getScale(),rotation:E.getRotation(),rotateWithView:E.getRotateWithView()}))}var O=Number(w.getZIndex());(L=f[O])||(L={},f[O]=L,L[pt]=[],L[vt]=[],L[ht]=[],L[lt]=[]);var I=w.getGeometryFunction()(g);I&&me(r,I.getExtent())&&L[I.getType().replace("Multi","")].push(I,w)}}}}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){l.setStyle(D[m+1]);for(var G=0,j=e.length;G<j;++G)l.setTransform(e[G]),l.drawGeometry(D[m])}}}return s.getImageData(0,0,u.width,u.height)}(n,c,this.renderedFeatures_,l.getStyleFunction(),u,o,a)}e(function(t,e,i){var n=[];if(i){var r=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*i.width),o=i.data[r],a=i.data[r+1],s=i.data[r+2]+256*(a+256*o),u=Math.floor(16777215/e.length);s&&s%u==0&&n.push(e[s/u-1])}return n}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,o){if(this.replayGroup_){var a=e.viewState.resolution,s=e.viewState.rotation,u=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,a,s,i,(function(t){var e=n(t);if(!(e in l))return l[e]=!0,r(t,u)}),u.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(),i=e.getSource();if(!i)return!1;var n=t.viewHints[aa],r=t.viewHints[sa],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,u=t.viewState,l=u.projection,h=u.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Fa);var g=u.center.slice(),_=Xt(s,f*h),v=[_.slice()],y=l.getExtent();if(i.getWrapX()&&l.canWrapX()&&!Kt(y,t.extent)){var m=ye(y),x=Math.max(ye(_)/2,m);_[0]=y[0]-x,_[2]=y[2]+x,oi(g,l);var S=function(t,e){var i=e.getExtent(),n=ce(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){var r=ye(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}(v[0],l);S[0]<y[0]&&S[2]<y[2]?v.push([S[0]+m,S[1],S[2]+m,S[3]]):S[0]>y[0]&&S[2]>y[2]&&v.push([S[0]-m,S[1],S[2]-m,S[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&Kt(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;for(var w=new Mo(Oa(h,c),_,h,c,e.getDeclutter()),C=0,b=v.length;C<b;++C)i.loadFeatures(v[C],h,l);var E=function(t,e){var i=Oa(t,e);return i*i}(h,c),T=function(t){var i,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,h)),i){var r=this.renderFeature(t,E,i,w,void 0);this.dirty_=this.dirty_||r}}.bind(this),P=wi(_),R=i.getFeaturesInExtent(P);d&&R.sort(d);for(C=0,b=R.length;C<b;++C)T(R[C]);this.renderedFeatures_=R;var F=w.finish(),O=new na(_,h,c,i.getOverlaps(),F,e.getRenderBuffer());return this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=_,this.renderedCenter_=g,this.renderedProjection_=l,this.replayGroup_=O,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,r){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)o=Ia(n,t,i[a],e,this.boundHandleStyleImageChange_,r)||o;else o=Ia(n,t,i,e,this.boundHandleStyleImageChange_,r);return o},e}(No),La=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ka=function(t){function e(e){return t.call(this,e)||this}return La(e,t),e.prototype.createRenderer=function(){return new Ma(this)},e}(eo),Da=function(){function t(t){this.rbush_=new Ko(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[n(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),r=0,o=e.length;r<o;r++){var a=t[r],s=e[r],u={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};i[r]=u,this.items_[n(s)]=u}this.rbush_.load(i)},t.prototype.remove=function(t){var e=n(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[n(e)];ie([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,n=0,r=t.length;n<r;n++)if(i=e(t[n]))return i;return i},t.prototype.isEmpty=function(){return w(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}(),Ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ja=function(t){function i(e){var i=t.call(this)||this;return i.projection_=li(e.projection),i.attributions_=Na(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Zr,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return Ga(i,t),i.prototype.getAttributions=function(){return this.attributions_},i.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},i.prototype.getProjection=function(){return this.projection_},i.prototype.getResolutions=function(){return e()},i.prototype.getState=function(){return this.state_},i.prototype.getWrapX=function(){return this.wrapX_},i.prototype.getContextOptions=function(){},i.prototype.refresh=function(){this.changed()},i.prototype.setAttributions=function(t){this.attributions_=Na(t),this.changed()},i.prototype.setState=function(t){this.state_=t,this.changed()},i}(K);function Na(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var za="addfeature",Ba="changefeature",Ua="clear",Xa="removefeature";function Va(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Wa="arraybuffer",Ya="json",Ka="text",Za="xml";function Ha(t,e){return function(t,e,i,n){return function(r,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(r,o,a):t,!0),e.getType()==Wa&&(s.responseType="arraybuffer"),s.withCredentials=!1,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),u=void 0;o==Ya||o==Ka?u=s.responseText:o==Za?(u=s.responseXML)||(u=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==Wa&&(u=s.response),u?i.call(this,e.readFeatures(u,{extent:r,featureProjection:a}),e.readProjection(u)):n.call(this)}else n.call(this)}.bind(this),s.onerror=function(){n.call(this)}.bind(this),s.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),y)}var qa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ja=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return qa(e,t),e}(s),Qa=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Zr,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=y,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(it(i.format_,7),i.loader_=Ha(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:Va;var r,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=a?new Da:null,i.loadedExtentsRtree_=new Da,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(r=n.features).getArray()),a||void 0!==r||(r=new et(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==r&&i.bindFeaturesCollection_(r),i}return qa(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=n(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ja(za,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,u,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(it(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],r=[],o=0,a=t.length;o<a;o++){var s=n(l=t[o]);this.addToIndex_(s,l)&&i.push(l)}o=0;for(var u=i.length;o<u;o++){var l;s=n(l=i[o]);this.setupChangeEvents_(s,l);var h=l.getGeometry();if(h){var c=h.getExtent();e.push(c),r.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,r);o=0;for(var p=i.length;o<p;o++)this.dispatchEvent(new Ja(za,i[o]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(za,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Xa,(function(i){e||(e=!0,t.remove(i.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 i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var n=new Ja(Ua);this.dispatchEvent(n),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var n=e(i);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),w(this.nullGeometryFeatures_)||d(t,S(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 i=t[0],n=t[1],r=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],u=e||_;return this.featuresRtree_.forEachInExtent(s,(function(t){if(u(t)){var e=t.getGeometry(),l=a;if((a=e.closestPointXY(i,n,o,a))<l){r=t;var h=Math.sqrt(a);s[0]=i-h,s[1]=n-h,s[2]=i+h,s[3]=n+h}}})),r},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=n(e),r=e.getGeometry();if(r){var o=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=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_[i]=e;this.changed(),this.dispatchEvent(new Ja(Ba,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:n(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&w(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){var n=this.loadedExtentsRtree_,r=this.strategy_(t,e);this.loading=!1;for(var o=function(t,o){var s=r[t];n.forEachInExtent(s,(function(t){return Kt(t.extent,s)}))||(a.loader_.call(a,s,e,i),n.insert(s,{extent:s.slice()}),a.loading=a.loader_!==y)},a=this,s=0,u=r.length;s<u;++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,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(ie(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=n(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=n(t);this.featureChangeKeys_[e].forEach(B),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ja(Xa,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){it(this.format_,7),this.setLoader(Ha(t,this.format_))},e}(ja);var $a=0,ts=1,es=2,is=3,ns=4;function rs(t){return Math.pow(t,3)}function os(t){return 1-rs(1-t)}function as(t){return 3*t*t-2*t*t*t}function ss(t){return t}var us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ls=function(t){function i(e,i,n){var r=t.call(this)||this,o=n||{};return r.tileCoord=e,r.state=i,r.interimTile=null,r.hifi=!0,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return us(i,t),i.prototype.changed=function(){this.dispatchEvent(E)},i.prototype.release=function(){},i.prototype.getKey=function(){return this.key+"/"+this.tileCoord},i.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==es)return this.transition_=0,t;t=t.interimTile}while(t);return this},i.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==es){t.interimTile=null;break}t.getState()==ts?e=t:t.getState()==$a?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},i.prototype.getTileCoord=function(){return this.tileCoord},i.prototype.getState=function(){return this.state},i.prototype.setState=function(t){if(this.state!==is&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},i.prototype.load=function(){e()},i.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:rs(n/this.transition_)},i.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},i.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},i}(b),hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cs=function(t){function e(e,i,n,r,o,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=r,s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.tileLoadFunction_=o,s}return hs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=is,this.unlistenImage_(),this.image_=((t=tr(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=es:this.state=ns,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==is&&(this.state=$a,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==$a&&(this.state=ts,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=wa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(ls);var ps=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),fs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ds=function(t){function i(e){var i=t.call(this)||this;return i.map_=e,i.declutterTree_=null,i}return fs(i,t),i.prototype.dispatchRenderEvent=function(t,i){e()},i.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ft(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ot(n,i)},i.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o,a,s){var u,l=e.viewState;function h(t,e,i){return r.call(o,e,t?i:null)}var c=l.projection,p=oi(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=ye(c.getExtent());f.push([-d,0],[d,0])}var g,_=e.layerStatesArray,v=_.length;this.declutterTree_&&(g=this.declutterTree_.all().map((function(t){return t.value})));for(var y=[],m=0;m<f.length;m++)for(var x=v-1;x>=0;--x){var S=_[x],w=S.layer;if(w.hasRenderer()&&Qr(S,l)&&a.call(s,w)){var C=w.getRenderer(),b=w.getSource();if(C&&b){var E=b.getWrapX()?p:t,T=h.bind(null,S.managed);y[0]=E[0]+f[m][0],y[1]=E[1]+f[m][1],u=C.forEachFeatureAtCoordinate(y,e,i,T,g)}if(u)return u}}},i.prototype.forEachLayerAtPixel=function(t,i,n,r,o){return e()},i.prototype.hasFeatureAtCoordinate=function(t,e,i,n,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,_,this,r,o)},i.prototype.getMap=function(){return this.map_},i.prototype.renderFrame=function(t){this.declutterTree_=function(t,e){e&&e.clear();for(var i=t.declutterItems,n=i.length-1;n>=0;--n)for(var r=i[n],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 i.length=0,e}(t,this.declutterTree_)},i.prototype.scheduleExpireIconCache=function(t){va.canExpireCache()&&t.postRenderFunctions.push(gs)},i}(l);function gs(t,e){va.expire()}var _s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vs=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=N(ur,u,e.redrawText.bind(e)),i.element_=document.createElement("div");var n=i.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",i.element_.className="ol-unselectable ol-layers";var r=e.getViewport();return r.insertBefore(i.element_,r.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return _s(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var n=new Go(t,void 0,e);i.dispatchEvent(n)}},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(mn,e);var i=e.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=e.viewState;this.children_.length=0;for(var r=null,o=0,a=i.length;o<a;++o){var s=i[o];if(e.layerIndex=o,Qr(s,n)&&(s.sourceState==Zr||s.sourceState==Yr)){var u=s.layer.render(e,r);u&&u!==r&&(this.children_.push(u),r=u)}}t.prototype.renderFrame.call(this,e),function(t,e){for(var i=t.childNodes,n=0;;++n){var r=i[n],o=e[n];if(!r&&!o)break;r!==o&&(r?o?t.insertBefore(o,r):(t.removeChild(r),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(xn,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,i,n,r){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var u=a[s],l=u.layer;if(l.hasRenderer()&&Qr(u,o)&&r(l)){var h=l.getRenderer().getDataAtPixel(t,e,i);if(h){var c=n(l,h);if(c)return c}}}},e}(ds),ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ms="layers",xs=function(t){function e(e){var i=this,n=e||{},r=m({},n);delete r.layers;var o=n.layers;return(i=t.call(this,r)||this).layersListenerKeys_=[],i.listenerKeys_={},i.addEventListener(H(ms),i.handleLayersChanged_),o?Array.isArray(o)?o=new et(o.slice(),{unique:!0}):it("function"==typeof o.getArray,43):o=new et(void 0,{unique:!0}),i.setLayers(o),i}return ys(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 i=t.getArray(),r=0,o=i.length;r<o;r++){var a=i[r];this.listenerKeys_[n(a)]=[N(a,u,this.handleLayerChange_,this),N(a,E,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[n(e)]=[N(e,u,this.handleLayerChange_,this),N(e,E,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=n(t.element);this.listenerKeys_[e].forEach(B),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(ms)},e.prototype.setLayers=function(t){this.set(ms,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));for(var n=this.getLayerState(),r=i,o=e.length;r<o;r++){var a=e[r];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=ge(a.extent,n.extent):a.extent=n.extent)}return e},e.prototype.getSourceState=function(){return Zr},e}(Wr),Ss=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ws=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.map=i,r.frameState=void 0!==n?n:null,r}return Ss(e,t),e}(s),Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bs=function(t){function e(e,i,n,r,o){var a=t.call(this,e,i,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==r&&r,a}return Cs(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}(ws),Es={SINGLECLICK:"singleclick",CLICK:R,DBLCLICK:F,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ts="pointermove",Ps="pointerdown",Rs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fs=function(t){function e(e,i){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=i?i*qn:qn,n.down_=null;var r=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=r,n.pointerdownListenerKey_=N(r,Ps,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=N(r,Ts,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(G,n.boundHandleTouchMove_,!!$n&&{passive:!1}),n}return Rs(e,t),e.prototype.emulateClick_=function(t){var e=new bs(Es.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new bs(Es.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new bs(Es.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Es.POINTERUP||e.type==Es.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Es.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new bs(Es.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 bs(Es.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.dragListenerKeys_.push(N(document,Es.POINTERMOVE,this.handlePointerMove_,this),N(document,Es.POINTERUP,this.handlePointerUp_,this),N(this.element_,Es.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==document&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),Es.POINTERUP,this.handlePointerUp_,this)))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new bs(Es.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 bs(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),Os="postrender",Is="movestart",As="moveend",Ms="layergroup",Ls="size",ks="target",Ds="view",Gs=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_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){it(!(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_,i=this.priorities_,n=e.length,r=e[t],o=i[t],a=t;t<n>>1;){var s=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=u<n&&i[u]<i[s]?u:s;e[t]=e[l],i[t]=i[l],t=l}e[t]=r,i[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,r=i[e],o=n[e];e>t;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;i[e]=i[a],n[e]=n[a],e=a}i[e]=r,n[e]=o},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,a=0,s=r.length;for(e=0;e<s;++e)(i=n(t=r[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=i,r[a++]=t);r.length=a,o.length=a,this.heapify_()},t}(),js=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ns=function(t){function e(e,i){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=i,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return js(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(E,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(e.hifi&&i===es||i===is||i===ns){e.removeEventListener(E,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,n,r=0;this.tilesLoading_<t&&r<e&&this.getCount()>0;)n=(i=this.dequeue()[0]).getKey(),i.getState()!==$a||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,i.load())},e}(Gs);var zs="center",Bs="resolution",Us="rotation";function Xs(t,e,i){return function(n,r,o,a){if(n){var s=e?0:o[0]*r,u=e?0:o[1]*r,l=t[0]+s/2,h=t[2]-s/2,c=t[1]+u/2,p=t[3]-u/2;l>h&&(h=l=(h+l)/2),c>p&&(p=c=(p+c)/2);var f=Ce(n[0],l,h),d=Ce(n[1],c,p),g=30*r;return a&&i&&(f+=-g*Math.log(1+Math.max(0,l-n[0])/g)+g*Math.log(1+Math.max(0,n[0]-h)/g),d+=-g*Math.log(1+Math.max(0,c-n[1])/g)+g*Math.log(1+Math.max(0,n[1]-p)/g)),[f,d]}}}function Vs(t){return t}function Ws(t,e,i,n){var r=ye(e)/i[0],o=de(e)/i[1];return n?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function Ys(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Ce(n,i/2,2*e)}function Ks(t,e,i,n,r){return function(o,a,s,u){if(void 0!==o){var l=n?Ws(t,n,s,r):t;return(void 0===i||i)&&u?Ys(o,l,e):Ce(o,e,l)}}}function Zs(t){return void 0!==t?0:void 0}function Hs(t){return void 0!==t?t:void 0}var qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Js=function(t){function e(e){var i=t.call(this)||this,n=m({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=pi(n.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.cancelAnchor_=void 0,n.center&&(n.center=Si(n.center,i.projection_)),n.extent&&(n.extent=Ci(n.extent,i.projection_)),i.applyOptions_(n),i}return qs(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,n,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,u=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,l=void 0!==t.showFullExtent&&t.showFullExtent,h=pi(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;i=g[r],n=void 0!==g[o]?g[o]:g[g.length-1],e=t.constrainResolution?function(t,e,i,n){return function(r,o,a,s){if(void 0!==r){var u=t[0],l=t[t.length-1],h=i?Ws(u,i,a,n):u;if(s)return void 0===e||e?Ys(r,h,l):Ce(r,l,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,u,!f&&d,l):Ks(i,n,u,!f&&d,l)}else{var _=(c?Math.max(ye(c),de(c)):360*Ct[yt]/h.getMetersPerUnit())/256/Math.pow(2,0),v=_/Math.pow(2,28);void 0!==(i=t.maxResolution)?r=0:i=_/Math.pow(a,r),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(a,o):_/Math.pow(a,o):v),o=r+Math.floor(Math.log(i/n)/Math.log(a)),n=i/Math.pow(a,o-r),e=t.constrainResolution?function(t,e,i,n,r,o){return function(a,s,u,l){if(void 0!==a){var h=r?Ws(e,r,u,o):e,c=void 0!==i?i:0;if(l)return void 0===n||n?Ys(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,i,n,u,!f&&d,l):Ks(i,n,u,!f&&d,l)}return{constraint:e,maxResolution:i,minResolution:n,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 i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Xs(t.extent,t.constrainOnlyCenter,e)}var i=pi(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var n=i.getExtent().slice();return n[0]=-1/0,n[2]=1/0,Xs(n,!1,!1)}return Vs}(t),n=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?Hs:"number"==typeof e?(i=e,n=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):Hs}return Zs;var i,n;var r,o}(t);this.constraints_={center:i,resolution:n,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),i=0;i<e.length;++i){var n=arguments[i];n.center&&((n=m({},n)).center=Si(n.center,this.getProjection())),n.anchor&&((n=m({},n)).anchor=Si(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;if(i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&Qs(e,!0))}for(var r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_,u=[],l=0;l<i;++l){var h=arguments[l],c={start:r,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||as,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}$s(c)?c.complete=!0:r+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(aa,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[aa]>0},e.prototype.getInteracting=function(){return this.hints_[sa]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(aa,-this.hints_[aa]);for(var e=0,i=this.animations_.length;e<i;++e){var n=this.animations_[e];if(n[0].callback&&Qs(n[0].callback,!1),!t)for(var r=0,o=n.length;r<o;++r){var a=n[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,i=this.animations_.length-1;i>=0;--i){for(var n=this.animations_[i],r=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var u=t-s.start,l=s.duration>0?u/s.duration:1;l>=1?(s.complete=!0,l=1):r=!1;var h=s.easing(l);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()),v=this.constraints_.resolution(g,0,_,!0);this.targetCenter_=this.calculateCenterZoom(v,s.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var y=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(y,!0);this.targetCenter_=this.calculateCenterRotate(m,s.anchor)}this.targetRotation_=y}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(r){this.animations_[i]=null,this.setHint(aa,-1);var x=n[0].callback;x&&Qs(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 i,n,r,o=this.getCenterInternal();return void 0!==o&&(ei(i=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),r=e,(n=i)[0]+=+r[0],n[1]+=+r[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),r=this.getResolution();void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*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?xi(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(zs)},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 wi(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();it(i,1);var n=this.getResolution();it(void 0!==n,2);var r=this.getRotation();return it(void 0!==r,3),fe(i,n,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(Bs)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Ci(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=ye(t)/i[0],r=de(t)/i[1];return Math.max(n,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(Us)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/r}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),i=this.getResolution(),n=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:i,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var r=p(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},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),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Ce(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i,n=m({size:this.getViewportSize_()},e||{});if(it(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))it(!xe(t),25),i=gn(r=Ci(t,this.getProjection()));else if(t.getType()===vt){var r;(i=gn(r=Ci(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ce(r))}else{i=t}this.fitInternal(i,n)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSize_());var r,o=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;r=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var s=t.getFlatCoordinates(),u=this.getRotation(),l=Math.cos(-u),h=Math.sin(-u),c=1/0,p=1/0,f=-1/0,d=-1/0,g=t.getStride(),_=0,v=s.length;_<v;_+=g){var m=s[_]*l-s[_+1]*h,x=s[_]*h+s[_+1]*l;c=Math.min(c,m),p=Math.min(p,x),f=Math.max(f,m),d=Math.max(d,x)}var S=this.getResolutionForExtentInternal([c,p,f,d],[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);S=isNaN(S)?r:Math.max(S,r),S=this.getConstrainedResolution(S,a?0:1),h=-h;var w=(c+f)/2,C=(p+d)/2,b=[(w+=(o[1]-o[3])/2*S)*l-(C+=(o[0]-o[2])/2*S)*h,C*l+w*h],E=i.callback?i.callback:y;void 0!==i.duration?this.animateInternal({resolution:S,center:this.getConstrainedCenter(b,S),duration:i.duration,easing:i.easing},E):(this.targetResolution_=S,this.targetCenter_=b,this.applyTargetState_(!1,!0),Qs(E,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(Si(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){var n=this.getRotation(),r=Math.cos(-n),o=Math.sin(-n),a=t[0]*r-t[1]*o,s=t[1]*r+t[0]*o,u=this.getResolution(),l=(a+=(e[0]/2-i[0])*u)*r-(s+=(i[1]-e[1]/2)*u)*(o=-o),h=s*r+a*o;this.setCenterInternal([l,h])},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=xi(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 i=e&&Si(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,n,i);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=Si(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(Si(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 i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,r,i),a=this.constraints_.center(this.targetCenter_,o,r,i);this.get(Us)!==n&&this.set(Us,n),this.get(Bs)!==o&&this.set(Bs,o),this.get(zs)&&ti(this.get(zs),a)||this.set(zs,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var n=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),u=this.constraints_.center(this.targetCenter_,s,a);if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=u,void this.applyTargetState_();var l=i||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&ti(this.getCenterInternal(),u)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:s,duration:n,easing:os,anchor:l}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(sa,1)},e.prototype.endInteraction=function(t,e,i){var n=i&&Si(i,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(sa,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,n)},e}(K);function Qs(t,e){setTimeout((function(){t(e)}),0)}function $s(t){return!(t.sourceCenter&&t.targetCenter&&!ti(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var tu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),eu=function(t){function e(e){var i=t.call(this)||this,n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,n,r,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new xs({layers:t.layers});o[Ms]=a,o[ks]=t.target,o[Ds]=void 0!==t.view?t.view:new Js,void 0!==t.controls&&(Array.isArray(t.controls)?i=new et(t.controls.slice()):(it("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new et(t.interactions.slice()):(it("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?r=new et(t.overlays.slice()):(it("function"==typeof t.overlays.getArray,49),r=t.overlays):r=new et;return{controls:i,interactions:n,keyboardEventTarget:e,overlays:r,values:o}}(e);return i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:qn,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=n.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=n.controls||new et,i.interactions=n.interactions||new et,i.overlays_=n.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Ns(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addEventListener(H(Ms),i.handleLayerGroupChanged_),i.addEventListener(H(Ds),i.handleViewChanged_),i.addEventListener(H(Ls),i.handleSizeChanged_),i.addEventListener(H(ks),i.handleTargetChanged_),i.setProperties(n.values),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.controls.addEventListener(q,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(J,function(t){t.element.setMap(null)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.addEventListener(q,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(J,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i.overlays_.addEventListener(q,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(J,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i}return tu(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,i){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==i.layerFilter?i.layerFilter:_,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,r,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var n=i||{},r=void 0!==n.hitTolerance?n.hitTolerance*this.frameState_.pixelRatio:0,o=n.layerFilter||_;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,r,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),n=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(i,this.frameState_,r,o,n,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(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(ks)},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 xi(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(Ms)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var n=t[e].layer.getSource();if(n&&n.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Si(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(Ls)},e.prototype.getView=function(){return this.get(Ds)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,i,n){return function(t,e,i,n,r){if(!t||!(i in t.wantedTiles))return 1/0;if(!t.wantedTiles[i][e.getKey()])return 1/0;var o=t.viewState.center,a=n[0]-o[0],s=n[1]-o[1];return 65536*Math.log(r)+Math.sqrt(a*a+s*s)/r}(this.frameState_,t,e,i,n)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new bs(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===Ps||i===j||i===M){var n=this.viewport_.getRootNode?this.viewport_.getRootNode():document,r=n===document?e.target:n.elementFromPoint(e.clientX,e.clientY);if(this.overlayContainerStopEvent_.contains(r)||!(n===document?document.documentElement:n).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 i=this.maxTilesLoading_,n=i;if(t){var r=t.viewHints;if(r[aa]||r[sa]){var o=!Qn&&Date.now()-t.time>8;i=o?0:8,n=o?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}!t||!this.hasListener(Sn)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Sn,t);for(var a=this.postRenderFunctions_,s=0,u=a.length;s<u;++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,i=this.keyHandlerKeys_.length;e<i;++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,ir(this.viewport_)}if(t){for(var n in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Fs(this,this.moveTolerance_),Es)this.mapBrowserEventHandler_.addEventListener(Es[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(P,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(j,this.boundHandleBrowserEvent_,!!$n&&{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,u,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,u,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,i=t.length;e<i;++e){var n=t[e].layer;n.hasRenderer()&&n.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(),i=this.getView(),n=this.frameState_,r=null;if(void 0!==e&&function(t){return t[0]>0&&t[1]>0}(e)&&i&&i.isDef()){var o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:n?n.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),n)(!this.previousExtent_||!xe(this.previousExtent_)&&!ie(r.extent,this.previousExtent_))&&(this.dispatchEvent(new ws(Is,this,n)),this.previousExtent_=Qt(this.previousExtent_));this.previousExtent_&&!r.viewHints[aa]&&!r.viewHints[sa]&&!ie(r.extent,this.previousExtent_)&&(this.dispatchEvent(new ws(As,this,r)),Vt(r.extent,this.previousExtent_))}this.dispatchEvent(new ws(Os,this,r)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(Ms,t)},e.prototype.setSize=function(t){this.set(Ls,t)},e.prototype.setTarget=function(t){this.set(ks,t)},e.prototype.setView=function(t){this.set(Ds,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,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(K);var iu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nu=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return iu(e,t),e.prototype.disposeInternal=function(){ir(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ir(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++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!==y&&this.listenerKeys.push(N(t,Os,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}(K),ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ou=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===n.collapsed||n.collapsed,i.overrideCollapsible_=void 0!==n.collapsible,i.collapsible_=void 0===n.collapsible||n.collapsible,i.collapsible_||(i.collapsed_=!1);var r=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.collapseLabel?n.collapseLabel:"»";"string"==typeof a?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=a):i.collapseLabel_=a;var s=void 0!==n.label?n.label:"i";"string"==typeof s?(i.label_=document.createElement("span"),i.label_.textContent=s):i.label_=s;var u=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=o,l.appendChild(u),l.addEventListener(R,i.handleClick_.bind(i),!1);var h=r+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),c=i.element;return c.className=h,c.appendChild(i.ulElement_),c.appendChild(l),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return ru(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=t.layerStatesArray,r=0,o=n.length;r<o;++r){var a=n[r];if(Qr(a,t.viewState)){var s=a.layer.getSource();if(s){var u=s.getAttributions();if(u){var l=u(t);if(l)if(this.overrideCollapsible_||!1!==s.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(l))for(var h=0,c=l.length;h<c;++h)l[h]in e||(i.push(l[h]),e[l[h]]=!0);else l in e||(i.push(l),e[l]=!0)}}}}return i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,r=e.length;n<r;++n){var o=document.createElement("li");o.innerHTML=e[n],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_?er(this.collapseLabel_,this.label_):er(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}(nu),au=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),su=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var r=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧";i.label_=null,"string"==typeof o?(i.label_=document.createElement("span"),i.label_.className="ol-compass",i.label_.textContent=o):(i.label_=o,i.label_.classList.add("ol-compass"));var a=n.tipLabel?n.tipLabel:"Reset rotation",s=document.createElement("button");s.className=r+"-reset",s.setAttribute("type","button"),s.title=a,s.appendChild(i.label_),s.addEventListener(R,i.handleClick_.bind(i),!1);var u=r+" ol-unselectable ol-control",l=i.element;return l.className=u,l.appendChild(s),i.callResetNorth_=n.resetNorth?n.resetNorth:void 0,i.duration_=void 0!==n.duration?n.duration:250,i.autoHide_=void 0===n.autoHide||n.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return au(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:os}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var r=this.element.classList.contains("ol-hidden");r||0!==i?r&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=n}this.rotation_=i}},e}(nu),uu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lu=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var r=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInLabel?n.zoomInLabel:"+",s=void 0!==n.zoomOutLabel?n.zoomOutLabel:"",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",l=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=r+"-in",h.setAttribute("type","button"),h.title=u,h.appendChild("string"==typeof a?document.createTextNode(a):a),h.addEventListener(R,i.handleClick_.bind(i,o),!1);var c=document.createElement("button");c.className=r+"-out",c.setAttribute("type","button"),c.title=l,c.appendChild("string"==typeof s?document.createTextNode(s):s),c.addEventListener(R,i.handleClick_.bind(i,-o),!1);var p=r+" ol-unselectable ol-control",f=i.element;return f.className=p,f.appendChild(h),f.appendChild(c),i.duration_=void 0!==n.duration?n.duration:250,i}return uu(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 i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:os})):e.setZoom(n)}}},e}(nu),hu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cu="degrees",pu="imperial",fu="nautical",du="metric",gu="us",_u=[1,2,5],vu=function(t){function e(e){var i=this,n=e||{},r=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).innerElement_=document.createElement("div"),i.innerElement_.className=r+"-inner",i.element.className=r+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==n.minWidth?n.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addEventListener(H("units"),i.handleUnitsChanged_),i.setUnits(n.units||du),i.scaleBar_=n.bar||!1,i.scaleBarSteps_=n.steps||4,i.scaleBarText_=n.text||!1,i.dpi_=n.dpi||void 0,i}return hu(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,i=t.projection,n=this.getUnits(),r=n==cu?yt:xt,o=hi(i,t.resolution,e,r),a=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),s=a*o,u="";if(n==cu){var l=Ct[yt];(s*=l)<l/60?(u="″",o*=3600):s<l?(u="",o*=60):u="°"}else n==pu?s<.9144?(u="in",o/=.0254):s<1609.344?(u="ft",o/=.3048):(u="mi",o/=1609.344):n==fu?(o/=1852,u="nm"):n==du?s<.001?(u="μm",o*=1e6):s<1?(u="mm",o*=1e3):s<1e3?u="m":(u="km",o/=1e3):n==gu?s<.9144?(u="in",o*=39.37):s<1609.344?(u="ft",o/=.30480061):(u="mi",o/=1609.3472):it(!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=_u[(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,u):h.toFixed(p<0?-p:0)+" "+u,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,i){for(var n="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,i):"")+"</div>"),s===this.scaleBarSteps_-1&&r.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</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,i,n,r){var o=(0===t?0:Math.round(n/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: "+(i?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=hi(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*39.37*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(nu);var yu="active",mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xu=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return mu(e,t),e.prototype.getActive=function(){return this.get(yu)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(yu,t)},e.prototype.setMap=function(t){this.map_=t},e}(K);function Su(t,e,i,n){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:i,duration:void 0!==n?n:250,easing:os})}}var wu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Cu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return wu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Es.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Su(n.getView(),o,r,this.duration_),t.preventDefault(),e=!0}return!e},e}(xu),bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Eu=function(t){function e(e){var i=this,n=e||{};return i=t.call(this,n)||this,n.handleDownEvent&&(i.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(i.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(i.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(i.handleUpEvent=n.handleUpEvent),n.stopDown&&(i.stopDown=n.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return bu(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==Es.POINTERDRAG)this.handleDragEvent(t),t.preventDefault();else if(t.type==Es.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Es.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Es.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===Es.POINTERDOWN||e===Es.POINTERDRAG||e===Es.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==Es.POINTERUP?delete this.trackedPointers_[i]:(t.type==Es.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=S(this.trackedPointers_)}},e}(xu);function Tu(t){for(var e=t.length,i=0,n=0,r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return[i/e,n/e]}function Pu(t){var e=arguments;return function(t){for(var i=!0,n=0,r=e.length;n<r&&(i=i&&e[n](t));++n);return i}}var Ru=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Fu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Ou=_,Iu=function(t){var e=t.originalEvent;return 0==e.button&&!(Zn&&Hn&&e.ctrlKey)},Au=v,Mu=function(t){return t.type==Es.SINGLECLICK},Lu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ku=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Du=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Gu=function(t){var e=t.originalEvent;return it(void 0!==e,56),"mouse"==e.pointerType},ju=function(t){var e=t.originalEvent;return it(void 0!==e,56),e.isPrimary&&0===e.button},Nu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zu=function(t){function e(e){var i=t.call(this,{stopDown:v})||this,n=e||{};i.kinetic_=n.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var r=n.condition?n.condition:Pu(Lu,ju);return i.condition_=n.onFocusOnly?Pu(Fu,r):r,i.noKinetic_=!1,i}return Nu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,i=Tu(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var n=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],r=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(n,r.getResolution()),ei(n,r.getRotation()),r.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(r),a[1]-n*Math.sin(r)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:os})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Eu),Bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Uu=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:v})||this).condition_=n.condition?n.condition:Ru,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return Bu(e,t),e.prototype.handleDragEvent=function(t){if(Gu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Zs){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Gu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Gu(t)&&(!(!Iu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Eu),Xu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vu=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return Xu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new dn([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(l),Wu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Yu="boxstart",Ku="boxdrag",Zu="boxend",Hu=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.coordinate=i,r.mapBrowserEvent=n,r}return Wu(e,t),e}(s),qu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new Vu(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Iu,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return Wu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Hu(Ku,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 Hu(Zu,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 Hu(Yu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Eu),Ju=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qu=function(t){function e(e){var i=this,n=e||{},r=n.condition?n.condition:ku;return(i=t.call(this,{condition:r,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return Ju(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),r=this.getGeometry().getExtent();if(this.out_){var o=i.calculateExtentInternal(n),a=te([e.getPixelFromCoordinateInternal(le(r)),e.getPixelFromCoordinateInternal(ve(r))]);!function(t,e){var i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}(o,1/i.getResolutionForExtentInternal(a,n)),r=o}var s=i.getConstrainedResolution(i.getResolutionForExtentInternal(r,n)),u=i.getConstrainedCenter(ce(r),s);i.animateInternal({resolution:s,center:u,duration:this.duration_,easing:os})},e}(qu),$u=37,tl=38,el=39,il=40,nl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),rl=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return Lu(t)&&Du(t)},i.condition_=void 0!==n.condition?n.condition:i.defaultCondition_,i.duration_=void 0!==n.duration?n.duration:100,i.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,i}return nl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==il||i==$u||i==el||i==tl)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,o=0,a=0;i==il?a=-r:i==$u?o=-r:i==el?o=r:a=r;var s=[o,a];ei(s,n.getRotation()),function(t,e,i){var n=t.getCenterInternal();if(n){var r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ss,center:t.getConstrainedCenter(r)})}}(n,s,this.duration_),t.preventDefault(),e=!0}}return!e},e}(xu),ol=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),al=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:Du,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return ol(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M||t.type==L){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var n=t.map,r=i=="+".charCodeAt(0)?this.delta_:-this.delta_;Su(n.getView(),r,void 0,this.duration_),t.preventDefault(),e=!0}}return!e},e}(xu),sl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ul="trackpad",ll="wheel",hl=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var r=n.condition?n.condition:Ou;return i.condition_=n.onFocusOnly?Pu(Fu,r):r,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return sl(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,i=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==j&&(e=n.deltaY,Kn&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=qn),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?ul:ll);var o=i.getView();if(this.mode_===ul&&!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,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Ce(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Su(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(xu),cl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pl=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=v),(i=t.call(this,r)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return cl(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Zs){var u=a.getViewport().getBoundingClientRect(),l=Tu(this.targetPointers);l[0]-=u.left,l[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(l),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}(Eu),fl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dl=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=v),(i=t.call(this,r)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return fl(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,a=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,u=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),h=Tu(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Eu),gl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_l="addfeatures",vl=function(t){function e(e,i,n,r){var o=t.call(this,e)||this;return o.features=n,o.file=i,o.projection=r,o}return gl(e,t),e}(s),yl=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{handleEvent:_})||this).formatConstructors_=n.formatConstructors?n.formatConstructors:[],i.projection_=n.projection?li(n.projection):null,i.dropListenKeys_=null,i.source_=n.source||null,i.target=n.target?n.target:null,i}return gl(e,t),e.prototype.handleResult_=function(t,e){var i=e.target.result,n=this.getMap(),r=this.projection_;r||(r=n.getView().getProjection());for(var o=this.formatConstructors_,a=0,s=o.length;a<s;++a){var u=new o[a],l=this.tryReadFeatures_(u,i,{featureProjection:r});if(l&&l.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(l)),this.dispatchEvent(new vl(_l,t,l,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,i){try{return t.readFeatures(e,i)}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,i=0,n=e.length;i<n;++i){var r=e.item(i),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}(xu),ml=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xl=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,n)||this).condition_=n.condition?n.condition:ku,i.lastAngle_=void 0,i.lastMagnitude_=void 0,i.lastScaleDelta_=0,i.duration_=void 0!==n.duration?n.duration:400,i}return ml(e,t),e.prototype.handleDragEvent=function(t){if(Gu(t)){var e=t.map,i=e.getSize(),n=t.pixel,r=n[0]-i[0]/2,o=i[1]/2-n[1],a=Math.atan2(o,r),s=Math.sqrt(r*r+o*o),u=e.getView();if(void 0!==this.lastAngle_){var l=this.lastAngle_-a;u.adjustRotationInternal(l)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&u.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!Gu(t))return!0;var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!Gu(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(Eu),Sl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wl=function(t){function e(e,i,n){var r=t.call(this)||this;if(void 0!==n&&void 0===i)r.setFlatCoordinates(n,e);else{var o=i||0;r.setCenterAndRadius(e,o,n)}return r}return Sl(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,i,n){var r=this.flatCoordinates,o=t-r[0],a=e-r[1],s=o*o+a*a;if(s<n){if(0===s)for(var u=0;u<this.stride;++u)i[u]=r[u];else{var l=this.getRadius()/Math.sqrt(s);i[0]=r[0]+l*o,i[1]=r[1]+l*a;for(u=2;u<this.stride;++u)i[u]=r[u]}return i.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,n=t-i[0],r=e-i[1];return n*n+r*r<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return Jt(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return vt},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,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var r=1;r<e;++r)n[e+r]=t[r];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,r=ji(n,0,t,this.stride);n[r++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[r++]=n[o];n.length=r,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter(Ei(i,0,i.length,n,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter(Ti(i,0,i.length,n,t,e,i)),this.changed()},e}(Ii);wl.prototype.transform;var Cl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bl=function(t){function e(e,i,n){var r=t.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(e[0]))r.setCoordinates(e,i);else if(void 0!==i&&n)r.setFlatCoordinates(i,e),r.ends_=n;else{for(var o=r.getLayout(),a=e,s=[],u=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(o=c.getLayout()),d(s,c.getFlatCoordinates()),u.push(s.length)}r.setFlatCoordinates(o,s),r.ends_=u}return r}return Cl(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,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ki(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gi(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=st&&this.layout!=ut||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,r=void 0!==i&&i;return function(t,e,i,n,r,o,a){if(a)return bn(t,e,i[i.length-1],n,r,o);var s;if(r<t[n-1])return o?((s=t.slice(0,n))[n-1]=r,s):null;if(t[t.length-1]<r)return o?((s=t.slice(t.length-n))[n-1]=r,s):null;for(var u=0,l=i.length;u<l;++u){var h=i[u];if(e!=h){if(r<t[e+n-1])return null;if(r<=t[h-1])return bn(t,e,h,n,r,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,r)},e.prototype.getCoordinates=function(){return Yi(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 Pn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[],r=0,o=0,a=e.length;o<a;++o){var s=e[o],u=new Pn(t.slice(r,s),i);n.push(u),r=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,n=this.ends_,r=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];d(t,Cn(e,i,s,r,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=function(t,e,i,n,r,o,a,s){for(var u=0,l=i.length;u<l;++u){var h=i[u];a=Bi(t,e,h,n,r,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,n),new e(i,ot,n)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return function(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o){if(an(t,e,i[o],n,r))return!0;e=i[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=zi(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Ii),El=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Tl=function(t){function e(e,i){var n=t.call(this)||this;return i&&!Array.isArray(e[0])?n.setFlatCoordinates(i,e):n.setCoordinates(e,i),n}return El(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,i,n){if(n<Wt(this.getExtent(),t,e))return n;for(var r=this.flatCoordinates,o=this.stride,a=0,s=r.length;a<s;a+=o){var u=Pe(t,e,r[a],r[a+1]);if(u<n){n=u;for(var l=0;l<o;++l)i[l]=r[a+l];i.length=o}}return n},e.prototype.getCoordinates=function(){return Wi(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 $i(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,n=[],r=0,o=t.length;r<o;r+=i){var a=new $i(t.slice(r,r+i),e);n.push(a)}return n},e.prototype.getType=function(){return ft},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,n=0,r=e.length;n<r;n+=i){if(Zt(t,e[n],e[n+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ni(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ii);var Pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rl=function(t){function e(e,i,n){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,!n&&!Array.isArray(e[0])){for(var o=r.getLayout(),a=e,s=[],u=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),g=0,_=f.length;g<_;++g)f[g]+=p;d(s,c.getFlatCoordinates()),u.push(f)}i=o,e=s,n=u}return void 0!==i&&n?(r.setFlatCoordinates(i,e),r.endss_=n):r.setCoordinates(e,i),r}return Pl(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;d(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,r=(e=t.getEnds().slice()).length;n<r;++n)e[n]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),n=0;n<t;++n)i[n]=this.endss_[n].slice();return new e(this.flatCoordinates.slice(),this.layout,i)},e.prototype.closestPointXY=function(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o){var s=i[o];r=ki(t,e,s,n,r),e=s[s.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,n,r,o,a,s,u,l,h){for(var c=h||[NaN,NaN],p=0,f=i.length;p<f;++p){var d=i[p];l=Gi(t,e,d,n,r,o,a,s,u,l,c),e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return function(t,e,i,n,r,o){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var u=i[a];if(nn(t,e,u,n,r,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,n){for(var r=0,o=0,a=i.length;o<a;++o){var s=i[o];r+=Hi(t,e,s,n),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?pn(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Ki(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,i,n){for(var r=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var u=i[a];o=ee(t,e,u[0],n),r.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=u[u.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,i,n,r){for(var o=[],a=0,s=i.length;a<s;++a){var u=i[a];o=rn(t,e,u,n,r,2*a,o),e=u[u.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 Tl(this.getFlatInteriorPoints().slice(),st)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o){var s=i[o];if(!hn(t,e,s,n,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=pn(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=function(t,e,i,n,r,o,a,s){for(var u=0,l=i.length;u<l;++u){var h=i[u],c=[];a=Vi(t,e,h,n,r,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,n),new e(i,ot,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var n=this.endss_[t].slice(),r=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new dn(this.flatCoordinates.slice(e,r),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[],r=0,o=0,a=i.length;o<a;++o){var s=i[o].slice(),u=s[s.length-1];if(0!==r)for(var l=0,h=s.length;l<h;++l)s[l]-=r;var c=new dn(e.slice(r,u),t,s);n.push(c),r=u}return n},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){return function(t,e,i,n,r){for(var o=0,a=i.length;o<a;++o){var s=i[o];if(sn(t,e,s,n,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 i=function(t,e,i,n,r){for(var o=r||[],a=0,s=0,u=i.length;s<u;++s){var l=zi(t,e,i[s],n,o[a]);o[a++]=l,e=l[l.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var n=i[i.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(Ii),Fl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ol="Point",Il="LineString",Al="Polygon",Ml="Circle",Ll="drawstart",kl="drawend",Dl="drawabort",Gl=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return Fl(e,t),e}(s),jl=function(t){function e(e){var i=this,n=e;n.stopDown||(n.stopDown=v),(i=t.call(this,n)||this).shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){var e;t===lt||t===ft?e=Ol:t===ht||t===dt?e=Il:t===pt||t===gt?e=Al:t===vt&&(e=Ml);return e}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Al?3:2,i.maxPoints_=e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:_;var r,o=e.geometryFunction;if(!o)if(i.type_===vt)o=function(t,e,i){var n=e||new wl([NaN,NaN]),r=Si(t[0]),o=ii(r,Si(t[1]));return n.setCenterAndRadius(r,Math.sqrt(o)),n};else{var a,s=i.mode_;s===Ol?a=$i:s===Il?a=Pn:s===Al&&(a=dn),o=function(t,e,i){var n=e;return n?s===Al?t[0].length?n.setCoordinates([t[0].concat([t[0][0]])]):n.setCoordinates([]):n.setCoordinates(t):n=new a(t),n}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new ka({source:new Qa({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(r=Or(),function(t,e){return r[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:Lu,i.freehandCondition_,e.freehand?i.freehandCondition_=Ou:i.freehandCondition_=e.freehandCondition?e.freehandCondition:ku,i.addEventListener(H(yu),i.updateState_),i}return Fl(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_!==Ol&&this.freehandCondition_(e);var i=e.type===Es.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Es.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Es.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Es.POINTERDOWN?n=!1:i?(n=e.type===Es.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.preventDefault()):("mouse"==e.originalEvent.pointerType||e.type===Es.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Es.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new bs(Es.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 i=this.mode_===Ml;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===Ol&&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_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],o=n*n+r*r;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t)},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,n=[this.finishCoordinate_];if(this.mode_===Il)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Al){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,n=[r[0][0],r[0][r[0].length-2]]}if(i)for(var o=t.map,a=0,s=n.length;a<s;a++){var u=n[a],l=o.getPixelFromCoordinate(u),h=t.pixel,c=h[0]-l[0],p=h[1]-l[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=u;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 $i(e)),this.updateSketchFeatures_())},e.prototype.startDrawing_=function(t){var e=t.coordinate,i=t.map.getView().getProjection();this.finishCoordinate_=e,this.mode_===Ol?this.sketchCoords_=e.slice():this.mode_===Al?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new rt(new Pn(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,i);this.sketchFeature_=new rt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new Gl(Ll,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,n,r=t.coordinate,o=this.sketchFeature_.getGeometry(),a=t.map.getView().getProjection();(this.mode_===Ol?i=this.sketchCoords_:this.mode_===Al?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(r=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=r[0],i[1]=r[1],this.geometryFunction_(this.sketchCoords_,o,a),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(r);if(o.getType()==pt&&this.mode_!==Al){this.sketchLine_||(this.sketchLine_=new rt);var s=o.getLinearRing(0);(n=this.sketchLine_.getGeometry())?(n.setFlatCoordinates(s.getLayout(),s.getFlatCoordinates()),n.changed()):(n=new Pn(s.getFlatCoordinates(),s.getLayout()),this.sketchLine_.setGeometry(n))}else this.sketchLineCoords_&&(n=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Il?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,n,r)):this.mode_===Al&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===Il?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,i),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Al&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)),0===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===Il?(e.pop(),this.geometryFunction_(e,i,n)):this.mode_===Al&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),this.type_===ft?t.setGeometry(new Tl([e])):this.type_===dt?t.setGeometry(new bl([e])):this.type_===gt&&t.setGeometry(new Rl([e])),this.dispatchEvent(new Gl(kl,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 Gl(Dl,t))},e.prototype.appendCoordinates=function(t){var e=this.mode_,i=[];e===Il?i=this.sketchCoords_:e===Al&&(i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var n=i.pop(),r=0;r<t.length;r++)this.addToDrawing_(t[r]);this.addToDrawing_(n)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new Gl(Ll,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}(Eu);var Nl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zl="extentchanged",Bl=function(t){function e(e){var i=t.call(this,zl)||this;return i.extent=e,i}return Nl(e,t),e}(s),Ul=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,n)||this).condition_=n.condition?n.condition:Ou,i.extent_=null,i.pointerHandler_=null,i.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.snappedToVertex_=!1,i.extentFeature_=null,i.vertexFeature_=null,e||(e={}),i.extentOverlay_=new ka({source:new Qa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:Xl(),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.vertexOverlay_=new ka({source:new Qa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:Vl(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&i.setExtent(e.extent),i}return Nl(e,t),e.prototype.snapToVertex_=function(t,e){var i=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){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]]]]}(n);r.sort((function(t,e){return ri(i,t)-ri(i,e)}));var o=r[0],a=$e(i,o),s=e.getPixelFromCoordinateInternal(a);if(ni(t,s)<=this.pixelTolerance_){var u=e.getPixelFromCoordinateInternal(o[0]),l=e.getPixelFromCoordinateInternal(o[1]),h=ii(s,u),c=ii(s,l),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,i=t.map,n=this.snapToVertex_(e,i);n||(n=i.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(gn(t)):e.setGeometry(void 0):(e=new rt(t?gn(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 $i(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Es.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,i=t.map,n=this.getExtentInternal(),r=this.snapToVertex_(e,i),o=function(t){var e=null,i=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?i=n[3]:t[1]==n[3]&&(i=n[1]),null!==e&&null!==i?[e,i]:null};if(r&&n){var a=r[0]==n[0]||r[0]==n[2]?r[0]:null,s=r[1]==n[1]||r[1]==n[3]?r[1]:null;null!==a&&null!==s?this.pointerHandler_=Wl(o(r)):null!==a?this.pointerHandler_=Yl(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=Yl(o([n[0],s]),o([n[2],s])))}else r=i.getCoordinateFromPixelInternal(e),this.setExtent([r[0],r[1],r[0],r[1]]),this.pointerHandler_=Wl(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!==ue(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 wi(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 Bl(this.extent_))},e}(Eu);function Xl(){var t=Or();return function(e,i){return t[pt]}}function Vl(){var t=Or();return function(e,i){return t[lt]}}function Wl(t){return function(e){return Ut([t,e])}}function Yl(t,e){return t[0]==e[0]?function(i){return Ut([t,[i[0],e[1]]])}:t[1]==e[1]?function(i){return Ut([t,[e[0],i[1]]])}:null}var Kl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zl=[0,0,0,0],Hl=[],ql="modifystart",Jl="modifyend",Ql=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.features=i,r.mapBrowserEvent=n,r}return Kl(e,t),e}(s),$l=function(t){function e(e){var i,n=t.call(this,e)||this;if(n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:ju,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&Mu(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Ou,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.modified_=!1,n.rBush_=new Da,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new ka({source:new Qa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:nh(),updateWhileAnimating:!0,updateWhileInteracting:!0}),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),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,e.source?(n.source_=e.source,i=new et(n.source_.getFeatures()),n.source_.addEventListener(za,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Xa,n.handleSourceRemove_.bind(n))):i=e.features,!i)throw new Error("The modify interaction requires features or a source");return n.features_=i,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(q,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(J,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n}return Kl(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(E,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Ql(ql,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_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n){for(var r=i[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);e.remove(r)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],a={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Ut(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,geometry:e,depth:[n],index:a,segment:u};this.rBush_.insert(Ut(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,geometry:e,depth:[n],index:a,segment:u};this.rBush_.insert(Ut(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],a=0,s=o.length;a<s;++a)for(var u=o[a],l=0,h=u.length-1;l<h;++l){var c=u.slice(l,l+2),p={feature:t,geometry:e,depth:[a,n],index:l,segment:c};this.rBush_.insert(Ut(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},r={feature:t,geometry:e,index:1,segment:[i,i]},o=[n,r];n.featureSegments=o,r.featureSegments=o,this.rBush_.insert($t(i),n);var a=e;this.rBush_.insert(a.getExtent(),r)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=i[n];(0,this.SEGMENT_WRITERS_[r.getType()])(t,r)}},e.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new rt(new $i(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!=Es.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=Es.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Es.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,i=0,n=this.dragSegments_.length;i<n;++i){for(var r=this.dragSegments_[i],o=r[0],a=o.depth,s=o.geometry,u=void 0,l=o.segment,h=r[1];e.length<s.getStride();)e.push(l[h][e.length]);switch(s.getType()){case lt:u=e,l[0]=e,l[1]=e;break;case ft:(u=s.getCoordinates())[o.index]=e,l[0]=e,l[1]=e;break;case ht:(u=s.getCoordinates())[o.index+h]=e,l[h]=e;break;case dt:case pt:(u=s.getCoordinates())[a[0]][o.index+h]=e,l[h]=e;break;case gt:(u=s.getCoordinates())[a[1]][a[0]][o.index+h]=e,l[h]=e;break;case vt:if(l[0]=e,l[1]=e,0===o.index)this.changingFeature_=!0,s.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var c=ni(Si(s.getCenter()),Si(e));s.setRadius(c),this.changingFeature_=!1}}u&&this.setGeometryCoordinates_(s,u)}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 i=this.vertexFeature_;if(i){var r=t.map.getView().getProjection(),o=[],a=i.getGeometry().getCoordinates(),s=Ut([a]),u=this.rBush_.getInExtent(s),l={};u.sort(th);for(var h=0,c=u.length;h<c;++h){var p=u[h],f=p.segment,d=n(p.geometry),g=p.depth;if(g&&(d+="-"+g.join("-")),l[d]||(l[d]=new Array(2)),p.geometry.getType()!==vt||1!==p.index)if(!ti(f[0],a)||l[d][0])if(!ti(f[1],a)||l[d][1])n(f)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&o.push([p,a]);else{if((p.geometry.getType()===ht||p.geometry.getType()===dt)&&l[d][0]&&0===l[d][0].index)continue;this.dragSegments_.push([p,1]),l[d][1]=p}else this.dragSegments_.push([p,0]),l[d][0]=p;else ti(ih(e,p,r),a)&&!l[d][0]&&(this.dragSegments_.push([p,0]),l[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 i=this.dragSegments_[e][0],n=i.geometry;if(n.getType()===vt){var r=n.getCenter(),o=i.featureSegments[0],a=i.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=n;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Ut(i.segment),i)}return this.modified_&&(this.dispatchEvent(new Ql(Jl,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,i){var r=i||e.getCoordinateFromPixel(t),o=e.getView().getProjection(),a=wi(Xt(Ci($t(r,Zl)),e.getView().getResolution()*this.pixelTolerance_,Zl)),s=this.rBush_.getInExtent(a);if(s.length>0){s.sort((function(t,e){return eh(r,t,o)-eh(r,e,o)}));var u=s[0],l=u.segment,h=ih(r,u,o),c=e.getPixelFromCoordinate(h),p=ni(t,c);if(p<=this.pixelTolerance_){var f={};if(u.geometry.getType()===vt&&1===u.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var d=e.getPixelFromCoordinate(l[0]),g=e.getPixelFromCoordinate(l[1]),_=ii(c,d),v=ii(c,g);p=Math.sqrt(Math.min(_,v)),this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(h=_>v?l[1]:l[0]),this.createOrUpdateVertexFeature_(h);for(var y=1,m=s.length;y<m;++y){var x=s[y].segment;if(!(ti(l[0],x[0])&&ti(l[1],x[1])||ti(l[0],x[1])&&ti(l[1],x[0])))break;f[n(x)]=!0}}return f[n(l)]=!0,void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,n=t.segment,r=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case dt:case pt:(i=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case gt:(i=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case ht:(i=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var u=this.rBush_;u.remove(t),this.updateSegmentIndices_(o,s,a,1);var l={segment:[n[0],e],feature:r,geometry:o,depth:a,index:s};u.insert(Ut(l.segment),l),this.dragSegments_.push([l,1]);var h={segment:[e,n[1]],feature:r,geometry:o,depth:a,index:s+1};u.insert(Ut(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Es.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t);var e=this.removeVertex_();return this.dispatchEvent(new Ql(Jl,this.features_,t)),this.modified_=!1,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,r,o,a,s,u,l,h,c,p=this.dragSegments_,f={},d=!1;for(o=p.length-1;o>=0;--o)c=n((h=(i=p[o])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===i[1]?(f[c].right=h,f[c].index=h.index):1==i[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(l=f[c].right,s=f[c].left,(u=(a=f[c].index)-1)<0&&(u=0),t=e=(r=(h=void 0!==s?s:l).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]),u=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!==l&&(this.rBush_.remove(l),g.push(l.segment[1])),void 0!==s&&void 0!==l){var _={depth:h.depth,feature:h.feature,geometry:h.geometry,index:u,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,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||g(r.depth,i))&&r.index>e&&(r.index+=n)}))},e}(Eu);function th(t,e){return t.index-e.index}function eh(t,e,i){var n=e.geometry;if(n.getType()===vt){var r=n;if(1===e.index){null;var o=ii(r.getCenter(),Si(t)),a=Math.sqrt(o)-r.getRadius();return a*a}}var s=Si(t);return Hl[0]=Si(e.segment[0]),Hl[1]=Si(e.segment[1]),ri(s,Hl)}function ih(t,e,i){var n=e.geometry;if(n.getType()===vt&&1===e.index){var r=n;return xi(r.getClosestPoint(Si(t)))}var o=Si(t);return Hl[0]=Si(e.segment[0]),Hl[1]=Si(e.segment[1]),xi($e(o,Hl))}function nh(){var t=Or();return function(e,i){return t[lt]}}var rh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oh="select",ah=function(t){function e(e,i,n,r){var o=t.call(this,e)||this;return o.selected=i,o.deselected=n,o.mapBrowserEvent=r,o}return rh(e,t),e}(s),sh={},uh=function(t){function e(e){var i,n,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:Mu,r.addCondition_=o.addCondition?o.addCondition:Au,r.removeCondition_=o.removeCondition?o.removeCondition:Au,r.toggleCondition_=o.toggleCondition?o.toggleCondition:ku,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((i=Or())[pt],i[ht]),d(i[_t],i[ht]),function(t){return t.getGeometry()?i[t.getGeometry().getType()]:null}),r.features_=o.features||new et,o.layers)if("function"==typeof o.layers)n=o.layers;else{var a=o.layers;n=function(t){return c(a,t)}}else n=_;return r.layerFilter_=n,r.featureLayerAssociation_={},r}return rh(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[n(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[n(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=n(t);e in sh||(sh[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){var i=n(t),r=this.getMap().getInteractions().getArray().filter((function(i){return i instanceof e&&i.getStyle()&&-1!==i.getFeatures().getArray().indexOf(t)}));r.length>0?t.setStyle(r[r.length-1].getStyle()):(t.setStyle(sh[i]),delete sh[i])},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[n(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),i=this.removeCondition_(t),n=this.toggleCondition_(t),r=!e&&!i&&!n,o=t.map,a=this.getFeatures(),s=[],u=[];if(r){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return u.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=a.getLength()-1;l>=0;--l){var h=a.item(l),p=u.indexOf(h);p>-1?u.splice(p,1):(a.remove(h),s.push(h))}0!==u.length&&a.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,r){if(this.filter_(t,r))return!e&&!n||c(a.getArray(),t)?(i||n)&&c(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(u.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(u)}return(u.length>0||s.length>0)&&this.dispatchEvent(new ah(oh,u,s,t)),!0},e}(xu);var lh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function hh(t){return t.feature?t.feature:t.element?t.element:void 0}var ch=[],ph=function(t){function e(e){var i=this,n=e||{},r=n;return r.handleDownEvent||(r.handleDownEvent=_),r.stopDown||(r.stopDown=v),(i=t.call(this,r)||this).source_=n.source?n.source:null,i.vertex_=void 0===n.vertex||n.vertex,i.edge_=void 0===n.edge||n.edge,i.features_=n.features?n.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.rBush_=new Da,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return lh(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,r=n(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))}i&&(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 i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=hh(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=hh(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=n(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=S(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,r=n(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 u=s.length-1;u>=0;--u)a.remove(s[u])}i&&(B(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var i=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();i&&(n.forEach(B),n.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(N(this.features_,q,this.handleFeatureAdd_,this),N(this.features_,J,this.handleFeatureRemove_,this)):this.source_&&n.push(N(this.source_,za,this.handleFeatureAdd_,this),N(this.source_,Xa,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var n=Ut([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),r=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(r=r.filter((function(t){return t.feature.getGeometry().getType()!==vt})));var o=!1,a=null,s=null;if(0===r.length)return{snapped:o,vertex:a,vertexPixel:s};i.getView().getProjection();for(var u,l=Si(e),h=1/0,c=0;c<r.length;++c){var p=r[c];ch[0]=Si(p.segment[0]),ch[1]=Si(p.segment[1]);var f=ri(l,ch);f<h&&(u=p,h=f)}var d=u.segment;if(this.vertex_&&!this.edge_){var g=i.getPixelFromCoordinate(d[0]),_=i.getPixelFromCoordinate(d[1]),v=ii(t,g),y=ii(t,_);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(o=!0,a=v>y?d[1]:d[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var m=u.feature.getGeometry().getType()===vt;if(m){var x=u.feature.getGeometry();null,a=xi(function(t,e){var i=e.getRadius(),n=e.getCenter(),r=n[0],o=n[1],a=t[0]-r,s=t[1]-o;0===a&&0===s&&(a=1);var u=Math.sqrt(a*a+s*s);return[r+i*a/u,o+i*s/u]}(l,x))}else ch[0]=Si(d[0]),ch[1]=Si(d[1]),a=xi($e(l,ch));if(ni(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!m)){g=i.getPixelFromCoordinate(d[0]),_=i.getPixelFromCoordinate(d[1]),v=ii(s,g),y=ii(s,_);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?d[1]:d[0],s=i.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 i=_n(e).getCoordinates()[0],n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert(Ut(o),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=this.SEGMENT_WRITERS_[i[n].getType()];r&&r(t,i[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert(Ut(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,segment:u};this.rBush_.insert(Ut(u),l)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],a=0,s=o.length;a<s;++a)for(var u=o[a],l=0,h=u.length-1;l<h;++l){var c=u.slice(l,l+2),p={feature:t,segment:c};this.rBush_.insert(Ut(c),p)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,segment:u};this.rBush_.insert(Ut(u),l)}},e}(Eu),fh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dh="translatestart",gh="translating",_h="translateend",vh=function(t){function e(e,i,n,r,o){var a=t.call(this,e)||this;return a.features=i,a.coordinate=n,a.startCoordinate=r,a.mapBrowserEvent=o,a}return fh(e,t),e}(s),yh=function(t){function e(e){var i,n=this,r=e||{};if((n=t.call(this,r)||this).lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==r.features?r.features:null,r.layers)if("function"==typeof r.layers)i=r.layers;else{var o=r.layers;i=function(t){return c(o,t)}}else i=_;return n.layerFilter_=i,n.filter_=r.filter?r.filter:_,n.hitTolerance_=r.hitTolerance?r.hitTolerance:0,n.lastFeature_=null,n.addEventListener(H(yu),n.handleActiveChanged_),n}return fh(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 vh(dh,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 vh(_h,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],r=this.features_||new et([this.lastFeature_]);r.forEach((function(t){var e=t.getGeometry();e.translate(i,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new vh(gh,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 i=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(i)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Eu);function mh(t){var e=t||{},i=new et,n=new ps(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Uu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Cu({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new zu({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new pl),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new dl({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new rl),i.push(new al({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new hl({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Qu({duration:e.zoomDuration})),i}var xh=Object.freeze({__proto__:null,defaults:mh,DoubleClickZoom:Cu,DragAndDrop:yl,DragBox:qu,DragPan:zu,DragRotate:Uu,DragRotateAndZoom:xl,DragZoom:Qu,Draw:jl,Extent:Ul,Interaction:xu,KeyboardPan:rl,KeyboardZoom:al,Modify:$l,MouseWheelZoom:hl,PinchRotate:pl,PinchZoom:dl,Pointer:Eu,Select:uh,Snap:ph,Translate:yh}),Sh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wh=function(t){function e(e){return(e=m({},e)).controls||(e.controls=function(t){var e=t||{},i=new et;return(void 0===e.zoom||e.zoom)&&i.push(new lu(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new su(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ou(e.attributionOptions)),i}()),e.interactions||(e.interactions=mh({onFocusOnly:!0})),t.call(this,e)||this}return Sh(e,t),e.prototype.createRenderer=function(){return new vs(this)},e}(eu),Ch=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return it(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return it(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){it(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function bh(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Eh(t,e,i){return t+"/"+e+"/"+i}function Th(t){return Eh(t[0],t[1],t[2])}function Ph(t){return(t[1]<<t[0])+t[2]}var Rh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Rh(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(Th(e.tileCoord)),e.release())}.bind(this))}},e}(Ch),Oh=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Ih(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new Oh(t,e,i,n)}var Ah=Yo((function(t,e){t.exports=function(t,e){t="default"in t?t.default:t;var i=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n="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||{},i=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 u=void 0!==e.label?e.label:"",l=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",i),h.setAttribute("aria-label",i),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=u,a.classList.add(n+"group-select-style-"+s.groupSelectStyle),a.classList.add(n+"activation-mode-"+s.activationMode),"click"===s.activationMode?(a.classList.add("activationModeClick"),s.startActive&&(h.textContent=l,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=u,h.setAttribute("title",i),h.setAttribute("aria-label",i)):(c.showPanel(),h.textContent=l,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),i(r,[{key:"setMap",value:function(t){for(var i=0;i<this.mapListeners.length;i++)e.unByKey(this.mapListeners[i]);if(this.mapListeners.length=0,function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,n)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(n):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 n=this;this.mapListeners.push(t.on("pointerdown",(function(){n.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,i){var n=new Event("render");for(e.dispatchEvent(n),(i=i||{}).groupSelectStyle=r.getGroupSelectStyle(i.groupSelectStyle),r.ensureTopVisibleBaseLayerShown_(t);e.firstChild;)e.removeChild(e.firstChild);r.forEachRecursive(t,(function(t,e,i){t.set("indeterminate",!1)})),"children"===i.groupSelectStyle||"none"===i.groupSelectStyle?r.setGroupVisibility(t):"group"===i.groupSelectStyle&&r.setChildVisibility(t);var o=document.createElement("ul");e.appendChild(o),r.renderLayers_(t,t,o,i,(function(n){r.renderPanel(t,e,i)}));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(),i=t.get("indeterminate");t.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),e&&!i||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown_",value:function(t){var e;r.forEachRecursive(t,(function(t,i,n){"base"===t.get("type")&&t.getVisible()&&(e=t)})),e&&r.setVisible_(t,e,!0)}},{key:"getGroupsAndLayers",value:function(t,e){var i=[];return e=e||function(t,e,i){return!0},r.forEachRecursive(t,(function(t,n,r){t.get("title")&&e(t,n,r)&&i.push(t)})),i}},{key:"setVisible_",value:function(t,e,i,n){e.setVisible(i),i&&"base"===e.get("type")&&r.forEachRecursive(t,(function(t,i,n){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e.getLayers&&!e.get("combine")&&"children"===n&&e.getLayers().forEach((function(i){r.setVisible_(t,i,e.getVisible(),n)}))}},{key:"renderLayer_",value:function(t,e,i,o,a){var s=document.createElement("li"),u=e.get("title"),l=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(n+"base-group"),e.get("fold")){s.classList.add(n+"fold"),s.classList.add(n+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=l,f.checked=e.getVisible(),f.indeterminate=e.get("indeterminate"),f.onchange=function(i){r.setVisible_(t,e,i.target.checked,o.groupSelectStyle),a(e)},s.appendChild(f),h.htmlFor=l}h.innerHTML=u,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=l,g.checked=e.get("visible"),g.indeterminate=e.get("indeterminate"),g.onchange=function(i){r.setVisible_(t,e,i.target.checked,o.groupSelectStyle),a(e)},s.appendChild(g),h.htmlFor=l,h.innerHTML=u;var _=t.getView().getResolution();(_>e.getMaxResolution()||_<e.getMinResolution())&&(h.className+=" disabled"),s.appendChild(h)}return s}},{key:"renderLayers_",value:function(t,e,i,n,o){var a=e.getLayers().getArray().slice();n.reverse&&(a=a.reverse());for(var s,u=0;u<a.length;u++)(s=a[u]).get("title")&&i.appendChild(r.renderLayer_(t,s,u,n,o))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,i,n){e(t,i,n),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(n+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(n+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}(nu,X)})),Mh=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var n=e.dataProjection?li(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===St&&(n=li(n)).setWorldExtent(e.extent),i={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(i)},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,i){return e()},t.prototype.readFeatures=function(t,i){return e()},t.prototype.readGeometry=function(t,i){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,i){return e()},t.prototype.writeFeatures=function(t,i){return e()},t.prototype.writeGeometry=function(t,i){return e()},t}();function Lh(t,e,i){var n,r=i?li(i.featureProjection):null,o=i?li(i.dataProjection):null;if(n=r&&o&&!fi(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return n}var kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dh=function(t){function i(){return t.call(this)||this}return kh(i,t),i.prototype.getType=function(){return Ya},i.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Gh(t),this.getReadOptions(t,e))},i.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Gh(t),this.getReadOptions(t,e))},i.prototype.readFeatureFromObject=function(t,i){return e()},i.prototype.readFeaturesFromObject=function(t,i){return e()},i.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Gh(t),this.getReadOptions(t,e))},i.prototype.readGeometryFromObject=function(t,i){return e()},i.prototype.readProjection=function(t){return this.readProjectionFromObject(Gh(t))},i.prototype.readProjectionFromObject=function(t){return e()},i.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},i.prototype.writeFeatureObject=function(t,i){return e()},i.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},i.prototype.writeFeaturesObject=function(t,i){return e()},i.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},i.prototype.writeGeometryObject=function(t,i){return e()},i}(Mh);function Gh(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var jh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Nh=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return jh(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,i,n){if(n<Wt(this.getExtent(),t,e))return n;for(var r=this.geometries_,o=0,a=r.length;o<a;++o)n=r[o].closestPointXY(t,e,i,n);return n},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)if(i[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){Qt(t);for(var e=this.geometries_,i=0,n=e.length;i<n;++i)ne(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return zh(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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 i=[],n=this.geometries_,r=!1,o=0,a=n.length;o<a;++o){var s=n[o],u=s.getSimplifiedGeometry(t);i.push(u),u!==s&&(r=!0)}if(r){var l=new e(null);return l.setGeometriesArray(i),l}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return _t},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)i[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var n=i;n||(n=ce(this.getExtent()));for(var r=this.geometries_,o=0,a=r.length;o<a;++o)r[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(zh(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)i[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Fi);function zh(t){for(var e=[],i=0,n=t.length;i<n;++i)e.push(t[i].clone());return e}var Bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Uh=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this)||this).dataProjection=li(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(i.defaultFeatureProjection=li(n.featureProjection)),i.geometryName_=n.geometryName,i.extractGeometryName_=n.extractGeometryName,i}return Bh(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,n=Xh((i="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 i!==void 0&&r.setGeometryName(i.geometry_name),r.setGeometry(n),"id"in i&&r.setId(i.id),i.properties&&r.setProperties(i.properties,!0),r},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var n=t.features,r=0,o=n.length;r<o;++r)i.push(this.readFeatureFromObject(n[r],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Xh(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=li(i.properties.name):"EPSG"===i.type?e=li("EPSG:"+i.properties.code):it(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(i.id=n),!t.hasProperties())return i;var r=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=Vh(o,e),delete r[t.getGeometryName()]),w(r)||(i.properties=r),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],n=0,r=t.length;n<r;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Vh(t,this.adaptOptions(e))},e}(Dh);function Xh(t,e){if(!t)return null;var i;switch(t.type){case lt:i=function(t){return new $i(t.coordinates)}(t);break;case ht:i=function(t){return new Pn(t.coordinates)}(t);break;case pt:i=function(t){return new dn(t.coordinates)}(t);break;case ft:i=function(t){return new Tl(t.coordinates)}(t);break;case dt:i=function(t){return new bl(t.coordinates)}(t);break;case gt:i=function(t){return new Rl(t.coordinates)}(t);break;case _t:i=function(t,e){var i=t.geometries.map((function(t){return Xh(t,e)}));return new Nh(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Lh(i,!1,e)}function Vh(t,e){var i,n=(t=Lh(t,!0,e)).getType();switch(n){case lt:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case ht:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case pt:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case ft:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case dt:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case gt:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case _t:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=m({},e);return delete i.featureProjection,Vh(t,i)}))}}(t,e);break;case vt:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return i}function Wh(t,e){return lc().createElementNS(t,e)}function Yh(t,e){return function t(e,i,n){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)i?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(e.nodeValue);else{var r=void 0;for(r=e.firstChild;r;r=r.nextSibling)t(r,i,n)}return n}(t,e,[]).join("")}function Kh(t){return"documentElement"in t}function Zh(t){return(new DOMParser).parseFromString(t,"application/xml")}function Hh(t,e){return function(i,n){var r=t.call(void 0!==e?e:this,i,n);void 0!==r&&d(n[n.length-1],r)}}function qh(t,e){return function(i,n){var r=t.call(void 0!==e?e:this,i,n);void 0!==r&&n[n.length-1].push(r)}}function Jh(t,e){return function(i,n){var r=t.call(void 0!==e?e:this,i,n);void 0!==r&&(n[n.length-1]=r)}}function Qh(t,e,i){return function(n,r){var o=t.call(void 0!==i?i:this,n,r);void 0!==o&&(r[r.length-1][void 0!==e?e:n.localName]=o)}}function $h(t,e){return function(i,n,r){t.call(void 0!==e?e:this,i,n,r),r[r.length-1].node.appendChild(i)}}function tc(t,e){var i=t;return function(t,n,r){var o=n[n.length-1].node,a=i;return void 0===a&&(a=r),Wh(void 0!==e?e:o.namespaceURI,a)}}var ec=tc();function ic(t,e){for(var i=e.length,n=new Array(i),r=0;r<i;++r)n[r]=t[e[r]];return n}function nc(t,e,i){var n,r,o=void 0!==i?i:{};for(n=0,r=t.length;n<r;++n)o[t[n]]=e;return o}function rc(t,e,i,n){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(n,r,i)}}}function oc(t,e,i,n,r){return n.push(t),rc(e,i,n,r),n.pop()}function ac(t,e,i,n,r,o,a){return r.push(t),function(t,e,i,n,r,o){for(var a,s,u=(void 0!==r?r:i).length,l=0;l<u;++l)void 0!==(a=i[l])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==r?r[l]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}(e,i,n,r,o,a),r.pop()}var sc=void 0;var uc=void 0;function lc(){return void 0===uc&&"undefined"!=typeof document&&(uc=document.implementation.createDocument("","",null)),uc}var hc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cc=function(t){function i(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===sc&&"undefined"!=typeof XMLSerializer&&(sc=new XMLSerializer),sc),e}return hc(i,t),i.prototype.getType=function(){return Za},i.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var i=Zh(t);return this.readFeatureFromDocument(i,e)}return Kh(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},i.prototype.readFeatureFromDocument=function(t,e){var i=this.readFeaturesFromDocument(t,e);return i.length>0?i[0]:null},i.prototype.readFeatureFromNode=function(t,e){return null},i.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var i=Zh(t);return this.readFeaturesFromDocument(i,e)}return Kh(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},i.prototype.readFeaturesFromDocument=function(t,e){for(var i=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(i,this.readFeaturesFromNode(n,e));return i},i.prototype.readFeaturesFromNode=function(t,i){return e()},i.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var i=Zh(t);return this.readGeometryFromDocument(i,e)}return Kh(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},i.prototype.readGeometryFromDocument=function(t,e){return null},i.prototype.readGeometryFromNode=function(t,e){return null},i.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Zh(t);return this.readProjectionFromDocument(e)}return Kh(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},i.prototype.readProjectionFromDocument=function(t){return this.dataProjection},i.prototype.readProjectionFromNode=function(t){return this.dataProjection},i.prototype.writeFeature=function(t,e){var i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)},i.prototype.writeFeatureNode=function(t,e){return null},i.prototype.writeFeatures=function(t,e){var i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)},i.prototype.writeFeaturesNode=function(t,e){return null},i.prototype.writeGeometry=function(t,e){var i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)},i.prototype.writeGeometryNode=function(t,e){return null},i}(Mh);function pc(t){var e,i=Yh(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(i))?void 0!==e[1]||!1:void 0}function fc(t){var e,i=Yh(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i))?parseFloat(e[1]):void 0}function dc(t){return Yh(t,!1).trim()}function gc(t,e){vc(t,e?"1":"0")}function _c(t,e){var i=e.toPrecision();t.appendChild(lc().createTextNode(i))}function vc(t,e){t.appendChild(lc().createTextNode(e))}var yc,mc,xc,Sc,wc,Cc,bc,Ec,Tc,Pc,Rc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fc=["http://www.google.com/kml/ext/2.2"],Oc=[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"],Ic={fraction:ha,pixels:ca,insetPixels:ca},Ac=nc(Oc,{ExtendedData:wp,Region:Cp,MultiGeometry:Qh(fp,"geometry"),LineString:Qh(hp,"geometry"),LinearRing:Qh(cp,"geometry"),Point:Qh(dp,"geometry"),Polygon:Qh(_p,"geometry"),Style:Qh(yp),StyleMap:function(t,e){var i=qc.call(this,t,e);if(!i)return;var n=e[e.length-1];Array.isArray(i)?n.Style=i:"string"==typeof i?n.styleUrl=i:it(!1,38)},address:Qh(dc),description:Qh(dc),name:Qh(dc),open:Qh(pc),phoneNumber:Qh(dc),styleUrl:Qh(Kc),visibility:Qh(pc)},nc(Fc,{MultiTrack:Qh((function(t,e){var i=oc([],np,t,e);if(!i)return;return new bl(i)}),"geometry"),Track:Qh(op,"geometry")})),Mc=nc(Oc,{ExtendedData:wp,Region:Cp,Link:function(t,e){rc(Lc,t,e)},address:Qh(dc),description:Qh(dc),name:Qh(dc),open:Qh(pc),phoneNumber:Qh(dc),visibility:Qh(pc)}),Lc=nc(Oc,{href:Qh(Kc)}),kc=nc(Oc,{LatLonAltBox:function(t,e){var i=oc({},Tp,t,e);if(!i)return;var n=e[e.length-1],r=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];n.extent=r,n.altitudeMode=i.altitudeMode,n.minAltitude=parseFloat(i.minAltitude),n.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,e){var i=oc({},Pp,t,e);if(!i)return;var n=e[e.length-1];n.minLodPixels=parseFloat(i.minLodPixels),n.maxLodPixels=parseFloat(i.maxLodPixels),n.minFadeExtent=parseFloat(i.minFadeExtent),n.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),Dc=nc(Oc,["Document","Placemark"]),Gc=nc(Oc,{Document:$h((function(t,e,i){ac({node:t},Ap,Mp,e,i,void 0,this)})),Placemark:$h(rf)}),jc=null,Nc=null,zc=null,Bc=null,Uc=null,Xc=null;var Vc=function(t){function e(e){var i=t.call(this)||this,n=e||{};return Xc||(jc=new wn({color:yc=[255,255,255,1]}),Nc=new Pa({anchor:mc=[20,2],anchorOrigin:pa,anchorXUnits:xc=ca,anchorYUnits:Sc=ca,crossOrigin:"anonymous",rotation:0,scale:bc=.5,size:wc=[64,64],src:Cc="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),Ec="NO_IMAGE",zc=new Rn({color:yc,width:1}),Tc=new Rn({color:[51,51,51,1],width:2}),Bc=new Lr({font:"bold 16px Helvetica",fill:jc,stroke:Tc,scale:.8}),Uc=new Pr({fill:jc,image:Nc,text:Bc,stroke:zc,zIndex:0}),Xc=[Uc]),i.dataProjection=li("EPSG:4326"),i.defaultStyle_=n.defaultStyle?n.defaultStyle:Xc,i.extractStyles_=void 0===n.extractStyles||n.extractStyles,i.writeStyles_=void 0===n.writeStyles||n.writeStyles,i.sharedStyles_={},i.showPointNames_=void 0===n.showPointNames||n.showPointNames,i.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",i}return Rc(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var i=oc([],nc(Oc,{Document:Hh(this.readDocumentOrFolder_,this),Folder:Hh(this.readDocumentOrFolder_,this),Placemark:qh(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return i||void 0},e.prototype.readPlacemark_=function(t,e){var i=oc({geometry:null},Ac,t,e,this);if(i){var n=new rt,r=t.getAttribute("id");null!==r&&n.setId(r);var o=e[0],a=i.geometry;if(a&&Lh(a,!1,o),n.setGeometry(a),delete i.geometry,this.extractStyles_){var s=function(t,e,i,n,r){return function(o,a){var s=r,u="",l=[];if(s){var h=o.getGeometry();if(h){var c=h.getType();s=c===_t?(l=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===lt||e===ft}))).length>0:c===lt||c===ft}}s&&(u=o.get("name"),(s=s&&!!u)&&u.search(/&[^&]+;/)>-1&&(Pc||(Pc=document.createElement("textarea")),Pc.innerHTML=u,u=Pc.value));var p=i;if(t?p=t:e&&(p=function t(e,i,n){return Array.isArray(e)?e:"string"==typeof e?(!(e in n)&&"#"+e in n&&(e="#"+e),t(n[e],i,n)):i}(e,i,n)),s){var f=function(t,e){var i=[0,0],n="start",r=t.getImage();if(r){var o=r.getImageSize();if(null===o&&(o=wc),2==o.length){var a=r.getScaleArray();i[0]=a[0]*o[0]/2,i[1]=-a[1]*o[1]/2,n="left"}}var s=t.getText();s?((s=s.clone()).setFont(s.getFont()||Bc.getFont()),s.setScale(s.getScale()||Bc.getScale()),s.setFill(s.getFill()||Bc.getFill()),s.setStroke(s.getStroke()||Tc)):s=Bc.clone();return s.setText(e),s.setOffsetX(i[0]),s.setOffsetY(i[1]),s.setTextAlign(n),new Pr({image:r,text:s})}(p[0],u);return l.length>0?(f.setGeometry(new Nh(l)),[f,new Pr({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(i.Style,i.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete i.Style,n.setProperties(i,!0),n}},e.prototype.readSharedStyle_=function(t,e){var i=t.getAttribute("id");if(null!==i){var n=yp.call(this,t,e);if(n){var r=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)r=new URL("#"+i,o).href;else r="#"+i;this.sharedStyles_[r]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var i=t.getAttribute("id");if(null!==i){var n=qc.call(this,t,e);if(n){var r,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)r=new URL("#"+i,o).href;else r="#"+i;this.sharedStyles_[r]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!c(Oc,t.namespaceURI))return null;var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(Oc,t.namespaceURI))return[];var i,n=t.localName;if("Document"==n||"Folder"==n)return(i=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r?[r]:[]}if("kml"==n){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&d(i,a)}return i}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Zh(t);return this.readNameFromDocument(e)}return Kh(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(e);if(i)return i}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(c(Oc,e.namespaceURI)&&"name"==e.localName)return dc(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var i=e.localName;if(c(Oc,e.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var i=Zh(t);d(e,this.readNetworkLinksFromDocument(i))}else Kh(t)?d(e,this.readNetworkLinksFromDocument(t)):d(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&d(e,this.readNetworkLinksFromNode(i));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(c(Oc,i.namespaceURI)&&"NetworkLink"==i.localName){var n=oc({},Mc,i,[]);e.push(n)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var r=i.localName;!c(Oc,i.namespaceURI)||"Document"!=r&&"Folder"!=r&&"kml"!=r||d(e,this.readNetworkLinksFromNode(i))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var i=Zh(t);d(e,this.readRegionFromDocument(i))}else Kh(t)?d(e,this.readRegionFromDocument(t)):d(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&d(e,this.readRegionFromNode(i));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(c(Oc,i.namespaceURI)&&"Region"==i.localName){var n=oc({},kc,i,[]);e.push(n)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var r=i.localName;!c(Oc,i.namespaceURI)||"Document"!=r&&"Folder"!=r&&"kml"!=r||d(e,this.readRegionFromNode(i))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=Wh(Oc[4],"kml"),n="http://www.w3.org/2000/xmlns/";i.setAttributeNS(n,"xmlns:gx",Fc[0]),i.setAttributeNS(n,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),i.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:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=Dc[i.namespaceURI],s=ic(o,a);return ac(r,Gc,ec,s,[e],a,this),i},e}(cc);function Wc(t){var e=Yh(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(i){var n=i[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function Yc(t){for(var e,i=Yh(t,!1),n=[],r=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=r.exec(i);){var o=parseFloat(e[1]),a=parseFloat(e[2]),s=e[3]?parseFloat(e[3]):0;n.push(o,a,s),i=i.substr(e[0].length)}if(""===i)return n}function Kc(t){var e=Yh(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function Zc(t){return fc(t)}var Hc=nc(Oc,{Pair:function(t,e){var i=oc({},bp,t,e,this);if(!i)return;var n=i.key;if(n&&"normal"==n){var r=i.styleUrl;r&&(e[e.length-1]=r);var o=i.Style;o&&(e[e.length-1]=o)}}});function qc(t,e){return oc(void 0,Hc,t,e,this)}var Jc=nc(Oc,{Icon:Qh((function(t,e){var i=oc({},ap,t,e);return i||null})),color:Qh(Wc),heading:Qh(fc),hotSpot:Qh((function(t){var e,i=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==i?"insetPixels"!==n?pa:da:"insetPixels"!==n?fa:ga,{x:parseFloat(t.getAttribute("x")),xunits:Ic[i],y:parseFloat(t.getAttribute("y")),yunits:Ic[n],origin:e}})),scale:Qh(Zc)});var Qc=nc(Oc,{color:Qh(Wc),scale:Qh(Zc)});var $c=nc(Oc,{color:Qh(Wc),width:Qh(fc)});var tp=nc(Oc,{color:Qh(Wc),fill:Qh(pc),outline:Qh(pc)});var ep=nc(Oc,{coordinates:Jh(Yc)});function ip(t,e){return oc(null,ep,t,e)}var np=nc(Fc,{Track:qh(op)});var rp=nc(Oc,{when:function(t,e){var i=e[e.length-1].whens,n=Yh(t,!1),r=Date.parse(n);i.push(isNaN(r)?0:r)}},nc(Fc,{coord:function(t,e){var i=e[e.length-1].flatCoordinates,n=Yh(t,!1),r=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(r){var o=parseFloat(r[1]),a=parseFloat(r[2]),s=parseFloat(r[3]);i.push(o,a,s,0)}else i.push(0,0,0,0)}}));function op(t,e){var i=oc({flatCoordinates:[],whens:[]},rp,t,e);if(i){for(var n=i.flatCoordinates,r=i.whens,o=0,a=Math.min(n.length,r.length);o<a;++o)n[4*o+3]=r[o];return new Pn(n,ut)}}var ap=nc(Oc,{href:Qh(Kc)},nc(Fc,{x:Qh(fc),y:Qh(fc),w:Qh(fc),h:Qh(fc)}));var sp=nc(Oc,{coordinates:Jh(Yc)});function up(t,e){return oc(null,sp,t,e)}var lp=nc(Oc,{extrude:Qh(pc),tessellate:Qh(pc),altitudeMode:Qh(dc)});function hp(t,e){var i=oc({},lp,t,e),n=up(t,e);if(n){var r=new Pn(n,at);return r.setProperties(i,!0),r}}function cp(t,e){var i=oc({},lp,t,e),n=up(t,e);if(n){var r=new dn(n,at,[n.length]);return r.setProperties(i,!0),r}}var pp=nc(Oc,{LineString:qh(hp),LinearRing:qh(cp),MultiGeometry:qh(fp),Point:qh(dp),Polygon:qh(_p)});function fp(t,e){var i,n=oc([],pp,t,e);if(!n)return null;if(0===n.length)return new Nh(n);for(var r=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){r=!1;break}if(r){var u=void 0,l=void 0;if(o==lt){var h=n[0];u=h.getLayout(),l=h.getFlatCoordinates();for(a=1,s=n.length;a<s;++a)d(l,n[a].getFlatCoordinates());mp(i=new Tl(l,u),n)}else o==ht?mp(i=new bl(n),n):o==pt?mp(i=new Rl(n),n):o==_t?i=new Nh(n):it(!1,37)}else i=new Nh(n);return i}function dp(t,e){var i=oc({},lp,t,e),n=up(t,e);if(n){var r=new $i(n,at);return r.setProperties(i,!0),r}}var gp=nc(Oc,{innerBoundaryIs:function(t,e){var i=oc(void 0,Rp,t,e);if(i){e[e.length-1].push(i)}},outerBoundaryIs:function(t,e){var i=oc(void 0,Fp,t,e);if(i){e[e.length-1][0]=i}}});function _p(t,e){var i=oc({},lp,t,e),n=oc([null],gp,t,e);if(n&&n[0]){for(var r=n[0],o=[r.length],a=1,s=n.length;a<s;++a)d(r,n[a]),o.push(r.length);var u=new dn(r,at,o);return u.setProperties(i,!0),u}}var vp=nc(Oc,{IconStyle:function(t,e){var i=oc({},Jc,t,e);if(i){var n,r,o,a,s=e[e.length-1],u="Icon"in i?i.Icon:{},l=!("Icon"in i)||Object.keys(u).length>0,h=u.href;h?n=h:l&&(n=Cc);var c,p=pa,f=i.hotSpot;f?(r=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):n===Cc?(r=mc,o=xc,a=Sc):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(r=[.5,0],o=ha,a=ha);var d,g=u.x,_=u.y;void 0!==g&&void 0!==_&&(c=[g,_]);var v,y=u.w,m=u.h;void 0!==y&&void 0!==m&&(d=[y,m]);var x=i.heading;void 0!==x&&(v=Fe(x));var S=i.scale,w=i.color;if(l){n==Cc&&(d=wc,void 0===S&&(S=bc));var C=new Pa({anchor:r,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:pa,rotation:v,scale:S,size:d,src:n,color:w});s.imageStyle=C}else s.imageStyle=Ec}},LabelStyle:function(t,e){var i=oc({},Qc,t,e);if(i){var n=e[e.length-1],r=new Lr({fill:new wn({color:"color"in i?i.color:yc}),scale:i.scale});n.textStyle=r}},LineStyle:function(t,e){var i=oc({},$c,t,e);if(i){var n=e[e.length-1],r=new Rn({color:"color"in i?i.color:yc,width:"width"in i?i.width:1});n.strokeStyle=r}},PolyStyle:function(t,e){var i=oc({},tp,t,e);if(i){var n=e[e.length-1],r=new wn({color:"color"in i?i.color:yc});n.fillStyle=r;var o=i.fill;void 0!==o&&(n.fill=o);var a=i.outline;void 0!==a&&(n.outline=a)}}});function yp(t,e){var i=oc({},vp,t,e,this);if(!i)return null;var n,r="fillStyle"in i?i.fillStyle:jc,o=i.fill;void 0===o||o||(r=null),"imageStyle"in i?i.imageStyle!=Ec&&(n=i.imageStyle):n=Nc;var a="textStyle"in i?i.textStyle:Bc,s="strokeStyle"in i?i.strokeStyle:zc,u=i.outline;return void 0===u||u?[new Pr({fill:r,image:n,stroke:s,text:a,zIndex:void 0})]:[new Pr({geometry:function(t){var e=t.getGeometry(),i=e.getType();return i===_t?new Nh(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==pt&&e!==gt}))):i!==pt&&i!==gt?e:void 0},fill:r,image:n,stroke:s,text:a,zIndex:void 0}),new Pr({geometry:function(t){var e=t.getGeometry(),i=e.getType();return i===_t?new Nh(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===gt}))):i===pt||i===gt?e:void 0},fill:r,stroke:null,zIndex:void 0})]}function mp(t,e){var i,n,r,o=e.length,a=new Array(e.length),s=new Array(e.length),u=new Array(e.length);i=!1,n=!1,r=!1;for(var l=0;l<o;++l){var h=e[l];a[l]=h.get("extrude"),s[l]=h.get("tessellate"),u[l]=h.get("altitudeMode"),i=i||void 0!==a[l],n=n||void 0!==s[l],r=r||u[l]}i&&t.set("extrude",a),n&&t.set("tessellate",s),r&&t.set("altitudeMode",u)}var xp=nc(Oc,{displayName:Qh(dc),value:Qh(dc)});var Sp=nc(Oc,{Data:function(t,e){var i=t.getAttribute("name");rc(xp,t,e);var n=e[e.length-1];i&&n.displayName?n[i]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==i?n[i]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){rc(Ep,t,e)}});function wp(t,e){rc(Sp,t,e)}function Cp(t,e){rc(kc,t,e)}var bp=nc(Oc,{Style:Qh(yp),key:Qh(dc),styleUrl:Qh(Kc)});var Ep=nc(Oc,{SimpleData:function(t,e){var i=t.getAttribute("name");if(null!==i){var n=dc(t);e[e.length-1][i]=n}}});var Tp=nc(Oc,{altitudeMode:Qh(dc),minAltitude:Qh(fc),maxAltitude:Qh(fc),north:Qh(fc),south:Qh(fc),east:Qh(fc),west:Qh(fc)});var Pp=nc(Oc,{minLodPixels:Qh(fc),maxLodPixels:Qh(fc),minFadeExtent:Qh(fc),maxFadeExtent:Qh(fc)});var Rp=nc(Oc,{LinearRing:Jh(ip)});var Fp=nc(Oc,{LinearRing:Jh(ip)});function Op(t,e){for(var i=Un(e),n=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],r=0;r<4;++r){var o=Math.floor(n[r]).toString(16);n[r]=1==o.length?"0"+o:o}vc(t,n.join(""))}var Ip=nc(Oc,{Data:$h((function(t,e,i){t.setAttribute("name",e.name);var n={node:t},r=e.value;"object"==typeof r?(null!==r&&r.displayName&&ac(n,Ip,ec,[r.displayName],i,["displayName"]),null!==r&&r.value&&ac(n,Ip,ec,[r.value],i,["value"])):ac(n,Ip,ec,[r],i,["value"])})),value:$h((function(t,e){vc(t,e)})),displayName:$h((function(t,e){!function(t,e){t.appendChild(lc().createCDATASection(e))}(t,e)}))});var Ap=nc(Oc,{Placemark:$h(rf)}),Mp=function(t,e,i){return Wh(e[e.length-1].node.namespaceURI,"Placemark")};var Lp=tc("Data");var kp=nc(Oc,["href"],nc(Fc,["x","y","w","h"])),Dp=nc(Oc,{href:$h(vc)},nc(Fc,{x:$h(_c),y:$h(_c),w:$h(_c),h:$h(_c)})),Gp=function(t,e,i){return Wh(Fc[0],"gx:"+i)};var jp=nc(Oc,["scale","heading","Icon","color","hotSpot"]),Np=nc(Oc,{Icon:$h((function(t,e,i){var n={node:t},r=i[i.length-1].node,o=kp[r.namespaceURI],a=ic(e,o);ac(n,Dp,ec,a,i,o),a=ic(e,o=kp[Fc[0]]),ac(n,Dp,Gp,a,i,o)})),color:$h(Op),heading:$h(_c),hotSpot:$h((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:$h(df)});var zp=nc(Oc,["color","scale"]),Bp=nc(Oc,{color:$h(Op),scale:$h(df)});var Up=nc(Oc,["color","width"]),Xp=nc(Oc,{color:$h(Op),width:$h(_c)});var Vp={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Wp=function(t,e,i){if(t)return Wh(e[e.length-1].node.namespaceURI,Vp[t.getType()])},Yp=tc("Point"),Kp=tc("LineString"),Zp=tc("LinearRing"),Hp=tc("Polygon"),qp=nc(Oc,{LineString:$h(sf),Point:$h(sf),Polygon:$h(pf),GeometryCollection:$h(Jp)});function Jp(t,e,i){var n,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===lt||e===ht||e===pt?a.push(t):it(!1,39)})),n=Wp):o===ft?(a=e.getPoints(),n=Yp):o===dt?(a=e.getLineStrings(),n=Kp):o===gt?(a=e.getPolygons(),n=Hp):it(!1,39),ac(r,qp,n,a,i)}var Qp=nc(Oc,{LinearRing:$h(sf)});function $p(t,e,i){ac({node:t},Qp,Zp,[e],i)}var tf=nc(Oc,{ExtendedData:$h((function(t,e,i){for(var n={node:t},r=e.names,o=e.values,a=r.length,s=0;s<a;s++)ac(n,Ip,Lp,[{name:r[s],value:o[s]}],i)})),MultiGeometry:$h(Jp),LineString:$h(sf),LinearRing:$h(sf),Point:$h(sf),Polygon:$h(pf),Style:$h((function(t,e,i){var n={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 u=i[i.length-1].node,l=gf[u.namespaceURI],h=ic(r,l);ac(n,_f,ec,h,i,l)})),address:$h(vc),description:$h(vc),name:$h(vc),open:$h(gc),phoneNumber:$h(vc),styleUrl:$h(vc),visibility:$h(gc)}),ef=nc(Oc,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),nf=tc("ExtendedData");function rf(t,e,i){var n={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 u=s(e,0);if(u){var l=Array.isArray(u)?u:[u],h=l;if(e.getGeometry()&&(h=l.filter((function(t){var i=t.getGeometryFunction()(e);if(i){var n=i.getType();return n===_t?i.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===lt||e===ft})).length:n===lt||n===ft}}))),this.writeStyles_){var c=l,p=l;e.getGeometry()&&(c=l.filter((function(t){var i=t.getGeometryFunction()(e);if(i){var n=i.getType();return n===_t?i.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ht||e===dt})).length:n===ht||n===dt}})),p=l.filter((function(t){var i=t.getGeometryFunction()(e);if(i){var n=i.getType();return n===_t?i.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===gt})).length:n===pt||n===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=i[i.length-1].node,g=ef[d.namespaceURI],_=ic(r,g);if(ac(n,tf,ec,_,i,g),a.length>0){var v=ic(r,a);ac(n,tf,nf,[{names:a,values:v}],i)}var y=i[0],m=e.getGeometry();m&&(m=Lh(m,!0,y)),ac(n,tf,Wp,[m],i)}var of=nc(Oc,["extrude","tessellate","altitudeMode","coordinates"]),af=nc(Oc,{extrude:$h(gc),tessellate:$h(gc),altitudeMode:$h(vc),coordinates:$h((function(t,e,i){var n,r=i[i.length-1],o=r.layout,a=r.stride;o==ot||o==st?n=2:o==at||o==ut?n=3:it(!1,34);var s=e.length,u="";if(s>0){u+=e[0];for(var l=1;l<n;++l)u+=","+e[l];for(var h=a;h<s;h+=a){u+=" "+e[h];for(l=1;l<n;++l)u+=","+e[h+l]}}vc(t,u)}))});function sf(t,e,i){var n=e.getFlatCoordinates(),r={node:t};r.layout=e.getLayout(),r.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var a=i[i.length-1].node,s=of[a.namespaceURI],u=ic(o,s);ac(r,af,ec,u,i,s)}var uf=nc(Oc,["color","fill","outline"]),lf=nc(Oc,{outerBoundaryIs:$h($p),innerBoundaryIs:$h($p)}),hf=tc("innerBoundaryIs"),cf=tc("outerBoundaryIs");function pf(t,e,i){var n=e.getLinearRings(),r=n.shift(),o={node:t};ac(o,lf,hf,n,i),ac(o,lf,cf,[r],i)}var ff=nc(Oc,{color:$h(Op),fill:$h(gc),outline:$h(gc)});function df(t,e){_c(t,Math.round(1e6*e)/1e6)}var gf=nc(Oc,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),_f=nc(Oc,{IconStyle:$h((function(t,e,i){var n={node:t},r={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),u={href:o};if(a){u.w=a[0],u.h=a[1];var l=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(u.x=h[0],u.y=s[1]-(h[1]+a[1])),l&&(l[0]!==a[0]/2||l[1]!==a[1]/2)){var c={x:l[0],xunits:ca,y:a[1]-l[1],yunits:ca};r.hotSpot=c}}r.Icon=u;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=i[i.length-1].node,_=jp[g.namespaceURI],v=ic(r,_);ac(n,Np,ec,v,i,_)})),LabelStyle:$h((function(t,e,i){var n={node:t},r={},o=e.getFill();o&&(r.color=o.getColor());var a=e.getScale();a&&1!==a&&(r.scale=a);var s=i[i.length-1].node,u=zp[s.namespaceURI],l=ic(r,u);ac(n,Bp,ec,l,i,u)})),LineStyle:$h((function(t,e,i){var n={node:t},r={color:e.getColor(),width:Number(e.getWidth())||1},o=i[i.length-1].node,a=Up[o.namespaceURI],s=ic(r,a);ac(n,Xp,ec,s,i,a)})),PolyStyle:$h((function(t,e,i){var n={node:t},r=e.getFill(),o=e.getStroke(),a={color:r?r.getColor():void 0,fill:!!r&&void 0,outline:!!o&&void 0},s=i[i.length-1].node,u=uf[s.namespaceURI],l=ic(a,u);ac(n,ff,ec,l,i,u)}))});var vf,yf=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function mf(t,e){for(var i=yf.length,n=0;n<i;++n)try{var r=t.getContext(yf[n],e);if(r)return r}catch(t){}return null}var xf=35044,Sf=function(){function t(t,e){this.array=null,this.type=t,it(34962===t||34963===t,62),this.usage=void 0!==e?e:xf}return t.prototype.ofSize=function(t){this.array=new(wf(this.type))(t)},t.prototype.fromArray=function(t){this.array=wf(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(wf(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function wf(t){switch(t){case 34962:return Float32Array;case 34963:return Uint32Array;default:return Float32Array}}var Cf="webglcontextlost",bf="webglcontextrestored",Ef=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 i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(i);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,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(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),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(i){this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;var n=e.RGBA,r=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,i[0],i[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 i=this.getGL(),n=t.size;i.bindFramebuffer(i.FRAMEBUFFER,e?e.getFrameBuffer():null),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,this.renderTargetTexture_),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),i.bindBuffer(i.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),i.useProgram(this.renderTargetProgram_),i.enableVertexAttribArray(this.renderTargetAttribLocation_),i.vertexAttribPointer(this.renderTargetAttribLocation_,2,i.FLOAT,!1,0,0),i.uniform2f(this.renderTargetUniformLocation_,n[0],n[1]),i.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),i.drawArrays(i.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,i=this.getGL(),n=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=i.createTexture()),i.activeTexture(i["TEXTURE"+n]),i.bindTexture(i.TEXTURE_2D,r.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),e instanceof ImageData?i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,e.width,e.height,0,i.UNSIGNED_BYTE,new Uint8Array(e.data)):i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),i.uniform1i(r.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void i.uniform2f(r.location,e[0],e[1]);case 3:return void i.uniform3f(r.location,e[0],e[1],e[2]);case 4:return void i.uniform4f(r.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&i.uniform1f(r.location,e)}))},t}();function Tf(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 Pf=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rf="u_projectionMatrix",Ff="u_offsetScaleMatrix",Of="u_offsetRotateMatrix",If="u_time",Af="u_zoom",Mf="u_resolution",Lf={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},kf=function(t){function e(e){var i=t.call(this)||this,n=e||{};i.boundHandleWebGLContextLost_=i.handleWebGLContextLost.bind(i),i.boundHandleWebGLContextRestored_=i.handleWebGLContextRestored.bind(i),i.canvas_=document.createElement("canvas"),i.canvas_.style.position="absolute",i.canvas_.style.left="0",i.gl_=mf(i.canvas_);var r=i.getGL();if(i.bufferCache_={},i.currentProgram_=null,it(c(function(){if(!vf){var t=mf(document.createElement("canvas"));t&&(vf=t.getSupportedExtensions())}return vf}(),"OES_element_index_uint"),63),r.getExtension("OES_element_index_uint"),i.canvas_.addEventListener(Cf,i.boundHandleWebGLContextLost_),i.canvas_.addEventListener(bf,i.boundHandleWebGLContextRestored_),i.offsetRotateMatrix_=[1,0,0,1,0,0],i.offsetScaleMatrix_=[1,0,0,1,0,0],i.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i.uniformLocations_={},i.attribLocations_={},i.uniforms_=[],n.uniforms)for(var o in n.uniforms)i.uniforms_.push({name:o,value:n.uniforms[o]});return i.postProcessPasses_=n.postProcesses?n.postProcesses.map((function(t){return new Ef({webGlContext:r,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new Ef({webGlContext:r})],i.shaderCompileErrors_=null,i.startTime_=Date.now(),i}return Pf(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),i=n(t),r=this.bufferCache_[i];r||(r={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[i]=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(),i=n(t),r=this.bufferCache_[i];e.isContextLost()||e.deleteBuffer(r.buffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(Cf,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(bf,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),i=this.getCanvas(),n=t.size,r=t.pixelRatio;i.width=n[0]*r,i.height=n[1]*r,i.style.width=n[0]+"px",i.style.height=n[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,i){var n=this.getGL(),r=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,r[0],r[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,i?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var i=this.getGL(),n=i.UNSIGNED_INT,r=e-t,o=4*t;i.drawElements(i.TRIANGLES,r,n,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,i=t.viewState.rotation,n=Et(this.offsetScaleMatrix_);!function(t,e,i){Tt(t,Pt(bt,e,0,0,i,0,0))}(n,2/e[0],2/e[1]);var r=Et(this.offsetRotateMatrix_);0!==i&&function(t,e){var i=Math.cos(e),n=Math.sin(e);Tt(t,Pt(bt,i,n,-n,i,0,0))}(r,-i),this.setUniformMatrixValue(Ff,Tf(this.tmpMat4_,n)),this.setUniformMatrixValue(Of,Tf(this.tmpMat4_,r)),this.setUniformFloatValue(If,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Af,t.viewState.zoom),this.setUniformFloatValue(Mf,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,i=this.getGL(),n=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=i.createTexture()),i.activeTexture(i["TEXTURE"+n]),i.bindTexture(i.TEXTURE_2D,r.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&r.prevValue!==e&&(r.prevValue=e,i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e)),i.uniform1i(this.getUniformLocation(r.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(r.name,Tf(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void i.uniform2f(this.getUniformLocation(r.name),e[0],e[1]);case 3:return void i.uniform3f(this.getUniformLocation(r.name),e[0],e[1],e[2]);case 4:return void i.uniform4f(this.getUniformLocation(r.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&i.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 i=this.getGL(),n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n},e.prototype.getProgram=function(t,e){var i=this.getGL(),n=this.compileShader(t,i.FRAGMENT_SHADER),r=this.compileShader(e,i.VERTEX_SHADER);this.shaderCompileErrors_=null,i.getShaderInfoLog(n)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+i.getShaderInfoLog(n)),i.getShaderInfoLog(r)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+i.getShaderInfoLog(r));var o=i.createProgram();return i.attachShader(o,n),i.attachShader(o,r),i.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 i=t.size,n=t.viewState.rotation,r=t.viewState.resolution,o=t.viewState.center;return Et(e),Ft(e,0,0,2/(r*i[0]),2/(r*i[1]),-n,-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,i,n,r){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,i,!1,n,r))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,i=0;i<t.length;i++){var n=t[i];e+=n.size*Df(n.type)}return e}(t),i=0,n=0;n<t.length;n++){var r=t[n];this.enableAttributeArray_(r.name,r.size,r.type||5126,e,i),i+=r.size*Df(r.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,i){var n=this.getGL(),r=i||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,r),e?n.texImage2D(n.TEXTURE_2D,0,o,a,s,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),r},e}(l);function Df(t){switch(t){case Lf.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Lf.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Lf.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Lf.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var Gf=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),jf="GENERATE_BUFFERS",Nf=function(t){function e(e,i){var n=t.call(this,e)||this,r=i||{};return n.helper=new kf({postProcesses:r.postProcesses,uniforms:r.uniforms}),n}return Gf(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e}(ko);var zf=new Uint8Array(4),Bf=function(){function t(t,e){this.helper_=t;var i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.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 zf[0]=0,zf[1]=0,zf[2]=0,zf[3]=0,zf;this.readAll();var i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return zf[0]=this.data_[4*i],zf[1]=this.data_[4*i+1],zf[2]=this.data_[4*i+2],zf[3]=this.data_[4*i+3],zf},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}(),Uf=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"}),Xf=URL.createObjectURL(Uf);var Vf=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wf=function(t){function e(e,i){var r=this,o=i.uniforms||{},a=[1,0,0,1,0,0];o[Rf]=a,(r=t.call(this,e,{uniforms:o,postProcesses:i.postProcesses})||this).sourceRevision_=-1,r.verticesBuffer_=new Sf(34962,35048),r.hitVerticesBuffer_=new Sf(34962,35048),r.indicesBuffer_=new Sf(34963,35048),r.program_=r.helper.getProgram(i.fragmentShader,i.vertexShader),r.hitDetectionEnabled_=!(!i.hitFragmentShader||!i.hitVertexShader),r.hitProgram_=r.hitDetectionEnabled_&&r.helper.getProgram(i.hitFragmentShader,i.hitVertexShader);var s=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Lf.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:Lf.FLOAT},{name:"a_index",size:1,type:Lf.FLOAT}].concat(s),r.hitDetectionAttributes=[{name:"a_position",size:2,type:Lf.FLOAT},{name:"a_index",size:1,type:Lf.FLOAT},{name:"a_hitColor",size:4,type:Lf.FLOAT},{name:"a_featureUid",size:1,type:Lf.FLOAT}].concat(s),r.customAttributes=i.attributes?i.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 Bf(r.helper),r.worker_=new Worker(Xf),r.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===jf){var i=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_=i,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 u=r.getLayer().getSource();return r.sourceListenKeys_=[N(u,za,r.handleSourceFeatureAdded_,r),N(u,Ba,r.handleSourceFeatureChanged_,r),N(u,Xa,r.handleSourceFeatureDelete_,r),N(u,Ua,r.handleSourceFeatureClear_,r)],u.forEachFeature(function(t){this.featureCache_[n(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(r)),r}return Vf(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[n(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[n(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[n(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 i=this.helper.getCanvas(),n=t.layerStatesArray[t.layerIndex].opacity;return n!==parseFloat(i.style.opacity)&&(i.style.opacity=String(n)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),i},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource(),n=t.viewState,r=!t.viewHints[aa]&&!t.viewHints[sa],o=!ie(this.previousExtent_,t.extent),a=this.sourceRevision_<i.getRevision();if(a&&(this.sourceRevision_=i.getRevision()),r&&(o||a)){var s=n.projection,u=n.resolution,l=e instanceof eo?e.getRenderBuffer():0,h=Xt(t.extent,l*u);i.loadFeatures(h,u,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 i,n,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,u,l=[],h=[],c=0,p=0;for(var f in this.featureCache_)if((n=(i=this.featureCache_[f]).geometry)&&n.getType()===lt){l[0]=n.getFlatCoordinates()[0],l[1]=n.getFlatCoordinates()[1],Rt(e,l),s=p+6,u=void 0,(u=h||[])[0]=Math.floor(s/256/256/256)/255,u[1]=Math.floor(s/256/256)%256/255,u[2]=Math.floor(s/256)%256/255,u[3]=s%256/255,a=u,this.renderInstructions_[c++]=l[0],this.renderInstructions_[c++]=l[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=l[0],this.hitRenderInstructions_[p++]=l[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(i.feature,i.properties),this.renderInstructions_[c++]=d,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=d)}var _={type:jf,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(_.projectionTransform=e,this.worker_.postMessage(_,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var v={type:jf,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};v.projectionTransform=e,v.hitDetection=!0,this.worker_.postMessage(v,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){if(it(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]),u=this.hitRenderInstructions_[s],l=Math.floor(u).toString(),h=this.getLayer().getSource().getFeatureByUid(l);return h?n(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}(Nf),Yf=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kf="blur",Zf="gradient",Hf="radius",qf=["#00f","#0ff","#0f0","#ff0","#f00"],Jf=function(t){function e(e){var i=this,n=e||{},r=m({},n);delete r.gradient,delete r.radius,delete r.blur,delete r.weight,(i=t.call(this,r)||this).gradient_=null,i.addEventListener(H(Zf),i.handleGradientChanged_),i.setGradient(n.gradient?n.gradient:qf),i.setBlur(void 0!==n.blur?n.blur:15),i.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return i.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return Yf(e,t),e.prototype.getBlur=function(){return this.get(Kf)},e.prototype.getGradient=function(){return this.get(Zf)},e.prototype.getRadius=function(){return this.get(Hf)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=tr(1,256),i=e.createLinearGradient(0,0,1,256),n=1/(t.length-1),r=0,o=t.length;r<o;++r)i.addColorStop(r*n,t[r]);return e.fillStyle=i,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Kf,t)},e.prototype.setGradient=function(t){this.set(Zf,t)},e.prototype.setRadius=function(t){this.set(Hf,t)},e.prototype.createRenderer=function(){return new Wf(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(Hf)+this.get(Kf))}.bind(this),u_blurSlope:function(){return this.get(Hf)/Math.max(1,this.get(Kf))}.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}(ka);var Qf=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$f=function(t){function e(e){var i=e||{};return t.call(this,i)||this}return Qf(e,t),e}(Jr),td=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ed=function(t){function e(e){var i=t.call(this,e)||this;return i.image_=null,i}return td(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,n=t.viewState,r=n.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=ge(s,Ci(e.extent,n.projection))),!a[aa]&&!a[sa]&&!xe(s))if(o){var u=n.projection,l=o.getImage(s,r,i,u);l&&this.loadImage(l)&&(this.image_=l)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var i=this.image_,n=i.getExtent(),r=i.getResolution(),o=i.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,u=t.viewState,l=u.center,h=u.resolution,c=t.size,p=s*r/(h*o),f=Math.round(c[0]*s),d=Math.round(c[1]*s),g=u.rotation;if(g){var _=Math.round(Math.sqrt(f*f+d*d));f=_,d=_}Ft(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,g,-f/2,-d/2),Ot(this.inversePixelTransform,this.pixelTransform);var v=wr(this.pixelTransform);this.useContainer(e,v,a.opacity);var y=this.context,x=y.canvas;x.width!=f||x.height!=d?(x.width=f,x.height=d):this.containerReused||y.clearRect(0,0,f,d);var S=!1;if(a.extent){var w=Ci(a.extent,u.projection);(S=!Kt(w,t.extent)&&me(w,t.extent))&&this.clipUnrotated(y,t,w)}var C=i.getImage(),b=Ft(this.tempTransform,f/2,d/2,p,p,0,o*(n[0]-l[0])/r,o*(l[1]-n[3])/r);this.renderedResolution=r*s/o;var E=b[4],T=b[5],P=C.width*b[0],R=C.height*b[3];if(m(y,this.getLayer().getSource().getContextOptions()),this.preRender(y,t),P>=.5&&R>=.5){var F=a.opacity,O=void 0;1!==F&&(O=this.context.globalAlpha,this.context.globalAlpha=F),this.context.drawImage(C,0,0,+C.width,+C.height,Math.round(E),Math.round(T),Math.round(P),Math.round(R)),1!==F&&(this.context.globalAlpha=O)}return this.postRender(y,t),S&&y.restore(),v!==x.style.transform&&(x.style.transform=v),this.container},e}(No),id=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nd=function(t){function e(e){return t.call(this,e)||this}return id(e,t),e.prototype.createRenderer=function(){return new ed(this)},e}($f),rd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),od=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new Oh(0,0,0,0),i}return rd(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==es||i==ns||i==is&&!n},e.prototype.getTile=function(t,e,i,n){var r=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,r,o);return s.getState()==is&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(es)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,o=r.projection,a=r.resolution,s=r.center,u=r.rotation,l=t.pixelRatio,c=this.getLayer(),p=c.getSource(),f=p.getRevision(),d=p.getTileGridForProjection(o),g=d.getZForResolution(a,p.zDirection),_=d.getResolution(g),v=t.extent,y=i.extent&&Ci(i.extent);y&&(v=ge(v,Ci(i.extent)));var x=p.getTilePixelRatio(l),S=Math.round(t.size[0]*x),w=Math.round(t.size[1]*x);if(u){var C=Math.round(Math.sqrt(S*S+w*w));S=C,w=C}var b=_*S/2/x,E=_*w/2/x,T=[s[0]-b,s[1]-E,s[0]+b,s[1]+E],P=d.getTileRangeForExtentAndZ(v,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=n(this);if(L.getState()==es){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,u,-S/2,-w/2);var z=wr(this.pixelTransform);this.useContainer(e,z,i.opacity);var B=this.context,U=B.canvas;Ot(this.inversePixelTransform,this.pixelTransform),Ft(this.tempTransform,S/2,w/2,N,N,0,-S/2,-w/2),U.width!=S||U.height!=w?(U.width=S,U.height=w):this.containerReused||B.clearRect(0,0,S,w),y&&this.clipUnrotated(B,t,y),m(B,p.getContextOptions()),this.preRender(B,t),this.renderedTiles.length=0;var X,V,W,Y=Object.keys(R).map(Number);Y.sort(h),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(X=[],V=[]):Y=Y.reverse();for(var K=Y.length-1;K>=0;--K){var Z=Y[K],H=p.getTilePixelSize(Z,l,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])/_]),it=x*p.getGutterForProjection(o),nt=R[Z];for(var rt in nt){var ot=(L=nt[rt]).tileCoord,at=et[0]-($[1]-ot[1])*J,st=Math.round(at+J),ut=et[1]-($[2]-ot[2])*Q,lt=Math.round(ut+Q),ht=st-(A=Math.round(at)),ct=lt-(M=Math.round(ut)),pt=g===Z;if(!(D=pt&&1!==L.getAlpha(n(this),t.time)))if(X){B.save(),W=[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<V[ft]){var gt=X[ft];B.beginPath(),B.moveTo(W[0],W[1]),B.lineTo(W[2],W[3]),B.lineTo(W[4],W[5]),B.lineTo(W[6],W[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(W),V.push(Z)}else B.clearRect(A,M,ht,ct);this.drawTileImage(L,t,A,M,ht,ct,it,pt,i.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_||!ie(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,p,d,l,o,v,g,c.getPreload()),this.scheduleExpireCache(t,p),this.postRender(B,t),i.extent&&B.restore(),z!==U.style.transform&&(U.style.transform=z),this.container},e.prototype.drawTileImage=function(t,e,i,r,o,a,s,u,l){var h=this.getTileImage(t);if(h){var c=n(this),p=u?t.getAlpha(c,e.time):1,f=l*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,i,r,o,a),d&&this.context.restore(),1!==p?e.animate=!0:u&&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 i=function(t,e,i){var r=n(t);r in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var r=n(e);r in t||(t[r]={}),t[r][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,r,o,a,s,u,l){var h=n(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,_,v=t.wantedTiles[h],y=t.tileQueue,m=0;for(_=i.getMinZoom();_<=s;++_)for(p=i.getTileRangeForExtentAndZ(a,_,p),f=i.getResolution(_),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)s-_<=u?(++m,(c=e.getTile(_,d,g,r,o)).getState()==$a&&(v[c.getKey()]=!0,y.isKeyQueued(c.getKey())||y.enqueue([c,h,i.getTileCoordCenter(c.tileCoord),f])),void 0!==l&&l(c)):e.useTile(_,d,g,o);e.updateCacheSize(m,o)},e}(No);od.prototype.getLayer;var ad="preload",sd="useInterimTilesOnError",ud="tileloadstart",ld="tileloadend",hd="tileloaderror",cd=[0,0,0],pd=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,it((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||h,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,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,it(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=_e(s)),it(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,it(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,it(!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 Oh(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,i){for(var n=this.getTileRangeForExtentAndZ(t,e),r=n.minX,o=n.maxX;r<=o;++r)for(var a=n.minY,s=n.maxY;a<=s;++a)i([e,r,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,n){var r,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?Ih(r=Math.floor(r/2),r,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(a,s,i)))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,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],r=2*t[2];return Ih(n,n+1,r,r+1,e)}var o=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),r=this.getResolution(t),o=Dn(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*r,s=n[0]+(e.maxX+1)*o[0]*r;return Jt(a,n[1]+e.minY*o[1]*r,s,n[1]+(e.maxY+1)*o[1]*r,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=cd;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var r=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Ih(r,n[1],o,n[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Dn(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Dn(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*r[0]*n,a=i[1]-(t[2]+1)*r[1]*n;return Jt(o,a,o+r[0]*n,a+r[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,r){var o=this.getZForResolution(i),a=i/this.getResolution(o),s=this.getOrigin(o),u=Dn(this.getTileSize(o),this.tmpSize_),l=n?.5:0,h=n?.5:0,c=Math.floor((t-s[0])/i+l),p=Math.floor((s[1]-e)/i+h),f=a*c/u[0],d=a*p/u[1];return n?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),bh(o,f,d,r)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,r){var o=this.getOrigin(i),a=this.getResolution(i),s=Dn(this.getTileSize(i),this.tmpSize_),u=n?.5:0,l=n?.5:0,h=Math.floor((t-o[0])/a+u),c=Math.floor((o[1]-e)/a+l),p=h/s[0],f=c/s[1];return n?(p=Math.ceil(p)-1,f=Math.ceil(f)-1):(p=Math.floor(p),f=Math.floor(f)),bh(i,p,f,r)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]: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,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i},t}();function fd(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,i,n){return function(t,e,i,n){var r=void 0!==n?n:Lt,o=gd(t,e,i);return new pd({extent:t,origin:pe(t,r),resolutions:o,tileSize:i})}(_d(t),e,i,n)}(t),t.setDefaultTileGrid(e)),e}function dd(t){var e=t||{},i=e.extent||li("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:gd(i,e.maxZoom,e.tileSize,e.maxResolution)};return new pd(n)}function gd(t,e,i,n){for(var r=void 0!==e?e:42,o=de(t),a=ye(t),s=Dn(void 0!==i?i:256),u=n>0?n:Math.max(a/s[0],o/s[1]),l=r+1,h=new Array(l),c=0;c<l;++c)h[c]=u/Math.pow(2,c);return h}function _d(t){var e=(t=li(t)).getExtent();if(!e){var i=180*Ct[yt]/t.getMetersPerUnit();e=Jt(-i,-i,i,i)}return e}var vd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yd=function(t){function i(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=e.tileGrid;return n&&Dn(n.getTileSize(n.getMinZoom()),[256,256]),i.tileCache=new Fh(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return vd(i,t),i.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},i.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},i.prototype.forEachLoadedTile=function(t,e,i,n){var r=this.getTileCacheForProjection(t);if(!r)return!1;for(var o,a,s,u=!0,l=i.minX;l<=i.maxX;++l)for(var h=i.minY;h<=i.maxY;++h)a=Eh(e,l,h),s=!1,r.containsKey(a)&&(s=(o=r.get(a)).getState()===es)&&(s=!1!==n(o)),s||(u=!1);return u},i.prototype.getGutterForProjection=function(t){return 0},i.prototype.getKey=function(){return this.key_},i.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},i.prototype.getOpaque=function(t){return this.opaque_},i.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},i.prototype.getTile=function(t,i,n,r,o){return e()},i.prototype.getTileGrid=function(){return this.tileGrid},i.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:fd(t)},i.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!fi(e,t)?null:this.tileCache},i.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},i.prototype.getTilePixelSize=function(t,e,i){var n=this.getTileGridForProjection(i),r=this.getTilePixelRatio(e),o=Dn(n.getTileSize(t),this.tmpSize);return 1==r?o:kn(o,r,this.tmpSize)},i.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],r=t.getTileCoordCenter(e),o=_d(i);if(Yt(o,r))return e;var a=ye(o),s=Math.ceil((o[0]-r[0])/a);return r[0]+=a*s,t.getTileCoordForCoordAndZ(r,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o,a=e.getExtent();return!(o=a?e.getTileRangeForExtentAndZ(a,i):e.getFullTileRange(i))||o.containsXY(n,r)}(t,n)?t:null},i.prototype.clear=function(){this.tileCache.clear()},i.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},i.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},i.prototype.useTile=function(t,e,i,n){},i}(ja),md=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return vd(e,t),e}(s);function xd(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(a,s,u){return a?t.replace(i,a[0].toString()).replace(n,a[1].toString()).replace(r,a[2].toString()).replace(o,(function(){var t=a[0],i=e.getFullTileRange(t);return it(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function Sd(t){return 1===t.length?t[0]:function(e,i,n){if(e){var r=Oe(Ph(e),t.length);return t[r](e,i,n)}}}var wd,Cd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bd=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction.bind(n)),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return Cd(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,i=t.target,r=n(i),o=i.getState();o==ts?(this.tileLoadingKeys_[r]=!0,e=ud):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=o==is?hd:o==es?ld:void 0),null!=e&&this.dispatchEvent(new md(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),r=i[2].charCodeAt(0),o=void 0;for(o=n;o<=r;++o)e.push(t.replace(i[0],String.fromCharCode(o)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[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 i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=xd(t[r],e);return Sd(n)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var n=Eh(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(yd),Ed=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Td=function(t){function e(e){var i=this,n=e||{},r=m({},n);return delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return Ed(e,t),e.prototype.getPreload=function(){return this.get(ad)},e.prototype.setPreload=function(t){this.set(ad,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(sd)},e.prototype.setUseInterimTilesOnError=function(t){this.set(sd,t)},e}(Jr),Pd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rd=function(t){function e(e){return t.call(this,e)||this}return Pd(e,t),e.prototype.createRenderer=function(){return new od(this)},e}(Td),Fd=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=gi(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_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&ye(n)==ye(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ye(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ye(this.targetProj_.getExtent()):null;var u=_e(i),l=ve(i),h=he(i),c=le(i),p=this.transformInv_(u),f=this.transformInv_(l),d=this.transformInv_(h),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(Ee(ue(i)/(o*o*256*256)))):0);if(this.addQuad_(u,l,h,c,p,f,d,g,_),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,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])-v>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]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,n,r,o){this.triangles_.push({source:[n,r,o],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,n,r,o,a,s,u){var l=Ut([r,o,a,s]),h=this.sourceWorldWidth_?ye(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=ye(Ut([t,e,i,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3]))||me(l,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(u>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(u>0){if(!f){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(g),v=void 0;if(p)v=(Oe(r[0],c)+Oe(a[0],c))/2-Oe(_[0],c);else v=(r[0]+a[0])/2-_[0];var y=(r[1]+a[1])/2-_[1];f=v*v+y*y>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var m=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(m),S=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(S);this.addQuad_(t,e,m,S,r,o,x,w,u-1),this.addQuad_(S,m,i,n,w,x,a,s,u-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],b=this.transformInv_(C),E=[(i[0]+n[0])/2,(i[1]+n[1])/2],T=this.transformInv_(E);this.addQuad_(t,C,E,n,r,b,T,s,u-1),this.addQuad_(C,e,i,E,b,o,a,T,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,n,r,a,s),0==(14&d)&&this.addTriangle_(t,i,e,r,a,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,s,r),0==(7&d)&&this.addTriangle_(e,n,i,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;re(t,r[0]),re(t,r[1]),re(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Od={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Id(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function Ad(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Md(t,e,i,n){var r=_i(i,e,t),o=hi(e,n,i),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var u=t.getExtent();if(!u||Yt(u,r)){var l=hi(t,o,r)/o;isFinite(l)&&l>0&&(o/=l)}return o}function Ld(t,e,i,n,r,o,a,s,u,l,h,c){var p=tr(Math.round(i*t),Math.round(i*e));if(m(p,c),0===u.length)return p.canvas;function f(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,e,i){ne(d,t.extent)}));var g=ye(d),_=de(d),v=tr(Math.round(i*g/n),Math.round(i*_/n));m(v,c);var y=i/n;u.forEach((function(t,e,i){var n=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=ye(t.extent),a=de(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,n*y,r*y,o*y,a*y)}));var x=_e(a);return s.getTriangles().forEach((function(t,e,r){var a=t.source,s=t.target,u=a[0][0],l=a[0][1],h=a[1][0],g=a[1][1],_=a[2][0],y=a[2][1],m=f((s[0][0]-x[0])/o),S=f(-(s[0][1]-x[1])/o),w=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=u,P=l;u=0,l=0;var R=function(t){for(var e=t.length,i=0;i<e;i++){for(var n=i,r=Math.abs(t[i][i]),o=i+1;o<e;o++){var a=Math.abs(t[o][i]);a>r&&(r=a,n=o)}if(0===r)return null;var s=t[n];t[n]=t[i],t[i]=s;for(var u=i+1;u<e;u++)for(var l=-t[u][i]/t[i][i],h=i;h<e+1;h++)i==h?t[u][h]=0:t[u][h]+=l*t[i][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,g-=P,0,0,w-m],[_-=T,y-=P,0,0,b-m],[0,0,h,g,C-S],[0,0,_,y,E-S]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===wd){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Id(t,4,5,4,0),Id(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;wd=Ad(e,0)||Ad(e,4)||Ad(e,8)}return wd}()||c===Od){p.moveTo(w,C);for(var F=m-w,O=S-C,I=0;I<4;I++)p.lineTo(w+f((I+1)*F/4),C+f(I*O/3)),3!=I&&p.lineTo(w+f((I+1)*F/4),C+f((I+1)*O/3));p.lineTo(b,E)}else p.moveTo(w,C),p.lineTo(m,S),p.lineTo(b,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],m,S),p.translate(d[0]-T,d[3]-P),p.scale(n/i,-n/i),p.drawImage(v.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-x[0])/o,a=-(n[0][1]-x[1])/o,s=(n[1][0]-x[0])/o,u=-(n[1][1]-x[1])/o,l=(n[2][0]-x[0])/o,h=-(n[2][1]-x[1])/o;p.beginPath(),p.moveTo(s,u),p.lineTo(r,a),p.lineTo(l,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var kd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dd=function(t){function e(e,i,n,r,o,a,s,u,l,h,c,p){var f=t.call(this,o,$a)||this;f.renderEdges_=void 0!==c&&c,f.contextOptions_=p,f.pixelRatio_=s,f.gutter_=u,f.canvas_=null,f.sourceTileGrid_=i,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(),v=g?ge(d,g):d;if(0===ue(v))return f.state=ns,f;var y=e.getExtent();y&&(_=_?ge(_,y):y);var m=r.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=ce(i),o=Md(t,e,r,n);return(!isFinite(o)||o<=0)&&se(i,(function(i){return o=Md(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,v,m);if(!isFinite(x)||x<=0)return f.state=ns,f;var S=void 0!==h?h:.5;if(f.triangulation_=new Fd(e,n,v,_,x*S,m),0===f.triangulation_.getTriangles().length)return f.state=ns,f;f.sourceZ_=i.getZForResolution(x);var w=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(w[1]=Ce(w[1],_[1],_[3]),w[3]=Ce(w[3],_[1],_[3])):w=ge(w,_)),ue(w)){for(var C=i.getTileRangeForExtentAndZ(w,f.sourceZ_),b=C.minX;b<=C.maxX;b++)for(var E=C.minY;E<=C.maxY;E++){var T=l(f.sourceZ_,b,E,s);T&&f.sourceTiles_.push(T)}0===f.sourceTiles_.length&&(f.state=ns)}else f.state=ns;return f}return kd(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==es&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=is;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Ld(n,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=es}this.changed()},e.prototype.load=function(){if(this.state==$a){this.state=ts,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==$a||r==ts){t++;var o=N(e,E,(function(i){var n=e.getState();n!=es&&n!=is&&n!=ns||(B(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){t.getState()==$a&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(B),this.sourcesListenerKeys_=null},e}(ls),Gd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),jd=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Nd,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:cs,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?Od:void 0,i.renderReprojectionEdges_=!1,i}return Gd(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!fi(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&&!fi(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!fi(e,t)){var i=n(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=fd(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||fi(e,t))return this.tileCache;var i=n(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Fh(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,r),u=s?this.tileUrlFunction(s,n,r):void 0,l=new this.tileClass(a,void 0!==u?$a:ns,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(E,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!fi(o,r)){var a=this.getTileCacheForProjection(r),s=[t,e,i],u=void 0,l=Th(s);a.containsKey(l)&&(u=a.get(l));var h=this.getKey();if(u&&u.key==h)return u;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(s,r),d=new Dd(o,c,r,p,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return d.key=h,u?(d.interimTile=u,d.refreshInterimChain(),a.replace(l,d)):a.set(l,d),d}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,a=Eh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var u=o;o=this.createTile_(t,e,i,n,r,s),u.getState()==$a?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,i,n,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 i=li(t);if(i){var r=n(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(bd);function Nd(t,e){t.getImage().src=e}var zd=1,Bd=2,Ud=4,Xd=8,Vd=16,Wd=31,Yd={};function Kd(t){if("number"==typeof t)return zd;if("boolean"==typeof t)return Xd;if("string"==typeof t)return e=t,Nn.test(e)&&(e=zn(e)),jn.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?Ud|Bd:Bd;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var i=t;if(i.every((function(t){return"number"==typeof t})))return 3===i.length||4===i.length?Ud|Vd:Vd;if("string"!=typeof i[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(i));var n=Yd[i[0]];if(void 0===n)throw new Error("Unrecognized expression operator: "+JSON.stringify(i));return n.getReturnType(i.slice(1))}function Zd(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Hd(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(Zd).join(", ")+")"}function qd(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Jd(t,e,i){if(Array.isArray(e)&&"string"==typeof e[0]){var n=Yd[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return n.toGlsl(t,e.slice(1),i)}return(Kd(e)&zd)>0?Zd(e):(Kd(e)&Xd)>0?e.toString():(Kd(e)&Bd)>0&&(void 0===i||i==Bd)?function(t,e){return Zd(qd(t,e))}(t,e.toString()):(Kd(e)&Ud)>0&&(void 0===i||i==Ud)?((r=Un(e).slice()).length<4&&r.push(1),Hd(r.map((function(t,e){return e<3?t/255:t})))):(Kd(e)&Vd)>0?Hd(e):void 0;var r}function Qd(t){if(!(Kd(t)&zd))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function $d(t){for(var e=0;e<t.length;e++)Qd(t[e])}function tg(t){if(!(Kd(t)&Bd))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function eg(t){if(!(Kd(t)&Xd))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function ig(t,e){if(t.length!==e)throw new Error("Exactly "+e+" arguments were expected, got "+t.length+" instead")}function ng(t,e){if(t.length<e)throw new Error("At least "+e+" arguments were expected, got "+t.length+" instead")}function rg(t,e){if(t.length>e)throw new Error("At most "+e+" arguments were expected, got "+t.length+" instead")}function og(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function ag(t,e){if(i=e,Math.log2(i)%1!=0)throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t));var i}function sg(t){return{getReturnType:function(t){return Xd},toGlsl:function(e,i){ig(i,2);for(var n=Wd,r=0;r<i.length;r++)n&=Kd(i[r]);if(0===n)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(i)+" instead");return"("+Jd(e,i[0],n)+" "+t+" "+Jd(e,i[1],n)+")"}}}function ug(t){return{getReturnType:function(t){return Xd},toGlsl:function(e,i){ng(i,2);for(var n=0;n<i.length;n++)eg(i[n]);return"("+i.map((function(t){return Jd(e,t)})).join(" "+t+" ")+")"}}}Yd.get={getReturnType:function(t){return Wd},toGlsl:function(t,e){ig(e,1),tg(e[0]);var i=e[0].toString();return-1===t.attributes.indexOf(i)&&t.attributes.push(i),(t.inFragmentShader?"v_":"a_")+i}},Yd.var={getReturnType:function(t){return Wd},toGlsl:function(t,e){ig(e,1),tg(e[0]);var i=e[0].toString();return-1===t.variables.indexOf(i)&&t.variables.push(i),"u_"+i}},Yd.time={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,0),"u_time"}},Yd.zoom={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,0),"u_zoom"}},Yd.resolution={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,0),"u_resolution"}},Yd["*"]={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" * "+Jd(t,e[1])+")"}},Yd["/"]={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" / "+Jd(t,e[1])+")"}},Yd["+"]={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" + "+Jd(t,e[1])+")"}},Yd["-"]={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" - "+Jd(t,e[1])+")"}},Yd.clamp={getReturnType:function(t){return zd},toGlsl:function(t,e){ig(e,3),$d(e);var i=Jd(t,e[1]),n=Jd(t,e[2]);return"clamp("+Jd(t,e[0])+", "+i+", "+n+")"}},Yd["%"]={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,2),$d(e),"mod("+Jd(t,e[0])+", "+Jd(t,e[1])+")"}},Yd["^"]={getReturnType:function(t){return zd},toGlsl:function(t,e){return ig(e,2),$d(e),"pow("+Jd(t,e[0])+", "+Jd(t,e[1])+")"}},Yd[">"]={getReturnType:function(t){return Xd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" > "+Jd(t,e[1])+")"}},Yd[">="]={getReturnType:function(t){return Xd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" >= "+Jd(t,e[1])+")"}},Yd["<"]={getReturnType:function(t){return Xd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" < "+Jd(t,e[1])+")"}},Yd["<="]={getReturnType:function(t){return Xd},toGlsl:function(t,e){return ig(e,2),$d(e),"("+Jd(t,e[0])+" <= "+Jd(t,e[1])+")"}},Yd["=="]=sg("=="),Yd["!="]=sg("!="),Yd["!"]={getReturnType:function(t){return Xd},toGlsl:function(t,e){return ig(e,1),eg(e[0]),"(!"+Jd(t,e[0])+")"}},Yd.all=ug("&&"),Yd.any=ug("||"),Yd.between={getReturnType:function(t){return Xd},toGlsl:function(t,e){ig(e,3),$d(e);var i=Jd(t,e[1]),n=Jd(t,e[2]),r=Jd(t,e[0]);return"("+r+" >= "+i+" && "+r+" <= "+n+")"}},Yd.array={getReturnType:function(t){return Vd},toGlsl:function(t,e){ng(e,2),rg(e,4),$d(e);var i=e.map((function(e){return Jd(t,e,zd)}));return"vec"+e.length+"("+i.join(", ")+")"}},Yd.color={getReturnType:function(t){return Ud},toGlsl:function(t,e){ng(e,3),rg(e,4),$d(e);var i=e;3===e.length&&i.push(1);var n=e.map((function(e,i){return Jd(t,e,zd)+(i<3?" / 255.0":"")}));return"vec"+e.length+"("+n.join(", ")+")"}},Yd.interpolate={getReturnType:function(t){for(var e=Ud|zd,i=3;i<t.length;i+=2)e&=Kd(t[i]);return e},toGlsl:function(t,e,i){og(e),ng(e,6);var n,r=e[0];switch(r[0]){case"linear":n=1;break;case"exponential":n=r[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(r));var o=void 0!==i?i:Wd,a=Yd.interpolate.getReturnType(e)&o;ag(e,a);for(var s=Jd(t,e[1]),u=null,l=2;l<e.length-2;l+=2){var h=Jd(t,e[l]),c=Jd(t,e[l+1],a),p=Jd(t,e[l+2]);u="mix("+(u||c)+", "+Jd(t,e[l+3],a)+", pow(clamp(("+s+" - "+h+") / ("+p+" - "+h+"), 0.0, 1.0), "+Zd(n)+"))"}return u}},Yd.match={getReturnType:function(t){for(var e=Wd,i=2;i<t.length;i+=2)e&=Kd(t[i]);return e&=Kd(t[t.length-1])},toGlsl:function(t,e,i){og(e),ng(e,4);var n=void 0!==i?i:Wd,r=Yd.match.getReturnType(e)&n;ag(e,r);for(var o=Jd(t,e[0]),a=Jd(t,e[e.length-1],r),s=null,u=e.length-3;u>=1;u-=2){s="("+o+" == "+Jd(t,e[u])+" ? "+Jd(t,e[u+1],r)+" : "+(s||a)+")"}return s}},Yd.case={getReturnType:function(t){for(var e=Wd,i=1;i<t.length;i+=2)e&=Kd(t[i]);return e&=Kd(t[t.length-1])},toGlsl:function(t,e,i){!function(t){if(t.length%2==0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}(e),ng(e,3);var n=void 0!==i?i:Wd,r=Yd.case.getReturnType(e)&n;ag(e,r);for(var o=0;o<e.length-1;o+=2)eg(e[o]);var a=Jd(t,e[e.length-1],r),s=null;for(o=e.length-3;o>=0;o-=2){s="("+Jd(t,e[o])+" ? "+Jd(t,e[o+1],r)+" : "+(s||a)+")"}return s}};var lg=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,i){return this.varyings.push({name:t,type:e,expression:i}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",i=this.attributes,n=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),n=n.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"+i.map((function(t){return"attribute "+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 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"+n.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;":"",i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+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 if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+e+"\n}"},t}();var hg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cg=function(t){function e(e){var i=this,n=m({},e);return(i=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,i=void 0!==e.size?e.size:1,n=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,u={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},l=Jd(u,i,Vd|zd),h=Jd(u,o,Vd),c=Jd(u,r,Vd),p=Jd(u,s,zd),f={inFragmentShader:!0,variables:u.variables,attributes:[],stringLiteralsMap:u.stringLiteralsMap},d=Jd(f,n,Ud),g=Jd(f,a,zd),_="1.0",v="vec2("+Jd(f,i,Vd|zd)+").x";switch(e.symbolType){case"square":case"image":break;case"circle":_="(1.0-smoothstep(1.-4./"+v+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var y="(v_quadCoord*2.-1.)",m="(atan("+y+".x,"+y+".y))";_="(1.0-smoothstep(.5-3./"+v+",.5,cos(floor(.5+"+m+"/2.094395102)*2.094395102-"+m+")*length("+y+")))";break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new lg).setSizeExpression("vec2("+l+")").setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4("+d+".rgb, "+d+".a * "+g+" * "+_+")");if(t.filter){var S=Jd(f,t.filter,Xd);x.setFragmentDiscardExpression("!"+S)}var w={};if(f.variables.forEach((function(e){x.addUniform("float u_"+e),w["u_"+e]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: "+e);var i=t.variables[e];return"string"==typeof i&&(i=qd(u,i)),void 0!==i?i:-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)"),w.u_texture=C}return f.attributes.forEach((function(t){-1===u.attributes.indexOf(t)&&u.attributes.push(t),x.addVarying("v_"+t,"float","a_"+t)})),u.attributes.forEach((function(t){x.addAttribute("float a_"+t)})),{builder:x,attributes:u.attributes.map((function(t){return{name:t,callback:function(e,i){var n=i[t];return"string"==typeof n&&(n=qd(u,n)),void 0!==n?n:-9999999}}})),uniforms:w}}(e.style),i.hitDetectionDisabled_=!!e.disableHitDetection,i}return hg(e,t),e.prototype.createRenderer=function(){return new Wf(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}(Jr),pg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var fg=function(t){function e(e){var i=this,r=void 0!==e.hidpi&&e.hidpi;return(i=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,opaque:!0,projection:li("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Kr,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this).hidpi_=r,i.culture_=void 0!==e.culture?e.culture:"en-us",i.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,i.apiKey_=e.key,i.imagerySet_=e.imagerySet,function(t,e,i,r){var o=document.createElement("script"),a="olc_"+n(e);function s(){delete window[a],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+a;var u=setTimeout((function(){s(),i&&i()}),1e4);window[a]=function(t){clearTimeout(u),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+i.apiKey_+"&c="+i.culture_,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return pg(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],i=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=_d(this.getProjection()),r=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/r:[e.imageWidth/r,e.imageHeight/r],a=dd({extent:n,minZoom:e.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=a;var s=this.culture_,u=this.hidpi_;if(this.tileUrlFunction=Sd(e.imageUrlSubdomains.map((function(t){var i=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,r){if(t){bh(t[0],t[1],t[2],i);var o=n;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,i,n=t[0],r=new Array(n),o=1<<n-1;for(e=0;e<n;++e)i=48,t[1]&o&&(i+=1),t[2]&o&&(i+=2),r[e]=String.fromCharCode(i),o>>=1;return r.join("")}(i))}}}))),e.imageryProviders){var l=di(li("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],n=t.viewState,r=this.getTileGrid(),o=r.getZForResolution(n.resolution,this.zDirection),a=r.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map((function(e){for(var n=!1,r=e.coverageAreas,o=0,s=r.length;o<s;++o){var u=r[o];if(a>=u.zoomMin&&a<=u.zoomMax){var h=u.bbox;if(me(Se([h[1],h[0],h[3],h[2]],l),t.extent)){n=!0;break}}}n&&i.push(e.attribution)})),i.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),i}.bind(this))}this.setState(Zr)}else this.setState(Hr)},e}(jd),dg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gg=function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",r=void 0!==i.tileGrid?i.tileGrid:dd({extent:_d(n),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return dg(e,t),e}(jd),_g=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vg=function(t){function e(e,i,n,r,o,a,s){var u=this,l=e.getExtent(),h=i.getExtent(),c=h?ge(n,h):n,p=Md(e,i,ce(c),r),f=new Fd(e,i,c,l,.5*p,r),d=a(f.calculateSourceExtent(),p,o),g=d?Fn:Mn,_=d?d.getPixelRatio():1;return(u=t.call(this,n,r,_,g)||this).targetProj_=i,u.maxSourceExtent_=l,u.triangulation_=f,u.targetResolution_=r,u.targetExtent_=n,u.sourceImage_=d,u.sourcePixelRatio_=_,u.contextOptions_=s,u.canvas_=null,u.sourceListenerKey_=null,u}return _g(e,t),e.prototype.disposeInternal=function(){this.state==On&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==In){var e=ye(this.targetExtent_)/this.targetResolution_,i=de(this.targetExtent_)/this.targetResolution_;this.canvas_=Ld(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Fn){this.state=On,this.changed();var t=this.sourceImage_.getState();t==In||t==An?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,E,(function(t){var e=this.sourceImage_.getState();e!=In&&e!=An||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){B(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(ma),yg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mg="imageloadstart",xg="imageloadend",Sg="imageloaderror",wg=function(t){function e(e,i){var n=t.call(this,e)||this;return n.image=i,n}return yg(e,t),e}(s),Cg=function(t){function i(e){var i=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return i.resolutions_=void 0!==e.resolutions?e.resolutions:null,i.reprojectedImage_=null,i.reprojectedRevision_=0,i.contextOptions_=!1===e.imageSmoothing?Od:void 0,i}return yg(i,t),i.prototype.getResolutions=function(){return this.resolutions_},i.prototype.getContextOptions=function(){return this.contextOptions_},i.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=p(this.resolutions_,t,0);t=this.resolutions_[e]}return t},i.prototype.getImage=function(t,e,i,n){var r=this.getProjection();if(r&&n&&!fi(r,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&fi(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&ie(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new vg(r,n,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,r)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return r&&(n=r),this.getImageInternal(t,e,i,n)},i.prototype.getImageInternal=function(t,i,n,r){return e()},i.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case On:this.loading=!0,this.dispatchEvent(new wg(mg,e));break;case In:this.loading=!1,this.dispatchEvent(new wg(xg,e));break;case An:this.loading=!1,this.dispatchEvent(new wg(Sg,e))}},i}(ja);function bg(t,e){t.getImage().src=e}function Eg(t,e){var i=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))}));var n=i.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var Tg="carmentaserver",Pg="geoserver",Rg="mapserver",Fg="qgis",Og=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ig=[101,101],Ag=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{attributions:n.attributions,imageSmoothing:n.imageSmoothing,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,i.url_=n.url,i.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:bg,i.params_=n.params||{},i.v13_=!0,i.updateV13_(),i.serverType_=n.serverType,i.hidpi_=void 0===n.hidpi||n.hidpi,i.image_=null,i.imageSize_=[0,0],i.renderedRevision_=0,i.ratio_=void 0!==n.ratio?n.ratio:1.5,i}return Og(e,t),e.prototype.getFeatureInfoUrl=function(t,e,i,n){if(void 0!==this.url_){var r=li(i),o=this.getProjection();o&&o!==r&&(e=Md(o,r,t,e),t=_i(t,r,o));var a=fe(t,e,0,Ig),s={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(s,this.params_,n);var u=Math.floor((t[0]-a[0])/e),l=Math.floor((a[3]-t[1])/e);return s[this.v13_?"I":"X"]=u,s[this.v13_?"J":"Y"]=l,this.getRequestUrl_(a,Ig,1,o||r,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var i={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;i.LAYER=n}if(void 0!==t){var r=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*r*39.37*(25.4/.28)}return m(i,e),Eg(this.url_,i)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,i,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==i||this.hidpi_&&void 0!==this.serverType_||(i=1);var r=e/i,o=ce(t),a=fe(o,r,0,[Math.ceil(ye(t)/r),Math.ceil(de(t)/r)]),s=fe(o,r,0,[Math.ceil(this.ratio_*ye(t)/r),Math.ceil(this.ratio_*de(t)/r)]),u=this.image_;if(u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==e&&u.getPixelRatio()==i&&Kt(u.getExtent(),a))return u;var l={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};m(l,this.params_),this.imageSize_[0]=Math.round(ye(s)/r),this.imageSize_[1]=Math.round(de(s)/r);var h=this.getRequestUrl_(s,this.imageSize_,i,n,l);return this.image_=new Sa(s,e,i,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(E,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,i,n,r){if(it(void 0!==this.url_,9),r[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(r.STYLES=""),1!=i)switch(this.serverType_){case Pg:var o=90*i+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+o:r.FORMAT_OPTIONS="dpi:"+o;break;case Rg:r.MAP_RESOLUTION=90*i;break;case Tg:case Fg:r.DPI=90*i;break;default:it(!1,8)}r.WIDTH=e[0],r.HEIGHT=e[1];var a,s=n.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,r.BBOX=a.join(","),Eg(this.url_,r)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){m(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=Qe(t,"1.3")>=0},e}(Cg),Mg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lg=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,cacheSize:n.cacheSize,crossOrigin:r,imageSmoothing:n.imageSmoothing,opaque:void 0===n.opaque||n.opaque,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,url:o,wrapX:n.wrapX,attributionsCollapsible:!1})||this}return Mg(e,t),e}(gg),kg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dg=function(t){function e(e){var i=this,n=e||{},r=n.params||{},o=!("TRANSPARENT"in r)||r.TRANSPARENT;return(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:!o,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this).gutter_=void 0!==n.gutter?n.gutter:0,i.params_=r,i.v13_=!0,i.serverType_=n.serverType,i.hidpi_=void 0===n.hidpi||n.hidpi,i.tmpExtent_=[1/0,1/0,-1/0,-1/0],i.updateV13_(),i.setKey(i.getKeyForParams_()),i}return kg(e,t),e.prototype.getFeatureInfoUrl=function(t,e,i,n){var r=li(i),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(r));var s=a.getZForResolution(e,this.zDirection),u=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=u[0])){var l=a.getResolution(u[0]),h=a.getTileCoordExtent(u,this.tmpExtent_),c=Dn(a.getTileSize(u[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=Ln(c,p,this.tmpSize),h=Xt(h,l*p,h)),o&&o!==r&&(l=Md(o,r,t,l),h=function(t,e,i,n){return Se(t,gi(e,i),void 0,n)}(h,r,o),t=_i(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_,n);var d=Math.floor((t[0]-h[0])/l),g=Math.floor((h[3]-t[1])/l);return f[this.v13_?"I":"X"]=d,f[this.v13_?"J":"Y"]=g,this.getRequestUrl_(u,c,h,1,o||r,f)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;i.LAYER=n}if(void 0!==t){var r=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*r*39.37*(25.4/.28)}return m(i,e),Eg(this.urls[0],i)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,i,n,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!=n)switch(this.serverType_){case Pg:var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case Rg:o.MAP_RESOLUTION=90*n;break;case Tg:case Fg:o.DPI=90*n;break;default:it(!1,52)}var u,l=r.getAxisOrientation(),h=i;if(this.v13_&&"ne"==l.substr(0,2)){var c=void 0;c=i[0],h[0]=i[1],h[1]=c,c=i[2],h[2]=i[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)u=a[0];else u=a[Oe(Ph(t),a.length)];return Eg(u,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},e.prototype.updateParams=function(t){m(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=Qe(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,i){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var r=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=Dn(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=Ln(a,s,this.tmpSize),o=Xt(o,r*s,o)),1!=e&&(a=kn(a,e,this.tmpSize));var u={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return m(u,this.params_),this.getRequestUrl_(t,a,o,e,i,u)}},e}(jd);X.unByKey=V;let Gg={Control:nu,Zoom:lu,Attribution:ou,ScaleLine:vu,LayerSwitcher:Ah},jg={GeoJSON:Uh,KML:Vc},Ng={Group:xs,Tile:Rd,Vector:ka,WebGLPoints:cg,Heatmap:Jf,Image:nd},zg={toLonLat:function(t,e){var i=_i(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=Oe(n+180,360)-180),i},fromLonLat:function(t,e){return _i(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}},Bg={LineString:Pn,Point:$i,MultiPoint:Tl},Ug={Icon:Pa,Style:Pr,Text:Lr,Stroke:Rn,Fill:wn,Circle:Tr},Xg={OSM:Lg,XYZ:gg,TileWMS:Dg,BingMaps:fg,Vector:Qa,ImageWMS:Ag};t.Collection=et,t.Feature=rt,t.Map=wh,t.Observable=X,t.View=Js,t.control=Gg,t.format=jg,t.geom=Bg,t.interaction=xh,t.layer=Ng,t.proj=zg,t.source=Xg,t.sphere=Je,t.style=Ug,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ol-custom.js.map