a2g_travel_blog/Resources/Public/JavaScript/vendor.a5ae8db0.js
2023-12-04 16:40:27 +01:00

10 lines
363 KiB
JavaScript

function M(){return function(){throw new Error("Unimplemented abstract method.")}()}var mu=0;function b(i){return i.ol_uid||(i.ol_uid=String(++mu))}var Eu="6.14.1",Tu=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Cu=function(i){Tu(n,i);function n(t){var e=this,r="v"+Eu.split("-")[0],o="Assertion failed. See https://openlayers.org/en/"+r+"/doc/errors/#"+t+" for details.";return e=i.call(this,o)||this,e.code=t,e.name="AssertionError",e.message=o,e}return n}(Error),Go=Cu,xu=function(){function i(n){this.propagationStopped,this.defaultPrevented,this.type=n,this.target=null}return i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i}();function Ou(i){i.stopPropagation()}var Ut=xu,tn={PROPERTYCHANGE:"propertychange"},Ru=function(){function i(){this.disposed=!1}return i.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},i.prototype.disposeInternal=function(){},i}(),ci=Ru;function Iu(i,n,t){for(var e,r,o=t||Re,a=0,s=i.length,u=!1;a<s;)e=a+(s-a>>1),r=+o(i[e],n),r<0?a=e+1:(s=e,u=!r);return u?a:~a}function Re(i,n){return i>n?1:i<n?-1:0}function ko(i,n){return i.indexOf(n)>=0}function di(i,n,t){var e=i.length;if(i[0]<=n)return 0;if(n<=i[e-1])return e-1;var r=void 0;if(t>0){for(r=1;r<e;++r)if(i[r]<n)return r-1}else if(t<0){for(r=1;r<e;++r)if(i[r]<=n)return r}else for(r=1;r<e;++r){if(i[r]==n)return r;if(i[r]<n)return typeof t=="function"?t(n,i[r-1],i[r])>0?r-1:r:i[r-1]-n<n-i[r]?r-1:r}return e-1}function wu(i,n,t){for(;n<t;){var e=i[n];i[n]=i[t],i[t]=e,++n,--t}}function Dt(i,n){for(var t=Array.isArray(n)?n:[n],e=t.length,r=0;r<e;r++)i[i.length]=t[r]}function Ie(i,n){var t=i.length;if(t!==n.length)return!1;for(var e=0;e<t;e++)if(i[e]!==n[e])return!1;return!0}function Su(i,n,t){var e=n||Re;return i.every(function(r,o){if(o===0)return!0;var a=e(i[o-1],r);return!(a>0||t&&a===0)})}function en(){return!0}function pr(){return!1}function we(){}function Pu(i){var n=!1,t,e,r;return function(){var o=Array.prototype.slice.call(arguments);return(!n||this!==r||!Ie(o,e))&&(n=!0,r=this,e=o,t=i.apply(this,arguments)),t}}var ut=typeof Object.assign=="function"?Object.assign:function(i,n){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(i),e=1,r=arguments.length;e<r;++e){var o=arguments[e];if(o!=null)for(var a in o)o.hasOwnProperty(a)&&(t[a]=o[a])}return t};function Pn(i){for(var n in i)delete i[n]}var Xo=typeof Object.values=="function"?Object.values:function(i){var n=[];for(var t in i)n.push(i[t]);return n};function nn(i){var n;for(n in i)return!1;return!n}var Lu=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Au=function(i){Lu(n,i);function n(t){var e=i.call(this)||this;return e.eventTarget_=t,e.pendingRemovals_=null,e.dispatching_=null,e.listeners_=null,e}return n.prototype.addEventListener=function(t,e){if(!(!t||!e)){var r=this.listeners_||(this.listeners_={}),o=r[t]||(r[t]=[]);o.indexOf(e)===-1&&o.push(e)}},n.prototype.dispatchEvent=function(t){var e=typeof t=="string",r=e?t:t.type,o=this.listeners_&&this.listeners_[r];if(!!o){var a=e?new Ut(t):t;a.target||(a.target=this.eventTarget_||this);var s=this.dispatching_||(this.dispatching_={}),u=this.pendingRemovals_||(this.pendingRemovals_={});r in s||(s[r]=0,u[r]=0),++s[r];for(var l,h=0,c=o.length;h<c;++h)if("handleEvent"in o[h]?l=o[h].handleEvent(a):l=o[h].call(this,a),l===!1||a.propagationStopped){l=!1;break}if(--s[r]==0){var f=u[r];for(delete u[r];f--;)this.removeEventListener(r,we);delete s[r]}return l}},n.prototype.disposeInternal=function(){this.listeners_&&Pn(this.listeners_)},n.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},n.prototype.hasListener=function(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1},n.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var o=r.indexOf(e);o!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[o]=we,++this.pendingRemovals_[t]):(r.splice(o,1),r.length===0&&delete this.listeners_[t]))}},n}(ci),rn=Au,F={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function B(i,n,t,e,r){if(e&&e!==i&&(t=t.bind(e)),r){var o=t;t=function(){i.removeEventListener(n,t),o.apply(this,arguments)}}var a={target:i,type:n,listener:t};return i.addEventListener(n,t),a}function vr(i,n,t,e){return B(i,n,t,e,!0)}function q(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),Pn(i))}var Mu=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),_r=function(i){Mu(n,i);function n(){var t=i.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return n.prototype.changed=function(){++this.revision_,this.dispatchEvent(F.CHANGE)},n.prototype.getRevision=function(){return this.revision_},n.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var r=t.length,o=new Array(r),a=0;a<r;++a)o[a]=B(this,t[a],e);return o}else return B(this,t,e)},n.prototype.onceInternal=function(t,e){var r;if(Array.isArray(t)){var o=t.length;r=new Array(o);for(var a=0;a<o;++a)r[a]=vr(this,t[a],e)}else r=vr(this,t,e);return e.ol_key=r,r},n.prototype.unInternal=function(t,e){var r=e.ol_key;if(r)Fu(r);else if(Array.isArray(t))for(var o=0,a=t.length;o<a;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},n}(rn);_r.prototype.on;_r.prototype.once;_r.prototype.un;function Fu(i){if(Array.isArray(i))for(var n=0,t=i.length;n<t;++n)q(i[n]);else q(i)}var Yo=_r,jo=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Uo=function(i){jo(n,i);function n(t,e,r){var o=i.call(this,t)||this;return o.key=e,o.oldValue=r,o}return n}(Ut),Nu=function(i){jo(n,i);function n(t){var e=i.call(this)||this;return e.on,e.once,e.un,b(e),e.values_=null,t!==void 0&&e.setProperties(t),e}return n.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},n.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},n.prototype.getProperties=function(){return this.values_&&ut({},this.values_)||{}},n.prototype.hasProperties=function(){return!!this.values_},n.prototype.notify=function(t,e){var r;r="change:".concat(t),this.hasListener(r)&&this.dispatchEvent(new Uo(r,t,e)),r=tn.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new Uo(r,t,e))},n.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},n.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},n.prototype.set=function(t,e,r){var o=this.values_||(this.values_={});if(r)o[t]=e;else{var a=o[t];o[t]=e,a!==e&&this.notify(t,a)}},n.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},n.prototype.applyProperties=function(t){!t.values_||ut(this.values_||(this.values_={}),t.values_)},n.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],nn(this.values_)&&(this.values_=null),e||this.notify(t,r)}},n}(Yo),At=Nu,Ct={ADD:"add",REMOVE:"remove"},Bo=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wo={LENGTH:"length"},gr=function(i){Bo(n,i);function n(t,e,r){var o=i.call(this,t)||this;return o.element=e,o.index=r,o}return n}(Ut),Du=function(i){Bo(n,i);function n(t,e){var r=i.call(this)||this;r.on,r.once,r.un;var o=e||{};if(r.unique_=!!o.unique,r.array_=t||[],r.unique_)for(var a=0,s=r.array_.length;a<s;++a)r.assertUnique_(r.array_[a],a);return r.updateLength_(),r}return n.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},n.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},n.prototype.forEach=function(t){for(var e=this.array_,r=0,o=e.length;r<o;++r)t(e[r],r,e)},n.prototype.getArray=function(){return this.array_},n.prototype.item=function(t){return this.array_[t]},n.prototype.getLength=function(){return this.get(Wo.LENGTH)},n.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new gr(Ct.ADD,e,t))},n.prototype.pop=function(){return this.removeAt(this.getLength()-1)},n.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},n.prototype.remove=function(t){for(var e=this.array_,r=0,o=e.length;r<o;++r)if(e[r]===t)return this.removeAt(r)},n.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new gr(Ct.REMOVE,e,t)),e},n.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new gr(Ct.REMOVE,o,t)),this.dispatchEvent(new gr(Ct.ADD,e,t))}else{for(var a=r;a<t;++a)this.insertAt(a,void 0);this.insertAt(t,e)}},n.prototype.updateLength_=function(){this.set(Wo.LENGTH,this.array_.length)},n.prototype.assertUnique_=function(t,e){for(var r=0,o=this.array_.length;r<o;++r)if(this.array_[r]===t&&r!==e)throw new Go(58)},n}(At),Mt=Du;function W(i,n){if(!i)throw new Go(n)}var Gu=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ku=function(i){Gu(n,i);function n(t){var e=i.call(this)||this;if(e.on,e.once,e.un,e.id_=void 0,e.geometryName_="geometry",e.style_=null,e.styleFunction_=void 0,e.geometryChangeKey_=null,e.addChangeListener(e.geometryName_,e.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){var r=t;e.setGeometry(r)}else{var o=t;e.setProperties(o)}return e}return n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var e=this.getGeometry();e&&t.setGeometry(e.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.geometryName_)},n.prototype.getId=function(){return this.id_},n.prototype.getGeometryName=function(){return this.geometryName_},n.prototype.getStyle=function(){return this.style_},n.prototype.getStyleFunction=function(){return this.styleFunction_},n.prototype.handleGeometryChange_=function(){this.changed()},n.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(q(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=B(t,F.CHANGE,this.handleGeometryChange_,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},n.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?Xu(t):void 0,this.changed()},n.prototype.setId=function(t){this.id_=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},n}(At);function Xu(i){if(typeof i=="function")return i;var n;if(Array.isArray(i))n=i;else{W(typeof i.getZIndex=="function",41);var t=i;n=[t]}return function(){return n}}var Ln=ku,$={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},w={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},on={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Bt={};Bt[on.RADIANS]=6370997/(2*Math.PI);Bt[on.DEGREES]=2*Math.PI*6370997/360;Bt[on.FEET]=.3048;Bt[on.METERS]=1;Bt[on.USFEET]=1200/3937;var Vt=on,ue=typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"?navigator.userAgent.toLowerCase():"",Yu=ue.indexOf("firefox")!==-1,ju=ue.indexOf("safari")!==-1&&ue.indexOf("chrom")==-1;ju&&(ue.indexOf("version/15.4")>=0||ue.match(/cpu (os|iphone os) 15_4 like mac os x/));var Uu=ue.indexOf("webkit")!==-1&&ue.indexOf("edge")==-1,Zo=ue.indexOf("macintosh")!==-1,Ko=typeof devicePixelRatio!="undefined"?devicePixelRatio:1,yr=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,Bu=typeof Image!="undefined"&&Image.prototype.decode,zo=function(){var i=!1;try{var n=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return i}();new Array(6);function Wt(){return[1,0,0,1,0,0]}function Wu(i,n,t,e,r,o,a){return i[0]=n,i[1]=t,i[2]=e,i[3]=r,i[4]=o,i[5]=a,i}function Zu(i,n){return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i}function at(i,n){var t=n[0],e=n[1];return n[0]=i[0]*t+i[2]*e+i[4],n[1]=i[1]*t+i[3]*e+i[5],n}function Ku(i,n,t){return Wu(i,n,0,0,t,0,0)}function bt(i,n,t,e,r,o,a,s){var u=Math.sin(o),l=Math.cos(o);return i[0]=e*l,i[1]=r*u,i[2]=-e*u,i[3]=r*l,i[4]=a*e*l-s*e*u+n,i[5]=a*r*u+s*r*l+t,i}function pi(i,n){var t=zu(n);W(t!==0,32);var e=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=n[5];return i[0]=a/t,i[1]=-r/t,i[2]=-o/t,i[3]=e/t,i[4]=(o*u-a*s)/t,i[5]=-(e*u-r*s)/t,i}function zu(i){return i[0]*i[3]-i[1]*i[2]}var Vo;function bo(i){var n="matrix("+i.join(", ")+")";if(yr)return n;var t=Vo||(Vo=document.createElement("div"));return t.style.transform=n,t.style.transform}var An={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},dt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function $o(i){for(var n=wt(),t=0,e=i.length;t<e;++t)Dn(n,i[t]);return n}function mr(i,n,t){return t?(t[0]=i[0]-n,t[1]=i[1]-n,t[2]=i[2]+n,t[3]=i[3]+n,t):[i[0]-n,i[1]-n,i[2]+n,i[3]+n]}function Ho(i,n){return n?(n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n):i.slice()}function Se(i,n,t){var e,r;return n<i[0]?e=i[0]-n:i[2]<n?e=n-i[2]:e=0,t<i[1]?r=i[1]-t:i[3]<t?r=t-i[3]:r=0,e*e+r*r}function Mn(i,n){return vi(i,n[0],n[1])}function Pe(i,n){return i[0]<=n[0]&&n[2]<=i[2]&&i[1]<=n[1]&&n[3]<=i[3]}function vi(i,n,t){return i[0]<=n&&n<=i[2]&&i[1]<=t&&t<=i[3]}function _i(i,n){var t=i[0],e=i[1],r=i[2],o=i[3],a=n[0],s=n[1],u=dt.UNKNOWN;return a<t?u=u|dt.LEFT:a>r&&(u=u|dt.RIGHT),s<e?u=u|dt.BELOW:s>o&&(u=u|dt.ABOVE),u===dt.UNKNOWN&&(u=dt.INTERSECTING),u}function wt(){return[1/0,1/0,-1/0,-1/0]}function $t(i,n,t,e,r){return r?(r[0]=i,r[1]=n,r[2]=t,r[3]=e,r):[i,n,t,e]}function Fn(i){return $t(1/0,1/0,-1/0,-1/0,i)}function qo(i,n){var t=i[0],e=i[1];return $t(t,e,t,e,n)}function Jo(i,n,t,e,r){var o=Fn(r);return ta(o,i,n,t,e)}function Nn(i,n){return i[0]==n[0]&&i[2]==n[2]&&i[1]==n[1]&&i[3]==n[3]}function Qo(i,n){return n[0]<i[0]&&(i[0]=n[0]),n[2]>i[2]&&(i[2]=n[2]),n[1]<i[1]&&(i[1]=n[1]),n[3]>i[3]&&(i[3]=n[3]),i}function Dn(i,n){n[0]<i[0]&&(i[0]=n[0]),n[0]>i[2]&&(i[2]=n[0]),n[1]<i[1]&&(i[1]=n[1]),n[1]>i[3]&&(i[3]=n[1])}function ta(i,n,t,e,r){for(;t<e;t+=r)Vu(i,n[t],n[t+1]);return i}function Vu(i,n,t){i[0]=Math.min(i[0],n),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],n),i[3]=Math.max(i[3],t)}function ea(i,n){var t;return t=n(Er(i)),t||(t=n(Tr(i)),t)||(t=n(Cr(i)),t)||(t=n(Le(i)),t)?t:!1}function gi(i){var n=0;return mi(i)||(n=rt(i)*Gt(i)),n}function Er(i){return[i[0],i[1]]}function Tr(i){return[i[2],i[1]]}function le(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function bu(i,n){var t;return n===An.BOTTOM_LEFT?t=Er(i):n===An.BOTTOM_RIGHT?t=Tr(i):n===An.TOP_LEFT?t=Le(i):n===An.TOP_RIGHT?t=Cr(i):W(!1,13),t}function yi(i,n,t,e,r){var o=n*e[0]/2,a=n*e[1]/2,s=Math.cos(t),u=Math.sin(t),l=o*s,h=o*u,c=a*s,f=a*u,d=i[0],p=i[1],v=d-l+f,_=d-l-f,m=d+l-f,g=d+l+f,y=p-h-c,E=p-h+c,T=p+h+c,x=p+h-c;return $t(Math.min(v,_,m,g),Math.min(y,E,T,x),Math.max(v,_,m,g),Math.max(y,E,T,x),r)}function Gt(i){return i[3]-i[1]}function Gn(i,n,t){var e=t||wt();return xt(i,n)?(i[0]>n[0]?e[0]=i[0]:e[0]=n[0],i[1]>n[1]?e[1]=i[1]:e[1]=n[1],i[2]<n[2]?e[2]=i[2]:e[2]=n[2],i[3]<n[3]?e[3]=i[3]:e[3]=n[3]):Fn(e),e}function Le(i){return[i[0],i[3]]}function Cr(i){return[i[2],i[3]]}function rt(i){return i[2]-i[0]}function xt(i,n){return i[0]<=n[2]&&i[2]>=n[0]&&i[1]<=n[3]&&i[3]>=n[1]}function mi(i){return i[2]<i[0]||i[3]<i[1]}function $u(i,n){return n?(n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n):i}function Hu(i,n,t){var e=!1,r=_i(i,n),o=_i(i,t);if(r===dt.INTERSECTING||o===dt.INTERSECTING)e=!0;else{var a=i[0],s=i[1],u=i[2],l=i[3],h=n[0],c=n[1],f=t[0],d=t[1],p=(d-c)/(f-h),v=void 0,_=void 0;!!(o&dt.ABOVE)&&!(r&dt.ABOVE)&&(v=f-(d-l)/p,e=v>=a&&v<=u),!e&&!!(o&dt.RIGHT)&&!(r&dt.RIGHT)&&(_=d-(f-u)*p,e=_>=s&&_<=l),!e&&!!(o&dt.BELOW)&&!(r&dt.BELOW)&&(v=f-(d-s)/p,e=v>=a&&v<=u),!e&&!!(o&dt.LEFT)&&!(r&dt.LEFT)&&(_=d-(f-a)*p,e=_>=s&&_<=l)}return e}function qu(i,n){var t=n.getExtent(),e=le(i);if(n.canWrapX()&&(e[0]<t[0]||e[0]>=t[2])){var r=rt(t),o=Math.floor((e[0]-t[0])/r),a=o*r;i[0]-=a,i[2]-=a}return i}var Ju=function(){function i(n){this.code_=n.code,this.units_=n.units,this.extent_=n.extent!==void 0?n.extent:null,this.worldExtent_=n.worldExtent!==void 0?n.worldExtent:null,this.axisOrientation_=n.axisOrientation!==void 0?n.axisOrientation:"enu",this.global_=n.global!==void 0?n.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=n.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=n.metersPerUnit}return i.prototype.canWrapX=function(){return this.canWrapX_},i.prototype.getCode=function(){return this.code_},i.prototype.getExtent=function(){return this.extent_},i.prototype.getUnits=function(){return this.units_},i.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Bt[this.units_]},i.prototype.getWorldExtent=function(){return this.worldExtent_},i.prototype.getAxisOrientation=function(){return this.axisOrientation_},i.prototype.isGlobal=function(){return this.global_},i.prototype.setGlobal=function(n){this.global_=n,this.canWrapX_=!!(n&&this.extent_)},i.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},i.prototype.setDefaultTileGrid=function(n){this.defaultTileGrid_=n},i.prototype.setExtent=function(n){this.extent_=n,this.canWrapX_=!!(this.global_&&n)},i.prototype.setWorldExtent=function(n){this.worldExtent_=n},i.prototype.setGetPointResolution=function(n){this.getPointResolutionFunc_=n},i.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},i}(),na=Ju;function it(i,n,t){return Math.min(Math.max(i,n),t)}var Qu=function(){var i;return"cosh"in Math?i=Math.cosh:i=function(n){var t=Math.exp(n);return(t+1/t)/2},i}(),tl=function(){var i;return"log2"in Math?i=Math.log2:i=function(n){return Math.log(n)*Math.LOG2E},i}();function el(i,n,t,e,r,o){var a=r-t,s=o-e;if(a!==0||s!==0){var u=((i-t)*a+(n-e)*s)/(a*a+s*s);u>1?(t=r,e=o):u>0&&(t+=a*u,e+=s*u)}return Ae(i,n,t,e)}function Ae(i,n,t,e){var r=t-i,o=e-n;return r*r+o*o}function nl(i){for(var n=i.length,t=0;t<n;t++){for(var e=t,r=Math.abs(i[t][t]),o=t+1;o<n;o++){var a=Math.abs(i[o][t]);a>r&&(r=a,e=o)}if(r===0)return null;var s=i[e];i[e]=i[t],i[t]=s;for(var u=t+1;u<n;u++)for(var l=-i[u][t]/i[t][t],h=t;h<n+1;h++)t==h?i[u][h]=0:i[u][h]+=l*i[t][h]}for(var c=new Array(n),f=n-1;f>=0;f--){c[f]=i[f][n]/i[f][f];for(var d=f-1;d>=0;d--)i[d][n]-=i[d][f]*c[f]}return c}function ra(i){return i*180/Math.PI}function Me(i){return i*Math.PI/180}function an(i,n){var t=i%n;return t*n<0?t+n:t}function Ht(i,n,t){return i+t*(n-i)}function ia(i,n){var t=Math.pow(10,n);return Math.round(i*t)/t}function xr(i,n){return Math.floor(ia(i,n))}function Or(i,n){return Math.ceil(ia(i,n))}var rl=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),kn=6378137,sn=Math.PI*kn,il=[-sn,-sn,sn,sn],ol=[-180,-85,180,85],Rr=kn*Math.log(Math.tan(Math.PI/2)),un=function(i){rl(n,i);function n(t){return i.call(this,{code:t,units:Vt.METERS,extent:il,global:!0,worldExtent:ol,getPointResolution:function(e,r){return e/Qu(r[1]/kn)}})||this}return n}(na),oa=[new un("EPSG:3857"),new un("EPSG:102100"),new un("EPSG:102113"),new un("EPSG:900913"),new un("http://www.opengis.net/def/crs/EPSG/0/3857"),new un("http://www.opengis.net/gml/srs/epsg.xml#3857")];function al(i,n,t){var e=i.length,r=t>1?t:2,o=n;o===void 0&&(r>2?o=i.slice():o=new Array(e));for(var a=0;a<e;a+=r){o[a]=sn*i[a]/180;var s=kn*Math.log(Math.tan(Math.PI*(+i[a+1]+90)/360));s>Rr?s=Rr:s<-Rr&&(s=-Rr),o[a+1]=s}return o}function sl(i,n,t){var e=i.length,r=t>1?t:2,o=n;o===void 0&&(r>2?o=i.slice():o=new Array(e));for(var a=0;a<e;a+=r)o[a]=180*i[a]/sn,o[a+1]=360*Math.atan(Math.exp(i[a+1]/kn))/Math.PI-90;return o}var ul=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ll=6378137,aa=[-180,-90,180,90],hl=Math.PI*ll/180,Fe=function(i){ul(n,i);function n(t,e){return i.call(this,{code:t,units:Vt.DEGREES,extent:aa,axisOrientation:e,global:!0,metersPerUnit:hl,worldExtent:aa})||this}return n}(na),sa=[new Fe("CRS:84"),new Fe("EPSG:4326","neu"),new Fe("urn:ogc:def:crs:OGC:1.3:CRS84"),new Fe("urn:ogc:def:crs:OGC:2:84"),new Fe("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Fe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fe("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Ei={};function fl(i){return Ei[i]||Ei[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function cl(i,n){Ei[i]=n}var ln={};function Ir(i,n,t){var e=i.getCode(),r=n.getCode();e in ln||(ln[e]={}),ln[e][r]=t}function dl(i,n){var t;return i in ln&&n in ln[i]&&(t=ln[i][n]),t}function Xn(i,n,t){var e=t!==void 0?i.toFixed(t):""+i,r=e.indexOf(".");return r=r===-1?e.length:r,r>n?e:new Array(1+n-r).join("0")+e}function ua(i,n){return i[0]+=+n[0],i[1]+=+n[1],i}function wr(i,n){for(var t=!0,e=i.length-1;e>=0;--e)if(i[e]!=n[e]){t=!1;break}return t}function Ti(i,n){var t=Math.cos(n),e=Math.sin(n),r=i[0]*t-i[1]*e,o=i[1]*t+i[0]*e;return i[0]=r,i[1]=o,i}function la(i,n){return i[0]*=n,i[1]*=n,i}function ha(i,n){if(n.canWrapX()){var t=rt(n.getExtent()),e=pl(i,n,t);e&&(i[0]-=e*t)}return i}function pl(i,n,t){var e=n.getExtent(),r=0;if(n.canWrapX()&&(i[0]<e[0]||i[0]>e[2])){var o=t||rt(e);r=Math.floor((i[0]-e[0])/o)}return r}var fa=63710088e-1;function ca(i,n,t){var e=t||fa,r=Me(i[1]),o=Me(n[1]),a=(o-r)/2,s=Me(n[0]-i[0])/2,u=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(r)*Math.cos(o);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function vl(i,n,t,e){var r=e||fa,o=Me(i[1]),a=Me(i[0]),s=n/r,u=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(t)),l=a+Math.atan2(Math.sin(t)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(u));return[ra(l),ra(u)]}var Ci=!0;function _l(i){var n=i===void 0?!0:i;Ci=!n}function xi(i,n,t){var e;if(n!==void 0){for(var r=0,o=i.length;r<o;++r)n[r]=i[r];e=n}else e=i.slice();return e}function Oi(i,n,t){if(n!==void 0&&i!==n){for(var e=0,r=i.length;e<r;++e)n[e]=i[e];i=n}return i}function gl(i){cl(i.getCode(),i),Ir(i,i,xi)}function yl(i){i.forEach(gl)}function ot(i){return typeof i=="string"?fl(i):i||null}function da(i,n,t,e){i=ot(i);var r,o=i.getPointResolutionFunc();if(o){if(r=o(n,t),e&&e!==i.getUnits()){var a=i.getMetersPerUnit();a&&(r=r*a/Bt[e])}}else{var s=i.getUnits();if(s==Vt.DEGREES&&!e||e==Vt.DEGREES)r=n;else{var u=Sr(i,ot("EPSG:4326"));if(u===Oi&&s!==Vt.DEGREES)r=n*i.getMetersPerUnit();else{var l=[t[0]-n/2,t[1],t[0]+n/2,t[1],t[0],t[1]-n/2,t[0],t[1]+n/2];l=u(l,l,2);var h=ca(l.slice(0,2),l.slice(2,4)),c=ca(l.slice(4,6),l.slice(6,8));r=(h+c)/2}var a=e?Bt[e]:i.getMetersPerUnit();a!==void 0&&(r/=a)}}return r}function pa(i){yl(i),i.forEach(function(n){i.forEach(function(t){n!==t&&Ir(n,t,xi)})})}function ml(i,n,t,e){i.forEach(function(r){n.forEach(function(o){Ir(r,o,t),Ir(o,r,e)})})}function Ri(i,n){return i?typeof i=="string"?ot(i):i:ot(n)}function Ne(i,n){if(i===n)return!0;var t=i.getUnits()===n.getUnits();if(i.getCode()===n.getCode())return t;var e=Sr(i,n);return e===xi&&t}function Sr(i,n){var t=i.getCode(),e=n.getCode(),r=dl(t,e);return r||(r=Oi),r}function Pr(i,n){var t=ot(i),e=ot(n);return Sr(t,e)}function El(i,n,t){var e=Pr(n,t);return e(i,void 0,i.length)}var Tl=null;function Cl(){return Tl}function Ii(i,n){return i}function qt(i,n){return Ci&&!wr(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(Ci=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function va(i,n){return i}function De(i,n){return i}function xl(){pa(oa),pa(sa),ml(sa,oa,al,sl)}xl();function Ge(i,n,t,e,r,o){for(var a=o||[],s=0,u=n;u<t;u+=e){var l=i[u],h=i[u+1];a[s++]=r[0]*l+r[2]*h+r[4],a[s++]=r[1]*l+r[3]*h+r[5]}return o&&a.length!=s&&(a.length=s),a}function _a(i,n,t,e,r,o,a){for(var s=a||[],u=Math.cos(r),l=Math.sin(r),h=o[0],c=o[1],f=0,d=n;d<t;d+=e){var p=i[d]-h,v=i[d+1]-c;s[f++]=h+p*u-v*l,s[f++]=c+p*l+v*u;for(var _=d+2;_<d+e;++_)s[f++]=i[_]}return a&&s.length!=f&&(s.length=f),s}function Ol(i,n,t,e,r,o,a,s){for(var u=s||[],l=a[0],h=a[1],c=0,f=n;f<t;f+=e){var d=i[f]-l,p=i[f+1]-h;u[c++]=l+r*d,u[c++]=h+o*p;for(var v=f+2;v<f+e;++v)u[c++]=i[v]}return s&&u.length!=c&&(u.length=c),u}function Rl(i,n,t,e,r,o,a){for(var s=a||[],u=0,l=n;l<t;l+=e){s[u++]=i[l]+r,s[u++]=i[l+1]+o;for(var h=l+2;h<l+e;++h)s[u++]=i[h]}return a&&s.length!=u&&(s.length=u),s}var Il=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ga=Wt(),wl=function(i){Il(n,i);function n(){var t=i.call(this)||this;return t.extent_=wt(),t.extentRevision_=-1,t.simplifiedGeometryMaxMinSquaredTolerance=0,t.simplifiedGeometryRevision=0,t.simplifyTransformedInternal=Pu(function(e,r,o){if(!o)return this.getSimplifiedGeometry(r);var a=this.clone();return a.applyTransform(o),a.getSimplifiedGeometry(r)}),t}return n.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},n.prototype.clone=function(){return M()},n.prototype.closestPointXY=function(t,e,r,o){return M()},n.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},n.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},n.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},n.prototype.computeExtent=function(t){return M()},n.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Fn(e),this.extentRevision_=this.getRevision()}return $u(this.extent_,t)},n.prototype.rotate=function(t,e){M()},n.prototype.scale=function(t,e,r){M()},n.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},n.prototype.getSimplifiedGeometry=function(t){return M()},n.prototype.getType=function(){return M()},n.prototype.applyTransform=function(t){M()},n.prototype.intersectsExtent=function(t){return M()},n.prototype.translate=function(t,e){M()},n.prototype.transform=function(t,e){var r=ot(t),o=r.getUnits()==Vt.TILE_PIXELS?function(a,s,u){var l=r.getExtent(),h=r.getWorldExtent(),c=Gt(h)/Gt(l);return bt(ga,h[0],h[3],c,-c,0,0,0),Ge(a,0,a.length,u,ga,s),Pr(r,e)(a,s,u)}:Pr(r,e);return this.applyTransform(o),this},n}(At),ya=wl,Sl=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Pl=function(i){Sl(n,i);function n(){var t=i.call(this)||this;return t.layout=$.XY,t.stride=2,t.flatCoordinates=null,t}return n.prototype.computeExtent=function(t){return Jo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinates=function(){return M()},n.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.getFlatCoordinates=function(){return this.flatCoordinates},n.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},n.prototype.getLayout=function(){return this.layout},n.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t),r=e.getFlatCoordinates();return r.length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},n.prototype.getSimplifiedGeometryInternal=function(t){return this},n.prototype.getStride=function(){return this.stride},n.prototype.setFlatCoordinates=function(t,e){this.stride=ma(t),this.layout=t,this.flatCoordinates=e},n.prototype.setCoordinates=function(t,e){M()},n.prototype.setLayout=function(t,e,r){var o;if(t)o=ma(t);else{for(var a=0;a<r;++a)if(e.length===0){this.layout=$.XY,this.stride=2;return}else e=e[0];o=e.length,t=Ll(o)}this.layout=t,this.stride=o},n.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},n.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var o=this.getStride();_a(r,0,r.length,o,t,e,r),this.changed()}},n.prototype.scale=function(t,e,r){var o=e;o===void 0&&(o=t);var a=r;a||(a=le(this.getExtent()));var s=this.getFlatCoordinates();if(s){var u=this.getStride();Ol(s,0,s.length,u,t,o,a,s),this.changed()}},n.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var o=this.getStride();Rl(r,0,r.length,o,t,e,r),this.changed()}},n}(ya);function Ll(i){var n;return i==2?n=$.XY:i==3?n=$.XYZ:i==4&&(n=$.XYZM),n}function ma(i){var n;return i==$.XY?n=2:i==$.XYZ||i==$.XYM?n=3:i==$.XYZM&&(n=4),n}function Al(i,n,t){var e=i.getFlatCoordinates();if(e){var r=i.getStride();return Ge(e,0,e.length,r,n,t)}else return null}var ke=Pl;function Ea(i,n,t,e,r,o,a){var s=i[n],u=i[n+1],l=i[t]-s,h=i[t+1]-u,c;if(l===0&&h===0)c=n;else{var f=((r-s)*l+(o-u)*h)/(l*l+h*h);if(f>1)c=t;else if(f>0){for(var d=0;d<e;++d)a[d]=Ht(i[n+d],i[t+d],f);a.length=e;return}else c=n}for(var d=0;d<e;++d)a[d]=i[c+d];a.length=e}function wi(i,n,t,e,r){var o=i[n],a=i[n+1];for(n+=e;n<t;n+=e){var s=i[n],u=i[n+1],l=Ae(o,a,s,u);l>r&&(r=l),o=s,a=u}return r}function Si(i,n,t,e,r){for(var o=0,a=t.length;o<a;++o){var s=t[o];r=wi(i,n,s,e,r),n=s}return r}function Ml(i,n,t,e,r){for(var o=0,a=t.length;o<a;++o){var s=t[o];r=Si(i,n,s,e,r),n=s[s.length-1]}return r}function Pi(i,n,t,e,r,o,a,s,u,l,h){if(n==t)return l;var c,f;if(r===0)if(f=Ae(a,s,i[n],i[n+1]),f<l){for(c=0;c<e;++c)u[c]=i[n+c];return u.length=e,f}else return l;for(var d=h||[NaN,NaN],p=n+e;p<t;)if(Ea(i,p-e,p,e,a,s,d),f=Ae(a,s,d[0],d[1]),f<l){for(l=f,c=0;c<e;++c)u[c]=d[c];u.length=e,p+=e}else p+=e*Math.max((Math.sqrt(f)-Math.sqrt(l))/r|0,1);if(o&&(Ea(i,t-e,n,e,a,s,d),f=Ae(a,s,d[0],d[1]),f<l)){for(l=f,c=0;c<e;++c)u[c]=d[c];u.length=e}return l}function Li(i,n,t,e,r,o,a,s,u,l,h){for(var c=h||[NaN,NaN],f=0,d=t.length;f<d;++f){var p=t[f];l=Pi(i,n,p,e,r,o,a,s,u,l,c),n=p}return l}function Fl(i,n,t,e,r,o,a,s,u,l,h){for(var c=h||[NaN,NaN],f=0,d=t.length;f<d;++f){var p=t[f];l=Li(i,n,p,e,r,o,a,s,u,l,c),n=p[p.length-1]}return l}function Nl(i,n,t,e){for(var r=0,o=t.length;r<o;++r)i[n++]=t[r];return n}function Lr(i,n,t,e){for(var r=0,o=t.length;r<o;++r)for(var a=t[r],s=0;s<e;++s)i[n++]=a[s];return n}function Ai(i,n,t,e,r){for(var o=r||[],a=0,s=0,u=t.length;s<u;++s){var l=Lr(i,n,t[s],e);o[a++]=l,n=l}return o.length=a,o}function Dl(i,n,t,e,r){for(var o=r||[],a=0,s=0,u=t.length;s<u;++s){var l=Ai(i,n,t[s],e,o[a]);o[a++]=l,n=l[l.length-1]}return o.length=a,o}function Mi(i,n,t,e,r,o,a){var s=(t-n)/e;if(s<3){for(;n<t;n+=e)o[a++]=i[n],o[a++]=i[n+1];return a}var u=new Array(s);u[0]=1,u[s-1]=1;for(var l=[n,t-e],h=0;l.length>0;){for(var c=l.pop(),f=l.pop(),d=0,p=i[f],v=i[f+1],_=i[c],m=i[c+1],g=f+e;g<c;g+=e){var y=i[g],E=i[g+1],T=el(y,E,p,v,_,m);T>d&&(h=g,d=T)}d>r&&(u[(h-n)/e]=1,f+e<h&&l.push(f,h),h+e<c&&l.push(h,c))}for(var g=0;g<s;++g)u[g]&&(o[a++]=i[n+g*e],o[a++]=i[n+g*e+1]);return a}function Gl(i,n,t,e,r,o,a,s){for(var u=0,l=t.length;u<l;++u){var h=t[u];a=Mi(i,n,h,e,r,o,a),s.push(a),n=h}return a}function Xe(i,n){return n*Math.round(i/n)}function kl(i,n,t,e,r,o,a){if(n==t)return a;var s=Xe(i[n],r),u=Xe(i[n+1],r);n+=e,o[a++]=s,o[a++]=u;var l,h;do if(l=Xe(i[n],r),h=Xe(i[n+1],r),n+=e,n==t)return o[a++]=l,o[a++]=h,a;while(l==s&&h==u);for(;n<t;){var c=Xe(i[n],r),f=Xe(i[n+1],r);if(n+=e,!(c==l&&f==h)){var d=l-s,p=h-u,v=c-s,_=f-u;if(d*_==p*v&&(d<0&&v<d||d==v||d>0&&v>d)&&(p<0&&_<p||p==_||p>0&&_>p)){l=c,h=f;continue}o[a++]=l,o[a++]=h,s=l,u=h,l=c,h=f}}return o[a++]=l,o[a++]=h,a}function Ta(i,n,t,e,r,o,a,s){for(var u=0,l=t.length;u<l;++u){var h=t[u];a=kl(i,n,h,e,r,o,a),s.push(a),n=h}return a}function Xl(i,n,t,e,r,o,a,s){for(var u=0,l=t.length;u<l;++u){var h=t[u],c=[];a=Ta(i,n,h,e,r,o,a,c),s.push(c),n=h[h.length-1]}return a}function he(i,n,t,e,r){for(var o=r!==void 0?r:[],a=0,s=n;s<t;s+=e)o[a++]=i.slice(s,s+e);return o.length=a,o}function Yn(i,n,t,e,r){for(var o=r!==void 0?r:[],a=0,s=0,u=t.length;s<u;++s){var l=t[s];o[a++]=he(i,n,l,e,o[a]),n=l}return o.length=a,o}function Fi(i,n,t,e,r){for(var o=r!==void 0?r:[],a=0,s=0,u=t.length;s<u;++s){var l=t[s];o[a++]=Yn(i,n,l,e,o[a]),n=l[l.length-1]}return o.length=a,o}function Ca(i,n,t,e){for(var r=0,o=i[t-e],a=i[t-e+1];n<t;n+=e){var s=i[n],u=i[n+1];r+=a*s-o*u,o=s,a=u}return r/2}function xa(i,n,t,e){for(var r=0,o=0,a=t.length;o<a;++o){var s=t[o];r+=Ca(i,n,s,e),n=s}return r}function Yl(i,n,t,e){for(var r=0,o=0,a=t.length;o<a;++o){var s=t[o];r+=xa(i,n,s,e),n=s[s.length-1]}return r}var jl=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ul=function(i){jl(n,i);function n(t,e){var r=i.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?r.setFlatCoordinates(e,t):r.setCoordinates(t,e),r}return n.prototype.clone=function(){return new n(this.flatCoordinates.slice(),this.layout)},n.prototype.closestPointXY=function(t,e,r,o){return o<Se(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,o))},n.prototype.getArea=function(){return Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getCoordinates=function(){return he(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getSimplifiedGeometryInternal=function(t){var e=[];return e.length=Mi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new n(e,$.XY)},n.prototype.getType=function(){return w.LINEAR_RING},n.prototype.intersectsExtent=function(t){return!1},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()},n}(ke),Oa=Ul,Bl=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wl=function(i){Bl(n,i);function n(t,e){var r=i.call(this)||this;return r.setCoordinates(t,e),r}return n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,e,r,o){var a=this.flatCoordinates,s=Ae(t,e,a[0],a[1]);if(s<o){for(var u=this.stride,l=0;l<u;++l)r[l]=a[l];return r.length=u,s}else return o},n.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},n.prototype.computeExtent=function(t){return qo(this.flatCoordinates,t)},n.prototype.getType=function(){return w.POINT},n.prototype.intersectsExtent=function(t){return vi(t,this.flatCoordinates[0],this.flatCoordinates[1])},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nl(this.flatCoordinates,0,t,this.stride),this.changed()},n}(ke),hn=Wl;function Zl(i,n,t,e,r){var o=ea(r,function(a){return!Ye(i,n,t,e,a[0],a[1])});return!o}function Ye(i,n,t,e,r,o){for(var a=0,s=i[t-e],u=i[t-e+1];n<t;n+=e){var l=i[n],h=i[n+1];u<=o?h>o&&(l-s)*(o-u)-(r-s)*(h-u)>0&&a++:h<=o&&(l-s)*(o-u)-(r-s)*(h-u)<0&&a--,s=l,u=h}return a!==0}function Ni(i,n,t,e,r,o){if(t.length===0||!Ye(i,n,t[0],e,r,o))return!1;for(var a=1,s=t.length;a<s;++a)if(Ye(i,t[a-1],t[a],e,r,o))return!1;return!0}function Kl(i,n,t,e,r,o){if(t.length===0)return!1;for(var a=0,s=t.length;a<s;++a){var u=t[a];if(Ni(i,n,u,e,r,o))return!0;n=u[u.length-1]}return!1}function Ra(i,n,t,e,r,o,a){for(var s,u,l,h,c,f,d,p=r[o+1],v=[],_=0,m=t.length;_<m;++_){var g=t[_];for(h=i[g-e],f=i[g-e+1],s=n;s<g;s+=e)c=i[s],d=i[s+1],(p<=f&&d<=p||f<=p&&p<=d)&&(l=(p-f)/(d-f)*(c-h)+h,v.push(l)),h=c,f=d}var y=NaN,E=-1/0;for(v.sort(Re),h=v[0],s=1,u=v.length;s<u;++s){c=v[s];var T=Math.abs(c-h);T>E&&(l=(h+c)/2,Ni(i,n,t,e,l,p)&&(y=l,E=T)),h=c}return isNaN(y)&&(y=r[o]),a?(a.push(y,p,E),a):[y,p,E]}function zl(i,n,t,e,r){for(var o=[],a=0,s=t.length;a<s;++a){var u=t[a];o=Ra(i,n,u,e,r,2*a,o),n=u[u.length-1]}return o}function Ia(i,n,t,e,r){var o;for(n+=e;n<t;n+=e)if(o=r(i.slice(n-e,n),i.slice(n,n+e)),o)return o;return!1}function Ar(i,n,t,e,r){var o=ta(wt(),i,n,t,e);return xt(r,o)?Pe(r,o)||o[0]>=r[0]&&o[2]<=r[2]||o[1]>=r[1]&&o[3]<=r[3]?!0:Ia(i,n,t,e,function(a,s){return Hu(r,a,s)}):!1}function Vl(i,n,t,e,r){for(var o=0,a=t.length;o<a;++o){if(Ar(i,n,t[o],e,r))return!0;n=t[o]}return!1}function bl(i,n,t,e,r){return!!(Ar(i,n,t,e,r)||Ye(i,n,t,e,r[0],r[1])||Ye(i,n,t,e,r[0],r[3])||Ye(i,n,t,e,r[2],r[1])||Ye(i,n,t,e,r[2],r[3]))}function wa(i,n,t,e,r){if(!bl(i,n,t[0],e,r))return!1;if(t.length===1)return!0;for(var o=1,a=t.length;o<a;++o)if(Zl(i,t[o-1],t[o],e,r)&&!Ar(i,t[o-1],t[o],e,r))return!1;return!0}function $l(i,n,t,e,r){for(var o=0,a=t.length;o<a;++o){var s=t[o];if(wa(i,n,s,e,r))return!0;n=s[s.length-1]}return!1}function Hl(i,n,t,e){for(;n<t-e;){for(var r=0;r<e;++r){var o=i[n+r];i[n+r]=i[t-e+r],i[t-e+r]=o}n+=e,t-=e}}function Sa(i,n,t,e){for(var r=0,o=i[t-e],a=i[t-e+1];n<t;n+=e){var s=i[n],u=i[n+1];r+=(s-o)*(u+a),o=s,a=u}return r===0?void 0:r>0}function Pa(i,n,t,e,r){for(var o=r!==void 0?r:!1,a=0,s=t.length;a<s;++a){var u=t[a],l=Sa(i,n,u,e);if(a===0){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;n=u}return!0}function ql(i,n,t,e,r){for(var o=0,a=t.length;o<a;++o){var s=t[o];if(!Pa(i,n,s,e,r))return!1;s.length&&(n=s[s.length-1])}return!0}function Di(i,n,t,e,r){for(var o=r!==void 0?r:!1,a=0,s=t.length;a<s;++a){var u=t[a],l=Sa(i,n,u,e),h=a===0?o&&l||!o&&!l:o&&!l||!o&&l;h&&Hl(i,n,u,e),n=u}return n}function La(i,n,t,e,r){for(var o=0,a=t.length;o<a;++o)n=Di(i,n,t[o],e,r);return n}var Jl=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Gi=function(i){Jl(n,i);function n(t,e,r){var o=i.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,e!==void 0&&r?(o.setFlatCoordinates(e,t),o.ends_=r):o.setCoordinates(t,e),o}return n.prototype.appendLinearRing=function(t){this.flatCoordinates?Dt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,e,r,o){return o<Se(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Si(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Li(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,o))},n.prototype.containsXY=function(t,e){return Ni(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},n.prototype.getArea=function(){return xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},n.prototype.getCoordinates=function(t){var e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Di(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Yn(e,0,this.ends_,this.stride)},n.prototype.getEnds=function(){return this.ends_},n.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=le(this.getExtent());this.flatInteriorPoint_=Ra(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},n.prototype.getInteriorPoint=function(){return new hn(this.getFlatInteriorPoint(),$.XYM)},n.prototype.getLinearRingCount=function(){return this.ends_.length},n.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Oa(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},n.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,o=[],a=0,s=0,u=r.length;s<u;++s){var l=r[s],h=new Oa(e.slice(a,l),t);o.push(h),a=l}return o},n.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Pa(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Di(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},n.prototype.getSimplifiedGeometryInternal=function(t){var e=[],r=[];return e.length=Ta(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,r),new n(e,$.XY,r)},n.prototype.getType=function(){return w.POLYGON},n.prototype.intersectsExtent=function(t){return wa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=Ai(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()},n}(ke),Mr=Gi;function Ql(i,n,t,e){for(var r=t||32,o=[],a=0;a<r;++a)Dt(o,vl(i,n,2*Math.PI*a/r,e));return o.push(o[0],o[1]),new Gi(o,$.XY,[o.length])}function Aa(i){var n=i[0],t=i[1],e=i[2],r=i[3],o=[n,t,n,r,e,r,e,t,n,t];return new Gi(o,$.XY,[o.length])}var Ma=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),et={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},th=function(i){Ma(n,i);function n(t){var e=i.call(this,F.ERROR)||this;return e.code=t.code,e.message=t.message,e}return n}(Ut),eh=function(i){Ma(n,i);function n(t){var e=i.call(this)||this;e.on,e.once,e.un;var r=t||{};return e.position_=null,e.transform_=Oi,e.watchId_=void 0,e.addChangeListener(et.PROJECTION,e.handleProjectionChanged_),e.addChangeListener(et.TRACKING,e.handleTrackingChanged_),r.projection!==void 0&&e.setProjection(r.projection),r.trackingOptions!==void 0&&e.setTrackingOptions(r.trackingOptions),e.setTracking(r.tracking!==void 0?r.tracking:!1),e}return n.prototype.disposeInternal=function(){this.setTracking(!1),i.prototype.disposeInternal.call(this)},n.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=Sr(ot("EPSG:4326"),t),this.position_&&this.set(et.POSITION,this.transform_(this.position_)))},n.prototype.handleTrackingChanged_=function(){if("geolocation"in navigator){var t=this.getTracking();t&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!t&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},n.prototype.positionChange_=function(t){var e=t.coords;this.set(et.ACCURACY,e.accuracy),this.set(et.ALTITUDE,e.altitude===null?void 0:e.altitude),this.set(et.ALTITUDE_ACCURACY,e.altitudeAccuracy===null?void 0:e.altitudeAccuracy),this.set(et.HEADING,e.heading===null?void 0:Me(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var r=this.transform_(this.position_);this.set(et.POSITION,r),this.set(et.SPEED,e.speed===null?void 0:e.speed);var o=Ql(this.position_,e.accuracy);o.applyTransform(this.transform_),this.set(et.ACCURACY_GEOMETRY,o),this.changed()},n.prototype.positionError_=function(t){this.dispatchEvent(new th(t))},n.prototype.getAccuracy=function(){return this.get(et.ACCURACY)},n.prototype.getAccuracyGeometry=function(){return this.get(et.ACCURACY_GEOMETRY)||null},n.prototype.getAltitude=function(){return this.get(et.ALTITUDE)},n.prototype.getAltitudeAccuracy=function(){return this.get(et.ALTITUDE_ACCURACY)},n.prototype.getHeading=function(){return this.get(et.HEADING)},n.prototype.getPosition=function(){return this.get(et.POSITION)},n.prototype.getProjection=function(){return this.get(et.PROJECTION)},n.prototype.getSpeed=function(){return this.get(et.SPEED)},n.prototype.getTracking=function(){return this.get(et.TRACKING)},n.prototype.getTrackingOptions=function(){return this.get(et.TRACKING_OPTIONS)},n.prototype.setProjection=function(t){this.set(et.PROJECTION,ot(t))},n.prototype.setTracking=function(t){this.set(et.TRACKING,t)},n.prototype.setTrackingOptions=function(t){this.set(et.TRACKING_OPTIONS,t)},n}(At),X_=eh,fe={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},nh=function(){function i(n){var t=n||{};this.color_=t.color!==void 0?t.color:null}return i.prototype.clone=function(){var n=this.getColor();return new i({color:Array.isArray(n)?n.slice():n||void 0})},i.prototype.getColor=function(){return this.color_},i.prototype.setColor=function(n){this.color_=n},i}(),Fa=nh;function Na(i,n,t,e,r,o,a){var s,u,l=(t-n)/e;if(l===1)s=n;else if(l===2)s=n,u=r;else if(l!==0){for(var h=i[n],c=i[n+1],f=0,d=[0],p=n+e;p<t;p+=e){var v=i[p],_=i[p+1];f+=Math.sqrt((v-h)*(v-h)+(_-c)*(_-c)),d.push(f),h=v,c=_}var m=r*f,g=Iu(d,m);g<0?(u=(m-d[-g-2])/(d[-g-1]-d[-g-2]),s=n+(-g-2)*e):s=n+g*e}for(var y=a>1?a:2,E=o||new Array(y),p=0;p<y;++p)E[p]=s===void 0?NaN:u===void 0?i[s+p]:Ht(i[s+p],i[s+e+p],u);return E}function ki(i,n,t,e,r,o){if(t==n)return null;var a;if(r<i[n+e-1])return o?(a=i.slice(n,n+e),a[e-1]=r,a):null;if(i[t-1]<r)return o?(a=i.slice(t-e,t),a[e-1]=r,a):null;if(r==i[n+e-1])return i.slice(n,n+e);for(var s=n/e,u=t/e;s<u;){var l=s+u>>1;r<i[(l+1)*e-1]?u=l:s=l+1}var h=i[s*e-1];if(r==h)return i.slice((s-1)*e,(s-1)*e+e);var c=i[(s+1)*e-1],f=(r-h)/(c-h);a=[];for(var d=0;d<e-1;++d)a.push(Ht(i[(s-1)*e+d],i[s*e+d],f));return a.push(r),a}function rh(i,n,t,e,r,o,a){if(a)return ki(i,n,t[t.length-1],e,r,o);var s;if(r<i[e-1])return o?(s=i.slice(0,e),s[e-1]=r,s):null;if(i[i.length-1]<r)return o?(s=i.slice(i.length-e),s[e-1]=r,s):null;for(var u=0,l=t.length;u<l;++u){var h=t[u];if(n!=h){if(r<i[n+e-1])return null;if(r<=i[h-1])return ki(i,n,h,e,r,!1);n=h}}return null}function Da(i,n,t,e){for(var r=i[n],o=i[n+1],a=0,s=n+e;s<t;s+=e){var u=i[s],l=i[s+1];a+=Math.sqrt((u-r)*(u-r)+(l-o)*(l-o)),r=u,o=l}return a}var ih=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),oh=function(i){ih(n,i);function n(t,e){var r=i.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?r.setFlatCoordinates(e,t):r.setCoordinates(t,e),r}return n.prototype.appendCoordinate=function(t){this.flatCoordinates?Dt(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,e,r,o){return o<Se(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,o))},n.prototype.forEachSegment=function(t){return Ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinateAtM=function(t,e){if(this.layout!=$.XYM&&this.layout!=$.XYZM)return null;var r=e!==void 0?e:!1;return ki(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},n.prototype.getCoordinates=function(){return he(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getCoordinateAt=function(t,e){return Na(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},n.prototype.getLength=function(){return Da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},n.prototype.getSimplifiedGeometryInternal=function(t){var e=[];return e.length=Mi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new n(e,$.XY)},n.prototype.getType=function(){return w.LINE_STRING},n.prototype.intersectsExtent=function(t){return Ar(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()},n}(ke),Fr=oh,ah=function(){function i(n){var t=n||{};this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}return i.prototype.clone=function(){var n=this.getColor();return new i({color:Array.isArray(n)?n.slice():n||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},i.prototype.getColor=function(){return this.color_},i.prototype.getLineCap=function(){return this.lineCap_},i.prototype.getLineDash=function(){return this.lineDash_},i.prototype.getLineDashOffset=function(){return this.lineDashOffset_},i.prototype.getLineJoin=function(){return this.lineJoin_},i.prototype.getMiterLimit=function(){return this.miterLimit_},i.prototype.getWidth=function(){return this.width_},i.prototype.setColor=function(n){this.color_=n},i.prototype.setLineCap=function(n){this.lineCap_=n},i.prototype.setLineDash=function(n){this.lineDash_=n},i.prototype.setLineDashOffset=function(n){this.lineDashOffset_=n},i.prototype.setLineJoin=function(n){this.lineJoin_=n},i.prototype.setMiterLimit=function(n){this.miterLimit_=n},i.prototype.setWidth=function(n){this.width_=n},i}(),sh=ah,Q={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Ga(i){return i[0]>0&&i[1]>0}function uh(i,n,t){return t===void 0&&(t=[0,0]),t[0]=i[0]*n+.5|0,t[1]=i[1]*n+.5|0,t}function St(i,n){return Array.isArray(i)?i:(n===void 0?n=[i,i]:(n[0]=i,n[1]=i),n)}var lh=function(){function i(n){this.opacity_=n.opacity,this.rotateWithView_=n.rotateWithView,this.rotation_=n.rotation,this.scale_=n.scale,this.scaleArray_=St(n.scale),this.displacement_=n.displacement}return i.prototype.clone=function(){var n=this.getScale();return new i({opacity:this.getOpacity(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},i.prototype.getOpacity=function(){return this.opacity_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getDisplacement=function(){return this.displacement_},i.prototype.getAnchor=function(){return M()},i.prototype.getImage=function(n){return M()},i.prototype.getHitDetectionImage=function(){return M()},i.prototype.getPixelRatio=function(n){return 1},i.prototype.getImageState=function(){return M()},i.prototype.getImageSize=function(){return M()},i.prototype.getOrigin=function(){return M()},i.prototype.getSize=function(){return M()},i.prototype.setDisplacement=function(n){this.displacement_=n},i.prototype.setOpacity=function(n){this.opacity_=n},i.prototype.setRotateWithView=function(n){this.rotateWithView_=n},i.prototype.setRotation=function(n){this.rotation_=n},i.prototype.setScale=function(n){this.scale_=n,this.scaleArray_=St(n)},i.prototype.listenImageChange=function(n){M()},i.prototype.load=function(){M()},i.prototype.unlistenImageChange=function(n){M()},i}(),ka=lh,hh=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,fh=/^([a-z]*)$|^hsla?\(.*\)$/i;function Xa(i){return typeof i=="string"?i:ja(i)}function ch(i){var n=document.createElement("div");if(n.style.color=i,n.style.color!==""){document.body.appendChild(n);var t=getComputedStyle(n).color;return document.body.removeChild(n),t}else return""}var dh=function(){var i=1024,n={},t=0;return function(e){var r;if(n.hasOwnProperty(e))r=n[e];else{if(t>=i){var o=0;for(var a in n)(o++&3)==0&&(delete n[a],--t)}r=ph(e),n[e]=r,++t}return r}}();function Nr(i){return Array.isArray(i)?i:dh(i)}function ph(i){var n,t,e,r,o;if(fh.exec(i)&&(i=ch(i)),hh.exec(i)){var a=i.length-1,s=void 0;a<=4?s=1:s=2;var u=a===4||a===8;n=parseInt(i.substr(1+0*s,s),16),t=parseInt(i.substr(1+1*s,s),16),e=parseInt(i.substr(1+2*s,s),16),u?r=parseInt(i.substr(1+3*s,s),16):r=255,s==1&&(n=(n<<4)+n,t=(t<<4)+t,e=(e<<4)+e,u&&(r=(r<<4)+r)),o=[n,t,e,r/255]}else i.indexOf("rgba(")==0?(o=i.slice(5,-1).split(",").map(Number),Ya(o)):i.indexOf("rgb(")==0?(o=i.slice(4,-1).split(",").map(Number),o.push(1),Ya(o)):W(!1,14);return o}function Ya(i){return i[0]=it(i[0]+.5|0,0,255),i[1]=it(i[1]+.5|0,0,255),i[2]=it(i[2]+.5|0,0,255),i[3]=it(i[3],0,1),i}function ja(i){var n=i[0];n!=(n|0)&&(n=n+.5|0);var t=i[1];t!=(t|0)&&(t=t+.5|0);var e=i[2];e!=(e|0)&&(e=e+.5|0);var r=i[3]===void 0?1:Math.round(i[3]*100)/100;return"rgba("+n+","+t+","+e+","+r+")"}function Zt(i){return Array.isArray(i)?ja(i):i}function Ft(i,n,t,e){var r;return t&&t.length?r=t.shift():yr?r=new OffscreenCanvas(i||300,n||300):r=document.createElement("canvas"),i&&(r.width=i),n&&(r.height=n),r.getContext("2d",e)}function vh(i){var n=i.offsetWidth,t=getComputedStyle(i);return n+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),n}function _h(i){var n=i.offsetHeight,t=getComputedStyle(i);return n+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),n}function Dr(i,n){var t=n.parentNode;t&&t.replaceChild(i,n)}function Gr(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function Ua(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function gh(i,n){for(var t=i.childNodes,e=0;;++e){var r=t[e],o=n[e];if(!r&&!o)break;if(r!==o){if(!r){i.appendChild(o);continue}if(!o){i.removeChild(r),--e;continue}i.insertBefore(o,r)}}}var kr="ol-hidden",yh="ol-selectable",je="ol-unselectable",Ba="ol-unsupported",jn="ol-control",Wa="ol-collapsed",mh=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"),Za=["style","variant","weight","size","lineHeight","family"],Ka=function(i){var n=i.match(mh);if(!n)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},e=0,r=Za.length;e<r;++e){var o=n[e+1];o!==void 0&&(t[Za[e]]=o)}return t.families=t.family.split(/,\s?/),t};function za(i){return i===1?"":String(Math.round(i*100)/100)}var Va="10px sans-serif",Jt="#000",Xr="round",Un=[],Bn=0,fn="round",Wn=10,Zn="#000",Kn="center",Yr="middle",Ue=[0,0,0,0],zn=1,Qt=new At,Eh=new rn;Eh.setSize=function(){console.warn("labelCache is deprecated.")};var cn=null,Xi,Yi={},Th=function(){var i=100,n="32px ",t=["monospace","serif"],e=t.length,r="wmytzilWMYTZIL@#/&?$%10\uF013",o,a;function s(l,h,c){for(var f=!0,d=0;d<e;++d){var p=t[d];if(a=jr(l+" "+h+" "+n+p,r),c!=p){var v=jr(l+" "+h+" "+n+c+","+p,r);f=f&&v!=a}}return!!f}function u(){for(var l=!0,h=Qt.getKeys(),c=0,f=h.length;c<f;++c){var d=h[c];Qt.get(d)<i&&(s.apply(this,d.split(`
`))?(Pn(Yi),cn=null,Xi=void 0,Qt.set(d,i)):(Qt.set(d,Qt.get(d)+1,!0),l=!1))}l&&(clearInterval(o),o=void 0)}return function(l){var h=Ka(l);if(!!h)for(var c=h.families,f=0,d=c.length;f<d;++f){var p=c[f],v=h.style+`
`+h.weight+`
`+p;Qt.get(v)===void 0&&(Qt.set(v,i,!0),s(h.style,h.weight,p)||(Qt.set(v,0,!0),o===void 0&&(o=setInterval(u,32))))}}}(),Ch=function(){var i;return function(n){var t=Yi[n];if(t==null){if(yr){var e=Ka(n),r=ba(n,"\u017Dg"),o=isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight);t=o*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=n,document.body.appendChild(i),t=i.offsetHeight,document.body.removeChild(i);Yi[n]=t}return t}}();function ba(i,n){return cn||(cn=Ft(1,1)),i!=Xi&&(cn.font=i,Xi=cn.font),cn.measureText(n)}function jr(i,n){return ba(i,n).width}function $a(i,n,t){if(n in t)return t[n];var e=jr(i,n);return t[n]=e,e}function xh(i,n){for(var t=[],e=[],r=[],o=0,a=0,s=0,u=0,l=0,h=n.length;l<=h;l+=2){var c=n[l];if(c===`
`||l===h){o=Math.max(o,a),r.push(a),a=0,s+=u;continue}var f=n[l+1]||i.font,d=jr(f,c);t.push(d),a+=d;var p=Ch(f);e.push(p),u=Math.max(u,p)}return{width:o,height:s,widths:t,heights:e,lineWidths:r}}function Oh(i,n,t,e,r,o,a,s,u,l,h){i.save(),t!==1&&(i.globalAlpha*=t),n&&i.setTransform.apply(i,n),e.contextInstructions?(i.translate(u,l),i.scale(h[0],h[1]),Rh(e,i)):h[0]<0||h[1]<0?(i.translate(u,l),i.scale(h[0],h[1]),i.drawImage(e,r,o,a,s,0,0,a,s)):i.drawImage(e,r,o,a,s,u,l,a*h[0],s*h[1]),i.restore()}function Rh(i,n){for(var t=i.contextInstructions,e=0,r=t.length;e<r;e+=2)Array.isArray(t[e+1])?n[t[e]].apply(n,t[e+1]):n[t[e]]=t[e+1]}var Ih=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),wh=function(i){Ih(n,i);function n(t){var e=this,r=t.rotateWithView!==void 0?t.rotateWithView:!1;return e=i.call(this,{opacity:1,rotateWithView:r,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0]})||this,e.canvas_=void 0,e.hitDetectionCanvas_=null,e.fill_=t.fill!==void 0?t.fill:null,e.origin_=[0,0],e.points_=t.points,e.radius_=t.radius!==void 0?t.radius:t.radius1,e.radius2_=t.radius2,e.angle_=t.angle!==void 0?t.angle:0,e.stroke_=t.stroke!==void 0?t.stroke:null,e.size_=null,e.renderOptions_=null,e.render(),e}return n.prototype.clone=function(){var t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return e.setOpacity(this.getOpacity()),e},n.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]]},n.prototype.getAngle=function(){return this.angle_},n.prototype.getFill=function(){return this.fill_},n.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},n.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var r=this.renderOptions_,o=Ft(r.size*t,r.size*t);this.draw_(r,o,t),e=o.canvas,this.canvas_[t]=e}return e},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.size_},n.prototype.getImageState=function(){return Q.LOADED},n.prototype.getOrigin=function(){return this.origin_},n.prototype.getPoints=function(){return this.points_},n.prototype.getRadius=function(){return this.radius_},n.prototype.getRadius2=function(){return this.radius2_},n.prototype.getSize=function(){return this.size_},n.prototype.getStroke=function(){return this.stroke_},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.calculateLineJoinSize_=function(t,e,r){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;var o=this.radius_,a=this.radius2_===void 0?o:this.radius2_;if(o<a){var s=o;o=a,a=s}var u=this.radius2_===void 0?this.points_:this.points_*2,l=2*Math.PI/u,h=a*Math.sin(l),c=Math.sqrt(a*a-h*h),f=o-c,d=Math.sqrt(h*h+f*f),p=d/h;if(t==="miter"&&p<=r)return p*e;var v=e/2/p,_=e/2*(f/d),m=Math.sqrt((o+v)*(o+v)+_*_),g=m-o;if(this.radius2_===void 0||t==="bevel")return g*2;var y=o*Math.sin(l),E=Math.sqrt(o*o-y*y),T=a-E,x=Math.sqrt(y*y+T*T),R=x/y;if(R<=r){var O=R*e/2-a-o;return 2*Math.max(g,O)}return g*2},n.prototype.createRenderOptions=function(){var t=fn,e=0,r=null,o=0,a,s=0;this.stroke_&&(a=this.stroke_.getColor(),a===null&&(a=Zn),a=Zt(a),s=this.stroke_.getWidth(),s===void 0&&(s=zn),r=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=fn),e=this.stroke_.getMiterLimit(),e===void 0&&(e=Wn));var u=this.calculateLineJoinSize_(t,s,e),l=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*l+u);return{strokeStyle:a,strokeWidth:s,size:h,lineDash:r,lineDashOffset:o,lineJoin:t,miterLimit:e}},n.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},n.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 o=this.fill_.getColor();o===null&&(o=Jt),e.fillStyle=Zt(o),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())},n.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),r=0;if(typeof e=="string"&&(e=Nr(e)),e===null?r=1:Array.isArray(e)&&(r=e.length===4?e[3]:1),r===0){var o=Ft(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},n.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 o=this.radius2_===void 0?r:this.radius2_;this.radius2_!==void 0&&(e*=2);for(var a=this.angle_-Math.PI/2,s=2*Math.PI/e,u=0;u<e;u++){var l=a+u*s,h=u%2==0?r:o;t.lineTo(h*Math.cos(l),h*Math.sin(l))}t.closePath()}},n.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Jt,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())},n}(ka),Sh=wh,Ph=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Lh=function(i){Ph(n,i);function n(t){var e=t||{};return i.call(this,{points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0]})||this}return n.prototype.clone=function(){var t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return e.setOpacity(this.getOpacity()),e},n.prototype.setRadius=function(t){this.radius_=t,this.render()},n}(Sh),Ah=Lh,Ha=function(){function i(n){var t=n||{};this.geometry_=null,this.geometryFunction_=qa,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}return i.prototype.clone=function(){var n=this.getGeometry();return n&&typeof n=="object"&&(n=n.clone()),new i({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},i.prototype.getRenderer=function(){return this.renderer_},i.prototype.setRenderer=function(n){this.renderer_=n},i.prototype.setHitDetectionRenderer=function(n){this.hitDetectionRenderer_=n},i.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},i.prototype.getGeometry=function(){return this.geometry_},i.prototype.getGeometryFunction=function(){return this.geometryFunction_},i.prototype.getFill=function(){return this.fill_},i.prototype.setFill=function(n){this.fill_=n},i.prototype.getImage=function(){return this.image_},i.prototype.setImage=function(n){this.image_=n},i.prototype.getStroke=function(){return this.stroke_},i.prototype.setStroke=function(n){this.stroke_=n},i.prototype.getText=function(){return this.text_},i.prototype.setText=function(n){this.text_=n},i.prototype.getZIndex=function(){return this.zIndex_},i.prototype.setGeometry=function(n){typeof n=="function"?this.geometryFunction_=n:typeof n=="string"?this.geometryFunction_=function(t){return t.get(n)}:n?n!==void 0&&(this.geometryFunction_=function(){return n}):this.geometryFunction_=qa,this.geometry_=n},i.prototype.setZIndex=function(n){this.zIndex_=n},i}();function Mh(i){var n;if(typeof i=="function")n=i;else{var t;if(Array.isArray(i))t=i;else{W(typeof i.getZIndex=="function",41);var e=i;t=[e]}n=function(){return t}}return n}var ji=null;function Fh(i,n){if(!ji){var t=new Fa({color:"rgba(255,255,255,0.4)"}),e=new sh({color:"#3399CC",width:1.25});ji=[new Ha({image:new Ah({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return ji}function qa(i){return i.getGeometry()}var Y_=Ha,Ja={POINT:"point",LINE:"line"},Nh="#333",Dh=function(){function i(n){var t=n||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=St(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Fa({color:Nh}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:Ja.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}return i.prototype.clone=function(){var n=this.getScale();return new i({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},i.prototype.getOverflow=function(){return this.overflow_},i.prototype.getFont=function(){return this.font_},i.prototype.getMaxAngle=function(){return this.maxAngle_},i.prototype.getPlacement=function(){return this.placement_},i.prototype.getOffsetX=function(){return this.offsetX_},i.prototype.getOffsetY=function(){return this.offsetY_},i.prototype.getFill=function(){return this.fill_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getStroke=function(){return this.stroke_},i.prototype.getText=function(){return this.text_},i.prototype.getTextAlign=function(){return this.textAlign_},i.prototype.getTextBaseline=function(){return this.textBaseline_},i.prototype.getBackgroundFill=function(){return this.backgroundFill_},i.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},i.prototype.getPadding=function(){return this.padding_},i.prototype.setOverflow=function(n){this.overflow_=n},i.prototype.setFont=function(n){this.font_=n},i.prototype.setMaxAngle=function(n){this.maxAngle_=n},i.prototype.setOffsetX=function(n){this.offsetX_=n},i.prototype.setOffsetY=function(n){this.offsetY_=n},i.prototype.setPlacement=function(n){this.placement_=n},i.prototype.setRotateWithView=function(n){this.rotateWithView_=n},i.prototype.setFill=function(n){this.fill_=n},i.prototype.setRotation=function(n){this.rotation_=n},i.prototype.setScale=function(n){this.scale_=n,this.scaleArray_=St(n!==void 0?n:1)},i.prototype.setStroke=function(n){this.stroke_=n},i.prototype.setText=function(n){this.text_=n},i.prototype.setTextAlign=function(n){this.textAlign_=n},i.prototype.setTextBaseline=function(n){this.textBaseline_=n},i.prototype.setBackgroundFill=function(n){this.backgroundFill_=n},i.prototype.setBackgroundStroke=function(n){this.backgroundStroke_=n},i.prototype.setPadding=function(n){this.padding_=n},i}(),j_=Dh,H={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"},Gh=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),kh=function(i){Gh(n,i);function n(t){var e=i.call(this)||this;e.on,e.once,e.un,e.background_=t.background;var r=ut({},t);return typeof t.properties=="object"&&(delete r.properties,ut(r,t.properties)),r[H.OPACITY]=t.opacity!==void 0?t.opacity:1,W(typeof r[H.OPACITY]=="number",64),r[H.VISIBLE]=t.visible!==void 0?t.visible:!0,r[H.Z_INDEX]=t.zIndex,r[H.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,r[H.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,r[H.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,r[H.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,e.className_=r.className!==void 0?r.className:"ol-layer",delete r.className,e.setProperties(r),e.state_=null,e}return n.prototype.getBackground=function(){return this.background_},n.prototype.getClassName=function(){return this.className_},n.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:t===void 0?!0:t},r=this.getZIndex();return e.opacity=it(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=r===void 0&&!e.managed?1/0:r,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},n.prototype.getLayersArray=function(t){return M()},n.prototype.getLayerStatesArray=function(t){return M()},n.prototype.getExtent=function(){return this.get(H.EXTENT)},n.prototype.getMaxResolution=function(){return this.get(H.MAX_RESOLUTION)},n.prototype.getMinResolution=function(){return this.get(H.MIN_RESOLUTION)},n.prototype.getMinZoom=function(){return this.get(H.MIN_ZOOM)},n.prototype.getMaxZoom=function(){return this.get(H.MAX_ZOOM)},n.prototype.getOpacity=function(){return this.get(H.OPACITY)},n.prototype.getSourceState=function(){return M()},n.prototype.getVisible=function(){return this.get(H.VISIBLE)},n.prototype.getZIndex=function(){return this.get(H.Z_INDEX)},n.prototype.setBackground=function(t){this.background_=t,this.changed()},n.prototype.setExtent=function(t){this.set(H.EXTENT,t)},n.prototype.setMaxResolution=function(t){this.set(H.MAX_RESOLUTION,t)},n.prototype.setMinResolution=function(t){this.set(H.MIN_RESOLUTION,t)},n.prototype.setMaxZoom=function(t){this.set(H.MAX_ZOOM,t)},n.prototype.setMinZoom=function(t){this.set(H.MIN_ZOOM,t)},n.prototype.setOpacity=function(t){W(typeof t=="number",64),this.set(H.OPACITY,t)},n.prototype.setVisible=function(t){this.set(H.VISIBLE,t)},n.prototype.setZIndex=function(t){this.set(H.Z_INDEX,t)},n.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),i.prototype.disposeInternal.call(this)},n}(At),Qa=kh,Be={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},Xh=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Yh=function(i){Xh(n,i);function n(t){var e=this,r=ut({},t);delete r.source,e=i.call(this,r)||this,e.on,e.once,e.un,e.mapPrecomposeKey_=null,e.mapRenderKey_=null,e.sourceChangeKey_=null,e.renderer_=null,e.rendered=!1,t.render&&(e.render=t.render),t.map&&e.setMap(t.map),e.addChangeListener(H.SOURCE,e.handleSourcePropertyChange_);var o=t.source?t.source:null;return e.setSource(o),e}return n.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},n.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},n.prototype.getSource=function(){return this.get(H.SOURCE)||null},n.prototype.getRenderSource=function(){return this.getSource()},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Be.UNDEFINED},n.prototype.handleSourceChange_=function(){this.changed()},n.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(q(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=B(t,F.CHANGE,this.handleSourceChange_,this)),this.changed()},n.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(e){return e([])})},n.prototype.getData=function(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)},n.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return this.rendered=!0,r.renderFrame(t,e)},n.prototype.unrender=function(){this.rendered=!1},n.prototype.setMapInternal=function(t){t||this.unrender(),this.set(H.MAP,t)},n.prototype.getMapInternal=function(){return this.get(H.MAP)},n.prototype.setMap=function(t){this.mapPrecomposeKey_&&(q(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(q(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=B(t,fe.PRECOMPOSE,function(e){var r=e,o=r.frameState.layerStatesArray,a=this.getLayerState(!1);W(!o.some(function(s){return s.layer===a.layer}),67),o.push(a)},this),this.mapRenderKey_=B(this,F.CHANGE,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(H.SOURCE,t)},n.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},n.prototype.hasRenderer=function(){return!!this.renderer_},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),i.prototype.disposeInternal.call(this)},n}(Qa);function Ur(i,n){if(!i.visible)return!1;var t=n.resolution;if(t<i.minResolution||t>=i.maxResolution)return!1;var e=n.zoom;return e>i.minZoom&&e<=i.maxZoom}var Br=Yh;function jh(i,n,t,e,r){ts(i,n,t||0,e||i.length-1,r||Uh)}function ts(i,n,t,e,r){for(;e>t;){if(e-t>600){var o=e-t+1,a=n-t+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1),h=Math.max(t,Math.floor(n-a*u/o+l)),c=Math.min(e,Math.floor(n+(o-a)*u/o+l));ts(i,n,h,c,r)}var f=i[n],d=t,p=e;for(Vn(i,t,n),r(i[e],f)>0&&Vn(i,t,e);d<p;){for(Vn(i,d,p),d++,p--;r(i[d],f)<0;)d++;for(;r(i[p],f)>0;)p--}r(i[t],f)===0?Vn(i,t,p):(p++,Vn(i,p,e)),p<=n&&(t=p+1),n<=p&&(e=p-1)}}function Vn(i,n,t){var e=i[n];i[n]=i[t],i[t]=e}function Uh(i,n){return i<n?-1:i>n?1:0}class es{constructor(n=9){this._maxEntries=Math.max(4,n),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(n){let t=this.data;const e=[];if(!Zr(n,t))return e;const r=this.toBBox,o=[];for(;t;){for(let a=0;a<t.children.length;a++){const s=t.children[a],u=t.leaf?r(s):s;Zr(n,u)&&(t.leaf?e.push(s):Bi(n,u)?this._all(s,e):o.push(s))}t=o.pop()}return e}collides(n){let t=this.data;if(!Zr(n,t))return!1;const e=[];for(;t;){for(let r=0;r<t.children.length;r++){const o=t.children[r],a=t.leaf?this.toBBox(o):o;if(Zr(n,a)){if(t.leaf||Bi(n,a))return!0;e.push(o)}}t=e.pop()}return!1}load(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(let e=0;e<n.length;e++)this.insert(n[e]);return this}let t=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(n){return n&&this._insert(n,this.data.height-1),this}clear(){return this.data=pn([]),this}remove(n,t){if(!n)return this;let e=this.data;const r=this.toBBox(n),o=[],a=[];let s,u,l;for(;e||o.length;){if(e||(e=o.pop(),u=o[o.length-1],s=a.pop(),l=!0),e.leaf){const h=Bh(n,e.children,t);if(h!==-1)return e.children.splice(h,1),o.push(e),this._condense(o),this}!l&&!e.leaf&&Bi(e,r)?(o.push(e),a.push(s),s=0,u=e,e=e.children[0]):u?(s++,e=u.children[s],l=!1):e=null}return this}toBBox(n){return n}compareMinX(n,t){return n.minX-t.minX}compareMinY(n,t){return n.minY-t.minY}toJSON(){return this.data}fromJSON(n){return this.data=n,this}_all(n,t){const e=[];for(;n;)n.leaf?t.push(...n.children):e.push(...n.children),n=e.pop();return t}_build(n,t,e,r){const o=e-t+1;let a=this._maxEntries,s;if(o<=a)return s=pn(n.slice(t,e+1)),dn(s,this.toBBox),s;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),s=pn([]),s.leaf=!1,s.height=r;const u=Math.ceil(o/a),l=u*Math.ceil(Math.sqrt(a));ns(n,t,e,l,this.compareMinX);for(let h=t;h<=e;h+=l){const c=Math.min(h+l-1,e);ns(n,h,c,u,this.compareMinY);for(let f=h;f<=c;f+=u){const d=Math.min(f+u-1,c);s.children.push(this._build(n,f,d,r-1))}}return dn(s,this.toBBox),s}_chooseSubtree(n,t,e,r){for(;r.push(t),!(t.leaf||r.length-1===e);){let o=1/0,a=1/0,s;for(let u=0;u<t.children.length;u++){const l=t.children[u],h=Ui(l),c=Kh(n,l)-h;c<a?(a=c,o=h<o?h:o,s=l):c===a&&h<o&&(o=h,s=l)}t=s||t.children[0]}return t}_insert(n,t,e){const r=e?n:this.toBBox(n),o=[],a=this._chooseSubtree(r,this.data,t,o);for(a.children.push(n),$n(a,r);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(r,o,t)}_split(n,t){const e=n[t],r=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,r);const a=this._chooseSplitIndex(e,o,r),s=pn(e.children.splice(a,e.children.length-a));s.height=e.height,s.leaf=e.leaf,dn(e,this.toBBox),dn(s,this.toBBox),t?n[t-1].children.push(s):this._splitRoot(e,s)}_splitRoot(n,t){this.data=pn([n,t]),this.data.height=n.height+1,this.data.leaf=!1,dn(this.data,this.toBBox)}_chooseSplitIndex(n,t,e){let r,o=1/0,a=1/0;for(let s=t;s<=e-t;s++){const u=bn(n,0,s,this.toBBox),l=bn(n,s,e,this.toBBox),h=zh(u,l),c=Ui(u)+Ui(l);h<o?(o=h,r=s,a=c<a?c:a):h===o&&c<a&&(a=c,r=s)}return r||e-t}_chooseSplitAxis(n,t,e){const r=n.leaf?this.compareMinX:Wh,o=n.leaf?this.compareMinY:Zh,a=this._allDistMargin(n,t,e,r),s=this._allDistMargin(n,t,e,o);a<s&&n.children.sort(r)}_allDistMargin(n,t,e,r){n.children.sort(r);const o=this.toBBox,a=bn(n,0,t,o),s=bn(n,e-t,e,o);let u=Wr(a)+Wr(s);for(let l=t;l<e-t;l++){const h=n.children[l];$n(a,n.leaf?o(h):h),u+=Wr(a)}for(let l=e-t-1;l>=t;l--){const h=n.children[l];$n(s,n.leaf?o(h):h),u+=Wr(s)}return u}_adjustParentBBoxes(n,t,e){for(let r=e;r>=0;r--)$n(t[r],n)}_condense(n){for(let t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():dn(n[t],this.toBBox)}}function Bh(i,n,t){if(!t)return n.indexOf(i);for(let e=0;e<n.length;e++)if(t(i,n[e]))return e;return-1}function dn(i,n){bn(i,0,i.children.length,n,i)}function bn(i,n,t,e,r){r||(r=pn(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=n;o<t;o++){const a=i.children[o];$n(r,i.leaf?e(a):a)}return r}function $n(i,n){return i.minX=Math.min(i.minX,n.minX),i.minY=Math.min(i.minY,n.minY),i.maxX=Math.max(i.maxX,n.maxX),i.maxY=Math.max(i.maxY,n.maxY),i}function Wh(i,n){return i.minX-n.minX}function Zh(i,n){return i.minY-n.minY}function Ui(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function Wr(i){return i.maxX-i.minX+(i.maxY-i.minY)}function Kh(i,n){return(Math.max(n.maxX,i.maxX)-Math.min(n.minX,i.minX))*(Math.max(n.maxY,i.maxY)-Math.min(n.minY,i.minY))}function zh(i,n){const t=Math.max(i.minX,n.minX),e=Math.max(i.minY,n.minY),r=Math.min(i.maxX,n.maxX),o=Math.min(i.maxY,n.maxY);return Math.max(0,r-t)*Math.max(0,o-e)}function Bi(i,n){return i.minX<=n.minX&&i.minY<=n.minY&&n.maxX<=i.maxX&&n.maxY<=i.maxY}function Zr(i,n){return n.minX<=i.maxX&&n.minY<=i.maxY&&n.maxX>=i.minX&&n.maxY>=i.minY}function pn(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ns(i,n,t,e,r){const o=[n,t];for(;o.length;){if(t=o.pop(),n=o.pop(),t-n<=e)continue;const a=n+Math.ceil((t-n)/e/2)*e;jh(i,a,n,t,r),o.push(n,a,a,t)}}var Vh=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rs={RENDER_ORDER:"renderOrder"},bh=function(i){Vh(n,i);function n(t){var e=this,r=t||{},o=ut({},r);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,e=i.call(this,o)||this,e.declutter_=r.declutter!==void 0?r.declutter:!1,e.renderBuffer_=r.renderBuffer!==void 0?r.renderBuffer:100,e.style_=null,e.styleFunction_=void 0,e.setStyle(r.style),e.updateWhileAnimating_=r.updateWhileAnimating!==void 0?r.updateWhileAnimating:!1,e.updateWhileInteracting_=r.updateWhileInteracting!==void 0?r.updateWhileInteracting:!1,e}return n.prototype.getDeclutter=function(){return this.declutter_},n.prototype.getFeatures=function(t){return i.prototype.getFeatures.call(this,t)},n.prototype.getRenderBuffer=function(){return this.renderBuffer_},n.prototype.getRenderOrder=function(){return this.get(rs.RENDER_ORDER)},n.prototype.getStyle=function(){return this.style_},n.prototype.getStyleFunction=function(){return this.styleFunction_},n.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},n.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new es(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(rs.RENDER_ORDER,t)},n.prototype.setStyle=function(t){this.style_=t!==void 0?t:Fh,this.styleFunction_=t===null?void 0:Mh(this.style_),this.changed()},n}(Br),$h=bh,Hn={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},Kr=[Hn.FILL],ce=[Hn.STROKE],We=[Hn.BEGIN_PATH],is=[Hn.CLOSE_PATH],N=Hn,Hh=function(){function i(){}return i.prototype.drawCustom=function(n,t,e,r){},i.prototype.drawGeometry=function(n){},i.prototype.setStyle=function(n){},i.prototype.drawCircle=function(n,t){},i.prototype.drawFeature=function(n,t){},i.prototype.drawGeometryCollection=function(n,t){},i.prototype.drawLineString=function(n,t){},i.prototype.drawMultiLineString=function(n,t){},i.prototype.drawMultiPoint=function(n,t){},i.prototype.drawMultiPolygon=function(n,t){},i.prototype.drawPoint=function(n,t){},i.prototype.drawPolygon=function(n,t){},i.prototype.drawText=function(n,t){},i.prototype.setFillStrokeStyle=function(n,t){},i.prototype.setImageStyle=function(n,t){},i.prototype.setTextStyle=function(n,t){},i}(),os=Hh,qh=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Jh=function(i){qh(n,i);function n(t,e,r,o){var a=i.call(this)||this;return a.tolerance=t,a.maxExtent=e,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=r,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return n.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return e==1?t:t.map(function(r){return r*e})},n.prototype.appendFlatPointCoordinates=function(t,e){for(var r=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,u=0,l=t.length;u<l;u+=e)o[0]=t[u],o[1]=t[u+1],Mn(r,o)&&(a[s++]=o[0],a[s++]=o[1]);return s},n.prototype.appendFlatLineCoordinates=function(t,e,r,o,a,s){var u=this.coordinates,l=u.length,h=this.getBufferedMaxExtent();s&&(e+=o);var c=t[e],f=t[e+1],d=this.tmpCoordinate_,p=!0,v,_,m;for(v=e+o;v<r;v+=o)d[0]=t[v],d[1]=t[v+1],m=_i(h,d),m!==_?(p&&(u[l++]=c,u[l++]=f,p=!1),u[l++]=d[0],u[l++]=d[1]):m===dt.INTERSECTING?(u[l++]=d[0],u[l++]=d[1],p=!1):p=!0,c=d[0],f=d[1],_=m;return(a&&p||v===e+o)&&(u[l++]=c,u[l++]=f),l},n.prototype.drawCustomCoordinates_=function(t,e,r,o,a){for(var s=0,u=r.length;s<u;++s){var l=r[s],h=this.appendFlatLineCoordinates(t,e,l,o,!1,!1);a.push(h),e=l}return e},n.prototype.drawCustom=function(t,e,r,o){this.beginGeometry(t,e);var a=t.getType(),s=t.getStride(),u=this.coordinates.length,l,h,c,f,d;switch(a){case w.MULTI_POLYGON:l=t.getOrientedFlatCoordinates(),f=[];var p=t.getEndss();d=0;for(var v=0,_=p.length;v<_;++v){var m=[];d=this.drawCustomCoordinates_(l,d,p[v],s,m),f.push(m)}this.instructions.push([N.CUSTOM,u,f,t,r,Fi]),this.hitDetectionInstructions.push([N.CUSTOM,u,f,t,o||r,Fi]);break;case w.POLYGON:case w.MULTI_LINE_STRING:c=[],l=a==w.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(l,0,t.getEnds(),s,c),this.instructions.push([N.CUSTOM,u,c,t,r,Yn]),this.hitDetectionInstructions.push([N.CUSTOM,u,c,t,o||r,Yn]);break;case w.LINE_STRING:case w.CIRCLE:l=t.getFlatCoordinates(),h=this.appendFlatLineCoordinates(l,0,l.length,s,!1,!1),this.instructions.push([N.CUSTOM,u,h,t,r,he]),this.hitDetectionInstructions.push([N.CUSTOM,u,h,t,o||r,he]);break;case w.MULTI_POINT:l=t.getFlatCoordinates(),h=this.appendFlatPointCoordinates(l,s),h>u&&(this.instructions.push([N.CUSTOM,u,h,t,r,he]),this.hitDetectionInstructions.push([N.CUSTOM,u,h,t,o||r,he]));break;case w.POINT:l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),h=this.coordinates.length,this.instructions.push([N.CUSTOM,u,h,t,r]),this.hitDetectionInstructions.push([N.CUSTOM,u,h,t,o||r]);break}this.endGeometry(e)},n.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[N.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[N.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var e,r=t.length,o,a,s=-1;for(e=0;e<r;++e)o=t[e],a=o[0],a==N.END_GEOMETRY?s=e:a==N.BEGIN_GEOMETRY&&(o[2]=e,wu(this.hitDetectionInstructions,s,e),s=-1)},n.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var o=t.getColor();r.fillStyle=Zt(o||Jt)}else r.fillStyle=void 0;if(e){var a=e.getColor();r.strokeStyle=Zt(a||Zn);var s=e.getLineCap();r.lineCap=s!==void 0?s:Xr;var u=e.getLineDash();r.lineDash=u?u.slice():Un;var l=e.getLineDashOffset();r.lineDashOffset=l||Bn;var h=e.getLineJoin();r.lineJoin=h!==void 0?h:fn;var c=e.getWidth();r.lineWidth=c!==void 0?c:zn;var f=e.getMiterLimit();r.miterLimit=f!==void 0?f:Wn,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},n.prototype.createFill=function(t){var e=t.fillStyle,r=[N.SET_FILL_STYLE,e];return typeof e!="string"&&r.push(!0),r},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[N.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;(typeof r!="string"||t.currentFillStyle!=r)&&(r!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},n.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,o=t.lineCap,a=t.lineDash,s=t.lineDashOffset,u=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=o||a!=t.currentLineDash&&!Ie(t.currentLineDash,a)||t.currentLineDashOffset!=s||t.currentLineJoin!=u||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(r!==void 0&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=o,t.currentLineDash=a,t.currentLineDashOffset=s,t.currentLineJoin=u,t.currentLineWidth=l,t.currentMiterLimit=h)},n.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[N.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},n.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ho(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;mr(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},n}(os),qn=Jh,Qh=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),tf=function(i){Qh(n,i);function n(t,e,r,o){var a=i.call(this,t,e,r,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterImageWithText_=void 0,a}return n.prototype.drawPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(r,o);this.instructions.push([N.DRAW_IMAGE,a,s,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([N.DRAW_IMAGE,a,s,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)}},n.prototype.drawMultiPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(r,o);this.instructions.push([N.DRAW_IMAGE,a,s,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([N.DRAW_IMAGE,a,s,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)}},n.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,i.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),o=t.getSize(),a=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),u=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=a,this.image_=s,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=u[0]*this.imagePixelRatio_,this.originY_=u[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},n}(qn),ef=tf,nf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rf=function(i){nf(n,i);function n(t,e,r,o){return i.call(this,t,e,r,o)||this}return n.prototype.drawFlatCoordinates_=function(t,e,r,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(t,e,r,o,!1,!1),u=[N.MOVE_TO_LINE_TO,a,s];return this.instructions.push(u),this.hitDetectionInstructions.push(u),r},n.prototype.drawLineString=function(t,e){var r=this.state,o=r.strokeStyle,a=r.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Un,Bn],We);var s=t.getFlatCoordinates(),u=t.getStride();this.drawFlatCoordinates_(s,0,s.length,u),this.hitDetectionInstructions.push(ce),this.endGeometry(e)}},n.prototype.drawMultiLineString=function(t,e){var r=this.state,o=r.strokeStyle,a=r.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],We);for(var s=t.getEnds(),u=t.getFlatCoordinates(),l=t.getStride(),h=0,c=0,f=s.length;c<f;++c)h=this.drawFlatCoordinates_(u,h,s[c],l);this.hitDetectionInstructions.push(ce),this.endGeometry(e)}},n.prototype.finish=function(){var t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(ce),this.reverseHitDetectionInstructions(),this.state=null,i.prototype.finish.call(this)},n.prototype.applyStroke=function(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ce),t.lastStroke=this.coordinates.length),t.lastStroke=0,i.prototype.applyStroke.call(this,t),this.instructions.push(We)},n}(qn),of=rf,af=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sf=function(i){af(n,i);function n(t,e,r,o){return i.call(this,t,e,r,o)||this}return n.prototype.drawFlatCoordinatess_=function(t,e,r,o){var a=this.state,s=a.fillStyle!==void 0,u=a.strokeStyle!==void 0,l=r.length;this.instructions.push(We),this.hitDetectionInstructions.push(We);for(var h=0;h<l;++h){var c=r[h],f=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,c,o,!0,!u),p=[N.MOVE_TO_LINE_TO,f,d];this.instructions.push(p),this.hitDetectionInstructions.push(p),u&&(this.instructions.push(is),this.hitDetectionInstructions.push(is)),e=c}return s&&(this.instructions.push(Kr),this.hitDetectionInstructions.push(Kr)),u&&(this.instructions.push(ce),this.hitDetectionInstructions.push(ce)),e},n.prototype.drawCircle=function(t,e){var r=this.state,o=r.fillStyle,a=r.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,e),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_FILL_STYLE,Jt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var s=t.getFlatCoordinates(),u=t.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,u,!1,!1);var h=[N.CIRCLE,l];this.instructions.push(We,h),this.hitDetectionInstructions.push(We,h),r.fillStyle!==void 0&&(this.instructions.push(Kr),this.hitDetectionInstructions.push(Kr)),r.strokeStyle!==void 0&&(this.instructions.push(ce),this.hitDetectionInstructions.push(ce)),this.endGeometry(e)}},n.prototype.drawPolygon=function(t,e){var r=this.state,o=r.fillStyle,a=r.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,e),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_FILL_STYLE,Jt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var s=t.getEnds(),u=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(u,0,s,l),this.endGeometry(e)}},n.prototype.drawMultiPolygon=function(t,e){var r=this.state,o=r.fillStyle,a=r.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,e),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_FILL_STYLE,Jt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var s=t.getEndss(),u=t.getOrientedFlatCoordinates(),l=t.getStride(),h=0,c=0,f=s.length;c<f;++c)h=this.drawFlatCoordinatess_(u,h,s[c],l);this.endGeometry(e)}},n.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(t!==0)for(var e=this.coordinates,r=0,o=e.length;r<o;++r)e[r]=Xe(e[r],t);return i.prototype.finish.call(this)},n.prototype.setFillStrokeStyles_=function(){var t=this.state,e=t.fillStyle;e!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)},n}(qn),as=sf;function uf(i,n,t,e,r){var o=t,a=t,s=0,u=0,l=t,h,c,f,d,p,v,_,m,g,y;for(c=t;c<e;c+=r){var E=n[c],T=n[c+1];p!==void 0&&(g=E-p,y=T-v,d=Math.sqrt(g*g+y*y),_!==void 0&&(u+=f,h=Math.acos((_*g+m*y)/(f*d)),h>i&&(u>s&&(s=u,o=l,a=c),u=0,l=c-r)),f=d,_=g,m=y),p=E,v=T}return u+=d,u>s?[l,c]:[o,a]}var lf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),zr={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},hf=function(i){lf(n,i);function n(t,e,r,o){var a=i.call(this,t,e,r,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return n.prototype.finish=function(){var t=i.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},n.prototype.drawText=function(t,e){var r=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!r&&!o)){var s=this.coordinates,u=s.length,l=t.getType(),h=null,c=t.getStride();if(a.placement===Ja.LINE&&(l==w.LINE_STRING||l==w.MULTI_LINE_STRING||l==w.POLYGON||l==w.MULTI_POLYGON)){if(!xt(this.getBufferedMaxExtent(),t.getExtent()))return;var f=void 0;if(h=t.getFlatCoordinates(),l==w.LINE_STRING)f=[h.length];else if(l==w.MULTI_LINE_STRING)f=t.getEnds();else if(l==w.POLYGON)f=t.getEnds().slice(0,1);else if(l==w.MULTI_POLYGON){var d=t.getEndss();f=[];for(var p=0,v=d.length;p<v;++p)f.push(d[p][0])}this.beginGeometry(t,e);for(var _=a.textAlign,m=0,g=void 0,y=0,E=f.length;y<E;++y){if(_==null){var T=uf(a.maxAngle,h,m,f[y],c);m=T[0],g=T[1]}else g=f[y];for(var p=m;p<g;p+=c)s.push(h[p],h[p+1]);var x=s.length;m=f[y],this.drawChars_(u,x),u=x}this.endGeometry(e)}else{var R=a.overflow?null:[];switch(l){case w.POINT:case w.MULTI_POINT:h=t.getFlatCoordinates();break;case w.LINE_STRING:h=t.getFlatMidpoint();break;case w.CIRCLE:h=t.getCenter();break;case w.MULTI_LINE_STRING:h=t.getFlatMidpoints(),c=2;break;case w.POLYGON:h=t.getFlatInteriorPoint(),a.overflow||R.push(h[2]/this.resolution),c=3;break;case w.MULTI_POLYGON:var O=t.getFlatInteriorPoints();h=[];for(var p=0,v=O.length;p<v;p+=3)a.overflow||R.push(O[p+2]/this.resolution),h.push(O[p],O[p+1]);if(h.length===0)return;c=2;break}var x=this.appendFlatPointCoordinates(h,c);if(x===u)return;if(R&&(x-u)/2!=h.length/c){var I=u/2;R=R.filter(function(K,Z){var V=s[(I+Z)*2]===h[Z*c]&&s[(I+Z)*2+1]===h[Z*c+1];return V||--I,V})}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var A=a.padding;if(A!=Ue&&(a.scale[0]<0||a.scale[1]<0)){var k=a.padding[0],P=a.padding[1],X=a.padding[2],U=a.padding[3];a.scale[0]<0&&(P=-P,U=-U),a.scale[1]<0&&(k=-k,X=-X),A=[k,P,X,U]}var L=this.pixelRatio;this.instructions.push([N.DRAW_IMAGE,u,x,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,A==Ue?Ue:A.map(function(K){return K*L}),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,R]);var G=1/L;this.hitDetectionInstructions.push([N.DRAW_IMAGE,u,x,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[G,G],NaN,this.declutterImageWithText_,A,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,R]),this.endGeometry(e)}}},n.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var a=this.textKey_;a in this.textStates||(this.textStates[a]={font:e.font,textAlign:e.textAlign||Kn,textBaseline:e.textBaseline||Yr,scale:e.scale});var s=this.fillKey_;r&&(s in this.fillStates||(this.fillStates[s]={fillStyle:r.fillStyle}))},n.prototype.drawChars_=function(t,e){var r=this.textStrokeState_,o=this.textState_,a=this.strokeKey_,s=this.textKey_,u=this.fillKey_;this.saveTextStates_();var l=this.pixelRatio,h=zr[o.textBaseline],c=this.textOffsetY_*l,f=this.text_,d=r?r.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([N.DRAW_CHARS,t,e,h,o.overflow,u,o.maxAngle,l,c,a,d*l,f,s,1]),this.hitDetectionInstructions.push([N.DRAW_CHARS,t,e,h,o.overflow,u,o.maxAngle,1,c,a,d,f,s,1/l])},n.prototype.setTextStyle=function(t,e){var r,o,a;if(!t)this.text_="";else{var s=t.getFill();s?(o=this.textFillState_,o||(o={},this.textFillState_=o),o.fillStyle=Zt(s.getColor()||Jt)):(o=null,this.textFillState_=o);var u=t.getStroke();if(!u)a=null,this.textStrokeState_=a;else{a=this.textStrokeState_,a||(a={},this.textStrokeState_=a);var l=u.getLineDash(),h=u.getLineDashOffset(),c=u.getWidth(),f=u.getMiterLimit();a.lineCap=u.getLineCap()||Xr,a.lineDash=l?l.slice():Un,a.lineDashOffset=h===void 0?Bn:h,a.lineJoin=u.getLineJoin()||fn,a.lineWidth=c===void 0?zn:c,a.miterLimit=f===void 0?Wn:f,a.strokeStyle=Zt(u.getColor()||Zn)}r=this.textState_;var d=t.getFont()||Va;Th(d);var p=t.getScaleArray();r.overflow=t.getOverflow(),r.font=d,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||Yr,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Ue,r.scale=p===void 0?[1,1]:p;var v=t.getOffsetX(),_=t.getOffsetY(),m=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=v===void 0?0:v,this.textOffsetY_=_===void 0?0:_,this.textRotateWithView_=m===void 0?!1:m,this.textRotation_=g===void 0?0:g,this.strokeKey_=a?(typeof a.strokeStyle=="string"?a.strokeStyle:b(a.strokeStyle))+a.lineCap+a.lineDashOffset+"|"+a.lineWidth+a.lineJoin+a.miterLimit+"["+a.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=o?typeof o.fillStyle=="string"?o.fillStyle:"|"+b(o.fillStyle):""}this.declutterImageWithText_=e},n}(qn),ff=hf,cf={Circle:as,Default:qn,Image:ef,LineString:of,Polygon:as,Text:ff},df=function(){function i(n,t,e,r){this.tolerance_=n,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=e,this.buildersByZIndex_={}}return i.prototype.finish=function(){var n={};for(var t in this.buildersByZIndex_){n[t]=n[t]||{};var e=this.buildersByZIndex_[t];for(var r in e){var o=e[r].finish();n[t][r]=o}}return n},i.prototype.getBuilder=function(n,t){var e=n!==void 0?n.toString():"0",r=this.buildersByZIndex_[e];r===void 0&&(r={},this.buildersByZIndex_[e]=r);var o=r[t];if(o===void 0){var a=cf[t];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=o}return o},i}(),ss=df,pf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),vf=function(i){pf(n,i);function n(t){var e=i.call(this)||this;return e.ready=!0,e.boundHandleImageChange_=e.handleImageChange_.bind(e),e.layer_=t,e.declutterExecutorGroup=null,e}return n.prototype.getFeatures=function(t){return M()},n.prototype.getData=function(t){return null},n.prototype.prepareFrame=function(t){return M()},n.prototype.renderFrame=function(t,e){return M()},n.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},n.prototype.createLoadedTileFinder=function(t,e,r){return function(o,a){var s=this.loadedTileCallback.bind(this,r,o);return t.forEachLoadedTile(e,o,a,s)}.bind(this)},n.prototype.forEachFeatureAtCoordinate=function(t,e,r,o,a){},n.prototype.getDataAtPixel=function(t,e,r){return null},n.prototype.getLayer=function(){return this.layer_},n.prototype.handleFontsChanged=function(){},n.prototype.handleImageChange_=function(t){var e=t.target;e.getState()===Q.LOADED&&this.renderIfReadyAndVisible()},n.prototype.loadImage=function(t){var e=t.getState();return e!=Q.LOADED&&e!=Q.ERROR&&t.addEventListener(F.CHANGE,this.boundHandleImageChange_),e==Q.IDLE&&(t.load(),e=t.getState()),e==Q.LOADED},n.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Be.READY&&t.changed()},n.prototype.disposeInternal=function(){delete this.layer_,i.prototype.disposeInternal.call(this)},n}(Yo),_f=vf,gf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yf=function(i){gf(n,i);function n(t,e,r,o){var a=i.call(this,t)||this;return a.inversePixelTransform=e,a.frameState=r,a.context=o,a}return n}(Ut),us=yf,mf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Jn=null;function Ef(){var i=document.createElement("canvas");i.width=1,i.height=1,Jn=i.getContext("2d")}var Tf=function(i){mf(n,i);function n(t){var e=i.call(this,t)||this;return e.container=null,e.renderedResolution,e.tempTransform=Wt(),e.pixelTransform=Wt(),e.inversePixelTransform=Wt(),e.context=null,e.containerReused=!1,e.pixelContext_=null,e.frameState=null,e}return n.prototype.getImageData=function(t,e,r){Jn||Ef(),Jn.clearRect(0,0,1,1);var o;try{Jn.drawImage(t,e,r,1,1,0,0,1,1),o=Jn.getImageData(0,0,1,1).data}catch(a){return null}return o},n.prototype.getBackground=function(t){var e=this.getLayer(),r=e.getBackground();return typeof r=="function"&&(r=r(t.viewState.resolution)),r||void 0},n.prototype.useContainer=function(t,e,r,o){var a=this.getLayer().getClassName(),s,u;if(t&&t.className===a&&t.style.opacity===""&&r===1&&(!o||t.style.backgroundColor&&Ie(Nr(t.style.backgroundColor),Nr(o)))){var l=t.firstElementChild;l instanceof HTMLCanvasElement&&(u=l.getContext("2d"))}if(u&&u.canvas.style.transform===e?(this.container=t,this.context=u,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){s=document.createElement("div"),s.className=a;var h=s.style;h.position="absolute",h.width="100%",h.height="100%",o&&(h.backgroundColor=o),u=Ft();var l=u.canvas;s.appendChild(l),h=l.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=s,this.context=u}},n.prototype.clipUnrotated=function(t,e,r){var o=Le(r),a=Cr(r),s=Tr(r),u=Er(r);at(e.coordinateToPixelTransform,o),at(e.coordinateToPixelTransform,a),at(e.coordinateToPixelTransform,s),at(e.coordinateToPixelTransform,u);var l=this.inversePixelTransform;at(l,o),at(l,a),at(l,s),at(l,u),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(u[0]),Math.round(u[1])),t.clip()},n.prototype.dispatchRenderEvent_=function(t,e,r){var o=this.getLayer();if(o.hasListener(t)){var a=new us(t,this.inversePixelTransform,r,e);o.dispatchEvent(a)}},n.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(fe.PRERENDER,t,e)},n.prototype.postRender=function(t,e){this.dispatchRenderEvent_(fe.POSTRENDER,t,e)},n.prototype.getRenderTransform=function(t,e,r,o,a,s,u){var l=a/2,h=s/2,c=o/e,f=-c,d=-t[0]+u,p=-t[1];return bt(this.tempTransform,l,h,c,f,-r,d,p)},n.prototype.getDataAtPixel=function(t,e,r){var o=at(this.inversePixelTransform,t.slice()),a=this.context,s=this.getLayer(),u=s.getExtent();if(u){var l=at(e.pixelToCoordinateTransform,t.slice());if(!Mn(u,l))return null}var h=Math.round(o[0]),c=Math.round(o[1]),f=this.pixelContext_;if(!f){var d=document.createElement("canvas");d.width=1,d.height=1,f=d.getContext("2d"),this.pixelContext_=f}f.clearRect(0,0,1,1);var p;try{f.drawImage(a.canvas,h,c,1,1,0,0,1,1),p=f.getImageData(0,0,1,1).data}catch(v){return v.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):p}return p[3]===0?null:p},n.prototype.disposeInternal=function(){delete this.frameState,i.prototype.disposeInternal.call(this)},n}(_f),ls=Tf,nt={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function Cf(i,n,t,e,r,o,a,s,u,l,h,c){var f=i[n],d=i[n+1],p=0,v=0,_=0,m=0;function g(){p=f,v=d,n+=e,f=i[n],d=i[n+1],m+=_,_=Math.sqrt((f-p)*(f-p)+(d-v)*(d-v))}do g();while(n<t-e&&m+_<o);for(var y=_===0?0:(o-m)/_,E=Ht(p,f,y),T=Ht(v,d,y),x=n-e,R=m,O=o+s*u(l,r,h);n<t-e&&m+_<O;)g();y=_===0?0:(O-m)/_;var I=Ht(p,f,y),A=Ht(v,d,y),k;if(c){var P=[E,T,I,A];_a(P,0,4,2,c,P,P),k=P[0]>P[2]}else k=E>I;var X=Math.PI,U=[],L=x+e===n;n=x,_=0,m=R,f=i[n],d=i[n+1];var G;if(L){g(),G=Math.atan2(d-v,f-p),k&&(G+=G>0?-X:X);var S=(I+E)/2,K=(A+T)/2;return U[0]=[S,K,(O-o)/2,G,r],U}for(var Z=0,V=r.length;Z<V;){g();var J=Math.atan2(d-v,f-p);if(k&&(J+=J>0?-X:X),G!==void 0){var C=J-G;if(C+=C>X?-2*X:C<-X?2*X:0,Math.abs(C)>a)return null}G=J;for(var st=Z,Y=0;Z<V;++Z){var ht=k?V-Z-1:Z,Ot=s*u(l,r[ht],h);if(n+e<t&&m+_<o+Y+Ot/2)break;Y+=Ot}if(Z!==st){var Rt=k?r.substring(V-st,V-Z):r.substring(st,Z);y=_===0?0:(o+Y/2-m)/_;var S=Ht(p,f,y),K=Ht(v,d,y);U.push([S,K,Y/2,J,Rt]),o+=Y}}return U}var vn=wt(),de=[],te=[],ee=[],pe=[];function hs(i){return i[3].declutterBox}var xf=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 fs(i,n){return(n==="start"||n==="end")&&!xf.test(i)&&(n=n==="start"?"left":"right"),zr[n]}function Of(i,n,t){return t>0&&i.push(`
`,""),i.push(n,""),i}var Rf=function(){function i(n,t,e,r){this.overlaps=e,this.pixelRatio=t,this.resolution=n,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Wt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return i.prototype.createLabel=function(n,t,e,r){var o=n+t+e+r;if(this.labels_[o])return this.labels_[o];var a=r?this.strokeStates[r]:null,s=e?this.fillStates[e]:null,u=this.textStates[t],l=this.pixelRatio,h=[u.scale[0]*l,u.scale[1]*l],c=Array.isArray(n),f=fs(c?n[0]:n,u.textAlign||Kn),d=r&&a.lineWidth?a.lineWidth:0,p=c?n:n.split(`
`).reduce(Of,[]),v=xh(u,p),_=v.width,m=v.height,g=v.widths,y=v.heights,E=v.lineWidths,T=_+d,x=[],R=(T+2)*h[0],O=(m+d)*h[1],I={width:R<0?Math.floor(R):Math.ceil(R),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:x};if((h[0]!=1||h[1]!=1)&&x.push("scale",h),r){x.push("strokeStyle",a.strokeStyle),x.push("lineWidth",d),x.push("lineCap",a.lineCap),x.push("lineJoin",a.lineJoin),x.push("miterLimit",a.miterLimit);var A=yr?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;A.prototype.setLineDash&&(x.push("setLineDash",[a.lineDash]),x.push("lineDashOffset",a.lineDashOffset))}e&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var k=.5-f,P=f*T+k*d,X=[],U=[],L=0,G=0,S=0,K=0,Z,V=0,J=p.length;V<J;V+=2){var C=p[V];if(C===`
`){G+=L,L=0,P=f*T+k*d,++K;continue}var st=p[V+1]||u.font;st!==Z&&(r&&X.push("font",st),e&&U.push("font",st),Z=st),L=Math.max(L,y[S]);var Y=[C,P+k*g[S]+f*(g[S]-E[K]),.5*(d+L)+G];P+=g[S],r&&X.push("strokeText",Y),e&&U.push("fillText",Y),++S}return Array.prototype.push.apply(x,X),Array.prototype.push.apply(x,U),this.labels_[o]=I,I},i.prototype.replayTextBackground_=function(n,t,e,r,o,a,s){n.beginPath(),n.moveTo.apply(n,t),n.lineTo.apply(n,e),n.lineTo.apply(n,r),n.lineTo.apply(n,o),n.lineTo.apply(n,t),a&&(this.alignFill_=a[2],this.fill_(n)),s&&(this.setStrokeStyle_(n,s),n.stroke())},i.prototype.calculateImageOrLabelDimensions_=function(n,t,e,r,o,a,s,u,l,h,c,f,d,p,v,_){s*=f[0],u*=f[1];var m=e-s,g=r-u,y=o+l>n?n-l:o,E=a+h>t?t-h:a,T=p[3]+y*f[0]+p[1],x=p[0]+E*f[1]+p[2],R=m-p[3],O=g-p[0];(v||c!==0)&&(de[0]=R,pe[0]=R,de[1]=O,te[1]=O,te[0]=R+T,ee[0]=te[0],ee[1]=O+x,pe[1]=ee[1]);var I;return c!==0?(I=bt(Wt(),e,r,1,1,c,-e,-r),at(I,de),at(I,te),at(I,ee),at(I,pe),$t(Math.min(de[0],te[0],ee[0],pe[0]),Math.min(de[1],te[1],ee[1],pe[1]),Math.max(de[0],te[0],ee[0],pe[0]),Math.max(de[1],te[1],ee[1],pe[1]),vn)):$t(Math.min(R,R+T),Math.min(O,O+x),Math.max(R,R+T),Math.max(O,O+x),vn),d&&(m=Math.round(m),g=Math.round(g)),{drawImageX:m,drawImageY:g,drawImageW:y,drawImageH:E,originX:l,originY:h,declutterBox:{minX:vn[0],minY:vn[1],maxX:vn[2],maxY:vn[3],value:_},canvasTransform:I,scale:f}},i.prototype.replayImageOrLabel_=function(n,t,e,r,o,a,s){var u=!!(a||s),l=r.declutterBox,h=n.canvas,c=s?s[2]*r.scale[0]/2:0,f=l.minX-c<=h.width/t&&l.maxX+c>=0&&l.minY-c<=h.height/t&&l.maxY+c>=0;return f&&(u&&this.replayTextBackground_(n,de,te,ee,pe,a,s),Oh(n,r.canvasTransform,o,e,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},i.prototype.fill_=function(n){if(this.alignFill_){var t=at(this.renderedTransform_,[0,0]),e=512*this.pixelRatio;n.save(),n.translate(t[0]%e,t[1]%e),n.rotate(this.viewRotation_)}n.fill(),this.alignFill_&&n.restore()},i.prototype.setStrokeStyle_=function(n,t){n.strokeStyle=t[1],n.lineWidth=t[2],n.lineCap=t[3],n.lineJoin=t[4],n.miterLimit=t[5],n.setLineDash&&(n.lineDashOffset=t[7],n.setLineDash(t[6]))},i.prototype.drawLabelWithPointPlacement_=function(n,t,e,r){var o=this.textStates[t],a=this.createLabel(n,t,r,e),s=this.strokeStates[e],u=this.pixelRatio,l=fs(Array.isArray(n)?n[0]:n,o.textAlign||Kn),h=zr[o.textBaseline||Yr],c=s&&s.lineWidth?s.lineWidth:0,f=a.width/u-2*o.scale[0],d=l*f+2*(.5-l)*c,p=h*a.height/u+2*(.5-h)*c;return{label:a,anchorX:d,anchorY:p}},i.prototype.execute_=function(n,t,e,r,o,a,s,u){var l;this.pixelCoordinates_&&Ie(e,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Ge(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Zu(this.renderedTransform_,e));for(var h=0,c=r.length,f=0,d,p,v,_,m,g,y,E,T,x,R,O,I=0,A=0,k=null,P=null,X=this.coordinateCache_,U=this.viewRotation_,L=Math.round(Math.atan2(-e[1],e[0])*1e12)/1e12,G={context:n,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:U},S=this.instructions!=r||this.overlaps?0:200,K,Z,V,J;h<c;){var C=r[h],st=C[0];switch(st){case N.BEGIN_GEOMETRY:K=C[1],J=C[3],K.getGeometry()?s!==void 0&&!xt(s,J.getExtent())?h=C[2]+1:++h:h=C[2];break;case N.BEGIN_PATH:I>S&&(this.fill_(n),I=0),A>S&&(n.stroke(),A=0),!I&&!A&&(n.beginPath(),_=NaN,m=NaN),++h;break;case N.CIRCLE:f=C[1];var Y=l[f],ht=l[f+1],Ot=l[f+2],Rt=l[f+3],mt=Ot-Y,It=Rt-ht,$e=Math.sqrt(mt*mt+It*It);n.moveTo(Y+$e,ht),n.arc(Y,ht,$e,0,2*Math.PI,!0),++h;break;case N.CLOSE_PATH:n.closePath(),++h;break;case N.CUSTOM:f=C[1],d=C[2];var Yt=C[3],or=C[4],ar=C.length==6?C[5]:void 0;G.geometry=Yt,G.feature=K,h in X||(X[h]=[]);var oe=X[h];ar?ar(l,f,d,2,oe):(oe[0]=l[f],oe[1]=l[f+1],oe.length=2),or(oe,G),++h;break;case N.DRAW_IMAGE:f=C[1],d=C[2],E=C[3],p=C[4],v=C[5];var He=C[6],sr=C[7],En=C[8],ur=C[9],Ce=C[10],Tn=C[11],lr=C[12],qe=C[13],ae=C[14];if(!E&&C.length>=19){T=C[18],x=C[19],R=C[20],O=C[21];var Je=this.drawLabelWithPointPlacement_(T,x,R,O);E=Je.label,C[3]=E;var si=C[22];p=(Je.anchorX-si)*this.pixelRatio,C[4]=p;var hr=C[23];v=(Je.anchorY-hr)*this.pixelRatio,C[5]=v,He=E.height,C[6]=He,qe=E.width,C[13]=qe}var Cn=void 0;C.length>24&&(Cn=C[24]);var zt=void 0,jt=void 0,xe=void 0;C.length>16?(zt=C[15],jt=C[16],xe=C[17]):(zt=Ue,jt=!1,xe=!1),Ce&&L?Tn+=U:!Ce&&!L&&(Tn-=U);for(var xn=0;f<d;f+=2)if(!(Cn&&Cn[xn++]<qe/this.pixelRatio)){var Et=this.calculateImageOrLabelDimensions_(E.width,E.height,l[f],l[f+1],qe,He,p,v,En,ur,Tn,lr,o,zt,jt||xe,K),fr=[n,t,E,Et,sr,jt?k:null,xe?P:null],_t=void 0,Qe=void 0;if(u&&ae){var Oe=d-f;if(!ae[Oe]){ae[Oe]=fr;continue}if(_t=ae[Oe],delete ae[Oe],Qe=hs(_t),u.collides(Qe))continue}u&&u.collides(Et.declutterBox)||(_t&&(u&&u.insert(Qe),this.replayImageOrLabel_.apply(this,_t)),u&&u.insert(Et.declutterBox),this.replayImageOrLabel_.apply(this,fr))}++h;break;case N.DRAW_CHARS:var So=C[1],Po=C[2],ui=C[3],pu=C[4];O=C[5];var vu=C[6],Lo=C[7],Ao=C[8];R=C[9];var li=C[10];T=C[11],x=C[12];var Mo=[C[13],C[13]],hi=this.textStates[x],On=hi.font,Rn=[hi.scale[0]*Lo,hi.scale[1]*Lo],In=void 0;On in this.widths_?In=this.widths_[On]:(In={},this.widths_[On]=In);var Fo=Da(l,So,Po,2),No=Math.abs(Rn[0])*$a(On,T,In);if(pu||No<=Fo){var _u=this.textStates[x].textAlign,gu=(Fo-No)*zr[_u],wn=Cf(l,So,Po,2,T,gu,vu,Math.abs(Rn[0]),$a,On,In,L?0:this.viewRotation_);t:if(wn){var Sn=[],se=void 0,cr=void 0,dr=void 0,Tt=void 0,Lt=void 0;if(R)for(se=0,cr=wn.length;se<cr;++se){Lt=wn[se],dr=Lt[4],Tt=this.createLabel(dr,x,"",R),p=Lt[2]+(Rn[0]<0?-li:li),v=ui*Tt.height+(.5-ui)*2*li*Rn[1]/Rn[0]-Ao;var Et=this.calculateImageOrLabelDimensions_(Tt.width,Tt.height,Lt[0],Lt[1],Tt.width,Tt.height,p,v,0,0,Lt[3],Mo,!1,Ue,!1,K);if(u&&u.collides(Et.declutterBox))break t;Sn.push([n,t,Tt,Et,1,null,null])}if(O)for(se=0,cr=wn.length;se<cr;++se){Lt=wn[se],dr=Lt[4],Tt=this.createLabel(dr,x,O,""),p=Lt[2],v=ui*Tt.height-Ao;var Et=this.calculateImageOrLabelDimensions_(Tt.width,Tt.height,Lt[0],Lt[1],Tt.width,Tt.height,p,v,0,0,Lt[3],Mo,!1,Ue,!1,K);if(u&&u.collides(Et.declutterBox))break t;Sn.push([n,t,Tt,Et,1,null,null])}u&&u.load(Sn.map(hs));for(var fi=0,yu=Sn.length;fi<yu;++fi)this.replayImageOrLabel_.apply(this,Sn[fi])}}++h;break;case N.END_GEOMETRY:if(a!==void 0){K=C[1];var Do=a(K,J);if(Do)return Do}++h;break;case N.FILL:S?I++:this.fill_(n),++h;break;case N.MOVE_TO_LINE_TO:for(f=C[1],d=C[2],Z=l[f],V=l[f+1],g=Z+.5|0,y=V+.5|0,(g!==_||y!==m)&&(n.moveTo(Z,V),_=g,m=y),f+=2;f<d;f+=2)Z=l[f],V=l[f+1],g=Z+.5|0,y=V+.5|0,(f==d-2||g!==_||y!==m)&&(n.lineTo(Z,V),_=g,m=y);++h;break;case N.SET_FILL_STYLE:k=C,this.alignFill_=C[2],I&&(this.fill_(n),I=0,A&&(n.stroke(),A=0)),n.fillStyle=C[1],++h;break;case N.SET_STROKE_STYLE:P=C,A&&(n.stroke(),A=0),this.setStrokeStyle_(n,C),++h;break;case N.STROKE:S?A++:n.stroke(),++h;break;default:++h;break}}I&&this.fill_(n),A&&n.stroke()},i.prototype.execute=function(n,t,e,r,o,a){this.viewRotation_=r,this.execute_(n,t,e,this.instructions,o,void 0,void 0,a)},i.prototype.executeHitDetection=function(n,t,e,r,o){return this.viewRotation_=e,this.execute_(n,1,t,this.hitDetectionInstructions,!0,r,o)},i}(),If=Rf,Wi=[nt.POLYGON,nt.CIRCLE,nt.LINE_STRING,nt.IMAGE,nt.TEXT,nt.DEFAULT],wf=function(){function i(n,t,e,r,o,a){this.maxExtent_=n,this.overlaps_=r,this.pixelRatio_=e,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Wt(),this.createExecutors_(o)}return i.prototype.clip=function(n,t){var e=this.getClipCoords(t);n.beginPath(),n.moveTo(e[0],e[1]),n.lineTo(e[2],e[3]),n.lineTo(e[4],e[5]),n.lineTo(e[6],e[7]),n.clip()},i.prototype.createExecutors_=function(n){for(var t in n){var e=this.executorsByZIndex_[t];e===void 0&&(e={},this.executorsByZIndex_[t]=e);var r=n[t];for(var o in r){var a=r[o];e[o]=new If(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}},i.prototype.hasExecutors=function(n){for(var t in this.executorsByZIndex_)for(var e=this.executorsByZIndex_[t],r=0,o=n.length;r<o;++r)if(n[r]in e)return!0;return!1},i.prototype.forEachFeatureAtCoordinate=function(n,t,e,r,o,a){r=Math.round(r);var s=r*2+1,u=bt(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-e,-n[0],-n[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=Ft(s,s));var h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s);var c;this.renderBuffer_!==void 0&&(c=wt(),Dn(c,n),mr(c,t*(this.renderBuffer_+r),c));var f=Sf(r),d;function p(x,R){for(var O=h.getImageData(0,0,s,s).data,I=0,A=f.length;I<A;I++)if(O[f[I]]>0){if(!a||d!==nt.IMAGE&&d!==nt.TEXT||a.indexOf(x)!==-1){var k=(f[I]-3)/4,P=r-k%s,X=r-(k/s|0),U=o(x,R,P*P+X*X);if(U)return U}h.clearRect(0,0,s,s);break}}var v=Object.keys(this.executorsByZIndex_).map(Number);v.sort(Re);var _,m,g,y,E;for(_=v.length-1;_>=0;--_){var T=v[_].toString();for(g=this.executorsByZIndex_[T],m=Wi.length-1;m>=0;--m)if(d=Wi[m],y=g[d],y!==void 0&&(E=y.executeHitDetection(h,u,e,p,c),E))return E}},i.prototype.getClipCoords=function(n){var t=this.maxExtent_;if(!t)return null;var e=t[0],r=t[1],o=t[2],a=t[3],s=[e,r,e,a,o,a,o,r];return Ge(s,0,8,2,n,s),s},i.prototype.isEmpty=function(){return nn(this.executorsByZIndex_)},i.prototype.execute=function(n,t,e,r,o,a,s){var u=Object.keys(this.executorsByZIndex_).map(Number);u.sort(Re),this.maxExtent_&&(n.save(),this.clip(n,e));var l=a||Wi,h,c,f,d,p,v;for(s&&u.reverse(),h=0,c=u.length;h<c;++h){var _=u[h].toString();for(p=this.executorsByZIndex_[_],f=0,d=l.length;f<d;++f){var m=l[f];v=p[m],v!==void 0&&v.execute(n,t,e,r,o,s)}}this.maxExtent_&&n.restore()},i}(),Zi={};function Sf(i){if(Zi[i]!==void 0)return Zi[i];for(var n=i*2+1,t=i*i,e=new Array(t+1),r=0;r<=i;++r)for(var o=0;o<=i;++o){var a=r*r+o*o;if(a>t)break;var s=e[a];s||(s=[],e[a]=s),s.push(((i+r)*n+(i+o))*4+3),r>0&&s.push(((i-r)*n+(i+o))*4+3),o>0&&(s.push(((i+r)*n+(i-o))*4+3),r>0&&s.push(((i-r)*n+(i-o))*4+3))}for(var u=[],r=0,l=e.length;r<l;++r)e[r]&&u.push.apply(u,e[r]);return Zi[i]=u,u}var cs=wf,gt={ANIMATING:0,INTERACTING:1},Pf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Lf=function(i){Pf(n,i);function n(t,e,r,o,a,s,u){var l=i.call(this)||this;return l.context_=t,l.pixelRatio_=e,l.extent_=r,l.transform_=o,l.viewRotation_=a,l.squaredTolerance_=s,l.userTransform_=u,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_=Wt(),l}return n.prototype.drawImages_=function(t,e,r,o){if(!!this.image_){var a=Ge(t,e,r,o,this.transform_,this.pixelCoordinates_),s=this.context_,u=this.tmpLocalTransform_,l=s.globalAlpha;this.imageOpacity_!=1&&(s.globalAlpha=l*this.imageOpacity_);var h=this.imageRotation_;this.imageRotateWithView_&&(h+=this.viewRotation_);for(var c=0,f=a.length;c<f;c+=2){var d=a[c]-this.imageAnchorX_,p=a[c+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){var v=d+this.imageAnchorX_,_=p+this.imageAnchorY_;bt(u,v,_,1,1,h,-v,-_),s.setTransform.apply(s,u),s.translate(v,_),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.setTransform(1,0,0,1,0,0)}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,p,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(s.globalAlpha=l)}},n.prototype.drawText_=function(t,e,r,o){if(!(!this.textState_||this.text_==="")){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var a=Ge(t,e,r,o,this.transform_,this.pixelCoordinates_),s=this.context_,u=this.textRotation_;for(this.textRotateWithView_&&(u+=this.viewRotation_);e<r;e+=o){var l=a[e]+this.textOffsetX_,h=a[e+1]+this.textOffsetY_;if(u!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){var c=bt(this.tmpLocalTransform_,l,h,1,1,u,-l,-h);s.setTransform.apply(s,c),s.translate(l,h),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&s.strokeText(this.text_,l,h),this.textFillState_&&s.fillText(this.text_,l,h)}}},n.prototype.moveToLineTo_=function(t,e,r,o,a){var s=this.context_,u=Ge(t,e,r,o,this.transform_,this.pixelCoordinates_);s.moveTo(u[0],u[1]);var l=u.length;a&&(l-=2);for(var h=2;h<l;h+=2)s.lineTo(u[h],u[h+1]);return a&&s.closePath(),r},n.prototype.drawRings_=function(t,e,r,o){for(var a=0,s=r.length;a<s;++a)e=this.moveToLineTo_(t,e,r[a],o,!0);return e},n.prototype.drawCircle=function(t){if(!!xt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=Al(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],o=e[3]-e[1],a=Math.sqrt(r*r+o*o),s=this.context_;s.beginPath(),s.arc(e[0],e[1],a,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}},n.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},n.prototype.setTransform=function(t){this.transform_=t},n.prototype.drawGeometry=function(t){var e=t.getType();switch(e){case w.POINT:this.drawPoint(t);break;case w.LINE_STRING:this.drawLineString(t);break;case w.POLYGON:this.drawPolygon(t);break;case w.MULTI_POINT:this.drawMultiPoint(t);break;case w.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case w.MULTI_POLYGON:this.drawMultiPolygon(t);break;case w.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case w.CIRCLE:this.drawCircle(t);break}},n.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);!r||!xt(this.extent_,r.getExtent())||(this.setStyle(e),this.drawGeometry(r))},n.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,o=e.length;r<o;++r)this.drawGeometry(e[r])},n.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)},n.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)},n.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!xt(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 o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},n.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(!!xt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,o=t.getFlatCoordinates(),a=0,s=t.getEnds(),u=t.getStride();r.beginPath();for(var l=0,h=s.length;l<h;++l)a=this.moveToLineTo_(o,a,s[l],u,!1);r.stroke()}if(this.text_!==""){var c=t.getFlatMidpoints();this.drawText_(c,0,c.length,2)}}},n.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!xt(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)}}},n.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!xt(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(),o=0,a=t.getEndss(),s=t.getStride();e.beginPath();for(var u=0,l=a.length;u<l;++u){var h=a[u];o=this.drawRings_(r,o,h,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){var c=t.getFlatInteriorPoints();this.drawText_(c,0,c.length,2)}}},n.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})},n.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&&(Ie(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})},n.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,o=t.textAlign?t.textAlign:Kn;r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=o&&(r.textAlign=o,e.textAlign=o),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},n.prototype.setFillStrokeStyle=function(t,e){var r=this;if(!t)this.fillState_=null;else{var o=t.getColor();this.fillState_={fillStyle:Zt(o||Jt)}}if(!e)this.strokeState_=null;else{var a=e.getColor(),s=e.getLineCap(),u=e.getLineDash(),l=e.getLineDashOffset(),h=e.getLineJoin(),c=e.getWidth(),f=e.getMiterLimit(),d=u||Un;this.strokeState_={lineCap:s!==void 0?s:Xr,lineDash:this.pixelRatio_===1?d:d.map(function(p){return p*r.pixelRatio_}),lineDashOffset:(l||Bn)*this.pixelRatio_,lineJoin:h!==void 0?h:fn,lineWidth:(c!==void 0?c:zn)*this.pixelRatio_,miterLimit:f!==void 0?f:Wn,strokeStyle:Zt(a||Zn)}}},n.prototype.setImageStyle=function(t){var e;if(!t||!(e=t.getSize())){this.image_=null;return}var r=t.getAnchor(),o=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_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_},n.prototype.setTextStyle=function(t){if(!t)this.text_="";else{var e=t.getFill();if(!e)this.textFillState_=null;else{var r=e.getColor();this.textFillState_={fillStyle:Zt(r||Jt)}}var o=t.getStroke();if(!o)this.textStrokeState_=null;else{var a=o.getColor(),s=o.getLineCap(),u=o.getLineDash(),l=o.getLineDashOffset(),h=o.getLineJoin(),c=o.getWidth(),f=o.getMiterLimit();this.textStrokeState_={lineCap:s!==void 0?s:Xr,lineDash:u||Un,lineDashOffset:l||Bn,lineJoin:h!==void 0?h:fn,lineWidth:c!==void 0?c:zn,miterLimit:f!==void 0?f:Wn,strokeStyle:Zt(a||Zn)}}var d=t.getFont(),p=t.getOffsetX(),v=t.getOffsetY(),_=t.getRotateWithView(),m=t.getRotation(),g=t.getScaleArray(),y=t.getText(),E=t.getTextAlign(),T=t.getTextBaseline();this.textState_={font:d!==void 0?d:Va,textAlign:E!==void 0?E:Kn,textBaseline:T!==void 0?T:Yr},this.text_=y!==void 0?Array.isArray(y)?y.reduce(function(x,R,O){return x+=O%2?" ":R},""):y:"",this.textOffsetX_=p!==void 0?this.pixelRatio_*p:0,this.textOffsetY_=v!==void 0?this.pixelRatio_*v:0,this.textRotateWithView_=_!==void 0?_:!1,this.textRotation_=m!==void 0?m:0,this.textScale_=[this.pixelRatio_*g[0],this.pixelRatio_*g[1]]}},n}(os),Af=Lf,ve={FRACTION:"fraction",PIXELS:"pixels"},Nt={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Mf=function(){function i(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return i.prototype.clear=function(){this.cache_={},this.cacheSize_=0},i.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},i.prototype.expire=function(){if(this.canExpireCache()){var n=0;for(var t in this.cache_){var e=this.cache_[t];(n++&3)==0&&!e.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},i.prototype.get=function(n,t,e){var r=ds(n,t,e);return r in this.cache_?this.cache_[r]:null},i.prototype.set=function(n,t,e,r){var o=ds(n,t,e);this.cache_[o]=r,++this.cacheSize_},i.prototype.setSize=function(n){this.maxCacheSize_=n,this.expire()},i}();function ds(i,n,t){var e=t?Xa(t):"null";return n+":"+i+":"+e}var Vr=new Mf,Ff=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Nf=function(i){Ff(n,i);function n(t,e,r,o){var a=i.call(this)||this;return a.extent=t,a.pixelRatio_=r,a.resolution=e,a.state=o,a}return n.prototype.changed=function(){this.dispatchEvent(F.CHANGE)},n.prototype.getExtent=function(){return this.extent},n.prototype.getImage=function(){return M()},n.prototype.getPixelRatio=function(){return this.pixelRatio_},n.prototype.getResolution=function(){return this.resolution},n.prototype.getState=function(){return this.state},n.prototype.load=function(){M()},n}(rn),Df=Nf,Gf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();(function(i){Gf(n,i);function n(t,e,r,o,a,s){var u=i.call(this,t,e,r,Q.IDLE)||this;return u.src_=o,u.image_=new Image,a!==null&&(u.image_.crossOrigin=a),u.unlisten_=null,u.state=Q.IDLE,u.imageLoadFunction_=s,u}return n.prototype.getImage=function(){return this.image_},n.prototype.handleImageError_=function(){this.state=Q.ERROR,this.unlistenImage_(),this.changed()},n.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Gt(this.extent)/this.image_.height),this.state=Q.LOADED,this.unlistenImage_(),this.changed()},n.prototype.load=function(){(this.state==Q.IDLE||this.state==Q.ERROR)&&(this.state=Q.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ki(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},n.prototype.setImage=function(t){this.image_=t,this.resolution=Gt(this.extent)/this.image_.height},n.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},n})(Df);function Ki(i,n,t){var e=i,r=!0,o=!1,a=!1,s=[vr(e,F.LOAD,function(){a=!0,o||n()})];return e.src&&Bu?(o=!0,e.decode().then(function(){r&&n()}).catch(function(u){r&&(a?n():t())})):s.push(vr(e,F.ERROR,t)),function(){r=!1,s.forEach(q)}}var kf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Qn=null,Xf=function(i){kf(n,i);function n(t,e,r,o,a,s){var u=i.call(this)||this;return u.hitDetectionImage_=null,u.image_=t||new Image,o!==null&&(u.image_.crossOrigin=o),u.canvas_={},u.color_=s,u.unlisten_=null,u.imageState_=a,u.size_=r,u.src_=e,u.tainted_,u}return n.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Q.LOADED){Qn||(Qn=Ft(1,1)),Qn.drawImage(this.image_,0,0);try{Qn.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Qn=null,this.tainted_=!0}}return this.tainted_===!0},n.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(F.CHANGE)},n.prototype.handleImageError_=function(){this.imageState_=Q.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},n.prototype.handleImageLoad_=function(){this.imageState_=Q.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},n.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},n.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},n.prototype.getImageState=function(){return this.imageState_},n.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],r=Ft(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},n.prototype.getSize=function(){return this.size_},n.prototype.getSrc=function(){return this.src_},n.prototype.load=function(){if(this.imageState_==Q.IDLE){this.imageState_=Q.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ki(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},n.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==Q.LOADED)){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",r.globalCompositeOperation==="multiply"||this.isTainted_())r.fillStyle=Xa(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 o=r.getImageData(0,0,e.width,e.height),a=o.data,s=this.color_[0]/255,u=this.color_[1]/255,l=this.color_[2]/255,h=this.color_[3],c=0,f=a.length;c<f;c+=4)a[c]*=s,a[c+1]*=u,a[c+2]*=l,a[c+3]*=h;r.putImageData(o,0,0)}}},n.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},n}(rn);function Yf(i,n,t,e,r,o){var a=Vr.get(n,e,o);return a||(a=new Xf(i,n,t,e,r,o),Vr.set(n,e,o,a)),a}var jf=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Uf=function(i){jf(n,i);function n(t){var e=this,r=t||{},o=r.opacity!==void 0?r.opacity:1,a=r.rotation!==void 0?r.rotation:0,s=r.scale!==void 0?r.scale:1,u=r.rotateWithView!==void 0?r.rotateWithView:!1;e=i.call(this,{opacity:o,rotation:a,scale:s,displacement:r.displacement!==void 0?r.displacement:[0,0],rotateWithView:u})||this,e.anchor_=r.anchor!==void 0?r.anchor:[.5,.5],e.normalizedAnchor_=null,e.anchorOrigin_=r.anchorOrigin!==void 0?r.anchorOrigin:Nt.TOP_LEFT,e.anchorXUnits_=r.anchorXUnits!==void 0?r.anchorXUnits:ve.FRACTION,e.anchorYUnits_=r.anchorYUnits!==void 0?r.anchorYUnits:ve.FRACTION,e.crossOrigin_=r.crossOrigin!==void 0?r.crossOrigin:null;var l=r.img!==void 0?r.img:null;e.imgSize_=r.imgSize;var h=r.src;W(!(h!==void 0&&l),4),W(!l||l&&e.imgSize_,5),(h===void 0||h.length===0)&&l&&(h=l.src||b(l)),W(h!==void 0&&h.length>0,6);var c=r.src!==void 0?Q.IDLE:Q.LOADED;return e.color_=r.color!==void 0?Nr(r.color):null,e.iconImage_=Yf(l,h,e.imgSize_!==void 0?e.imgSize_:null,e.crossOrigin_,c,e.color_),e.offset_=r.offset!==void 0?r.offset:[0,0],e.offsetOrigin_=r.offsetOrigin!==void 0?r.offsetOrigin:Nt.TOP_LEFT,e.origin_=null,e.size_=r.size!==void 0?r.size:null,e}return n.prototype.clone=function(){var t=this.getScale();return new n({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:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})},n.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==ve.FRACTION||this.anchorYUnits_==ve.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ve.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==ve.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Nt.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==Nt.TOP_RIGHT||this.anchorOrigin_==Nt.BOTTOM_RIGHT)&&(t[0]=-t[0]+e[0]),(this.anchorOrigin_==Nt.BOTTOM_LEFT||this.anchorOrigin_==Nt.BOTTOM_RIGHT)&&(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},n.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},n.prototype.getColor=function(){return this.color_},n.prototype.getImage=function(t){return this.iconImage_.getImage(t)},n.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.iconImage_.getSize()},n.prototype.getImageState=function(){return this.iconImage_.getImageState()},n.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Nt.TOP_LEFT){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),(this.offsetOrigin_==Nt.TOP_RIGHT||this.offsetOrigin_==Nt.BOTTOM_RIGHT)&&(t[0]=r[0]-e[0]-t[0]),(this.offsetOrigin_==Nt.BOTTOM_LEFT||this.offsetOrigin_==Nt.BOTTOM_RIGHT)&&(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},n.prototype.getSrc=function(){return this.iconImage_.getSrc()},n.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},n.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(F.CHANGE,t)},n.prototype.load=function(){this.iconImage_.load()},n.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(F.CHANGE,t)},n}(ka),Bf=Uf,Kt=.5;function Wf(i,n,t,e,r,o,a){var s=i[0]*Kt,u=i[1]*Kt,l=Ft(s,u);l.imageSmoothingEnabled=!1;for(var h=l.canvas,c=new Af(l,Kt,r,null,a),f=t.length,d=Math.floor((256*256*256-1)/f),p={},v=1;v<=f;++v){var _=t[v-1],m=_.getStyleFunction()||e;if(!!e){var g=m(_,o);if(!!g){Array.isArray(g)||(g=[g]);for(var y=v*d,E="#"+("000000"+y.toString(16)).slice(-6),T=0,x=g.length;T<x;++T){var R=g[T],O=R.getGeometryFunction()(_);if(!(!O||!xt(r,O.getExtent()))){var I=R.clone(),A=I.getFill();A&&A.setColor(E);var k=I.getStroke();k&&(k.setColor(E),k.setLineDash(null)),I.setText(void 0);var P=R.getImage();if(P&&P.getOpacity()!==0){var X=P.getImageSize();if(!X)continue;var U=Ft(X[0],X[1],void 0,{alpha:!1}),L=U.canvas;U.fillStyle=E,U.fillRect(0,0,L.width,L.height),I.setImage(new Bf({img:L,imgSize:X,anchor:P.getAnchor(),anchorXUnits:ve.PIXELS,anchorYUnits:ve.PIXELS,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}var G=I.getZIndex()||0,S=p[G];S||(S={},p[G]=S,S[w.POLYGON]=[],S[w.CIRCLE]=[],S[w.LINE_STRING]=[],S[w.POINT]=[]),S[O.getType().replace("Multi","")].push(O,I)}}}}}for(var K=Object.keys(p).map(Number).sort(Re),v=0,Z=K.length;v<Z;++v){var S=p[K[v]];for(var V in S)for(var J=S[V],T=0,x=J.length;T<x;T+=2){c.setStyle(J[T+1]);for(var C=0,st=n.length;C<st;++C)c.setTransform(n[C]),c.drawGeometry(J[T])}}return l.getImageData(0,0,h.width,h.height)}function Zf(i,n,t){var e=[];if(t){var r=Math.floor(Math.round(i[0])*Kt),o=Math.floor(Math.round(i[1])*Kt),a=(it(r,0,t.width-1)+it(o,0,t.height-1)*t.width)*4,s=t.data[a],u=t.data[a+1],l=t.data[a+2],h=l+256*(u+256*s),c=Math.floor((256*256*256-1)/n.length);h&&h%c==0&&e.push(n[h/c-1])}return e}var Kf=.5,ps={Point:tc,LineString:qf,Polygon:nc,MultiPoint:ec,MultiLineString:Jf,MultiPolygon:Qf,GeometryCollection:Hf,Circle:bf};function zf(i,n){return parseInt(b(i),10)-parseInt(b(n),10)}function Vf(i,n){var t=zi(i,n);return t*t}function zi(i,n){return Kf*i/n}function bf(i,n,t,e,r){var o=t.getFill(),a=t.getStroke();if(o||a){var s=i.getBuilder(t.getZIndex(),nt.CIRCLE);s.setFillStrokeStyle(o,a),s.drawCircle(n,e)}var u=t.getText();if(u&&u.getText()){var l=(r||i).getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(u),l.drawText(n,e)}}function vs(i,n,t,e,r,o,a){var s=!1,u=t.getImage();if(u){var l=u.getImageState();l==Q.LOADED||l==Q.ERROR?u.unlistenImageChange(r):(l==Q.IDLE&&u.load(),l=u.getImageState(),u.listenImageChange(r),s=!0)}return $f(i,n,t,e,o,a),s}function $f(i,n,t,e,r,o){var a=t.getGeometryFunction()(n);if(!!a){var s=a.simplifyTransformed(e,r),u=t.getRenderer();if(u)_s(i,s,t,n);else{var l=ps[s.getType()];l(i,s,t,n,o)}}}function _s(i,n,t,e){if(n.getType()==w.GEOMETRY_COLLECTION){for(var r=n.getGeometries(),o=0,a=r.length;o<a;++o)_s(i,r[o],t,e);return}var s=i.getBuilder(t.getZIndex(),nt.DEFAULT);s.drawCustom(n,e,t.getRenderer(),t.getHitDetectionRenderer())}function Hf(i,n,t,e,r){var o=n.getGeometriesArray(),a,s;for(a=0,s=o.length;a<s;++a){var u=ps[o[a].getType()];u(i,o[a],t,e,r)}}function qf(i,n,t,e,r){var o=t.getStroke();if(o){var a=i.getBuilder(t.getZIndex(),nt.LINE_STRING);a.setFillStrokeStyle(null,o),a.drawLineString(n,e)}var s=t.getText();if(s&&s.getText()){var u=(r||i).getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(s),u.drawText(n,e)}}function Jf(i,n,t,e,r){var o=t.getStroke();if(o){var a=i.getBuilder(t.getZIndex(),nt.LINE_STRING);a.setFillStrokeStyle(null,o),a.drawMultiLineString(n,e)}var s=t.getText();if(s&&s.getText()){var u=(r||i).getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(s),u.drawText(n,e)}}function Qf(i,n,t,e,r){var o=t.getFill(),a=t.getStroke();if(a||o){var s=i.getBuilder(t.getZIndex(),nt.POLYGON);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(n,e)}var u=t.getText();if(u&&u.getText()){var l=(r||i).getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(u),l.drawText(n,e)}}function tc(i,n,t,e,r){var o=t.getImage(),a=t.getText(),s;if(r&&(i=r,s=o&&a&&a.getText()?{}:void 0),o){if(o.getImageState()!=Q.LOADED)return;var u=i.getBuilder(t.getZIndex(),nt.IMAGE);u.setImageStyle(o,s),u.drawPoint(n,e)}if(a&&a.getText()){var l=i.getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(a,s),l.drawText(n,e)}}function ec(i,n,t,e,r){var o=t.getImage(),a=t.getText(),s;if(r&&(i=r,s=o&&a&&a.getText()?{}:void 0),o){if(o.getImageState()!=Q.LOADED)return;var u=i.getBuilder(t.getZIndex(),nt.IMAGE);u.setImageStyle(o,s),u.drawMultiPoint(n,e)}if(a&&a.getText()){var l=(r||i).getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(a,s),l.drawText(n,e)}}function nc(i,n,t,e,r){var o=t.getFill(),a=t.getStroke();if(o||a){var s=i.getBuilder(t.getZIndex(),nt.POLYGON);s.setFillStrokeStyle(o,a),s.drawPolygon(n,e)}var u=t.getText();if(u&&u.getText()){var l=(r||i).getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(u),l.drawText(n,e)}}var rc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ic=function(i){rc(n,i);function n(t){var e=i.call(this,t)||this;return e.boundHandleStyleImageChange_=e.handleStyleImageChange_.bind(e),e.animatingOrInteracting_,e.dirty_=!1,e.hitDetectionImageData_=null,e.renderedFeatures_=null,e.renderedRevision_=-1,e.renderedResolution_=NaN,e.renderedExtent_=wt(),e.wrappedRenderedExtent_=wt(),e.renderedRotation_,e.renderedCenter_=null,e.renderedProjection_=null,e.renderedRenderOrder_=null,e.replayGroup_=null,e.replayGroupChanged=!0,e.declutterExecutorGroup=null,e.clipping=!0,e}return n.prototype.renderWorlds=function(t,e,r){var o=e.extent,a=e.viewState,s=a.center,u=a.resolution,l=a.projection,h=a.rotation,c=l.getExtent(),f=this.getLayer().getSource(),d=e.pixelRatio,p=e.viewHints,v=!(p[gt.ANIMATING]||p[gt.INTERACTING]),_=this.context,m=Math.round(e.size[0]*d),g=Math.round(e.size[1]*d),y=f.getWrapX()&&l.canWrapX(),E=y?rt(c):null,T=y?Math.ceil((o[2]-c[2])/E)+1:1,x=y?Math.floor((o[0]-c[0])/E):0;do{var R=this.getRenderTransform(s,u,h,d,m,g,x*E);t.execute(_,1,R,h,v,void 0,r)}while(++x<T)},n.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},n.prototype.renderFrame=function(t,e){var r=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];Ku(this.pixelTransform,1/r,1/r),pi(this.inversePixelTransform,this.pixelTransform);var a=bo(this.pixelTransform);this.useContainer(e,a,o.opacity,this.getBackground(t));var s=this.context,u=s.canvas,l=this.replayGroup_,h=this.declutterExecutorGroup;if((!l||l.isEmpty())&&(!h||h.isEmpty()))return null;var c=Math.round(t.size[0]*r),f=Math.round(t.size[1]*r);u.width!=c||u.height!=f?(u.width=c,u.height=f,u.style.transform!==a&&(u.style.transform=a)):this.containerReused||s.clearRect(0,0,c,f),this.preRender(s,t);var d=t.viewState;d.projection;var p=!1,v=!0;if(o.extent&&this.clipping){var _=De(o.extent);v=xt(_,t.extent),p=v&&!Pe(_,t.extent),p&&this.clipUnrotated(s,t,_)}v&&this.renderWorlds(l,t),p&&s.restore(),this.postRender(s,t);var m=za(o.opacity),g=this.container;return m!==g.style.opacity&&(g.style.opacity=m),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container},n.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];at(this.pixelTransform,r);var o=this.renderedCenter_,a=this.renderedResolution_,s=this.renderedRotation_,u=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],f=r[0]*Kt,d=r[1]*Kt;c.push(this.getRenderTransform(o,a,s,Kt,f,d,0).slice());var p=h.getSource(),v=u.getExtent();if(p.getWrapX()&&u.canWrapX()&&!Pe(v,l)){for(var _=l[0],m=rt(v),g=0,y=void 0;_<v[0];)--g,y=m*g,c.push(this.getRenderTransform(o,a,s,Kt,f,d,y).slice()),_+=m;for(g=0,_=l[2];_>v[2];)++g,y=m*g,c.push(this.getRenderTransform(o,a,s,Kt,f,d,y).slice()),_-=m}this.hitDetectionImageData_=Wf(r,c,this.renderedFeatures_,h.getStyleFunction(),l,a,s)}e(Zf(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,e,r,o,a){var s=this;if(!!this.replayGroup_){var u=e.viewState.resolution,l=e.viewState.rotation,h=this.getLayer(),c={},f=function(v,_,m){var g=b(v),y=c[g];if(y){if(y!==!0&&m<y.distanceSq){if(m===0)return c[g]=!0,a.splice(a.lastIndexOf(y),1),o(v,h,_);y.geometry=_,y.distanceSq=m}}else{if(m===0)return c[g]=!0,o(v,h,_);a.push(c[g]={feature:v,layer:h,geometry:_,distanceSq:m,callback:o})}},d,p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some(function(v){return d=v.forEachFeatureAtCoordinate(t,u,l,r,f,v===s.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(function(_){return _.value}):null)}),d}},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},n.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},n.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var o=t.viewHints[gt.ANIMATING],a=t.viewHints[gt.INTERACTING],s=e.getUpdateWhileAnimating(),u=e.getUpdateWhileInteracting();if(!this.dirty_&&!s&&o||!u&&a)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var l=t.extent,h=t.viewState,c=h.projection,f=h.resolution,d=t.pixelRatio,p=e.getRevision(),v=e.getRenderBuffer(),_=e.getRenderOrder();_===void 0&&(_=zf);var m=h.center.slice(),g=mr(l,v*f),y=g.slice(),E=[g.slice()],T=c.getExtent();if(r.getWrapX()&&c.canWrapX()&&!Pe(T,t.extent)){var x=rt(T),R=Math.max(rt(g)/2,x);g[0]=T[0]-R,g[2]=T[2]+R,ha(m,c);var O=qu(E[0],c);O[0]<T[0]&&O[2]<T[2]?E.push([O[0]+x,O[1],O[2]+x,O[3]]):O[0]>T[0]&&O[2]>T[2]&&E.push([O[0]-x,O[1],O[2]-x,O[3]])}if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==p&&this.renderedRenderOrder_==_&&Pe(this.wrappedRenderedExtent_,g))return Ie(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var I=new ss(zi(f,d),g,f,d),A;this.getLayer().getDeclutter()&&(A=new ss(zi(f,d),g,f,d));for(var k,P,X,P=0,X=E.length;P<X;++P)r.loadFeatures(E[P],f,c);var U=Vf(f,d),L=function(V){var J,C=V.getStyleFunction()||e.getStyleFunction();if(C&&(J=C(V,f)),J){var st=this.renderFeature(V,U,J,I,k,A);this.dirty_=this.dirty_||st}}.bind(this),G=va(g),S=r.getFeaturesInExtent(G);_&&S.sort(_);for(var P=0,X=S.length;P<X;++P)L(S[P]);this.renderedFeatures_=S;var K=I.finish(),Z=new cs(g,f,d,r.getOverlaps(),K,e.getRenderBuffer());return A&&(this.declutterExecutorGroup=new cs(g,f,d,r.getOverlaps(),A.finish(),e.getRenderBuffer())),this.renderedResolution_=f,this.renderedRevision_=p,this.renderedRenderOrder_=_,this.renderedExtent_=y,this.wrappedRenderedExtent_=g,this.renderedCenter_=m,this.renderedProjection_=c,this.replayGroup_=Z,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},n.prototype.renderFeature=function(t,e,r,o,a,s){if(!r)return!1;var u=!1;if(Array.isArray(r))for(var l=0,h=r.length;l<h;++l)u=vs(o,t,r[l],e,this.boundHandleStyleImageChange_,a,s)||u;else u=vs(o,t,r,e,this.boundHandleStyleImageChange_,a,s);return u},n}(ls),oc=ic,ac=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sc=function(i){ac(n,i);function n(t){return i.call(this,t)||this}return n.prototype.createRenderer=function(){return new oc(this)},n}($h),U_=sc,uc=function(){function i(n){this.rbush_=new es(n),this.items_={}}return i.prototype.insert=function(n,t){var e={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:t};this.rbush_.insert(e),this.items_[b(t)]=e},i.prototype.load=function(n,t){for(var e=new Array(t.length),r=0,o=t.length;r<o;r++){var a=n[r],s=t[r],u={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};e[r]=u,this.items_[b(s)]=u}this.rbush_.load(e)},i.prototype.remove=function(n){var t=b(n),e=this.items_[t];return delete this.items_[t],this.rbush_.remove(e)!==null},i.prototype.update=function(n,t){var e=this.items_[b(t)],r=[e.minX,e.minY,e.maxX,e.maxY];Nn(r,n)||(this.remove(t),this.insert(n,t))},i.prototype.getAll=function(){var n=this.rbush_.all();return n.map(function(t){return t.value})},i.prototype.getInExtent=function(n){var t={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]},e=this.rbush_.search(t);return e.map(function(r){return r.value})},i.prototype.forEach=function(n){return this.forEach_(this.getAll(),n)},i.prototype.forEachInExtent=function(n,t){return this.forEach_(this.getInExtent(n),t)},i.prototype.forEach_=function(n,t){for(var e,r=0,o=n.length;r<o;r++)if(e=t(n[r]),e)return e;return e},i.prototype.isEmpty=function(){return nn(this.items_)},i.prototype.clear=function(){this.rbush_.clear(),this.items_={}},i.prototype.getExtent=function(n){var t=this.rbush_.toJSON();return $t(t.minX,t.minY,t.maxX,t.maxY,n)},i.prototype.concat=function(n){this.rbush_.load(n.rbush_.all());for(var t in n.items_)this.items_[t]=n.items_[t]},i}(),gs=uc,lc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),hc=function(i){lc(n,i);function n(t){var e=i.call(this)||this;e.projection=ot(t.projection),e.attributions_=ys(t.attributions),e.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,e.loading=!1,e.state_=t.state!==void 0?t.state:Be.READY,e.wrapX_=t.wrapX!==void 0?t.wrapX:!1,e.interpolate_=!!t.interpolate,e.viewResolver=null,e.viewRejector=null;var r=e;return e.viewPromise_=new Promise(function(o,a){r.viewResolver=o,r.viewRejector=a}),e}return n.prototype.getAttributions=function(){return this.attributions_},n.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},n.prototype.getProjection=function(){return this.projection},n.prototype.getResolutions=function(){return M()},n.prototype.getView=function(){return this.viewPromise_},n.prototype.getState=function(){return this.state_},n.prototype.getWrapX=function(){return this.wrapX_},n.prototype.getInterpolate=function(){return this.interpolate_},n.prototype.refresh=function(){this.changed()},n.prototype.setAttributions=function(t){this.attributions_=ys(t),this.changed()},n.prototype.setState=function(t){this.state_=t,this.changed()},n}(At);function ys(i){return i?Array.isArray(i)?function(n){return i}:typeof i=="function"?i:function(n){return[i]}:null}var ms=hc,kt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function fc(i,n){return[[-1/0,-1/0,1/0,1/0]]}var Ze={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"},cc=!1;function dc(i,n,t,e,r,o,a){var s=new XMLHttpRequest;s.open("GET",typeof i=="function"?i(t,e,r):i,!0),n.getType()==Ze.ARRAY_BUFFER&&(s.responseType="arraybuffer"),s.withCredentials=cc,s.onload=function(u){if(!s.status||s.status>=200&&s.status<300){var l=n.getType(),h=void 0;l==Ze.JSON||l==Ze.TEXT?h=s.responseText:l==Ze.XML?(h=s.responseXML,h||(h=new DOMParser().parseFromString(s.responseText,"application/xml"))):l==Ze.ARRAY_BUFFER&&(h=s.response),h?o(n.readFeatures(h,{extent:t,featureProjection:r}),n.readProjection(h)):a()}else a()},s.onerror=a,s.send()}function Es(i,n){return function(t,e,r,o,a){var s=this;dc(i,n,t,e,r,function(u,l){s.addFeatures(u),o!==void 0&&o(u)},a||we)}}var Ts=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),_e=function(i){Ts(n,i);function n(t,e,r){var o=i.call(this,t)||this;return o.feature=e,o.features=r,o}return n}(Ut),pc=function(i){Ts(n,i);function n(t){var e=this,r=t||{};e=i.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:Be.READY,wrapX:r.wrapX!==void 0?r.wrapX:!0})||this,e.on,e.once,e.un,e.loader_=we,e.format_=r.format,e.overlaps_=r.overlaps===void 0?!0:r.overlaps,e.url_=r.url,r.loader!==void 0?e.loader_=r.loader:e.url_!==void 0&&(W(e.format_,7),e.loader_=Es(e.url_,e.format_)),e.strategy_=r.strategy!==void 0?r.strategy:fc;var o=r.useSpatialIndex!==void 0?r.useSpatialIndex:!0;e.featuresRtree_=o?new gs:null,e.loadedExtentsRtree_=new gs,e.loadingExtentsCount_=0,e.nullGeometryFeatures_={},e.idIndex_={},e.uidIndex_={},e.featureChangeKeys_={},e.featuresCollection_=null;var a,s;return Array.isArray(r.features)?s=r.features:r.features&&(a=r.features,s=a.getArray()),!o&&a===void 0&&(a=new Mt(s)),s!==void 0&&e.addFeaturesInternal(s),a!==void 0&&e.bindFeaturesCollection_(a),e}return n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var e=b(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var o=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new _e(kt.ADDFEATURE,t))},n.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[B(e,F.CHANGE,this.handleFeatureChange_,this),B(e,tn.PROPERTYCHANGE,this.handleFeatureChange_,this)]},n.prototype.addToIndex_=function(t,e){var r=!0,o=e.getId();return o!==void 0&&(o.toString()in this.idIndex_?r=!1:this.idIndex_[o.toString()]=e),r&&(W(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],o=[],a=0,s=t.length;a<s;a++){var u=t[a],l=b(u);this.addToIndex_(l,u)&&r.push(u)}for(var a=0,h=r.length;a<h;a++){var u=r[a],l=b(u);this.setupChangeEvents_(l,u);var c=u.getGeometry();if(c){var f=c.getExtent();e.push(f),o.push(u)}else this.nullGeometryFeatures_[l]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,o),this.hasListener(kt.ADDFEATURE))for(var a=0,d=r.length;a<d;a++)this.dispatchEvent(new _e(kt.ADDFEATURE,r[a]))},n.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(kt.ADDFEATURE,function(r){e||(e=!0,t.push(r.feature),e=!1)}),this.addEventListener(kt.REMOVEFEATURE,function(r){e||(e=!0,t.remove(r.feature),e=!1)}),t.addEventListener(Ct.ADD,function(r){e||(e=!0,this.addFeature(r.element),e=!1)}.bind(this)),t.addEventListener(Ct.REMOVE,function(r){e||(e=!0,this.removeFeature(r.element),e=!1)}.bind(this)),this.featuresCollection_=t},n.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){var r=this.featureChangeKeys_[e];r.forEach(q)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var o=function(u){this.removeFeatureInternal(u)}.bind(this);this.featuresRtree_.forEach(o);for(var a in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[a])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var s=new _e(kt.CLEAR);this.dispatchEvent(s),this.changed()},n.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},n.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,function(o){var a=o.getGeometry();if(a.intersectsCoordinate(t))return e(o)})},n.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},n.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(r){var o=r.getGeometry();if(o.intersectsExtent(t)){var a=e(r);if(a)return a}})},n.prototype.getFeaturesCollection=function(){return this.featuresCollection_},n.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),nn(this.nullGeometryFeatures_)||Dt(t,Xo(this.nullGeometryFeatures_))),t},n.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(r){e.push(r)}),e},n.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},n.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],o=t[1],a=null,s=[NaN,NaN],u=1/0,l=[-1/0,-1/0,1/0,1/0],h=e||en;return this.featuresRtree_.forEachInExtent(l,function(c){if(h(c)){var f=c.getGeometry(),d=u;if(u=f.closestPointXY(r,o,s,u),u<d){a=c;var p=Math.sqrt(u);l[0]=r-p,l[1]=o-p,l[2]=r+p,l[3]=o+p}}}),a},n.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},n.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return e!==void 0?e:null},n.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return e!==void 0?e:null},n.prototype.getFormat=function(){return this.format_},n.prototype.getOverlaps=function(){return this.overlaps_},n.prototype.getUrl=function(){return this.url_},n.prototype.handleFeatureChange_=function(t){var e=t.target,r=b(e),o=e.getGeometry();if(!o)r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);else{var a=o.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}var s=e.getId();if(s!==void 0){var u=s.toString();this.idIndex_[u]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[u]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new _e(kt.CHANGEFEATURE,e))},n.prototype.hasFeature=function(t){var e=t.getId();return e!==void 0?e in this.idIndex_:b(t)in this.uidIndex_},n.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&nn(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0},n.prototype.loadFeatures=function(t,e,r){for(var o=this.loadedExtentsRtree_,a=this.strategy_(t,e,r),s=function(c,f){var d=a[c],p=o.forEachInExtent(d,function(v){return Pe(v.extent,d)});p||(++u.loadingExtentsCount_,u.dispatchEvent(new _e(kt.FEATURESLOADSTART)),u.loader_.call(u,d,e,r,function(v){--this.loadingExtentsCount_,this.dispatchEvent(new _e(kt.FEATURESLOADEND,void 0,v))}.bind(u),function(){--this.loadingExtentsCount_,this.dispatchEvent(new _e(kt.FEATURESLOADERROR))}.bind(u)),o.insert(d,{extent:d.slice()}))},u=this,l=0,h=a.length;l<h;++l)s(l);this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0},n.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),i.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var e=this.loadedExtentsRtree_,r;e.forEachInExtent(t,function(o){if(Nn(o.extent,t))return r=o,!0}),r&&e.remove(r)},n.prototype.removeFeature=function(t){if(!!t){var e=b(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);var r=this.removeFeatureInternal(t);r&&this.changed()}},n.prototype.removeFeatureInternal=function(t){var e=b(t),r=this.featureChangeKeys_[e];if(!!r){r.forEach(q),delete this.featureChangeKeys_[e];var o=t.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[e],this.dispatchEvent(new _e(kt.REMOVEFEATURE,t)),t}},n.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},n.prototype.setLoader=function(t){this.loader_=t},n.prototype.setUrl=function(t){W(this.format_,7),this.url_=t,this.setLoader(Es(t,this.format_))},n}(ms),vc=pc;function B_(i,n){return at(i.inversePixelTransform,n.slice(0))}var D={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Cs(i){return Math.pow(i,3)}function Ke(i){return 1-Cs(1-i)}function _c(i){return 3*i*i-2*i*i*i}function gc(i){return i}var yc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),mc=function(i){yc(n,i);function n(t,e,r){var o=i.call(this)||this,a=r||{};return o.tileCoord=t,o.state=e,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return n.prototype.changed=function(){this.dispatchEvent(F.CHANGE)},n.prototype.release=function(){},n.prototype.getKey=function(){return this.key+"/"+this.tileCoord},n.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==D.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},n.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==D.LOADED){t.interimTile=null;break}else t.getState()==D.LOADING?e=t:t.getState()==D.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}},n.prototype.getTileCoord=function(){return this.tileCoord},n.prototype.getState=function(){return this.state},n.prototype.setState=function(t){if(this.state!==D.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){M()},n.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(!r)r=e,this.transitionStarts_[t]=r;else if(r===-1)return 1;var o=e-r+1e3/60;return o>=this.transition_?1:Cs(o/this.transition_)},n.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},n.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},n}(rn),xs=mc,Ec=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Tc=function(i){Ec(n,i);function n(t,e,r,o,a,s){var u=i.call(this,t,e,s)||this;return u.crossOrigin_=o,u.src_=r,u.key=r,u.image_=new Image,o!==null&&(u.image_.crossOrigin=o),u.unlisten_=null,u.tileLoadFunction_=a,u}return n.prototype.getImage=function(){return this.image_},n.prototype.setImage=function(t){this.image_=t,this.state=D.LOADED,this.unlistenImage_(),this.changed()},n.prototype.handleImageError_=function(){this.state=D.ERROR,this.unlistenImage_(),this.image_=Cc(),this.changed()},n.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=D.LOADED:this.state=D.EMPTY,this.unlistenImage_(),this.changed()},n.prototype.load=function(){this.state==D.ERROR&&(this.state=D.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==D.IDLE&&(this.state=D.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ki(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},n.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},n}(xs);function Cc(){var i=Ft(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}var Os=Tc,xc=function(){function i(n,t,e){this.decay_=n,this.minVelocity_=t,this.delay_=e,this.points_=[],this.angle_=0,this.initialVelocity_=0}return i.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},i.prototype.update=function(n,t){this.points_.push(n,t,Date.now())},i.prototype.end=function(){if(this.points_.length<6)return!1;var n=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<n)return!1;for(var e=t-3;e>0&&this.points_[e+2]>n;)e-=3;var r=this.points_[t+2]-this.points_[e+2];if(r<1e3/60)return!1;var o=this.points_[t]-this.points_[e],a=this.points_[t+1]-this.points_[e+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/r,this.initialVelocity_>this.minVelocity_},i.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},i.prototype.getAngle=function(){return this.angle_},i}(),Oc=xc,Rc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ic=function(i){Rc(n,i);function n(t){var e=i.call(this)||this;return e.map_=t,e}return n.prototype.dispatchRenderEvent=function(t,e){M()},n.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;bt(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),pi(o,r)},n.prototype.forEachFeatureAtCoordinate=function(t,e,r,o,a,s,u,l){var h,c=e.viewState;function f(L,G,S,K){return a.call(s,G,L?S:null,K)}var d=c.projection,p=ha(t.slice(),d),v=[[0,0]];if(d.canWrapX()&&o){var _=d.getExtent(),m=rt(_);v.push([-m,0],[m,0])}for(var g=e.layerStatesArray,y=g.length,E=[],T=[],x=0;x<v.length;x++)for(var R=y-1;R>=0;--R){var O=g[R],I=O.layer;if(I.hasRenderer()&&Ur(O,c)&&u.call(l,I)){var A=I.getRenderer(),k=I.getSource();if(A&&k){var P=k.getWrapX()?p:t,X=f.bind(null,O.managed);T[0]=P[0]+v[x][0],T[1]=P[1]+v[x][1],h=A.forEachFeatureAtCoordinate(T,e,r,X,E)}if(h)return h}}if(E.length!==0){var U=1/E.length;return E.forEach(function(L,G){return L.distanceSq+=G*U}),E.sort(function(L,G){return L.distanceSq-G.distanceSq}),E.some(function(L){return h=L.callback(L.feature,L.layer,L.geometry)}),h}},n.prototype.forEachLayerAtPixel=function(t,e,r,o,a){return M()},n.prototype.hasFeatureAtCoordinate=function(t,e,r,o,a,s){var u=this.forEachFeatureAtCoordinate(t,e,r,o,en,this,a,s);return u!==void 0},n.prototype.getMap=function(){return this.map_},n.prototype.renderFrame=function(t){M()},n.prototype.scheduleExpireIconCache=function(t){Vr.canExpireCache()&&t.postRenderFunctions.push(wc)},n}(ci);function wc(i,n){Vr.expire()}var Sc=Ic,Pc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Lc=function(i){Pc(n,i);function n(t){var e=i.call(this,t)||this;e.fontChangeListenerKey_=B(Qt,tn.PROPERTYCHANGE,t.redrawText.bind(t)),e.element_=document.createElement("div");var r=e.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",e.element_.className=je+" ol-layers";var o=t.getViewport();return o.insertBefore(e.element_,o.firstChild||null),e.children_=[],e.renderedVisible_=!0,e}return n.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var o=new us(t,void 0,e);r.dispatchEvent(o)}},n.prototype.disposeInternal=function(){q(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),i.prototype.disposeInternal.call(this)},n.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(fe.PRECOMPOSE,t);var e=t.layerStatesArray.sort(function(d,p){return d.zIndex-p.zIndex}),r=t.viewState;this.children_.length=0;for(var o=[],a=null,s=0,u=e.length;s<u;++s){var l=e[s];t.layerIndex=s;var h=l.layer,c=h.getSourceState();if(!Ur(l,r)||c!=Be.READY&&c!=Be.UNDEFINED){h.unrender();continue}var f=h.render(t,a);!f||(f!==a&&(this.children_.push(f),a=f),"getDeclutter"in h&&o.push(h))}for(var s=o.length-1;s>=0;--s)o[s].renderDeclutter(t);gh(this.element_,this.children_),this.dispatchRenderEvent(fe.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},n.prototype.forEachLayerAtPixel=function(t,e,r,o,a){for(var s=e.viewState,u=e.layerStatesArray,l=u.length,h=l-1;h>=0;--h){var c=u[h],f=c.layer;if(f.hasRenderer()&&Ur(c,s)&&a(f)){var d=f.getRenderer(),p=d.getDataAtPixel(t,e,r);if(p){var v=o(f,p);if(v)return v}}}},n}(Sc),Ac=Lc,Rs=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ge=function(i){Rs(n,i);function n(t,e){var r=i.call(this,t)||this;return r.layer=e,r}return n}(Ut),Vi={LAYERS:"layers"},Mc=function(i){Rs(n,i);function n(t){var e=this,r=t||{},o=ut({},r);delete o.layers;var a=r.layers;return e=i.call(this,o)||this,e.on,e.once,e.un,e.layersListenerKeys_=[],e.listenerKeys_={},e.addChangeListener(Vi.LAYERS,e.handleLayersChanged_),a?Array.isArray(a)?a=new Mt(a.slice(),{unique:!0}):W(typeof a.getArray=="function",43):a=new Mt(void 0,{unique:!0}),e.setLayers(a),e}return n.prototype.handleLayerChange_=function(){this.changed()},n.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(q),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(B(t,Ct.ADD,this.handleLayersAdd_,this),B(t,Ct.REMOVE,this.handleLayersRemove_,this));for(var e in this.listenerKeys_)this.listenerKeys_[e].forEach(q);Pn(this.listenerKeys_);for(var r=t.getArray(),o=0,a=r.length;o<a;o++){var s=r[o];this.registerLayerListeners_(s),this.dispatchEvent(new ge("addlayer",s))}this.changed()},n.prototype.registerLayerListeners_=function(t){var e=[B(t,tn.PROPERTYCHANGE,this.handleLayerChange_,this),B(t,F.CHANGE,this.handleLayerChange_,this)];t instanceof n&&e.push(B(t,"addlayer",this.handleLayerGroupAdd_,this),B(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[b(t)]=e},n.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new ge("addlayer",t.layer))},n.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new ge("removelayer",t.layer))},n.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new ge("addlayer",e)),this.changed()},n.prototype.handleLayersRemove_=function(t){var e=t.element,r=b(e);this.listenerKeys_[r].forEach(q),delete this.listenerKeys_[r],this.dispatchEvent(new ge("removelayer",e)),this.changed()},n.prototype.getLayers=function(){return this.get(Vi.LAYERS)},n.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var r=e.getArray(),o=0,a=r.length;o<a;++o)this.dispatchEvent(new ge("removelayer",r[o]));this.set(Vi.LAYERS,t)},n.prototype.getLayersArray=function(t){var e=t!==void 0?t:[];return this.getLayers().forEach(function(r){r.getLayersArray(e)}),e},n.prototype.getLayerStatesArray=function(t){var e=t!==void 0?t:[],r=e.length;this.getLayers().forEach(function(h){h.getLayerStatesArray(e)});var o=this.getLayerState(),a=o.zIndex;!t&&o.zIndex===void 0&&(a=0);for(var s=r,u=e.length;s<u;s++){var l=e[s];l.opacity*=o.opacity,l.visible=l.visible&&o.visible,l.maxResolution=Math.min(l.maxResolution,o.maxResolution),l.minResolution=Math.max(l.minResolution,o.minResolution),l.minZoom=Math.max(l.minZoom,o.minZoom),l.maxZoom=Math.min(l.maxZoom,o.maxZoom),o.extent!==void 0&&(l.extent!==void 0?l.extent=Gn(l.extent,o.extent):l.extent=o.extent),l.zIndex===void 0&&(l.zIndex=a)}return e},n.prototype.getSourceState=function(){return Be.READY},n}(Qa),br=Mc,Fc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Nc=function(i){Fc(n,i);function n(t,e,r){var o=i.call(this,t)||this;return o.map=e,o.frameState=r!==void 0?r:null,o}return n}(Ut),_n=Nc,Dc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Gc=function(i){Dc(n,i);function n(t,e,r,o,a){var s=i.call(this,t,e,a)||this;return s.originalEvent=r,s.pixel_=null,s.coordinate_=null,s.dragging=o!==void 0?o:!1,s}return Object.defineProperty(n.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(n.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}),n.prototype.preventDefault=function(){i.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},n.prototype.stopPropagation=function(){i.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},n}(_n),ye=Gc,tt={SINGLECLICK:"singleclick",CLICK:F.CLICK,DBLCLICK:F.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},me={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},kc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Xc=function(i){kc(n,i);function n(t,e){var r=i.call(this,t)||this;r.map_=t,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=e===void 0?1:e,r.down_=null;var o=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=o,r.pointerdownListenerKey_=B(o,me.POINTERDOWN,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=B(o,me.POINTERMOVE,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(F.TOUCHMOVE,r.boundHandleTouchMove_,zo?{passive:!1}:!1),r}return n.prototype.emulateClick_=function(t){var e=new ye(tt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new ye(tt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var r=new ye(tt.SINGLECLICK,this.map_,t);this.dispatchEvent(r)}.bind(this),250)},n.prototype.updateActivePointers_=function(t){var e=t;e.type==tt.POINTERUP||e.type==tt.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==tt.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},n.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new ye(tt.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_===0&&(this.dragListenerKeys_.forEach(q),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},n.prototype.isMouseActionButton_=function(t){return t.button===0},n.prototype.handlePointerDown_=function(t){this.emulateClicks_=this.activePointers_===0,this.updateActivePointers_(t);var e=new ye(tt.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_={};for(var r in t){var o=t[r];this.down_[r]=typeof o=="function"?we:o}if(this.dragListenerKeys_.length===0){var a=this.map_.getOwnerDocument();this.dragListenerKeys_.push(B(a,tt.POINTERMOVE,this.handlePointerMove_,this),B(a,tt.POINTERUP,this.handlePointerUp_,this),B(this.element_,tt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==a&&this.dragListenerKeys_.push(B(this.element_.getRootNode(),tt.POINTERUP,this.handlePointerUp_,this))}},n.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new ye(tt.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},n.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new ye(t.type,this.map_,t,e))},n.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()},n.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_},n.prototype.disposeInternal=function(){this.relayedListenerKey_&&(q(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(F.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(q(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(q),this.dragListenerKeys_.length=0,this.element_=null,i.prototype.disposeInternal.call(this)},n}(rn),Yc=Xc,ne={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},pt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},$r=1/0,jc=function(){function i(n,t){this.priorityFunction_=n,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return i.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Pn(this.queuedElements_)},i.prototype.dequeue=function(){var n=this.elements_,t=this.priorities_,e=n[0];n.length==1?(n.length=0,t.length=0):(n[0]=n.pop(),t[0]=t.pop(),this.siftUp_(0));var r=this.keyFunction_(e);return delete this.queuedElements_[r],e},i.prototype.enqueue=function(n){W(!(this.keyFunction_(n)in this.queuedElements_),31);var t=this.priorityFunction_(n);return t!=$r?(this.elements_.push(n),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(n)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},i.prototype.getCount=function(){return this.elements_.length},i.prototype.getLeftChildIndex_=function(n){return n*2+1},i.prototype.getRightChildIndex_=function(n){return n*2+2},i.prototype.getParentIndex_=function(n){return n-1>>1},i.prototype.heapify_=function(){var n;for(n=(this.elements_.length>>1)-1;n>=0;n--)this.siftUp_(n)},i.prototype.isEmpty=function(){return this.elements_.length===0},i.prototype.isKeyQueued=function(n){return n in this.queuedElements_},i.prototype.isQueued=function(n){return this.isKeyQueued(this.keyFunction_(n))},i.prototype.siftUp_=function(n){for(var t=this.elements_,e=this.priorities_,r=t.length,o=t[n],a=e[n],s=n;n<r>>1;){var u=this.getLeftChildIndex_(n),l=this.getRightChildIndex_(n),h=l<r&&e[l]<e[u]?l:u;t[n]=t[h],e[n]=e[h],n=h}t[n]=o,e[n]=a,this.siftDown_(s,n)},i.prototype.siftDown_=function(n,t){for(var e=this.elements_,r=this.priorities_,o=e[t],a=r[t];t>n;){var s=this.getParentIndex_(t);if(r[s]>a)e[t]=e[s],r[t]=r[s],t=s;else break}e[t]=o,r[t]=a},i.prototype.reprioritize=function(){var n=this.priorityFunction_,t=this.elements_,e=this.priorities_,r=0,o=t.length,a,s,u;for(s=0;s<o;++s)a=t[s],u=n(a),u==$r?delete this.queuedElements_[this.keyFunction_(a)]:(e[r]=u,t[r++]=a);t.length=r,e.length=r,this.heapify_()},i}(),Uc=jc,Bc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wc=function(i){Bc(n,i);function n(t,e){var r=i.call(this,function(o){return t.apply(null,o)},function(o){return o[0].getKey()})||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=e,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return n.prototype.enqueue=function(t){var e=i.prototype.enqueue.call(this,t);if(e){var r=t[0];r.addEventListener(F.CHANGE,this.boundHandleTileChange_)}return e},n.prototype.getTilesLoading=function(){return this.tilesLoading_},n.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(r===D.LOADED||r===D.ERROR||r===D.EMPTY){e.removeEventListener(F.CHANGE,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},n.prototype.loadMoreTiles=function(t,e){for(var r=0,o,a,s;this.tilesLoading_<t&&r<e&&this.getCount()>0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===D.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++r,a.load())},n}(Uc),Zc=Wc;function Kc(i,n,t,e,r){if(!i||!(t in i.wantedTiles)||!i.wantedTiles[t][n.getKey()])return $r;var o=i.viewState.center,a=e[0]-o[0],s=e[1]-o[1];return 65536*Math.log(r)+Math.sqrt(a*a+s*s)/r}var Xt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},zc=42,bi=256;function Is(i,n,t){return function(e,r,o,a,s){if(!!e){if(!r&&!n)return e;var u=n?0:o[0]*r,l=n?0:o[1]*r,h=s?s[0]:0,c=s?s[1]:0,f=i[0]+u/2+h,d=i[2]-u/2+h,p=i[1]+l/2+c,v=i[3]-l/2+c;f>d&&(f=(d+f)/2,d=f),p>v&&(p=(v+p)/2,v=p);var _=it(e[0],f,d),m=it(e[1],p,v);if(a&&t&&r){var g=30*r;_+=-g*Math.log(1+Math.max(0,f-e[0])/g)+g*Math.log(1+Math.max(0,e[0]-d)/g),m+=-g*Math.log(1+Math.max(0,p-e[1])/g)+g*Math.log(1+Math.max(0,e[1]-v)/g)}return[_,m]}}}function Vc(i){return i}function $i(i,n,t,e){var r=rt(n)/t[0],o=Gt(n)/t[1];return e?Math.min(i,Math.max(r,o)):Math.min(i,Math.min(r,o))}function Hi(i,n,t){var e=Math.min(i,n),r=50;return e*=Math.log(1+r*Math.max(0,i/n-1))/r+1,t&&(e=Math.max(e,t),e/=Math.log(1+r*Math.max(0,t/i-1))/r+1),it(e,t/2,n*2)}function bc(i,n,t,e){return function(r,o,a,s){if(r!==void 0){var u=i[0],l=i[i.length-1],h=t?$i(u,t,a,e):u;if(s){var c=n!==void 0?n:!0;return c?Hi(r,h,l):it(r,l,h)}var f=Math.min(h,r),d=Math.floor(di(i,f,o));return i[d]>h&&d<i.length-1?i[d+1]:i[d]}else return}}function $c(i,n,t,e,r,o){return function(a,s,u,l){if(a!==void 0){var h=r?$i(n,r,u,o):n,c=t!==void 0?t:0;if(l){var f=e!==void 0?e:!0;return f?Hi(a,h,c):it(a,c,h)}var d=1e-9,p=Math.ceil(Math.log(n/h)/Math.log(i)-d),v=-s*(.5-d)+.5,_=Math.min(h,a),m=Math.floor(Math.log(n/_)/Math.log(i)+v),g=Math.max(p,m),y=n/Math.pow(i,g);return it(y,c,h)}else return}}function ws(i,n,t,e,r){return function(o,a,s,u){if(o!==void 0){var l=e?$i(i,e,s,r):i,h=t!==void 0?t:!0;return!h||!u?it(o,n,l):Hi(o,l,n)}else return}}function qi(i){if(i!==void 0)return 0}function Ss(i){if(i!==void 0)return i}function Hc(i){var n=2*Math.PI/i;return function(t,e){if(e)return t;if(t!==void 0)return t=Math.floor(t/n+.5)*n,t}}function qc(i){var n=i||Me(5);return function(t,e){if(e)return t;if(t!==void 0)return Math.abs(t)<=n?0:t}}var Jc=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ji=0,Qc=function(i){Jc(n,i);function n(t){var e=i.call(this)||this;e.on,e.once,e.un;var r=ut({},t);return e.hints_=[0,0],e.animations_=[],e.updateAnimationKey_,e.projection_=Ri(r.projection,"EPSG:3857"),e.viewportSize_=[100,100],e.targetCenter_=null,e.targetResolution_,e.targetRotation_,e.nextCenter_=null,e.nextResolution_,e.nextRotation_,e.cancelAnchor_=void 0,r.projection&&_l(),r.center&&(r.center=qt(r.center,e.projection_)),r.extent&&(r.extent=De(r.extent,e.projection_)),e.applyOptions_(r),e}return n.prototype.applyOptions_=function(t){var e=ut({},t);for(var r in Xt)delete e[r];this.setProperties(e,!0);var o=ed(t);this.maxResolution_=o.maxResolution,this.minResolution_=o.minResolution,this.zoomFactor_=o.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=o.minZoom;var a=td(t),s=o.constraint,u=nd(t);this.constraints_={center:a,resolution:s,rotation:u},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)},Object.defineProperty(n.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var r=this.getCenter();if(r){var o=t||[0,0,0,0];e=e||[0,0,0,0];var a=this.getResolution(),s=a/2*(o[3]-e[3]+e[1]-o[1]),u=a/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([r[0]+s,r[1]-u])}},enumerable:!1,configurable:!0}),n.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),ut({},e,t)},n.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 o=arguments[r];o.center&&(o=ut({},o),o.center=qt(o.center,this.getProjection())),o.anchor&&(o=ut({},o),o.anchor=qt(o.anchor,this.getProjection())),e[r]=o}this.animateInternal.apply(this,e)},n.prototype.animateInternal=function(t){var e=arguments.length,r;e>1&&typeof arguments[e-1]=="function"&&(r=arguments[e-1],--e);for(var o=0;o<e&&!this.isDef();++o){var a=arguments[o];a.center&&this.setCenterInternal(a.center),a.zoom!==void 0?this.setZoom(a.zoom):a.resolution&&this.setResolution(a.resolution),a.rotation!==void 0&&this.setRotation(a.rotation)}if(o===e){r&&Hr(r,!0);return}for(var s=Date.now(),u=this.targetCenter_.slice(),l=this.targetResolution_,h=this.targetRotation_,c=[];o<e;++o){var f=arguments[o],d={start:s,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||_c,callback:r};if(f.center&&(d.sourceCenter=u,d.targetCenter=f.center.slice(),u=d.targetCenter),f.zoom!==void 0?(d.sourceResolution=l,d.targetResolution=this.getResolutionForZoom(f.zoom),l=d.targetResolution):f.resolution&&(d.sourceResolution=l,d.targetResolution=f.resolution,l=d.targetResolution),f.rotation!==void 0){d.sourceRotation=h;var p=an(f.rotation-h+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=h+p,h=d.targetRotation}rd(d)?d.complete=!0:s+=d.duration,c.push(d)}this.animations_.push(c),this.setHint(gt.ANIMATING,1),this.updateAnimations_()},n.prototype.getAnimating=function(){return this.hints_[gt.ANIMATING]>0},n.prototype.getInteracting=function(){return this.hints_[gt.INTERACTING]>0},n.prototype.cancelAnimations=function(){this.setHint(gt.ANIMATING,-this.hints_[gt.ANIMATING]);for(var t,e=0,r=this.animations_.length;e<r;++e){var o=this.animations_[e];if(o[0].callback&&Hr(o[0].callback,!1),!t)for(var a=0,s=o.length;a<s;++a){var u=o[a];if(!u.complete){t=u.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},n.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==void 0&&(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 o=this.animations_[r],a=!0,s=0,u=o.length;s<u;++s){var l=o[s];if(!l.complete){var h=t-l.start,c=l.duration>0?h/l.duration:1;c>=1?(l.complete=!0,c=1):a=!1;var f=l.easing(c);if(l.sourceCenter){var d=l.sourceCenter[0],p=l.sourceCenter[1],v=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;var m=d+f*(v-d),g=p+f*(_-p);this.targetCenter_=[m,g]}if(l.sourceResolution&&l.targetResolution){var y=f===1?l.targetResolution:l.sourceResolution+f*(l.targetResolution-l.sourceResolution);if(l.anchor){var E=this.getViewportSize_(this.getRotation()),T=this.constraints_.resolution(y,0,E,!0);this.targetCenter_=this.calculateCenterZoom(T,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){var x=f===1?an(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+f*(l.targetRotation-l.sourceRotation);if(l.anchor){var R=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(R,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!l.complete)break}}if(a){this.animations_[r]=null,this.setHint(gt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&Hr(O,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},n.prototype.calculateCenterRotate=function(t,e){var r,o=this.getCenterInternal();return o!==void 0&&(r=[o[0]-e[0],o[1]-e[1]],Ti(r,t-this.getRotation()),ua(r,e)),r},n.prototype.calculateCenterZoom=function(t,e){var r,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=e[0]-t*(e[0]-o[0])/a,u=e[1]-t*(e[1]-o[1])/a;r=[s,u]}return r},n.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],o=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(o*Math.cos(t))]}else return e},n.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&Ii(t,this.getProjection())},n.prototype.getCenterInternal=function(){return this.get(Xt.CENTER)},n.prototype.getConstraints=function(){return this.constraints_},n.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},n.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},n.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return va(e,this.getProjection())},n.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();W(r,1);var o=this.getResolution();W(o!==void 0,2);var a=this.getRotation();return W(a!==void 0,3),yi(r,o,a,e)},n.prototype.getMaxResolution=function(){return this.maxResolution_},n.prototype.getMinResolution=function(){return this.minResolution_},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},n.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},n.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},n.prototype.getProjection=function(){return this.projection_},n.prototype.getResolution=function(){return this.get(Xt.RESOLUTION)},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(De(t,this.getProjection()),e)},n.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),o=rt(t)/r[0],a=Gt(t)/r[1];return Math.max(o,a)},n.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(r/o)/Math.log(e);return function(s){var u=r/Math.pow(e,s*a);return u}},n.prototype.getRotation=function(){return this.get(Xt.ROTATION)},n.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(r/o)/e;return function(s){var u=Math.log(r/s)/e/a;return u}},n.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},n.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),r=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=Qi(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],e,r)}return{center:o.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:r,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t},n.prototype.getZoomForResolution=function(t){var e=this.minZoom_||0,r,o;if(this.resolutions_){var a=di(this.resolutions_,t,1);e=a,r=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=r/this.resolutions_[a+1]}else r=this.maxResolution_,o=this.zoomFactor_;return e+Math.log(r/t)/Math.log(o)},n.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=it(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,it(t-e,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},n.prototype.fit=function(t,e){var r;if(W(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){W(!mi(t),25);var o=De(t,this.getProjection());r=Aa(o)}else if(t.getType()===w.CIRCLE){var o=De(t.getExtent(),this.getProjection());r=Aa(o),r.rotate(this.getRotation(),le(o))}else{var a=Cl();a?r=t.clone().transform(a,this.getProjection()):r=t}this.fitInternal(r,e)},n.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),r=Math.cos(e),o=Math.sin(-e),a=t.getFlatCoordinates(),s=t.getStride(),u=1/0,l=1/0,h=-1/0,c=-1/0,f=0,d=a.length;f<d;f+=s){var p=a[f]*r-a[f+1]*o,v=a[f]*o+a[f+1]*r;u=Math.min(u,p),l=Math.min(l,v),h=Math.max(h,p),c=Math.max(c,v)}return[u,l,h,c]},n.prototype.fitInternal=function(t,e){var r=e||{},o=r.size;o||(o=this.getViewportSizeMinusPadding_());var a=r.padding!==void 0?r.padding:[0,0,0,0],s=r.nearest!==void 0?r.nearest:!1,u;r.minResolution!==void 0?u=r.minResolution:r.maxZoom!==void 0?u=this.getResolutionForZoom(r.maxZoom):u=0;var l=this.rotatedExtentForGeometry(t),h=this.getResolutionForExtentInternal(l,[o[0]-a[1]-a[3],o[1]-a[0]-a[2]]);h=isNaN(h)?u:Math.max(h,u),h=this.getConstrainedResolution(h,s?0:1);var c=this.getRotation(),f=Math.sin(c),d=Math.cos(c),p=le(l);p[0]+=(a[1]-a[3])/2*h,p[1]+=(a[0]-a[2])/2*h;var v=p[0]*d-p[1]*f,_=p[1]*d+p[0]*f,m=this.getConstrainedCenter([v,_],h),g=r.callback?r.callback:we;r.duration!==void 0?this.animateInternal({resolution:h,center:m,duration:r.duration,easing:r.easing},g):(this.targetResolution_=h,this.targetCenter_=m,this.applyTargetState_(!1,!0),Hr(g,!0))},n.prototype.centerOn=function(t,e,r){this.centerOnInternal(qt(t,this.getProjection()),e,r)},n.prototype.centerOnInternal=function(t,e,r){this.setCenterInternal(Qi(t,e,r,this.getResolution(),this.getRotation()))},n.prototype.calculateCenterShift=function(t,e,r,o){var a,s=this.padding_;if(s&&t){var u=this.getViewportSizeMinusPadding_(-r),l=Qi(t,o,[u[0]/2+s[3],u[1]/2+s[0]],e,r);a=[t[0]-l[0],t[1]-l[1]]}return a},n.prototype.isDef=function(){return!!this.getCenterInternal()&&this.getResolution()!==void 0},n.prototype.adjustCenter=function(t){var e=Ii(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},n.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},n.prototype.adjustResolution=function(t,e){var r=e&&qt(e,this.getProjection());this.adjustResolutionInternal(t,r)},n.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),a=this.constraints_.resolution(this.targetResolution_*t,0,o,r);e&&(this.targetCenter_=this.calculateCenterZoom(a,e)),this.targetResolution_*=t,this.applyTargetState_()},n.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},n.prototype.adjustRotation=function(t,e){e&&(e=qt(e,this.getProjection())),this.adjustRotationInternal(t,e)},n.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},n.prototype.setCenter=function(t){this.setCenterInternal(t&&qt(t,this.getProjection()))},n.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},n.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},n.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},n.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},n.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},n.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,r),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,0,a,r),u=this.constraints_.center(this.targetCenter_,s,a,r,this.calculateCenterShift(this.targetCenter_,s,o,a));this.get(Xt.ROTATION)!==o&&this.set(Xt.ROTATION,o),this.get(Xt.RESOLUTION)!==s&&(this.set(Xt.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),(!u||!this.get(Xt.CENTER)||!wr(this.get(Xt.CENTER),u))&&this.set(Xt.CENTER,u),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},n.prototype.resolveConstraints=function(t,e,r){var o=t!==void 0?t:200,a=e||0,s=this.constraints_.rotation(this.targetRotation_),u=this.getViewportSize_(s),l=this.constraints_.resolution(this.targetResolution_,a,u),h=this.constraints_.center(this.targetCenter_,l,u,!1,this.calculateCenterShift(this.targetCenter_,l,s,u));if(o===0&&!this.cancelAnchor_){this.targetResolution_=l,this.targetRotation_=s,this.targetCenter_=h,this.applyTargetState_();return}var c=r||(o===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==l||this.getRotation()!==s||!this.getCenterInternal()||!wr(this.getCenterInternal(),h))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:h,resolution:l,duration:o,easing:Ke,anchor:c}))},n.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(gt.INTERACTING,1)},n.prototype.endInteraction=function(t,e,r){var o=r&&qt(r,this.getProjection());this.endInteractionInternal(t,e,o)},n.prototype.endInteractionInternal=function(t,e,r){this.setHint(gt.INTERACTING,-1),this.resolveConstraints(t,e,r)},n.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},n.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},n.prototype.getConstrainedResolution=function(t,e){var r=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,o)},n}(At);function Hr(i,n){setTimeout(function(){i(n)},0)}function td(i){if(i.extent!==void 0){var n=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return Is(i.extent,i.constrainOnlyCenter,n)}var t=Ri(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&t.isGlobal()){var e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Is(e,!1,!1)}return Vc}function ed(i){var n,t,e,r=28,o=2,a=i.minZoom!==void 0?i.minZoom:Ji,s=i.maxZoom!==void 0?i.maxZoom:r,u=i.zoomFactor!==void 0?i.zoomFactor:o,l=i.multiWorld!==void 0?i.multiWorld:!1,h=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,c=i.showFullExtent!==void 0?i.showFullExtent:!1,f=Ri(i.projection,"EPSG:3857"),d=f.getExtent(),p=i.constrainOnlyCenter,v=i.extent;if(!l&&!v&&f.isGlobal()&&(p=!1,v=d),i.resolutions!==void 0){var _=i.resolutions;t=_[a],e=_[s]!==void 0?_[s]:_[_.length-1],i.constrainResolution?n=bc(_,h,!p&&v,c):n=ws(t,e,h,!p&&v,c)}else{var m=d?Math.max(rt(d),Gt(d)):360*Bt[Vt.DEGREES]/f.getMetersPerUnit(),g=m/bi/Math.pow(o,Ji),y=g/Math.pow(o,r-Ji);t=i.maxResolution,t!==void 0?a=0:t=g/Math.pow(u,a),e=i.minResolution,e===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?e=t/Math.pow(u,s):e=g/Math.pow(u,s):e=y),s=a+Math.floor(Math.log(t/e)/Math.log(u)),e=t/Math.pow(u,s-a),i.constrainResolution?n=$c(u,t,e,h,!p&&v,c):n=ws(t,e,h,!p&&v,c)}return{constraint:n,maxResolution:t,minResolution:e,minZoom:a,zoomFactor:u}}function nd(i){var n=i.enableRotation!==void 0?i.enableRotation:!0;if(n){var t=i.constrainRotation;return t===void 0||t===!0?qc():t===!1?Ss:typeof t=="number"?Hc(t):Ss}else return qi}function rd(i){return!(i.sourceCenter&&i.targetCenter&&!wr(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Qi(i,n,t,e,r){var o=Math.cos(-r),a=Math.sin(-r),s=i[0]*o-i[1]*a,u=i[1]*o+i[0]*a;s+=(n[0]/2-t[0])*e,u+=(t[1]-n[1]/2)*e,a=-a;var l=s*o-u*a,h=u*o+s*a;return[l,h]}var ze=Qc,id=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();function Ps(i){if(i instanceof Br){i.setMapInternal(null);return}i instanceof br&&i.getLayers().forEach(Ps)}function Ls(i,n){if(i instanceof Br){i.setMapInternal(n);return}if(i instanceof br)for(var t=i.getLayers().getArray(),e=0,r=t.length;e<r;++e)Ls(t[e],n)}var od=function(i){id(n,i);function n(t){var e=i.call(this)||this;e.on,e.once,e.un;var r=ad(t);e.renderComplete_,e.loaded_=!0,e.boundHandleBrowserEvent_=e.handleBrowserEvent.bind(e),e.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,e.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:Ko,e.postRenderTimeoutHandle_,e.animationDelayKey_,e.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(e),e.coordinateToPixelTransform_=Wt(),e.pixelToCoordinateTransform_=Wt(),e.frameIndex_=0,e.frameState_=null,e.previousExtent_=null,e.viewPropertyListenerKey_=null,e.viewChangeListenerKey_=null,e.layerGroupPropertyListenerKeys_=null,e.viewport_=document.createElement("div"),e.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),e.viewport_.style.position="relative",e.viewport_.style.overflow="hidden",e.viewport_.style.width="100%",e.viewport_.style.height="100%",e.overlayContainer_=document.createElement("div"),e.overlayContainer_.style.position="absolute",e.overlayContainer_.style.zIndex="0",e.overlayContainer_.style.width="100%",e.overlayContainer_.style.height="100%",e.overlayContainer_.style.pointerEvents="none",e.overlayContainer_.className="ol-overlaycontainer",e.viewport_.appendChild(e.overlayContainer_),e.overlayContainerStopEvent_=document.createElement("div"),e.overlayContainerStopEvent_.style.position="absolute",e.overlayContainerStopEvent_.style.zIndex="0",e.overlayContainerStopEvent_.style.width="100%",e.overlayContainerStopEvent_.style.height="100%",e.overlayContainerStopEvent_.style.pointerEvents="none",e.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",e.viewport_.appendChild(e.overlayContainerStopEvent_),e.mapBrowserEventHandler_=null,e.moveTolerance_=t.moveTolerance,e.keyboardEventTarget_=r.keyboardEventTarget,e.targetChangeHandlerKeys_=null,e.controls=r.controls||new Mt,e.interactions=r.interactions||new Mt,e.overlays_=r.overlays,e.overlayIdIndex_={},e.renderer_=null,e.postRenderFunctions_=[],e.tileQueue_=new Zc(e.getTilePriority.bind(e),e.handleTileChange_.bind(e)),e.addChangeListener(pt.LAYERGROUP,e.handleLayerGroupChanged_),e.addChangeListener(pt.VIEW,e.handleViewChanged_),e.addChangeListener(pt.SIZE,e.handleSizeChanged_),e.addChangeListener(pt.TARGET,e.handleTargetChanged_),e.setProperties(r.values);var o=e;return t.view&&!(t.view instanceof ze)&&t.view.then(function(a){o.setView(new ze(a))}),e.controls.addEventListener(Ct.ADD,function(a){a.element.setMap(this)}.bind(e)),e.controls.addEventListener(Ct.REMOVE,function(a){a.element.setMap(null)}.bind(e)),e.interactions.addEventListener(Ct.ADD,function(a){a.element.setMap(this)}.bind(e)),e.interactions.addEventListener(Ct.REMOVE,function(a){a.element.setMap(null)}.bind(e)),e.overlays_.addEventListener(Ct.ADD,function(a){this.addOverlayInternal_(a.element)}.bind(e)),e.overlays_.addEventListener(Ct.REMOVE,function(a){var s=a.element,u=s.getId();u!==void 0&&delete this.overlayIdIndex_[u.toString()],a.element.setMap(null)}.bind(e)),e.controls.forEach(function(a){a.setMap(this)}.bind(e)),e.interactions.forEach(function(a){a.setMap(this)}.bind(e)),e.overlays_.forEach(e.addOverlayInternal_.bind(e)),e}return n.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},n.prototype.addControl=function(t){this.getControls().push(t)},n.prototype.addInteraction=function(t){this.getInteractions().push(t)},n.prototype.addLayer=function(t){var e=this.getLayerGroup().getLayers();e.push(t)},n.prototype.handleLayerAdd_=function(t){Ls(t.layer,this)},n.prototype.addOverlay=function(t){this.getOverlays().push(t)},n.prototype.addOverlayInternal_=function(t){var e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},n.prototype.disposeInternal=function(){this.setTarget(null),i.prototype.disposeInternal.call(this)},n.prototype.forEachFeatureAtPixel=function(t,e,r){if(!(!this.frameState_||!this.renderer_)){var o=this.getCoordinateFromPixelInternal(t);r=r!==void 0?r:{};var a=r.hitTolerance!==void 0?r.hitTolerance:0,s=r.layerFilter!==void 0?r.layerFilter:en,u=r.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,a,u,e,null,s,null)}},n.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,function(o){r.push(o)},e),r},n.prototype.getAllLayers=function(){var t=[];function e(r){r.forEach(function(o){o instanceof br?e(o.getLayers()):t.push(o)})}return e(this.getLayers()),t},n.prototype.forEachLayerAtPixel=function(t,e,r){if(!(!this.frameState_||!this.renderer_)){var o=r||{},a=o.hitTolerance!==void 0?o.hitTolerance:0,s=o.layerFilter||en;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,a,e,s)}},n.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var r=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};var o=e.layerFilter!==void 0?e.layerFilter:en,a=e.hitTolerance!==void 0?e.hitTolerance:0,s=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,a,s,o,null)},n.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},n.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},n.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},n.prototype.getTarget=function(){return this.get(pt.TARGET)},n.prototype.getTargetElement=function(){var t=this.getTarget();return t!==void 0?typeof t=="string"?document.getElementById(t):t:null},n.prototype.getCoordinateFromPixel=function(t){return Ii(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},n.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?at(e.pixelToCoordinateTransform,t.slice()):null},n.prototype.getControls=function(){return this.controls},n.prototype.getOverlays=function(){return this.overlays_},n.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null},n.prototype.getInteractions=function(){return this.interactions},n.prototype.getLayerGroup=function(){return this.get(pt.LAYERGROUP)},n.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof Mt){e.setLayers(t);return}var r=e.getLayers();r.clear(),r.extend(t)},n.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t},n.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var o=t[e];if(!!o.visible){var a=o.layer.getRenderer();if(a&&!a.ready)return!0;var s=o.layer.getSource();if(s&&s.loading)return!0}}return!1},n.prototype.getPixelFromCoordinate=function(t){var e=qt(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},n.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?at(e.coordinateToPixelTransform,t.slice(0,2)):null},n.prototype.getRenderer=function(){return this.renderer_},n.prototype.getSize=function(){return this.get(pt.SIZE)},n.prototype.getView=function(){return this.get(pt.VIEW)},n.prototype.getViewport=function(){return this.viewport_},n.prototype.getOverlayContainer=function(){return this.overlayContainer_},n.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},n.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},n.prototype.getTilePriority=function(t,e,r,o){return Kc(this.frameState_,t,e,r,o)},n.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,o=new ye(r,this,t);this.handleMapBrowserEvent(o)},n.prototype.handleMapBrowserEvent=function(t){if(!!this.frameState_){var e=t.originalEvent,r=e.type;if(r===me.POINTERDOWN||r===F.WHEEL||r===F.KEYDOWN){var o=this.getOwnerDocument(),a=this.viewport_.getRootNode?this.viewport_.getRootNode():o,s=e.target;if(this.overlayContainerStopEvent_.contains(s)||!(a===o?o.documentElement:a).contains(s))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1)for(var u=this.getInteractions().getArray().slice(),l=u.length-1;l>=0;l--){var h=u[l];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var c=h.handleEvent(t);if(!c||t.propagationStopped)break}}}},n.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,o=r;if(t){var a=t.viewHints;if(a[gt.ANIMATING]||a[gt.INTERACTING]){var s=Date.now()-t.time>8;r=s?0:8,o=s?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,o))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(fe.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(fe.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new _n(ne.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new _n(ne.LOADSTART,this,t))));for(var u=this.postRenderFunctions_,l=0,h=u.length;l<h;++l)u[l](this,t);u.length=0},n.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},n.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)q(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(F.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(F.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Gr(this.viewport_)}var r=this.getTargetElement();if(!r)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);else{r.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Yc(this,this.moveTolerance_);for(var o in tt)this.mapBrowserEventHandler_.addEventListener(tt[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(F.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(F.WHEEL,this.boundHandleBrowserEvent_,zo?{passive:!1}:!1);var a=this.getOwnerDocument().defaultView,s=this.keyboardEventTarget_?this.keyboardEventTarget_:r;this.targetChangeHandlerKeys_=[B(s,F.KEYDOWN,this.handleBrowserEvent,this),B(s,F.KEYPRESS,this.handleBrowserEvent,this),B(a,F.RESIZE,this.updateSize,this)]}this.updateSize()},n.prototype.handleTileChange_=function(){this.render()},n.prototype.handleViewPropertyChanged_=function(){this.render()},n.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(q(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(q(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=B(t,tn.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=B(t,F.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},n.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(q),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new ge("addlayer",t)),this.layerGroupPropertyListenerKeys_=[B(t,tn.PROPERTYCHANGE,this.render,this),B(t,F.CHANGE,this.render,this),B(t,"addlayer",this.handleLayerAdd_,this),B(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},n.prototype.isRendered=function(){return!!this.frameState_},n.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},n.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var o=t[e].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},n.prototype.render=function(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},n.prototype.removeControl=function(t){return this.getControls().remove(t)},n.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},n.prototype.removeLayer=function(t){var e=this.getLayerGroup().getLayers();return e.remove(t)},n.prototype.handleLayerRemove_=function(t){Ps(t.layer)},n.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},n.prototype.renderFrame_=function(t){var e=this,r=this.getSize(),o=this.getView(),a=this.frameState_,s=null;if(r!==void 0&&Ga(r)&&o&&o.isDef()){var u=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=o.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:yi(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:u,wantedTiles:{},mapId:b(this),renderTargets:{}},l.nextCenter&&l.nextResolution){var h=isNaN(l.nextRotation)?l.rotation:l.nextRotation;s.nextExtent=yi(l.nextCenter,l.nextResolution,h,r)}}if(this.frameState_=s,this.renderer_.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),a){var c=!this.previousExtent_||!mi(this.previousExtent_)&&!Nn(s.extent,this.previousExtent_);c&&(this.dispatchEvent(new _n(ne.MOVESTART,this,a)),this.previousExtent_=Fn(this.previousExtent_))}var f=this.previousExtent_&&!s.viewHints[gt.ANIMATING]&&!s.viewHints[gt.INTERACTING]&&!Nn(s.extent,this.previousExtent_);f&&(this.dispatchEvent(new _n(ne.MOVEEND,this,s)),Ho(s.extent,this.previousExtent_))}this.dispatchEvent(new _n(ne.POSTRENDER,this,s)),this.renderComplete_=this.hasListener(ne.LOADSTART)||this.hasListener(ne.LOADEND)||this.hasListener(fe.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()},0))},n.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new ge("removelayer",e)),this.set(pt.LAYERGROUP,t)},n.prototype.setSize=function(t){this.set(pt.SIZE,t)},n.prototype.setTarget=function(t){this.set(pt.TARGET,t)},n.prototype.setView=function(t){if(!t||t instanceof ze){this.set(pt.VIEW,t);return}this.set(pt.VIEW,new ze);var e=this;t.then(function(r){e.setView(new ze(r))})},n.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var r=getComputedStyle(t),o=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),a=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(e=[o,a],!Ga(e)&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(e),this.updateViewportSize_()},n.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)}},n}(At);function ad(i){var n=null;i.keyboardEventTarget!==void 0&&(n=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);var t={},e=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new br({layers:i.layers});t[pt.LAYERGROUP]=e,t[pt.TARGET]=i.target,t[pt.VIEW]=i.view instanceof ze?i.view:new ze;var r;i.controls!==void 0&&(Array.isArray(i.controls)?r=new Mt(i.controls.slice()):(W(typeof i.controls.getArray=="function",47),r=i.controls));var o;i.interactions!==void 0&&(Array.isArray(i.interactions)?o=new Mt(i.interactions.slice()):(W(typeof i.interactions.getArray=="function",48),o=i.interactions));var a;return i.overlays!==void 0?Array.isArray(i.overlays)?a=new Mt(i.overlays.slice()):(W(typeof i.overlays.getArray=="function",49),a=i.overlays):a=new Mt,{controls:r,interactions:o,keyboardEventTarget:n,overlays:a,values:t}}var sd=od,ud=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ld=function(i){ud(n,i);function n(t){var e=i.call(this)||this,r=t.element;return r&&!t.target&&!r.style.pointerEvents&&(r.style.pointerEvents="auto"),e.element=r||null,e.target_=null,e.map_=null,e.listenerKeys=[],t.render&&(e.render=t.render),t.target&&e.setTarget(t.target),e}return n.prototype.disposeInternal=function(){Gr(this.element),i.prototype.disposeInternal.call(this)},n.prototype.getMap=function(){return this.map_},n.prototype.setMap=function(t){this.map_&&Gr(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)q(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){var o=this.target_?this.target_:t.getOverlayContainerStopEvent();o.appendChild(this.element),this.render!==we&&this.listenerKeys.push(B(t,ne.POSTRENDER,this.render,this)),t.render()}},n.prototype.render=function(t){},n.prototype.setTarget=function(t){this.target_=typeof t=="string"?document.getElementById(t):t},n}(At),tr=ld,hd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),fd=function(i){hd(n,i);function n(t){var e=this,r=t||{};e=i.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this,e.ulElement_=document.createElement("ul"),e.collapsed_=r.collapsed!==void 0?r.collapsed:!0,e.userCollapsed_=e.collapsed_,e.overrideCollapsible_=r.collapsible!==void 0,e.collapsible_=r.collapsible!==void 0?r.collapsible:!0,e.collapsible_||(e.collapsed_=!1);var o=r.className!==void 0?r.className:"ol-attribution",a=r.tipLabel!==void 0?r.tipLabel:"Attributions",s=r.expandClassName!==void 0?r.expandClassName:o+"-expand",u=r.collapseLabel!==void 0?r.collapseLabel:"\u203A",l=r.collapseClassName!==void 0?r.collapseClassName:o+"-collapse";typeof u=="string"?(e.collapseLabel_=document.createElement("span"),e.collapseLabel_.textContent=u,e.collapseLabel_.className=l):e.collapseLabel_=u;var h=r.label!==void 0?r.label:"i";typeof h=="string"?(e.label_=document.createElement("span"),e.label_.textContent=h,e.label_.className=s):e.label_=h;var c=e.collapsible_&&!e.collapsed_?e.collapseLabel_:e.label_;e.toggleButton_=document.createElement("button"),e.toggleButton_.setAttribute("type","button"),e.toggleButton_.setAttribute("aria-expanded",String(!e.collapsed_)),e.toggleButton_.title=a,e.toggleButton_.appendChild(c),e.toggleButton_.addEventListener(F.CLICK,e.handleClick_.bind(e),!1);var f=o+" "+je+" "+jn+(e.collapsed_&&e.collapsible_?" "+Wa:"")+(e.collapsible_?"":" ol-uncollapsible"),d=e.element;return d.className=f,d.appendChild(e.toggleButton_),d.appendChild(e.ulElement_),e.renderedAttributions_=[],e.renderedVisible_=!0,e}return n.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],o=!0,a=t.layerStatesArray,s=0,u=a.length;s<u;++s){var l=a[s];if(!!Ur(l,t.viewState)){var h=l.layer.getSource();if(!!h){var c=h.getAttributions();if(!!c){var f=c(t);if(!!f)if(o=o&&h.getAttributionsCollapsible()!==!1,Array.isArray(f))for(var d=0,p=f.length;d<p;++d)f[d]in e||(r.push(f[d]),e[f[d]]=!0);else f in e||(r.push(f),e[f]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),r},n.prototype.updateElement_=function(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!Ie(e,this.renderedAttributions_)){Ua(this.ulElement_);for(var o=0,a=e.length;o<a;++o){var s=document.createElement("li");s.innerHTML=e[o],this.ulElement_.appendChild(s)}this.renderedAttributions_=e}},n.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},n.prototype.handleToggle_=function(){this.element.classList.toggle(Wa),this.collapsed_?Dr(this.collapseLabel_,this.label_):Dr(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},n.prototype.getCollapsible=function(){return this.collapsible_},n.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},n.prototype.setCollapsed=function(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()},n.prototype.getCollapsed=function(){return this.collapsed_},n.prototype.render=function(t){this.updateElement_(t.frameState)},n}(tr),cd=fd,dd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),pd=function(i){dd(n,i);function n(t){var e=this,r=t||{};e=i.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var o=r.className!==void 0?r.className:"ol-rotate",a=r.label!==void 0?r.label:"\u21E7",s=r.compassClassName!==void 0?r.compassClassName:"ol-compass";e.label_=null,typeof a=="string"?(e.label_=document.createElement("span"),e.label_.className=s,e.label_.textContent=a):(e.label_=a,e.label_.classList.add(s));var u=r.tipLabel?r.tipLabel:"Reset rotation",l=document.createElement("button");l.className=o+"-reset",l.setAttribute("type","button"),l.title=u,l.appendChild(e.label_),l.addEventListener(F.CLICK,e.handleClick_.bind(e),!1);var h=o+" "+je+" "+jn,c=e.element;return c.className=h,c.appendChild(l),e.callResetNorth_=r.resetNorth?r.resetNorth:void 0,e.duration_=r.duration!==void 0?r.duration:250,e.autoHide_=r.autoHide!==void 0?r.autoHide:!0,e.rotation_=void 0,e.autoHide_&&e.element.classList.add(kr),e}return n.prototype.handleClick_=function(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()},n.prototype.resetNorth_=function(){var t=this.getMap(),e=t.getView();if(!!e){var r=e.getRotation();r!==void 0&&(this.duration_>0&&r%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:Ke}):e.setRotation(0))}},n.prototype.render=function(t){var e=t.frameState;if(!!e){var r=e.viewState.rotation;if(r!=this.rotation_){var o="rotate("+r+"rad)";if(this.autoHide_){var a=this.element.classList.contains(kr);!a&&r===0?this.element.classList.add(kr):a&&r!==0&&this.element.classList.remove(kr)}this.label_.style.transform=o}this.rotation_=r}},n}(tr),vd=pd,_d=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),gd=function(i){_d(n,i);function n(t){var e=this,r=t||{};e=i.call(this,{element:document.createElement("div"),target:r.target})||this;var o=r.className!==void 0?r.className:"ol-zoom",a=r.delta!==void 0?r.delta:1,s=r.zoomInClassName!==void 0?r.zoomInClassName:o+"-in",u=r.zoomOutClassName!==void 0?r.zoomOutClassName:o+"-out",l=r.zoomInLabel!==void 0?r.zoomInLabel:"+",h=r.zoomOutLabel!==void 0?r.zoomOutLabel:"\u2013",c=r.zoomInTipLabel!==void 0?r.zoomInTipLabel:"Zoom in",f=r.zoomOutTipLabel!==void 0?r.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof l=="string"?document.createTextNode(l):l),d.addEventListener(F.CLICK,e.handleClick_.bind(e,a),!1);var p=document.createElement("button");p.className=u,p.setAttribute("type","button"),p.title=f,p.appendChild(typeof h=="string"?document.createTextNode(h):h),p.addEventListener(F.CLICK,e.handleClick_.bind(e,-a),!1);var v=o+" "+je+" "+jn,_=e.element;return _.className=v,_.appendChild(d),_.appendChild(p),e.duration_=r.duration!==void 0?r.duration:250,e}return n.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},n.prototype.zoomByDelta_=function(t){var e=this.getMap(),r=e.getView();if(!!r){var o=r.getZoom();if(o!==void 0){var a=r.getConstrainedZoom(o+t);this.duration_>0?(r.getAnimating()&&r.cancelAnimations(),r.animate({zoom:a,duration:this.duration_,easing:Ke})):r.setZoom(a)}}},n}(tr),yd=gd,md=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),As=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Ms={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},Ed=function(i){md(n,i);function n(t){var e=this,r=t||{};e=i.call(this,{element:document.createElement("div"),target:r.target})||this,e.on,e.once,e.un,e.keys_=r.keys!==void 0?r.keys:!1,e.source_=r.source,e.isInFullscreen_=!1,e.boundHandleMapTargetChange_=e.handleMapTargetChange_.bind(e),e.cssClassName_=r.className!==void 0?r.className:"ol-full-screen",e.documentListeners_=[],e.activeClassName_=r.activeClassName!==void 0?r.activeClassName.split(" "):[e.cssClassName_+"-true"],e.inactiveClassName_=r.inactiveClassName!==void 0?r.inactiveClassName.split(" "):[e.cssClassName_+"-false"];var o=r.label!==void 0?r.label:"\u2922";e.labelNode_=typeof o=="string"?document.createTextNode(o):o;var a=r.labelActive!==void 0?r.labelActive:"\xD7";e.labelActiveNode_=typeof a=="string"?document.createTextNode(a):a;var s=r.tipLabel?r.tipLabel:"Toggle full-screen";return e.button_=document.createElement("button"),e.button_.title=s,e.button_.setAttribute("type","button"),e.button_.appendChild(e.labelNode_),e.button_.addEventListener(F.CLICK,e.handleClick_.bind(e),!1),e.setClassName_(e.button_,e.isInFullscreen_),e.element.className="".concat(e.cssClassName_," ").concat(je," ").concat(jn),e.element.appendChild(e.button_),e}return n.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},n.prototype.handleFullScreen_=function(){var t=this.getMap();if(!!t){var e=t.getOwnerDocument();if(!!Fs(e))if(Ns(e))Cd(e);else{var r=void 0;this.source_?r=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:r=t.getTargetElement(),this.keys_?Td(r):Ds(r)}}},n.prototype.handleFullScreenChange_=function(){var t=this.getMap();if(!!t){var e=this.isInFullscreen_;this.isInFullscreen_=Ns(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Dr(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Ms.ENTERFULLSCREEN)):(Dr(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Ms.LEAVEFULLSCREEN)),t.updateSize())}},n.prototype.setClassName_=function(t,e){var r,o,a,s;e?((r=t.classList).remove.apply(r,this.inactiveClassName_),(o=t.classList).add.apply(o,this.activeClassName_)):((a=t.classList).remove.apply(a,this.activeClassName_),(s=t.classList).add.apply(s,this.inactiveClassName_))},n.prototype.setMap=function(t){var e=this.getMap();e&&e.removeChangeListener(pt.TARGET,this.boundHandleMapTargetChange_),i.prototype.setMap.call(this,t),this.handleMapTargetChange_(),t&&t.addChangeListener(pt.TARGET,this.boundHandleMapTargetChange_)},n.prototype.handleMapTargetChange_=function(){for(var t=this.documentListeners_,e=0,r=t.length;e<r;++e)q(t[e]);t.length=0;var o=this.getMap();if(o){var a=o.getOwnerDocument();Fs(a)?this.element.classList.remove(Ba):this.element.classList.add(Ba);for(var e=0,r=As.length;e<r;++e)t.push(B(a,As[e],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}},n}(tr);function Fs(i){var n=i.body;return!!(n.webkitRequestFullscreen||n.msRequestFullscreen&&i.msFullscreenEnabled||n.requestFullscreen&&i.fullscreenEnabled)}function Ns(i){return!!(i.webkitIsFullScreen||i.msFullscreenElement||i.fullscreenElement)}function Ds(i){i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.webkitRequestFullscreen&&i.webkitRequestFullscreen()}function Td(i){i.webkitRequestFullscreen?i.webkitRequestFullscreen():Ds(i)}function Cd(i){i.exitFullscreen?i.exitFullscreen():i.msExitFullscreen?i.msExitFullscreen():i.webkitExitFullscreen&&i.webkitExitFullscreen()}var W_=Ed,Pt={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"},xd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yt={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},Od=function(i){xd(n,i);function n(t){var e=i.call(this)||this;e.on,e.once,e.un,e.options=t,e.id=t.id,e.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,e.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,e.element=document.createElement("div"),e.element.className=t.className!==void 0?t.className:"ol-overlay-container "+yh,e.element.style.position="absolute",e.element.style.pointerEvents="auto";var r=t.autoPan;return r&&typeof r!="object"&&(r={animation:t.autoPanAnimation,margin:t.autoPanMargin}),e.autoPan=r||!1,e.rendered={transform_:"",visible:!0},e.mapPostrenderListenerKey=null,e.addChangeListener(yt.ELEMENT,e.handleElementChanged),e.addChangeListener(yt.MAP,e.handleMapChanged),e.addChangeListener(yt.OFFSET,e.handleOffsetChanged),e.addChangeListener(yt.POSITION,e.handlePositionChanged),e.addChangeListener(yt.POSITIONING,e.handlePositioningChanged),t.element!==void 0&&e.setElement(t.element),e.setOffset(t.offset!==void 0?t.offset:[0,0]),e.setPositioning(t.positioning!==void 0?t.positioning:Pt.TOP_LEFT),t.position!==void 0&&e.setPosition(t.position),e}return n.prototype.getElement=function(){return this.get(yt.ELEMENT)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(yt.MAP)||null},n.prototype.getOffset=function(){return this.get(yt.OFFSET)},n.prototype.getPosition=function(){return this.get(yt.POSITION)},n.prototype.getPositioning=function(){return this.get(yt.POSITIONING)},n.prototype.handleElementChanged=function(){Ua(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Gr(this.element),q(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=B(t,ne.POSTRENDER,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(yt.ELEMENT,t)},n.prototype.setMap=function(t){this.set(yt.MAP,t)},n.prototype.setOffset=function(t){this.set(yt.OFFSET,t)},n.prototype.setPosition=function(t){this.set(yt.POSITION,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var e=this.getMap();if(!(!e||!e.getTargetElement()||!this.get(yt.POSITION))){var r=this.getRect(e.getTargetElement(),e.getSize()),o=this.getElement(),a=this.getRect(o,[vh(o),_h(o)]),s=t||{},u=s.margin===void 0?20:s.margin;if(!Pe(r,a)){var l=a[0]-r[0],h=r[2]-a[2],c=a[1]-r[1],f=r[3]-a[3],d=[0,0];if(l<0?d[0]=l-u:h<0&&(d[0]=Math.abs(h)+u),c<0?d[1]=c-u:f<0&&(d[1]=Math.abs(f)+u),d[0]!==0||d[1]!==0){var p=e.getView().getCenterInternal(),v=e.getPixelFromCoordinateInternal(p);if(!v)return;var _=[v[0]+d[0],v[1]+d[1]],m=s.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(_),duration:m.duration,easing:m.easing})}}}},n.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),o=r.left+window.pageXOffset,a=r.top+window.pageYOffset;return[o,a,o+e[0],a+e[1]]},n.prototype.setPositioning=function(t){this.set(yt.POSITIONING,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}var r=t.getPixelFromCoordinate(e),o=t.getSize();this.updateRenderedPosition(r,o)},n.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,o=this.getOffset(),a=this.getPositioning();this.setVisible(!0);var s=Math.round(t[0]+o[0])+"px",u=Math.round(t[1]+o[1])+"px",l="0%",h="0%";a==Pt.BOTTOM_RIGHT||a==Pt.CENTER_RIGHT||a==Pt.TOP_RIGHT?l="-100%":(a==Pt.BOTTOM_CENTER||a==Pt.CENTER_CENTER||a==Pt.TOP_CENTER)&&(l="-50%"),a==Pt.BOTTOM_LEFT||a==Pt.BOTTOM_CENTER||a==Pt.BOTTOM_RIGHT?h="-100%":(a==Pt.CENTER_LEFT||a==Pt.CENTER_CENTER||a==Pt.CENTER_RIGHT)&&(h="-50%");var c="translate(".concat(l,", ").concat(h,") translate(").concat(s,", ").concat(u,")");this.rendered.transform_!=c&&(this.rendered.transform_=c,r.transform=c,r.msTransform=c)},n.prototype.getOptions=function(){return this.options},n}(At),Z_=Od,Rd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),er={VERTICAL:0,HORIZONTAL:1},Id=function(i){Rd(n,i);function n(t){var e=this,r=t||{};e=i.call(this,{element:document.createElement("div"),render:r.render})||this,e.dragListenerKeys_=[],e.currentResolution_=void 0,e.direction_=er.VERTICAL,e.dragging_,e.heightLimit_=0,e.widthLimit_=0,e.startX_,e.startY_,e.thumbSize_=null,e.sliderInitialized_=!1,e.duration_=r.duration!==void 0?r.duration:200;var o=r.className!==void 0?r.className:"ol-zoomslider",a=document.createElement("button");a.setAttribute("type","button"),a.className=o+"-thumb "+je;var s=e.element;return s.className=o+" "+je+" "+jn,s.appendChild(a),s.addEventListener(me.POINTERDOWN,e.handleDraggerStart_.bind(e),!1),s.addEventListener(me.POINTERMOVE,e.handleDraggerDrag_.bind(e),!1),s.addEventListener(me.POINTERUP,e.handleDraggerEnd_.bind(e),!1),s.addEventListener(F.CLICK,e.handleContainerClick_.bind(e),!1),a.addEventListener(F.CLICK,Ou,!1),e}return n.prototype.setMap=function(t){i.prototype.setMap.call(this,t),t&&t.render()},n.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,r=t.offsetHeight;if(e===0&&r===0)return this.sliderInitialized_=!1;var o=getComputedStyle(t);e-=parseFloat(o.paddingRight)+parseFloat(o.paddingLeft),r-=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom);var a=t.firstElementChild,s=getComputedStyle(a),u=a.offsetWidth+parseFloat(s.marginRight)+parseFloat(s.marginLeft),l=a.offsetHeight+parseFloat(s.marginTop)+parseFloat(s.marginBottom);return this.thumbSize_=[u,l],e>r?(this.direction_=er.HORIZONTAL,this.widthLimit_=e-u):(this.direction_=er.VERTICAL,this.heightLimit_=r-l),this.sliderInitialized_=!0},n.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),o=this.getResolutionForPosition_(r),a=e.getConstrainedZoom(e.getZoomForResolution(o));e.animateInternal({zoom:a,duration:this.duration_,easing:Ke})},n.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,this.dragListenerKeys_.length===0){var r=this.handleDraggerDrag_,o=this.handleDraggerEnd_,a=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(B(a,me.POINTERMOVE,r,this),B(a,me.POINTERUP,o,this))}}},n.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,o=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(o),this.getMap().getView().setResolution(this.currentResolution_)}},n.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(q),this.dragListenerKeys_.length=0}},n.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==er.HORIZONTAL?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},n.prototype.getRelativePosition_=function(t,e){var r;return this.direction_===er.HORIZONTAL?r=t/this.widthLimit_:r=e/this.heightLimit_,it(r,0,1)},n.prototype.getResolutionForPosition_=function(t){var e=this.getMap().getView().getResolutionForValueFunction();return e(1-t)},n.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return it(1-e(t),0,1)},n.prototype.render=function(t){if(!!t.frameState&&!(!this.sliderInitialized_&&!this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},n}(tr),K_=Id;function wd(i){var n=i||{},t=new Mt,e=n.zoom!==void 0?n.zoom:!0;e&&t.push(new yd(n.zoomOptions));var r=n.rotate!==void 0?n.rotate:!0;r&&t.push(new vd(n.rotateOptions));var o=n.attribution!==void 0?n.attribution:!0;return o&&t.push(new cd(n.attributionOptions)),t}var Gs={ACTIVE:"active"},Sd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Pd=function(i){Sd(n,i);function n(t){var e=i.call(this)||this;return e.on,e.once,e.un,t&&t.handleEvent&&(e.handleEvent=t.handleEvent),e.map_=null,e.setActive(!0),e}return n.prototype.getActive=function(){return this.get(Gs.ACTIVE)},n.prototype.getMap=function(){return this.map_},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(Gs.ACTIVE,t)},n.prototype.setMap=function(t){this.map_=t},n}(At);function Ld(i,n,t){var e=i.getCenterInternal();if(e){var r=[e[0]+n[0],e[1]+n[1]];i.animateInternal({duration:t!==void 0?t:250,easing:gc,center:i.getConstrainedCenter(r)})}}function to(i,n,t,e){var r=i.getZoom();if(r!==void 0){var o=i.getConstrainedZoom(r+n),a=i.getResolutionForZoom(o);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:a,anchor:t,duration:e!==void 0?e:250,easing:Ke})}}var nr=Pd,Ad=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Md=function(i){Ad(n,i);function n(t){var e=i.call(this)||this,r=t||{};return e.delta_=r.delta?r.delta:1,e.duration_=r.duration!==void 0?r.duration:250,e}return n.prototype.handleEvent=function(t){var e=!1;if(t.type==tt.DBLCLICK){var r=t.originalEvent,o=t.map,a=t.coordinate,s=r.shiftKey?-this.delta_:this.delta_,u=o.getView();to(u,s,a,this.duration_),r.preventDefault(),e=!0}return!e},n}(nr),Fd=Md,Nd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Dd=function(i){Nd(n,i);function n(t){var e=this,r=t||{};return e=i.call(this,r)||this,r.handleDownEvent&&(e.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(e.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(e.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(e.handleUpEvent=r.handleUpEvent),r.stopDown&&(e.stopDown=r.stopDown),e.handlingDownUpSequence=!1,e.trackedPointers_={},e.targetPointers=[],e}return n.prototype.getPointerCount=function(){return this.targetPointers.length},n.prototype.handleDownEvent=function(t){return!1},n.prototype.handleDragEvent=function(t){},n.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==tt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==tt.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==tt.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==tt.POINTERMOVE&&this.handleMoveEvent(t);return!e},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.updateTrackedPointers_=function(t){if(Gd(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==tt.POINTERUP?delete this.trackedPointers_[r]:t.type==tt.POINTERDOWN?this.trackedPointers_[r]=e:r in this.trackedPointers_&&(this.trackedPointers_[r]=e),this.targetPointers=Xo(this.trackedPointers_)}},n}(nr);function eo(i){for(var n=i.length,t=0,e=0,r=0;r<n;r++)t+=i[r].clientX,e+=i[r].clientY;return[t/n,e/n]}function Gd(i){var n=i.type;return n===tt.POINTERDOWN||n===tt.POINTERDRAG||n===tt.POINTERUP}var rr=Dd;function no(i){var n=arguments;return function(t){for(var e=!0,r=0,o=n.length;r<o&&(e=e&&n[r](t),!!e);++r);return e}}var kd=function(i){var n=i.originalEvent;return n.altKey&&!(n.metaKey||n.ctrlKey)&&n.shiftKey},Xd=function(i){var n=i.map.getTargetElement(),t=i.map.getOwnerDocument().activeElement;return n.contains(t)},ks=function(i){return i.map.getTargetElement().hasAttribute("tabindex")?Xd(i):!0},Yd=en,Xs=function(i){var n=i.originalEvent;return n.button==0&&!(Uu&&Zo&&n.ctrlKey)},Ys=function(i){var n=i.originalEvent;return!n.altKey&&!(n.metaKey||n.ctrlKey)&&!n.shiftKey},z_=function(i){var n=i.originalEvent;return!n.altKey&&(Zo?n.metaKey:n.ctrlKey)&&!n.shiftKey},jd=function(i){var n=i.originalEvent;return!n.altKey&&!(n.metaKey||n.ctrlKey)&&n.shiftKey},js=function(i){var n=i.originalEvent,t=n.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"},ro=function(i){var n=i.originalEvent;return W(n!==void 0,56),n.pointerType=="mouse"},Ud=function(i){var n=i.originalEvent;return W(n!==void 0,56),n.isPrimary&&n.button===0},Bd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wd=function(i){Bd(n,i);function n(t){var e=i.call(this,{stopDown:pr})||this,r=t||{};e.kinetic_=r.kinetic,e.lastCentroid=null,e.lastPointersCount_,e.panning_=!1;var o=r.condition?r.condition:no(Ys,Ud);return e.condition_=r.onFocusOnly?no(ks,o):o,e.noKinetic_=!1,e}return n.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=eo(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var o=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],a=t.map,s=a.getView();la(o,s.getResolution()),Ti(o,s.getRotation()),s.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},n.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),a=this.kinetic_.getAngle(),s=r.getCenterInternal(),u=e.getPixelFromCoordinateInternal(s),l=e.getCoordinateFromPixelInternal([u[0]-o*Math.cos(a),u[1]-o*Math.sin(a)]);r.animateInternal({center:r.getConstrainedCenter(l),duration:500,easing:Ke})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map,r=e.getView();return this.lastCentroid=null,r.getAnimating()&&r.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},n}(rr),Zd=Wd,Kd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),zd=function(i){Kd(n,i);function n(t){var e=this,r=t||{};return e=i.call(this,{stopDown:pr})||this,e.condition_=r.condition?r.condition:kd,e.lastAngle_=void 0,e.duration_=r.duration!==void 0?r.duration:250,e}return n.prototype.handleDragEvent=function(t){if(!!ro(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==qi){var o=e.getSize(),a=t.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var u=s-this.lastAngle_;r.adjustRotationInternal(-u)}this.lastAngle_=s}}},n.prototype.handleUpEvent=function(t){if(!ro(t))return!0;var e=t.map,r=e.getView();return r.endInteraction(this.duration_),!1},n.prototype.handleDownEvent=function(t){if(!ro(t))return!1;if(Xs(t)&&this.condition_(t)){var e=t.map;return e.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},n}(rr),Vd=zd,bd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$d=function(i){bd(n,i);function n(t){var e=i.call(this)||this;return e.geometry_=null,e.element_=document.createElement("div"),e.element_.style.position="absolute",e.element_.style.pointerEvents="auto",e.element_.className="ol-box "+t,e.map_=null,e.startPixel_=null,e.endPixel_=null,e}return n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+r,o.top=Math.min(t[1],e[1])+r,o.width=Math.abs(e[0]-t[0])+r,o.height=Math.abs(e[1]-t[1])+r},n.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_)},n.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},n.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]],o=r.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Mr([o])},n.prototype.getGeometry=function(){return this.geometry_},n}(ci),Hd=$d,Us=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),qr={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},io=function(i){Us(n,i);function n(t,e,r){var o=i.call(this,t)||this;return o.coordinate=e,o.mapBrowserEvent=r,o}return n}(Ut),qd=function(i){Us(n,i);function n(t){var e=i.call(this)||this;e.on,e.once,e.un;var r=t||{};return e.box_=new Hd(r.className||"ol-dragbox"),e.minArea_=r.minArea!==void 0?r.minArea:64,r.onBoxEnd&&(e.onBoxEnd=r.onBoxEnd),e.startPixel_=null,e.condition_=r.condition?r.condition:Xs,e.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:e.defaultBoxEndCondition,e}return n.prototype.defaultBoxEndCondition=function(t,e,r){var o=r[0]-e[0],a=r[1]-e[1];return o*o+a*a>=this.minArea_},n.prototype.getGeometry=function(){return this.box_.getGeometry()},n.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new io(qr.BOXDRAG,t.coordinate,t))},n.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 io(e?qr.BOXEND:qr.BOXCANCEL,t.coordinate,t)),!1},n.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 io(qr.BOXSTART,t.coordinate,t)),!0):!1},n.prototype.onBoxEnd=function(t){},n}(rr),Jd=qd,Qd=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),tp=function(i){Qd(n,i);function n(t){var e=this,r=t||{},o=r.condition?r.condition:jd;return e=i.call(this,{condition:o,className:r.className||"ol-dragzoom",minArea:r.minArea})||this,e.duration_=r.duration!==void 0?r.duration:200,e.out_=r.out!==void 0?r.out:!1,e}return n.prototype.onBoxEnd=function(t){var e=this.getMap(),r=e.getView(),o=this.getGeometry();if(this.out_){var a=r.rotatedExtentForGeometry(o),s=r.getResolutionForExtentInternal(a),u=r.getResolution()/s;o=o.clone(),o.scale(u*u)}r.fitInternal(o,{duration:this.duration_,easing:Ke})},n}(Jd),ep=tp,Ve={LEFT:37,UP:38,RIGHT:39,DOWN:40},np=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rp=function(i){np(n,i);function n(t){var e=i.call(this)||this,r=t||{};return e.defaultCondition_=function(o){return Ys(o)&&js(o)},e.condition_=r.condition!==void 0?r.condition:e.defaultCondition_,e.duration_=r.duration!==void 0?r.duration:100,e.pixelDelta_=r.pixelDelta!==void 0?r.pixelDelta:128,e}return n.prototype.handleEvent=function(t){var e=!1;if(t.type==F.KEYDOWN){var r=t.originalEvent,o=r.keyCode;if(this.condition_(t)&&(o==Ve.DOWN||o==Ve.LEFT||o==Ve.RIGHT||o==Ve.UP)){var a=t.map,s=a.getView(),u=s.getResolution()*this.pixelDelta_,l=0,h=0;o==Ve.DOWN?h=-u:o==Ve.LEFT?l=-u:o==Ve.RIGHT?l=u:h=u;var c=[l,h];Ti(c,s.getRotation()),Ld(s,c,this.duration_),r.preventDefault(),e=!0}}return!e},n}(nr),ip=rp,op=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ap=function(i){op(n,i);function n(t){var e=i.call(this)||this,r=t||{};return e.condition_=r.condition?r.condition:js,e.delta_=r.delta?r.delta:1,e.duration_=r.duration!==void 0?r.duration:100,e}return n.prototype.handleEvent=function(t){var e=!1;if(t.type==F.KEYDOWN||t.type==F.KEYPRESS){var r=t.originalEvent,o=r.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var a=t.map,s=o=="+".charCodeAt(0)?this.delta_:-this.delta_,u=a.getView();to(u,s,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},n}(nr),sp=ap,up=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),oo={TRACKPAD:"trackpad",WHEEL:"wheel"},lp=function(i){up(n,i);function n(t){var e=this,r=t||{};e=i.call(this,r)||this,e.totalDelta_=0,e.lastDelta_=0,e.maxDelta_=r.maxDelta!==void 0?r.maxDelta:1,e.duration_=r.duration!==void 0?r.duration:250,e.timeout_=r.timeout!==void 0?r.timeout:80,e.useAnchor_=r.useAnchor!==void 0?r.useAnchor:!0,e.constrainResolution_=r.constrainResolution!==void 0?r.constrainResolution:!1;var o=r.condition?r.condition:Yd;return e.condition_=r.onFocusOnly?no(ks,o):o,e.lastAnchor_=null,e.startTime_=void 0,e.timeoutId_,e.mode_=void 0,e.trackpadEventGap_=400,e.trackpadTimeoutId_,e.deltaPerZoom_=300,e}return n.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap().getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},n.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==F.WHEEL)return!0;var r=t.map,o=t.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var a;if(t.type==F.WHEEL&&(a=o.deltaY,Yu&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=Ko),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?oo.TRACKPAD:oo.WHEEL);var u=r.getView();if(this.mode_===oo.TRACKPAD&&!(u.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(u.getAnimating()&&u.cancelAnimations(),u.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),u.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var l=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),l),!1},n.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-it(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),to(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},n.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},n}(nr),hp=lp,fp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),cp=function(i){fp(n,i);function n(t){var e=this,r=t||{},o=r;return o.stopDown||(o.stopDown=pr),e=i.call(this,o)||this,e.anchor_=null,e.lastAngle_=void 0,e.rotating_=!1,e.rotationDelta_=0,e.threshold_=r.threshold!==void 0?r.threshold:.3,e.duration_=r.duration!==void 0?r.duration:250,e}return n.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-r.clientY,o.clientX-r.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=s}this.lastAngle_=a;var u=t.map,l=u.getView();if(l.getConstraints().rotation!==qi){var h=u.getViewport().getBoundingClientRect(),c=eo(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.anchor_=u.getCoordinateFromPixelInternal(c),this.rotating_&&(u.render(),l.adjustRotationInternal(e,this.anchor_))}},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,r=e.getView();return r.endInteraction(this.duration_),!1}else return!0},n.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}else return!1},n}(rr),dp=cp,pp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),vp=function(i){pp(n,i);function n(t){var e=this,r=t||{},o=r;return o.stopDown||(o.stopDown=pr),e=i.call(this,o)||this,e.anchor_=null,e.duration_=r.duration!==void 0?r.duration:400,e.lastDistance_=void 0,e.lastScaleDelta_=1,e}return n.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],o=this.targetPointers[1],a=r.clientX-o.clientX,s=r.clientY-o.clientY,u=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(e=this.lastDistance_/u),this.lastDistance_=u;var l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e);var c=l.getViewport().getBoundingClientRect(),f=eo(this.targetPointers);f[0]-=c.left,f[1]-=c.top,this.anchor_=l.getCoordinateFromPixelInternal(f),l.render(),h.adjustResolutionInternal(e,this.anchor_)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,r=e.getView(),o=this.lastScaleDelta_>1?1:-1;return r.endInteraction(this.duration_,o),!1}else return!0},n.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}else return!1},n}(rr),_p=vp,gp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yp=function(i){gp(n,i);function n(t,e,r){var o=i.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(t[0]))o.setCoordinates(t,e);else if(e!==void 0&&r)o.setFlatCoordinates(e,t),o.ends_=r;else{for(var a=o.getLayout(),s=t,u=[],l=[],h=0,c=s.length;h<c;++h){var f=s[h];h===0&&(a=f.getLayout()),Dt(u,f.getFlatCoordinates()),l.push(u.length)}o.setFlatCoordinates(a,u),o.ends_=l}return o}return n.prototype.appendLineString=function(t){this.flatCoordinates?Dt(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,e,r,o){return o<Se(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Si(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Li(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,o))},n.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=$.XYM&&this.layout!=$.XYZM||this.flatCoordinates.length===0)return null;var o=e!==void 0?e:!1,a=r!==void 0?r:!1;return rh(this.flatCoordinates,0,this.ends_,this.stride,t,o,a)},n.prototype.getCoordinates=function(){return Yn(this.flatCoordinates,0,this.ends_,this.stride)},n.prototype.getEnds=function(){return this.ends_},n.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Fr(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},n.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,o=[],a=0,s=0,u=e.length;s<u;++s){var l=e[s],h=new Fr(t.slice(a,l),r);o.push(h),a=l}return o},n.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,o=this.ends_,a=this.stride,s=0,u=o.length;s<u;++s){var l=o[s],h=Na(e,r,l,a,.5);Dt(t,h),r=l}return t},n.prototype.getSimplifiedGeometryInternal=function(t){var e=[],r=[];return e.length=Gl(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,r),new n(e,$.XY,r)},n.prototype.getType=function(){return w.MULTI_LINE_STRING},n.prototype.intersectsExtent=function(t){return Vl(this.flatCoordinates,0,this.ends_,this.stride,t)},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=Ai(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()},n}(ke),Bs=yp,mp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ep=function(i){mp(n,i);function n(t,e){var r=i.call(this)||this;return e&&!Array.isArray(t[0])?r.setFlatCoordinates(e,t):r.setCoordinates(t,e),r}return n.prototype.appendPoint=function(t){this.flatCoordinates?Dt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,e,r,o){if(o<Se(this.getExtent(),t,e))return o;for(var a=this.flatCoordinates,s=this.stride,u=0,l=a.length;u<l;u+=s){var h=Ae(t,e,a[u],a[u+1]);if(h<o){o=h;for(var c=0;c<s;++c)r[c]=a[u+c];r.length=s}}return o},n.prototype.getCoordinates=function(){return he(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new hn(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},n.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,o=[],a=0,s=t.length;a<s;a+=r){var u=new hn(t.slice(a,a+r),e);o.push(u)}return o},n.prototype.getType=function(){return w.MULTI_POINT},n.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,o=0,a=e.length;o<a;o+=r){var s=e[o],u=e[o+1];if(vi(t,s,u))return!0}return!1},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()},n}(ke),Ws=Ep;function Tp(i,n,t,e){for(var r=[],o=wt(),a=0,s=t.length;a<s;++a){var u=t[a];o=Jo(i,n,u[0],e),r.push((o[0]+o[2])/2,(o[1]+o[3])/2),n=u[u.length-1]}return r}var Cp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),xp=function(i){Cp(n,i);function n(t,e,r){var o=i.call(this)||this;if(o.endss_=[],o.flatInteriorPointsRevision_=-1,o.flatInteriorPoints_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){for(var a=o.getLayout(),s=t,u=[],l=[],h=0,c=s.length;h<c;++h){var f=s[h];h===0&&(a=f.getLayout());for(var d=u.length,p=f.getEnds(),v=0,_=p.length;v<_;++v)p[v]+=d;Dt(u,f.getFlatCoordinates()),l.push(p)}e=a,t=u,r=l}return e!==void 0&&r?(o.setFlatCoordinates(e,t),o.endss_=r):o.setCoordinates(t,e),o}return n.prototype.appendPolygon=function(t){var e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{var r=this.flatCoordinates.length;Dt(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(var o=0,a=e.length;o<a;++o)e[o]+=r}this.endss_.push(e),this.changed()},n.prototype.clone=function(){for(var t=this.endss_.length,e=new Array(t),r=0;r<t;++r)e[r]=this.endss_[r].slice();var o=new n(this.flatCoordinates.slice(),this.layout,e);return o.applyProperties(this),o},n.prototype.closestPointXY=function(t,e,r,o){return o<Se(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ml(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fl(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,o))},n.prototype.containsXY=function(t,e){return Kl(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},n.prototype.getArea=function(){return Yl(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},n.prototype.getCoordinates=function(t){var e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),La(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Fi(e,0,this.endss_,this.stride)},n.prototype.getEndss=function(){return this.endss_},n.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Tp(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=zl(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},n.prototype.getInteriorPoints=function(){return new Ws(this.getFlatInteriorPoints().slice(),$.XYM)},n.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;ql(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=La(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},n.prototype.getSimplifiedGeometryInternal=function(t){var e=[],r=[];return e.length=Xl(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,r),new n(e,$.XY,r)},n.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(t===0)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var o=this.endss_[t].slice(),a=o[o.length-1];if(e!==0)for(var s=0,u=o.length;s<u;++s)o[s]-=e;return new Mr(this.flatCoordinates.slice(e,a),this.layout,o)},n.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,o=[],a=0,s=0,u=r.length;s<u;++s){var l=r[s].slice(),h=l[l.length-1];if(a!==0)for(var c=0,f=l.length;c<f;++c)l[c]-=a;var d=new Mr(e.slice(a,h),t,l);o.push(d),a=h}return o},n.prototype.getType=function(){return w.MULTI_POLYGON},n.prototype.intersectsExtent=function(t){return $l(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=Dl(this.flatCoordinates,0,t,this.stride,this.endss_);if(r.length===0)this.flatCoordinates.length=0;else{var o=r[r.length-1];this.flatCoordinates.length=o.length===0?0:o[o.length-1]}this.changed()},n}(ke),Op=xp;function Rp(i){var n=i||{},t=new Mt,e=new Oc(-.005,.05,100),r=n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0;r&&t.push(new Vd);var o=n.doubleClickZoom!==void 0?n.doubleClickZoom:!0;o&&t.push(new Fd({delta:n.zoomDelta,duration:n.zoomDuration}));var a=n.dragPan!==void 0?n.dragPan:!0;a&&t.push(new Zd({onFocusOnly:n.onFocusOnly,kinetic:e}));var s=n.pinchRotate!==void 0?n.pinchRotate:!0;s&&t.push(new dp);var u=n.pinchZoom!==void 0?n.pinchZoom:!0;u&&t.push(new _p({duration:n.zoomDuration}));var l=n.keyboard!==void 0?n.keyboard:!0;l&&(t.push(new ip),t.push(new sp({delta:n.zoomDelta,duration:n.zoomDuration})));var h=n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0;h&&t.push(new hp({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration}));var c=n.shiftDragZoom!==void 0?n.shiftDragZoom:!0;return c&&t.push(new ep({duration:n.zoomDuration})),t}var Ip=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),wp=function(i){Ip(n,i);function n(t){return t=ut({},t),t.controls||(t.controls=wd()),t.interactions||(t.interactions=Rp({onFocusOnly:!0})),i.call(this,t)||this}return n.prototype.createRenderer=function(){return new Ac(this)},n}(sd),V_=wp,Sp=function(){function i(n){this.highWaterMark=n!==void 0?n:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return i.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},i.prototype.expireCache=function(n){for(;this.canExpireCache();)this.pop()},i.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},i.prototype.containsKey=function(n){return this.entries_.hasOwnProperty(n)},i.prototype.forEach=function(n){for(var t=this.oldest_;t;)n(t.value_,t.key_,this),t=t.newer},i.prototype.get=function(n,t){var e=this.entries_[n];return W(e!==void 0,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},i.prototype.remove=function(n){var t=this.entries_[n];return W(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[n],--this.count_,t.value_},i.prototype.getCount=function(){return this.count_},i.prototype.getKeys=function(){var n=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)n[t++]=e.key_;return n},i.prototype.getValues=function(){var n=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)n[t++]=e.value_;return n},i.prototype.peekLast=function(){return this.oldest_.value_},i.prototype.peekLastKey=function(){return this.oldest_.key_},i.prototype.peekFirstKey=function(){return this.newest_.key_},i.prototype.pop=function(){var n=this.oldest_;return delete this.entries_[n.key_],n.newer&&(n.newer.older=null),this.oldest_=n.newer,this.oldest_||(this.newest_=null),--this.count_,n.value_},i.prototype.replace=function(n,t){this.get(n),this.entries_[n].value_=t},i.prototype.set=function(n,t){W(!(n in this.entries_),16);var e={key_:n,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=e:this.oldest_=e,this.newest_=e,this.entries_[n]=e,++this.count_},i.prototype.setSize=function(n){this.highWaterMark=n},i}(),Pp=Sp;function Zs(i,n,t,e){return e!==void 0?(e[0]=i,e[1]=n,e[2]=t,e):[i,n,t]}function Jr(i,n,t){return i+"/"+n+"/"+t}function Ks(i){return Jr(i[0],i[1],i[2])}function Lp(i){return i.split("/").map(Number)}function Ap(i){return(i[1]<<i[0])+i[2]}function Mp(i,n){var t=i[0],e=i[1],r=i[2];if(n.getMinZoom()>t||t>n.getMaxZoom())return!1;var o=n.getFullTileRange(t);return o?o.containsXY(e,r):!0}var Fp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Np=function(i){Fp(n,i);function n(){return i!==null&&i.apply(this,arguments)||this}return n.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast();if(e.getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),e=Lp(t),r=e[0];this.forEach(function(o){o.tileCoord[0]!==r&&(this.remove(Ks(o.tileCoord)),o.release())}.bind(this))}},n}(Pp),zs=Np,Vs=function(){function i(n,t,e,r){this.minX=n,this.maxX=t,this.minY=e,this.maxY=r}return i.prototype.contains=function(n){return this.containsXY(n[1],n[2])},i.prototype.containsTileRange=function(n){return this.minX<=n.minX&&n.maxX<=this.maxX&&this.minY<=n.minY&&n.maxY<=this.maxY},i.prototype.containsXY=function(n,t){return this.minX<=n&&n<=this.maxX&&this.minY<=t&&t<=this.maxY},i.prototype.equals=function(n){return this.minX==n.minX&&this.minY==n.minY&&this.maxX==n.maxX&&this.maxY==n.maxY},i.prototype.extend=function(n){n.minX<this.minX&&(this.minX=n.minX),n.maxX>this.maxX&&(this.maxX=n.maxX),n.minY<this.minY&&(this.minY=n.minY),n.maxY>this.maxY&&(this.maxY=n.maxY)},i.prototype.getHeight=function(){return this.maxY-this.minY+1},i.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},i.prototype.getWidth=function(){return this.maxX-this.minX+1},i.prototype.intersects=function(n){return this.minX<=n.maxX&&this.maxX>=n.minX&&this.minY<=n.maxY&&this.maxY>=n.minY},i}();function gn(i,n,t,e,r){return r!==void 0?(r.minX=i,r.maxX=n,r.minY=t,r.maxY=e,r):new Vs(i,n,t,e)}var bs=Vs,$s=function(){function i(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return i.prototype.getReadOptions=function(n,t){var e;if(t){var r=t.dataProjection?ot(t.dataProjection):this.readProjection(n);t.extent&&r&&r.getUnits()===Vt.TILE_PIXELS&&(r=ot(r),r.setWorldExtent(t.extent)),e={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(e)},i.prototype.adaptOptions=function(n){return ut({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},n)},i.prototype.getType=function(){return M()},i.prototype.readFeature=function(n,t){return M()},i.prototype.readFeatures=function(n,t){return M()},i.prototype.readGeometry=function(n,t){return M()},i.prototype.readProjection=function(n){return M()},i.prototype.writeFeature=function(n,t){return M()},i.prototype.writeFeatures=function(n,t){return M()},i.prototype.writeGeometry=function(n,t){return M()},i}();function Ee(i,n,t){var e=t?ot(t.featureProjection):null,r=t?ot(t.dataProjection):null,o;if(e&&r&&!Ne(e,r)?o=(n?i.clone():i).transform(n?e:r,n?r:e):o=i,n&&t&&t.decimals!==void 0){var a=Math.pow(10,t.decimals),s=function(u){for(var l=0,h=u.length;l<h;++l)u[l]=Math.round(u[l]*a)/a;return u};o===i&&(o=i.clone()),o.applyTransform(s)}return o}var Dp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Gp=function(i){Dp(n,i);function n(){return i.call(this)||this}return n.prototype.getType=function(){return Ze.JSON},n.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Qr(t),this.getReadOptions(t,e))},n.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Qr(t),this.getReadOptions(t,e))},n.prototype.readFeatureFromObject=function(t,e){return M()},n.prototype.readFeaturesFromObject=function(t,e){return M()},n.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Qr(t),this.getReadOptions(t,e))},n.prototype.readGeometryFromObject=function(t,e){return M()},n.prototype.readProjection=function(t){return this.readProjectionFromObject(Qr(t))},n.prototype.readProjectionFromObject=function(t){return M()},n.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},n.prototype.writeFeatureObject=function(t,e){return M()},n.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},n.prototype.writeFeaturesObject=function(t,e){return M()},n.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},n.prototype.writeGeometryObject=function(t,e){return M()},n}($s);function Qr(i){if(typeof i=="string"){var n=JSON.parse(i);return n||null}else return i!==null?i:null}var kp=Gp,Xp=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Yp=function(i){Xp(n,i);function n(t){var e=i.call(this)||this;return e.geometries_=t||null,e.changeEventsKeys_=[],e.listenGeometriesChange_(),e}return n.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(q),this.changeEventsKeys_.length=0},n.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(B(this.geometries_[t],F.CHANGE,this.changed,this))},n.prototype.clone=function(){var t=new n(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},n.prototype.closestPointXY=function(t,e,r,o){if(o<Se(this.getExtent(),t,e))return o;for(var a=this.geometries_,s=0,u=a.length;s<u;++s)o=a[s].closestPointXY(t,e,r,o);return o},n.prototype.containsXY=function(t,e){for(var r=this.geometries_,o=0,a=r.length;o<a;++o)if(r[o].containsXY(t,e))return!0;return!1},n.prototype.computeExtent=function(t){Fn(t);for(var e=this.geometries_,r=0,o=e.length;r<o;++r)Qo(t,e[r].getExtent());return t},n.prototype.getGeometries=function(){return Hs(this.geometries_)},n.prototype.getGeometriesArray=function(){return this.geometries_},n.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,o=e.length;r<o;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},n.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var e=[],r=this.geometries_,o=!1,a=0,s=r.length;a<s;++a){var u=r[a],l=u.getSimplifiedGeometry(t);e.push(l),l!==u&&(o=!0)}if(o){var h=new n(null);return h.setGeometriesArray(e),h}else return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},n.prototype.getType=function(){return w.GEOMETRY_COLLECTION},n.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,o=e.length;r<o;++r)if(e[r].intersectsExtent(t))return!0;return!1},n.prototype.isEmpty=function(){return this.geometries_.length===0},n.prototype.rotate=function(t,e){for(var r=this.geometries_,o=0,a=r.length;o<a;++o)r[o].rotate(t,e);this.changed()},n.prototype.scale=function(t,e,r){var o=r;o||(o=le(this.getExtent()));for(var a=this.geometries_,s=0,u=a.length;s<u;++s)a[s].scale(t,e,o);this.changed()},n.prototype.setGeometries=function(t){this.setGeometriesArray(Hs(t))},n.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},n.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,o=e.length;r<o;++r)e[r].applyTransform(t);this.changed()},n.prototype.translate=function(t,e){for(var r=this.geometries_,o=0,a=r.length;o<a;++o)r[o].translate(t,e);this.changed()},n.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),i.prototype.disposeInternal.call(this)},n}(ya);function Hs(i){for(var n=[],t=0,e=i.length;t<e;++t)n.push(i[t].clone());return n}var jp=Yp,Up=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Bp=function(i){Up(n,i);function n(t){var e=this,r=t||{};return e=i.call(this)||this,e.dataProjection=ot(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(e.defaultFeatureProjection=ot(r.featureProjection)),e.geometryName_=r.geometryName,e.extractGeometryName_=r.extractGeometryName,e.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],e}return n.prototype.readFeatureFromObject=function(t,e){var r=null;t.type==="Feature"?r=t:r={type:"Feature",geometry:t,properties:null};var o=ao(r.geometry,e),a=new Ln;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&a.setGeometryName(r.geometry_name),a.setGeometry(o),"id"in r&&a.setId(r.id),r.properties&&a.setProperties(r.properties,!0),a},n.prototype.readFeaturesFromObject=function(t,e){var r=t,o=null;if(r.type==="FeatureCollection"){var a=t;o=[];for(var s=a.features,u=0,l=s.length;u<l;++u)o.push(this.readFeatureFromObject(s[u],e))}else o=[this.readFeatureFromObject(t,e)];return o},n.prototype.readGeometryFromObject=function(t,e){return ao(t,e)},n.prototype.readProjectionFromObject=function(t){var e=t.crs,r;return e?e.type=="name"?r=ot(e.properties.name):e.type==="EPSG"?r=ot("EPSG:"+e.properties.code):W(!1,36):r=this.dataProjection,r},n.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},o=t.getId();if(o!==void 0&&(r.id=o),!t.hasProperties())return r;var a=t.getProperties(),s=t.getGeometry();return s&&(r.geometry=so(s,e),delete a[t.getGeometryName()]),nn(a)||(r.properties=a),r},n.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],o=0,a=t.length;o<a;++o)r.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:r}},n.prototype.writeGeometryObject=function(t,e){return so(t,this.adaptOptions(e))},n}(kp);function ao(i,n){if(!i)return null;var t;switch(i.type){case w.POINT:{t=Zp(i);break}case w.LINE_STRING:{t=Kp(i);break}case w.POLYGON:{t=$p(i);break}case w.MULTI_POINT:{t=Vp(i);break}case w.MULTI_LINE_STRING:{t=zp(i);break}case w.MULTI_POLYGON:{t=bp(i);break}case w.GEOMETRY_COLLECTION:{t=Wp(i);break}default:throw new Error("Unsupported GeoJSON type: "+i.type)}return Ee(t,!1,n)}function Wp(i,n){var t=i.geometries.map(function(e){return ao(e,n)});return new jp(t)}function Zp(i){return new hn(i.coordinates)}function Kp(i){return new Fr(i.coordinates)}function zp(i){return new Bs(i.coordinates)}function Vp(i){return new Ws(i.coordinates)}function bp(i){return new Op(i.coordinates)}function $p(i){return new Mr(i.coordinates)}function so(i,n){i=Ee(i,!0,n);var t=i.getType(),e;switch(t){case w.POINT:{e=ev(i);break}case w.LINE_STRING:{e=qp(i);break}case w.POLYGON:{e=nv(i,n);break}case w.MULTI_POINT:{e=Qp(i);break}case w.MULTI_LINE_STRING:{e=Jp(i);break}case w.MULTI_POLYGON:{e=tv(i,n);break}case w.GEOMETRY_COLLECTION:{e=Hp(i,n);break}case w.CIRCLE:{e={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return e}function Hp(i,n){var t=i.getGeometriesArray().map(function(e){var r=ut({},n);return delete r.featureProjection,so(e,r)});return{type:"GeometryCollection",geometries:t}}function qp(i,n){return{type:"LineString",coordinates:i.getCoordinates()}}function Jp(i,n){return{type:"MultiLineString",coordinates:i.getCoordinates()}}function Qp(i,n){return{type:"MultiPoint",coordinates:i.getCoordinates()}}function tv(i,n){var t;return n&&(t=n.rightHanded),{type:"MultiPolygon",coordinates:i.getCoordinates(t)}}function ev(i,n){return{type:"Point",coordinates:i.getCoordinates()}}function nv(i,n){var t;return n&&(t=n.rightHanded),{type:"Polygon",coordinates:i.getCoordinates(t)}}var b_=Bp,qs="http://www.w3.org/2001/XMLSchema-instance";function uo(i,n){return ir().createElementNS(i,n)}function ti(i,n){return Js(i,n,[]).join("")}function Js(i,n,t){if(i.nodeType==Node.CDATA_SECTION_NODE||i.nodeType==Node.TEXT_NODE)n?t.push(String(i.nodeValue).replace(/(\r\n|\r|\n)/g,"")):t.push(i.nodeValue);else{var e=void 0;for(e=i.firstChild;e;e=e.nextSibling)Js(e,n,t)}return t}function ei(i){return"documentElement"in i}function ni(i){return new DOMParser().parseFromString(i,"application/xml")}function lo(i,n){return function(t,e){var r=i.call(n!==void 0?n:this,t,e);if(r!==void 0){var o=e[e.length-1];o.push(r)}}}function z(i,n,t){return function(e,r){var o=i.call(t!==void 0?t:this,e,r);if(o!==void 0){var a=r[r.length-1],s=n!==void 0?n:e.localName;a[s]=o}}}function j(i,n){return function(t,e,r){i.call(n!==void 0?n:this,t,e,r);var o=r[r.length-1],a=o.node;a.appendChild(t)}}function Qs(i,n){var t,e;return function(r,o,a){if(t===void 0){t={};var s={};s[r.localName]=i,t[r.namespaceURI]=s,e=ho(r.localName)}tu(t,e,o,a)}}function ho(i,n){var t=i;return function(e,r,o){var a=r[r.length-1],s=a.node,u=t;u===void 0&&(u=o);var l=n!==void 0?n:s.namespaceURI;return uo(l,u)}}var ri=ho();function fo(i,n){for(var t=n.length,e=new Array(t),r=0;r<t;++r)e[r]=i[n[r]];return e}function vt(i,n,t){var e=t!==void 0?t:{},r,o;for(r=0,o=i.length;r<o;++r)e[i[r]]=n;return e}function co(i,n,t,e){var r;for(r=n.firstElementChild;r;r=r.nextElementSibling){var o=i[r.namespaceURI];if(o!==void 0){var a=o[r.localName];a!==void 0&&a.call(e,r,t)}}}function yn(i,n,t,e,r){return e.push(i),co(n,t,e,r),e.pop()}function tu(i,n,t,e,r,o){for(var a=(r!==void 0?r:t).length,s,u,l=0;l<a;++l)s=t[l],s!==void 0&&(u=n.call(o!==void 0?o:this,s,e,r!==void 0?r[l]:void 0),u!==void 0&&i[u.namespaceURI][u.localName].call(o,u,s,e))}function mn(i,n,t,e,r,o,a){return r.push(i),tu(n,t,e,r,o,a),r.pop()}var po=void 0;function rv(){return po===void 0&&typeof XMLSerializer!="undefined"&&(po=new XMLSerializer),po}var vo=void 0;function ir(){return vo===void 0&&typeof document!="undefined"&&(vo=document.implementation.createDocument("","",null)),vo}var iv=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ov=function(i){iv(n,i);function n(){var t=i.call(this)||this;return t.xmlSerializer_=rv(),t}return n.prototype.getType=function(){return Ze.XML},n.prototype.readFeature=function(t,e){if(t)if(typeof t=="string"){var r=ni(t);return this.readFeatureFromDocument(r,e)}else return ei(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e);else return null},n.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},n.prototype.readFeatureFromNode=function(t,e){return null},n.prototype.readFeatures=function(t,e){if(t)if(typeof t=="string"){var r=ni(t);return this.readFeaturesFromDocument(r,e)}else return ei(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e);else return[]},n.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],o=t.firstChild;o;o=o.nextSibling)o.nodeType==Node.ELEMENT_NODE&&Dt(r,this.readFeaturesFromNode(o,e));return r},n.prototype.readFeaturesFromNode=function(t,e){return M()},n.prototype.readGeometry=function(t,e){if(t)if(typeof t=="string"){var r=ni(t);return this.readGeometryFromDocument(r,e)}else return ei(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e);else return null},n.prototype.readGeometryFromDocument=function(t,e){return null},n.prototype.readGeometryFromNode=function(t,e){return null},n.prototype.readProjection=function(t){if(t)if(typeof t=="string"){var e=ni(t);return this.readProjectionFromDocument(e)}else return ei(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t);else return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},n.prototype.writeFeatureNode=function(t,e){return null},n.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},n.prototype.writeFeaturesNode=function(t,e){return null},n.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},n.prototype.writeGeometryNode=function(t,e){return null},n}($s),av=ov;function _o(i){var n=ti(i,!1),t=Date.parse(n);return isNaN(t)?void 0:t/1e3}function re(i){var n=ti(i,!1);return sv(n)}function sv(i){var n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i);if(n)return parseFloat(n[1])}function ii(i){var n=ti(i,!1);return uv(n)}function uv(i){var n=/^\s*(\d+)\s*$/.exec(i);if(n)return parseInt(n[1],10)}function ft(i){return ti(i,!1).trim()}function lv(i,n){var t=new Date(n*1e3),e=t.getUTCFullYear()+"-"+Xn(t.getUTCMonth()+1,2)+"-"+Xn(t.getUTCDate(),2)+"T"+Xn(t.getUTCHours(),2)+":"+Xn(t.getUTCMinutes(),2)+":"+Xn(t.getUTCSeconds(),2)+"Z";i.appendChild(ir().createTextNode(e))}function be(i,n){var t=n.toPrecision();i.appendChild(ir().createTextNode(t))}function oi(i,n){var t=n.toString();i.appendChild(ir().createTextNode(t))}function ct(i,n){i.appendChild(ir().createTextNode(n))}var hv=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),lt=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],fv="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",cv={rte:eu,trk:nu,wpt:ru},dv=vt(lt,{rte:lo(eu),trk:lo(nu),wpt:lo(ru)}),pv=vt(lt,{text:z(ft,"linkText"),type:z(ft,"linkType")}),vv=vt(lt,{rte:j(Yv),trk:j(jv),wpt:j(Bv)}),_v=function(i){hv(n,i);function n(t){var e=i.call(this)||this,r=t||{};return e.dataProjection=ot("EPSG:4326"),e.readExtensions_=r.readExtensions,e}return n.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,r=t.length;e<r;++e){var o=t[e];if(this.readExtensions_){var a=o.get("extensionsNode_")||null;this.readExtensions_(o,a)}o.set("extensionsNode_",void 0)}},n.prototype.readFeatureFromNode=function(t,e){if(!ko(lt,t.namespaceURI))return null;var r=cv[t.localName];if(!r)return null;var o=r(t,[this.getReadOptions(t,e)]);return o?(this.handleReadExtensions_([o]),o):null},n.prototype.readFeaturesFromNode=function(t,e){if(!ko(lt,t.namespaceURI))return[];if(t.localName=="gpx"){var r=yn([],dv,t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_(r),r):[]}return[]},n.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=uo("http://www.topografix.com/GPX/1/1","gpx"),o="http://www.w3.org/2000/xmlns/";return r.setAttributeNS(o,"xmlns:xsi",qs),r.setAttributeNS(qs,"xsi:schemaLocation",fv),r.setAttribute("version","1.1"),r.setAttribute("creator","OpenLayers"),mn({node:r},vv,Dv,t,[e]),r},n}(av),gv=vt(lt,{name:z(ft),cmt:z(ft),desc:z(ft),src:z(ft),link:mo,number:z(ii),extensions:Eo,type:z(ft),rtept:Gv}),yv=vt(lt,{ele:z(re),time:z(_o)}),mv=vt(lt,{name:z(ft),cmt:z(ft),desc:z(ft),src:z(ft),link:mo,number:z(ii),type:z(ft),extensions:Eo,trkseg:Xv}),Ev=vt(lt,{trkpt:kv}),Tv=vt(lt,{ele:z(re),time:z(_o)}),Cv=vt(lt,{ele:z(re),time:z(_o),magvar:z(re),geoidheight:z(re),name:z(ft),cmt:z(ft),desc:z(ft),src:z(ft),link:mo,sym:z(ft),type:z(ft),fix:z(ft),sat:z(ii),hdop:z(re),vdop:z(re),pdop:z(re),ageofdgpsdata:z(re),dgpsid:z(ii),extensions:Eo}),xv=["text","type"],Ov=vt(lt,{text:j(ct),type:j(ct)}),Rv=vt(lt,["name","cmt","desc","src","link","number","type","rtept"]),Iv=vt(lt,{name:j(ct),cmt:j(ct),desc:j(ct),src:j(ct),link:j(To),number:j(oi),type:j(ct),rtept:Qs(j(Co))}),wv=vt(lt,["ele","time"]),Sv=vt(lt,["name","cmt","desc","src","link","number","type","trkseg"]),Pv=vt(lt,{name:j(ct),cmt:j(ct),desc:j(ct),src:j(ct),link:j(To),number:j(oi),type:j(ct),trkseg:Qs(j(Uv))}),Lv=ho("trkpt"),Av=vt(lt,{trkpt:j(Co)}),Mv=vt(lt,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),Fv=vt(lt,{ele:j(be),time:j(lv),magvar:j(be),geoidheight:j(be),name:j(ct),cmt:j(ct),desc:j(ct),src:j(ct),link:j(To),sym:j(ct),type:j(ct),fix:j(ct),sat:j(oi),hdop:j(be),vdop:j(be),pdop:j(be),ageofdgpsdata:j(be),dgpsid:j(oi)}),Nv={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function Dv(i,n,t){var e=i.getGeometry();if(e){var r=Nv[e.getType()];if(r){var o=n[n.length-1].node;return uo(o.namespaceURI,r)}}}function go(i,n,t,e){return i.push(parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))),"ele"in e?(i.push(e.ele),delete e.ele,n.hasZ=!0):i.push(0),"time"in e?(i.push(e.time),delete e.time,n.hasM=!0):i.push(0),i}function yo(i,n,t){var e=$.XY,r=2;if(i.hasZ&&i.hasM?(e=$.XYZM,r=4):i.hasZ?(e=$.XYZ,r=3):i.hasM&&(e=$.XYM,r=3),r!==4){for(var o=0,a=n.length/4;o<a;o++)n[o*r]=n[o*4],n[o*r+1]=n[o*4+1],i.hasZ&&(n[o*r+2]=n[o*4+2]),i.hasM&&(n[o*r+2]=n[o*4+3]);if(n.length=n.length/4*r,t)for(var o=0,a=t.length;o<a;o++)t[o]=t[o]/4*r}return e}function mo(i,n){var t=n[n.length-1],e=i.getAttribute("href");e!==null&&(t.link=e),co(pv,i,n)}function Eo(i,n){var t=n[n.length-1];t.extensionsNode_=i}function Gv(i,n){var t=yn({},yv,i,n);if(t){var e=n[n.length-1],r=e.flatCoordinates,o=e.layoutOptions;go(r,o,i,t)}}function kv(i,n){var t=yn({},Tv,i,n);if(t){var e=n[n.length-1],r=e.flatCoordinates,o=e.layoutOptions;go(r,o,i,t)}}function Xv(i,n){var t=n[n.length-1];co(Ev,i,n);var e=t.flatCoordinates,r=t.ends;r.push(e.length)}function eu(i,n){var t=n[0],e=yn({flatCoordinates:[],layoutOptions:{}},gv,i,n);if(!!e){var r=e.flatCoordinates;delete e.flatCoordinates;var o=e.layoutOptions;delete e.layoutOptions;var a=yo(o,r),s=new Fr(r,a);Ee(s,!1,t);var u=new Ln(s);return u.setProperties(e,!0),u}}function nu(i,n){var t=n[0],e=yn({flatCoordinates:[],ends:[],layoutOptions:{}},mv,i,n);if(!!e){var r=e.flatCoordinates;delete e.flatCoordinates;var o=e.ends;delete e.ends;var a=e.layoutOptions;delete e.layoutOptions;var s=yo(a,r,o),u=new Bs(r,s,o);Ee(u,!1,t);var l=new Ln(u);return l.setProperties(e,!0),l}}function ru(i,n){var t=n[0],e=yn({},Cv,i,n);if(!!e){var r={},o=go([],r,i,e),a=yo(r,o),s=new hn(o,a);Ee(s,!1,t);var u=new Ln(s);return u.setProperties(e,!0),u}}function To(i,n,t){i.setAttribute("href",n);var e=t[t.length-1],r=e.properties,o=[r.linkText,r.linkType];mn({node:i},Ov,ri,o,t,xv)}function Co(i,n,t){var e=t[t.length-1],r=e.node,o=r.namespaceURI,a=e.properties;i.setAttributeNS(null,"lat",String(n[1])),i.setAttributeNS(null,"lon",String(n[0]));var s=e.geometryLayout;switch(s){case $.XYZM:n[3]!==0&&(a.time=n[3]);case $.XYZ:n[2]!==0&&(a.ele=n[2]);break;case $.XYM:n[2]!==0&&(a.time=n[2]);break}var u=i.nodeName=="rtept"?wv[o]:Mv[o],l=fo(a,u);mn({node:i,properties:a},Fv,ri,l,t,u)}function Yv(i,n,t){var e=t[0],r=n.getProperties(),o={node:i};o.properties=r;var a=n.getGeometry();if(a.getType()==w.LINE_STRING){var s=Ee(a,!0,e);o.geometryLayout=s.getLayout(),r.rtept=s.getCoordinates()}var u=t[t.length-1].node,l=Rv[u.namespaceURI],h=fo(r,l);mn(o,Iv,ri,h,t,l)}function jv(i,n,t){var e=t[0],r=n.getProperties(),o={node:i};o.properties=r;var a=n.getGeometry();if(a.getType()==w.MULTI_LINE_STRING){var s=Ee(a,!0,e);r.trkseg=s.getLineStrings()}var u=t[t.length-1].node,l=Sv[u.namespaceURI],h=fo(r,l);mn(o,Pv,ri,h,t,l)}function Uv(i,n,t){var e={node:i};e.geometryLayout=n.getLayout(),e.properties={},mn(e,Av,Lv,n.getCoordinates(),t)}function Bv(i,n,t){var e=t[0],r=t[t.length-1];r.properties=n.getProperties();var o=n.getGeometry();if(o.getType()==w.POINT){var a=Ee(o,!0,e);r.geometryLayout=a.getLayout(),Co(i,a.getCoordinates(),t)}}var $_=_v,Wv=.5,ie=!0,Zv=10,iu=.25,Kv=function(){function i(n,t,e,r,o,a){this.sourceProj_=n,this.targetProj_=t;var s={},u=Pr(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){var E=y[0]+"/"+y[1];return s[E]||(s[E]=u(y)),s[E]},this.maxSourceExtent_=r,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&rt(r)==rt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?rt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?rt(this.targetProj_.getExtent()):null;var l=Le(e),h=Cr(e),c=Tr(e),f=Er(e),d=this.transformInv_(l),p=this.transformInv_(h),v=this.transformInv_(c),_=this.transformInv_(f),m=Zv+(a?Math.max(0,Math.ceil(tl(gi(e)/(a*a*256*256)))):0);if(this.addQuad_(l,h,c,f,d,p,v,_,m),this.wrapsXInSource_){var g=1/0;this.triangles_.forEach(function(y,E,T){g=Math.min(g,y.source[0][0],y.source[1][0],y.source[2][0])}),this.triangles_.forEach(function(y){if(Math.max(y.source[0][0],y.source[1][0],y.source[2][0])-g>this.sourceWorldWidth_/2){var E=[[y.source[0][0],y.source[0][1]],[y.source[1][0],y.source[1][1]],[y.source[2][0],y.source[2][1]]];E[0][0]-g>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-g>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-g>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);var T=Math.min(E[0][0],E[1][0],E[2][0]),x=Math.max(E[0][0],E[1][0],E[2][0]);x-T<this.sourceWorldWidth_/2&&(y.source=E)}}.bind(this))}s={}}return i.prototype.addTriangle_=function(n,t,e,r,o,a){this.triangles_.push({source:[r,o,a],target:[n,t,e]})},i.prototype.addQuad_=function(n,t,e,r,o,a,s,u,l){var h=$o([o,a,s,u]),c=this.sourceWorldWidth_?rt(h)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&c>.5&&c<1,p=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=$o([n,t,e,r]),_=rt(v)/this.targetWorldWidth_;p=_>iu||p}!d&&this.sourceProj_.isGlobal()&&c&&(p=c>iu||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!xt(h,this.maxSourceExtent_))){var m=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(u[0])||!isFinite(u[1]))){if(l>0)p=!0;else if(m=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(u[0])||!isFinite(u[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(l>0){if(!p){var g=[(n[0]+e[0])/2,(n[1]+e[1])/2],y=this.transformInv_(g),E=void 0;if(d){var T=(an(o[0],f)+an(s[0],f))/2;E=T-an(y[0],f)}else E=(o[0]+s[0])/2-y[0];var x=(o[1]+s[1])/2-y[1],R=E*E+x*x;p=R>this.errorThresholdSquared_}if(p){if(Math.abs(n[0]-e[0])<=Math.abs(n[1]-e[1])){var O=[(t[0]+e[0])/2,(t[1]+e[1])/2],I=this.transformInv_(O),A=[(r[0]+n[0])/2,(r[1]+n[1])/2],k=this.transformInv_(A);this.addQuad_(n,t,O,A,o,a,I,k,l-1),this.addQuad_(A,O,e,r,k,I,s,u,l-1)}else{var P=[(n[0]+t[0])/2,(n[1]+t[1])/2],X=this.transformInv_(P),U=[(e[0]+r[0])/2,(e[1]+r[1])/2],L=this.transformInv_(U);this.addQuad_(n,P,U,r,o,X,L,u,l-1),this.addQuad_(P,t,e,U,X,a,s,L,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(n,e,r,o,s,u),(m&14)==0&&this.addTriangle_(n,e,t,o,s,a),m&&((m&13)==0&&this.addTriangle_(t,r,n,a,u,o),(m&7)==0&&this.addTriangle_(t,r,e,a,u,s))}},i.prototype.calculateSourceExtent=function(){var n=wt();return this.triangles_.forEach(function(t,e,r){var o=t.source;Dn(n,o[0]),Dn(n,o[1]),Dn(n,o[2])}),n},i.prototype.getTriangles=function(){return this.triangles_},i}(),zv=Kv,xo={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Vv={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Oo;function ou(i,n,t,e,r){i.beginPath(),i.moveTo(0,0),i.lineTo(n,t),i.lineTo(e,r),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(n,e)+1,Math.max(t,r)),i.restore()}function Ro(i,n){return Math.abs(i[n*4]-210)>2||Math.abs(i[n*4+3]-.75*255)>2}function bv(){if(Oo===void 0){var i=document.createElement("canvas").getContext("2d");i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",ou(i,4,5,4,0),ou(i,4,5,0,5);var n=i.getImageData(0,0,3,3).data;Oo=Ro(n,0)||Ro(n,4)||Ro(n,8)}return Oo}function au(i,n,t,e){var r=El(t,n,i),o=da(n,e,t),a=n.getMetersPerUnit();a!==void 0&&(o*=a);var s=i.getMetersPerUnit();s!==void 0&&(o/=s);var u=i.getExtent();if(!u||Mn(u,r)){var l=da(i,o,r)/o;isFinite(l)&&l>0&&(o/=l)}return o}function $v(i,n,t,e){var r=le(t),o=au(i,n,r,e);return(!isFinite(o)||o<=0)&&ea(t,function(a){return o=au(i,n,a,e),isFinite(o)&&o>0}),o}function Hv(i,n,t,e,r,o,a,s,u,l,h,c){var f=Ft(Math.round(t*i),Math.round(t*n));if(c||ut(f,xo),u.length===0)return f.canvas;f.scale(t,t);function d(E){return Math.round(E*t)/t}f.globalCompositeOperation="lighter";var p=wt();u.forEach(function(E,T,x){Qo(p,E.extent)});var v=rt(p),_=Gt(p),m=Ft(Math.round(t*v/e),Math.round(t*_/e));c||ut(m,xo);var g=t/e;u.forEach(function(E,T,x){var R=E.extent[0]-p[0],O=-(E.extent[3]-p[3]),I=rt(E.extent),A=Gt(E.extent);E.image.width>0&&E.image.height>0&&m.drawImage(E.image,l,l,E.image.width-2*l,E.image.height-2*l,R*g,O*g,I*g,A*g)});var y=Le(a);return s.getTriangles().forEach(function(E,T,x){var R=E.source,O=E.target,I=R[0][0],A=R[0][1],k=R[1][0],P=R[1][1],X=R[2][0],U=R[2][1],L=d((O[0][0]-y[0])/o),G=d(-(O[0][1]-y[1])/o),S=d((O[1][0]-y[0])/o),K=d(-(O[1][1]-y[1])/o),Z=d((O[2][0]-y[0])/o),V=d(-(O[2][1]-y[1])/o),J=I,C=A;I=0,A=0,k-=J,P-=C,X-=J,U-=C;var st=[[k,P,0,0,S-L],[X,U,0,0,Z-L],[0,0,k,P,K-G],[0,0,X,U,V-G]],Y=nl(st);if(!!Y){if(f.save(),f.beginPath(),bv()||!c){f.moveTo(S,K);for(var ht=4,Ot=L-S,Rt=G-K,mt=0;mt<ht;mt++)f.lineTo(S+d((mt+1)*Ot/ht),K+d(mt*Rt/(ht-1))),mt!=ht-1&&f.lineTo(S+d((mt+1)*Ot/ht),K+d((mt+1)*Rt/(ht-1)));f.lineTo(Z,V)}else f.moveTo(S,K),f.lineTo(L,G),f.lineTo(Z,V);f.clip(),f.transform(Y[0],Y[2],Y[1],Y[3],L,G),f.translate(p[0]-J,p[3]-C),f.scale(e/t,-e/t),f.drawImage(m.canvas,0,0),f.restore()}}),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,s.getTriangles().forEach(function(E,T,x){var R=E.target,O=(R[0][0]-y[0])/o,I=-(R[0][1]-y[1])/o,A=(R[1][0]-y[0])/o,k=-(R[1][1]-y[1])/o,P=(R[2][0]-y[0])/o,X=-(R[2][1]-y[1])/o;f.beginPath(),f.moveTo(A,k),f.lineTo(O,I),f.lineTo(P,X),f.closePath(),f.stroke()}),f.restore()),f.canvas}var qv=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Jv=function(i){qv(n,i);function n(t,e,r,o,a,s,u,l,h,c,f,d){var p=i.call(this,a,D.IDLE,{interpolate:!!d})||this;p.renderEdges_=f!==void 0?f:!1,p.pixelRatio_=u,p.gutter_=l,p.canvas_=null,p.sourceTileGrid_=e,p.targetTileGrid_=o,p.wrappedTileCoord_=s||a,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var v=o.getTileCoordExtent(p.wrappedTileCoord_),_=p.targetTileGrid_.getExtent(),m=p.sourceTileGrid_.getExtent(),g=_?Gn(v,_):v;if(gi(g)===0)return p.state=D.EMPTY,p;var y=t.getExtent();y&&(m?m=Gn(m,y):m=y);var E=o.getResolution(p.wrappedTileCoord_[0]),T=$v(t,r,g,E);if(!isFinite(T)||T<=0)return p.state=D.EMPTY,p;var x=c!==void 0?c:Wv;if(p.triangulation_=new zv(t,r,g,m,T*x,E),p.triangulation_.getTriangles().length===0)return p.state=D.EMPTY,p;p.sourceZ_=e.getZForResolution(T);var R=p.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(R[1]=it(R[1],m[1],m[3]),R[3]=it(R[3],m[1],m[3])):R=Gn(R,m)),!gi(R))p.state=D.EMPTY;else{for(var O=e.getTileRangeForExtentAndZ(R,p.sourceZ_),I=O.minX;I<=O.maxX;I++)for(var A=O.minY;A<=O.maxY;A++){var k=h(p.sourceZ_,I,A,u);k&&p.sourceTiles_.push(k)}p.sourceTiles_.length===0&&(p.state=D.EMPTY)}return p}return n.prototype.getImage=function(){return this.canvas_},n.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(h,c,f){h&&h.getState()==D.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(h.tileCoord),image:h.getImage()})}.bind(this)),this.sourceTiles_.length=0,t.length===0)this.state=D.ERROR;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],s=this.targetTileGrid_.getResolution(e),u=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Hv(o,a,this.pixelRatio_,u,this.sourceTileGrid_.getExtent(),s,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=D.LOADED}this.changed()},n.prototype.load=function(){if(this.state==D.IDLE){this.state=D.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,o){var a=e.getState();if(a==D.IDLE||a==D.LOADING){t++;var s=B(e,F.CHANGE,function(u){var l=e.getState();(l==D.LOADED||l==D.ERROR||l==D.EMPTY)&&(q(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(s)}}.bind(this)),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,r,o){var a=e.getState();a==D.IDLE&&e.load()})}},n.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(q),this.sourcesListenerKeys_=null},n}(xs),su=Jv,Io={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},Qv=[0,0,0],Te=5,t_=function(){function i(n){this.minZoom=n.minZoom!==void 0?n.minZoom:0,this.resolutions_=n.resolutions,W(Su(this.resolutions_,function(a,s){return s-a},!0),17);var t;if(!n.origins){for(var e=0,r=this.resolutions_.length-1;e<r;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=n.origin!==void 0?n.origin:null,this.origins_=null,n.origins!==void 0&&(this.origins_=n.origins,W(this.origins_.length==this.resolutions_.length,20));var o=n.extent;o!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Le(o)),W(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,n.tileSizes!==void 0&&(this.tileSizes_=n.tileSizes,W(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=n.tileSize!==void 0?n.tileSize:this.tileSizes_?null:bi,W(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=o!==void 0?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],n.sizes!==void 0?this.fullTileRanges_=n.sizes.map(function(a,s){var u=new bs(Math.min(0,a[0]),Math.max(a[0]-1,-1),Math.min(0,a[1]),Math.max(a[1]-1,-1));if(o){var l=this.getTileRangeForExtentAndZ(o,s);u.minX=Math.max(l.minX,u.minX),u.maxX=Math.min(l.maxX,u.maxX),u.minY=Math.max(l.minY,u.minY),u.maxY=Math.min(l.maxY,u.maxY)}return u},this):o&&this.calculateTileRanges_(o)}return i.prototype.forEachTileCoord=function(n,t,e){for(var r=this.getTileRangeForExtentAndZ(n,t),o=r.minX,a=r.maxX;o<=a;++o)for(var s=r.minY,u=r.maxY;s<=u;++s)e([t,o,s])},i.prototype.forEachTileCoordParentTileRange=function(n,t,e,r){var o,a,s,u=null,l=n[0]-1;for(this.zoomFactor_===2?(a=n[1],s=n[2]):u=this.getTileCoordExtent(n,r);l>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=gn(a,a,s,s,e)):o=this.getTileRangeForExtentAndZ(u,l,e),t(l,o))return!0;--l}return!1},i.prototype.getExtent=function(){return this.extent_},i.prototype.getMaxZoom=function(){return this.maxZoom},i.prototype.getMinZoom=function(){return this.minZoom},i.prototype.getOrigin=function(n){return this.origin_?this.origin_:this.origins_[n]},i.prototype.getResolution=function(n){return this.resolutions_[n]},i.prototype.getResolutions=function(){return this.resolutions_},i.prototype.getTileCoordChildTileRange=function(n,t,e){if(n[0]<this.maxZoom){if(this.zoomFactor_===2){var r=n[1]*2,o=n[2]*2;return gn(r,r+1,o,o+1,t)}var a=this.getTileCoordExtent(n,e||this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,n[0]+1,t)}return null},i.prototype.getTileRangeForTileCoordAndZ=function(n,t,e){if(t>this.maxZoom||t<this.minZoom)return null;var r=n[0],o=n[1],a=n[2];if(t===r)return gn(o,a,o,a,e);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,t-r),u=Math.floor(o*s),l=Math.floor(a*s);if(t<r)return gn(u,u,l,l,e);var h=Math.floor(s*(o+1))-1,c=Math.floor(s*(a+1))-1;return gn(u,h,l,c,e)}var f=this.getTileCoordExtent(n,this.tmpExtent_);return this.getTileRangeForExtentAndZ(f,t,e)},i.prototype.getTileRangeExtent=function(n,t,e){var r=this.getOrigin(n),o=this.getResolution(n),a=St(this.getTileSize(n),this.tmpSize_),s=r[0]+t.minX*a[0]*o,u=r[0]+(t.maxX+1)*a[0]*o,l=r[1]+t.minY*a[1]*o,h=r[1]+(t.maxY+1)*a[1]*o;return $t(s,l,u,h,e)},i.prototype.getTileRangeForExtentAndZ=function(n,t,e){var r=Qv;this.getTileCoordForXYAndZ_(n[0],n[3],t,!1,r);var o=r[1],a=r[2];return this.getTileCoordForXYAndZ_(n[2],n[1],t,!0,r),gn(o,r[1],a,r[2],e)},i.prototype.getTileCoordCenter=function(n){var t=this.getOrigin(n[0]),e=this.getResolution(n[0]),r=St(this.getTileSize(n[0]),this.tmpSize_);return[t[0]+(n[1]+.5)*r[0]*e,t[1]-(n[2]+.5)*r[1]*e]},i.prototype.getTileCoordExtent=function(n,t){var e=this.getOrigin(n[0]),r=this.getResolution(n[0]),o=St(this.getTileSize(n[0]),this.tmpSize_),a=e[0]+n[1]*o[0]*r,s=e[1]-(n[2]+1)*o[1]*r,u=a+o[0]*r,l=s+o[1]*r;return $t(a,s,u,l,t)},i.prototype.getTileCoordForCoordAndResolution=function(n,t,e){return this.getTileCoordForXYAndResolution_(n[0],n[1],t,!1,e)},i.prototype.getTileCoordForXYAndResolution_=function(n,t,e,r,o){var a=this.getZForResolution(e),s=e/this.getResolution(a),u=this.getOrigin(a),l=St(this.getTileSize(a),this.tmpSize_),h=s*(n-u[0])/e/l[0],c=s*(u[1]-t)/e/l[1];return r?(h=Or(h,Te)-1,c=Or(c,Te)-1):(h=xr(h,Te),c=xr(c,Te)),Zs(a,h,c,o)},i.prototype.getTileCoordForXYAndZ_=function(n,t,e,r,o){var a=this.getOrigin(e),s=this.getResolution(e),u=St(this.getTileSize(e),this.tmpSize_),l=(n-a[0])/s/u[0],h=(a[1]-t)/s/u[1];return r?(l=Or(l,Te)-1,h=Or(h,Te)-1):(l=xr(l,Te),h=xr(h,Te)),Zs(e,l,h,o)},i.prototype.getTileCoordForCoordAndZ=function(n,t,e){return this.getTileCoordForXYAndZ_(n[0],n[1],t,!1,e)},i.prototype.getTileCoordResolution=function(n){return this.resolutions_[n[0]]},i.prototype.getTileSize=function(n){return this.tileSize_?this.tileSize_:this.tileSizes_[n]},i.prototype.getFullTileRange=function(n){return this.fullTileRanges_?this.fullTileRanges_[n]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,n):null},i.prototype.getZForResolution=function(n,t){var e=di(this.resolutions_,n,t||0);return it(e,this.minZoom,this.maxZoom)},i.prototype.calculateTileRanges_=function(n){for(var t=this.resolutions_.length,e=new Array(t),r=this.minZoom;r<t;++r)e[r]=this.getTileRangeForExtentAndZ(n,r);this.fullTileRanges_=e},i}(),uu=t_;function lu(i){var n=i.getDefaultTileGrid();return n||(n=i_(i),i.setDefaultTileGrid(n)),n}function e_(i,n,t){var e=n[0],r=i.getTileCoordCenter(n),o=wo(t);if(Mn(o,r))return n;var a=rt(o),s=Math.ceil((o[0]-r[0])/a);return r[0]+=a*s,i.getTileCoordForCoordAndZ(r,e)}function n_(i,n,t,e){var r=e!==void 0?e:An.TOP_LEFT,o=hu(i,n,t);return new uu({extent:i,origin:bu(i,r),resolutions:o,tileSize:t})}function r_(i){var n=i||{},t=n.extent||ot("EPSG:3857").getExtent(),e={extent:t,minZoom:n.minZoom,tileSize:n.tileSize,resolutions:hu(t,n.maxZoom,n.tileSize,n.maxResolution)};return new uu(e)}function hu(i,n,t,e){for(var r=n!==void 0?n:zc,o=Gt(i),a=rt(i),s=St(t!==void 0?t:bi),u=e>0?e:Math.max(a/s[0],o/s[1]),l=r+1,h=new Array(l),c=0;c<l;++c)h[c]=u/Math.pow(2,c);return h}function i_(i,n,t,e){var r=wo(i);return n_(r,n,t,e)}function wo(i){i=ot(i);var n=i.getExtent();if(!n){var t=180*Bt[Vt.DEGREES]/i.getMetersPerUnit();n=$t(-t,-t,t,t)}return n}var fu=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),o_=function(i){fu(n,i);function n(t){var e=i.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate})||this;e.on,e.once,e.un,e.opaque_=t.opaque!==void 0?t.opaque:!1,e.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,e.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;var r=[256,256];return e.tileGrid&&St(e.tileGrid.getTileSize(e.tileGrid.getMinZoom()),r),e.tileCache=new zs(t.cacheSize||0),e.tmpSize=[0,0],e.key_=t.key||"",e.tileOptions={transition:t.transition,interpolate:t.interpolate},e.zDirection=t.zDirection?t.zDirection:0,e}return n.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},n.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},n.prototype.forEachLoadedTile=function(t,e,r,o){var a=this.getTileCacheForProjection(t);if(!a)return!1;for(var s=!0,u,l,h,c=r.minX;c<=r.maxX;++c)for(var f=r.minY;f<=r.maxY;++f)l=Jr(e,c,f),h=!1,a.containsKey(l)&&(u=a.get(l),h=u.getState()===D.LOADED,h&&(h=o(u)!==!1)),h||(s=!1);return s},n.prototype.getGutterForProjection=function(t){return 0},n.prototype.getKey=function(){return this.key_},n.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},n.prototype.getOpaque=function(t){return this.opaque_},n.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},n.prototype.getTile=function(t,e,r,o,a){return M()},n.prototype.getTileGrid=function(){return this.tileGrid},n.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:lu(t)},n.prototype.getTileCacheForProjection=function(t){return W(Ne(this.getProjection(),t),68),this.tileCache},n.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},n.prototype.getTilePixelSize=function(t,e,r){var o=this.getTileGridForProjection(r),a=this.getTilePixelRatio(e),s=St(o.getTileSize(t),this.tmpSize);return a==1?s:uh(s,a,this.tmpSize)},n.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=e!==void 0?e:this.getProjection(),o=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=e_(o,t,r)),Mp(t,o)?t:null},n.prototype.clear=function(){this.tileCache.clear()},n.prototype.refresh=function(){this.clear(),i.prototype.refresh.call(this)},n.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},n.prototype.useTile=function(t,e,r,o){},n}(ms),a_=function(i){fu(n,i);function n(t,e){var r=i.call(this,t)||this;return r.tile=e,r}return n}(Ut),s_=o_;function u_(i,n){var t=/\{z\}/g,e=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(a,s,u){if(a)return i.replace(t,a[0].toString()).replace(e,a[1].toString()).replace(r,a[2].toString()).replace(o,function(){var l=a[0],h=n.getFullTileRange(l);W(h,55);var c=h.getHeight()-a[2]-1;return c.toString()})}}function l_(i,n){for(var t=i.length,e=new Array(t),r=0;r<t;++r)e[r]=u_(i[r],n);return h_(e)}function h_(i){return i.length===1?i[0]:function(n,t,e){if(n){var r=Ap(n),o=an(r,i.length);return i[o](n,t,e)}else return}}function f_(i){var n=[],t=/\{([a-z])-([a-z])\}/.exec(i);if(t){var e=t[1].charCodeAt(0),r=t[2].charCodeAt(0),o=void 0;for(o=e;o<=r;++o)n.push(i.replace(t[0],String.fromCharCode(o)));return n}if(t=/\{(\d+)-(\d+)\}/.exec(i),t){for(var a=parseInt(t[2],10),s=parseInt(t[1],10);s<=a;s++)n.push(i.replace(t[0],s.toString()));return n}return n.push(i),n}var c_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),d_=function(i){c_(n,i);function n(t){var e=i.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return e.generateTileUrlFunction_=e.tileUrlFunction===n.prototype.tileUrlFunction,e.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(e.tileUrlFunction=t.tileUrlFunction),e.urls=null,t.urls?e.setUrls(t.urls):t.url&&e.setUrl(t.url),e.tileLoadingKeys_={},e}return n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var e=t.target,r=b(e),o=e.getState(),a;o==D.LOADING?(this.tileLoadingKeys_[r]=!0,a=Io.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],a=o==D.ERROR?Io.TILELOADERROR:o==D.LOADED?Io.TILELOADEND:void 0),a!=null&&this.dispatchEvent(new a_(a,e))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e!="undefined"?this.setKey(e):this.changed()},n.prototype.setUrl=function(t){var e=f_(t);this.urls=e,this.setUrls(e)},n.prototype.setUrls=function(t){this.urls=t;var e=t.join(`
`);this.generateTileUrlFunction_?this.setTileUrlFunction(l_(t,this.tileGrid),e):this.setKey(e)},n.prototype.tileUrlFunction=function(t,e,r){},n.prototype.useTile=function(t,e,r){var o=Jr(t,e,r);this.tileCache.containsKey(o)&&this.tileCache.get(o)},n}(s_),p_=d_,v_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),__=function(i){v_(n,i);function n(t){var e=this,r=t.imageSmoothing!==void 0?t.imageSmoothing:!0;return t.interpolate!==void 0&&(r=t.interpolate),e=i.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:g_,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:r,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this,e.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,e.tileClass=t.tileClass!==void 0?t.tileClass:Os,e.tileCacheForProjection={},e.tileGridForProjection={},e.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,e.renderReprojectionEdges_=!1,e}return n.prototype.canExpireCache=function(){if(!ie)return i.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,e){if(!ie){i.prototype.expireCache.call(this,t,e);return}var r=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==r?e:{});for(var o in this.tileCacheForProjection){var a=this.tileCacheForProjection[o];a.expireCache(a==r?e:{})}},n.prototype.getGutterForProjection=function(t){return ie&&this.getProjection()&&t&&!Ne(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){var t=i.prototype.getKey.call(this);return this.getInterpolate()||(t+=":disable-interpolation"),t},n.prototype.getOpaque=function(t){return ie&&this.getProjection()&&t&&!Ne(this.getProjection(),t)?!1:i.prototype.getOpaque.call(this,t)},n.prototype.getTileGridForProjection=function(t){if(!ie)return i.prototype.getTileGridForProjection.call(this,t);var e=this.getProjection();if(this.tileGrid&&(!e||Ne(e,t)))return this.tileGrid;var r=b(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=lu(t)),this.tileGridForProjection[r]},n.prototype.getTileCacheForProjection=function(t){if(!ie)return i.prototype.getTileCacheForProjection.call(this,t);var e=this.getProjection();if(!e||Ne(e,t))return this.tileCache;var r=b(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new zs(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},n.prototype.createTile_=function(t,e,r,o,a,s){var u=[t,e,r],l=this.getTileCoordForTileUrlFunction(u,a),h=l?this.tileUrlFunction(l,o,a):void 0,c=new this.tileClass(u,h!==void 0?D.IDLE:D.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=s,c.addEventListener(F.CHANGE,this.handleTileChange.bind(this)),c},n.prototype.getTile=function(t,e,r,o,a){var s=this.getProjection();if(!ie||!s||!a||Ne(s,a))return this.getTileInternal(t,e,r,o,s||a);var u=this.getTileCacheForProjection(a),l=[t,e,r],h=void 0,c=Ks(l);u.containsKey(c)&&(h=u.get(c));var f=this.getKey();if(h&&h.key==f)return h;var d=this.getTileGridForProjection(s),p=this.getTileGridForProjection(a),v=this.getTileCoordForTileUrlFunction(l,a),_=new su(s,d,a,p,l,v,this.getTilePixelRatio(o),this.getGutter(),function(m,g,y,E){return this.getTileInternal(m,g,y,E,s)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return _.key=f,h?(_.interimTile=h,_.refreshInterimChain(),u.replace(c,_)):u.set(c,_),_},n.prototype.getTileInternal=function(t,e,r,o,a){var s=null,u=Jr(t,e,r),l=this.getKey();if(!this.tileCache.containsKey(u))s=this.createTile_(t,e,r,o,a,l),this.tileCache.set(u,s);else if(s=this.tileCache.get(u),s.key!=l){var h=s;s=this.createTile_(t,e,r,o,a,l),h.getState()==D.IDLE?s.interimTile=h.interimTile:s.interimTile=h,s.refreshInterimChain(),this.tileCache.replace(u,s)}return s},n.prototype.setRenderReprojectionEdges=function(t){if(!(!ie||this.renderReprojectionEdges_==t)){this.renderReprojectionEdges_=t;for(var e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,e){if(ie){var r=ot(t);if(r){var o=b(r);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}}},n}(p_);function g_(i,n){i.getImage().src=n}var y_=__,m_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),E_=function(i){m_(n,i);function n(t){var e=t||{},r=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(r=e.interpolate);var o=e.projection!==void 0?e.projection:"EPSG:3857",a=e.tileGrid!==void 0?e.tileGrid:r_({extent:wo(o),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});return i.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:r,opaque:e.opaque,projection:o,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:a,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this}return n}(y_),cu=E_,T_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),C_=function(i){T_(n,i);function n(t){var e=i.call(this,{attributions:t.attributions,wrapX:t.wrapX})||this;return e.resolution=void 0,e.distance=t.distance!==void 0?t.distance:20,e.minDistance=t.minDistance||0,e.interpolationRatio=0,e.features=[],e.geometryFunction=t.geometryFunction||function(r){var o=r.getGeometry();return W(o.getType()==w.POINT,10),o},e.createCustomCluster_=t.createCluster,e.source=null,e.boundRefresh_=e.refresh.bind(e),e.updateDistance(e.distance,e.minDistance),e.setSource(t.source||null),e}return n.prototype.clear=function(t){this.features.length=0,i.prototype.clear.call(this,t)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,e,r){this.source.loadFeatures(t,e,r),e!==this.resolution&&(this.resolution=e,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(F.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(F.CHANGE,this.boundRefresh_),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,e){var r=t===0?0:Math.min(e,t)/t,o=t!==this.distance||this.interpolationRatio!==r;this.distance=t,this.minDistance=e,this.interpolationRatio=r,o&&this.refresh()},n.prototype.cluster=function(){if(!(this.resolution===void 0||!this.source))for(var t=wt(),e=this.distance*this.resolution,r=this.source.getFeatures(),o={},a=0,s=r.length;a<s;a++){var u=r[a];if(!(b(u)in o)){var l=this.geometryFunction(u);if(l){var h=l.getCoordinates();qo(h,t),mr(t,e,t);var c=this.source.getFeaturesInExtent(t).filter(function(f){var d=b(f);return d in o?!1:(o[d]=!0,!0)});this.features.push(this.createCluster(c,t))}}}},n.prototype.createCluster=function(t,e){for(var r=[0,0],o=t.length-1;o>=0;--o){var a=this.geometryFunction(t[o]);a?ua(r,a.getCoordinates()):t.splice(o,1)}la(r,1/t.length);var s=le(e),u=this.interpolationRatio,l=new hn([r[0]*(1-u)+s[0]*u,r[1]*(1-u)+s[1]*u]);return this.createCustomCluster_?this.createCustomCluster_(l,t):new Ln({geometry:l,features:t})},n}(vc),H_=C_,x_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),du='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',O_=function(i){x_(n,i);function n(t){var e=t||{},r=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(r=e.interpolate);var o;e.attributions!==void 0?o=e.attributions:o=[du];var a=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return i.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:a,interpolate:r,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,opaque:e.opaque!==void 0?e.opaque:!0,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})||this}return n}(cu),q_=O_,ai={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"},R_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),I_=function(i){R_(n,i);function n(t){var e=this,r=t||{},o=ut({},r);return delete o.preload,delete o.useInterimTilesOnError,e=i.call(this,o)||this,e.on,e.once,e.un,e.setPreload(r.preload!==void 0?r.preload:0),e.setUseInterimTilesOnError(r.useInterimTilesOnError!==void 0?r.useInterimTilesOnError:!0),e}return n.prototype.getPreload=function(){return this.get(ai.PRELOAD)},n.prototype.setPreload=function(t){this.set(ai.PRELOAD,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(ai.USE_INTERIM_TILES_ON_ERROR)},n.prototype.setUseInterimTilesOnError=function(t){this.set(ai.USE_INTERIM_TILES_ON_ERROR,t)},n.prototype.getData=function(t){return i.prototype.getData.call(this,t)},n}(Br),w_=I_,S_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),P_=function(i){S_(n,i);function n(t){var e=i.call(this,t)||this;return e.extentChanged=!0,e.renderedExtent_=null,e.renderedPixelRatio,e.renderedProjection=null,e.renderedRevision,e.renderedTiles=[],e.newTiles_=!1,e.tmpExtent=wt(),e.tmpTileRange_=new bs(0,0,0,0),e}return n.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),o=e.getUseInterimTilesOnError();return r==D.LOADED||r==D.EMPTY||r==D.ERROR&&!o},n.prototype.getTile=function(t,e,r,o){var a=o.pixelRatio,s=o.viewState.projection,u=this.getLayer(),l=u.getSource(),h=l.getTile(t,e,r,a,s);return h.getState()==D.ERROR&&(u.getUseInterimTilesOnError()?u.getPreload()>0&&(this.newTiles_=!0):h.setState(D.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},n.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),o=at(e.pixelToCoordinateTransform,t.slice()),a=r.getExtent();if(a&&!Mn(a,o))return null;for(var s=e.pixelRatio,u=e.viewState.projection,l=e.viewState,h=r.getRenderSource(),c=h.getTileGridForProjection(l.projection),f=h.getTilePixelRatio(e.pixelRatio),d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){var p=c.getTileCoordForCoordAndZ(o,d),v=h.getTile(d,p[1],p[2],s,u);if(!(v instanceof Os||v instanceof su))return null;if(v.getState()===D.LOADED){var _=c.getOrigin(d),m=St(c.getTileSize(d)),g=c.getResolution(d),y=Math.floor(f*((o[0]-_[0])/g-p[1]*m[0])),E=Math.floor(f*((_[1]-o[1])/g-p[2]*m[1]));return this.getImageData(v.getImage(),y,E)}}return null},n.prototype.loadedTileCallback=function(t,e,r){return this.isDrawableTile(r)?i.prototype.loadedTileCallback.call(this,t,e,r):!1},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],o=t.viewState,a=o.projection,s=o.resolution,u=o.center,l=o.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),d=f.getRevision(),p=f.getTileGridForProjection(a),v=p.getZForResolution(s,f.zDirection),_=p.getResolution(v),m=t.extent,g=r.extent&&De(r.extent);g&&(m=Gn(m,De(r.extent)));var y=f.getTilePixelRatio(h),E=Math.round(t.size[0]*y),T=Math.round(t.size[1]*y);if(l){var x=Math.round(Math.sqrt(E*E+T*T));E=x,T=x}var R=_*E/2/y,O=_*T/2/y,I=[u[0]-R,u[1]-O,u[0]+R,u[1]+O],A=p.getTileRangeForExtentAndZ(m,v),k={};k[v]={};var P=this.createLoadedTileFinder(f,a,k),X=this.tmpExtent,U=this.tmpTileRange_;this.newTiles_=!1;for(var L=A.minX;L<=A.maxX;++L)for(var G=A.minY;G<=A.maxY;++G){var S=this.getTile(v,L,G,t);if(this.isDrawableTile(S)){var K=b(this);if(S.getState()==D.LOADED){k[v][S.tileCoord.toString()]=S;var Z=S.inTransition(K);!this.newTiles_&&(Z||this.renderedTiles.indexOf(S)===-1)&&(this.newTiles_=!0)}if(S.getAlpha(K,t.time)===1)continue}var V=p.getTileCoordChildTileRange(S.tileCoord,U,X),J=!1;V&&(J=P(v+1,V)),J||p.forEachTileCoordParentTileRange(S.tileCoord,P,U,X)}var C=_/s;bt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,l,-E/2,-T/2);var st=bo(this.pixelTransform);this.useContainer(e,st,r.opacity,this.getBackground(t));var Y=this.context,ht=Y.canvas;pi(this.inversePixelTransform,this.pixelTransform),bt(this.tempTransform,E/2,T/2,C,C,0,-E/2,-T/2),ht.width!=E||ht.height!=T?(ht.width=E,ht.height=T):this.containerReused||Y.clearRect(0,0,E,T),g&&this.clipUnrotated(Y,t,g),f.getInterpolate()||ut(Y,xo),this.preRender(Y,t),this.renderedTiles.length=0;var Ot=Object.keys(k).map(Number);Ot.sort(Re);var Rt,mt,It;r.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?Ot=Ot.reverse():(Rt=[],mt=[]);for(var $e=Ot.length-1;$e>=0;--$e){var Yt=Ot[$e],or=f.getTilePixelSize(Yt,h,a),ar=p.getResolution(Yt),oe=ar/_,He=or[0]*oe*C,sr=or[1]*oe*C,En=p.getTileCoordForCoordAndZ(Le(I),Yt),ur=p.getTileCoordExtent(En),Ce=at(this.tempTransform,[y*(ur[0]-I[0])/_,y*(I[3]-ur[3])/_]),Tn=y*f.getGutterForProjection(a),lr=k[Yt];for(var qe in lr){var S=lr[qe],ae=S.tileCoord,Je=En[1]-ae[1],si=Math.round(Ce[0]-(Je-1)*He),hr=En[2]-ae[2],Cn=Math.round(Ce[1]-(hr-1)*sr),L=Math.round(Ce[0]-Je*He),G=Math.round(Ce[1]-hr*sr),zt=si-L,jt=Cn-G,xe=v===Yt,Z=xe&&S.getAlpha(b(this),t.time)!==1,xn=!1;if(!Z)if(Rt){It=[L,G,L+zt,G,L+zt,G+jt,L,G+jt];for(var Et=0,fr=Rt.length;Et<fr;++Et)if(v!==Yt&&Yt<mt[Et]){var _t=Rt[Et];xt([L,G,L+zt,G+jt],[_t[0],_t[3],_t[4],_t[7]])&&(xn||(Y.save(),xn=!0),Y.beginPath(),Y.moveTo(It[0],It[1]),Y.lineTo(It[2],It[3]),Y.lineTo(It[4],It[5]),Y.lineTo(It[6],It[7]),Y.moveTo(_t[6],_t[7]),Y.lineTo(_t[4],_t[5]),Y.lineTo(_t[2],_t[3]),Y.lineTo(_t[0],_t[1]),Y.clip())}Rt.push(It),mt.push(Yt)}else Y.clearRect(L,G,zt,jt);this.drawTileImage(S,t,L,G,zt,jt,Tn,xe),Rt&&!Z?(xn&&Y.restore(),this.renderedTiles.unshift(S)):this.renderedTiles.push(S),this.updateUsedTiles(t.usedTiles,f,S)}}this.renderedRevision=d,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!Nn(this.renderedExtent_,I),this.renderedExtent_=I,this.renderedPixelRatio=h,this.renderedProjection=a,this.manageTilePyramid(t,f,p,h,a,m,v,c.getPreload()),this.scheduleExpireCache(t,f),this.postRender(Y,t),r.extent&&Y.restore(),ut(Y,Vv),st!==ht.style.transform&&(ht.style.transform=st);var Qe=za(r.opacity),Oe=this.container;return Qe!==Oe.style.opacity&&(Oe.style.opacity=Qe),this.container},n.prototype.drawTileImage=function(t,e,r,o,a,s,u,l){var h=this.getTileImage(t);if(!!h){var c=b(this),f=l?t.getAlpha(c,e.time):1,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(h,u,u,h.width-2*u,h.height-2*u,r,o,a,s),d&&this.context.restore(),f!==1?e.animate=!0:l&&t.endTransition(c)}},n.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},n.prototype.getTileImage=function(t){return t.getImage()},n.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(o,a,s){var u=b(o);u in s.usedTiles&&o.expireCache(s.viewState.projection,s.usedTiles[u])}.bind(null,e);t.postRenderFunctions.push(r)}},n.prototype.updateUsedTiles=function(t,e,r){var o=b(e);o in t||(t[o]={}),t[o][r.getKey()]=!0},n.prototype.manageTilePyramid=function(t,e,r,o,a,s,u,l,h){var c=b(e);c in t.wantedTiles||(t.wantedTiles[c]={});var f=t.wantedTiles[c],d=t.tileQueue,p=r.getMinZoom(),v=0,_,m,g,y,E,T;for(T=p;T<=u;++T)for(m=r.getTileRangeForExtentAndZ(s,T,m),g=r.getResolution(T),y=m.minX;y<=m.maxX;++y)for(E=m.minY;E<=m.maxY;++E)u-T<=l?(++v,_=e.getTile(T,y,E,o,a),_.getState()==D.IDLE&&(f[_.getKey()]=!0,d.isKeyQueued(_.getKey())||d.enqueue([_,c,r.getTileCoordCenter(_.tileCoord),g])),h!==void 0&&h(_)):e.useTile(T,y,E,a);e.updateCacheSize(v,a)},n}(ls),L_=P_,A_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),M_=function(i){A_(n,i);function n(t){return i.call(this,t)||this}return n.prototype.createRenderer=function(){return new L_(this)},n}(w_),J_=M_,F_=function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),N_=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',du],D_={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},G_={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},k_=function(i){F_(n,i);function n(t){var e=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(e=t.interpolate);var r=t.layer.indexOf("-"),o=r==-1?t.layer:t.layer.slice(0,r),a=G_[o],s=D_[t.layer],u=t.url!==void 0?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+s.extension;return i.call(this,{attributions:N_,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:e,maxZoom:t.maxZoom!=null?t.maxZoom:a.maxZoom,minZoom:t.minZoom!=null?t.minZoom:a.minZoom,opaque:s.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:u,wrapX:t.wrapX,zDirection:t.zDirection})||this}return n}(cu),Q_=k_;export{Ah as C,Zd as D,Fa as F,$_ as G,Bf as I,V_ as M,Z_ as O,hn as P,sh as S,J_ as T,vc as V,cu as X,K_ as Z,Y_ as a,U_ as b,Ln as c,X_ as d,q_ as e,Q_ as f,B_ as g,ze as h,W_ as i,Rp as j,hp as k,wd as l,Qo as m,j_ as n,b_ as o,z_ as p,H_ as q,wt as r};