5 lines
539 KiB
JavaScript
5 lines
539 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ol={})}(this,(function(t){"use strict";function e(){return function(){throw new Error("Unimplemented abstract method.")}()}var r=0;function n(t){return t.ol_uid||(t.ol_uid=String(++r))}var i,o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.14.1".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return o(e,t),e}(Error),s=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),l="propertychange",u=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function h(t,e){return t>e?1:t<e?-1:0}function c(t,e){return t.indexOf(e)>=0}function p(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof r?r(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return n-1}function f(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r],t[r]=n,++e,--r}}function d(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function g(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function _(){return!0}function y(){return!1}function v(){}var m="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n<i;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a])}return r};function x(t){for(var e in t)delete t[e]}var w="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function S(t){var e;for(e in t)return!1;return!e}var C=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return C(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_||(this.listeners_={}),n=r[t]||(r[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,r=e?t:t.type,n=this.listeners_&&this.listeners_[r];if(n){var i=e?new s(t):t;i.target||(i.target=this.eventTarget_||this);var o,a=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});r in a||(a[r]=0,l[r]=0),++a[r];for(var u=0,h=n.length;u<h;++u)if(!1===(o="handleEvent"in n[u]?n[u].handleEvent(i):n[u].call(this,i))||i.propagationStopped){o=!1;break}if(0==--a[r]){var c=l[r];for(delete l[r];c--;)this.removeEventListener(r,v);delete a[r]}return o}},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 r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=v,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(u),T="change",b="error",R="contextmenu",P="click",O="dblclick",F="dragenter",I="dragover",L="drop",M="keydown",A="keypress",D="load",k="resize",j="touchmove",G="wheel";function N(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var a={target:t,type:e,listener:r};return t.addEventListener(e,r),a}function B(t,e,r,n){return N(t,e,r,n,!0)}function z(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var U=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),V=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return U(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(T)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=N(this,t[i],e);return n}return N(this,t,e)},e.prototype.onceInternal=function(t,e){var r;if(Array.isArray(t)){var n=t.length;r=new Array(n);for(var i=0;i<n;++i)r[i]=B(this,t[i],e)}else r=B(this,t,e);return e.ol_key=r,r},e.prototype.unInternal=function(t,e){var r=e.ol_key;if(r)X(r);else if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(E);function X(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)z(t[e]);else z(t)}V.prototype.on,V.prototype.once,V.prototype.un;var W=V,Y=Object.freeze({__proto__:null,unByKey:X,default:W}),K=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Z=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return K(e,t),e}(s),H=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,n(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return K(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 r;r="change:".concat(t),this.hasListener(r)&&this.dispatchEvent(new Z(r,t,e)),r=l,this.hasListener(r)&&this.dispatchEvent(new Z(r,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,r){var n=this.values_||(this.values_={});if(r)n[t]=e;else{var i=n[t];n[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.applyProperties=function(t){t.values_&&m(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],S(this.values_)&&(this.values_=null),e||this.notify(t,r)}},e}(W),q=H,J="add",Q="remove",$=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tt="length",et=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return $(e,t),e}(s),rt=function(t){function e(e,r){var n=t.call(this)||this;n.on,n.once,n.un;var i=r||{};if(n.unique_=!!i.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 $(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(tt)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new et(J,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_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new et(Q,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new et(Q,n,t)),this.dispatchEvent(new et(J,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(tt,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new a(58)},e}(q);function nt(t,e){if(!t)throw new a(e)}var it=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ot=function(t){function e(e){var r=t.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return it(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.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_&&(z(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=N(t,T,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(nt("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(q);var at=ot,st="XY",lt="XYZ",ut="XYM",ht="XYZM",ct="Point",pt="LineString",ft="LinearRing",dt="Polygon",gt="MultiPoint",_t="MultiLineString",yt="MultiPolygon",vt="GeometryCollection",mt="Circle",xt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},wt={};wt[xt.RADIANS]=6370997/(2*Math.PI),wt[xt.DEGREES]=2*Math.PI*6370997/360,wt[xt.FEET]=.3048,wt[xt.METERS]=1,wt[xt.USFEET]=1200/3937;var St,Ct=xt,Et="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Tt=-1!==Et.indexOf("firefox"),bt=-1!==Et.indexOf("safari")&&-1==Et.indexOf("chrom")&&!!(Et.indexOf("version/15.4")>=0||Et.match(/cpu (os|iphone os) 15_4 like mac os x/)),Rt=-1!==Et.indexOf("webkit")&&-1==Et.indexOf("edge"),Pt=-1!==Et.indexOf("macintosh"),Ot="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Ft="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,It="undefined"!=typeof Image&&Image.prototype.decode,Lt=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}(),Mt=new Array(6);function At(t){return kt(t,1,0,0,1,0,0)}function Dt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=r*l+i*u,t[1]=n*l+o*u,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*p+i*f+a,t[5]=n*p+o*f+s,t}function kt(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function jt(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function Gt(t,e,r){return Dt(t,kt(Mt,e,0,0,r,0,0))}function Nt(t,e,r,n,i,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=i*l,t[2]=-n*l,t[3]=i*u,t[4]=a*n*u-s*n*l+e,t[5]=a*i*l+s*i*u+r,t}function Bt(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];nt(0!==n,32);var i=e[0],o=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=i/n,t[4]=(a*u-s*l)/n,t[5]=-(i*u-o*l)/n,t}function zt(t){var e="matrix("+t.join(", ")+")";if(Ft)return e;var r=St||(St=document.createElement("div"));return r.style.transform=e,r.style.transform}var Ut="bottom-left",Vt="bottom-right",Xt="top-left",Wt="top-right",Yt=0,Kt=1,Zt=2,Ht=4,qt=8,Jt=16;function Qt(t){for(var e=ae(),r=0,n=t.length;r<n;++r)fe(e,t[r]);return e}function $t(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function te(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function ee(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function re(t,e){return ie(t,e[0],e[1])}function ne(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ie(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function oe(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=Yt;return a<r?l|=Jt:a>i&&(l|=Ht),s<n?l|=qt:s>o&&(l|=Zt),l===Yt&&(l=Kt),l}function ae(){return[1/0,1/0,-1/0,-1/0]}function se(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function le(t){return se(1/0,1/0,-1/0,-1/0,t)}function ue(t,e){var r=t[0],n=t[1];return se(r,n,r,n,e)}function he(t,e,r,n,i){return de(le(i),t,e,r,n)}function ce(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function pe(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 fe(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 de(t,e,r,n,i){for(;r<n;r+=i)ge(t,e[r],e[r+1]);return t}function ge(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function _e(t,e){var r;return(r=e(ve(t)))||(r=e(me(t)))||(r=e(be(t)))?r:(r=e(Te(t)))||!1}function ye(t){var e=0;return Oe(t)||(e=Re(t)*Ce(t)),e}function ve(t){return[t[0],t[1]]}function me(t){return[t[2],t[1]]}function xe(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function we(t,e){var r;return e===Ut?r=ve(t):e===Vt?r=me(t):e===Xt?r=Te(t):e===Wt?r=be(t):nt(!1,13),r}function Se(t,e,r,n,i){var o=e*n[0]/2,a=e*n[1]/2,s=Math.cos(r),l=Math.sin(r),u=o*s,h=o*l,c=a*s,p=a*l,f=t[0],d=t[1],g=f-u+p,_=f-u-p,y=f+u-p,v=f+u+p,m=d-h-c,x=d-h+c,w=d+h+c,S=d+h-c;return se(Math.min(g,_,y,v),Math.min(m,x,w,S),Math.max(g,_,y,v),Math.max(m,x,w,S),i)}function Ce(t){return t[3]-t[1]}function Ee(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return Pe(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]):le(n),n}function Te(t){return[t[0],t[3]]}function be(t){return[t[2],t[3]]}function Re(t){return t[2]-t[0]}function Pe(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Oe(t){return t[2]<t[0]||t[3]<t[1]}function Fe(t,e,r,n){var i=[];if(n>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<n;++s)i.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 i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var l=[],u=[],h=(s=0,i.length);s<h;s+=2)l.push(i[s]),u.push(i[s+1]);return function(t,e,r){return se(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(l,u,r)}var Ie=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_||wt[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 Le(t,e,r){return Math.min(Math.max(t,e),r)}var Me="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ae="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function De(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return ke(t,e,r,n)}function ke(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function je(t){return 180*t/Math.PI}function Ge(t){return t*Math.PI/180}function Ne(t,e){var r=t%e;return r*e<0?r+e:r}function Be(t,e,r){return t+r*(e-t)}function ze(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function Ue(t,e){return Math.round(ze(t,e))}function Ve(t,e){return Math.floor(ze(t,e))}function Xe(t,e){return Math.ceil(ze(t,e))}var We=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ye=6378137,Ke=Math.PI*Ye,Ze=[-Ke,-Ke,Ke,Ke],He=[-180,-85,180,85],qe=Ye*Math.log(Math.tan(Math.PI/2)),Je=function(t){function e(e){return t.call(this,{code:e,units:Ct.METERS,extent:Ze,global:!0,worldExtent:He,getPointResolution:function(t,e){return t/Me(e[1]/Ye)}})||this}return We(e,t),e}(Ie),Qe=[new Je("EPSG:3857"),new Je("EPSG:102100"),new Je("EPSG:102113"),new Je("EPSG:900913"),new Je("http://www.opengis.net/def/crs/EPSG/0/3857"),new Je("http://www.opengis.net/gml/srs/epsg.xml#3857")];function $e(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a<n;a+=i){o[a]=Ke*t[a]/180;var s=Ye*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>qe?s=qe:s<-qe&&(s=-qe),o[a+1]=s}return o}function tr(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a<n;a+=i)o[a]=180*t[a]/Ke,o[a+1]=360*Math.atan(Math.exp(t[a+1]/Ye))/Math.PI-90;return o}var er=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rr=[-180,-90,180,90],nr=6378137*Math.PI/180,ir=function(t){function e(e,r){return t.call(this,{code:e,units:Ct.DEGREES,extent:rr,axisOrientation:r,global:!0,metersPerUnit:nr,worldExtent:rr})||this}return er(e,t),e}(Ie),or=[new ir("CRS:84"),new ir("EPSG:4326","neu"),new ir("urn:ogc:def:crs:OGC:1.3:CRS84"),new ir("urn:ogc:def:crs:OGC:2:84"),new ir("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ir("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ir("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ar={};var sr={};function lr(t,e,r){var n=t.getCode(),i=e.getCode();n in sr||(sr[n]={}),sr[n][i]=r}function ur(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function hr(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[i+r*a/l,o+r*s/l]}function cr(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],h=s[0],c=s[1],p=h-l,f=c-u,d=0===p&&0===f?0:(p*(i-l)+f*(o-u))/(p*p+f*f||0);return d<=0?(r=l,n=u):d>=1?(r=h,n=c):(r=l+d*p,n=u+d*f),[r,n]}function pr(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function fr(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function dr(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function gr(t,e){return Math.sqrt(dr(t,e))}function _r(t,e){return dr(t,cr(t,e))}function yr(t,e){if(e.canWrapX()){var r=Re(e.getExtent()),n=function(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=r||Re(n);i=Math.floor((t[0]-n[0])/o)}return i}(t,e,r);n&&(t[0]-=n*r)}return t}var vr=6371008.8;function mr(t,e,r){var n=r||vr,i=Ge(t[1]),o=Ge(e[1]),a=(o-i)/2,s=Ge(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function xr(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=mr(t[n],t[n+1],e);return r}function wr(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],l=t[a][1];r+=Ge(s-i)*(2+Math.sin(Ge(o))+Math.sin(Ge(l))),i=s,o=l}return r*e*e/2}var Sr=Object.freeze({__proto__:null,DEFAULT_RADIUS:vr,getDistance:mr,getLength:function t(e,r){var n=r||{},i=n.radius||vr,o=n.projection||"EPSG:3857",a=e.getType();a!==vt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case ct:case gt:break;case pt:case ft:f=xr(s=e.getCoordinates(),i);break;case _t:case dt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)f+=xr(s[u],i);break;case yt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=s[u]).length;c<p;++c)f+=xr(l[c],i);break;case vt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},getArea:function t(e,r){var n=r||{},i=n.radius||vr,o=n.projection||"EPSG:3857",a=e.getType();a!==vt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case ct:case gt:case pt:case _t:case ft:break;case dt:for(s=e.getCoordinates(),f=Math.abs(wr(s[0],i)),u=1,h=s.length;u<h;++u)f-=Math.abs(wr(s[u],i));break;case yt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(l=s[u],f+=Math.abs(wr(l[0],i)),c=1,p=l.length;c<p;++c)f-=Math.abs(wr(l[c],i));break;case vt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},offset:function(t,e,r,n){var i=n||vr,o=Ge(t[1]),a=Ge(t[0]),s=e/i,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(r));return[je(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l))),je(l)]}}),Cr=!0;function Er(t){Cr=!(void 0===t||t)}function Tr(t,e,r){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function br(t,e,r){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function Rr(t){!function(t,e){ar[t]=e}(t.getCode(),t),lr(t,t,Tr)}function Pr(t){return"string"==typeof t?ar[e=t]||ar[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Or(t,e,r,n){var i,o=(t=Pr(t)).getPointResolutionFunc();if(o){if(i=o(e,r),n&&n!==t.getUnits())(s=t.getMetersPerUnit())&&(i=i*s/wt[n])}else{var a=t.getUnits();if(a==Ct.DEGREES&&!n||n==Ct.DEGREES)i=e;else{var s,l=Mr(t,Pr("EPSG:4326"));if(l===br&&a!==Ct.DEGREES)i=e*t.getMetersPerUnit();else{var u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(mr((u=l(u,u,2)).slice(0,2),u.slice(2,4))+mr(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=n?wt[n]:t.getMetersPerUnit())&&(i/=s)}}return i}function Fr(t){!function(t){t.forEach(Rr)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&lr(e,t,Tr)}))}))}function Ir(t,e){return t?"string"==typeof t?Pr(t):t:Pr(e)}function Lr(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Mr(t,e)===Tr)&&r}function Mr(t,e){var r=function(t,e){var r;return t in sr&&e in sr[t]&&(r=sr[t][e]),r}(t.getCode(),e.getCode());return r||(r=br),r}function Ar(t,e){return Mr(Pr(t),Pr(e))}function Dr(t,e,r){return Ar(e,r)(t,void 0,t.length)}var kr,jr,Gr;function Nr(t,e){return t}function Br(t,e){return Cr&&!pr(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Cr=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function zr(t,e){return t}function Ur(t,e){return t}function Vr(t,e,r,n,i,o){for(var a=o||[],s=0,l=e;l<r;l+=n){var u=t[l],h=t[l+1];a[s++]=i[0]*u+i[2]*h+i[4],a[s++]=i[1]*u+i[3]*h+i[5]}return o&&a.length!=s&&(a.length=s),a}function Xr(t,e,r,n,i,o,a){for(var s=a||[],l=Math.cos(i),u=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<r;f+=n){var d=t[f]-h,g=t[f+1]-c;s[p++]=h+d*l-g*u,s[p++]=c+d*u+g*l;for(var _=f+2;_<f+n;++_)s[p++]=t[_]}return a&&s.length!=p&&(s.length=p),s}function Wr(t,e,r,n,i,o,a){for(var s=a||[],l=0,u=e;u<r;u+=n){s[l++]=t[u]+i,s[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)s[l++]=t[h]}return a&&s.length!=l&&(s.length=l),s}Fr(Qe),Fr(or),kr=Qe,jr=$e,Gr=tr,or.forEach((function(t){kr.forEach((function(e){lr(t,e,jr),lr(e,t,Gr)}))}));var Yr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kr=[1,0,0,1,0,0],Zr=function(t){function r(){var e,r,n,i,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,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&g(t,n)||(o=!0,i=this,n=t,r=e.apply(this,arguments)),r}),a}return Yr(r,t),r.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},r.prototype.clone=function(){return e()},r.prototype.closestPointXY=function(t,r,n,i){return e()},r.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},r.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},r.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},r.prototype.computeExtent=function(t){return e()},r.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&le(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)},r.prototype.rotate=function(t,r){e()},r.prototype.scale=function(t,r,n){e()},r.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},r.prototype.getSimplifiedGeometry=function(t){return e()},r.prototype.getType=function(){return e()},r.prototype.applyTransform=function(t){e()},r.prototype.intersectsExtent=function(t){return e()},r.prototype.translate=function(t,r){e()},r.prototype.transform=function(t,e){var r=Pr(t),n=r.getUnits()==Ct.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),a=r.getWorldExtent(),s=Ce(a)/Ce(o);return Nt(Kr,a[0],a[3],s,-s,0,0,0),Vr(t,0,t.length,i,Kr,n),Ar(r,e)(t,n,i)}:Ar(r,e);return this.applyTransform(n),this},r}(q),Hr=Zr,qr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jr=function(t){function r(){var e=t.call(this)||this;return e.layout=st,e.stride=2,e.flatCoordinates=null,e}return qr(r,t),r.prototype.computeExtent=function(t){return he(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinates=function(){return e()},r.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},r.prototype.getFlatCoordinates=function(){return this.flatCoordinates},r.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},r.prototype.getLayout=function(){return this.layout},r.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)},r.prototype.getSimplifiedGeometryInternal=function(t){return this},r.prototype.getStride=function(){return this.stride},r.prototype.setFlatCoordinates=function(t,e){this.stride=Qr(t),this.layout=t,this.flatCoordinates=e},r.prototype.setCoordinates=function(t,r){e()},r.prototype.setLayout=function(t,e,r){var n;if(t)n=Qr(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=st,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=st:3==t?e=lt:4==t&&(e=ht);return e}(n=e.length)}this.layout=t,this.stride=n},r.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},r.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Xr(r,0,r.length,n,t,e,r),this.changed()}},r.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=xe(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,r,n,i,o,a,s){for(var l=s||[],u=a[0],h=a[1],c=0,p=e;p<r;p+=n){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+i*f,l[c++]=h+o*d;for(var g=p+2;g<p+n;++g)l[c++]=t[g]}s&&l.length!=c&&(l.length=c)}(o,0,o.length,a,t,n,i,o),this.changed()}},r.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Wr(r,0,r.length,n,t,e,r),this.changed()}},r}(Hr);function Qr(t){var e;return t==st?e=2:t==lt||t==ut?e=3:t==ht&&(e=4),e}var $r=Jr;function tn(t,e,r,n,i,o,a){var s,l=t[e],u=t[e+1],h=t[r]-l,c=t[r+1]-u;if(0===h&&0===c)s=e;else{var p=((i-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)s=r;else{if(p>0){for(var f=0;f<n;++f)a[f]=Be(t[e+f],t[r+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function en(t,e,r,n,i){var o=t[e],a=t[e+1];for(e+=n;e<r;e+=n){var s=t[e],l=t[e+1],u=ke(o,a,s,l);u>i&&(i=u),o=s,a=l}return i}function rn(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=en(t,e,s,n,i),e=s}return i}function nn(t,e,r,n,i,o,a,s,l,u,h){if(e==r)return u;var c,p;if(0===i){if((p=ke(a,s,t[e],t[e+1]))<u){for(c=0;c<n;++c)l[c]=t[e+c];return l.length=n,p}return u}for(var f=h||[NaN,NaN],d=e+n;d<r;)if(tn(t,d-n,d,n,a,s,f),(p=ke(a,s,f[0],f[1]))<u){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n,d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(u))/i|0,1);if(o&&(tn(t,r-n,e,n,a,s,f),(p=ke(a,s,f[0],f[1]))<u)){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n}return u}function on(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=nn(t,e,d,n,i,o,a,s,l,u,c),e=d}return u}function an(t,e,r,n){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function sn(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var a=r[i],s=0;s<n;++s)t[e++]=a[s];return e}function ln(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=sn(t,e,r[s],n);o[a++]=u,e=u}return o.length=a,o}function un(t,e,r,n,i,o,a){var s=(r-e)/n;if(s<3){for(;e<r;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,r-n],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),f=0,d=t[p],g=t[p+1],_=t[c],y=t[c+1],v=p+n;v<c;v+=n){var m=De(t[v],t[v+1],d,g,_,y);m>f&&(h=v,f=m)}f>i&&(l[(h-e)/n]=1,p+n<h&&u.push(p,h),h+n<c&&u.push(h,c))}for(v=0;v<s;++v)l[v]&&(o[a++]=t[e+v*n],o[a++]=t[e+v*n+1]);return a}function hn(t,e){return e*Math.round(t/e)}function cn(t,e,r,n,i,o,a){if(e==r)return a;var s,l,u=hn(t[e],i),h=hn(t[e+1],i);e+=n,o[a++]=u,o[a++]=h;do{if(s=hn(t[e],i),l=hn(t[e+1],i),(e+=n)==r)return o[a++]=s,o[a++]=l,a}while(s==u&&l==h);for(;e<r;){var c=hn(t[e],i),p=hn(t[e+1],i);if(e+=n,c!=s||p!=l){var f=s-u,d=l-h,g=c-u,_=p-h;f*_==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&_<d||d==_||d>0&&_>d)?(s=c,l=p):(o[a++]=s,o[a++]=l,u=s,h=l,s=c,l=p)}}return o[a++]=s,o[a++]=l,a}function pn(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=cn(t,e,h,n,i,o,a),s.push(a),e=h}return a}function fn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s<r;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function dn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=fn(t,e,u,n,o[a]),e=u}return o.length=a,o}function gn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=dn(t,e,u,n,o[a]),e=u[u.length-1]}return o.length=a,o}function _n(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=a*s-o*l,o=s,a=l}return i/2}function yn(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=_n(t,e,s,n),e=s}return i}var vn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mn=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return vn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<ee(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(en(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),nn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return fn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,st)},e.prototype.getType=function(){return ft},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=sn(this.flatCoordinates,0,t,this.stride),this.changed()},e}($r),xn=mn,wn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sn=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return wn(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=ke(t,e,i[0],i[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)r[s]=i[s];return r.length=a,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ue(this.flatCoordinates,t)},e.prototype.getType=function(){return ct},e.prototype.intersectsExtent=function(t){return ie(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=an(this.flatCoordinates,0,t,this.stride),this.changed()},e}($r),Cn=Sn;function En(t,e,r,n,i){return!_e(i,(function(i){return!Tn(t,e,r,n,i[0],i[1])}))}function Tn(t,e,r,n,i,o){for(var a=0,s=t[r-n],l=t[r-n+1];e<r;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(u-s)*(o-l)-(i-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(i-s)*(h-l)<0&&a--,s=u,l=h}return 0!==a}function bn(t,e,r,n,i,o){if(0===r.length)return!1;if(!Tn(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a<s;++a)if(Tn(t,r[a-1],r[a],n,i,o))return!1;return!0}function Rn(t,e,r,n,i,o,a){for(var s,l,u,c,p,f,d,g=i[o+1],_=[],y=0,v=r.length;y<v;++y){var m=r[y];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)&&(u=(g-f)/(d-f)*(p-c)+c,_.push(u)),c=p,f=d}var x=NaN,w=-1/0;for(_.sort(h),c=_[0],s=1,l=_.length;s<l;++s){p=_[s];var S=Math.abs(p-c);S>w&&bn(t,e,r,n,u=(c+p)/2,g)&&(x=u,w=S),c=p}return isNaN(x)&&(x=i[o]),a?(a.push(x,g,w),a):[x,g,w]}function Pn(t,e,r,n,i){for(var o=[],a=0,s=r.length;a<s;++a){var l=r[a];o=Rn(t,e,l,n,i,2*a,o),e=l[l.length-1]}return o}function On(t,e,r,n,i){var o;for(e+=n;e<r;e+=n)if(o=i(t.slice(e-n,e),t.slice(e,e+n)))return o;return!1}function Fn(t,e,r,n,i){var o=de([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!Pe(i,o)&&(!!ne(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||On(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=oe(t,e),o=oe(t,r);if(i===Kt||o===Kt)n=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],f=r[1],d=(f-c)/(p-h),g=void 0,_=void 0;o&Zt&&!(i&Zt)&&(n=(g=p-(f-u)/d)>=a&&g<=l),n||!(o&Ht)||i&Ht||(n=(_=f-(p-l)*d)>=s&&_<=u),n||!(o&qt)||i&qt||(n=(g=p-(f-s)/d)>=a&&g<=l),n||!(o&Jt)||i&Jt||(n=(_=f-(p-a)*d)>=s&&_<=u)}return n}(i,t,e)})))))}function In(t,e,r,n,i){if(!function(t,e,r,n,i){return!!(Fn(t,e,r,n,i)||Tn(t,e,r,n,i[0],i[1])||Tn(t,e,r,n,i[0],i[3])||Tn(t,e,r,n,i[2],i[1])||Tn(t,e,r,n,i[2],i[3]))}(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o<a;++o)if(En(t,r[o-1],r[o],n,i)&&!Fn(t,r[o-1],r[o],n,i))return!1;return!0}function Ln(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i],t[r-n+i]=o}e+=n,r-=n}}function Mn(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=(s-o)*(l+a),o=s,a=l}return 0===i?void 0:i>0}function An(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=Mn(t,e,l,n);if(0===a){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function Dn(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=Mn(t,e,l,n);(0===a?o&&u||!o&&!u:o&&!u||!o&&u)&&Ln(t,e,l,n),e=l}return e}function kn(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o)e=Dn(t,e,r[o],n,i);return e}var jn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gn=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return jn(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(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<ee(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),on(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return bn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return yn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Dn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,dn(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=xe(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 Cn(this.getFlatInteriorPoint(),ut)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new xn(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,r=this.ends_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o],l=new xn(e.slice(i,s),t);n.push(l),i=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;An(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Dn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=pn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,st,n)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return In(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=ln(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}($r);function Nn(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new Gn(o,st,[o.length])}function Bn(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(n+1),l=new Array(s),u=0;u<s;u+=i){l[u]=0,l[u+1]=0;for(var h=2;h<i;h++)l[u+h]=a[h]}var c=[l.length],p=new Gn(l,o,c);return function(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=n||0,l=0;l<=a;++l){var u=l*o,h=s+2*Ne(l,a)*Math.PI/a;i[u]=e[0]+r*Math.cos(h),i[u+1]=e[1]+r*Math.sin(h)}t.changed()}(p,a,t.getRadius(),r),p}var zn="prerender",Un="postrender",Vn="precompose",Xn="postcompose",Wn="rendercomplete",Yn=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 Kn(t,e,r,n,i,o,a){var s,l,u=(r-e)/n;if(1===u)s=e;else if(2===u)s=e,l=i;else if(0!==u){for(var c=t[e],p=t[e+1],f=0,d=[0],g=e+n;g<r;g+=n){var _=t[g],y=t[g+1];f+=Math.sqrt((_-c)*(_-c)+(y-p)*(y-p)),d.push(f),c=_,p=y}var v=i*f,m=function(t,e,r){for(var n,i,o=r||h,a=0,s=t.length,l=!1;a<s;)(i=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,l=!i);return l?a:~a}(d,v);m<0?(l=(v-d[-m-2])/(d[-m-1]-d[-m-2]),s=e+(-m-2)*n):s=e+m*n}var x=a>1?a:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===s?NaN:void 0===l?t[s+g]:Be(t[s+g],t[s+n+g],l);return w}function Zn(t,e,r,n,i,o){if(r==e)return null;var a;if(i<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=i,a):null;if(t[r-1]<i)return o?((a=t.slice(r-n,r))[n-1]=i,a):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,l=r/n;s<l;){var u=s+l>>1;i<t[(u+1)*n-1]?l=u:s=u+1}var h=t[s*n-1];if(i==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(i-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(Be(t[(s-1)*n+p],t[s*n+p],c));return a.push(i),a}function Hn(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;s<r;s+=n){var l=t[s],u=t[s+1];a+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return a}var qn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jn=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return qn(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?d(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<ee(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(en(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),nn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,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!=ut&&this.layout!=ht)return null;var r=void 0!==e&&e;return Zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return fn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Kn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Hn(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 r=[];return r.length=un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,st)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return Fn(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=sn(this.flatCoordinates,0,t,this.stride),this.changed()},e}($r),Qn=Jn,$n=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}(),ti=0,ei=1,ri=2,ni=3,ii=4;function oi(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function ai(t){return t[0]>0&&t[1]>0}function si(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function li(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var ui=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=li(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return e()},t.prototype.getImage=function(t){return e()},t.prototype.getHitDetectionImage=function(){return e()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return e()},t.prototype.getImageSize=function(){return e()},t.prototype.getOrigin=function(){return e()},t.prototype.getSize=function(){return e()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=li(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),hi=ui,ci=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,pi=/^([a-z]*)$|^hsla?\(.*\)$/i;function fi(t){return"string"==typeof t?t:vi(t)}function di(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var gi=function(){var t={},e=0;return function(r){var n;if(t.hasOwnProperty(r))n=t[r];else{if(e>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--e)}n=function(t){var e,r,n,i,o;pi.exec(t)&&(t=di(t));if(ci.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),r=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),i=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,l&&(i=(i<<4)+i)),o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?yi(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),yi(o)):nt(!1,14);return o}(r),t[r]=n,++e}return n}}();function _i(t){return Array.isArray(t)?t:gi(t)}function yi(t){return t[0]=Le(t[0]+.5|0,0,255),t[1]=Le(t[1]+.5|0,0,255),t[2]=Le(t[2]+.5|0,0,255),t[3]=Le(t[3],0,1),t}function vi(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function mi(t){return Array.isArray(t)?vi(t):t}function xi(t,e,r,n){var i;return i=r&&r.length?r.shift():Ft?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",n)}function wi(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function Si(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var Ci="ol-hidden",Ei="ol-unselectable",Ti="ol-control",bi="ol-collapsed",Ri=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"),Pi=["style","variant","weight","size","lineHeight","family"],Oi=function(t){var e=t.match(Ri);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=Pi.length;n<i;++n){var o=e[n+1];void 0!==o&&(r[Pi[n]]=o)}return r.families=r.family.split(/,\s?/),r};function Fi(t){return 1===t?"":String(Math.round(100*t)/100)}var Ii="10px sans-serif",Li="#000",Mi="round",Ai=[],Di="round",ki="#000",ji="center",Gi="middle",Ni=[0,0,0,0],Bi=new q;(new E).setSize=function(){console.warn("labelCache is deprecated.")};var zi,Ui,Vi=null,Xi={},Wi=function(){var t,e,r="32px ",n=["monospace","serif"],i=n.length,o="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<i;++u){var h=n[u];if(e=Zi(t+" "+a+" "+r+h,o),s!=h){var c=Zi(t+" "+a+" "+r+s+","+h,o);l=l&&c!=e}}return!!l}function s(){for(var e=!0,r=Bi.getKeys(),n=0,i=r.length;n<i;++n){var o=r[n];Bi.get(o)<100&&(a.apply(this,o.split("\n"))?(x(Xi),Vi=null,zi=void 0,Bi.set(o,100)):(Bi.set(o,Bi.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var r=Oi(e);if(r)for(var n=r.families,i=0,o=n.length;i<o;++i){var l=n[i],u=r.style+"\n"+r.weight+"\n"+l;void 0===Bi.get(u)&&(Bi.set(u,100,!0),a(r.style,r.weight,l)||(Bi.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Yi=function(t){var e=Xi[t];if(null==e){if(Ft){var r=Oi(t),n=Ki(t,"Žg");e=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else Ui||((Ui=document.createElement("div")).innerHTML="M",Ui.style.minHeight="0",Ui.style.maxHeight="none",Ui.style.height="auto",Ui.style.padding="0",Ui.style.border="none",Ui.style.position="absolute",Ui.style.display="block",Ui.style.left="-99999px"),Ui.style.font=t,document.body.appendChild(Ui),e=Ui.offsetHeight,document.body.removeChild(Ui);Xi[t]=e}return e};function Ki(t,e){return Vi||(Vi=xi(1,1)),t!=zi&&(Vi.font=t,zi=Vi.font),Vi.measureText(e)}function Zi(t,e){return Ki(t,e).width}function Hi(t,e,r){if(e in r)return r[e];var n=Zi(t,e);return r[e]=n,n}function qi(t,e,r,n,i,o,a,s,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;n<i;n+=2)Array.isArray(r[n+1])?e[r[n]].apply(e,r[n+1]):e[r[n]]=r[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,i,o,a,s,0,0,a,s)):t.drawImage(n,i,o,a,s,l,u,a*h[0],s*h[1]),t.restore()}var Ji=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qi=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return Ji(e,t),e.prototype.clone=function(){var t=this.getScale(),r=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(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var r=this.renderOptions_,n=xi(r.size*t,r.size*t);this.draw_(r,n,t),e=n.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return ri},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.calculateLineJoinSize_=function(t,e,r){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,i=void 0===this.radius2_?n:this.radius2_;if(n<i){var o=n;n=i,i=o}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=i*Math.sin(s),u=n-Math.sqrt(i*i-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=r)return c*e;var p=e/2/c,f=e/2*(u/h),d=Math.sqrt((n+p)*(n+p)+f*f)-n;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=n*Math.sin(s),_=i-Math.sqrt(n*n-g*g),y=Math.sqrt(g*g+_*_)/g;if(y<=r){var v=y*e/2-i-n;return 2*Math.max(d,v)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Di,r=0,n=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=ki),t=mi(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Di),void 0===(r=this.stroke_.getMiterLimit())&&(r=10));var a=this.calculateLineJoinSize_(e,o,r),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*s+a),lineDash:n,lineDashOffset:i,lineJoin:e,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,r){if(e.scale(r,r),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n=Li),e.fillStyle=mi(n),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.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=_i(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=xi(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,r=this.radius_;if(e===1/0)t.arc(0,0,r,0,2*Math.PI);else{var n=void 0===this.radius2_?r:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,a=0;a<e;a++){var s=i+a*o,l=a%2==0?r:n;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Li,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(hi),$i=Qi,to=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),eo=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:void 0!==r.scale?r.scale:1,rotation:void 0!==r.rotation?r.rotation:0,rotateWithView:void 0!==r.rotateWithView&&r.rotateWithView,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return to(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}($i),ro=eo,no=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=so,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.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer: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,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},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_=so,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var io=null;function oo(t,e){if(!io){var r=new Yn({color:"rgba(255,255,255,0.4)"}),n=new $n({color:"#3399CC",width:1.25});io=[new no({image:new ro({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return io}function ao(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[dt]=[new no({fill:new Yn({color:[255,255,255,.5]})})],t[yt]=t[dt],t[pt]=[new no({stroke:new $n({color:e,width:5})}),new no({stroke:new $n({color:r,width:3})})],t[_t]=t[pt],t[mt]=t[dt].concat(t[pt]),t[ct]=[new no({image:new ro({radius:6,fill:new Yn({color:r}),stroke:new $n({color:e,width:1.5})}),zIndex:1/0})],t[gt]=t[ct],t[vt]=t[dt].concat(t[pt],t[ct]),t}function so(t){return t.getGeometry()}var lo=no,uo="point",ho="line",co=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=li(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Yn({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:uo,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()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=li(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),po=co,fo="opacity",go="visible",_o="extent",yo="zIndex",vo="maxResolution",mo="minResolution",xo="maxZoom",wo="minZoom",So="source",Co="map",Eo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),To=function(t){function r(e){var r=t.call(this)||this;r.on,r.once,r.un,r.background_=e.background;var n=m({},e);return"object"==typeof e.properties&&(delete n.properties,m(n,e.properties)),n[fo]=void 0!==e.opacity?e.opacity:1,nt("number"==typeof n[fo],64),n[go]=void 0===e.visible||e.visible,n[yo]=e.zIndex,n[vo]=void 0!==e.maxResolution?e.maxResolution:1/0,n[mo]=void 0!==e.minResolution?e.minResolution:0,n[wo]=void 0!==e.minZoom?e.minZoom:-1/0,n[xo]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?n.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return Eo(r,t),r.prototype.getBackground=function(){return this.background_},r.prototype.getClassName=function(){return this.className_},r.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=Le(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r||e.managed?r:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},r.prototype.getLayersArray=function(t){return e()},r.prototype.getLayerStatesArray=function(t){return e()},r.prototype.getExtent=function(){return this.get(_o)},r.prototype.getMaxResolution=function(){return this.get(vo)},r.prototype.getMinResolution=function(){return this.get(mo)},r.prototype.getMinZoom=function(){return this.get(wo)},r.prototype.getMaxZoom=function(){return this.get(xo)},r.prototype.getOpacity=function(){return this.get(fo)},r.prototype.getSourceState=function(){return e()},r.prototype.getVisible=function(){return this.get(go)},r.prototype.getZIndex=function(){return this.get(yo)},r.prototype.setBackground=function(t){this.background_=t,this.changed()},r.prototype.setExtent=function(t){this.set(_o,t)},r.prototype.setMaxResolution=function(t){this.set(vo,t)},r.prototype.setMinResolution=function(t){this.set(mo,t)},r.prototype.setMaxZoom=function(t){this.set(xo,t)},r.prototype.setMinZoom=function(t){this.set(wo,t)},r.prototype.setOpacity=function(t){nt("number"==typeof t,64),this.set(fo,t)},r.prototype.setVisible=function(t){this.set(go,t)},r.prototype.setZIndex=function(t){this.set(yo,t)},r.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},r}(q),bo="undefined",Ro="loading",Po="ready",Oo="error",Fo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Io=function(t){function e(e){var r=this,n=m({},e);delete n.source,(r=t.call(this,n)||this).on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addChangeListener(So,r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return Fo(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(So)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():bo},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(z(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=N(t,T,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return this.rendered=!0,r.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Co,t)},e.prototype.getMapInternal=function(){return this.get(Co)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(z(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(z(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=N(t,Vn,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);nt(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=N(this,T,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(So,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.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(To);function Lo(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Mo=Io;function Ao(t,e,r,n,i){Do(t,e,r||0,n||t.length-1,i||jo)}function Do(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Do(t,e,Math.max(r,Math.floor(e-a*l/o+u)),Math.min(n,Math.floor(e+(o-a)*l/o+u)),i)}var h=t[e],c=r,p=n;for(ko(t,r,e),i(t[n],h)>0&&ko(t,r,n);c<p;){for(ko(t,c,p),c++,p--;i(t[c],h)<0;)c++;for(;i(t[p],h)>0;)p--}0===i(t[r],h)?ko(t,r,p):ko(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function ko(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function jo(t,e){return t<e?-1:t>e?1:0}class Go{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const r=[];if(!Ho(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],s=e.leaf?n(a):a;Ho(t,s)&&(e.leaf?r.push(a):Zo(t,s)?this._all(a,r):i.push(a))}e=i.pop()}return r}collides(t){let e=this.data;if(!Ho(t,e))return!1;const r=[];for(;e;){for(let n=0;n<e.children.length;n++){const i=e.children[n],o=e.leaf?this.toBBox(i):i;if(Ho(t,o)){if(e.leaf||Zo(t,o))return!0;r.push(i)}}e=r.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=qo([]),this}remove(t,e){if(!t)return this;let r=this.data;const n=this.toBBox(t),i=[],o=[];let a,s,l;for(;r||i.length;){if(r||(r=i.pop(),s=i[i.length-1],a=o.pop(),l=!0),r.leaf){const n=No(t,r.children,e);if(-1!==n)return r.children.splice(n,1),i.push(r),this._condense(i),this}l||r.leaf||!Zo(r,n)?s?(a++,r=s.children[a],l=!1):r=null:(i.push(r),o.push(a),a=0,s=r,r=r.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const r=[];for(;t;)t.leaf?e.push(...t.children):r.push(...t.children),t=r.pop();return e}_build(t,e,r,n){const i=r-e+1;let o,a=this._maxEntries;if(i<=a)return o=qo(t.slice(e,r+1)),Bo(o,this.toBBox),o;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),o=qo([]),o.leaf=!1,o.height=n;const s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a));Jo(t,e,r,l,this.compareMinX);for(let i=e;i<=r;i+=l){const e=Math.min(i+l-1,r);Jo(t,i,e,s,this.compareMinY);for(let r=i;r<=e;r+=s){const i=Math.min(r+s-1,e);o.children.push(this._build(t,r,i,n-1))}}return Bo(o,this.toBBox),o}_chooseSubtree(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){let r,n=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=Wo(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<a?(a=h,n=u<n?u:n,r=l):h===a&&u<n&&(n=u,r=l)}e=r||e.children[0]}var i,o;return e}_insert(t,e,r){const n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),Uo(o,n);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)}_split(t,e){const r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n),a=qo(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Bo(r,this.toBBox),Bo(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,e){this.data=qo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Bo(this.data,this.toBBox)}_chooseSplitIndex(t,e,r){let n,i=1/0,o=1/0;for(let a=e;a<=r-e;a++){const e=zo(t,0,a,this.toBBox),s=zo(t,a,r,this.toBBox),l=Ko(e,s),u=Wo(e)+Wo(s);l<i?(i=l,n=a,o=u<o?u:o):l===i&&u<o&&(o=u,n=a)}return n||r-e}_chooseSplitAxis(t,e,r){const n=t.leaf?this.compareMinX:Vo,i=t.leaf?this.compareMinY:Xo;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);const i=this.toBBox,o=zo(t,0,e,i),a=zo(t,r-e,r,i);let s=Yo(o)+Yo(a);for(let n=e;n<r-e;n++){const e=t.children[n];Uo(o,t.leaf?i(e):e),s+=Yo(o)}for(let n=r-e-1;n>=e;n--){const e=t.children[n];Uo(a,t.leaf?i(e):e),s+=Yo(a)}return s}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)Uo(e[n],t)}_condense(t){for(let e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():Bo(t[r],this.toBBox)}}function No(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function Bo(t,e){zo(t,0,t.children.length,e,t)}function zo(t,e,r,n,i){i||(i=qo(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<r;o++){const e=t.children[o];Uo(i,t.leaf?n(e):e)}return i}function Uo(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 Vo(t,e){return t.minX-e.minX}function Xo(t,e){return t.minY-e.minY}function Wo(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Yo(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ko(t,e){const r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function Zo(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Ho(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function qo(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Jo(t,e,r,n,i){const o=[e,r];for(;o.length;){if((r=o.pop())-(e=o.pop())<=n)continue;const a=e+Math.ceil((r-e)/n/2)*n;Ao(t,a,e,r,i),o.push(e,a,a,r)}}var Qo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$o="renderOrder",ta=function(t){function e(e){var r=this,n=e||{},i=m({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return Qo(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($o)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Go(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set($o,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:oo,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;Array.isArray(t)?r=t:(nt("function"==typeof t.getZIndex,41),r=[t]),e=function(){return r}}return e}(this.style_),this.changed()},e}(Mo),ea={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},ra=[ea.FILL],na=[ea.STROKE],ia=[ea.BEGIN_PATH],oa=[ea.CLOSE_PATH],aa=ea,sa=function(){function t(){}return t.prototype.drawCustom=function(t,e,r,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),la=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ua=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,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 la(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var r=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;a<s;a+=e)n[0]=t[a],n[1]=t[a+1],re(r,n)&&(i[o++]=n[0],i[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,r,n,i,o){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+n;u<r;u+=n)d[0]=t[u],d[1]=t[u+1],(c=oe(l,d))!==h?(g&&(a[s++]=p,a[s++]=f,g=!1),a[s++]=d[0],a[s++]=d[1]):c===Kt?(a[s++]=d[0],a[s++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(i&&g||u===e+n)&&(a[s++]=p,a[s++]=f),s},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o],l=this.appendFlatLineCoordinates(t,e,s,n,!1,!1);i.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,r,n){this.beginGeometry(t,e);var i,o,a,s,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case yt:i=t.getOrientedFlatCoordinates(),s=[];var p=t.getEndss();l=0;for(var f=0,d=p.length;f<d;++f){var g=[];l=this.drawCustomCoordinates_(i,l,p[f],h,g),s.push(g)}this.instructions.push([aa.CUSTOM,c,s,t,r,gn]),this.hitDetectionInstructions.push([aa.CUSTOM,c,s,t,n||r,gn]);break;case dt:case _t:a=[],i=u==dt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(i,0,t.getEnds(),h,a),this.instructions.push([aa.CUSTOM,c,a,t,r,dn]),this.hitDetectionInstructions.push([aa.CUSTOM,c,a,t,n||r,dn]);break;case pt:case mt:i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,h,!1,!1),this.instructions.push([aa.CUSTOM,c,o,t,r,fn]),this.hitDetectionInstructions.push([aa.CUSTOM,c,o,t,n||r,fn]);break;case gt:i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,h))>c&&(this.instructions.push([aa.CUSTOM,c,o,t,r,fn]),this.hitDetectionInstructions.push([aa.CUSTOM,c,o,t,n||r,fn]));break;case ct:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([aa.CUSTOM,c,o,t,r]),this.hitDetectionInstructions.push([aa.CUSTOM,c,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[aa.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[aa.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,n,i=e.length,o=-1;for(t=0;t<i;++t)(n=(r=e[t])[0])==aa.END_GEOMETRY?o=t:n==aa.BEGIN_GEOMETRY&&(r[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=mi(n||Li)}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=mi(i||ki);var o=e.getLineCap();r.lineCap=void 0!==o?o:Mi;var a=e.getLineDash();r.lineDash=a?a.slice():Ai;var s=e.getLineDashOffset();r.lineDashOffset=s||0;var l=e.getLineJoin();r.lineJoin=void 0!==l?l:Di;var u=e.getWidth();r.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[aa.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[aa.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!g(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[aa.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=te(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;$t(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(sa),ha=ua,ca=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pa=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return ca(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([aa.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([aa.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([aa.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([aa.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ha),fa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),da=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return fa(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,r,n,!1,!1),a=[aa.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([aa.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Ai,0],ia);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(na),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([aa.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],ia);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],s);this.hitDetectionInstructions.push(na),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(na),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(na),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(ia)},e}(ha),ga=da,_a=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ya=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return _a(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,a=void 0!==i.strokeStyle,s=r.length;this.instructions.push(ia),this.hitDetectionInstructions.push(ia);for(var l=0;l<s;++l){var u=r[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!a),p=[aa.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(oa),this.hitDetectionInstructions.push(oa)),e=u}return o&&(this.instructions.push(ra),this.hitDetectionInstructions.push(ra)),a&&(this.instructions.push(na),this.hitDetectionInstructions.push(na)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([aa.SET_FILL_STYLE,Li]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([aa.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);var l=[aa.CIRCLE,s];this.instructions.push(ia,l),this.hitDetectionInstructions.push(ia,l),void 0!==r.fillStyle&&(this.instructions.push(ra),this.hitDetectionInstructions.push(ra)),void 0!==r.strokeStyle&&(this.instructions.push(na),this.hitDetectionInstructions.push(na)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([aa.SET_FILL_STYLE,Li]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([aa.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.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 r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([aa.SET_FILL_STYLE,Li]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([aa.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=hn(r[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}(ha),va=ya;function ma(t,e,r,n,i){var o,a,s,l,u,h,c,p,f,d=r,g=r,_=0,y=0,v=r;for(o=r;o<n;o+=i){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,s=Math.sqrt(p*p+f*f),void 0!==h&&(y+=a,Math.acos((h*p+c*f)/(a*s))>t&&(y>_&&(_=y,d=v,g=o),y=0,v=o-i)),a=s,h=p,c=f),l=m,u=x}return(y+=s)>_?[v,o]:[d,g]}var xa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wa={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Sa=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return xa(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 r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o=this.coordinates,a=o.length,s=t.getType(),l=null,u=t.getStride();if(i.placement!==ho||s!=pt&&s!=_t&&s!=dt&&s!=yt){var h=i.overflow?null:[];switch(s){case ct:case gt:l=t.getFlatCoordinates();break;case pt:l=t.getFlatMidpoint();break;case mt:l=t.getCenter();break;case _t:l=t.getFlatMidpoints(),u=2;break;case dt:l=t.getFlatInteriorPoint(),i.overflow||h.push(l[2]/this.resolution),u=3;break;case yt:var c=t.getFlatInteriorPoints();l=[];for(S=0,C=c.length;S<C;S+=3)i.overflow||h.push(c[S+2]/this.resolution),l.push(c[S],c[S+1]);if(0===l.length)return;u=2}if((F=this.appendFlatPointCoordinates(l,u))===a)return;if(h&&(F-a)/2!=l.length/u){var p=a/2;h=h.filter((function(t,e){var r=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return r||--p,r}))}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=i.padding;if(f!=Ni&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],_=i.padding[2],y=i.padding[3];i.scale[0]<0&&(g=-g,y=-y),i.scale[1]<0&&(d=-d,_=-_),f=[d,g,_,y]}var v=this.pixelRatio;this.instructions.push([aa.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==Ni?Ni:f.map((function(t){return t*v})),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var m=1/v;this.hitDetectionInstructions.push([aa.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,f,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!Pe(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),s==pt)x=[l.length];else if(s==_t)x=t.getEnds();else if(s==dt)x=t.getEnds().slice(0,1);else if(s==yt){var w=t.getEndss();x=[];for(var S=0,C=w.length;S<C;++S)x.push(w[S][0])}this.beginGeometry(t,e);for(var E=i.textAlign,T=0,b=void 0,R=0,P=x.length;R<P;++R){if(null==E){var O=ma(i.maxAngle,l,T,x[R],u);T=O[0],b=O[1]}else b=x[R];for(var S=T;S<b;S+=u)o.push(l[S],l[S+1]);var F=o.length;T=x[R],this.drawChars_(a,F),a=F}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=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 i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||ji,textBaseline:e.textBaseline||Gi,scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e){var r=this.textStrokeState_,n=this.textState_,i=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=wa[n.textBaseline],u=this.textOffsetY_*s,h=this.text_,c=r?r.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([aa.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,s,u,i,c*s,h,o,1]),this.hitDetectionInstructions.push([aa.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,1,u,i,c,h,o,1/s])},e.prototype.setTextStyle=function(t,e){var r,i,o;if(t){var a=t.getFill();a?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=mi(a.getColor()||Li)):(i=null,this.textFillState_=i);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var l=s.getLineDash(),u=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();o.lineCap=s.getLineCap()||Mi,o.lineDash=l?l.slice():Ai,o.lineDashOffset=void 0===u?0:u,o.lineJoin=s.getLineJoin()||Di,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=mi(s.getColor()||ki)}else o=null,this.textStrokeState_=o;r=this.textState_;var p=t.getFont()||Ii;Wi(p);var f=t.getScaleArray();r.overflow=t.getOverflow(),r.font=p,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||Gi,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Ni,r.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),_=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==_&&_,this.textRotation_=void 0===y?0:y,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:n(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+n(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(ha),Ca={Circle:va,Default:ha,Image:pa,LineString:ga,Polygon:va,Text:Sa},Ea=function(){function t(t,e,r,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];void 0===i&&(i=new(0,Ca[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i);return i},t}(),Ta=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ba=function(t){function r(e){var r=t.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r.declutterExecutorGroup=null,r}return Ta(r,t),r.prototype.getFeatures=function(t){return e()},r.prototype.getData=function(t){return null},r.prototype.prepareFrame=function(t){return e()},r.prototype.renderFrame=function(t,r){return e()},r.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},r.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},r.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){},r.prototype.getDataAtPixel=function(t,e,r){return null},r.prototype.getLayer=function(){return this.layer_},r.prototype.handleFontsChanged=function(){},r.prototype.handleImageChange_=function(t){t.target.getState()===ri&&this.renderIfReadyAndVisible()},r.prototype.loadImage=function(t){var e=t.getState();return e!=ri&&e!=ni&&t.addEventListener(T,this.boundHandleImageChange_),e==ti&&(t.load(),e=t.getState()),e==ri},r.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Po&&t.changed()},r.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},r}(W),Ra=ba,Pa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Oa=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Pa(e,t),e}(s),Fa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ia=null;var La=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return Fa(e,t),e.prototype.getImageData=function(t,e,r){var n,i;Ia||((n=document.createElement("canvas")).width=1,n.height=1,Ia=n.getContext("2d")),Ia.clearRect(0,0,1,1);try{Ia.drawImage(t,e,r,1,1,0,0,1,1),i=Ia.getImageData(0,0,1,1).data}catch(t){return null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,r,n){var i,o,a=this.getLayer().getClassName();t&&t.className===a&&""===t.style.opacity&&1===r&&(!n||t.style.backgroundColor&&g(_i(t.style.backgroundColor),_i(n)))&&((l=t.firstElementChild)instanceof HTMLCanvasElement&&(o=l.getContext("2d")));if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(i=document.createElement("div")).className=a;var s=i.style;s.position="absolute",s.width="100%",s.height="100%",n&&(s.backgroundColor=n);var l=(o=xi()).canvas;i.appendChild(l),(s=l.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=o}},e.prototype.clipUnrotated=function(t,e,r){var n=Te(r),i=be(r),o=me(r),a=ve(r);jt(e.coordinateToPixelTransform,n),jt(e.coordinateToPixelTransform,i),jt(e.coordinateToPixelTransform,o),jt(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;jt(s,n),jt(s,i),jt(s,o),jt(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(i[0]),Math.round(i[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,r){var n=this.getLayer();if(n.hasListener(t)){var i=new Oa(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(zn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Un,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,a){var s=i/2,l=o/2,u=n/e,h=-u,c=-t[0]+a,p=-t[1];return Nt(this.tempTransform,s,l,u,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var n=jt(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!re(o,jt(e.pixelToCoordinateTransform,t.slice())))return null;var a,s=Math.round(n[0]),l=Math.round(n[1]),u=this.pixelContext_;if(!u){var h=document.createElement("canvas");h.width=1,h.height=1,u=h.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(i.canvas,s,l,1,1,0,0,1,1),a=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):a}return 0===a[3]?null:a},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Ra),Ma=La,Aa="Circle",Da="Default",ka="Image",ja="LineString",Ga="Polygon",Na="Text";function Ba(t,e,r,n,i,o,a,s,l,u,h,c){var p=t[e],f=t[e+1],d=0,g=0,_=0,y=0;function v(){d=p,g=f,p=t[e+=n],f=t[e+1],y+=_,_=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{v()}while(e<r-n&&y+_<o);for(var m=0===_?0:(o-y)/_,x=Be(d,p,m),w=Be(g,f,m),S=e-n,C=y,E=o+s*l(u,i,h);e<r-n&&y+_<E;)v();var T,b=Be(d,p,m=0===_?0:(E-y)/_),R=Be(g,f,m);if(c){var P=[x,w,b,R];Xr(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=x>b;var O,F=Math.PI,I=[],L=S+n===e;if(_=0,y=C,p=t[e=S],f=t[e+1],L){v(),O=Math.atan2(f-g,p-d),T&&(O+=O>0?-F:F);var M=(b+x)/2,A=(R+w)/2;return I[0]=[M,A,(E-o)/2,O,i],I}for(var D=0,k=i.length;D<k;){v();var j=Math.atan2(f-g,p-d);if(T&&(j+=j>0?-F:F),void 0!==O){var G=j-O;if(G+=G>F?-2*F:G<-F?2*F:0,Math.abs(G)>a)return null}O=j;for(var N=D,B=0;D<k;++D){var z=s*l(u,i[T?k-D-1:D],h);if(e+n<r&&y+_<o+B+z/2)break;B+=z}if(D!==N){var U=T?i.substring(k-N,k-D):i.substring(N,D);M=Be(d,p,m=0===_?0:(o+B/2-y)/_),A=Be(g,f,m);I.push([M,A,B/2,j,U]),o+=B}}return I}var za=[1/0,1/0,-1/0,-1/0],Ua=[],Va=[],Xa=[],Wa=[];function Ya(t){return t[3].declutterBox}var Ka=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Za(t,e){return"start"!==e&&"end"!==e||Ka.test(t)||(e="start"===e?"left":"right"),wa[e]}function Ha(t,e,r){return r>0&&t.push("\n",""),t.push(e,""),t}var qa=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,a=r?this.fillStates[r]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],h=Array.isArray(t),c=Za(h?t[0]:t,s.textAlign||ji),p=n&&o.lineWidth?o.lineWidth:0,f=h?t:t.split("\n").reduce(Ha,[]),d=function(t,e){for(var r=[],n=[],i=[],o=0,a=0,s=0,l=0,u=0,h=e.length;u<=h;u+=2){var c=e[u];if("\n"!==c&&u!==h){var p=e[u+1]||t.font,f=Zi(p,c);r.push(f),a+=f;var d=Yi(p);n.push(d),l=Math.max(l,d)}else o=Math.max(o,a),i.push(a),a=0,s+=l}return{width:o,height:s,widths:r,heights:n,lineWidths:i}}(s,f),g=d.width,_=d.height,y=d.widths,v=d.heights,m=d.lineWidths,x=g+p,w=[],S=(x+2)*u[0],C=(_+p)*u[1],E={width:S<0?Math.floor(S):Math.ceil(S),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:w};(1==u[0]&&1==u[1]||w.push("scale",u),n)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",p),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(Ft?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));r&&w.push("fillStyle",a.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var T,b=.5-c,R=c*x+b*p,P=[],O=[],F=0,I=0,L=0,M=0,A=0,D=f.length;A<D;A+=2){var k=f[A];if("\n"!==k){var j=f[A+1]||s.font;j!==T&&(n&&P.push("font",j),r&&O.push("font",j),T=j),F=Math.max(F,v[L]);var G=[k,R+b*y[L]+c*(y[L]-m[M]),.5*(p+F)+I];R+=y[L],n&&P.push("strokeText",G),r&&O.push("fillText",G),++L}else I+=F,F=0,R=c*x+b*p,++M}return Array.prototype.push.apply(w,P),Array.prototype.push.apply(w,O),this.labels_[i]=E,E},t.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,r,n,i,o,a,s,l,u,h,c,p,f,d,g){var _,y=r-(a*=c[0]),v=n-(s*=c[1]),m=i+l>t?t-l:i,x=o+u>e?e-u:o,w=f[3]+m*c[0]+f[1],S=f[0]+x*c[1]+f[2],C=y-f[3],E=v-f[0];return(d||0!==h)&&(Ua[0]=C,Wa[0]=C,Ua[1]=E,Va[1]=E,Va[0]=C+w,Xa[0]=Va[0],Xa[1]=E+S,Wa[1]=Xa[1]),0!==h?(jt(_=Nt([1,0,0,1,0,0],r,n,1,1,h,-r,-n),Ua),jt(_,Va),jt(_,Xa),jt(_,Wa),se(Math.min(Ua[0],Va[0],Xa[0],Wa[0]),Math.min(Ua[1],Va[1],Xa[1],Wa[1]),Math.max(Ua[0],Va[0],Xa[0],Wa[0]),Math.max(Ua[1],Va[1],Xa[1],Wa[1]),za)):se(Math.min(C,C+w),Math.min(E,E+S),Math.max(C,C+w),Math.max(E,E+S),za),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:za[0],minY:za[1],maxX:za[2],maxY:za[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a){var s=!(!o&&!a),l=n.declutterBox,u=t.canvas,h=a?a[2]*n.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(s&&this.replayTextBackground_(t,Ua,Va,Xa,Wa,o,a),qi(t,n.canvasTransform,i,r,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=jt(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,n){var i=this.textStates[e],o=this.createLabel(t,e,n,r),a=this.strokeStates[r],s=this.pixelRatio,l=Za(Array.isArray(t)?t[0]:t,i.textAlign||ji),u=wa[i.textBaseline||Gi],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*i.scale[0])+2*(.5-l)*h,anchorY:u*o.height/s+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,n,i,o,a,s){var l,u,h;this.pixelCoordinates_&&g(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Vr(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),u=this.renderedTransform_,h=r,u[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,p,f,d,_,y,v,m,x,w,S,C,E,T,b,R,P=0,O=n.length,F=0,I=0,L=0,M=null,A=null,D=this.coordinateCache_,k=this.viewRotation_,j=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},N=this.instructions!=n||this.overlaps?0:200;P<O;){var B=n[P];switch(B[0]){case aa.BEGIN_GEOMETRY:E=B[1],R=B[3],E.getGeometry()?void 0===a||Pe(a,R.getExtent())?++P:P=B[2]+1:P=B[2];break;case aa.BEGIN_PATH:I>N&&(this.fill_(t),I=0),L>N&&(t.stroke(),L=0),I||L||(t.beginPath(),d=NaN,_=NaN),++P;break;case aa.CIRCLE:var z=l[F=B[1]],U=l[F+1],V=l[F+2]-z,X=l[F+3]-U,W=Math.sqrt(V*V+X*X);t.moveTo(z+W,U),t.arc(z,U,W,0,2*Math.PI,!0),++P;break;case aa.CLOSE_PATH:t.closePath(),++P;break;case aa.CUSTOM:F=B[1],c=B[2];var Y=B[3],K=B[4],Z=6==B.length?B[5]:void 0;G.geometry=Y,G.feature=E,P in D||(D[P]=[]);var H=D[P];Z?Z(l,F,c,2,H):(H[0]=l[F],H[1]=l[F+1],H.length=2),K(H,G),++P;break;case aa.DRAW_IMAGE:F=B[1],c=B[2],m=B[3],p=B[4],f=B[5];var q=B[6],J=B[7],Q=B[8],$=B[9],tt=B[10],et=B[11],rt=B[12],nt=B[13],it=B[14];if(!m&&B.length>=19){x=B[18],w=B[19],S=B[20],C=B[21];var ot=this.drawLabelWithPointPlacement_(x,w,S,C);m=ot.label,B[3]=m;var at=B[22];p=(ot.anchorX-at)*this.pixelRatio,B[4]=p;var st=B[23];f=(ot.anchorY-st)*this.pixelRatio,B[5]=f,q=m.height,B[6]=q,nt=m.width,B[13]=nt}var lt=void 0;B.length>24&&(lt=B[24]);var ut=void 0,ht=void 0,ct=void 0;B.length>16?(ut=B[15],ht=B[16],ct=B[17]):(ut=Ni,ht=!1,ct=!1),tt&&j?et+=k:tt||j||(et-=k);for(var pt=0;F<c;F+=2)if(!(lt&<[pt++]<nt/this.pixelRatio)){var ft=[t,e,m,Bt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[F],l[F+1],nt,q,p,f,Q,$,et,rt,i,ut,ht||ct,E),J,ht?M:null,ct?A:null],dt=void 0,gt=void 0;if(s&&it){var _t=c-F;if(!it[_t]){it[_t]=ft;continue}if(dt=it[_t],delete it[_t],gt=Ya(dt),s.collides(gt))continue}s&&s.collides(Bt.declutterBox)||(dt&&(s&&s.insert(gt),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Bt.declutterBox),this.replayImageOrLabel_.apply(this,ft))}++P;break;case aa.DRAW_CHARS:var yt=B[1],vt=B[2],mt=B[3],xt=B[4];C=B[5];var wt=B[6],St=B[7],Ct=B[8];S=B[9];var Et=B[10];x=B[11],w=B[12];var Tt=[B[13],B[13]],bt=this.textStates[w],Rt=bt.font,Pt=[bt.scale[0]*St,bt.scale[1]*St],Ot=void 0;Rt in this.widths_?Ot=this.widths_[Rt]:(Ot={},this.widths_[Rt]=Ot);var Ft=Hn(l,yt,vt,2),It=Math.abs(Pt[0])*Hi(Rt,x,Ot);if(xt||It<=Ft){var Lt=this.textStates[w].textAlign,Mt=Ba(l,yt,vt,2,x,(Ft-It)*wa[Lt],wt,Math.abs(Pt[0]),Hi,Rt,Ot,j?0:this.viewRotation_);t:if(Mt){var At=[],Dt=void 0,kt=void 0,jt=void 0,Gt=void 0,Nt=void 0;if(S)for(Dt=0,kt=Mt.length;Dt<kt;++Dt){jt=(Nt=Mt[Dt])[4],Gt=this.createLabel(jt,w,"",S),p=Nt[2]+(Pt[0]<0?-Et:Et),f=mt*Gt.height+2*(.5-mt)*Et*Pt[1]/Pt[0]-Ct;var Bt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,Nt[0],Nt[1],Gt.width,Gt.height,p,f,0,0,Nt[3],Tt,!1,Ni,!1,E);if(s&&s.collides(Bt.declutterBox))break t;At.push([t,e,Gt,Bt,1,null,null])}if(C)for(Dt=0,kt=Mt.length;Dt<kt;++Dt){jt=(Nt=Mt[Dt])[4],Gt=this.createLabel(jt,w,C,""),p=Nt[2],f=mt*Gt.height-Ct;Bt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,Nt[0],Nt[1],Gt.width,Gt.height,p,f,0,0,Nt[3],Tt,!1,Ni,!1,E);if(s&&s.collides(Bt.declutterBox))break t;At.push([t,e,Gt,Bt,1,null,null])}s&&s.load(At.map(Ya));for(var zt=0,Ut=At.length;zt<Ut;++zt)this.replayImageOrLabel_.apply(this,At[zt])}}++P;break;case aa.END_GEOMETRY:if(void 0!==o){var Vt=o(E=B[1],R);if(Vt)return Vt}++P;break;case aa.FILL:N?I++:this.fill_(t),++P;break;case aa.MOVE_TO_LINE_TO:for(F=B[1],c=B[2],T=l[F],v=(b=l[F+1])+.5|0,(y=T+.5|0)===d&&v===_||(t.moveTo(T,b),d=y,_=v),F+=2;F<c;F+=2)y=(T=l[F])+.5|0,v=(b=l[F+1])+.5|0,F!=c-2&&y===d&&v===_||(t.lineTo(T,b),d=y,_=v);++P;break;case aa.SET_FILL_STYLE:M=B,this.alignFill_=B[2],I&&(this.fill_(t),I=0,L&&(t.stroke(),L=0)),t.fillStyle=B[1],++P;break;case aa.SET_STROKE_STYLE:A=B,L&&(t.stroke(),L=0),this.setStrokeStyle_(t,B),++P;break;case aa.STROKE:N?L++:t.stroke(),++P;break;default:++P}}I&&this.fill_(t),L&&t.stroke()},t.prototype.execute=function(t,e,r,n,i,o){this.viewRotation_=n,this.execute_(t,e,r,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,i)},t}(),Ja=qa,Qa=[Ga,Aa,ja,ka,Na,Da],$a=function(){function t(t,e,r,n,i,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new Ja(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var a=2*(n=Math.round(n))+1,s=Nt(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=xi(a,a));var u,c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):l||c.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(fe(u=[1/0,1/0,-1/0,-1/0],t),$t(u,e*(this.renderBuffer_+n),u));var p,f=function(t){if(void 0!==ts[t])return ts[t];for(var e=2*t+1,r=t*t,n=new Array(r+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var a=i*i+o*o;if(a>r)break;var s=n[a];s||(s=[],n[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,n.length);i<u;++i)n[i]&&l.push.apply(l,n[i]);return ts[t]=l,l}(n);function d(t,e){for(var r=c.getImageData(0,0,a,a).data,s=0,l=f.length;s<l;s++)if(r[f[s]]>0){if(!o||p!==ka&&p!==Na||-1!==o.indexOf(t)){var u=(f[s]-3)/4,h=n-u%a,d=n-(u/a|0),g=i(t,e,h*h+d*d);if(g)return g}c.clearRect(0,0,a,a);break}}var g,_,y,v,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(h),g=x.length-1;g>=0;--g){var w=x[g].toString();for(y=this.executorsByZIndex_[w],_=Qa.length-1;_>=0;--_)if(void 0!==(v=y[p=Qa[_]])&&(m=v.executeHitDetection(c,s,r,d,u)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return Vr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return S(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(h),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,c,p,f,d,g=o||Qa;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var _=s[l].toString();for(f=this.executorsByZIndex_[_],c=0,p=g.length;c<p;++c){void 0!==(d=f[g[c]])&&d.execute(t,e,r,n,i,a)}}this.maxExtent_&&t.restore()},t}(),ts={};var es=$a,rs=0,ns=1,is=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),os=function(t){function e(e,r,n,i,o,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=r,l.extent_=n,l.transform_=i,l.viewRotation_=o,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return is(e,t),e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=Vr(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=i.length;u<h;u+=2){var c=i[u]-this.imageAnchorX_,p=i[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;Nt(a,f,d,1,1,l,-f,-d),o.setTransform.apply(o,a),o.translate(f,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=Vr(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<r;e+=n){var s=i[e]+this.textOffsetX_,l=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Nt(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);o.setTransform.apply(o,u),o.translate(s,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,s,l),this.textFillState_&&o.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,a=Vr(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(Pe(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,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return Vr(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,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 ct:this.drawPoint(t);break;case pt:this.drawLineString(t);break;case dt:this.drawPolygon(t);break;case gt:this.drawMultiPoint(t);break;case _t:this.drawMultiLineString(t);break;case yt:this.drawMultiPolygon(t);break;case vt:this.drawGeometryCollection(t);break;case mt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&Pe(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Pe(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.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(Pe(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();r.beginPath();for(var s=0,l=o.length;s<l;++s)i=this.moveToLineTo_(n,i,o[s],a,!1);r.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Pe(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 r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Pe(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_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var l=i[a];n=this.drawRings_(r,n,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.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_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.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_,r=this.contextTextState_,n=t.textAlign?t.textAlign:ji;r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var r=this;if(t){var n=t.getColor();this.fillState_={fillStyle:mi(n||Li)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=a||Ai;this.strokeState_={lineCap:void 0!==o?o:Mi,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*r.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Di,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:mi(i||ki)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var r=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*this.pixelRatio_,this.imageAnchorY_=r[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:mi(r||Li)}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Mi,lineDash:a||Ai,lineDashOffset:s||0,lineJoin:void 0!==l?l:Di,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:mi(i||ki)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),_=t.getScaleArray(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:Ii,textAlign:void 0!==v?v:ji,textBaseline:void 0!==m?m:Gi},this.text_=void 0!==y?Array.isArray(y)?y.reduce((function(t,e,r){return t+(r%2?" ":e)}),""):y:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*_[0],this.pixelRatio_*_[1]]}else this.text_=""},e}(sa),as=os,ss="fraction",ls="pixels",us="bottom-left",hs="bottom-right",cs="top-left",ps="top-right";function fs(t,e,r){return e+":"+t+":"+(r?fi(r):"null")}var ds=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 r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=fs(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=fs(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),gs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_s=function(t){function r(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return gs(r,t),r.prototype.changed=function(){this.dispatchEvent(T)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return e()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){e()},r}(E),ys=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function vs(t,e,r){var n=t,i=!0,o=!1,a=!1,s=[B(n,D,(function(){a=!0,o||e()}))];return n.src&&It?(o=!0,n.decode().then((function(){i&&e()})).catch((function(t){i&&(a?e():r())}))):s.push(B(n,b,r)),function(){i=!1,s.forEach(z)}}var ms=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,n,ti)||this;return s.src_=i,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=ti,s.imageLoadFunction_=a,s}return ys(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=ni,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Ce(this.extent)/this.image_.height),this.state=ri,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=ti&&this.state!=ni||(this.state=ei,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=vs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Ce(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(_s),xs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ws=null,Ss=function(t){function e(e,r,n,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=n,s.src_=r,s.tainted_,s}return xs(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===ri){ws||(ws=xi(1,1)),ws.drawImage(this.image_,0,0);try{ws.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ws=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(T)},e.prototype.handleImageError_=function(){this.imageState_=ni,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=ri,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],r=xi(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==ti){this.imageState_=ei;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=vs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===ri){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 r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),r.globalCompositeOperation="multiply","multiply"===r.globalCompositeOperation||this.isTainted_())r.fillStyle=fi(this.color_),r.fillRect(0,0,e.width/t,e.height/t),r.globalCompositeOperation="destination-in",r.drawImage(this.image_,0,0);else{for(var n=r.getImageData(0,0,e.width,e.height),i=n.data,o=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,h=i.length;u<h;u+=4)i[u]*=o,i[u+1]*=a,i[u+2]*=s,i[u+3]*=l;r.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(E);var Cs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Es=function(t){function e(e){var r=this,i=e||{},o=void 0!==i.opacity?i.opacity:1,a=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,l=void 0!==i.rotateWithView&&i.rotateWithView;(r=t.call(this,{opacity:o,rotation:a,scale:s,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:cs,r.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:ss,r.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:ss,r.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var u=void 0!==i.img?i.img:null;r.imgSize_=i.imgSize;var h=i.src;nt(!(void 0!==h&&u),4),nt(!u||u&&r.imgSize_,5),void 0!==h&&0!==h.length||!u||(h=u.src||n(u)),nt(void 0!==h&&h.length>0,6);var c=void 0!==i.src?ti:ri;return r.color_=void 0!==i.color?_i(i.color):null,r.iconImage_=function(t,e,r,n,i,o){var a=ds.get(e,n,o);return a||(a=new Ss(t,e,r,n,i,o),ds.set(e,n,o,a)),a}(u,h,void 0!==r.imgSize_?r.imgSize_:null,r.crossOrigin_,c,r.color_),r.offset_=void 0!==i.offset?i.offset:[0,0],r.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:cs,r.origin_=null,r.size_=void 0!==i.size?i.size:null,r}return Cs(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_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==ss||this.anchorYUnits_==ss){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ss&&(t[0]*=e[0]),this.anchorYUnits_==ss&&(t[1]*=e[1])}if(this.anchorOrigin_!=cs){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ps&&this.anchorOrigin_!=hs||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=us&&this.anchorOrigin_!=hs||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},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.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_;if(this.offsetOrigin_!=cs){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=ps&&this.offsetOrigin_!=hs||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=us&&this.offsetOrigin_!=hs||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(T,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(T,t)},e}(hi),Ts=Es,bs=.5;function Rs(t,e,r,n,i,o,a){var s=xi(t[0]*bs,t[1]*bs);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new as(s,bs,i,null,a),c=r.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var g=r[d-1],_=g.getStyleFunction()||n;if(n){var y=_(g,o);if(y){Array.isArray(y)||(y=[y]);for(var v="#"+("000000"+(d*p).toString(16)).slice(-6),m=0,x=y.length;m<x;++m){var w=y[m],S=w.getGeometryFunction()(g);if(S&&Pe(i,S.getExtent())){var C=w.clone(),E=C.getFill();E&&E.setColor(v);var T=C.getStroke();T&&(T.setColor(v),T.setLineDash(null)),C.setText(void 0);var b=w.getImage();if(b&&0!==b.getOpacity()){var R=b.getImageSize();if(!R)continue;var P=xi(R[0],R[1],void 0,{alpha:!1}),O=P.canvas;P.fillStyle=v,P.fillRect(0,0,O.width,O.height),C.setImage(new Ts({img:O,imgSize:R,anchor:b.getAnchor(),anchorXUnits:ls,anchorYUnits:ls,offset:b.getOrigin(),opacity:1,size:b.getSize(),scale:b.getScale(),rotation:b.getRotation(),rotateWithView:b.getRotateWithView()}))}var F=C.getZIndex()||0;(M=f[F])||(M={},f[F]=M,M[dt]=[],M[mt]=[],M[pt]=[],M[ct]=[]),M[S.getType().replace("Multi","")].push(S,C)}}}}}for(var I=Object.keys(f).map(Number).sort(h),L=(d=0,I.length);d<L;++d){var M=f[I[d]];for(var A in M){var D=M[A];for(m=0,x=D.length;m<x;m+=2){u.setStyle(D[m+1]);for(var k=0,j=e.length;k<j;++k)u.setTransform(e[k]),u.drawGeometry(D[m])}}}return s.getImageData(0,0,l.width,l.height)}function Ps(t,e,r){var n=[];if(r){var i=Math.floor(Math.round(t[0])*bs),o=Math.floor(Math.round(t[1])*bs),a=4*(Le(i,0,r.width-1)+Le(o,0,r.height-1)*r.width),s=r.data[a],l=r.data[a+1],u=r.data[a+2]+256*(l+256*s),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Os={Point:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=ri)return;var l=t.getBuilder(r.getZIndex(),ka);l.setImageStyle(a,o),l.drawPoint(e,n)}if(s&&s.getText()){var u=t.getBuilder(r.getZIndex(),Na);u.setTextStyle(s,o),u.drawText(e,n)}},LineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),ja);a.setFillStrokeStyle(null,o),a.drawLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Na);l.setTextStyle(s),l.drawText(e,n)}},Polygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Ga);s.setFillStrokeStyle(o,a),s.drawPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Na);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=ri)return;var l=t.getBuilder(r.getZIndex(),ka);l.setImageStyle(a,o),l.drawMultiPoint(e,n)}if(s&&s.getText()){var u=(i||t).getBuilder(r.getZIndex(),Na);u.setTextStyle(s,o),u.drawText(e,n)}},MultiLineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),ja);a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Na);l.setTextStyle(s),l.drawText(e,n)}},MultiPolygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(a||o){var s=t.getBuilder(r.getZIndex(),Ga);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Na);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,r,n,i){var o,a,s=e.getGeometriesArray();for(o=0,a=s.length;o<a;++o){(0,Os[s[o].getType()])(t,s[o],r,n,i)}},Circle:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Aa);s.setFillStrokeStyle(o,a),s.drawCircle(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Na);u.setTextStyle(l),u.drawText(e,n)}}};function Fs(t,e){return parseInt(n(t),10)-parseInt(n(e),10)}function Is(t,e){var r=Ls(t,e);return r*r}function Ls(t,e){return.5*t/e}function Ms(t,e,r,n,i,o,a){var s=!1,l=r.getImage();if(l){var u=l.getImageState();u==ri||u==ni?l.unlistenImageChange(i):(u==ti&&l.load(),u=l.getImageState(),l.listenImageChange(i),s=!0)}return function(t,e,r,n,i,o){var a=r.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(n,i);if(r.getRenderer())As(t,s,r,e);else{(0,Os[s.getType()])(t,s,r,e,o)}}(t,e,r,n,o,a),s}function As(t,e,r,n){if(e.getType()!=vt)t.getBuilder(r.getZIndex(),Da).drawCustom(e,n,r.getRenderer(),r.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,a=i.length;o<a;++o)As(t,i[o],r,n)}var Ds=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ks=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r}return Ds(e,t),e.prototype.renderWorlds=function(t,e,r){var n=e.extent,i=e.viewState,o=i.center,a=i.resolution,s=i.projection,l=i.rotation,u=s.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[rs]||p[ns]),d=this.context,g=Math.round(e.size[0]*c),_=Math.round(e.size[1]*c),y=h.getWrapX()&&s.canWrapX(),v=y?Re(u):null,m=y?Math.ceil((n[2]-u[2])/v)+1:1,x=y?Math.floor((n[0]-u[0])/v):0;do{var w=this.getRenderTransform(o,a,l,c,g,_,x*v);t.execute(d,1,w,l,f,void 0,r)}while(++x<m)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){kt(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),Bt(this.inversePixelTransform,this.pixelTransform);var i=zt(this.pixelTransform);this.useContainer(e,i,n.opacity,this.getBackground(t));var o=this.context,a=o.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*r),h=Math.round(t.size[1]*r);a.width!=u||a.height!=h?(a.width=u,a.height=h,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection;var p=!1,f=!0;if(n.extent&&this.clipping){var d=Ur(n.extent);(p=(f=Pe(d,t.extent))&&!ne(d,t.extent))&&this.clipUnrotated(o,t,d)}f&&this.renderWorlds(s,t),p&&o.restore(),this.postRender(o,t);var g=Fi(n.opacity),_=this.container;return g!==_.style.opacity&&(_.style.opacity=g),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];jt(this.pixelTransform,r);var n=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=r[0]*bs,c=r[1]*bs;u.push(this.getRenderTransform(n,i,o,bs,h,c,0).slice());var p=l.getSource(),f=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!ne(f,s)){for(var d=s[0],g=Re(f),_=0,y=void 0;d<f[0];)y=g*--_,u.push(this.getRenderTransform(n,i,o,bs,h,c,y).slice()),d+=g;for(_=0,d=s[2];d>f[2];)y=g*++_,u.push(this.getRenderTransform(n,i,o,bs,h,c,y).slice()),d-=g}this.hitDetectionImageData_=Rs(r,u,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}e(Ps(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,o){var a=this;if(this.replayGroup_){var s,l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,r){var a=n(t),s=c[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return c[a]=!0,o.splice(o.lastIndexOf(s),1),i(t,h,e);s.geometry=e,s.distanceSq=r}}else{if(0===r)return c[a]=!0,i(t,h,e);o.push(c[a]={feature:t,layer:h,geometry:e,distanceSq:r,callback:i})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some((function(n){return s=n.forEachFeatureAtCoordinate(t,l,u,r,p,n===a.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var n=t.viewHints[rs],i=t.viewHints[ns],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Fs);var _=l.center.slice(),y=$t(s,f*h),v=y.slice(),m=[y.slice()],x=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!ne(x,t.extent)){var w=Re(x),S=Math.max(Re(y)/2,w);y[0]=x[0]-S,y[2]=x[2]+S,yr(_,u);var C=function(t,e){var r=e.getExtent(),n=xe(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var i=Re(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}(m[0],u);C[0]<x[0]&&C[2]<x[2]?m.push([C[0]+w,C[1],C[2]+w,C[3]]):C[0]>x[0]&&C[2]>x[2]&&m.push([C[0]-w,C[1],C[2]-w,C[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&ne(this.wrappedRenderedExtent_,y))return g(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var E,T=new Ea(Ls(h,c),y,h,c);this.getLayer().getDeclutter()&&(E=new Ea(Ls(h,c),y,h,c));for(var b=0,R=m.length;b<R;++b)r.loadFeatures(m[b],h,u);var P=Is(h,c),O=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,P,r,T,undefined,E);this.dirty_=this.dirty_||i}}.bind(this),F=zr(y),I=r.getFeaturesInExtent(F);d&&I.sort(d);for(b=0,R=I.length;b<R;++b)O(I[b]);this.renderedFeatures_=I;var L=T.finish(),M=new es(y,h,c,r.getOverlaps(),L,e.getRenderBuffer());return E&&(this.declutterExecutorGroup=new es(y,h,c,r.getOverlaps(),E.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=v,this.wrappedRenderedExtent_=y,this.renderedCenter_=_,this.renderedProjection_=u,this.replayGroup_=M,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i,o){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)a=Ms(n,t,r[s],e,this.boundHandleStyleImageChange_,i,o)||a;else a=Ms(n,t,r,e,this.boundHandleStyleImageChange_,i,o);return a},e}(Ma),js=ks,Gs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ns=function(t){function e(e){return t.call(this,e)||this}return Gs(e,t),e.prototype.createRenderer=function(){return new js(this)},e}(ta),Bs=function(){function t(t){this.rbush_=new Go(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[n(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),i=0,o=e.length;i<o;i++){var a=t[i],s=e[i],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};r[i]=l,this.items_[n(s)]=l}this.rbush_.load(r)},t.prototype.remove=function(t){var e=n(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[n(e)];ce([r.minX,r.minY,r.maxX,r.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 r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return S(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return se(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}(),zs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Us(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Vs=function(t){function r(e){var r=t.call(this)||this;r.projection=Pr(e.projection),r.attributions_=Us(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:Po,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r.interpolate_=!!e.interpolate,r.viewResolver=null,r.viewRejector=null;var n=r;return r.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),r}return zs(r,t),r.prototype.getAttributions=function(){return this.attributions_},r.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},r.prototype.getProjection=function(){return this.projection},r.prototype.getResolutions=function(){return e()},r.prototype.getView=function(){return this.viewPromise_},r.prototype.getState=function(){return this.state_},r.prototype.getWrapX=function(){return this.wrapX_},r.prototype.getInterpolate=function(){return this.interpolate_},r.prototype.refresh=function(){this.changed()},r.prototype.setAttributions=function(t){this.attributions_=Us(t),this.changed()},r.prototype.setState=function(t){this.state_=t,this.changed()},r}(q),Xs="addfeature",Ws="changefeature",Ys="clear",Ks="removefeature",Zs="featuresloadstart",Hs="featuresloadend",qs="featuresloaderror";function Js(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Qs="arraybuffer",$s="json",tl="text",el="xml";function rl(t,e,r,n,i,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(r,n,i):t,!0),e.getType()==Qs&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var n=e.getType(),l=void 0;n==$s||n==tl?l=s.responseText:n==el?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):n==Qs&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function nl(t,e){return function(r,n,i,o,a){var s=this;rl(t,e,r,n,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||v)}}var il=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ol=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return il(e,t),e}(s),al=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:Po,wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=v,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(nt(r.format_,7),r.loader_=nl(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:Js;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new Bs:null,r.loadedExtentsRtree_=new Bs,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new rt(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return il(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 r=t.getGeometry();if(r){var i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new ol(Xs,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[N(e,T,this.handleFeatureChange_,this),N(e,l,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(nt(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],i=[],o=0,a=t.length;o<a;o++){var s=n(u=t[o]);this.addToIndex_(s,u)&&r.push(u)}o=0;for(var l=r.length;o<l;o++){var u;s=n(u=r[o]);this.setupChangeEvents_(s,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),i.push(u)}else this.nullGeometryFeatures_[s]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,i),this.hasListener(Xs)){o=0;for(var p=r.length;o<p;o++)this.dispatchEvent(new ol(Xs,r[o]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Xs,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(Ks,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(J,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Q,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(z)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var r=function(t){this.removeFeatureInternal(t)}.bind(this);for(var n in this.featuresRtree_.forEach(r),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new ol(Ys);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):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(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),S(this.nullGeometryFeatures_)||d(t,w(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||_;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(r,n,o,a))<u){i=t;var h=Math.sqrt(a);s[0]=r-h,s[1]=n-h,s[2]=r+h,s[3]=n+h}}})),i},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,r=n(e),i=e.getGeometry();if(i){var o=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=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_[r]=e;this.changed(),this.dispatchEvent(new ol(Ws,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_?this.featuresRtree_.isEmpty()&&S(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,r){for(var n=this.loadedExtentsRtree_,i=this.strategy_(t,e,r),o=function(t,o){var s=i[t];n.forEachInExtent(s,(function(t){return ne(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new ol(Zs)),a.loader_.call(a,s,e,r,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new ol(Hs,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new ol(qs))}.bind(a)),n.insert(s,{extent:s.slice()}))},a=this,s=0,l=i.length;s<l;++s)o(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(ce(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(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),r=this.featureChangeKeys_[e];if(r){r.forEach(z),delete this.featureChangeKeys_[e];var i=t.getId();return void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new ol(Ks,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){nt(this.format_,7),this.url_=t,this.setLoader(nl(t,this.format_))},e}(Vs),sl=0,ll=1,ul=2,hl=3,cl=4;function pl(t){return Math.pow(t,3)}function fl(t){return 1-pl(1-t)}function dl(t){return 3*t*t-2*t*t*t}function gl(t){return t}var _l=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yl=function(t){function r(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return _l(r,t),r.prototype.changed=function(){this.dispatchEvent(T)},r.prototype.release=function(){},r.prototype.getKey=function(){return this.key+"/"+this.tileCoord},r.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==ul)return this.transition_=0,t;t=t.interimTile}while(t);return this},r.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==ul){t.interimTile=null;break}t.getState()==ll?e=t:t.getState()==sl?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},r.prototype.getTileCoord=function(){return this.tileCoord},r.prototype.getState=function(){return this.state},r.prototype.setState=function(t){if(this.state!==hl&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},r.prototype.load=function(){e()},r.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:pl(n/this.transition_)},r.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},r.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},r}(E),vl=yl,ml=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var xl=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.crossOrigin_=i,s.src_=n,s.key=n,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return ml(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=ul,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=hl,this.unlistenImage_(),this.image_=((t=xi(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=ul:this.state=cl,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==hl&&(this.state=sl,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==sl&&(this.state=ll,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=vs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(vl),wl=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,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 r=e-3;r>0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+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}(),Sl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cl=function(t){function r(e){var r=t.call(this)||this;return r.map_=e,r}return Sl(r,t),r.prototype.dispatchRenderEvent=function(t,r){e()},r.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Nt(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Bt(n,r)},r.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var l,u=e.viewState;function h(t,e,r,n){return i.call(o,e,t?r:null,n)}var c=u.projection,p=yr(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=Re(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,_=g.length,y=[],v=[],m=0;m<f.length;m++)for(var x=_-1;x>=0;--x){var w=g[x],S=w.layer;if(S.hasRenderer()&&Lo(w,u)&&a.call(s,S)){var C=S.getRenderer(),E=S.getSource();if(C&&E){var T=E.getWrapX()?p:t,b=h.bind(null,w.managed);v[0]=T[0]+f[m][0],v[1]=T[1]+f[m][1],l=C.forEachFeatureAtCoordinate(v,e,r,b,y)}if(l)return l}}if(0!==y.length){var R=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*R})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},r.prototype.forEachLayerAtPixel=function(t,r,n,i,o){return e()},r.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,_,this,i,o)},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(t){e()},r.prototype.scheduleExpireIconCache=function(t){ds.canExpireCache()&&t.postRenderFunctions.push(El)},r}(u);function El(t,e){ds.expire()}var Tl=Cl,bl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rl=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=N(Bi,l,e.redrawText.bind(e)),r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",r.element_.className="ol-unselectable ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return bl(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new Oa(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){z(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Vn,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),r=t.viewState;this.children_.length=0;for(var n=[],i=null,o=0,a=e.length;o<a;++o){var s=e[o];t.layerIndex=o;var l=s.layer,u=l.getSourceState();if(!Lo(s,r)||u!=Po&&u!=bo)l.unrender();else{var h=l.render(t,i);h&&(h!==i&&(this.children_.push(h),i=h),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;o>=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Xn,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&Lo(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(u,h);if(c)return c}}}},e}(Tl),Pl=Rl,Ol=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fl=function(t){function e(e,r){var n=t.call(this,e)||this;return n.layer=r,n}return Ol(e,t),e}(s),Il="layers",Ll=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(Il,r.handleLayersChanged_),o?Array.isArray(o)?o=new rt(o.slice(),{unique:!0}):nt("function"==typeof o.getArray,43):o=new rt(void 0,{unique:!0}),r.setLayers(o),r}return Ol(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(z),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(N(t,J,this.handleLayersAdd_,this),N(t,Q,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(z);x(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var o=r[n];this.registerLayerListeners_(o),this.dispatchEvent(new Fl("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[N(t,l,this.handleLayerChange_,this),N(t,T,this.handleLayerChange_,this)];t instanceof e&&r.push(N(t,"addlayer",this.handleLayerGroupAdd_,this),N(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[n(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new Fl("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new Fl("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Fl("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,r=n(e);this.listenerKeys_[r].forEach(z),delete this.listenerKeys_[r],this.dispatchEvent(new Fl("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Il)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var r=e.getArray(),n=0,i=r.length;n<i;++n)this.dispatchEvent(new Fl("removelayer",r[n]));this.set(Il,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:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),i=n.zIndex;t||void 0!==n.zIndex||(i=0);for(var o=r,a=e.length;o<a;o++){var s=e[o];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),s.minZoom=Math.max(s.minZoom,n.minZoom),s.maxZoom=Math.min(s.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==s.extent?s.extent=Ee(s.extent,n.extent):s.extent=n.extent),void 0===s.zIndex&&(s.zIndex=i)}return e},e.prototype.getSourceState=function(){return Po},e}(To),Ml=Object.freeze({__proto__:null,GroupEvent:Fl,default:Ll}),Al=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dl=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return Al(e,t),e}(s),kl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jl=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a}return kl(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),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(Dl),Gl={SINGLECLICK:"singleclick",CLICK:P,DBLCLICK:O,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Nl="pointermove",Bl="pointerdown",zl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ul=function(t){function e(e,r){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===r?1:r,n.down_=null;var i=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=N(i,Bl,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=N(i,Nl,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(j,n.boundHandleTouchMove_,!!Lt&&{passive:!1}),n}return zl(e,t),e.prototype.emulateClick_=function(t){var e=new jl(Gl.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new jl(Gl.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new jl(Gl.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Gl.POINTERUP||e.type==Gl.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Gl.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new jl(Gl.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(z),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.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new jl(Gl.POINTERDOWN,this.map_,t);for(var r in this.dispatchEvent(e),this.down_={},t){var n=t[r];this.down_[r]="function"==typeof n?v:n}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(i,Gl.POINTERMOVE,this.handlePointerMove_,this),N(i,Gl.POINTERUP,this.handlePointerUp_,this),N(this.element_,Gl.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),Gl.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new jl(Gl.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 jl(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||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_&&(z(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(j,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(z(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(z),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(E),Vl="postrender",Xl="movestart",Wl="moveend",Yl="loadstart",Kl="loadend",Zl="layergroup",Hl="size",ql="target",Jl="view",Ql=1/0,$l=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_,r=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_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){nt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Ql&&(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_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t<n>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&r[l]<r[s]?l:s;e[t]=e[u],r[t]=r[u],t=u}e[t]=i,r[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a],n[e]=n[a],e=a}r[e]=i,n[e]=o},t.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e<s;++e)(r=n(t=i[e]))==Ql?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=r,i[a++]=t);i.length=a,o.length=a,this.heapify_()},t}(),tu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),eu=function(t){function e(e,r){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_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return tu(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);r&&e[0].addEventListener(T,this.boundHandleTileChange_);return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(r===ul||r===hl||r===cl){e.removeEventListener(T,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 r,n,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==sl||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}($l);var ru={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},nu=256;function iu(t,e,r){return function(n,i,o,a,s){if(n){if(!i&&!e)return n;var l=e?0:o[0]*i,u=e?0:o[1]*i,h=s?s[0]:0,c=s?s[1]:0,p=t[0]+l/2+h,f=t[2]-l/2+h,d=t[1]+u/2+c,g=t[3]-u/2+c;p>f&&(f=p=(f+p)/2),d>g&&(g=d=(g+d)/2);var _=Le(n[0],p,f),y=Le(n[1],d,g);if(a&&r&&i){var v=30*i;_+=-v*Math.log(1+Math.max(0,p-n[0])/v)+v*Math.log(1+Math.max(0,n[0]-f)/v),y+=-v*Math.log(1+Math.max(0,d-n[1])/v)+v*Math.log(1+Math.max(0,n[1]-g)/v)}return[_,y]}}}function ou(t){return t}function au(t,e,r,n){var i=Re(e)/r[0],o=Ce(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function su(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),Le(n,r/2,2*e)}function lu(t,e,r,n,i){return function(o,a,s,l){if(void 0!==o){var u=n?au(t,n,s,i):t;return(void 0===r||r)&&l?su(o,u,e):Le(o,e,u)}}}function uu(t){return void 0!==t?0:void 0}function hu(t){return void 0!==t?t:void 0}var cu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=m({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=Ir(n.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,n.projection&&Er(),n.center&&(n.center=Br(n.center,r.projection_)),n.extent&&(n.extent=Ur(n.extent,r.projection_)),r.applyOptions_(n),r}return cu(e,t),e.prototype.applyOptions_=function(t){var e=m({},t);for(var r in ru)delete e[r];this.setProperties(e,!0);var n=function(t){var e,r,n,i=28,o=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:i,l=void 0!==t.zoomFactor?t.zoomFactor:o,u=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,f=Ir(t.projection,"EPSG:3857"),d=f.getExtent(),g=t.constrainOnlyCenter,_=t.extent;u||_||!f.isGlobal()||(g=!1,_=d);if(void 0!==t.resolutions){var y=t.resolutions;r=y[a],n=void 0!==y[s]?y[s]:y[y.length-1],e=t.constrainResolution?function(t,e,r,n){return function(i,o,a,s){if(void 0!==i){var l=t[0],u=t[t.length-1],h=r?au(l,r,a,n):l;if(s)return void 0===e||e?su(i,h,u):Le(i,u,h);var c=Math.min(h,i),f=Math.floor(p(t,c,o));return t[f]>h&&f<t.length-1?t[f+1]:t[f]}}}(y,h,!g&&_,c):lu(r,n,h,!g&&_,c)}else{var v=(d?Math.max(Re(d),Ce(d)):360*wt[Ct.DEGREES]/f.getMetersPerUnit())/nu/Math.pow(o,0),m=v/Math.pow(o,i-0);void 0!==(r=t.maxResolution)?a=0:r=v/Math.pow(l,a),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(l,s):v/Math.pow(l,s):m),s=a+Math.floor(Math.log(r/n)/Math.log(l)),n=r/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,r,n,i,o){return function(a,s,l,u){if(void 0!==a){var h=i?au(e,i,l,o):e,c=void 0!==r?r:0;if(u)return void 0===n||n?su(a,h,c):Le(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 Le(e/Math.pow(t,_),c,h)}}}(l,r,n,h,!g&&_,c):lu(r,n,h,!g&&_,c)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return iu(t.extent,t.constrainOnlyCenter,e)}var r=Ir(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,iu(n,!1,!1)}return ou}(t),o=n.constraint,a=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=i||Ge(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?hu:"number"==typeof e?(r=e,n=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):hu}return uu;var r,n;var i,o}(t);this.constraints_={center:i,resolution:o,rotation:a},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var r=this.getCenter();if(r){var n=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(n[3]-e[3]+e[1]-n[1]),a=i/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([r[0]+o,r[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();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),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=m({},n)).center=Br(n.center,this.getProjection())),n.anchor&&((n=m({},n)).anchor=Br(n.anchor,this.getProjection())),e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n<r&&!this.isDef();++n){var i=arguments[n];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(n!==r){for(var o=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];n<r;++n){var h=arguments[n],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||dl,callback:e};if(h.center&&(c.sourceCenter=a,c.targetCenter=h.center.slice(),a=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(h.zoom),s=c.targetResolution):h.resolution&&(c.sourceResolution=s,c.targetResolution=h.resolution,s=c.targetResolution),void 0!==h.rotation){c.sourceRotation=l;var p=Ne(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}du(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(rs,1),this.updateAnimations_()}else e&&fu(e,!0)},e.prototype.getAnimating=function(){return this.hints_[rs]>0},e.prototype.getInteracting=function(){return this.hints_[ns]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(rs,-this.hints_[rs]);for(var e=0,r=this.animations_.length;e<r;++e){var n=this.animations_[e];if(n[0].callback&&fu(n[0].callback,!1),!t)for(var i=0,o=n.length;i<o;++i){var a=n[i];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},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,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):i=!1;var h=s.easing(u);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=c+h*(f-c),_=p+h*(d-p);this.targetCenter_=[g,_]}if(s.sourceResolution&&s.targetResolution){var y=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var v=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(y,0,v,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var x=1===h?Ne(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(i){this.animations_[r]=null,this.setHint(rs,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var S=n[0].callback;S&&fu(S,!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 r,n,i,o=this.getCenterInternal();return void 0!==o&&(fr(r=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),i=e,(n=r)[0]+=+i[0],n[1]+=+i[1]),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],n=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(r*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?Nr(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(ru.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("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 zr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();nt(r,1);var n=this.getResolution();nt(void 0!==n,2);var i=this.getRotation();return nt(void 0!==i,3),Se(r,n,i,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(ru.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Ur(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),n=Re(t)/r[0],i=Ce(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(ru.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/e;return function(t){return Math.log(r/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),r=this.padding_;return r&&(e=[e[0]-r[1]-r[3],e[1]-r[0]-r[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),r=this.getRotation(),n=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();n=gu(n,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,r)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:r,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,r,n=this.minZoom_||0;if(this.resolutions_){var i=p(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Le(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,Le(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(nt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))nt(!Oe(t),25),r=Nn(n=Ur(t,this.getProjection()));else if(t.getType()===mt){var n;(r=Nn(n=Ur(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),xe(n))}else{r=t}this.fitInternal(r,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),r=Math.cos(e),n=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,h=0,c=i.length;h<c;h+=o){var p=i[h]*r-i[h+1]*n,f=i[h]*n+i[h+1]*r;a=Math.min(a,p),s=Math.min(s,f),l=Math.max(l,p),u=Math.max(u,f)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getViewportSizeMinusPadding_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=xe(s);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var f=p[0]*c-p[1]*h,d=p[1]*c+p[0]*h,g=this.getConstrainedCenter([f,d],l),_=r.callback?r.callback:v;void 0!==r.duration?this.animateInternal({resolution:l,center:g,duration:r.duration,easing:r.easing},_):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),fu(_,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(Br(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){this.setCenterInternal(gu(t,e,r,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,r,n){var i,o=this.padding_;if(o&&t){var a=this.getViewportSizeMinusPadding_(-r),s=gu(t,n,[a[0]/2+o[3],a[1]/2+o[0]],e,r);i=[t[0]-s[0],t[1]-s[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Nr(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 r=e&&Br(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);e&&(this.targetCenter_=this.calculateCenterZoom(i,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=Br(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?Br(t,this.getProjection()):t)},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 r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),a=this.constraints_.center(this.targetCenter_,o,i,r,this.calculateCenterShift(this.targetCenter_,o,n,i));this.get(ru.ROTATION)!==n&&this.set(ru.ROTATION,n),this.get(ru.RESOLUTION)!==o&&(this.set(ru.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),a&&this.get(ru.CENTER)&&pr(this.get(ru.CENTER),a)||this.set(ru.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,o,a));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=r||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&pr(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:n,easing:fl,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(ns,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&Br(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(ns,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(q);function fu(t,e){setTimeout((function(){t(e)}),0)}function du(t){return!(t.sourceCenter&&t.targetCenter&&!pr(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function gu(t,e,r,n,i){var o=Math.cos(-i),a=Math.sin(-i),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;return[(s+=(e[0]/2-r[0])*n)*o-(l+=(r[1]-e[1]/2)*n)*(a=-a),l*o+s*a]}var _u=pu,yu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function vu(t){t instanceof Mo?t.setMapInternal(null):t instanceof Ll&&t.getLayers().forEach(vu)}function mu(t,e){if(t instanceof Mo)t.setMapInternal(e);else if(t instanceof Ll)for(var r=t.getLayers().getArray(),n=0,i=r.length;n<i;++n)mu(r[n],e)}var xu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Ll({layers:t.layers});o[Zl]=a,o[ql]=t.target,o[Jl]=t.view instanceof _u?t.view:new _u,void 0!==t.controls&&(Array.isArray(t.controls)?r=new rt(t.controls.slice()):(nt("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new rt(t.interactions.slice()):(nt("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new rt(t.overlays.slice()):(nt("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new rt;return{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Ot,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=e.moveTolerance,r.keyboardEventTarget_=n.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=n.controls||new rt,r.interactions=n.interactions||new rt,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new eu(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Zl,r.handleLayerGroupChanged_),r.addChangeListener(Jl,r.handleViewChanged_),r.addChangeListener(Hl,r.handleSizeChanged_),r.addChangeListener(ql,r.handleTargetChanged_),r.setProperties(n.values);var i=r;return!e.view||e.view instanceof _u||e.view.then((function(t){i.setView(new _u(t))})),r.controls.addEventListener(J,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(Q,function(t){t.element.setMap(null)}.bind(r)),r.interactions.addEventListener(J,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(Q,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(J,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(Q,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return yu(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.handleLayerAdd_=function(t){mu(t.layer,this)},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,r){if(this.frameState_&&this.renderer_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance:0,o=void 0!==r.layerFilter?r.layerFilter:_,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.getAllLayers=function(){var t=[];return function e(r){r.forEach((function(r){r instanceof Ll?e(r.getLayers()):t.push(r)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||_;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:_,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,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(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(ql)},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 Nr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?jt(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(Zl)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof rt)e.setLayers(t);else{var r=e.getLayers();r.clear(),r.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e];if(n.visible){var i=n.layer.getRenderer();if(i&&!i.ready)return!0;var o=n.layer.getSource();if(o&&o.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Br(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?jt(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Hl)},e.prototype.getView=function(){return this.get(Jl)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,r,n){return function(t,e,r,n,i){if(!t||!(r in t.wantedTiles))return Ql;if(!t.wantedTiles[r][e.getKey()])return Ql;var o=t.viewState.center,a=n[0]-o[0],s=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}(this.frameState_,t,e,r,n)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new jl(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,r=e.type;if(r===Bl||r===G||r===M){var n=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===n?n.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[rs]||i[ns]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Wn)&&this.renderer_.dispatchRenderEvent(Wn,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Dl(Kl,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Dl(Yl,this,t))));for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)z(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(R,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(G,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Si(this.viewport_)}var r=this.getTargetElement();if(r){for(var n in r.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Ul(this,this.moveTolerance_),Gl)this.mapBrowserEventHandler_.addEventListener(Gl[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(R,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(G,this.boundHandleBrowserEvent_,!!Lt&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:r;this.targetChangeHandlerKeys_=[N(o,M,this.handleBrowserEvent,this),N(o,A,this.handleBrowserEvent,this),N(i,k,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,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_&&(z(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(z(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=N(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(t,T,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(z),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Fl("addlayer",t)),this.layerGroupPropertyListenerKeys_=[N(t,l,this.render,this),N(t,T,this.render,this),N(t,"addlayer",this.handleLayerAdd_,this),N(t,"removelayer",this.handleLayerRemove_,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,r=t.length;e<r;++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.handleLayerRemove_=function(t){vu(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,r=this.getSize(),i=this.getView(),o=this.frameState_,a=null;if(void 0!==r&&ai(r)&&i&&i.isDef()){var s=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=i.getState();if(a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Se(l.center,l.resolution,l.rotation,r),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:l,viewHints:s,wantedTiles:{},mapId:n(this),renderTargets:{}},l.nextCenter&&l.nextResolution){var u=isNaN(l.nextRotation)?l.rotation:l.nextRotation;a.nextExtent=Se(l.nextCenter,l.nextResolution,u,r)}}if(this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),o)(!this.previousExtent_||!Oe(this.previousExtent_)&&!ce(a.extent,this.previousExtent_))&&(this.dispatchEvent(new Dl(Xl,this,o)),this.previousExtent_=le(this.previousExtent_));this.previousExtent_&&!a.viewHints[rs]&&!a.viewHints[ns]&&!ce(a.extent,this.previousExtent_)&&(this.dispatchEvent(new Dl(Wl,this,a)),te(a.extent,this.previousExtent_))}this.dispatchEvent(new Dl(Vl,this,a)),this.renderComplete_=this.hasListener(Yl)||this.hasListener(Kl)||this.hasListener(Wn)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new Fl("removelayer",e)),this.set(Zl,t)},e.prototype.setSize=function(t){this.set(Hl,t)},e.prototype.setTarget=function(t){this.set(ql,t)},e.prototype.setView=function(t){if(!t||t instanceof _u)this.set(Jl,t);else{this.set(Jl,new _u);var e=this;t.then((function(t){e.setView(new _u(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var r=getComputedStyle(t),n=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),i=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);isNaN(n)||isNaN(i)||!ai(e=[n,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(q);var wu=xu,Su=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cu=function(t){function e(e){var r=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),r.element=n||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return Su(e,t),e.prototype.disposeInternal=function(){Si(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Si(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)z(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==v&&this.listenerKeys.push(N(t,Vl,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}(q),Eu=Object.freeze({__proto__:null,default:Cu}),Tu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bu=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===n.collapsed||n.collapsed,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=void 0!==n.collapsible,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.expandClassName?n.expandClassName:i+"-expand",s=void 0!==n.collapseLabel?n.collapseLabel:"›",l=void 0!==n.collapseClassName?n.collapseClassName:i+"-collapse";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s,r.collapseLabel_.className=l):r.collapseLabel_=s;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(r.label_=document.createElement("span"),r.label_.textContent=u,r.label_.className=a):r.label_=u;var h=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(h),r.toggleButton_.addEventListener(P,r.handleClick_.bind(r),!1);var c=i+" "+"ol-unselectable "+Ti+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),p=r.element;return p.className=c,p.appendChild(r.toggleButton_),p.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return Tu(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=!0,i=t.layerStatesArray,o=0,a=i.length;o<a;++o){var s=i[o];if(Lo(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(n=n&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(r.push(h[c]),e[h[c]]=!0);else h in e||(r.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,i=e.length;n<i;++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_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(bi),this.collapsed_?wi(this.collapseLabel_,this.label_):wi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!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"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=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}(Cu),Ru=bu,Pu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ou=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",a=void 0!==n.compassClassName?n.compassClassName:"ol-compass";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className=a,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(a));var s=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=i+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(r.label_),l.addEventListener(P,r.handleClick_.bind(r),!1);var u=i+" "+"ol-unselectable "+Ti,h=r.element;return h.className=u,h.appendChild(l),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(Ci),r}return Pu(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:fl}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains(Ci);i||0!==r?i&&0!==r&&this.element.classList.remove(Ci):this.element.classList.add(Ci)}this.label_.style.transform=n}this.rotation_=r}},e}(Cu),Fu=Ou,Iu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lu=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInClassName?n.zoomInClassName:i+"-in",s=void 0!==n.zoomOutClassName?n.zoomOutClassName:i+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",u=void 0!==n.zoomOutLabel?n.zoomOutLabel:"–",h=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(P,r.handleClick_.bind(r,o),!1);var f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(P,r.handleClick_.bind(r,-o),!1);var d=i+" "+"ol-unselectable "+Ti,g=r.element;return g.className=d,g.appendChild(p),g.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return Iu(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 r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:fl})):e.setZoom(n)}}},e}(Cu),Mu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Au="units",Du="degrees",ku="imperial",ju="nautical",Gu="metric",Nu="us",Bu=[1,2,5],zu=25.4/.28,Uu=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+Ei,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(Au,r.handleUnitsChanged_),r.setUnits(n.units||Gu),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return Mu(e,t),e.prototype.getUnits=function(){return this.get(Au)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Au,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==Du?Ct.DEGREES:Ct.METERS,o=Or(r,t.resolution,e,i),a=this.minWidth_*(this.dpi_||zu)/zu,s=a*o,l="";if(n==Du){var u=wt[Ct.DEGREES];(s*=u)<u/60?(l="″",o*=3600):s<u?(l="′",o*=60):l="°"}else n==ku?s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):n==ju?(o/=1852,l="nmi"):n==Gu?s<.001?(l="μm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3):n==Nu?s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):nt(!1,33);for(var h,c,p,f,d=3*Math.floor(Math.log(a*o)/Math.log(10));;){p=Math.floor(d/3);var g=Math.pow(10,p);if(h=Bu[(d%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=a)break;++d}f=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.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,r):"")+"</div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+i.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,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);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: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Or(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Ct.METERS),e=this.dpi_||zu;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(Cu),Vu=Uu;var Xu="active",Wu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Yu(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:fl})}}var Ku=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Wu(e,t),e.prototype.getActive=function(){return this.get(Xu)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Xu,t)},e.prototype.setMap=function(t){this.map_=t},e}(q),Zu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hu=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return Zu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Gl.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;Yu(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(Ku),qu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ju(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}var Qu=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return qu(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==Gl.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Gl.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==Gl.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Gl.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===Gl.POINTERDOWN||e===Gl.POINTERDRAG||e===Gl.POINTERUP}(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==Gl.POINTERUP?delete this.trackedPointers_[r]:(t.type==Gl.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=w(this.trackedPointers_)}},e}(Ku);function $u(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n<i&&(r=r&&e[n](t));++n);return r}}var th=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},eh=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),r=t.map.getOwnerDocument().activeElement;return e.contains(r)}(t)},rh=_,nh=function(t){var e=t.originalEvent;return 0==e.button&&!(Rt&&Pt&&e.ctrlKey)},ih=y,oh=function(t){return t.type==Gl.SINGLECLICK},ah=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},sh=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},lh=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},uh=function(t){var e=t.originalEvent;return nt(void 0!==e,56),"mouse"==e.pointerType},hh=function(t){var e=t.originalEvent;return nt(void 0!==e,56),e.isPrimary&&0===e.button},ch=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ph=function(t){function e(e){var r=t.call(this,{stopDown:y})||this,n=e||{};r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var i=n.condition?n.condition:$u(ah,hh);return r.condition_=n.onFocusOnly?$u(eh,i):i,r.noKinetic_=!1,r}return ch(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=Ju(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(n,i.getResolution()),fr(n,i.getRotation()),i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(i),a[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:fl})}return this.panning_&&(this.panning_=!1,r.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}(Qu),fh=ph,dh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:y})||this).condition_=n.condition?n.condition:th,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return dh(e,t),e.prototype.handleDragEvent=function(t){if(uh(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==uu){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;r.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!uh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!uh(t)&&(!(!nh(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Qu),_h=gh,yh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vh=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return yh(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+r,n.top=Math.min(t[1],e[1])+r,n.width=Math.abs(e[0]-t[0])+r,n.height=Math.abs(e[1]-t[1])+r},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_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Gn([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(u),mh=vh,xh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wh="boxstart",Sh="boxdrag",Ch="boxend",Eh="boxcancel",Th=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return xh(e,t),e}(s),bh=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new mh(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(r.onBoxEnd=n.onBoxEnd),r.startPixel_=null,r.condition_=n.condition?n.condition:nh,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return xh(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=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 Th(Sh,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Th(e?Ch:Eh,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 Th(wh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Qu),Rh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ph=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:sh;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return Rh(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),r=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(r),i=e.getResolutionForExtentInternal(n),o=e.getResolution()/i;(r=r.clone()).scale(o*o)}e.fitInternal(r,{duration:this.duration_,easing:fl})},e}(bh),Oh=37,Fh=38,Ih=39,Lh=40,Mh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ah=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return ah(t)&&lh(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Mh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(n==Lh||n==Oh||n==Ih||n==Fh)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,a=0,s=0;n==Lh?s=-o:n==Oh?a=-o:n==Ih?a=o:s=o;var l=[a,s];fr(l,i.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:gl,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Ku),Dh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kh=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:lh,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Dh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M||t.type==A){var r=t.originalEvent,n=r.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var i=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;Yu(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Ku),jh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gh="trackpad",Nh="wheel",Bh=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var i=n.condition?n.condition:rh;return r.condition_=n.onFocusOnly?$u(eh,i):i,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return jh(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!==G)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==G&&(e=n.deltaY,Tt&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Ot),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Gh:Nh);var o=r.getView();if(this.mode_===Gh&&!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_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-Le(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),Yu(e,r,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}(Ku),zh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uh=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=y),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return zh(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==uu){var l=a.getViewport().getBoundingClientRect(),u=Ju(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Qu),Vh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xh=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=y),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Vh(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),h=Ju(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!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}(Qu),Wh=Xh,Yh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kh="addfeatures",Zh=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.features=n,o.file=r,o.projection=i,o}return Yh(e,t),e}(s),Hh=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{handleEvent:_})||this).on,r.once,r.un,r.readAsBuffer_=!1,r.formats_=[];for(var i=n.formatConstructors?n.formatConstructors:[],o=0,a=i.length;o<a;++o){var s=i[o];"function"==typeof s&&(s=new s),r.formats_.push(s),r.readAsBuffer_=r.readAsBuffer_||s.getType()===Qs}return r.projection_=n.projection?Pr(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return Yh(e,t),e.prototype.handleResult_=function(t,e){var r,n=e.target.result,i=this.getMap(),o=this.projection_;o||(o=i.getView().getProjection());for(var a=this.formats_,s=0,l=a.length;s<l;++s){var u=a[s],h=n;this.readAsBuffer_&&u.getType()!==Qs&&(void 0===r&&(r=(new TextDecoder).decode(n)),h=r);var c=this.tryReadFeatures_(u,h,{featureProjection:o});if(c&&c.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new Zh(Kh,t,c,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[N(e,L,this.handleDrop,this),N(e,F,this.handleStop,this),N(e,I,this.handleStop,this),N(e,L,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,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(z),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var i=e.item(r),o=new FileReader;o.addEventListener(D,this.handleResult_.bind(this,i)),this.readAsBuffer_?o.readAsArrayBuffer(i):o.readAsText(i)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(Ku),qh=Hh,Jh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).condition_=n.condition?n.condition:sh,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==n.duration?n.duration:400,r}return Jh(e,t),e.prototype.handleDragEvent=function(t){if(uh(t)){var e=t.map,r=e.getSize(),n=t.pixel,i=n[0]-r[0]/2,o=r[1]/2-n[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!uh(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!uh(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(Qu),$h=Qh,tc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ec=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return tc(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<n){if(0===s)for(var l=0;l<this.stride;++l)r[l]=i[l];else{var u=this.getRadius()/Math.sqrt(s);r[0]=i[0]+u*o,r[1]=i[1]+u*a;for(l=2;l<this.stride;++l)r[l]=i[l]}return r.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return se(e[0]-r,e[1]-r,e[0]+r,e[1]+r,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 mt},e.prototype.intersectsExtent=function(t){if(Pe(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||_e(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=an(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[i++]=n[o];n.length=i,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 r=this.getCenter(),n=this.getStride();this.setCenter(Xr(r,0,r.length,n,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(Wr(r,0,r.length,n,t,e,r)),this.changed()},e}($r);ec.prototype.transform;var rc=ec,nc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ic=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout()),d(s,c.getFlatCoordinates()),l.push(s.length)}i.setFlatCoordinates(o,s),i.ends_=l}return i}return nc(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(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<ee(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),on(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=ut&&this.layout!=ht||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,a){if(a)return Zn(t,e,r[r.length-1],n,i,o);var s;if(i<t[n-1])return o?((s=t.slice(0,n))[n-1]=i,s):null;if(t[t.length-1]<i)return o?((s=t.slice(t.length-n))[n-1]=i,s):null;for(var l=0,u=r.length;l<u;++l){var h=r[l];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return Zn(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return dn(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 Qn(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_,r=this.layout,n=[],i=0,o=0,a=e.length;o<a;++o){var s=e[o],l=new Qn(t.slice(i,s),r);n.push(l),i=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];d(t,Kn(e,r,s,i,.5)),r=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=un(t,e,h,n,i,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,st,n)},e.prototype.getType=function(){return _t},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){if(Fn(t,e,r[o],n,i))return!0;e=r[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 r=ln(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}($r),oc=ic,ac=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sc=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return ac(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(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<ee(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,a=0,s=i.length;a<s;a+=o){var l=ke(t,e,i[a],i[a+1]);if(l<n){n=l;for(var u=0;u<o;++u)r[u]=i[a+u];r.length=o}}return n},e.prototype.getCoordinates=function(){return fn(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 Cn(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var a=new Cn(t.slice(i,i+r),e);n.push(a)}return n},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r){if(ie(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=sn(this.flatCoordinates,0,t,this.stride),this.changed()},e}($r),lc=sc;function uc(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=r.length;a<s;++a){var l=r[a];o=he(t,e,l[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var hc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cc=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),g=0,_=f.length;g<_;++g)f[g]+=p;d(s,c.getFlatCoordinates()),l.push(f)}r=o,e=s,n=l}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return hc(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;d(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}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,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();var i=new e(this.flatCoordinates.slice(),this.layout,r);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,r,n){return n<ee(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=rn(t,e,s,n,i),e=s[s.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=on(t,e,d,n,i,o,a,s,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var a=0,s=r.length;a<s;++a){var l=r[a];if(bn(t,e,l,n,i,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=yn(t,e,s,n),e=s[s.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?kn(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,gn(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=uc(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Pn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new lc(this.getFlatInteriorPoints().slice(),ut)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(!An(t,e,s,n,i))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=kn(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l],c=[];a=pn(t,e,h,n,i,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,st,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new Gn(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o].slice(),l=s[s.length-1];if(0!==i)for(var u=0,h=s.length;u<h;++u)s[u]-=i;var c=new Gn(e.slice(i,l),t,s);n.push(c),i=l}return n},e.prototype.getType=function(){return yt},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(In(t,e,s,n,i))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 r=function(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=ln(t,e,r[s],n,o[a]);o[a++]=u,e=u[u.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}($r),pc=cc,fc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dc="Point",gc="LineString",_c="Polygon",yc="Circle",vc="drawstart",mc="drawend",xc="drawabort",wc=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return fc(e,t),e}(s),Sc=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=y),(r=t.call(this,n)||this).on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){switch(t){case ct:case gt:return dc;case pt:case _t:return gc;case dt:case yt:return _c;case mt:return yc;default:throw new Error("Invalid type: "+t)}}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===_c?3:2,r.maxPoints_=r.mode_===yc?2:e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:_;var i,o=e.geometryFunction;if(!o){var a,s=r.mode_;if(s===yc)o=function(t,e,r){var n=e||new rc([NaN,NaN]),i=Br(t[0]),o=dr(i,Br(t[t.length-1]));return n.setCenterAndRadius(i,Math.sqrt(o)),n};else s===dc?a=Cn:s===gc?a=Qn:s===_c&&(a=Gn),o=function(t,e,r){return e?s===_c?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new Ns({source:new al({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=ao(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:ah,r.freehandCondition_,e.freehand?r.freehandCondition_=rh:r.freehandCondition_=e.freehandCondition?e.freehandCondition:sh,r.addChangeListener(Xu,r.updateState_),r}return fc(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===R&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==dc&&this.freehandCondition_(e);var r=e.type===Gl.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Gl.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Gl.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Gl.POINTERDOWN?n=!1:r&&this.getPointerCount()<2?(n=e.type===Gl.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===Gl.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Gl.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new jl(Gl.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var r=!this.finishCoordinate_;r&&this.startDrawing_(t.coordinate),!r&&this.freehand_?this.finishDrawing():this.freehand_||r&&this.mode_!==dc||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_],i=this.mode_;if(i===dc)e=!0;else if(i===yc)e=2===this.sketchCoords_.length;else if(i===gc)r=this.sketchCoords_.length>this.minPoints_;else if(i===_c){var o=this.sketchCoords_;r=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(r)for(var a=this.getMap(),s=0,l=n.length;s<l;s++){var u=n[s],h=a.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[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){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new at(new Cn(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new at);var e=t.getLinearRing(0),r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),r.changed()):(r=new Qn(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(r))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===dc?this.sketchCoords_=t.slice():this.mode_===_c?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new at(new Qn(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new at,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new wc(vc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,r,n=this.getMap(),i=this.sketchFeature_.getGeometry(),o=n.getView().getProjection();(this.mode_===dc?r=this.sketchCoords_:this.mode_===_c?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=t[0],r[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(i.getType()===dt&&this.mode_!==_c)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===gc||o===yc?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):o===_c&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,n,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),n=this.mode_;if(n===gc||n===yc){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,r),e.getType()===dt&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===_c){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===gc?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===_c&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),this.type_===gt?t.setGeometry(new lc([e])):this.type_===_t?t.setGeometry(new oc([e])):this.type_===yt&&t.setGeometry(new pc([e])),this.dispatchEvent(new wc(mc,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 wc(xc,t))},e.prototype.appendCoordinates=function(t){var e,r=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),r===gc||r===yc)e=this.sketchCoords_;else{if(r!==_c)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new at(new Cn(r)),this.updateSketchFeatures_(),this.dispatchEvent(new wc(vc,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}(Qu);var Cc=Sc,Ec=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tc="extentchanged",bc=function(t){function e(e){var r=t.call(this,Tc)||this;return r.extent=e,r}return Ec(e,t),e}(s);function Rc(){var t=ao();return function(e,r){return t[dt]}}function Pc(){var t=ao();return function(e,r){return t[ct]}}function Oc(t){return function(e){return Qt([t,e])}}function Fc(t,e){return t[0]==e[0]?function(r){return Qt([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return Qt([t,[e[0],r[1]]])}:null}var Ic=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).on,r.once,r.un,r.condition_=n.condition?n.condition:rh,r.extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,e||(e={}),r.extentOverlay_=new Ns({source:new al({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:Rc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new Ns({source:new al({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:Pc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&r.setExtent(e.extent),r}return Ec(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){var i=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);i.sort((function(t,e){return _r(r,t)-_r(r,e)}));var o=i[0],a=cr(r,o),s=e.getPixelFromCoordinateInternal(a);if(gr(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=dr(s,l),c=dr(s,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,n=this.snapToVertex_(e,r);n||(n=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Nn(t)):e.setGeometry(void 0):(e=new at(t?Nn(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 at(new Cn(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Gl.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,n=this.getExtentInternal(),i=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?r=n[3]:t[1]==n[3]&&(r=n[1]),null!==e&&null!==r?[e,r]:null};if(i&&n){var a=i[0]==n[0]||i[0]==n[2]?i[0]:null,s=i[1]==n[1]||i[1]==n[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=Oc(o(i)):null!==a?this.pointerHandler_=Fc(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=Fc(o([n[0],s]),o([n[2],s])))}else i=r.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=Oc(i);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!==ye(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 zr(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 bc(this.extent_))},e}(Qu),Lc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mc=[0,0,0,0],Ac=[],Dc="modifystart",kc="modifyend",jc=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return Lc(e,t),e}(s),Gc=function(t){function e(e){var r,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:hh,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&oh(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:rh,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new Bs,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Ns({source:new al({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Uc(),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,n.hitDetection_=null,e.features?r=e.features:e.source&&(n.source_=e.source,r=new rt(n.source_.getFeatures()),n.source_.addEventListener(Xs,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Ks,n.handleSourceRemove_.bind(n))),!r)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=r,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(J,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(Q,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Lc(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(T,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new rt;for(var r=this.featuresBeingModified_.getArray(),n=0,i=e.length;n<i;++n)for(var o=e[n],a=0,s=o.length;a<s;++a){var l=o[a].feature;l&&-1===r.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new jc(Dc,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(T,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},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 r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[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 r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Qt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert(Qt(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert(Qt(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,n],index:u,segment:c};this.rBush_.insert(Qt(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:1,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert(ue(r),n);var a=e;this.rBush_.insert(a.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,r){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new at(new Cn(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",r),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Gl.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=Gl.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Gl.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],r=[],n=[],i=0,o=this.dragSegments_.length;i<o;++i){var a=this.dragSegments_[i],s=a[0],l=s.feature;-1===r.indexOf(l)&&r.push(l);var u=s.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=s.depth,c=void 0,p=s.segment,f=a[1];e.length<u.getStride();)e.push(p[f][e.length]);switch(u.getType()){case ct:c=e,p[0]=e,p[1]=e;break;case gt:(c=u.getCoordinates())[s.index]=e,p[0]=e,p[1]=e;break;case pt:(c=u.getCoordinates())[s.index+f]=e,p[f]=e;break;case _t:case dt:(c=u.getCoordinates())[h[0]][s.index+f]=e,p[f]=e;break;case yt:(c=u.getCoordinates())[h[1]][h[0]][s.index+f]=e,p[f]=e;break;case mt:if(p[0]=e,p[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var d=gr(Br(u.getCenter()),Br(e));u.setRadius(d),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,r,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var r=this.vertexFeature_;if(r){var i=t.map.getView().getProjection(),o=[],a=r.getGeometry().getCoordinates(),s=Qt([a]),l=this.rBush_.getInExtent(s),u={};l.sort(Nc);for(var h=0,c=l.length;h<c;++h){var p=l[h],f=p.segment,d=n(p.geometry),g=p.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),p.geometry.getType()!==mt||1!==p.index)if(!pr(f[0],a)||u[d][0])if(!pr(f[1],a)||u[d][1])n(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&o.push(p);else{if((p.geometry.getType()===pt||p.geometry.getType()===_t)&&u[d][0]&&0===u[d][0].index)continue;this.dragSegments_.push([p,1]),u[d][1]=p}else this.dragSegments_.push([p,0]),u[d][0]=p;else pr(zc(e,p,i),a)&&!u[d][0]&&(this.dragSegments_.push([p,0]),u[d][0]=p)}o.length&&this.willModifyFeatures_(t,[o]);for(var _=o.length-1;_>=0;--_)this.insertVertex_(o[_],a)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if(n.getType()===mt){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=i,o.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(ue(i),o);var s=n;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Qt(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new jc(kc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var i,o,a=this,s=r||e.getCoordinateFromPixel(t),l=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===a.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,r){if((r=r||t.getGeometry()).getType()===ct&&c(a.features_.getArray(),t)){o=r;var n=r.getFlatCoordinates().slice(0,2);i=[{feature:t,geometry:r,segment:[n,n]}]}return!0}),{layerFilter:u})}if(!i){var h=zr($t(Ur(ue(s,Mc)),e.getView().getResolution()*this.pixelTolerance_,Mc));i=this.rBush_.getInExtent(h)}if(i&&i.length>0){var p=i.sort((function(t,e){return Bc(s,t,l)-Bc(s,e,l)}))[0],f=p.segment,d=zc(s,p,l),g=e.getPixelFromCoordinate(d),_=gr(t,g);if(o||_<=this.pixelTolerance_){var y={};if(y[n(f)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-s[0],this.delta_[1]=d[1]-s[1]),p.geometry.getType()===mt&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var v=e.getPixelFromCoordinate(f[0]),m=e.getPixelFromCoordinate(f[1]),x=dr(g,v),w=dr(g,m);_=Math.sqrt(Math.min(x,w)),this.snappedToVertex_=_<=this.pixelTolerance_,this.snappedToVertex_&&(d=x>w?f[1]:f[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var S={};S[n(p.geometry)]=!0;for(var C=1,E=i.length;C<E;++C){var T=i[C].segment;if(!(pr(f[0],T[0])&&pr(f[1],T[1])||pr(f[0],T[1])&&pr(f[1],T[0])))break;var b=n(i[C].geometry);b in S||(S[b]=!0,y[n(T)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case _t:case dt:(r=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case yt:(r=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case pt:(r=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var u={segment:[n[0],e],feature:i,geometry:o,depth:a,index:s};l.insert(Qt(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:s+1};l.insert(Qt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Gl.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new jc(kc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,i,o,a,s,l,u,h,c,p=this.dragSegments_,f={},d=!1;for(o=p.length-1;o>=0;--o)c=n((h=(r=p[o])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(l=(a=f[c].index)-1)<0&&(l=0),t=e=(i=(h=void 0!==s?s:u).geometry).getCoordinates(),d=!1,i.getType()){case _t:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),d=!0);break;case pt:e.length>2&&(e.splice(a,1),d=!0);break;case yt:t=t[h.depth[1]];case dt:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),d=!0,0===a&&(t.pop(),t.push(t[0]),l=t.length-1))}if(d){this.setGeometryCoordinates_(i,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var _={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert(Qt(_.segment),_)}this.updateSegmentIndices_(i,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,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||g(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(Qu);function Nc(t,e){return t.index-e.index}function Bc(t,e,r){var n=e.geometry;if(n.getType()===mt){var i=n;if(1===e.index){null;var o=dr(i.getCenter(),Br(t)),a=Math.sqrt(o)-i.getRadius();return a*a}}var s=Br(t);return Ac[0]=Br(e.segment[0]),Ac[1]=Br(e.segment[1]),_r(s,Ac)}function zc(t,e,r){var n=e.geometry;if(n.getType()===mt&&1===e.index){var i=n;return Nr(i.getClosestPoint(Br(t)))}var o=Br(t);return Ac[0]=Br(e.segment[0]),Ac[1]=Br(e.segment[1]),Nr(cr(o,Ac))}function Uc(){var t=ao();return function(e,r){return t[ct]}}var Vc=Gc,Xc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wc="select",Yc=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return Xc(e,t),e}(s),Kc={},Zc=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n,i,o=e||{};if(r.boundAddFeature_=r.addFeature_.bind(r),r.boundRemoveFeature_=r.removeFeature_.bind(r),r.condition_=o.condition?o.condition:oh,r.addCondition_=o.addCondition?o.addCondition:ih,r.removeCondition_=o.removeCondition?o.removeCondition:ih,r.toggleCondition_=o.toggleCondition?o.toggleCondition:sh,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:_,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(d((n=ao())[dt],n[pt]),d(n[vt],n[pt]),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new rt,o.layers)if("function"==typeof o.layers)i=o.layers;else{var a=o.layers;i=function(t){return c(a,t)}}else i=_;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return Xc(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(J,this.boundAddFeature_),this.features_.addEventListener(Q,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(J,this.boundAddFeature_),this.features_.removeEventListener(Q,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){var r=this.getMap().getAllLayers().find((function(t){if(t instanceof Ns&&t.getSource()&&t.getSource().hasFeature(e))return t}));r&&this.addFeatureLayerAssociation_(e,r)}},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 Kc||(Kc[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var r=this.getMap().getInteractions().getArray(),i=r.length-1;i>=0;--i){var o=r[i];if(o!==this&&o instanceof e&&o.getStyle()&&-1!==o.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(o.getStyle())}var a=n(t);t.setStyle(Kc[a]),delete Kc[a]},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),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,a=this.getFeatures(),s=[],l=[];if(i){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),p=l.indexOf(h);p>-1?l.splice(p,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||c(a.getArray(),t)?(r||n)&&c(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(this.addFeatureLayerAssociation_(t,i),l.push(t)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var f=s.length-1;f>=0;--f)a.remove(s[f]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new Yc(Wc,l,s,t)),!0},e}(Ku);var Hc=Zc,qc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Jc(t){return t.feature?t.feature:t.element?t.element:void 0}var Qc=[],$c=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=_),i.stopDown||(i.stopDown=y),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new Bs,r.GEOMETRY_SEGMENTERS_={Point:r.segmentPointGemetry_.bind(r),LineString:r.segmentLineStringGemetry_.bind(r),LinearRing:r.segmentLineStringGemetry_.bind(r),Polygon:r.segmentPolygonGemetry_.bind(r),MultiPoint:r.segmentMultiPointGemetry_.bind(r),MultiLineString:r.segmentMultiLineStringGemetry_.bind(r),MultiPolygon:r.segmentMultiPolygonGemetry_.bind(r),GeometryCollection:r.segmentGeometryCollectionGemetry_.bind(r),Circle:r.segmentCircleGemetry_.bind(r)},r}return qc(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,i=n(t),o=t.getGeometry();if(o){var a=this.GEOMETRY_SEGMENTERS_[o.getType()];if(a){this.indexedFeaturesExtents_[i]=o.getExtent([1/0,1/0,-1/0,-1/0]);var s=[];if(a(s,o),1===s.length)this.rBush_.insert(Qt(s[0]),{feature:t,segment:s[0]});else if(s.length>1){var l=s.map((function(t){return Qt(t)})),u=s.map((function(e){return{feature:t,segment:e}}));this.rBush_.load(l,u)}}}r&&(this.featureChangeListenerKeys_[i]=N(t,T,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 r=this.snapTo(e.pixel,e.coordinate,e.map);return r&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Jc(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Jc(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=n(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=w(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,i=n(t),o=this.indexedFeaturesExtents_[i];if(o){var a=this.rBush_,s=[];a.forEachInExtent(o,(function(e){t===e.feature&&s.push(e)}));for(var l=s.length-1;l>=0;--l)a.remove(s[l])}r&&(z(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(z),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(N(this.features_,J,this.handleFeatureAdd_,this),N(this.features_,Q,this.handleFeatureRemove_,this)):this.source_&&n.push(N(this.source_,Xs,this.handleFeatureAdd_,this),N(this.source_,Ks,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=Qt([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n),o=i.length;if(0===o)return null;r.getView().getProjection();var a,s=Br(e),l=1/0,u=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(a){var e=r.getPixelFromCoordinate(a);if(dr(t,e)<=u)return{vertex:a,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var c=0;c<o;++c){(p=i[c]).feature.getGeometry().getType()!==mt&&p.segment.forEach((function(t){var e=Br(t),r=dr(s,e);r<l&&(a=t,l=r)}))}if(m=h())return m}if(this.edge_){for(c=0;c<o;++c){var p,f=null;if((p=i[c]).feature.getGeometry().getType()===mt){var d=p.feature.getGeometry();null,f=Nr(hr(s,d))}else{var g=p.segment,_=g[0],y=g[1];y&&(Qc[0]=Br(_),Qc[1]=Br(y),f=cr(s,Qc))}if(f){var v=dr(s,f);v<l&&(a=f,l=v)}}var m;if(m=h())return m}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGemetry_=function(t,e){this.getMap().getView().getProjection();for(var r=Bn(e).getCoordinates()[0],n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentGeometryCollectionGemetry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.GEOMETRY_SEGMENTERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.segmentLineStringGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentMultiLineStringGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a)t.push(o.slice(a,a+2))},e.prototype.segmentMultiPointGemetry_=function(t,e){e.getCoordinates().forEach((function(e){t.push([e])}))},e.prototype.segmentMultiPolygonGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u)t.push(l.slice(u,u+2))},e.prototype.segmentPointGemetry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a)t.push(o.slice(a,a+2))},e}(Qu),tp=$c,ep=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rp="translatestart",np="translating",ip="translateend",op=function(t){function e(e,r,n,i,o){var a=t.call(this,e)||this;return a.features=r,a.coordinate=n,a.startCoordinate=i,a.mapBrowserEvent=o,a}return ep(e,t),e}(s),ap=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).on,n.once,n.un,n.lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers&&!n.features_)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return c(o,t)}}else r=_;return n.layerFilter_=r,n.filter_=i.filter&&!n.features_?i.filter:_,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.condition_=i.condition?i.condition:rh,n.lastFeature_=null,n.addChangeListener(Xu,n.handleActiveChanged_),n}return ep(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;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 rt([this.lastFeature_]);return this.dispatchEvent(new op(rp,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 rt([this.lastFeature_]);return this.dispatchEvent(new op(ip,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new rt([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(r,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new op(np,i,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 r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Qu),sp=ap;function lp(t){var e=t||{},r=new rt,n=new wl(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new _h),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new Hu({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new fh({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Uh),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new Wh({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new Ah),r.push(new kh({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Bh({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Ph({duration:e.zoomDuration})),r}var up=Object.freeze({__proto__:null,defaults:lp,DoubleClickZoom:Hu,DragAndDrop:qh,DragBox:bh,DragPan:fh,DragRotate:_h,DragRotateAndZoom:$h,DragZoom:Ph,Draw:Cc,Extent:Ic,Interaction:Ku,KeyboardPan:Ah,KeyboardZoom:kh,Modify:Vc,MouseWheelZoom:Bh,PinchRotate:Uh,PinchZoom:Wh,Pointer:Qu,Select:Hc,Snap:tp,Translate:sp}),hp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cp=function(t){function e(e){return(e=m({},e)).controls||(e.controls=function(t){var e=t||{},r=new rt;return(void 0===e.zoom||e.zoom)&&r.push(new Lu(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Fu(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new Ru(e.attributionOptions)),r}()),e.interactions||(e.interactions=lp({onFocusOnly:!0})),t.call(this,e)||this}return hp(e,t),e.prototype.createRenderer=function(){return new Pl(this)},e}(wu),pp=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.expireCache=function(t){for(;this.canExpireCache();)this.pop()},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 r=this.entries_[t];return nt(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return nt(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){nt(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function fp(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function dp(t,e,r){return t+"/"+e+"/"+r}function gp(t){return dp(t[0],t[1],t[2])}function _p(t){return t.split("/").map(Number)}function yp(t){return(t[1]<<t[0])+t[2]}var vp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vp(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=_p(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(gp(e.tileCoord)),e.release())}.bind(this))}},e}(pp),xp=mp,wp=function(){function t(t,e,r,n){this.minX=t,this.maxX=e,this.minY=r,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 Sp(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new wp(t,e,r,n)}var Cp=wp,Ep=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tp=[],bp=function(t){function e(e,r,n,i){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=n,o}return Ep(e,t),e.prototype.getContext=function(t){var e=n(t);return e in this.context_||(this.context_[e]=xi(1,1,Tp)),this.context_[e]},e.prototype.hasContext=function(t){return n(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=n(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)Tp.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(vl),Rp=bp,Pp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Op=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=n,s.key=n,s}return Pp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==sl&&(this.setState(ll),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(hl)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(ul)},e.prototype.setLoader=function(t){this.loader_=t},e}(vl),Fp=Op;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ip(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var Lp={exports:{}},Mp=Ip(Eu),Ap=Ip(Y),Dp=Ip(Ml);!function(t,e){t.exports=function(t,e,r){t="default"in t?t.default:t,r="default"in r?r.default:r;var n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},a=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)},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},l="layer-switcher-",u=function(t){function u(t){n(this,u);var e=Object.assign({},t),r=e.tipLabel?e.tipLabel:"Legend",i=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",o=document.createElement("div"),a=s(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,{element:o,target:e.target}));a.activationMode=e.activationMode||"mouseover",a.startActive=!0===e.startActive;var h=void 0!==e.label?e.label:"",c=void 0!==e.collapseLabel?e.collapseLabel:"»";a.groupSelectStyle=u.getGroupSelectStyle(e.groupSelectStyle),a.reverse=!1!==e.reverse,a.mapListeners=[],a.hiddenClassName="ol-unselectable ol-control layer-switcher",u.isTouchDevice_()&&(a.hiddenClassName+=" touch"),a.shownClassName="shown",o.className=a.hiddenClassName;var p=document.createElement("button");return p.setAttribute("title",r),p.setAttribute("aria-label",r),o.appendChild(p),a.panel=document.createElement("div"),a.panel.className="panel",o.appendChild(a.panel),u.enableTouchScroll_(a.panel),p.textContent=h,o.classList.add(l+"group-select-style-"+a.groupSelectStyle),o.classList.add(l+"activation-mode-"+a.activationMode),"click"===a.activationMode?(o.classList.add("activationModeClick"),a.startActive&&(p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),p.onclick=function(t){var e=t||window.event;a.element.classList.contains(a.shownClassName)?(a.hidePanel(),p.textContent=h,p.setAttribute("title",r),p.setAttribute("aria-label",r)):(a.showPanel(),p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),e.preventDefault()}):(p.onmouseover=function(){a.showPanel()},p.onclick=function(t){var e=t||window.event;a.showPanel(),e.preventDefault()},a.panel.onmouseout=function(t){a.panel.contains(t.relatedTarget)||a.hidePanel()}),a}return a(u,t),i(u,[{key:"setMap",value:function(t){for(var r=this,n=0;n<this.mapListeners.length;n++)e.unByKey(this.mapListeners[n]);this.mapListeners.length=0,o(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"setMap",this).call(this,t),t&&(this.startActive?this.showPanel():this.renderPanel(),"click"!==this.activationMode&&this.mapListeners.push(t.on("pointerdown",(function(){r.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("render"),u.renderPanel(this.getMap(),this.panel,{groupSelectStyle:this.groupSelectStyle,reverse:this.reverse}),this.dispatchEvent("rendercomplete")}}],[{key:"renderPanel",value:function(t,e,r){var n=new Event("render");for(e.dispatchEvent(n),(r=r||{}).groupSelectStyle=u.getGroupSelectStyle(r.groupSelectStyle),u.ensureTopVisibleBaseLayerShown(t,r.groupSelectStyle);e.firstChild;)e.removeChild(e.firstChild);u.forEachRecursive(t,(function(t,e,r){t.set("indeterminate",!1)})),"children"===r.groupSelectStyle||"none"===r.groupSelectStyle?u.setGroupVisibility(t):"group"===r.groupSelectStyle&&u.setChildVisibility(t);var i=document.createElement("ul");e.appendChild(i),u.renderLayers_(t,t,i,r,(function(n){u.renderPanel(t,e,r)}));var o=new Event("rendercomplete");e.dispatchEvent(o)}},{key:"isBaseGroup",value:function(t){if(t instanceof r){var e=t.getLayers().getArray();return e.length&&"base"===e[0].get("type")}return!1}},{key:"setGroupVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.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){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).forEach((function(t){var e=t,r=e.getVisible(),n=e.get("indeterminate");e.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),r&&!n||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown",value:function(t,e){var r=void 0;u.forEachRecursive(t,(function(t,e,n){"base"===t.get("type")&&t.getVisible()&&(r=t)})),r&&u.setVisible_(t,r,!0,e)}},{key:"getGroupsAndLayers",value:function(t,e){var r=[];return e=e||function(t,e,r){return!0},u.forEachRecursive(t,(function(t,n,i){t.get("title")&&e(t,n,i)&&r.push(t)})),r}},{key:"setVisible_",value:function(t,e,n,i){e.setVisible(n),n&&"base"===e.get("type")&&u.forEachRecursive(t,(function(t,r,n){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e instanceof r&&!e.get("combine")&&"children"===i&&e.getLayers().forEach((function(r){u.setVisible_(t,r,e.getVisible(),i)}))}},{key:"renderLayer_",value:function(t,e,n,i,o){var a=document.createElement("li"),s=e.get("title"),h=u.uuid(),c=document.createElement("label");if(e instanceof r&&!e.get("combine")){var p=u.isBaseGroup(e);if(a.classList.add("group"),p&&a.classList.add(l+"base-group"),e.get("fold")){a.classList.add(l+"fold"),a.classList.add(l+e.get("fold"));var f=document.createElement("button");f.onclick=function(t){var r=t||window.event;u.toggleFold_(e,a),r.preventDefault()},a.appendChild(f)}if(!p&&"none"!=i.groupSelectStyle){var d=document.createElement("input");d.type="checkbox",d.id=h,d.checked=e.getVisible(),d.indeterminate=e.get("indeterminate"),d.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(d),c.htmlFor=h}c.innerHTML=s,a.appendChild(c);var g=document.createElement("ul");a.appendChild(g),u.renderLayers_(t,e,g,i,o)}else{a.className="layer";var _=document.createElement("input");"base"===e.get("type")?(_.type="radio",_.name="base"):_.type="checkbox",_.id=h,_.checked=e.get("visible"),_.indeterminate=e.get("indeterminate"),_.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(_),c.htmlFor=h,c.innerHTML=s;var y=t.getView().getResolution();(y>e.getMaxResolution()||y<e.getMinResolution())&&(c.className+=" disabled"),a.appendChild(c)}return a}},{key:"renderLayers_",value:function(t,e,r,n,i){var o=e.getLayers().getArray().slice();n.reverse&&(o=o.reverse());for(var a,s=0;s<o.length;s++)(a=o[s]).get("title")&&r.appendChild(u.renderLayer_(t,a,s,n,i))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,n,i){e(t,n,i),t instanceof r&&u.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(u.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(l+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(l+t.get("fold"))}},{key:"getGroupSelectStyle",value:function(t){return["none","children","group"].indexOf(t)>=0?t:"children"}}]),u}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=u),u}(Mp,Ap,Dp)}(Lp);var kp=Lp.exports,jp=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?Pr(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===Ct.TILE_PIXELS&&(n=Pr(n)).setWorldExtent(e.extent),r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},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,r){return e()},t.prototype.readFeatures=function(t,r){return e()},t.prototype.readGeometry=function(t,r){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,r){return e()},t.prototype.writeFeatures=function(t,r){return e()},t.prototype.writeGeometry=function(t,r){return e()},t}(),Gp=jp;function Np(t,e,r){var n,i=r?Pr(r.featureProjection):null,o=r?Pr(r.dataProjection):null;if(n=i&&o&&!Lr(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var a=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return n}var Bp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zp=function(t){function r(){return t.call(this)||this}return Bp(r,t),r.prototype.getType=function(){return $s},r.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Up(t),this.getReadOptions(t,e))},r.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Up(t),this.getReadOptions(t,e))},r.prototype.readFeatureFromObject=function(t,r){return e()},r.prototype.readFeaturesFromObject=function(t,r){return e()},r.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Up(t),this.getReadOptions(t,e))},r.prototype.readGeometryFromObject=function(t,r){return e()},r.prototype.readProjection=function(t){return this.readProjectionFromObject(Up(t))},r.prototype.readProjectionFromObject=function(t){return e()},r.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},r.prototype.writeFeatureObject=function(t,r){return e()},r.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},r.prototype.writeFeaturesObject=function(t,r){return e()},r.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},r.prototype.writeGeometryObject=function(t,r){return e()},r}(Gp);function Up(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Vp=zp,Xp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Wp(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}var Yp=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return Xp(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(z),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],T,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<ee(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){le(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)pe(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return Wp(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);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 r=[],n=this.geometries_,i=!1,o=0,a=n.length;o<a;++o){var s=n[o],l=s.getSimplifiedGeometry(t);r.push(l),l!==s&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return vt},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=xe(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Wp(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_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Hr),Kp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Zp(t,e){if(!t)return null;var r;switch(t.type){case ct:r=function(t){return new Cn(t.coordinates)}(t);break;case pt:r=function(t){return new Qn(t.coordinates)}(t);break;case dt:r=function(t){return new Gn(t.coordinates)}(t);break;case gt:r=function(t){return new lc(t.coordinates)}(t);break;case _t:r=function(t){return new oc(t.coordinates)}(t);break;case yt:r=function(t){return new pc(t.coordinates)}(t);break;case vt:r=function(t,e){var r=t.geometries.map((function(t){return Zp(t,e)}));return new Yp(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Np(r,!1,e)}function Hp(t,e){var r,n=(t=Np(t,!0,e)).getType();switch(n){case ct:r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case pt:r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case dt:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case gt:r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case _t:r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case yt:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case vt:r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=m({},e);return delete r.featureProjection,Hp(t,r)}))}}(t,e);break;case mt:r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}var qp=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=Pr(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=Pr(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return Kp(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,n=Zp((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new at;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return Zp(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=Pr(r.properties.name):"EPSG"===r.type?e=Pr("EPSG:"+r.properties.code):nt(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(r.id=n),!t.hasProperties())return r;var i=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=Hp(o,e),delete i[t.getGeometryName()]),S(i)||(r.properties=i),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return Hp(t,this.adaptOptions(e))},e}(Vp),Jp="http://www.w3.org/2001/XMLSchema-instance";function Qp(t,e){return vf().createElementNS(t,e)}function $p(t,e){return tf(t,e,[]).join("")}function tf(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)tf(n,e,r)}return r}function ef(t){return"documentElement"in t}function rf(t){return(new DOMParser).parseFromString(t,"application/xml")}function nf(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&d(n[n.length-1],i)}}function of(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function af(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function sf(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function lf(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function uf(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,a=r;return void 0===a&&(a=i),Qp(void 0!==e?e:o.namespaceURI,a)}}var hf=uf();function cf(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function pf(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function ff(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(n,i,r)}}}function df(t,e,r,n,i){return n.push(t),ff(e,r,n,i),n.pop()}function gf(t,e,r,n,i,o,a){return i.push(t),function(t,e,r,n,i,o){for(var a,s,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(a=r[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==i?i[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}(e,r,n,i,o,a),i.pop()}var _f=void 0;var yf=void 0;function vf(){return void 0===yf&&"undefined"!=typeof document&&(yf=document.implementation.createDocument("","",null)),yf}var mf=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xf=function(t){function r(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===_f&&"undefined"!=typeof XMLSerializer&&(_f=new XMLSerializer),_f),e}return mf(r,t),r.prototype.getType=function(){return el},r.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=rf(t);return this.readFeatureFromDocument(r,e)}return ef(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},r.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},r.prototype.readFeatureFromNode=function(t,e){return null},r.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=rf(t);return this.readFeaturesFromDocument(r,e)}return ef(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},r.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(r,this.readFeaturesFromNode(n,e));return r},r.prototype.readFeaturesFromNode=function(t,r){return e()},r.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=rf(t);return this.readGeometryFromDocument(r,e)}return ef(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},r.prototype.readGeometryFromDocument=function(t,e){return null},r.prototype.readGeometryFromNode=function(t,e){return null},r.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=rf(t);return this.readProjectionFromDocument(e)}return ef(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},r.prototype.readProjectionFromDocument=function(t){return this.dataProjection},r.prototype.readProjectionFromNode=function(t){return this.dataProjection},r.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeFeatureNode=function(t,e){return null},r.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeFeaturesNode=function(t,e){return null},r.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeGeometryNode=function(t,e){return null},r}(Gp),wf=xf;function Sf(t){var e,r=$p(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function Cf(t){var e,r=$p(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function Ef(t){return $p(t,!1).trim()}function Tf(t,e){Rf(t,e?"1":"0")}function bf(t,e){var r=e.toPrecision();t.appendChild(vf().createTextNode(r))}function Rf(t,e){t.appendChild(vf().createTextNode(e))}var Pf,Of,Ff,If,Lf,Mf,Af,Df,kf,jf=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gf=["http://www.google.com/kml/ext/2.2"],Nf=[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"],Bf={fraction:ss,pixels:ls,insetPixels:ls},zf=pf(Nf,{ExtendedData:Dd,Region:kd,MultiGeometry:sf(bd,"geometry"),LineString:sf(Cd,"geometry"),LinearRing:sf(Ed,"geometry"),Point:sf(Rd,"geometry"),Polygon:sf(Od,"geometry"),Style:sf(Id),StyleMap:function(t,e){var r=ud.call(this,t,e);if(!r)return;var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:nt(!1,38)},address:sf(Ef),description:sf(Ef),name:sf(Ef),open:sf(Sf),phoneNumber:sf(Ef),styleUrl:sf(ad),visibility:sf(Sf)},pf(Gf,{MultiTrack:sf((function(t,e){var r=df([],_d,t,e);if(!r)return;return new oc(r)}),"geometry"),Track:sf(vd,"geometry")})),Uf=pf(Nf,{ExtendedData:Dd,Region:kd,Link:function(t,e){ff(Vf,t,e)},address:sf(Ef),description:sf(Ef),name:sf(Ef),open:sf(Sf),phoneNumber:sf(Ef),visibility:sf(Sf)}),Vf=pf(Nf,{href:sf(od)}),Xf=pf(Nf,{LatLonAltBox:function(t,e){var r=df({},Nd,t,e);if(!r)return;var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)},Lod:function(t,e){var r=df({},Bd,t,e);if(!r)return;var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}),Wf=pf(Nf,["Document","Placemark"]),Yf=pf(Nf,{Document:lf((function(t,e,r){gf({node:t},Wd,Yd,e,r,void 0,this)})),Placemark:lf(_g)}),Kf=null,Zf=null,Hf=null,qf=null,Jf=null,Qf=null;function $f(t){return 32/Math.min(t[0],t[1])}function td(t){return t}var ed=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Qf||(Kf=new Yn({color:Pf=[255,255,255,1]}),Mf="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Zf=new Ts({anchor:Of=[20,2],anchorOrigin:us,anchorXUnits:Ff=ls,anchorYUnits:If=ls,crossOrigin:"anonymous",rotation:0,scale:$f(Lf=[64,64]),size:Lf,src:Mf}),Af="NO_IMAGE",Hf=new $n({color:Pf,width:1}),Df=new $n({color:[51,51,51,1],width:2}),qf=new po({font:"bold 16px Helvetica",fill:Kf,stroke:Df,scale:.8}),Jf=new lo({fill:Kf,image:Zf,text:qf,stroke:Hf,zIndex:0}),Qf=[Jf]),r.dataProjection=Pr("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Qf,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:td,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return jf(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=df([],pf(Nf,{Document:nf(this.readDocumentOrFolder_,this),Folder:nf(this.readDocumentOrFolder_,this),Placemark:of(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=df({geometry:null},zf,t,e,this);if(r){var n=new at,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&Np(a,!1,o),n.setGeometry(a),delete r.geometry,this.extractStyles_){var s=function(t,e,r,n,i){return function(o,a){var s=i,l="",u=[];if(s){var h=o.getGeometry();if(h)if(h instanceof Yp)u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ct||e===gt})),s=u.length>0;else{var c=h.getType();s=c===ct||c===gt}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(kf||(kf=document.createElement("textarea")),kf.innerHTML=l,l=kf.value));var p=r;if(t?p=t:e&&(p=rd(e,r,n)),s){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var a=i.getScaleArray(),s=i.getAnchor();r[0]=a[0]*(o[0]-s[0]),r[1]=a[1]*(o[1]/2-s[1]),n="left"}}var l=t.getText();l?((l=l.clone()).setFont(l.getFont()||qf.getFont()),l.setScale(l.getScale()||qf.getScale()),l.setFill(l.getFill()||qf.getFill()),l.setStroke(l.getStroke()||Df)):l=qf.clone();return l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new lo({image:i,text:l})}(p[0],l);return u.length>0?(f.setGeometry(new Yp(u)),[f,new lo({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete r.Style,n.setProperties(r,!0),n}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Id.call(this,t,e);if(n){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=ud.call(this,t,e);if(n){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!c(Nf,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(Nf,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&d(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=rf(t);return this.readNameFromDocument(e)}return ef(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 r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(c(Nf,e.namespaceURI)&&"name"==e.localName)return Ef(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(c(Nf,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=rf(t);d(e,this.readNetworkLinksFromDocument(r))}else ef(t)?d(e,this.readNetworkLinksFromDocument(t)):d(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&d(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(c(Nf,r.namespaceURI)&&"NetworkLink"==r.localName){var n=df({},Uf,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!c(Nf,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=rf(t);d(e,this.readRegionFromDocument(r))}else ef(t)?d(e,this.readRegionFromDocument(t)):d(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&d(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(c(Nf,r.namespaceURI)&&"Region"==r.localName){var n=df({},Xf,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!c(Nf,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Qp(Nf[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",Gf[0]),r.setAttributeNS(n,"xmlns:xsi",Jp),r.setAttributeNS(Jp,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=Wf[r.namespaceURI],s=cf(o,a);return gf(i,Yf,hf,s,[e],a,this),r},e}(wf);function rd(t,e,r){return Array.isArray(t)?t:"string"==typeof t?rd(r[t],e,r):e}function nd(t){var e=$p(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[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 id(t){var e=$p(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),a=parseFloat(n[2]),s=n[3]?parseFloat(n[3]):0;r.push(o,a,s),e=e.substr(n[0].length)}if(""===e)return r}function od(t){var e=$p(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function ad(t){var e=$p(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function sd(t){return Cf(t)}var ld=pf(Nf,{Pair:function(t,e){var r=df({},jd,t,e,this);if(!r)return;var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}});function ud(t,e){return df(void 0,ld,t,e,this)}var hd=pf(Nf,{Icon:sf((function(t,e){var r=df({},md,t,e);return r||null})),color:sf(nd),heading:sf(Cf),hotSpot:sf((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?us:cs:"insetPixels"!==n?hs:ps,{x:parseFloat(t.getAttribute("x")),xunits:Bf[r],y:parseFloat(t.getAttribute("y")),yunits:Bf[n],origin:e}})),scale:sf(sd)});var cd=pf(Nf,{color:sf(nd),scale:sf(sd)});var pd=pf(Nf,{color:sf(nd),width:sf(Cf)});var fd=pf(Nf,{color:sf(nd),fill:sf(Sf),outline:sf(Sf)});var dd=pf(Nf,{coordinates:af(id)});function gd(t,e){return df(null,dd,t,e)}var _d=pf(Gf,{Track:of(vd)});var yd=pf(Nf,{when:function(t,e){var r=e[e.length-1].whens,n=$p(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},pf(Gf,{coord:function(t,e){var r=e[e.length-1].coordinates,n=$p(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),a=parseFloat(i[2]),s=parseFloat(i[3]);r.push([o,a,s])}else r.push([])}}));function vd(t,e){var r=df({coordinates:[],whens:[]},yd,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,a=0,s=Math.min(i.length,o.length);a<s;++a)3==i[a].length&&n.push(i[a][0],i[a][1],i[a][2],o[a]);return new Qn(n,ht)}}var md=pf(Nf,{href:sf(od)},pf(Gf,{x:sf(Cf),y:sf(Cf),w:sf(Cf),h:sf(Cf)}));var xd=pf(Nf,{coordinates:af(id)});function wd(t,e){return df(null,xd,t,e)}var Sd=pf(Nf,{extrude:sf(Sf),tessellate:sf(Sf),altitudeMode:sf(Ef)});function Cd(t,e){var r=df({},Sd,t,e),n=wd(t,e);if(n){var i=new Qn(n,lt);return i.setProperties(r,!0),i}}function Ed(t,e){var r=df({},Sd,t,e),n=wd(t,e);if(n){var i=new Gn(n,lt,[n.length]);return i.setProperties(r,!0),i}}var Td=pf(Nf,{LineString:of(Cd),LinearRing:of(Ed),MultiGeometry:of(bd),Point:of(Rd),Polygon:of(Od)});function bd(t,e){var r,n=df([],Td,t,e);if(!n)return null;if(0===n.length)return new Yp(n);for(var i=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if(o==ct){var h=n[0];l=h.getLayout(),u=h.getFlatCoordinates();for(a=1,s=n.length;a<s;++a)d(u,n[a].getFlatCoordinates());Ld(r=new lc(u,l),n)}else o==pt?Ld(r=new oc(n),n):o==dt?Ld(r=new pc(n),n):o==vt?r=new Yp(n):nt(!1,37)}else r=new Yp(n);return r}function Rd(t,e){var r=df({},Sd,t,e),n=wd(t,e);if(n){var i=new Cn(n,lt);return i.setProperties(r,!0),i}}var Pd=pf(Nf,{innerBoundaryIs:function(t,e){var r=df([],zd,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=df(void 0,Ud,t,e);if(r){e[e.length-1][0]=r}}});function Od(t,e){var r=df({},Sd,t,e),n=df([null],Pd,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a<s;++a)d(i,n[a]),o.push(i.length);var l=new Gn(i,lt,o);return l.setProperties(r,!0),l}}var Fd=pf(Nf,{IconStyle:function(t,e){var r=df({},hd,t,e);if(r){var n,i,o,a,s=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=Mf);var c,p=us,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=Of,o=Ff,a=If):/arrow-reverse/.test(n)?(i=[54,42],o=Ff,a=If):/paddle/.test(n)&&(i=[32,1],o=Ff,a=If));var d,g=l.x,_=l.y;void 0!==g&&void 0!==_&&(c=[g,_]);var y,v=l.w,m=l.h;void 0!==v&&void 0!==m&&(d=[v,m]);var x=r.heading;void 0!==x&&(y=Ge(x));var w=r.scale,S=r.color;if(u){n==Mf&&(d=Lf);var C=new Ts({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:us,rotation:y,scale:w,size:d,src:this.iconUrlFunction_(n),color:S}),E=C.getScaleArray()[0],T=C.getSize();if(null===T){var b=C.getImageState();if(b===ti||b===ei){var R=function(){var t=C.getImageState();if(t!==ti&&t!==ei){var e=C.getSize();if(e&&2==e.length){var r=$f(e);C.setScale(E*r)}C.unlistenImageChange(R)}};C.listenImageChange(R),b===ti&&C.load()}}else if(2==T.length){var P=$f(T);C.setScale(E*P)}s.imageStyle=C}else s.imageStyle=Af}},LabelStyle:function(t,e){var r=df({},cd,t,e);if(r){var n=e[e.length-1],i=new po({fill:new Yn({color:"color"in r?r.color:Pf}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=df({},pd,t,e);if(r){var n=e[e.length-1],i=new $n({color:"color"in r?r.color:Pf,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=df({},fd,t,e);if(r){var n=e[e.length-1],i=new Yn({color:"color"in r?r.color:Pf});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function Id(t,e){var r=df({},Fd,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Kf,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=Af&&(n=r.imageStyle):n=Zf;var a="textStyle"in r?r.textStyle:qf,s="strokeStyle"in r?r.strokeStyle:Hf,l=r.outline;return void 0===l||l?[new lo({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new lo({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===vt?new Yp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==dt&&e!==yt}))):r!==dt&&r!==yt?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new lo({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===vt?new Yp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt}))):r===dt||r===yt?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Ld(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];a[u]=h.get("extrude"),s[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==a[u],n=n||void 0!==s[u],i=i||l[u]}r&&t.set("extrude",a),n&&t.set("tessellate",s),i&&t.set("altitudeMode",l)}var Md=pf(Nf,{displayName:sf(Ef),value:sf(Ef)});var Ad=pf(Nf,{Data:function(t,e){var r=t.getAttribute("name");ff(Md,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){ff(Gd,t,e)}});function Dd(t,e){ff(Ad,t,e)}function kd(t,e){ff(Xf,t,e)}var jd=pf(Nf,{Style:sf(Id),key:sf(Ef),styleUrl:sf(ad)});var Gd=pf(Nf,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=Ef(t);e[e.length-1][r]=n}}});var Nd=pf(Nf,{altitudeMode:sf(Ef),minAltitude:sf(Cf),maxAltitude:sf(Cf),north:sf(Cf),south:sf(Cf),east:sf(Cf),west:sf(Cf)});var Bd=pf(Nf,{minLodPixels:sf(Cf),maxLodPixels:sf(Cf),minFadeExtent:sf(Cf),maxFadeExtent:sf(Cf)});var zd=pf(Nf,{LinearRing:of(gd)});var Ud=pf(Nf,{LinearRing:af(gd)});function Vd(t,e){for(var r=_i(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}Rf(t,n.join(""))}var Xd=pf(Nf,{Data:lf((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&gf(n,Xd,hf,[i.displayName],r,["displayName"]),null!==i&&i.value&&gf(n,Xd,hf,[i.value],r,["value"])):gf(n,Xd,hf,[i],r,["value"])})),value:lf((function(t,e){Rf(t,e)})),displayName:lf((function(t,e){!function(t,e){t.appendChild(vf().createCDATASection(e))}(t,e)}))});var Wd=pf(Nf,{Placemark:lf(_g)}),Yd=function(t,e,r){return Qp(e[e.length-1].node.namespaceURI,"Placemark")};var Kd=uf("Data");var Zd=pf(Nf,["href"],pf(Gf,["x","y","w","h"])),Hd=pf(Nf,{href:lf(Rf)},pf(Gf,{x:lf(bf),y:lf(bf),w:lf(bf),h:lf(bf)})),qd=function(t,e,r){return Qp(Gf[0],"gx:"+r)};var Jd=pf(Nf,["scale","heading","Icon","color","hotSpot"]),Qd=pf(Nf,{Icon:lf((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Zd[i.namespaceURI],a=cf(e,o);gf(n,Hd,hf,a,r,o),a=cf(e,o=Zd[Gf[0]]),gf(n,Hd,qd,a,r,o)})),color:lf(Vd),heading:lf(bf),hotSpot:lf((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:lf(bg)});var $d=pf(Nf,["color","scale"]),tg=pf(Nf,{color:lf(Vd),scale:lf(bg)});var eg=pf(Nf,["color","width"]),rg=pf(Nf,{color:lf(Vd),width:lf(bf)});var ng={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},ig=function(t,e,r){if(t)return Qp(e[e.length-1].node.namespaceURI,ng[t.getType()])},og=uf("Point"),ag=uf("LineString"),sg=uf("LinearRing"),lg=uf("Polygon"),ug=pf(Nf,{LineString:lf(mg),Point:lf(mg),Polygon:lf(Eg),GeometryCollection:lf(hg)});function hg(t,e,r){var n,i={node:t},o=e.getType(),a=[];o===vt?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===gt?a=a.concat(t.getPoints()):e===_t?a=a.concat(t.getLineStrings()):e===yt?a=a.concat(t.getPolygons()):e===ct||e===pt||e===dt?a.push(t):nt(!1,39)})),n=ig):o===gt?(a=e.getPoints(),n=og):o===_t?(a=e.getLineStrings(),n=ag):o===yt?(a=e.getPolygons(),n=lg):nt(!1,39),gf(i,ug,n,a,r)}var cg=pf(Nf,{LinearRing:lf(mg)});function pg(t,e,r){gf({node:t},cg,sg,[e],r)}var fg=pf(Nf,{ExtendedData:lf((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)gf(n,Xd,Kd,[{name:i[s],value:o[s]}],r)})),MultiGeometry:lf(hg),LineString:lf(mg),LinearRing:lf(mg),Point:lf(mg),Polygon:lf(Eg),Style:lf((function(t,e,r){var n={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(i.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(i.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=s),i.PolyStyle=e.polyStyles[0]}var l=r[r.length-1].node,u=Rg[l.namespaceURI],h=cf(i,u);gf(n,Pg,hf,h,r,u)})),address:lf(Rf),description:lf(Rf),name:lf(Rf),open:lf(Tf),phoneNumber:lf(Rf),styleUrl:lf(Rf),visibility:lf(Tf)}),dg=pf(Nf,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),gg=uf("ExtendedData");function _g(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=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(i||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var l=s(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===vt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ct||e===gt})).length:n===ct||n===gt}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===vt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===_t})).length:n===pt||n===_t}})),p=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===vt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt})).length:n===dt||n===yt}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var d=r[r.length-1].node,g=dg[d.namespaceURI],_=cf(i,g);if(gf(n,fg,hf,_,r,g),a.length>0){var y=cf(i,a);gf(n,fg,gg,[{names:a,values:y}],r)}var v=r[0],m=e.getGeometry();m&&(m=Np(m,!0,v)),gf(n,fg,ig,[m],r)}var yg=pf(Nf,["extrude","tessellate","altitudeMode","coordinates"]),vg=pf(Nf,{extrude:lf(Tf),tessellate:lf(Tf),altitudeMode:lf(Rf),coordinates:lf((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==st||o==ut?n=2:o==lt||o==ht?n=3:nt(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=a;h<s;h+=a){l+=" "+e[h];for(u=1;u<n;++u)l+=","+e[h+u]}}Rf(t,l)}))});function mg(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var a=r[r.length-1].node,s=yg[a.namespaceURI],l=cf(o,s);gf(i,vg,hf,l,r,s)}var xg=pf(Nf,["color","fill","outline"]),wg=pf(Nf,{outerBoundaryIs:lf(pg),innerBoundaryIs:lf(pg)}),Sg=uf("innerBoundaryIs"),Cg=uf("outerBoundaryIs");function Eg(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};gf(o,wg,Sg,n,r),gf(o,wg,Cg,[i],r)}var Tg=pf(Nf,{color:lf(Vd),fill:lf(Tf),outline:lf(Tf)});function bg(t,e){bf(t,Math.round(1e6*e)/1e6)}var Rg=pf(Nf,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Pg=pf(Nf,{IconStyle:lf((function(t,e,r){var n={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(l.x=h[0],l.y=s[1]-(h[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var c={x:u[0],xunits:ls,y:a[1]-u[1],yunits:ls};i.hotSpot=c}}i.Icon=l;var p=e.getScaleArray()[0],f=a;null===f&&(f=Lf),2==f.length&&(p/=$f(f)),1!==p&&(i.scale=p);var d=e.getRotation();0!==d&&(i.heading=d);var g=e.getColor();g&&(i.color=g);var _=r[r.length-1].node,y=Jd[_.namespaceURI],v=cf(i,y);gf(n,Qd,hf,v,r,y)})),LabelStyle:lf((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=r[r.length-1].node,l=$d[s.namespaceURI],u=cf(i,l);gf(n,tg,hf,u,r,l)})),LineStyle:lf((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,a=eg[o.namespaceURI],s=cf(i,a);gf(n,rg,hf,s,r,a)})),PolyStyle:lf((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),a={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},s=r[r.length-1].node,l=xg[s.namespaceURI],u=cf(a,l);gf(n,Tg,hf,u,r,l)}))});var Og=ed,Fg={
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||
read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,h=-7,c=r?i-1:0,p=r?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*g}},Ig=Mg,Lg=Fg;function Mg(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Mg.Varint=0,Mg.Fixed64=1,Mg.Bytes=2,Mg.Fixed32=5;var Ag=4294967296,Dg=1/Ag,kg="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function jg(t){return t.type===Mg.Bytes?t.readVarint()+t.pos:t.pos+1}function Gg(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ng(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Bg(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function zg(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ug(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Vg(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Xg(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Wg(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Yg(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Kg(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Zg(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Hg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function qg(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Jg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Mg.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Hg(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Jg(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Hg(this.buf,this.pos)+Hg(this.buf,this.pos+4)*Ag;return this.pos+=8,t},readSFixed64:function(){var t=Hg(this.buf,this.pos)+Jg(this.buf,this.pos+4)*Ag;return this.pos+=8,t},readFloat:function(){var t=Lg.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Lg.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return Gg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return Gg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return Gg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return Gg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return Gg(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return Gg(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&kg?function(t,e,r){return kg.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Mg.Bytes)return t.push(this.readVarint(e));var r=jg(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Mg.Bytes)return t.push(this.readSVarint());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Mg.Bytes)return t.push(this.readBoolean());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Mg.Bytes)return t.push(this.readFloat());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Mg.Bytes)return t.push(this.readDouble());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Mg.Bytes)return t.push(this.readFixed32());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Mg.Bytes)return t.push(this.readSFixed32());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Mg.Bytes)return t.push(this.readFixed64());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Mg.Bytes)return t.push(this.readSFixed64());var e=jg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Mg.Varint)for(;this.buf[this.pos++]>127;);else if(e===Mg.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Mg.Fixed32)this.pos+=4;else{if(e!==Mg.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),qg(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),qg(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),qg(this.buf,-1&t,this.pos),qg(this.buf,Math.floor(t*Dg),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),qg(this.buf,-1&t,this.pos),qg(this.buf,Math.floor(t*Dg),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ng(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Lg.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Lg.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Ng(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Mg.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Bg,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,zg,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Xg,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ug,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Vg,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Wg,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Yg,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Kg,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zg,e)},writeBytesField:function(t,e){this.writeTag(t,Mg.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Mg.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Mg.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Mg.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Mg.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Mg.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Mg.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Mg.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Mg.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Mg.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Qg=[1,0,0,1,0,0],$g=function(){function t(t,e,r,n,i){this.styleFunction,this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===ct?ue(this.flatCoordinates_):he(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=xe(this.getExtent());this.flatInteriorPoints_=Rn(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=uc(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Pn(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Kn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],a=Kn(t,e,o,2,.5);d(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Pr(t)).getExtent(),r=t.getWorldExtent();if(e&&r){var n=Ce(r)/Ce(e);Nt(Qg,r[0],r[3],n,-n,0,0,0),Vr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Qg,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();$g.prototype.getEndss=$g.prototype.getEnds,$g.prototype.getFlatCoordinates=$g.prototype.getOrientedFlatCoordinates;var t_=$g,e_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),r_=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new Ie({code:"",units:Ct.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:t_,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return e_(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,l=0,u=0,h=0;t.pos<i;){if(!a){var c=t.readVarint();o=7&c,a=c>>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),r.push(s,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):nt(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var r;1===t?r=1===e?ct:gt:2===t?r=1===e?pt:_t:3===t&&(r=dt);return r}(i,l.length);if(this.featureClass_===t_)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection);else{var h=void 0;if(u==dt){var c=function(t,e){for(var r=[],n=0,i=0,o=0,a=e.length;o<a;++o){var s=e[o];if(Mn(t,n,s,2)){if(0===r.length)continue;r[r.length-1].push(e[i])}else r.push(e.slice(i,o+1));i=o+1,n=s}return r}(s,l);h=c.length>1?new pc(s,st,c):new Gn(s,st,l)}else h=u===ct?new Cn(s,st):u===pt?new Qn(s,st):u===dt?new Gn(s,st,l):u===gt?new lc(s,st):u===_t?new oc(s,st,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var p=Np(h,!1,r);n.setGeometry(p),void 0!==o&&n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return Qs},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=Pr(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new Ig(t),a=o.readFields(n_,{}),s=[];for(var l in a)if(!r||-1!=r.indexOf(l)){var u=a[l],h=u?[0,0,u.extent,u.extent]:null;i.setExtent(h);for(var c=0,p=u.length;c<p;++c){var f=a_(o,u,c),d=this.createFeature_(o,f,n);null!==d&&s.push(d)}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Gp);function n_(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(i_,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function i_(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1===(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function o_(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function a_(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(o_,i,n),i}var s_=r_,l_=34962,u_=34963,h_=35044,c_=35048,p_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function f_(t,e){for(var r=m({preserveDrawingBuffer:!0,antialias:!bt},e),n=p_.length,i=0;i<n;++i)try{var o=t.getContext(p_[i],r);if(o)return o}catch(t){}return null}var d_=h_,g_=function(){function t(t,e){this.array=null,this.type=t,nt(t===l_||t===u_,62),this.usage=void 0!==e?e:d_}return t.prototype.ofSize=function(t){this.array=new(__(this.type))(t)},t.prototype.fromArray=function(t){var e=__(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(__(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 __(t){switch(t){case l_:return Float32Array;case u_:return Uint32Array;default:return Float32Array}}var y_=g_,v_="webglcontextlost",m_="webglcontextrestored",x_=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 r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,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(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),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.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,i,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,r,i){var o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){var s=n(o.canvas);if(!t.renderTargets[s]){var l=o.getContextAttributes();l&&l.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT)),t.renderTargets[s]=!0}}o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);var u=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,u),this.applyUniforms(t),r&&r(o,t),o.drawArrays(o.TRIANGLES,0,6),i&&i(o,t)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)}))},t}(),w_=x_;function S_(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 C_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E_="u_projectionMatrix",T_="u_offsetScaleMatrix",b_="u_offsetRotateMatrix",R_="u_time",P_="u_zoom",O_="u_resolution",F_={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},I_={};function L_(t){return"shared/"+t}var M_=0;var A_=function(t){function e(e){var r,n=t.call(this)||this,i=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvasCacheKey_=i.canvasCacheKey?L_(i.canvasCacheKey):(r="unique/"+M_,M_+=1,r),n.canvas_=function(t){var e=I_[t];if(!e){var r=document.createElement("canvas");r.style.position="absolute",r.style.left="0",e={users:0,canvas:r},I_[t]=e}return e.users+=1,e.canvas}(n.canvasCacheKey_),n.gl_=f_(n.canvas_),n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(v_,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(m_,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=[1,0,0,1,0,0],n.offsetScaleMatrix_=[1,0,0,1,0,0],n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],i.uniforms&&n.setUniforms(i.uniforms);var o=n.getGL();return n.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new w_({webGlContext:o,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new w_({webGlContext:o})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return C_(e,t),e.prototype.setUniforms=function(t){for(var e in this.uniforms_=[],t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===L_(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e},e.prototype.bindBuffer=function(t){var e=this.getGL(),r=n(t),i=this.bufferCache_[r];i||(i={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=i);e.bindBuffer(t.getType(),i.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(),r=n(t),i=this.bufferCache_[r];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(v_,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(m_,this.boundHandleWebGLContextRestored_),function(t){var e=I_[t];if(e&&(e.users-=1,!(e.users>0))){var r=f_(e.canvas).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete I_[t]}}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var r=this.getGL(),n=this.getCanvas(),i=t.size,o=t.pixelRatio;n.width=i[0]*o,n.height=i[1]*o,n.style.width=i[0]+"px",n.style.height=i[1]+"px",r.useProgram(this.currentProgram_);for(var a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].init(t);r.bindTexture(r.TEXTURE_2D,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,e?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,i[0],i[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,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL();this.getExtension("OES_element_index_uint");var n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t,e,r){for(var n=0,i=this.postProcessPasses_.length;n<i;n++)n===i-1?this.postProcessPasses_[n].apply(t,null,e,r):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=At(this.offsetScaleMatrix_);Gt(n,2/e[0],2/e[1]);var i=At(this.offsetRotateMatrix_);0!==r&&function(t,e){var r=Math.cos(e),n=Math.sin(e);Dt(t,kt(Mt,r,n,-n,r,0,0))}(i,-r),this.setUniformMatrixValue(T_,S_(this.tmpMat4_,n)),this.setUniformMatrixValue(b_,S_(this.tmpMat4_,i)),this.setUniformFloatValue(R_,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(P_,t.viewState.zoom),this.setUniformFloatValue(O_,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,S_(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.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 r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getShaderParameter(n,r.COMPILE_STATUS)){var a="Fragment shader compliation failed: ".concat(r.getShaderInfoLog(n));throw new Error(a)}if(r.deleteShader(n),!r.getShaderParameter(i,r.COMPILE_STATUS)){a="Vertex shader compilation failed: ".concat(r.getShaderInfoLog(i));throw new Error(a)}if(r.deleteShader(i),!r.getProgramParameter(o,r.LINK_STATUS)){a="GL program linking failed: ".concat(r.getShaderInfoLog(i));throw new Error(a)}return o},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 r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return At(e),Nt(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformFloatVec4=function(t,e){this.getGL().uniform4fv(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*D_(n.type)}return e}(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r),r+=i.size*D_(i.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),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),i},e}(u);function D_(t){switch(t){case F_.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case F_.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case F_.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case F_.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var k_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),j_="GENERATE_BUFFERS",G_=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.inversePixelTransform_=[1,0,0,1,0,0],n.pixelContext_=null,n.postProcesses_=i.postProcesses,n.uniforms_=i.uniforms,n.helper,e.addChangeListener(Co,n.removeHelper.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return k_(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Vn)){var n=new Oa(Vn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Xn)){var n=new Oa(Xn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var r=!0,n=-1,i=void 0,o=0,a=t.layerStatesArray.length;o<a;o++){var s=t.layerStatesArray[o].layer,l=s.getRenderer();if(l instanceof e){var u=s.getClassName();if((r||u!==i)&&(n+=1,r=!1),i=u,l===this)break}else r=!0}var h="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(h)||(this.removeHelper(),this.helper=new A_({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:h}),i&&(this.helper.getCanvas().className=i),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){Nt(this.inversePixelTransform_,0,0,r.pixelRatio,-r.pixelRatio,0,0,-r.size[1]);var i=new Oa(t,this.inversePixelTransform_,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(zn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Un,t,e)},e.prototype.getDataAtPixel=function(t,e,r){var n=jt([e.pixelRatio,0,0,e.pixelRatio,0,0],t.slice()),i=this.helper.getGL();if(!i)return null;var o=this.getLayer().getExtent();if(o&&!re(o,jt(e.pixelToCoordinateTransform,t.slice())))return null;var a=i.getContextAttributes();if(!a||!a.preserveDrawingBuffer)return new Uint8Array;var s,l=Math.round(n[0]),u=Math.round(n[1]),h=this.pixelContext_;if(!h){var c=document.createElement("canvas");c.width=1,c.height=1,h=c.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);try{h.drawImage(i.canvas,l,u,1,1,0,0,1,1),s=h.getImageData(0,0,1,1).data}catch(t){return s}return 0===s[3]?null:s},e}(Ra);var N_=G_,B_=new Uint8Array(4),z_=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.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 B_[0]=0,B_[1]=0,B_[2]=0,B_[3]=0,B_;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return B_[0]=this.data_[4*r],B_[1]=this.data_[4*r+1],B_[2]=this.data_[4*r+2],B_[3]=this.data_[4*r+3],B_},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}();var U_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),V_=function(t){function e(e,r){var i=this,o=r.uniforms||{},a=[1,0,0,1,0,0];o[E_]=a,(i=t.call(this,e,{uniforms:o,postProcesses:r.postProcesses})||this).ready=!1,i.sourceRevision_=-1,i.verticesBuffer_=new y_(l_,c_),i.hitVerticesBuffer_=new y_(l_,c_),i.indicesBuffer_=new y_(u_,c_),i.vertexShader_=r.vertexShader,i.fragmentShader_=r.fragmentShader,i.program_,i.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),i.hitVertexShader_=r.hitVertexShader,i.hitFragmentShader_=r.hitFragmentShader,i.hitProgram_;var s=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:F_.FLOAT}})):[];i.attributes=[{name:"a_position",size:2,type:F_.FLOAT},{name:"a_index",size:1,type:F_.FLOAT}].concat(s),i.hitDetectionAttributes=[{name:"a_position",size:2,type:F_.FLOAT},{name:"a_index",size:1,type:F_.FLOAT},{name:"a_hitColor",size:4,type:F_.FLOAT},{name:"a_featureUid",size:1,type:F_.FLOAT}].concat(s),i.customAttributes=r.attributes?r.attributes:[],i.previousExtent_=[1/0,1/0,-1/0,-1/0],i.currentTransform_=a,i.renderTransform_=[1,0,0,1,0,0],i.invertRenderTransform_=[1,0,0,1,0,0],i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_,i.generateBuffersRun_=0,i.worker_=function(){var t='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),i.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===j_){var r=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_=r,Bt(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):(this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var l=i.getLayer().getSource();return i.sourceListenKeys_=[N(l,Xs,i.handleSourceFeatureAdded_,i),N(l,Ws,i.handleSourceFeatureChanged_,i),N(l,Ks,i.handleSourceFeatureDelete_,i),N(l,Ys,i.handleSourceFeatureClear_,i)],l.forEachFeature(function(t){this.featureCache_[n(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(i)),i}return U_(e,t),e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new z_(this.helper))},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.helper.getGL();this.preRender(e,t);var r=this.indicesBuffer_.getSize();this.helper.drawElements(0,r),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var n=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[rs]&&!t.viewHints[ns],o=!ce(this.previousExtent_,t.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),i&&(o||a)){var s=n.projection,l=n.resolution,u=e instanceof ta?e.getRenderBuffer():0,h=$t(t.extent,u*l);r.loadFeatures(h,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),Dt(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 r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s,l,u,h,c=[],p=[],f=0,d=0;for(var g in this.featureCache_)if((n=(r=this.featureCache_[g]).geometry)&&n.getType()===ct){c[0]=n.getFlatCoordinates()[0],c[1]=n.getFlatCoordinates()[1],jt(e,c),s=d+6,l=void 0,u=void 0,h=void 0,u=256,h=255,(l=p||[])[0]=Math.floor(s/u/u/u)/h,l[1]=Math.floor(s/u/u)%u/h,l[2]=Math.floor(s/u)%u/h,l[3]=s%u/h,a=l,this.renderInstructions_[f++]=c[0],this.renderInstructions_[f++]=c[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=c[0],this.hitRenderInstructions_[d++]=c[1],this.hitRenderInstructions_[d++]=a[0],this.hitRenderInstructions_[d++]=a[1],this.hitRenderInstructions_[d++]=a[2],this.hitRenderInstructions_[d++]=a[3],this.hitRenderInstructions_[d++]=Number(g));for(var _=void 0,y=0;y<this.customAttributes.length;y++)_=this.customAttributes[y].callback(r.feature,r.properties),this.renderInstructions_[f++]=_,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=_)}var v={type:j_,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(v.projectionTransform=e,v.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(v,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:j_,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=e,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(nt(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=jt(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0,r=256,n=255;return e+=Math.round(t[0]*r*r*r*n),e+=Math.round(t[1]*r*r*n),e+=Math.round(t[2]*r*n),e+Math.round(t[3]*n)}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?n(h,this.getLayer(),null):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){z(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(N_),X_=V_,W_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Y_="blur",K_="gradient",Z_="radius",H_=["#00f","#0ff","#0f0","#ff0","#f00"];var q_,J_=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(r=t.call(this,i)||this).gradient_=null,r.addChangeListener(K_,r.handleGradientChanged_),r.setGradient(n.gradient?n.gradient:H_),r.setBlur(void 0!==n.blur?n.blur:15),r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return W_(e,t),e.prototype.getBlur=function(){return this.get(Y_)},e.prototype.getGradient=function(){return this.get(K_)},e.prototype.getRadius=function(){return this.get(Z_)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,r=256,n=xi(e,r),i=n.createLinearGradient(0,0,e,r),o=1/(t.length-1),a=0,s=t.length;a<s;++a)i.addColorStop(a*o,t[a]);return n.fillStyle=i,n.fillRect(0,0,e,r),n.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Y_,t)},e.prototype.setGradient=function(t){this.set(K_,t)},e.prototype.setRadius=function(t){this.set(Z_,t)},e.prototype.createRenderer=function(){return new X_(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Le(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(Z_)+this.get(Y_))}.bind(this),u_blurSlope:function(){return this.get(Z_)/Math.max(1,this.get(Y_))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(ta),Q_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$_=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return Q_(e,t),e}(Mo),ty={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},ey={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},ry=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ny=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return ry(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=Ee(s,Ur(e.extent,n.projection))),!a[rs]&&!a[ns]&&!Oe(s))if(o){var l=n.projection,u=o.getImage(s,i,r,l);u&&(this.loadImage(u)?this.image_=u:u.getState()===ii&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=jt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!re(i,n))return null;var o=this.image_.getExtent(),a=this.image_.getImage(),s=Re(o),l=Math.floor(a.width*((n[0]-o[0])/s));if(l<0||l>=a.width)return null;var u=Ce(o),h=Math.floor(a.height*((o[3]-n[1])/u));return h<0||h>=a.height?null:this.getImageData(a,l,h)},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,l=t.viewState,u=l.center,h=l.resolution,c=t.size,p=s*i/(h*o),f=Math.round(c[0]*s),d=Math.round(c[1]*s),g=l.rotation;if(g){var _=Math.round(Math.sqrt(f*f+d*d));f=_,d=_}Nt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,g,-f/2,-d/2),Bt(this.inversePixelTransform,this.pixelTransform);var y=zt(this.pixelTransform);this.useContainer(e,y,a.opacity,this.getBackground(t));var v=this.context,x=v.canvas;x.width!=f||x.height!=d?(x.width=f,x.height=d):this.containerReused||v.clearRect(0,0,f,d);var w=!1,S=!0;if(a.extent){var C=Ur(a.extent,l.projection);(w=(S=Pe(C,t.extent))&&!ne(C,t.extent))&&this.clipUnrotated(v,t,C)}var E=r.getImage(),T=Nt(this.tempTransform,f/2,d/2,p,p,0,o*(n[0]-u[0])/i,o*(u[1]-n[3])/i);this.renderedResolution=i*s/o;var b=E.width*T[0],R=E.height*T[3];if(this.getLayer().getSource().getInterpolate()||m(v,ty),this.preRender(v,t),S&&b>=.5&&R>=.5){var P=T[4],O=T[5],F=a.opacity,I=void 0;1!==F&&(I=v.globalAlpha,v.globalAlpha=F),v.drawImage(E,0,0,+E.width,+E.height,Math.round(P),Math.round(O),Math.round(b),Math.round(R)),1!==F&&(v.globalAlpha=I)}return this.postRender(v,t),w&&v.restore(),m(v,ey),y!==x.style.transform&&(x.style.transform=y),this.container},e}(Ma),iy=ny,oy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ay=function(t){function e(e){return t.call(this,e)||this}return oy(e,t),e.prototype.createRenderer=function(){return new iy(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}($_),sy=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=Ar(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_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Re(n)==Re(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Re(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Re(this.targetProj_.getExtent()):null;var l=Te(r),u=be(r),h=me(r),c=ve(r),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(Ae(ye(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,f,d,g,_),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,r){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,a,s,l){var u=Qt([i,o,a,s]),h=this.sourceWorldWidth_?Re(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=Re(Qt([t,e,r,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Pe(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var g=[(t[0]+r[0])/2,(t[1]+r[1])/2],_=this.transformInv_(g),y=void 0;if(p)y=(Ne(i[0],c)+Ne(a[0],c))/2-Ne(_[0],c);else y=(i[0]+a[0])/2-_[0];var v=(i[1]+a[1])/2-_[1];f=y*y+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var m=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(m),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,S,l-1),this.addQuad_(w,m,r,n,S,x,a,s,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(r[0]+n[0])/2,(r[1]+n[1])/2],b=this.transformInv_(T);this.addQuad_(t,C,T,n,i,E,b,s,l-1),this.addQuad_(C,e,r,T,E,o,a,b,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,r,n,i,a,s),0==(14&d)&&this.addTriangle_(t,r,e,i,a,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,s,i),0==(7&d)&&this.addTriangle_(e,n,r,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;fe(t,i[0]),fe(t,i[1]),fe(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();function ly(t,e,r,n,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(n,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(r,i)),t.restore()}function uy(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function hy(t,e,r,n){var i=Dr(r,e,t),o=Or(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var l=t.getExtent();if(!l||re(l,i)){var u=Or(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function cy(t,e,r,n,i,o,a,s,l,u,h,c){var p=xi(Math.round(r*t),Math.round(r*e));if(c||m(p,ty),0===l.length)return p.canvas;function f(t){return Math.round(t*r)/r}p.scale(r,r),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){pe(d,t.extent)}));var g=Re(d),_=Ce(d),y=xi(Math.round(r*g/n),Math.round(r*_/n));c||m(y,ty);var v=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=Re(t.extent),a=Ce(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*v,i*v,o*v,a*v)}));var x=Te(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],h=a[1][0],g=a[1][1],_=a[2][0],v=a[2][1],m=f((s[0][0]-x[0])/o),w=f(-(s[0][1]-x[1])/o),S=f((s[1][0]-x[0])/o),C=f(-(s[1][1]-x[1])/o),E=f((s[2][0]-x[0])/o),T=f(-(s[2][1]-x[1])/o),b=l,R=u;l=0,u=0;var P=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var a=Math.abs(t[o][r]);a>i&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r],t[r]=s;for(var l=r+1;l<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][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-=b,g-=R,0,0,S-m],[_-=b,v-=R,0,0,E-m],[0,0,h,g,C-w],[0,0,_,v,T-w]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===q_){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",ly(t,4,5,4,0),ly(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;q_=uy(e,0)||uy(e,4)||uy(e,8)}return q_}()||!c){p.moveTo(S,C);for(var O=m-S,F=w-C,I=0;I<4;I++)p.lineTo(S+f((I+1)*O/4),C+f(I*F/3)),3!=I&&p.lineTo(S+f((I+1)*O/4),C+f((I+1)*F/3));p.lineTo(E,T)}else p.moveTo(S,C),p.lineTo(m,w),p.lineTo(E,T);p.clip(),p.transform(P[0],P[2],P[1],P[3],m,w),p.translate(d[0]-b,d[3]-R),p.scale(n/r,-n/r),p.drawImage(y.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-x[0])/o,a=-(n[0][1]-x[1])/o,s=(n[1][0]-x[0])/o,l=-(n[1][1]-x[1])/o,u=(n[2][0]-x[0])/o,h=-(n[2][1]-x[1])/o;p.beginPath(),p.moveTo(s,l),p.lineTo(i,a),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var py=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fy=function(t){function e(e,r,n,i,o,a,s,l,u,h,c,p){var f=t.call(this,o,sl,{interpolate:!!p})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=s,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=r,f.targetTileGrid_=i,f.wrappedTileCoord_=a||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=i.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),_=f.sourceTileGrid_.getExtent(),y=g?Ee(d,g):d;if(0===ye(y))return f.state=cl,f;var v=e.getExtent();v&&(_=_?Ee(_,v):v);var m=i.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,r,n){var i=xe(r),o=hy(t,e,i,n);return(!isFinite(o)||o<=0)&&_e(r,(function(r){return o=hy(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,y,m);if(!isFinite(x)||x<=0)return f.state=cl,f;var w=void 0!==h?h:.5;if(f.triangulation_=new sy(e,n,y,_,x*w,m),0===f.triangulation_.getTriangles().length)return f.state=cl,f;f.sourceZ_=r.getZForResolution(x);var S=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(S[1]=Le(S[1],_[1],_[3]),S[3]=Le(S[3],_[1],_[3])):S=Ee(S,_)),ye(S)){for(var C=r.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var b=u(f.sourceZ_,E,T,s);b&&f.sourceTiles_.push(b)}0===f.sourceTiles_.length&&(f.state=cl)}else f.state=cl;return f}return py(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==ul&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=hl;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=cy(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=ul}this.changed()},e.prototype.load=function(){if(this.state==sl){this.state=ll,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==sl||i==ll){t++;var o=N(e,T,(function(r){var n=e.getState();n!=ul&&n!=hl&&n!=cl||(z(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,r){t.getState()==sl&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(z),this.sourcesListenerKeys_=null},e}(vl),dy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gy=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Cp(0,0,0,0),r}return dy(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ul||r==cl||r==hl&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,r,i,o);return s.getState()==hl&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(ul)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=jt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!re(i,n))return null;for(var o=e.pixelRatio,a=e.viewState.projection,s=e.viewState,l=r.getRenderSource(),u=l.getTileGridForProjection(s.projection),h=l.getTilePixelRatio(e.pixelRatio),c=u.getZForResolution(s.resolution);c>=u.getMinZoom();--c){var p=u.getTileCoordForCoordAndZ(n,c),f=l.getTile(c,p[1],p[2],o,a);if(!(f instanceof xl||f instanceof fy))return null;if(f.getState()===ul){var d=u.getOrigin(c),g=li(u.getTileSize(c)),_=u.getResolution(c),y=Math.floor(h*((n[0]-d[0])/_-p[1]*g[0])),v=Math.floor(h*((d[1]-n[1])/_-p[2]*g[1]));return this.getImageData(f.getImage(),y,v)}}return null},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,a=i.resolution,s=i.center,l=i.rotation,u=t.pixelRatio,c=this.getLayer(),p=c.getSource(),f=p.getRevision(),d=p.getTileGridForProjection(o),g=d.getZForResolution(a,p.zDirection),_=d.getResolution(g),y=t.extent,v=r.extent&&Ur(r.extent);v&&(y=Ee(y,Ur(r.extent)));var x=p.getTilePixelRatio(u),w=Math.round(t.size[0]*x),S=Math.round(t.size[1]*x);if(l){var C=Math.round(Math.sqrt(w*w+S*S));w=C,S=C}var E=_*w/2/x,T=_*S/2/x,b=[s[0]-E,s[1]-T,s[0]+E,s[1]+T],R=d.getTileRangeForExtentAndZ(y,g),P={};P[g]={};var O=this.createLoadedTileFinder(p,o,P),F=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var L=R.minX;L<=R.maxX;++L)for(var M=R.minY;M<=R.maxY;++M){var A=this.getTile(g,L,M,t);if(this.isDrawableTile(A)){var D=n(this);if(A.getState()==ul){P[g][A.tileCoord.toString()]=A;var k=A.inTransition(D);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0)}if(1===A.getAlpha(D,t.time))continue}var j=d.getTileCoordChildTileRange(A.tileCoord,I,F),G=!1;j&&(G=O(g+1,j)),G||d.forEachTileCoordParentTileRange(A.tileCoord,O,I,F)}var N=_/a;Nt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-w/2,-S/2);var B=zt(this.pixelTransform);this.useContainer(e,B,r.opacity,this.getBackground(t));var z=this.context,U=z.canvas;Bt(this.inversePixelTransform,this.pixelTransform),Nt(this.tempTransform,w/2,S/2,N,N,0,-w/2,-S/2),U.width!=w||U.height!=S?(U.width=w,U.height=S):this.containerReused||z.clearRect(0,0,w,S),v&&this.clipUnrotated(z,t,v),p.getInterpolate()||m(z,ty),this.preRender(z,t),this.renderedTiles.length=0;var V,X,W,Y=Object.keys(P).map(Number);Y.sort(h),1!==r.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(V=[],X=[]):Y=Y.reverse();for(var K=Y.length-1;K>=0;--K){var Z=Y[K],H=p.getTilePixelSize(Z,u,o),q=d.getResolution(Z)/_,J=H[0]*q*N,Q=H[1]*q*N,$=d.getTileCoordForCoordAndZ(Te(b),Z),tt=d.getTileCoordExtent($),et=jt(this.tempTransform,[x*(tt[0]-b[0])/_,x*(b[3]-tt[3])/_]),rt=x*p.getGutterForProjection(o),nt=P[Z];for(var it in nt){var ot=(A=nt[it]).tileCoord,at=$[1]-ot[1],st=Math.round(et[0]-(at-1)*J),lt=$[2]-ot[2],ut=Math.round(et[1]-(lt-1)*Q),ht=st-(L=Math.round(et[0]-at*J)),ct=ut-(M=Math.round(et[1]-lt*Q)),pt=g===Z,ft=!1;if(!(k=pt&&1!==A.getAlpha(n(this),t.time)))if(V){W=[L,M,L+ht,M,L+ht,M+ct,L,M+ct];for(var dt=0,gt=V.length;dt<gt;++dt)if(g!==Z&&Z<X[dt]){var _t=V[dt];Pe([L,M,L+ht,M+ct],[_t[0],_t[3],_t[4],_t[7]])&&(ft||(z.save(),ft=!0),z.beginPath(),z.moveTo(W[0],W[1]),z.lineTo(W[2],W[3]),z.lineTo(W[4],W[5]),z.lineTo(W[6],W[7]),z.moveTo(_t[6],_t[7]),z.lineTo(_t[4],_t[5]),z.lineTo(_t[2],_t[3]),z.lineTo(_t[0],_t[1]),z.clip())}V.push(W),X.push(Z)}else z.clearRect(L,M,ht,ct);this.drawTileImage(A,t,L,M,ht,ct,rt,pt),V&&!k?(ft&&z.restore(),this.renderedTiles.unshift(A)):this.renderedTiles.push(A),this.updateUsedTiles(t.usedTiles,p,A)}}this.renderedRevision=f,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!ce(this.renderedExtent_,b),this.renderedExtent_=b,this.renderedPixelRatio=u,this.renderedProjection=o,this.manageTilePyramid(t,p,d,u,o,y,g,c.getPreload()),this.scheduleExpireCache(t,p),this.postRender(z,t),r.extent&&z.restore(),m(z,ey),B!==U.style.transform&&(U.style.transform=B);var yt=Fi(r.opacity),vt=this.container;return yt!==vt.style.opacity&&(vt.style.opacity=yt),this.container},e.prototype.drawTileImage=function(t,e,r,i,o,a,s,l){var u=this.getTileImage(t);if(u){var h=n(this),c=l?t.getAlpha(h,e.time):1,p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,r,i,o,a),p&&this.context.restore(),1!==c?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var i=n(t);i in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var i=n(e);i in t||(t[i]={}),t[i][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,i,o,a,s,l,u){var h=n(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,_,y=t.wantedTiles[h],v=t.tileQueue,m=0;for(_=r.getMinZoom();_<=s;++_)for(p=r.getTileRangeForExtentAndZ(a,_,p),f=r.getResolution(_),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)s-_<=l?(++m,(c=e.getTile(_,d,g,i,o)).getState()==sl&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(_,d,g,o);e.updateCacheSize(m,o)},e}(Ma),_y=gy,yy="image",vy="hybrid",my="vector",xy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wy={image:[Ga,Aa,ja,ka,Na],hybrid:[Ga,ja],vector:[]},Sy={hybrid:[ka,Na,Da],vector:[Ga,Aa,ja,ka,Na,Da]},Cy=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return xy(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return i!==ul&&i!==hl||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,a=i.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),h=u.getSource().getTile(e,r,n,o,l),c=i.viewHints,p=!(c[rs]||c[ns]);return!p&&h.wantedResolution||(h.wantedResolution=s),this.prepareTile(h,o,l)&&(p||Date.now()-i.time<8)&&u.getRenderMode()!==my&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===my?n(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var i=this.getLayer(),o=i.getRevision(),a=i.getRenderOrder()||null,s=t.wantedResolution,l=t.getReplayState(i);if(l.dirty||l.renderedResolution!==s||l.renderedRevision!=o||l.renderedRenderOrder!=a){var u=i.getSource(),h=i.getDeclutter(),c=u.getTileGrid(),p=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,r,t),d=n(i);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],h&&(t.declutterExecutorGroups[d]=[]);for(var g=function(r,n){var o=f[r];if(o.getState()!=ul)return"continue";var g=o.tileCoord,y=c.getTileCoordExtent(g),v=Ee(p,y),m=$t(v,i.getRenderBuffer()*s,_.tmpExtent),x=ce(y,v)?null:m;l.dirty=!1;var w=new Ea(0,m,s,e),S=h?new Ea(0,v,s,e):void 0,C=Is(s,e),E=function(t){var e,r=t.getStyleFunction()||i.getStyleFunction();if(r&&(e=r(t,s)),e){var n=this.renderFeature(t,C,e,w,S);this.dirty_=this.dirty_||n,l.dirty=l.dirty||n}},T=o.getFeatures();a&&a!==l.renderedRenderOrder&&T.sort(a);for(var b=0,R=T.length;b<R;++b){var P=T[b];x&&!Pe(x,P.getGeometry().getExtent())||E.call(_,P)}var O=w.finish(),F=i.getRenderMode()!==my&&h&&1===f.length?null:v,I=new es(F,s,e,u.getOverlaps(),O,i.getRenderBuffer());if(t.executorGroups[d].push(I),S){var L=new es(null,s,e,u.getOverlaps(),S.finish(),i.getRenderBuffer());t.declutterExecutorGroups[d].push(L)}},_=this,y=0,v=f.length;y<v;++y)g(y);l.renderedRevision=o,l.renderedRenderOrder=a,l.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,o){var a=e.viewState.resolution,s=e.viewState.rotation;r=null==r?0:r;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=Qt([t]);$t(h,a*r,h);for(var c,p={},f=function(t,e,r){var a=t.getId();void 0===a&&(a=n(t));var s=p[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return p[a]=!0,o.splice(o.lastIndexOf(s),1),i(t,l,e);s.geometry=e,s.distanceSq=r}}else{if(0===r)return p[a]=!0,i(t,l,e);o.push(p[a]={feature:t,layer:l,geometry:e,distanceSq:r,callback:i})}},d=this.renderedTiles,g=function(i,o){var p=d[i];if(!Pe(u.getTileCoordExtent(p.wrappedTileCoord),h))return"continue";var g=n(l),_=[p.executorGroups[g]],y=p.declutterExecutorGroups[g];y&&_.push(y),_.some((function(n){for(var i=n===y?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=n.length;o<l;++o){var u=n[o];if(c=u.forEachFeatureAtCoordinate(t,a,s,r,f,i))return!0}}))},_=0,y=d.length;!c&&_<y;++_)g(_);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var i,o=this.getLayer(),a=n(o),s=o.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=s.getTileGridForProjection(l),p=jt(this.renderedPixelToCoordinateTransform_,t.slice()),f=c.getTileCoordForCoordAndResolution(p,h),d=0,g=this.renderedTiles.length;d<g;++d)if(f.toString()===this.renderedTiles[d].tileCoord.toString()){if((i=this.renderedTiles[d]).getState()===ul){var _=c.getTileCoordExtent(i.tileCoord);s.getWrapX()&&l.canWrapX()&&!ne(u,_)&&yr(p,l);break}i=void 0}if(!i||i.loadingSourceTiles>0)e([]);else{var y=Te(c.getTileCoordExtent(i.wrappedTileCoord)),v=[(p[0]-y[0])/h,(y[1]-p[1])/h],m=i.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=i.hitDetectionImageData[a];if(!x&&!this.animatingOrInteracting_){var w=li(c.getTileSize(c.getZForResolution(h))),S=this.renderedRotation_;x=Rs(w,[this.getRenderTransform(c.getTileCoordCenter(i.wrappedTileCoord),h,0,bs,w[0]*bs,w[1]*bs,0)],m,o.getStyleFunction(),c.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(o).renderedResolution,S),i.hitDetectionImageData[a]=x}e(Ps(v,m,x))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var i=t.viewHints,o=!(i[rs]||i[ns]),a=this.renderedTiles,s=0,l=a.length;s<l;++s){var u=a[s],h=u.declutterExecutorGroups[n(this.getLayer())];if(h)for(var c=h.length-1;c>=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,o,void 0,t.declutterTree)}e.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,a=n.rotation,s=e.size,l=Math.round(s[0]*r),u=Math.round(s[1]*r),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),f=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return Dt(Gt(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},e.prototype.renderFrame=function(e,r){var i=e.viewHints,o=!(i[rs]||i[ns]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var a=this.getLayer(),s=a.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=a.getOpacity();for(var h=Sy[s],c=e.viewState,p=c.rotation,f=a.getSource(),d=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),g=this.renderedTiles,_=[],y=[],v=g.length-1;v>=0;--v){var m=g[v],x=m.executorGroups[n(a)].filter((function(t){return t.hasExecutors(h)}));if(0!==x.length){for(var w=this.getTileRenderTransform(m,e),S=m.tileCoord[0],C=!1,E=x[0].getClipCoords(w),T=0,b=_.length;T<b;++T)if(d!==S&&S<y[T]){var R=_[T];Pe([E[0],E[3],E[4],E[7]],[R[0],R[3],R[4],R[7]])&&(C||(l.save(),C=!0),l.beginPath(),l.moveTo(E[0],E[1]),l.lineTo(E[2],E[3]),l.lineTo(E[4],E[5]),l.lineTo(E[6],E[7]),l.moveTo(R[6],R[7]),l.lineTo(R[4],R[5]),l.lineTo(R[2],R[3]),l.lineTo(R[0],R[1]),l.clip())}_.push(E),y.push(S);for(var P=0,O=x.length;P<O;++P){x[P].execute(l,1,w,p,o,h)}C&&l.restore()}}return l.globalAlpha=u,this.container},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var a=0,s=r.length;a<s;++a)o=Ms(n,t,r[a],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Ms(n,t,r,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===my)return!1;var r=t.getReplayState(e),n=e.getRevision(),i=t.wantedResolution;return r.renderedTileResolution!==i||r.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),i=t.getReplayState(r),o=r.getRevision(),a=t.executorGroups[n(r)];i.renderedTileRevision=o;var s=t.wrappedTileCoord,l=s[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=u.getTileGridForProjection(c),f=p.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*f,g=p.getResolution(l),_=t.getContext(r);h=Math.round(Math.max(h,d/h));var y=u.getTilePixelSize(l,h,c);_.canvas.width=y[0],_.canvas.height=y[1];var v=h/d;if(1!==v){var m=At(this.tmpTransform_);Gt(m,v,v),_.setTransform.apply(_,m)}var x=p.getTileCoordExtent(s,this.tmpExtent),w=d/g,S=At(this.tmpTransform_);Gt(S,w,-w),function(t,e,r){Dt(t,kt(Mt,1,0,0,1,e,r))}(S,-x[0],-x[3]);for(var C=0,E=a.length;C<E;++C){a[C].execute(_,v,S,0,!0,wy[r.getRenderMode()])}i.renderedTileResolution=t.wantedResolution},e}(_y),Ey=Cy,Ty="preload",by="useInterimTilesOnError",Ry=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Py=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,n.renderMode===yy&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||vy;return nt(o==vy||o==my,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r.getBackground,r.setBackground,r}return Ry(e,t),e.prototype.createRenderer=function(){return new Ey(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(Ty)},e.prototype.getUseInterimTilesOnError=function(){return this.get(by)},e.prototype.setPreload=function(t){this.set(Ty,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(by,t)},e}(ta),Oy="tileloadstart",Fy="tileloadend",Iy="tileloaderror",Ly=[0,0,0],My=function(){function t(t){var e,r,n,i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,nt((e=this.resolutions_,r=!0,n=function(t,e){return e-t}||h,e.every((function(t,i){if(0===i)return!0;var o=n(e[i-1],t);return!(o>0||r&&0===o)}))),17),!t.origins)for(var o=0,a=this.resolutions_.length-1;o<a;++o)if(i){if(this.resolutions_[o]/this.resolutions_[o+1]!==i){i=void 0;break}}else i=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,nt(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Te(s)),nt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,nt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:nu,nt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var r=new Cp(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var n=this.getTileRangeForExtentAndZ(s,e);r.minX=Math.max(n.minX,r.minX),r.maxX=Math.min(n.maxX,r.maxX),r.minY=Math.max(n.minY,r.minY),r.maxY=Math.min(n.maxY,r.maxY)}return r}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var a=n.minY,s=n.maxY;a<=s;++a)r([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?Sp(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(a,s,r)))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,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return Sp(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,r){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],i=t[1],o=t[2];if(e===n)return Sp(i,o,i,o,r);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-n),s=Math.floor(i*a),l=Math.floor(o*a);return e<n?Sp(s,s,l,l,r):Sp(s,Math.floor(a*(i+1))-1,l,Math.floor(a*(o+1))-1,r)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,r)},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=li(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*i,s=n[0]+(e.maxX+1)*o[0]*i;return se(a,n[1]+e.minY*o[1]*i,s,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=Ly;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Sp(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=li(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=li(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,a=r[1]-(t[2]+1)*i[1]*n;return se(o,a,o+i[0]*n,a+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),a=r/this.getResolution(o),s=this.getOrigin(o),l=li(this.getTileSize(o),this.tmpSize_),u=a*(t-s[0])/r/l[0],h=a*(s[1]-e)/r/l[1];return n?(u=Xe(u,5)-1,h=Xe(h,5)-1):(u=Ve(u,5),h=Ve(h,5)),fp(o,u,h,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),a=this.getResolution(r),s=li(this.getTileSize(r),this.tmpSize_),l=(t-o[0])/a/s[0],u=(o[1]-e)/a/s[1];return n?(l=Xe(l,5)-1,u=Xe(u,5)-1):(l=Ve(l,5),u=Ve(u,5)),fp(r,l,u,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Le(p(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}(),Ay=My;function Dy(t){var e=t.getDefaultTileGrid();return e||(e=Gy(t),t.setDefaultTileGrid(e)),e}function ky(t){var e=t||{},r=e.extent||Pr("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:jy(r,e.maxZoom,e.tileSize,e.maxResolution)};return new Ay(n)}function jy(t,e,r,n){for(var i=void 0!==e?e:42,o=Ce(t),a=Re(t),s=li(void 0!==r?r:nu),l=n>0?n:Math.max(a/s[0],o/s[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Gy(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:Xt,o=jy(t,e,r);return new Ay({extent:t,origin:we(t,i),resolutions:o,tileSize:r})}(Ny(t),e,r,n)}function Ny(t){var e=(t=Pr(t)).getExtent();if(!e){var r=180*wt[Ct.DEGREES]/t.getMetersPerUnit();e=se(-r,-r,r,r)}return e}var By=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zy=function(t){function r(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;r.on,r.once,r.un,r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return r.tileGrid&&li(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),[256,256]),r.tileCache=new xp(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition,interpolate:e.interpolate},r.zDirection=e.zDirection?e.zDirection:0,r}return By(r,t),r.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},r.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},r.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,s,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)a=dp(e,u,h),s=!1,i.containsKey(a)&&(s=(o=i.get(a)).getState()===ul)&&(s=!1!==n(o)),s||(l=!1);return l},r.prototype.getGutterForProjection=function(t){return 0},r.prototype.getKey=function(){return this.key_},r.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},r.prototype.getOpaque=function(t){return this.opaque_},r.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},r.prototype.getTile=function(t,r,n,i,o){return e()},r.prototype.getTileGrid=function(){return this.tileGrid},r.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Dy(t)},r.prototype.getTileCacheForProjection=function(t){return nt(Lr(this.getProjection(),t),68),this.tileCache},r.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},r.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=li(n.getTileSize(t),this.tmpSize);return 1==i?o:si(o,i,this.tmpSize)},r.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=Ny(r);if(re(o,i))return e;var a=Re(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},r.prototype.clear=function(){this.tileCache.clear()},r.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},r.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},r.prototype.useTile=function(t,e,r,n){},r}(Vs),Uy=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return By(e,t),e}(s),Vy=zy;function Xy(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){return a?t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],r=e.getFullTileRange(t);return nt(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function Wy(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=Ne(yp(e),t.length);return t[i](e,r,n)}}}var Yy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ky=function(t){function e(r){var n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,interpolate:r.interpolate,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(n.tileUrlFunction=r.tileUrlFunction),n.urls=null,r.urls?n.setUrls(r.urls):r.url&&n.setUrl(r.url),n.tileLoadingKeys_={},n}return Yy(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,i=n(r),o=r.getState();o==ll?(this.tileLoadingKeys_[i]=!0,e=Oy):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=o==hl?Iy:o==ul?Fy:void 0),null!=e&&this.dispatchEvent(new Uy(e,r))},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=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[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 r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=Xy(t[i],e);return Wy(n)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var n=dp(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Vy),Zy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hy=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||Ny(n),o=e.tileGrid||ky({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Jy,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.sourceTileCache=new xp(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:Fp,r.tileGrids_={},r}return Zy(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=_p(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===ul)for(var o=r.getSourceTiles(),a=0,s=o.length;a<s;++a){var l=o[a],u=l.tileCoord;if(Pe(t,i.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var f=h[c],d=f.getGeometry();Pe(t,d.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){var n=this.getTileCacheForProjection(e),i=Object.keys(r).reduce((function(t,e){var r,i,o=dp((i=(r=e).substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number))[0],i[1],i[2]);if(n.containsKey(o))for(var a=n.get(o).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,r){var n=this;if(r.getState()===sl){r.setState(ll);var i=r.wrappedTileCoord,o=this.getTileGridForProjection(e),a=o.getTileCoordExtent(i),s=i[0],l=o.getResolution(s);$t(a,-l,a);var u=this.tileGrid,h=u.getExtent();h&&Ee(a,h,a);var c=u.getZForResolution(l,1);u.forEachTileCoord(a,c,(function(i){var o=n.tileUrlFunction(i,t,e),a=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(i,o?sl:cl,o,n.format_,n.tileLoadFunction);r.sourceTiles.push(a);var s=a.getState();if(s<ul){var l=function(t){n.handleTileChange(t);var e=a.getState();if(e===ul||e===hl){var i=a.getKey();i in r.errorTileKeys?a.getState()===ul&&delete r.errorTileKeys[i]:r.loadingSourceTiles--,e===hl?r.errorTileKeys[i]=!0:a.removeEventListener(T,l),0===r.loadingSourceTiles&&r.setState(S(r.errorTileKeys)?ul:hl)}};a.addEventListener(T,l),r.loadingSourceTiles++}s===sl&&(a.extent=u.getTileCoordExtent(i),a.projection=e,a.resolution=u.getResolution(i[0]),n.sourceTileCache.set(o,a),a.load())})),r.loadingSourceTiles||r.setState(r.sourceTiles.some((function(t){return t.getState()===hl}))?hl:ul)}return r.sourceTiles},e.prototype.getTile=function(t,e,r,n,i){var o,a=dp(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(u&&h){var p=c.getTileCoordExtent(u);$t(p,-c.getResolution(t),p),Pe(h,p)||(u=null)}var f=!0;if(null!==u){var d=this.tileGrid,g=c.getResolution(t),_=d.getZForResolution(g,1),y=c.getTileCoordExtent(u);$t(y,-g,y),d.forEachTileCoord(y,_,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var v=new Rp(l,f?cl:sl,u,this.getSourceTiles.bind(this,n,i));return v.key=s,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(a,v)):this.tileCache.set(a,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var n=this.tileGrid;r=Gy(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=li(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(Ky),qy=Hy;function Jy(t,e){t.setLoader((function(r,n,i){rl(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Qy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$y=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=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:tv,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:xl,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Qy(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 r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Lr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Lr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Lr(e,t)){var r=n(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Dy(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Lr(e,t))return this.tileCache;var r=n(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new xp(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),l=s?this.tileUrlFunction(s,n,i):void 0,u=new this.tileClass(a,void 0!==l?sl:cl,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(T,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Lr(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],l=void 0,u=gp(s);a.containsKey(u)&&(l=a.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new fy(o,c,i,p,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=h,l?(d.interimTile=l,d.refreshInterimChain(),a.replace(u,d)):a.set(u,d),d}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=dp(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var l=o;o=this.createTile_(t,e,r,n,i,s),l.getState()==sl?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,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 r=Pr(t);if(r){var i=n(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(Ky);function tv(t,e){t.getImage().src=e}var ev=$y,rv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e){var r=this,n="Unexpected response status: "+e.status;return(r=t.call(this,n)||this).name="ResponseError",r.response=e,r}rv(e,t)}(Error),function(t){function e(e){var r=t.call(this,"Failed to issue request")||this;return r.name="ClientError",r.client=e,r}rv(e,t)}(Error);var nv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iv=function(t){function e(e){var r=this,n=e||{},i=m({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,r.setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return nv(e,t),e.prototype.getPreload=function(){return this.get(Ty)},e.prototype.setPreload=function(t){this.set(Ty,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(by)},e.prototype.setUseInterimTilesOnError=function(t){this.set(by,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Mo),ov=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),av=function(t){function e(e){return t.call(this,e)||this}return ov(e,t),e.prototype.createRenderer=function(){return new _y(this)},e}(iv),sv=function(){function t(t,e){this.name=t,this.data=e,this.texture_=null}return t.prototype.getTexture=function(t){if(!this.texture_){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_},t}(),lv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uv=function(t){function e(e){var r=this,n=sl;return(r=t.call(this,e.tileCoord,n,{transition:e.transition,interpolate:e.interpolate})||this).loader_=e.loader,r.data_=null,r.error_=null,r}return lv(e,t),e.prototype.getData=function(){return this.data_},e.prototype.getError=function(){return this.error_},e.prototype.load=function(){this.state=ll,this.changed();var t=this;this.loader_().then((function(e){t.data_=e,t.state=ul,t.changed()})).catch((function(e){t.error_=e,t.state=hl,t.changed()}))},e}(vl),hv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function cv(t,e,r){var n=r?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function pv(t,e,r,n,i,o){var a,s,l=t.getGL();r instanceof Float32Array?(a=l.FLOAT,t.getExtension("OES_texture_float"),s=null!==t.getExtension("OES_texture_float_linear")):(a=l.UNSIGNED_BYTE,s=!0);cv(l,e,o&&s);var u,h=r.byteLength/n[1],c=1;switch(h%8==0?c=8:h%4==0?c=4:h%2==0&&(c=2),i){case 1:u=l.LUMINANCE;break;case 2:u=l.LUMINANCE_ALPHA;break;case 3:u=l.RGB;break;case 4:u=l.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(i))}var p=l.getParameter(l.UNPACK_ALIGNMENT);l.pixelStorei(l.UNPACK_ALIGNMENT,c),l.texImage2D(l.TEXTURE_2D,0,u,n[0],n[1],0,u,a,r),l.pixelStorei(l.UNPACK_ALIGNMENT,p)}var fv=null;var dv=function(t){function e(e){var r=t.call(this)||this;r.tile,r.textures=[],r.handleTileChange_=r.handleTileChange_.bind(r),r.size=li(e.grid.getTileSize(e.tile.tileCoord[0])),r.tilePixelRatio_=e.tilePixelRatio||1,r.gutter_=e.gutter||0,r.bandCount=NaN,r.helper_=e.helper;var n=new y_(l_,h_);return n.fromArray([0,1,1,1,1,0,0,0]),r.helper_.flushBufferData(n),r.coords=n,r.setTile(e.tile),r}return hv(e,t),e.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(T,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===ul,this.loaded)this.uploadTile_();else{if(t instanceof xl){var e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(T,this.handleTileChange_)}},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof xl||r instanceof fy){var n=r.getImage();if(0!==this.gutter_){var i=this.tilePixelRatio_*this.gutter_,o=Math.round(n.width-2*i),a=Math.round(n.height-2*i),s=xi(o,a);r.interpolate||m(s,ty),s.drawImage(n,i,i,o,a,0,0,o,a),n=s.canvas}var l=e.createTexture();return this.textures.push(l),this.bandCount=4,void function(t,e,r,n){cv(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,l,n,r.interpolate)}var u=[this.size[0]*this.tilePixelRatio_,this.size[1]*this.tilePixelRatio_],h=r.getData(),c=h instanceof Float32Array,p=u[0]*u[1],f=c?Float32Array:Uint8Array,d=f.BYTES_PER_ELEMENT,g=h.byteLength/u[1];this.bandCount=Math.floor(g/d/u[0]);var _=Math.ceil(this.bandCount/4);if(1===_){l=e.createTexture();return this.textures.push(l),void pv(t,l,h,u,this.bandCount,r.interpolate)}for(var y=new Array(_),v=0;v<_;++v){l=e.createTexture();this.textures.push(l);var x=v<_-1?4:this.bandCount%4;y[v]=new f(p*x)}for(var w=0,S=0,C=u[0]*this.bandCount,E=0;E<u[1];++E){for(var T=0;T<C;++T){var b=h[S+T],R=Math.floor(w/this.bandCount),P=T%this.bandCount;(O=y[v=Math.floor(P/4)])[R*(x=O.length/p)+P%4]=b,++w}S+=g/d}for(v=0;v<_;++v){var O;pv(t,l=this.textures[v],O=y[v],u,x=O.length/p,r.interpolate)}},e.prototype.handleTileChange_=function(){this.tile.getState()===ul&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(T))},e.prototype.disposeInternal=function(){var t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(var e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(T,this.handleTileChange_)},e.prototype.getPixelData=function(t,e){if(!this.loaded)return null;if(t=Math.floor(this.tilePixelRatio_*t),e=Math.floor(this.tilePixelRatio_*e),this.tile instanceof uv){var r=this.tile.getData(),n=Math.floor(this.tilePixelRatio_*this.size[0]);if(r instanceof DataView){var i=r.byteLength/(this.size[0]*this.size[1]),o=e*n*i+t*i,a=r.buffer.slice(o,o+i);return new DataView(a)}var s=e*n*this.bandCount+t*this.bandCount;return r.slice(s,s+this.bandCount)}var l,u;fv||((l=document.createElement("canvas")).width=1,l.height=1,fv=l.getContext("2d")),fv.clearRect(0,0,1,1);var h=this.tile.getImage();try{fv.drawImage(h,t,e,1,1,0,0,1,1),u=fv.getImageData(0,0,1,1).data}catch(t){return null}return u},e}(E),gv=dv,_v=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yv="u_tileTextures",vv="u_tileTransform",mv="u_transitionAlpha",xv="u_depth",wv="u_texturePixelWidth",Sv="u_texturePixelHeight",Cv="u_textureResolution",Ev="u_textureOriginX",Tv="u_textureOriginY",bv="u_renderExtent",Rv="u_resolution",Pv="u_zoom",Ov=[{name:"a_textureCoord",size:2,type:F_.FLOAT}],Fv={};function Iv(t){return 2*(1-1/(t+1))-1}function Lv(t,e,r){r in t||(t[r]=[]),t[r].push(e)}function Mv(t,e){var r=t.layerStatesArray[t.layerIndex];r.extent&&(e=Ee(e,Ur(r.extent,t.viewState.projection)));var n=r.layer.getRenderSource();if(!n.getWrapX()){var i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=Ee(e,i))}return e}function Av(t,e){return"".concat(t.getKey(),",").concat(gp(e))}!function(t){function e(e,r){var n=t.call(this,e,{uniforms:r.uniforms})||this;n.renderComplete=!1,n.tileTransform_=[1,0,0,1,0,0],n.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.tempTileRange_=new Cp(0,0,0,0),n.tempTileCoord_=fp(0,0,0),n.tempSize_=[0,0],n.program_,n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.indices_=new y_(u_,h_),n.indices_.fromArray([0,1,3,1,2,3]);var i=void 0!==r.cacheSize?r.cacheSize:512;return n.tileTextureCache_=new pp(i),n.paletteTextures_=r.paletteTextures||[],n.frameState_=null,n}_v(e,t),e.prototype.reset=function(e){t.prototype.reset.call(this,{uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))},e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)},e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ul||r==cl||r==hl&&!n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer().getRenderSource();return!!e&&(!Oe(Mv(t,t.extent))&&e.getState()===Po)},e.prototype.enqueueTiles=function(t,e,r,i){var o=t.viewState,a=this.getLayer(),s=a.getRenderSource(),l=s.getTileGridForProjection(o.projection),u=s.getTilePixelRatio(t.pixelRatio),h=s.getGutterForProjection(o.projection),c=n(s);c in t.wantedTiles||(t.wantedTiles[c]={});for(var p=t.wantedTiles[c],f=this.tileTextureCache_,d=Math.max(r-a.getPreload(),l.getMinZoom(),a.getMinZoom()),g=r;g>=d;--g)for(var _=l.getTileRangeForExtentAndZ(e,g,this.tempTileRange_),y=l.getResolution(g),v=_.minX;v<=_.maxX;++v)for(var m=_.minY;m<=_.maxY;++m){var x=fp(g,v,m,this.tempTileCoord_),w=Av(s,x),S=void 0,C=void 0;if(f.containsKey(w)&&(C=(S=f.get(w)).tile),!S||S.tile.key!==s.getKey())if(C=s.getTile(g,v,m,t.pixelRatio,o.projection),S)if(this.isDrawableTile_(C))S.setTile(C);else{var E=C.getInterimTile();S.setTile(E)}else S=new gv({tile:C,grid:l,helper:this.helper,tilePixelRatio:u,gutter:h}),f.set(w,S);Lv(i,S,g);var T=C.getKey();p[T]=!0,C.getState()===sl&&(t.tileQueue.isKeyQueued(T)||t.tileQueue.enqueue([C,c,l.getTileCoordCenter(x),y]))}},e.prototype.renderFrame=function(t){this.frameState_=t,this.renderComplete=!0;var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,i=this.getLayer().getRenderSource(),o=i.getTileGridForProjection(r.projection),a=Mv(t,t.extent),s=o.getZForResolution(r.resolution,i.zDirection),l={};if(t.nextExtent){var u=o.getZForResolution(r.nextResolution,i.zDirection),c=Mv(t,t.nextExtent);this.enqueueTiles(t,c,u,l)}this.enqueueTiles(t,a,s,l);for(var p={},f=n(this),d=t.time,g=!1,_=l[s],y=0,v=_.length;y<v;++y){var m=(k=(H=_[y]).tile).tileCoord;if(H.loaded){if(1===(j=k.getAlpha(f,d))){k.endTransition(f);continue}g=!0,p[G=gp(m)]=j}if(this.renderComplete=!1,!this.findAltTiles_(o,m,s+1,l))for(var x=o.getMinZoom(),w=s-1;w>=x;--w){if(this.findAltTiles_(o,m,w,l))break}}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!g);for(var S=Object.keys(l).map(Number).sort(h),C=r.center[0],E=r.center[1],T=0,b=S.length;T<b;++T){var R=S[T],P=o.getResolution(R),O=li(o.getTileSize(R),this.tempSize_),F=o.getOrigin(R),I=(C-F[0])/(O[0]*P),L=(F[1]-E)/(O[1]*P),M=r.resolution/P,A=Iv(R),D=l[R];for(y=0,v=D.length;y<v;++y){if((H=D[y]).loaded){var k,j,G=gp(m=(k=H.tile).tileCoord),N=m[1],B=m[2];Nt(this.tileTransform_,0,0,2/(t.size[0]*M/O[0]),-2/(t.size[1]*M/O[1]),r.rotation,-(I-N),-(L-B)),this.helper.setUniformMatrixValue(vv,S_(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(H.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(Ov);for(var z=0;z<H.textures.length;){var U="TEXTURE"+z,V="".concat(yv,"[").concat(z,"]");e.activeTexture(e[U]),e.bindTexture(e.TEXTURE_2D,H.textures[z]),e.uniform1i(this.helper.getUniformLocation(V),z),++z}for(var X=0;X<this.paletteTextures_.length;++X){var W=this.paletteTextures_[X];e.activeTexture(e["TEXTURE"+z]);var Y=W.getTexture(e);e.bindTexture(e.TEXTURE_2D,Y),e.uniform1i(this.helper.getUniformLocation(W.name),z),++z}(j=G in p?p[G]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(mv,j),this.helper.setUniformFloatValue(xv,A),this.helper.setUniformFloatValue(wv,O[0]),this.helper.setUniformFloatValue(Sv,O[1]),this.helper.setUniformFloatValue(Cv,P),this.helper.setUniformFloatValue(Ev,F[0]+N*O[0]*P),this.helper.setUniformFloatValue(Tv,F[1]-B*O[1]*P),this.helper.setUniformFloatVec4(bv,a),this.helper.setUniformFloatValue(Rv,r.resolution),this.helper.setUniformFloatValue(Pv,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var K=this.helper.getCanvas(),Z=this.tileTextureCache_;Z.canExpireCache();){var H;(H=Z.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){i.expireCache(e.viewState.projection,Fv)})),this.postRender(e,t),K},e.prototype.getData=function(t){if(!this.helper.getGL())return null;var e=this.frameState_;if(!e)return null;var r=this.getLayer(),n=jt(e.pixelToCoordinateTransform,t.slice()),i=e.viewState,o=r.getExtent();if(o&&!re(Ur(o,i.projection),n))return null;var a=r.getRenderSource(),s=a.getTileGridForProjection(i.projection);if(!a.getWrapX()){var l=s.getExtent();if(l&&!re(l,n))return null}for(var u=this.tileTextureCache_,h=s.getZForResolution(i.resolution);h>=s.getMinZoom();--h){var c=s.getTileCoordForCoordAndZ(n,h),p=Av(a,c);if(u.containsKey(p)){var f=u.get(p);if(f.loaded){var d=s.getOrigin(h),g=li(s.getTileSize(h)),_=s.getResolution(h),y=(n[0]-d[0])/_-c[1]*g[0],v=(d[1]-n[1])/_-c[2]*g[1];return f.getPixelData(y,v)}}}return null},e.prototype.findAltTiles_=function(t,e,r,n){var i=t.getTileRangeForTileCoordAndZ(e,r,this.tempTileRange_);if(!i)return!1;for(var o=!0,a=this.tileTextureCache_,s=this.getLayer().getRenderSource(),l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u){var h=Av(s,[r,l,u]),c=!1;if(a.containsKey(h)){var p=a.get(h);p.loaded&&(Lv(n,p,r),c=!0)}c||(o=!1)}return o},e.prototype.removeHelper=function(){if(this.helper){var e=this.tileTextureCache_;e.forEach((function(t){return t.dispose()})),e.clear()}t.prototype.removeHelper.call(this)},e.prototype.disposeInternal=function(){var e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_));t.prototype.disposeInternal.call(this),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_}}(N_);var Dv=1,kv=2,jv=4,Gv=8,Nv=16,Bv=31,zv=0,Uv={};function Vv(t){if("number"==typeof t)return Dv;if("boolean"==typeof t)return Gv;if("string"==typeof t)return e=t,pi.test(e)&&(e=di(e)),ci.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?jv|kv:kv;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var r=t;if(r.every((function(t){return"number"==typeof t})))return 3===r.length||4===r.length?jv|Nv:Nv;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(r)));var n=Uv[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(r)));return n.getReturnType(r.slice(1))}function Xv(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Wv(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(Xv).join(", "),")")}function Yv(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Kv(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=Uv[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(e)));return n.toGlsl(t,e.slice(1),r)}var i,o=Vv(e);if((o&Dv)>0)return Xv(e);if((o&Gv)>0)return e.toString();if((o&kv)>0&&(void 0===r||r==kv))return function(t,e){return Xv(Yv(t,e))}(t,e.toString());if((o&jv)>0&&(void 0===r||r==jv))return(i=_i(e).slice()).length<4&&i.push(1),Wv(i.map((function(t,e){return e<3?t/255:t})));if((o&Nv)>0)return Wv(e);throw new Error("Unexpected expression ".concat(e," (expected type ").concat(r,")"))}function Zv(t){if(!(Vv(t)&Dv))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Hv(t){for(var e=0;e<t.length;e++)Zv(t[e])}function qv(t){if(!(Vv(t)&kv))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function Jv(t){if(!(Vv(t)&Gv))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function Qv(t,e){if(t.length!==e)throw new Error("Exactly ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function $v(t,e){if(t.length<e)throw new Error("At least ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function tm(t,e){if(t.length>e)throw new Error("At most ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function em(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function rm(t,e){if(Ae(e)%1!=0)throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function nm(t){return"u_var_"+t}Uv.get={getReturnType:function(t){return Bv},toGlsl:function(t,e){Qv(e,1),qv(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},Uv.var={getReturnType:function(t){return Bv},toGlsl:function(t,e){Qv(e,1),qv(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),nm(r)}};Uv.palette={getReturnType:function(t){return jv},toGlsl:function(t,e){Qv(e,2),Zv(e[0]);var r=Kv(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");for(var i=n.length,o=new Uint8Array(4*i),a=0;a<i;a++){var s=n[a],l=void 0;if("string"==typeof s)l=gi(s);else{if(!Array.isArray(s))throw new Error("The second argument of palette must be an array of strings or colors");var u=s.length;if(4===u)l=s;else{if(3!==u)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(u));l=[s[0],s[1],s[2],1]}}var h=4*a;o[h]=l[0],o[h+1]=l[1],o[h+2]=l[2],o[h+3]=255*l[3]}t.paletteTextures||(t.paletteTextures=[]);var c="".concat("u_paletteTextures","[").concat(t.paletteTextures.length,"]"),p=new sv(c,o);return t.paletteTextures.push(p),"texture2D(".concat(c,", vec2((").concat(r," + 0.5) / ").concat(i,".0, 0.5))")}};var im="getBandValue";function om(t){return{getReturnType:function(t){return Gv},toGlsl:function(e,r){Qv(r,2);for(var n=Bv,i=0;i<r.length;i++)n&=Vv(r[i]);if(n===zv)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(r)," instead"));return n&=~jv,"(".concat(Kv(e,r[0],n)," ").concat(t," ").concat(Kv(e,r[1],n),")")}}}function am(t){return{getReturnType:function(t){return Gv},toGlsl:function(e,r){$v(r,2);for(var n=0;n<r.length;n++)Jv(r[n]);var i="";return i=r.map((function(t){return Kv(e,t)})).join(" ".concat(t," ")),i="(".concat(i,")")}}}Uv.band={getReturnType:function(t){return Dv},toGlsl:function(t,e){$v(e,1),tm(e,3);var r=e[0];if(!(im in t.functions)){for(var n="",i=t.bandCount||1,o=0;o<i;o++){var a=Math.floor(o/4),s=o%4;s===i-1&&1===s&&(s=3);var l="".concat(yv,"[").concat(a,"]");n+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(l,", v_textureCoord + vec2(dx, dy))[").concat(s,"];\n }\n ")}t.functions.getBandValue="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(wv,";\n float dy = yOffset / ").concat(Sv,";\n ").concat(n,"\n }\n ")}var u=Kv(t,r),h=Kv(t,e[1]||0),c=Kv(t,e[2]||0);return"".concat(im,"(").concat(u,", ").concat(h,", ").concat(c,")")}},Uv.time={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,0),"u_time"}},Uv.zoom={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,0),"u_zoom"}},Uv.resolution={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,0),"u_resolution"}},Uv["*"]={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," * ").concat(Kv(t,e[1]),")")}},Uv["/"]={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," / ").concat(Kv(t,e[1]),")")}},Uv["+"]={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," + ").concat(Kv(t,e[1]),")")}},Uv["-"]={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," - ").concat(Kv(t,e[1]),")")}},Uv.clamp={getReturnType:function(t){return Dv},toGlsl:function(t,e){Qv(e,3),Hv(e);var r=Kv(t,e[1]),n=Kv(t,e[2]);return"clamp(".concat(Kv(t,e[0]),", ").concat(r,", ").concat(n,")")}},Uv["%"]={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"mod(".concat(Kv(t,e[0]),", ").concat(Kv(t,e[1]),")")}},Uv["^"]={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"pow(".concat(Kv(t,e[0]),", ").concat(Kv(t,e[1]),")")}},Uv.abs={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,1),Hv(e),"abs(".concat(Kv(t,e[0]),")")}},Uv.floor={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,1),Hv(e),"floor(".concat(Kv(t,e[0]),")")}},Uv.round={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,1),Hv(e),"floor(".concat(Kv(t,e[0])," + 0.5)")}},Uv.ceil={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,1),Hv(e),"ceil(".concat(Kv(t,e[0]),")")}},Uv.sin={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,1),Hv(e),"sin(".concat(Kv(t,e[0]),")")}},Uv.cos={getReturnType:function(t){return Dv},toGlsl:function(t,e){return Qv(e,1),Hv(e),"cos(".concat(Kv(t,e[0]),")")}},Uv.atan={getReturnType:function(t){return Dv},toGlsl:function(t,e){return $v(e,1),tm(e,2),Hv(e),2===e.length?"atan(".concat(Kv(t,e[0]),", ").concat(Kv(t,e[1]),")"):"atan(".concat(Kv(t,e[0]),")")}},Uv[">"]={getReturnType:function(t){return Gv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," > ").concat(Kv(t,e[1]),")")}},Uv[">="]={getReturnType:function(t){return Gv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," >= ").concat(Kv(t,e[1]),")")}},Uv["<"]={getReturnType:function(t){return Gv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," < ").concat(Kv(t,e[1]),")")}},Uv["<="]={getReturnType:function(t){return Gv},toGlsl:function(t,e){return Qv(e,2),Hv(e),"(".concat(Kv(t,e[0])," <= ").concat(Kv(t,e[1]),")")}},Uv["=="]=om("=="),Uv["!="]=om("!="),Uv["!"]={getReturnType:function(t){return Gv},toGlsl:function(t,e){return Qv(e,1),Jv(e[0]),"(!".concat(Kv(t,e[0]),")")}},Uv.all=am("&&"),Uv.any=am("||"),Uv.between={getReturnType:function(t){return Gv},toGlsl:function(t,e){Qv(e,3),Hv(e);var r=Kv(t,e[1]),n=Kv(t,e[2]),i=Kv(t,e[0]);return"(".concat(i," >= ").concat(r," && ").concat(i," <= ").concat(n,")")}},Uv.array={getReturnType:function(t){return Nv},toGlsl:function(t,e){$v(e,2),tm(e,4),Hv(e);var r=e.map((function(e){return Kv(t,e,Dv)}));return"vec".concat(e.length,"(").concat(r.join(", "),")")}},Uv.color={getReturnType:function(t){return jv},toGlsl:function(t,e){$v(e,3),tm(e,4),Hv(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Kv(t,e,Dv)+(r<3?" / 255.0":"")}));return"vec".concat(e.length,"(").concat(n.join(", "),")")}},Uv.interpolate={getReturnType:function(t){for(var e=jv|Dv,r=3;r<t.length;r+=2)e&=Vv(t[r]);return e},toGlsl:function(t,e,r){em(e),$v(e,6);var n,i=e[0];switch(i[0]){case"linear":n=1;break;case"exponential":n=i[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(i)));var o=void 0!==r?r:Bv,a=Uv.interpolate.getReturnType(e)&o;rm(e,a);for(var s=Kv(t,e[1]),l=Xv(n),u="",h=2;h<e.length-2;h+=2){var c=Kv(t,e[h]),p=u||Kv(t,e[h+1],a),f=Kv(t,e[h+2]),d=Kv(t,e[h+3],a);u="mix(".concat(p,", ").concat(d,", pow(clamp((").concat(s," - ").concat(c,") / (").concat(f," - ").concat(c,"), 0.0, 1.0), ").concat(l,"))")}return u}},Uv.match={getReturnType:function(t){for(var e=Bv,r=2;r<t.length;r+=2)e&=Vv(t[r]);return e&=Vv(t[t.length-1])},toGlsl:function(t,e,r){em(e),$v(e,4);var n=void 0!==r?r:Bv,i=Uv.match.getReturnType(e)&n;rm(e,i);for(var o=Kv(t,e[0]),a=Kv(t,e[e.length-1],i),s=null,l=e.length-3;l>=1;l-=2){var u=Kv(t,e[l]),h=Kv(t,e[l+1],i);s="(".concat(o," == ").concat(u," ? ").concat(h," : ").concat(s||a,")")}return s}},Uv.case={getReturnType:function(t){for(var e=Bv,r=1;r<t.length;r+=2)e&=Vv(t[r]);return e&=Vv(t[t.length-1])},toGlsl:function(t,e,r){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(e),$v(e,3);var n=void 0!==r?r:Bv,i=Uv.case.getReturnType(e)&n;rm(e,i);for(var o=0;o<e.length-1;o+=2)Jv(e[o]);var a=Kv(t,e[e.length-1],i),s=null;for(o=e.length-3;o>=0;o-=2){var l=Kv(t,e[o]),u=Kv(t,e[o+1],i);s="(".concat(l," ? ").concat(u," : ").concat(s||a,")")}return s}};var sm=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,r){return this.varyings.push({name:t,type:e,expression:r}),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",r=this.attributes,n=this.varyings;return t&&(r=r.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".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(r.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(e,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(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;":"",r=this.varyings;return t&&(r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(e,"\n}")},t}();var lm=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),um=function(t){function e(e){var r=this,n=m({},e);return(r=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,r=void 0!==e.size?e.size:1,n=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=Kv(l,r,Nv|Dv),h=Kv(l,o,Nv),c=Kv(l,i,Nv),p=Kv(l,s,Dv),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},d=Kv(f,n,jv),g=Kv(f,a,Dv),_="1.0",y="vec2(".concat(Kv(f,r,Nv|Dv),").x");switch(e.symbolType){case"square":case"image":break;case"circle":_="(1.0-smoothstep(1.-4./".concat(y,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var v="(v_quadCoord*2.-1.)",m="(atan(".concat(v,".x,").concat(v,".y))");_="(1.0-smoothstep(.5-3./".concat(y,",.5,cos(floor(.5+").concat(m,"/2.094395102)*2.094395102-").concat(m,")*length(").concat(v,")))");break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new sm).setSizeExpression("vec2(".concat(u,")")).setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(g," * ").concat(_,")"));if(t.filter){var w=Kv(f,t.filter,Gv);x.setFragmentDiscardExpression("!".concat(w))}var S={};if(f.variables.forEach((function(e){var r=nm(e);x.addUniform("float ".concat(r)),S[r]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: ".concat(e));var r=t.variables[e];return"string"==typeof r&&(r=Yv(l,r)),void 0!==r?r:-9999999}})),"image"===e.symbolType&&e.src){var C=new Image;C.crossOrigin=void 0===e.crossOrigin?"anonymous":e.crossOrigin,C.src=e.src,x.addUniform("sampler2D u_texture").setColorExpression(x.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),S.u_texture=C}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),x.addVarying("v_".concat(t),"float","a_".concat(t))})),l.attributes.forEach((function(t){x.addAttribute("float a_".concat(t))})),{builder:x,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,r){var n=r[t];return"string"==typeof n&&(n=Yv(l,n)),void 0!==n?n:-9999999}}})),uniforms:S}}(e.style),r.styleVariables_=e.style.variables||{},r.hitDetectionDisabled_=!!e.disableHitDetection,r}return lm(e,t),e.prototype.createRenderer=function(){return new X_(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.updateStyleVariables=function(t){m(this.styleVariables_,t),this.changed()},e}(Mo),hm=um,cm=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var pm=function(t){function e(e){var r=this,i=void 0!==e.hidpi&&e.hidpi,o=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(o=e.interpolate),(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:o,opaque:!0,projection:Pr("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Ro,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:i?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).hidpi_=i,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,function(t,e,r,i){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("?")?"?":"&")+(i||"callback")+"="+a;var l=setTimeout((function(){s(),r&&r()}),1e4);window[a]=function(t){clearTimeout(l),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return cm(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],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=Ny(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=ky({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=Wy(e.imageUrlSubdomains.map((function(t){var r=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){fp(t[0],t[1],t[2],r);var o=n;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,r,n=t[0],i=new Array(n),o=1<<n-1;for(e=0;e<n;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),i[e]=String.fromCharCode(r),o>>=1;return i.join("")}(r))}}}))),e.imageryProviders){var u=Mr(Pr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],n=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(n.resolution,this.zDirection),a=i.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map((function(e){for(var n=!1,i=e.coverageAreas,o=0,s=i.length;o<s;++o){var l=i[o];if(a>=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(Pe(Fe([h[1],h[0],h[3],h[2]],u),t.extent)){n=!0;break}}}n&&r.push(e.attribution)})),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),r}.bind(this))}this.setState(Po)}else this.setState(Oo)},e}(ev),fm=pm,dm=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gm=function(t){function e(e){var r=e||{},n=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(n=r.interpolate);var i=void 0!==r.projection?r.projection:"EPSG:3857",o=void 0!==r.tileGrid?r.tileGrid:ky({extent:Ny(i),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:n,opaque:r.opaque,projection:i,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return dm(e,t),e}(ev),_m=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ym=function(t){function e(e,r,n,i,o,a,s){var l=this,u=e.getExtent(),h=r.getExtent(),c=h?Ee(n,h):n,p=hy(e,r,xe(c),i),f=new sy(e,r,c,u,.5*p,i),d=a(f.calculateSourceExtent(),p,o),g=d?ti:ii,_=d?d.getPixelRatio():1;return(l=t.call(this,n,i,_,g)||this).targetProj_=r,l.maxSourceExtent_=u,l.triangulation_=f,l.targetResolution_=i,l.targetExtent_=n,l.sourceImage_=d,l.sourcePixelRatio_=_,l.interpolate_=s,l.canvas_=null,l.sourceListenerKey_=null,l}return _m(e,t),e.prototype.disposeInternal=function(){this.state==ei&&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==ri){var e=Re(this.targetExtent_)/this.targetResolution_,r=Ce(this.targetExtent_)/this.targetResolution_;this.canvas_=cy(e,r,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.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==ti){this.state=ei,this.changed();var t=this.sourceImage_.getState();t==ri||t==ni?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,T,(function(t){var e=this.sourceImage_.getState();e!=ri&&e!=ni||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){z(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(_s),vm=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mm="imageloadstart",xm="imageloadend",wm="imageloaderror",Sm=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return vm(e,t),e}(s);function Cm(t,e){t.getImage().src=e}var Em=function(t){function r(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:n})||this).on,r.once,r.un,r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return vm(r,t),r.prototype.getResolutions=function(){return this.resolutions_},r.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=p(this.resolutions_,t,0);t=this.resolutions_[e]}return t},r.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Lr(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Lr(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&ce(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new ym(i,n,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(n=i),this.getImageInternal(t,e,r,n)},r.prototype.getImageInternal=function(t,r,n,i){return e()},r.prototype.handleImageChange=function(t){var e,r=t.target;switch(r.getState()){case ei:this.loading=!0,e=mm;break;case ri:this.loading=!1,e=xm;break;case ni:this.loading=!1,e=wm;break;default:return}this.hasListener(e)&&this.dispatchEvent(new Sm(e,r))},r}(Vs);function Tm(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var n=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var bm="1.3.0",Rm="carmentaserver",Pm="geoserver",Om="mapserver",Fm="qgis",Im=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lm=[101,101],Mm=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(i=n.interpolate),(r=t.call(this,{attributions:n.attributions,interpolate:i,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:Cm,r.params_=n.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return Im(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=Pr(r),o=this.getProjection();o&&o!==i&&(e=hy(o,i,t,e),t=Dr(t,i,o));var a=Se(t,e,0,Lm),s={SERVICE:"WMS",VERSION:bm,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(s,this.params_,n);var l=Ve((t[0]-a[0])/e,4),u=Ve((a[3]-t[1])/e,4);return s[this.v13_?"I":"X"]=l,s[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,Lm,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:bm,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;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return m(r,e),Tm(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var i=e/r,o=xe(t),a=Se(o,i,0,[Xe(Re(t)/i,4),Xe(Ce(t)/i,4)]),s=Se(o,i,0,[Xe(this.ratio_*Re(t)/i,4),Xe(this.ratio_*Ce(t)/i,4)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&ne(l.getExtent(),a))return l;var u={SERVICE:"WMS",VERSION:bm,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};m(u,this.params_),this.imageSize_[0]=Ue(Re(s)/i,4),this.imageSize_[1]=Ue(Ce(s)/i,4);var h=this.getRequestUrl_(s,this.imageSize_,r,n,u);return this.image_=new ms(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(T,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(nt(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case Pm:var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case Om:i.MAP_RESOLUTION=90*r;break;case Rm:case Fm:i.DPI=90*r;break;default:nt(!1,8)}i.WIDTH=e[0],i.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,i.BBOX=a.join(","),Tm(this.url_,i)},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||bm;this.v13_=ur(t,"1.3")>=0},e}(Em),Am=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dm=function(t){function e(e){var r,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate),r=void 0!==n.attributions?n.attributions:['© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var o=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",a=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:o,interpolate:i,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Am(e,t),e}(gm),km=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jm=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=n.params||{},a=!("TRANSPARENT"in o)||o.TRANSPARENT;return(r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:i,opaque:!a,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,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,r.params_=o,r.v13_=!0,r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return km(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=Pr(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getZForResolution(e,this.zDirection),l=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=l[0])){var u=a.getResolution(l[0]),h=a.getTileCoordExtent(l,this.tmpExtent_),c=li(a.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=oi(c,p,this.tmpSize),h=$t(h,u*p,h)),o&&o!==i&&(u=hy(o,i,t,u),h=function(t,e,r,n){return Fe(t,Ar(e,r),void 0,n)}(h,i,o),t=Dr(t,i,o));var f={SERVICE:"WMS",VERSION:bm,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])/u),g=Math.floor((h[3]-t[1])/u);return f[this.v13_?"I":"X"]=d,f[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||i,f)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:bm,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;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return m(r,e),Tm(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case Pm:var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case Om:o.MAP_RESOLUTION=90*n;break;case Rm:case Fm:o.DPI=90*n;break;default:nt(!1,52)}var l,u=i.getAxisOrientation(),h=r;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)l=a[0];else l=a[Ne(yp(t),a.length)];return Tm(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];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||bm;this.v13_=ur(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=li(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=oi(a,s,this.tmpSize),o=$t(o,i*s,o)),1!=e&&(a=si(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:bm,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return m(l,this.params_),this.getRequestUrl_(t,a,o,e,r,l)}},e}(ev),Gm=jm;W.unByKey=X;let Nm={Control:Cu,Zoom:Lu,Attribution:Ru,ScaleLine:Vu,LayerSwitcher:kp},Bm={GeoJSON:qp,KML:Og,MVT:s_},zm={Group:Ll,Tile:av,Vector:Ns,VectorTile:Py,WebGLPoints:hm,Heatmap:J_,Image:ay},Um={toLonLat:function(t,e){var r=Dr(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=Ne(n+180,360)-180),r},fromLonLat:function(t,e){return Er(),Dr(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}},Vm={LineString:Qn,Point:Cn,MultiPoint:lc},Xm={Icon:Ts,Style:lo,Text:po,Stroke:$n,Fill:Yn,Circle:ro},Wm={OSM:Dm,XYZ:gm,TileWMS:Gm,BingMaps:fm,Vector:al,VectorTile:qy,ImageWMS:Mm};t.Collection=rt,t.Feature=at,t.Map=cp,t.Observable=W,t.View=_u,t.control=Nm,t.format=Bm,t.geom=Vm,t.interaction=up,t.layer=zm,t.proj=Um,t.source=Wm,t.sphere=Sr,t.style=Xm,Object.defineProperty(t,"__esModule",{value:!0})}));
|
||
//# sourceMappingURL=ol-custom.js.map
|