@opensystemslab/map 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,9 +30,9 @@ const rt=t=>e=>{return"function"==typeof e?(i=t,o=e,window.customElements.define
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */function lt(t){return st(__spreadProps(__spreadValues({},t),{state:!0,attribute:!1}))}var ut=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),pt="propertychange",ht=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function dt(t,e){return t>e?1:t<e?-1:0}function ct(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function gt(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function ft(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function mt(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function vt(){return!0}function yt(){return!1}function _t(){}var bt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function xt(t){for(var e in t)delete t[e]}var kt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function wt(t){var e;for(e in t)return!1;return!e}var St,Ct=(St=function(t,e){return(St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}St(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),zt=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return Ct(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new ut(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,_t);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&xt(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=_t,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(ht),Et="change",Tt="error",Pt="contextmenu",Ot="click",Ft="dblclick",Rt="keydown",Mt="keypress",It="load",jt="resize",Dt="touchmove",At="wheel";function Lt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Gt(t,e,i,o){return Lt(t,e,i,o,!0)}function Nt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),xt(t))}var Bt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vt=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return Bt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Et)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Lt(this,t[n],e);return o}return Lt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Gt(this,t[n],e)}else i=Gt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Nt(t[e]);else Nt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(zt);Vt.prototype.on,Vt.prototype.once,Vt.prototype.un;var qt=Vt;function Wt(){return function(){throw new Error("Unimplemented abstract method.")}()}var Ut=0;function Xt(t){return t.ol_uid||(t.ol_uid=String(++Ut))}var Kt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yt=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return Kt(e,t),e}(ut),Zt=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,Xt(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return Kt(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&bt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new Yt(i,t,e)),i=pt,this.dispatchEvent(new Yt(i,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,i){var o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&bt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],wt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(qt),Ht="postrender",$t="movestart",Jt="moveend",Qt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",te=-1!==Qt.indexOf("firefox");-1!==Qt.indexOf("safari")&&Qt.indexOf("chrom");var ee=-1!==Qt.indexOf("webkit")&&-1==Qt.indexOf("edge"),ie=-1!==Qt.indexOf("macintosh"),oe="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ne="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,re="undefined"!=typeof Image&&Image.prototype.decode,ae=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function se(t,e,i,o){var n;return i&&i.length?n=i.shift():ne?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function le(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ue(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var pe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),he=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return pe(e,t),e.prototype.disposeInternal=function(){ue(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ue(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Nt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_t&&this.listenerKeys.push(Lt(t,Ht,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(Zt),de="ol-hidden",ce="ol-unselectable",ge="ol-control",fe="ol-collapsed",me=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"),ve=["style","variant","weight","size","lineHeight","family"],ye=function(t){var e=t.match(me);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=ve.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[ve[o]]=r)}return i.families=i.family.split(/,\s?/),i};function _e(t){return 1===t?"":String(Math.round(100*t)/100)}var be="opacity",xe="visible",ke="extent",we="zIndex",Se="maxResolution",Ce="minResolution",ze="maxZoom",Ee="minZoom",Te="source",Pe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Oe=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Pe(e,t),e}(Error);function Fe(t,e){if(!t)throw new Oe(e)}function Re(t,e,i){return Math.min(Math.max(t,e),i)}var Me="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ie="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function je(t,e,i,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return De(t,e,i,o)}function De(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function Ae(t){return t*Math.PI/180}function Le(t,e){var i=t%e;return i*e<0?i+e:i}function Ge(t,e,i){return t+i*(e-t)}var Ne=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Be=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return"object"==typeof e.properties&&(delete o.properties,bt(o,e.properties)),o[be]=void 0!==e.opacity?e.opacity:1,Fe("number"==typeof o[be],64),o[xe]=void 0===e.visible||e.visible,o[we]=e.zIndex,o[Se]=void 0!==e.maxResolution?e.maxResolution:1/0,o[Ce]=void 0!==e.minResolution?e.minResolution:0,o[Ee]=void 0!==e.minZoom?e.minZoom:-1/0,o[ze]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),i.state_=null,i}return Ne(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=Re(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Wt()},e.prototype.getLayerStatesArray=function(t){return Wt()},e.prototype.getExtent=function(){return this.get(ke)},e.prototype.getMaxResolution=function(){return this.get(Se)},e.prototype.getMinResolution=function(){return this.get(Ce)},e.prototype.getMinZoom=function(){return this.get(Ee)},e.prototype.getMaxZoom=function(){return this.get(ze)},e.prototype.getOpacity=function(){return this.get(be)},e.prototype.getSourceState=function(){return Wt()},e.prototype.getVisible=function(){return this.get(xe)},e.prototype.getZIndex=function(){return this.get(we)},e.prototype.setExtent=function(t){this.set(ke,t)},e.prototype.setMaxResolution=function(t){this.set(Se,t)},e.prototype.setMinResolution=function(t){this.set(Ce,t)},e.prototype.setMaxZoom=function(t){this.set(ze,t)},e.prototype.setMinZoom=function(t){this.set(Ee,t)},e.prototype.setOpacity=function(t){Fe("number"==typeof t,64),this.set(be,t)},e.prototype.setVisible=function(t){this.set(xe,t)},e.prototype.setZIndex=function(t){this.set(we,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(Zt),Ve="prerender",qe="postrender",We="precompose",Ue="postcompose",Xe="rendercomplete",Ke="undefined",Ye="ready",Ze=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function He(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var $e=function(t){function e(e){var i=this,o=bt({},e);delete o.source,(i=t.call(this,o)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Te,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return Ze(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Te)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ke},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Nt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Lt(t,Et,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Nt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Nt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Lt(t,We,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Fe(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Lt(this,Et,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Te,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Be),Je=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qe=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(Ot,i.handleClick_.bind(i),!1);var h=n+" "+"ol-unselectable "+ge+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;return d.className=h,d.appendChild(i.toggleButton_),d.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Je(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(He(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var h=0,d=p.length;h<d;++h)p[h]in e||(i.push(p[h]),e[p[h]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!mt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(fe),this.collapsed_?le(this.collapseLabel_,this.label_):le(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(he),ti="add",ei="remove",ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oi="length",ni=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return ii(e,t),e}(ut),ri=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return ii(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(oi)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ni(ti,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ni(ei,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ni(ei,o,t)),this.dispatchEvent(new ni(ti,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(oi,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new Oe(58)},e}(Zt);function ai(t){return Math.pow(t,3)}function si(t){return 1-ai(1-t)}function li(t){return 3*t*t-2*t*t*t}function ui(t){return t}var pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(Ot,i.handleClick_.bind(i),!1);var u=n+" "+"ol-unselectable "+ge,p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add(de),i}return pi(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:si}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains(de);n||0!==i?n&&0!==i&&this.element.classList.remove(de):this.element.classList.add(de)}this.label_.style.transform=o}this.rotation_=i}},e}(he),di=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ci=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",h=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=p,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(Ot,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=h,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(Ot,i.handleClick_.bind(i,-r),!1);var g=n+" "+"ol-unselectable "+ge,f=i.element;return f.className=g,f.appendChild(d),f.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return di(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:si})):e.setZoom(o)}}},e}(he),gi="pointermove",fi="pointerdown",mi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},vi={};vi[mi.RADIANS]=6370997/(2*Math.PI),vi[mi.DEGREES]=2*Math.PI*6370997/360,vi[mi.FEET]=.3048,vi[mi.METERS]=1,vi[mi.USFEET]=1200/3937;var yi=mi,_i=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||vi[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),bi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xi=6378137,ki=Math.PI*xi,wi=[-ki,-ki,ki,ki],Si=[-180,-85,180,85],Ci=xi*Math.log(Math.tan(Math.PI/2)),zi=function(t){function e(e){return t.call(this,{code:e,units:yi.METERS,extent:wi,global:!0,worldExtent:Si,getPointResolution:function(t,e){return t/Me(e[1]/xi)}})||this}return bi(e,t),e}(_i),Ei=[new zi("EPSG:3857"),new zi("EPSG:102100"),new zi("EPSG:102113"),new zi("EPSG:900913"),new zi("http://www.opengis.net/def/crs/EPSG/0/3857"),new zi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ti(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=ki*t[a]/180;var s=xi*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Ci?s=Ci:s<-Ci&&(s=-Ci),r[a+1]=s}return r}function Pi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/ki,r[a+1]=360*Math.atan(Math.exp(t[a+1]/xi))/Math.PI-90;return r}var Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fi=[-180,-90,180,90],Ri=6378137*Math.PI/180,Mi=function(t){function e(e,i){return t.call(this,{code:e,units:yi.DEGREES,extent:Fi,axisOrientation:i,global:!0,metersPerUnit:Ri,worldExtent:Fi})||this}return Oi(e,t),e}(_i),Ii=[new Mi("CRS:84"),new Mi("EPSG:4326","neu"),new Mi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Mi("urn:ogc:def:crs:OGC:2:84"),new Mi("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new Mi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Mi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ji={};var Di={};function Ai(t,e,i){var o=t.getCode(),n=e.getCode();o in Di||(Di[o]={}),Di[o][n]=i}var Li="bottom-left",Gi="bottom-right",Ni="top-left",Bi="top-right",Vi=0,qi=1,Wi=2,Ui=4,Xi=8,Ki=16;function Yi(t){for(var e=io(),i=0,o=t.length;i<o;++i)uo(e,t[i]);return e}function Zi(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Hi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function $i(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function Ji(t,e){return to(t,e[0],e[1])}function Qi(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function to(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function eo(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Vi;return a<i?l|=Ki:a>n&&(l|=Ui),s<o?l|=Xi:s>r&&(l|=Wi),l===Vi&&(l=qi),l}function io(){return[1/0,1/0,-1/0,-1/0]}function oo(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function no(t){return oo(1/0,1/0,-1/0,-1/0,t)}function ro(t,e){var i=t[0],o=t[1];return oo(i,o,i,o,e)}function ao(t,e,i,o,n){return po(no(n),t,e,i,o)}function so(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function lo(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function uo(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function po(t,e,i,o,n){for(;i<o;i+=n)ho(t,e[i],e[i+1]);return t}function ho(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function co(t,e){var i;return(i=e(fo(t)))||(i=e(mo(t)))||(i=e(wo(t)))?i:(i=e(ko(t)))||!1}function go(t){var e=0;return zo(t)||(e=So(t)*bo(t)),e}function fo(t){return[t[0],t[1]]}function mo(t){return[t[2],t[1]]}function vo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function yo(t,e){var i;return e===Li?i=fo(t):e===Gi?i=mo(t):e===Ni?i=ko(t):e===Bi?i=wo(t):Fe(!1,13),i}function _o(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,h=a*s,d=a*l,c=t[0],g=t[1],f=c-u+d,m=c-u-d,v=c+u-d,y=c+u+d,_=g-p-h,b=g-p+h,x=g+p+h,k=g+p-h;return oo(Math.min(f,m,v,y),Math.min(_,b,x,k),Math.max(f,m,v,y),Math.max(_,b,x,k),n)}function bo(t){return t[3]-t[1]}function xo(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return Co(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):no(o),o}function ko(t){return[t[0],t[3]]}function wo(t){return[t[2],t[3]]}function So(t){return t[2]-t[0]}function Co(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function zo(t){return t[2]<t[0]||t[3]<t[1]}function Eo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return oo(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var To="Point",Po="LineString",Oo="LinearRing",Fo="Polygon",Ro="MultiPoint",Mo="MultiLineString",Io="MultiPolygon",jo="GeometryCollection",Do="Circle",Ao=6371008.8;function Lo(t,e,i){var o=i||Ao,n=Ae(t[1]),r=Ae(e[1]),a=(r-n)/2,s=Ae(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Go(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=Ae(s-n)*(2+Math.sin(Ae(r))+Math.sin(Ae(l))),n=s,r=l}return i*e*e/2}function No(t,e){var i=e||{},o=i.radius||Ao,n=i.projection||"EPSG:3857",r=t.getType();r!==jo&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,h,d=0;switch(r){case To:case Ro:case Po:case Mo:case Oo:break;case Fo:for(a=t.getCoordinates(),d=Math.abs(Go(a[0],o)),l=1,u=a.length;l<u;++l)d-=Math.abs(Go(a[l],o));break;case Io:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],d+=Math.abs(Go(s[0],o)),p=1,h=s.length;p<h;++p)d-=Math.abs(Go(s[p],o));break;case jo:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)d+=No(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return d}function Bo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],h=s[1],d=p-l,c=h-u,g=0===d&&0===c?0:(d*(n-l)+c*(r-u))/(d*d+c*c||0);return g<=0?(i=l,o=u):g>=1?(i=p,o=h):(i=l+g*d,o=u+g*c),[i,o]}function Vo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function qo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Wo(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Uo(t,e){return Math.sqrt(Wo(t,e))}function Xo(t,e){return Wo(t,Bo(t,e))}function Ko(t,e){if(e.canWrapX()){var i=So(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||So(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Yo(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function Zo(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Ho(t){!function(t,e){ji[t]=e}(t.getCode(),t),Ai(t,t,Yo)}function $o(t){return"string"==typeof t?ji[e=t]||ji[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Jo(t,e,i,o){var n,r=(t=$o(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/vi[o])}else{var a=t.getUnits();if(a==yi.DEGREES&&!o||o==yi.DEGREES)n=e;else{var s,l=nn(t,$o("EPSG:4326"));if(l===Zo&&a!==yi.DEGREES)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(Lo((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Lo(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?vi[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function Qo(t){!function(t){t.forEach(Ho)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ai(e,t,Yo)}))}))}function tn(t,e){return t?"string"==typeof t?$o(t):t:$o(e)}function en(t,e){return an(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function on(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||nn(t,e)===Yo)&&i}function nn(t,e){var i=function(t,e){var i;return t in Di&&e in Di[t]&&(i=Di[t][e]),i}(t.getCode(),e.getCode());return i||(i=Zo),i}function rn(t,e){return nn($o(t),$o(e))}function an(t,e,i){return rn(e,i)(t,void 0,t.length)}var sn,ln,un;function pn(t,e){return t}function hn(t,e){return t}function dn(t,e){return t}function cn(t,e){return t}Qo(Ei),Qo(Ii),sn=Ei,ln=Ti,un=Pi,Ii.forEach((function(t){sn.forEach((function(e){Ai(t,e,ln),Ai(e,t,un)}))}));var gn,fn=new Array(6);function mn(t){return yn(t,1,0,0,1,0,0)}function vn(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],h=e[3],d=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*h,t[3]=o*p+r*h,t[4]=i*d+n*c+a,t[5]=o*d+r*c+s,t}function yn(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function _n(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function bn(t,e,i){return vn(t,yn(fn,e,0,0,i,0,0))}function xn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function kn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];Fe(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function wn(t){var e="matrix("+t.join(", ")+")";if(ne)return e;var i=gn||(gn=document.createElement("div"));return i.style.transform=e,i.style.transform}var Sn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Cn=/^([a-z]*)$|^hsla?\(.*\)$/i;function zn(t){return"string"==typeof t?t:Rn(t)}var En,Tn,Pn=(En={},Tn=0,function(t){var e;if(En.hasOwnProperty(t))e=En[t];else{if(Tn>=1024){var i=0;for(var o in En)0==(3&i++)&&(delete En[o],--Tn)}e=function(t){var e,i,o,n,r;if(Cn.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Sn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?Fn(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Fn(r)):Fe(!1,14);return r}(t),En[t]=e,++Tn}return e});function On(t){return Array.isArray(t)?t:Pn(t)}function Fn(t){return t[0]=Re(t[0]+.5|0,0,255),t[1]=Re(t[1]+.5|0,0,255),t[2]=Re(t[2]+.5|0,0,255),t[3]=Re(t[3],0,1),t}function Rn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function Mn(t,e,i){return e+":"+t+":"+(i?zn(i):"null")}var In=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var o=Mn(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=Mn(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),jn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Dn(t,e){In.expire()}var An=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return jn(e,t),e.prototype.dispatchRenderEvent=function(t,e){Wt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;xn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),kn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var h=u.projection,d=Ko(t.slice(),h),c=[[0,0]];if(h.canWrapX()&&o){var g=So(h.getExtent());c.push([-g,0],[g,0])}for(var f=e.layerStatesArray,m=f.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=f[b],k=x.layer;if(k.hasRenderer()&&He(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?d:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var E=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*E})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Wt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,vt,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Wt()},e.prototype.scheduleExpireIconCache=function(t){In.canExpireCache()&&t.postRenderFunctions.push(Dn)},e}(ht),Ln=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Ln(e,t),e}(ut),Nn="10px sans-serif",Bn="#000",Vn="round",qn=[],Wn="round",Un="#000",Xn="center",Kn="middle",Yn=[0,0,0,0],Zn=new Zt;(new zt).setSize=function(){console.warn("labelCache is deprecated.")};var Hn,$n,Jn=null,Qn={},tr=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=or(t+" "+a+" "+i+p,r),s!=p){var h=or(t+" "+a+" "+i+s+","+p,r);l=l&&h!=e}}return!!l}function s(){for(var e=!0,i=Zn.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Zn.get(r)<100&&(a.apply(this,r.split("\n"))?(xt(Qn),Jn=null,Hn=void 0,Zn.set(r,100)):(Zn.set(r,Zn.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=ye(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Zn.get(u)&&(Zn.set(u,100,!0),a(i.style,i.weight,l)||(Zn.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),er=function(t){var e=Qn[t];if(null==e){if(ne){var i=ye(t),o=ir(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else $n||(($n=document.createElement("div")).innerHTML="M",$n.style.minHeight="0",$n.style.maxHeight="none",$n.style.height="auto",$n.style.padding="0",$n.style.border="none",$n.style.position="absolute",$n.style.display="block",$n.style.left="-99999px"),$n.style.font=t,document.body.appendChild($n),e=$n.offsetHeight,document.body.removeChild($n);Qn[t]=e}return e};function ir(t,e){return Jn||(Jn=se(1,1)),t!=Hn&&(Jn.font=t,Hn=Jn.font),Jn.measureText(e)}function or(t,e){return ir(t,e).width}function nr(t,e,i){if(e in i)return i[e];var o=or(t,e);return i[e]=o,o}function rr(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sr=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Lt(Zn,pt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return ar(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new Gn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Nt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(We,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,He(s,i)&&(s.sourceState==Ye||s.sourceState==Ke)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(Ue,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&He(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var h=o(u,p);if(h)return h}}}},e}(An),lr="layergroup",ur="size",pr="target",hr="view",dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cr="layers",gr=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(cr,i.handleLayersChanged_),r?Array.isArray(r)?r=new ri(r.slice(),{unique:!0}):Fe("function"==typeof r.getArray,43):r=new ri(void 0,{unique:!0}),i.setLayers(r),i}return dr(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Nt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Lt(t,ti,this.handleLayersAdd_,this),Lt(t,ei,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Nt);xt(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[Xt(r)]=[Lt(r,pt,this.handleLayerChange_,this),Lt(r,Et,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[Xt(e)]=[Lt(e,pt,this.handleLayerChange_,this),Lt(e,Et,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=Xt(t.element);this.listenerKeys_[e].forEach(Nt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(cr)},e.prototype.setLayers=function(t){this.set(cr,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=xo(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Ye},e}(Be),fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return fr(e,t),e}(ut),vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yr=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return vr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(mr),_r={SINGLECLICK:"singleclick",CLICK:Ot,DBLCLICK:Ft,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},br=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Lt(n,fi,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Lt(n,gi,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Dt,o.boundHandleTouchMove_,!!ae&&{passive:!1}),o}return br(e,t),e.prototype.emulateClick_=function(t){var e=new yr(_r.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new yr(_r.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new yr(_r.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==_r.POINTERUP||e.type==_r.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==_r.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new yr(_r.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Nt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new yr(_r.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?_t:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Lt(n,_r.POINTERMOVE,this.handlePointerMove_,this),Lt(n,_r.POINTERUP,this.handlePointerUp_,this),Lt(this.element_,_r.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Lt(this.element_.getRootNode(),_r.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new yr(_r.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new yr(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Nt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Dt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Nt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Nt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(zt),kr=1/0,wr=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,xt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){Fe(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=kr&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==kr?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),Sr=0,Cr=1,zr=2,Er=3,Tr=4,Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Or=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return Pr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(Et,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===zr||i===Er||i===Tr){e.removeEventListener(Et,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==Sr||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(wr);var Fr=0,Rr=1,Mr="center",Ir="resolution",jr="rotation",Dr=256;function Ar(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,h=s?s[1]:0,d=t[0]+l/2+p,c=t[2]-l/2+p,g=t[1]+u/2+h,f=t[3]-u/2+h;d>c&&(c=d=(c+d)/2),g>f&&(f=g=(f+g)/2);var m=Re(o[0],d,c),v=Re(o[1],g,f),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,d-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,g-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-f)/y)),[m,v]}}}function Lr(t){return t}function Gr(t,e,i,o){var n=So(e)/i[0],r=bo(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function Nr(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Re(o,i/2,2*e)}function Br(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Gr(t,o,s,n):t;return(void 0===i||i)&&l?Nr(r,u,e):Re(r,e,u)}}}function Vr(t){return void 0!==t?0:void 0}function qr(t){return void 0!==t?t:void 0}var Wr="XY",Ur="XYZ",Xr="XYM",Kr="XYZM";function Yr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function Zr(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],h=r[1],d=0,c=e;c<i;c+=o){var g=t[c]-p,f=t[c+1]-h;s[d++]=p+g*l-f*u,s[d++]=h+g*u+f*l;for(var m=c+2;m<c+o;++m)s[d++]=t[m]}return a&&s.length!=d&&(s.length=d),s}function Hr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var $r=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Jr=[1,0,0,1,0,0],Qr=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&mt(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return $r(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Wt()},e.prototype.closestPointXY=function(t,e,i,o){return Wt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Wt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&no(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){Wt()},e.prototype.scale=function(t,e,i){Wt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Wt()},e.prototype.getType=function(){return Wt()},e.prototype.applyTransform=function(t){Wt()},e.prototype.intersectsExtent=function(t){return Wt()},e.prototype.translate=function(t,e){Wt()},e.prototype.transform=function(t,e){var i=$o(t),o=i.getUnits()==yi.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=bo(a)/bo(r);return xn(Jr,a[0],a[3],s,-s,0,0,0),Yr(t,0,t.length,n,Jr,o),rn(i,e)(t,o,n)}:rn(i,e);return this.applyTransform(o),this},e}(Zt),ta=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ea(t){var e;return t==Wr?e=2:t==Ur||t==Xr?e=3:t==Kr&&(e=4),e}var ia=function(t){function e(){var e=t.call(this)||this;return e.layout=Wr,e.stride=2,e.flatCoordinates=null,e}return ta(e,t),e.prototype.computeExtent=function(t){return ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Wt()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=ea(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Wt()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=ea(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Wr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Wr:3==t?e=Ur:4==t&&(e=Kr);return e}(o=e.length)}this.layout=t,this.stride=o},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Zr(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=vo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],h=0,d=e;d<i;d+=o){var c=t[d]-u,g=t[d+1]-p;l[h++]=u+n*c,l[h++]=p+r*g;for(var f=d+2;f<d+o;++f)l[h++]=t[f]}s&&l.length!=h&&(l.length=h)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Hr(i,0,i.length,o,t,e,i),this.changed()}},e}(Qr);function oa(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,h=t[i+1]-u;if(0===p&&0===h)s=e;else{var d=((n-l)*p+(r-u)*h)/(p*p+h*h);if(d>1)s=i;else{if(d>0){for(var c=0;c<o;++c)a[c]=Ge(t[e+c],t[i+c],d);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function na(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=De(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function ra(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=na(t,e,s,o,n),e=s}return n}function aa(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var h,d;if(0===n){if((d=De(a,s,t[e],t[e+1]))<u){for(h=0;h<o;++h)l[h]=t[e+h];return l.length=o,d}return u}for(var c=p||[NaN,NaN],g=e+o;g<i;)if(oa(t,g-o,g,o,a,s,c),(d=De(a,s,c[0],c[1]))<u){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o,g+=o}else g+=o*Math.max((Math.sqrt(d)-Math.sqrt(u))/n|0,1);if(r&&(oa(t,i-o,e,o,a,s,c),(d=De(a,s,c[0],c[1]))<u)){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o}return u}function sa(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=aa(t,e,g,o,n,r,a,s,l,u,h),e=g}return u}function la(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function ua(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function pa(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=ua(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function ha(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var h=u.pop(),d=u.pop(),c=0,g=t[d],f=t[d+1],m=t[h],v=t[h+1],y=d+o;y<h;y+=o){var _=je(t[y],t[y+1],g,f,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,d+o<p&&u.push(d,p),p+o<h&&u.push(p,h))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function da(t,e){return e*Math.round(t/e)}function ca(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=da(t[e],n),p=da(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=da(t[e],n),l=da(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var h=da(t[e],n),d=da(t[e+1],n);if(e+=o,h!=s||d!=l){var c=s-u,g=l-p,f=h-u,m=d-p;c*m==g*f&&(c<0&&f<c||c==f||c>0&&f>c)&&(g<0&&m<g||g==m||g>0&&m>g)?(s=h,l=d):(r[a++]=s,r[a++]=l,u=s,p=l,s=h,l=d)}}return r[a++]=s,r[a++]=l,a}function ga(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ca(t,e,p,o,n,r,a),s.push(a),e=p}return a}function fa(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function ma(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=fa(t,e,u,o,r[a]),e=u}return r.length=a,r}function va(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ma(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function ya(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function _a(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ya(t,e,s,o),e=s}return n}var ba=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xa=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ba(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ha(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Wr)},e.prototype.getType=function(){return Oo},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ua(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia),ka=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wa=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return ka(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=De(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ro(this.flatCoordinates,t)},e.prototype.getType=function(){return To},e.prototype.intersectsExtent=function(t){return to(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=la(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia);function Sa(t,e,i,o,n){return!co(n,(function(n){return!Ca(t,e,i,o,n[0],n[1])}))}function Ca(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function za(t,e,i,o,n,r){if(0===i.length)return!1;if(!Ca(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(Ca(t,i[a-1],i[a],o,n,r))return!1;return!0}function Ea(t,e,i,o,n,r,a){for(var s,l,u,p,h,d,c,g=n[r+1],f=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],d=t[y-o+1],s=e;s<y;s+=o)h=t[s],c=t[s+1],(g<=d&&c<=g||d<=g&&g<=c)&&(u=(g-d)/(c-d)*(h-p)+p,f.push(u)),p=h,d=c}var _=NaN,b=-1/0;for(f.sort(dt),p=f[0],s=1,l=f.length;s<l;++s){h=f[s];var x=Math.abs(h-p);x>b&&za(t,e,i,o,u=(p+h)/2,g)&&(_=u,b=x),p=h}return isNaN(_)&&(_=n[r]),a?(a.push(_,g,b),a):[_,g,b]}function Ta(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=Ea(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function Pa(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function Oa(t,e,i,o,n){var r=po([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!Co(n,r)&&(!!Qi(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||Pa(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=eo(t,e),r=eo(t,i);if(n===qi||r===qi)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],h=e[1],d=i[0],c=i[1],g=(c-h)/(d-p),f=void 0,m=void 0;r&Wi&&!(n&Wi)&&(o=(f=d-(c-u)/g)>=a&&f<=l),o||!(r&Ui)||n&Ui||(o=(m=c-(d-l)*g)>=s&&m<=u),o||!(r&Xi)||n&Xi||(o=(f=d-(c-s)/g)>=a&&f<=l),o||!(r&Ki)||n&Ki||(o=(m=c-(d-a)*g)>=s&&m<=u)}return o}(n,t,e)})))))}function Fa(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(Oa(t,e,i,o,n)||Ca(t,e,i,o,n[0],n[1])||Ca(t,e,i,o,n[0],n[3])||Ca(t,e,i,o,n[2],n[1])||Ca(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(Sa(t,i[r-1],i[r],o,n)&&!Oa(t,i[r-1],i[r],o,n))return!1;return!0}function Ra(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Ma(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Ia(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function ja(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&Ra(t,e,l,o),e=l}return e}function Da(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=ja(t,e,i[r],o,n);return e}var Aa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),La=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Aa(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?ft(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return za(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return _a(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ja(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ma(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=vo(this.getExtent());this.flatInteriorPoint_=Ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new wa(this.getFlatInteriorPoint(),Xr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new xa(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new xa(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Ia(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ja(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=ga(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Wr,o)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return Fa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=pa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(ia),Ga=La;function Na(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new La(r,Wr,[r.length])}function Ba(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var h=[l.length],d=new La(l,r,h);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*Le(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(d,a,t.getRadius(),i),d}var Va=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function qa(t,e){setTimeout((function(){t(e)}),0)}function Wa(t){return!(t.sourceCenter&&t.targetCenter&&!Vo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ua(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var Xa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=tn(o.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,o.center&&(o.center=hn(o.center,i.projection_)),o.extent&&(o.extent=cn(o.extent,i.projection_)),i.applyOptions_(o),i}return Va(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,d=tn(t.projection,"EPSG:3857"),c=d.getExtent(),g=t.constrainOnlyCenter,f=t.extent;u||f||!d.isGlobal()||(g=!1,f=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Gr(l,i,a,o):l;if(s)return void 0===e||e?Nr(n,p,u):Re(n,u,p);var h=Math.min(p,n),d=Math.floor(ct(t,h,r));return t[d]>p&&d<t.length-1?t[d+1]:t[d]}}}(m,p,!g&&f,h):Br(i,o,p,!g&&f,h)}else{var v=(c?Math.max(So(c),bo(c)):360*vi[yi.DEGREES]/d.getMetersPerUnit())/Dr/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Gr(e,n,l,r):e,h=void 0!==i?i:0;if(u)return void 0===o||o?Nr(a,p,h):Re(a,h,p);var d=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,g=Math.min(p,a),f=Math.floor(Math.log(e/g)/Math.log(t)+c),m=Math.max(d,f);return Re(e/Math.pow(t,m),h,p)}}}(l,i,o,p,!g&&f,h):Br(i,o,p,!g&&f,h)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ar(t.extent,t.constrainOnlyCenter,e)}var i=tn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Ar(o,!1,!1)}return Lr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||Ae(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?qr:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):qr}return Vr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=bt({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),bt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var o=arguments[i];o.center&&((o=bt({},o)).center=hn(o.center,this.getProjection())),o.anchor&&((o=bt({},o)).anchor=hn(o.anchor,this.getProjection())),e[i]=o}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],h={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||li,callback:e};if(p.center&&(h.sourceCenter=a,h.targetCenter=p.center.slice(),a=h.targetCenter),void 0!==p.zoom?(h.sourceResolution=s,h.targetResolution=this.getResolutionForZoom(p.zoom),s=h.targetResolution):p.resolution&&(h.sourceResolution=s,h.targetResolution=p.resolution,s=h.targetResolution),void 0!==p.rotation){h.sourceRotation=l;var d=Le(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+d,l=h.targetRotation}Wa(h)?h.complete=!0:r+=h.duration,u.push(h)}this.animations_.push(u),this.setHint(Fr,1),this.updateAnimations_()}else e&&qa(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Fr]>0},e.prototype.getInteracting=function(){return this.hints_[Rr]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Fr,-this.hints_[Fr]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&qa(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var h=s.sourceCenter[0],d=s.sourceCenter[1],c=s.targetCenter[0],g=s.targetCenter[1];this.nextCenter_=s.targetCenter;var f=h+p*(c-h),m=d+p*(g-d);this.targetCenter_=[f,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?Le(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(Fr,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&qa(k,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,o,n,r=this.getCenterInternal();return void 0!==r&&(qo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?pn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Mr)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return dn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Fe(i,1);var o=this.getResolution();Fe(void 0!==o,2);var n=this.getRotation();return Fe(void 0!==n,3),_o(i,o,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ir)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(cn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=So(t)/i[0],n=bo(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(jr)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ua(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,o=this.minZoom_||0;if(this.resolutions_){var n=ct(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Re(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Re(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Fe(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Fe(!zo(t),25),i=Na(o=cn(t,this.getProjection()));else if(t.getType()===Do){var o;(i=Na(o=cn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),vo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,h=n.length;p<h;p+=r){var d=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,d),s=Math.min(s,c),l=Math.max(l,d),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),h=Math.cos(u),d=vo(s);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;var c=d[0]*h-d[1]*p,g=d[1]*h+d[0]*p,f=this.getConstrainedCenter([c,g],l),m=i.callback?i.callback:_t;void 0!==i.duration?this.animateInternal({resolution:l,center:f,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=f,this.applyTargetState_(!1,!0),qa(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(hn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ua(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ua(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=pn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&hn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=hn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(hn(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var i=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(jr)!==o&&this.set(jr,o),this.get(Ir)!==r&&this.set(Ir,r),this.get(Mr)&&Vo(this.get(Mr),a)||this.set(Mr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Vo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:si,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Rr,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&hn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Rr,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(Zt);function Ka(t){return t[0]>0&&t[1]>0}function Ya(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Za=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Ha=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new gr({layers:t.layers});r[lr]=a,r[pr]=t.target,r[hr]=t.view instanceof Xa?t.view:new Xa,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ri(t.controls.slice()):(Fe("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new ri(t.interactions.slice()):(Fe("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new ri(t.overlays.slice()):(Fe("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new ri;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:oe,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new ri,i.interactions=o.interactions||new ri,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Or(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(lr,i.handleLayerGroupChanged_),i.addChangeListener(hr,i.handleViewChanged_),i.addChangeListener(ur,i.handleSizeChanged_),i.addChangeListener(pr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof Xa||e.view.then((function(t){n.setView(new Xa(t))})),i.controls.addEventListener(ti,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ei,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ti,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ei,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ti,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ei,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return Za(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:vt,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||vt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:vt,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(pr)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return pn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?_n(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(lr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof ri)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=hn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?_n(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ur)},e.prototype.getView=function(){return this.get(hr)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return kr;if(!t.wantedTiles[i][e.getKey()])return kr;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new yr(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===fi||i===At||i===Rt){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[Fr]||n[Rr]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(Xe)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Xe,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Nt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Pt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(At,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(jt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ue(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new xr(this,this.moveTolerance_),_r)this.mapBrowserEventHandler_.addEventListener(_r[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Pt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(At,this.boundHandleBrowserEvent_,!!ae&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Lt(n,Rt,this.handleBrowserEvent,this),Lt(n,Mt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(jt,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Nt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Nt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Lt(t,pt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Lt(t,Et,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Nt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Lt(t,pt,this.render,this),Lt(t,Et,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Ka(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:_o(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=_o(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!zo(this.previousExtent_)&&!so(r.extent,this.previousExtent_))&&(this.dispatchEvent(new mr($t,this,n)),this.previousExtent_=no(this.previousExtent_));this.previousExtent_&&!r.viewHints[Fr]&&!r.viewHints[Rr]&&!so(r.extent,this.previousExtent_)&&(this.dispatchEvent(new mr(Jt,this,r)),Hi(r.extent,this.previousExtent_))}this.dispatchEvent(new mr(Ht,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(lr,t)},e.prototype.setSize=function(t){this.set(ur,t)},e.prototype.setTarget=function(t){this.set(pr,t)},e.prototype.setView=function(t){if(!t||t instanceof Xa)this.set(hr,t);else{this.set(hr,new Xa);var e=this;t.then((function(t){e.setView(new Xa(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Ka(e=[o,n])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Zt),$a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ja="units",Qa="degrees",ts="imperial",es="nautical",is="metric",os="us",ns=[1,2,5],rs=25.4/.28,as=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" "+ce,i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener(Ja,i.handleUnitsChanged_),i.setUnits(o.units||is),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return $a(e,t),e.prototype.getUnits=function(){return this.get(Ja)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Ja,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,o=this.getUnits(),n=o==Qa?yi.DEGREES:yi.METERS,r=Jo(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||rs)/rs,s=a*r,l="";if(o==Qa){var u=vi[yi.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==ts?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==es?(r/=1852,l="nm"):o==is?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==os?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):Fe(!1,33);for(var p,h,d,c,g=3*Math.floor(Math.log(a*r)/Math.log(10));;){d=Math.floor(g/3);var f=Math.pow(10,d);if(p=ns[(g%3+3)%3]*f,h=Math.round(p/r),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=a)break;++g}c=this.scaleBar_?this.createScaleBar(h,p,l):p.toFixed(d<0?-d:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=Jo(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||rs,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(he);function ss(t){var e=t||{},i=new ri;return(void 0===e.zoom||e.zoom)&&i.push(new ci(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new hi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Qe(e.attributionOptions)),i}var ls=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var us=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return ls(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var o=this.getStyle();return o&&t.setStyle(o),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Nt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Lt(t,Et,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(Fe("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Zt),ps=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var o=e.dataProjection?$o(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===yi.TILE_PIXELS&&(o=$o(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return bt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Wt()},t.prototype.readFeature=function(t,e){return Wt()},t.prototype.readFeatures=function(t,e){return Wt()},t.prototype.readGeometry=function(t,e){return Wt()},t.prototype.readProjection=function(t){return Wt()},t.prototype.writeFeature=function(t,e){return Wt()},t.prototype.writeFeatures=function(t,e){return Wt()},t.prototype.writeGeometry=function(t,e){return Wt()},t}();function hs(t,e,i){var o,n=i?$o(i.featureProjection):null,r=i?$o(i.dataProjection):null;if(o=n&&r&&!on(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var ds="arraybuffer",cs="json",gs="text",fs="xml",ms=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function vs(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var ys=function(t){function e(){return t.call(this)||this}return ms(e,t),e.prototype.getType=function(){return cs},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(vs(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(vs(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Wt()},e.prototype.readFeaturesFromObject=function(t,e){return Wt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(vs(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Wt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(vs(t))},e.prototype.readProjectionFromObject=function(t){return Wt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Wt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Wt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Wt()},e}(ps);function _s(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],h=t[e+1],d=0,c=[0],g=e+o;g<i;g+=o){var f=t[g],m=t[g+1];d+=Math.sqrt((f-p)*(f-p)+(m-h)*(m-h)),c.push(d),p=f,h=m}var v=n*d,y=function(t,e,i){for(var o,n,r=i||dt,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(g=0;g<_;++g)b[g]=void 0===s?NaN:void 0===l?t[s+g]:Ge(t[s+g],t[s+o+g],l);return b}function bs(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var h=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var d=0;d<o-1;++d)a.push(Ge(t[(s-1)*o+d],t[s*o+d],h));return a.push(n),a}function xs(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var ks=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ws=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ks(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?ft(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return Pa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Xr&&this.layout!=Kr)return null;var i=void 0!==e&&e;return bs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return _s(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return xs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ha(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Wr)},e.prototype.getType=function(){return Po},e.prototype.intersectsExtent=function(t){return Oa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ua(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia),Ss=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout()),ft(s,h.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return Ss(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?ft(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Xr&&this.layout!=Kr||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return bs(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return bs(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return ma(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new ws(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new ws(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];ft(t,_s(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ha(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Wr,o)},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(Oa(t,e,i[r],o,n))return!0;e=i[r]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=pa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(ia),zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Es=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return zs(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?ft(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<$i(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=De(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new wa(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,o=[],n=0,r=t.length;n<r;n+=i){var a=new wa(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(to(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ua(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia);function Ts(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=ao(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}var Ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Os=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout());for(var d=s.length,c=h.getEnds(),g=0,f=c.length;g<f;++g)c[g]+=d;ft(s,h.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return Ps(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;ft(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=ra(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=sa(t,e,g,o,n,r,a,s,l,u,h),e=g[g.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(za(t,e,l,o,n,r))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=_a(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Da(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,va(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Ts(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Ta(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Es(this.getFlatInteriorPoints().slice(),Xr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Ia(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Da(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],h=[];a=ga(t,e,p,o,n,r,a,h),s.push(h),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Wr,o)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ga(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var h=new Ga(e.slice(n,l),t,s);o.push(h),n=l}return o},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Fa(t,e,s,o,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=pa(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(ia),Fs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Rs(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var Ms=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return Fs(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Nt),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Lt(this.geometries_[t],Et,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<$i(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){no(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)lo(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return Rs(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return jo},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=vo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Rs(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Qr),Is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function js(t,e){if(!t)return null;var i;switch(t.type){case To:i=function(t){return new wa(t.coordinates)}(t);break;case Po:i=function(t){return new ws(t.coordinates)}(t);break;case Fo:i=function(t){return new Ga(t.coordinates)}(t);break;case Ro:i=function(t){return new Es(t.coordinates)}(t);break;case Mo:i=function(t){return new Cs(t.coordinates)}(t);break;case Io:i=function(t){return new Os(t.coordinates)}(t);break;case jo:i=function(t,e){var i=t.geometries.map((function(t){return js(t,e)}));return new Ms(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return hs(i,!1,e)}function Ds(t,e){var i,o=(t=hs(t,!0,e)).getType();switch(o){case To:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Po:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Fo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Ro:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Io:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case jo:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=bt({},e);return delete i.featureProjection,Ds(t,i)}))}}(t,e);break;case Do:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var As=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=$o(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=$o(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return Is(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=js((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new us;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return js(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=$o(i.properties.name):"EPSG"===i.type?e=$o("EPSG:"+i.properties.code):Fe(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Ds(r,e),delete n[t.getGeometryName()]),wt(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ds(t,this.adaptOptions(e))},e}(ys),Ls=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Gs="fraction",Ns="pixels",Bs="bottom-left",Vs="bottom-right",qs="top-left",Ws="top-right",Us=0,Xs=1,Ks=2,Ys=3,Zs=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ya(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Wt()},t.prototype.getImage=function(t){return Wt()},t.prototype.getHitDetectionImage=function(){return Wt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Wt()},t.prototype.getImageSize=function(){return Wt()},t.prototype.getOrigin=function(){return Wt()},t.prototype.getSize=function(){return Wt()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ya(t)},t.prototype.listenImageChange=function(t){Wt()},t.prototype.load=function(){Wt()},t.prototype.unlistenImageChange=function(t){Wt()},t}(),Hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),$s=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Hs(e,t),e.prototype.changed=function(){this.dispatchEvent(Et)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Wt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Wt()},e}(zt),Js=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Qs(t,e,i){var o=t;if(o.src&&re){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Gt(o,It,e),Gt(o,Tt,i)];return function(){a.forEach(Nt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Us)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Us,s.imageLoadFunction_=a,s}Js(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ys,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=bo(this.extent)/this.image_.height),this.state=Ks,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Us&&this.state!=Ys||(this.state=Xs,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Qs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=bo(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}($s);var tl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),el=null,il=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return tl(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Ks){el||(el=se(1,1)),el.drawImage(this.image_,0,0);try{el.getImageData(0,0,1,1),this.tainted_=!1}catch(t){el=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Et)},e.prototype.handleImageError_=function(){this.imageState_=Ys,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Ks,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=se(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Us){this.imageState_=Xs;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Qs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Ks){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=zn(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(zt);var ol=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nl=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:qs,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Gs,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Gs,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;Fe(!(void 0!==p&&l),4),Fe(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||Xt(l)),Fe(void 0!==p&&p.length>0,6);var h=void 0!==o.src?Us:Ks;return i.color_=void 0!==o.color?On(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=In.get(e,o,r);return a||(a=new il(t,e,i,o,n,r),In.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,h,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:qs,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return ol(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Gs||this.anchorYUnits_==Gs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Gs&&(t[0]*=e[0]),this.anchorYUnits_==Gs&&(t[1]*=e[1])}if(this.anchorOrigin_!=qs){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ws&&this.anchorOrigin_!=Vs||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Bs&&this.anchorOrigin_!=Vs||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=qs){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Ws&&this.offsetOrigin_!=Vs||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Bs&&this.offsetOrigin_!=Vs||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Et,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Et,t)},e}(Zs),rl=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();function al(t){return Array.isArray(t)?Rn(t):t}var sl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ll=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return sl(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,o=se(i.size*t,i.size*t);this.draw_(i,o,t),e=o.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Ks},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),h=p/l;if("miter"===t&&h<=i)return h*e;var d=e/2/h,c=e/2*(u/p),g=Math.sqrt((o+d)*(o+d)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*g;var f=o*Math.sin(s),m=n-Math.sqrt(o*o-f*f),v=Math.sqrt(f*f+m*m)/f;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(g,y)}return 2*g},e.prototype.createRenderOptions=function(){var t,e=Wn,i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Un),t=al(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Wn),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();null===o&&(o=Bn),e.fillStyle=al(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())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=On(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=se(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Bn,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Zs),ul=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return ul(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(ll),hl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=fl,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=fl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var dl=null;function cl(t,e){if(!dl){var i=new Ls({color:"rgba(255,255,255,0.4)"}),o=new rl({color:"#3399CC",width:1.25});dl=[new hl({image:new pl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return dl}function gl(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Fo]=[new hl({fill:new Ls({color:[255,255,255,.5]})})],t[Io]=t[Fo],t[Po]=[new hl({stroke:new rl({color:e,width:5})}),new hl({stroke:new rl({color:i,width:3})})],t[Mo]=t[Po],t[Do]=t[Fo].concat(t[Po]),t[To]=[new hl({image:new pl({radius:6,fill:new Ls({color:i}),stroke:new rl({color:e,width:1.5})}),zIndex:1/0})],t[Ro]=t[To],t[jo]=t[Fo].concat(t[Po],t[To]),t}function fl(t){return t.getGeometry()}var ml=hl,vl="point",yl="line",_l=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Ya(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Ls({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:vl,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ya(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function bl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xl={
33
+ */function lt(t){return st(__spreadProps(__spreadValues({},t),{state:!0,attribute:!1}))}var ut=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),pt="propertychange",ht=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function dt(t,e){return t>e?1:t<e?-1:0}function ct(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function gt(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function ft(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function mt(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function vt(){return!0}function yt(){return!1}function _t(){}var bt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function xt(t){for(var e in t)delete t[e]}var kt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function wt(t){var e;for(e in t)return!1;return!e}var St,Ct=(St=function(t,e){return(St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}St(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),zt=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return Ct(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new ut(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,_t);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&xt(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=_t,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(ht),Et="change",Tt="error",Pt="contextmenu",Ot="click",Ft="dblclick",Rt="keydown",Mt="keypress",It="load",jt="resize",Dt="touchmove",At="wheel";function Lt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Gt(t,e,i,o){return Lt(t,e,i,o,!0)}function Nt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),xt(t))}var Bt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vt=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return Bt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Et)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Lt(this,t[n],e);return o}return Lt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Gt(this,t[n],e)}else i=Gt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Nt(t[e]);else Nt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(zt);Vt.prototype.on,Vt.prototype.once,Vt.prototype.un;var qt=Vt;function Wt(){return function(){throw new Error("Unimplemented abstract method.")}()}var Ut=0;function Xt(t){return t.ol_uid||(t.ol_uid=String(++Ut))}var Kt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yt=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return Kt(e,t),e}(ut),Zt=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,Xt(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return Kt(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&bt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new Yt(i,t,e)),i=pt,this.dispatchEvent(new Yt(i,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,i){var o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&bt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],wt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(qt),Ht="postrender",$t="movestart",Jt="moveend",Qt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",te=-1!==Qt.indexOf("firefox");-1!==Qt.indexOf("safari")&&Qt.indexOf("chrom");var ee=-1!==Qt.indexOf("webkit")&&-1==Qt.indexOf("edge"),ie=-1!==Qt.indexOf("macintosh"),oe="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ne="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,re="undefined"!=typeof Image&&Image.prototype.decode,ae=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function se(t,e,i,o){var n;return i&&i.length?n=i.shift():ne?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function le(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ue(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var pe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),he=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return pe(e,t),e.prototype.disposeInternal=function(){ue(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ue(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Nt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_t&&this.listenerKeys.push(Lt(t,Ht,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(Zt),de="ol-hidden",ce="ol-unselectable",ge="ol-control",fe="ol-collapsed",me=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"),ve=["style","variant","weight","size","lineHeight","family"],ye=function(t){var e=t.match(me);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=ve.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[ve[o]]=r)}return i.families=i.family.split(/,\s?/),i};function _e(t){return 1===t?"":String(Math.round(100*t)/100)}var be="opacity",xe="visible",ke="extent",we="zIndex",Se="maxResolution",Ce="minResolution",ze="maxZoom",Ee="minZoom",Te="source",Pe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Oe=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Pe(e,t),e}(Error);function Fe(t,e){if(!t)throw new Oe(e)}function Re(t,e,i){return Math.min(Math.max(t,e),i)}var Me="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ie="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function je(t,e,i,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return De(t,e,i,o)}function De(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function Ae(t){return t*Math.PI/180}function Le(t,e){var i=t%e;return i*e<0?i+e:i}function Ge(t,e,i){return t+i*(e-t)}var Ne=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Be=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return"object"==typeof e.properties&&(delete o.properties,bt(o,e.properties)),o[be]=void 0!==e.opacity?e.opacity:1,Fe("number"==typeof o[be],64),o[xe]=void 0===e.visible||e.visible,o[we]=e.zIndex,o[Se]=void 0!==e.maxResolution?e.maxResolution:1/0,o[Ce]=void 0!==e.minResolution?e.minResolution:0,o[Ee]=void 0!==e.minZoom?e.minZoom:-1/0,o[ze]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),i.state_=null,i}return Ne(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=Re(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Wt()},e.prototype.getLayerStatesArray=function(t){return Wt()},e.prototype.getExtent=function(){return this.get(ke)},e.prototype.getMaxResolution=function(){return this.get(Se)},e.prototype.getMinResolution=function(){return this.get(Ce)},e.prototype.getMinZoom=function(){return this.get(Ee)},e.prototype.getMaxZoom=function(){return this.get(ze)},e.prototype.getOpacity=function(){return this.get(be)},e.prototype.getSourceState=function(){return Wt()},e.prototype.getVisible=function(){return this.get(xe)},e.prototype.getZIndex=function(){return this.get(we)},e.prototype.setExtent=function(t){this.set(ke,t)},e.prototype.setMaxResolution=function(t){this.set(Se,t)},e.prototype.setMinResolution=function(t){this.set(Ce,t)},e.prototype.setMaxZoom=function(t){this.set(ze,t)},e.prototype.setMinZoom=function(t){this.set(Ee,t)},e.prototype.setOpacity=function(t){Fe("number"==typeof t,64),this.set(be,t)},e.prototype.setVisible=function(t){this.set(xe,t)},e.prototype.setZIndex=function(t){this.set(we,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(Zt),Ve="prerender",qe="postrender",We="precompose",Ue="postcompose",Xe="rendercomplete",Ke="undefined",Ye="ready",Ze=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function He(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var $e=function(t){function e(e){var i=this,o=bt({},e);delete o.source,(i=t.call(this,o)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Te,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return Ze(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Te)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ke},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Nt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Lt(t,Et,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Nt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Nt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Lt(t,We,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Fe(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Lt(this,Et,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Te,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Be),Je=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qe=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(Ot,i.handleClick_.bind(i),!1);var h=n+" "+"ol-unselectable "+ge+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;return d.className=h,d.appendChild(i.toggleButton_),d.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Je(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(He(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var h=0,d=p.length;h<d;++h)p[h]in e||(i.push(p[h]),e[p[h]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!mt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(fe),this.collapsed_?le(this.collapseLabel_,this.label_):le(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(he),ti="add",ei="remove",ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oi="length",ni=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return ii(e,t),e}(ut),ri=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return ii(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(oi)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ni(ti,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ni(ei,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ni(ei,o,t)),this.dispatchEvent(new ni(ti,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(oi,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new Oe(58)},e}(Zt);function ai(t){return Math.pow(t,3)}function si(t){return 1-ai(1-t)}function li(t){return 3*t*t-2*t*t*t}function ui(t){return t}var pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(Ot,i.handleClick_.bind(i),!1);var u=n+" "+"ol-unselectable "+ge,p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add(de),i}return pi(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:si}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains(de);n||0!==i?n&&0!==i&&this.element.classList.remove(de):this.element.classList.add(de)}this.label_.style.transform=o}this.rotation_=i}},e}(he),di=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ci=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",h=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=p,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(Ot,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=h,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(Ot,i.handleClick_.bind(i,-r),!1);var g=n+" "+"ol-unselectable "+ge,f=i.element;return f.className=g,f.appendChild(d),f.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return di(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:si})):e.setZoom(o)}}},e}(he),gi="pointermove",fi="pointerdown",mi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},vi={};vi[mi.RADIANS]=6370997/(2*Math.PI),vi[mi.DEGREES]=2*Math.PI*6370997/360,vi[mi.FEET]=.3048,vi[mi.METERS]=1,vi[mi.USFEET]=1200/3937;var yi=mi,_i=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||vi[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),bi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xi=6378137,ki=Math.PI*xi,wi=[-ki,-ki,ki,ki],Si=[-180,-85,180,85],Ci=xi*Math.log(Math.tan(Math.PI/2)),zi=function(t){function e(e){return t.call(this,{code:e,units:yi.METERS,extent:wi,global:!0,worldExtent:Si,getPointResolution:function(t,e){return t/Me(e[1]/xi)}})||this}return bi(e,t),e}(_i),Ei=[new zi("EPSG:3857"),new zi("EPSG:102100"),new zi("EPSG:102113"),new zi("EPSG:900913"),new zi("http://www.opengis.net/def/crs/EPSG/0/3857"),new zi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ti(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=ki*t[a]/180;var s=xi*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Ci?s=Ci:s<-Ci&&(s=-Ci),r[a+1]=s}return r}function Pi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/ki,r[a+1]=360*Math.atan(Math.exp(t[a+1]/xi))/Math.PI-90;return r}var Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fi=[-180,-90,180,90],Ri=6378137*Math.PI/180,Mi=function(t){function e(e,i){return t.call(this,{code:e,units:yi.DEGREES,extent:Fi,axisOrientation:i,global:!0,metersPerUnit:Ri,worldExtent:Fi})||this}return Oi(e,t),e}(_i),Ii=[new Mi("CRS:84"),new Mi("EPSG:4326","neu"),new Mi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Mi("urn:ogc:def:crs:OGC:2:84"),new Mi("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new Mi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Mi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ji={};var Di={};function Ai(t,e,i){var o=t.getCode(),n=e.getCode();o in Di||(Di[o]={}),Di[o][n]=i}var Li="bottom-left",Gi="bottom-right",Ni="top-left",Bi="top-right",Vi=0,qi=1,Wi=2,Ui=4,Xi=8,Ki=16;function Yi(t){for(var e=io(),i=0,o=t.length;i<o;++i)uo(e,t[i]);return e}function Zi(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Hi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function $i(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function Ji(t,e){return to(t,e[0],e[1])}function Qi(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function to(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function eo(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Vi;return a<i?l|=Ki:a>n&&(l|=Ui),s<o?l|=Xi:s>r&&(l|=Wi),l===Vi&&(l=qi),l}function io(){return[1/0,1/0,-1/0,-1/0]}function oo(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function no(t){return oo(1/0,1/0,-1/0,-1/0,t)}function ro(t,e){var i=t[0],o=t[1];return oo(i,o,i,o,e)}function ao(t,e,i,o,n){return po(no(n),t,e,i,o)}function so(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function lo(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function uo(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function po(t,e,i,o,n){for(;i<o;i+=n)ho(t,e[i],e[i+1]);return t}function ho(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function co(t,e){var i;return(i=e(fo(t)))||(i=e(mo(t)))||(i=e(wo(t)))?i:(i=e(ko(t)))||!1}function go(t){var e=0;return zo(t)||(e=So(t)*bo(t)),e}function fo(t){return[t[0],t[1]]}function mo(t){return[t[2],t[1]]}function vo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function yo(t,e){var i;return e===Li?i=fo(t):e===Gi?i=mo(t):e===Ni?i=ko(t):e===Bi?i=wo(t):Fe(!1,13),i}function _o(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,h=a*s,d=a*l,c=t[0],g=t[1],f=c-u+d,m=c-u-d,v=c+u-d,y=c+u+d,_=g-p-h,b=g-p+h,x=g+p+h,k=g+p-h;return oo(Math.min(f,m,v,y),Math.min(_,b,x,k),Math.max(f,m,v,y),Math.max(_,b,x,k),n)}function bo(t){return t[3]-t[1]}function xo(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return Co(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):no(o),o}function ko(t){return[t[0],t[3]]}function wo(t){return[t[2],t[3]]}function So(t){return t[2]-t[0]}function Co(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function zo(t){return t[2]<t[0]||t[3]<t[1]}function Eo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return oo(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var To="Point",Po="LineString",Oo="LinearRing",Fo="Polygon",Ro="MultiPoint",Mo="MultiLineString",Io="MultiPolygon",jo="GeometryCollection",Do="Circle",Ao=6371008.8;function Lo(t,e,i){var o=i||Ao,n=Ae(t[1]),r=Ae(e[1]),a=(r-n)/2,s=Ae(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Go(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=Ae(s-n)*(2+Math.sin(Ae(r))+Math.sin(Ae(l))),n=s,r=l}return i*e*e/2}function No(t,e){var i=e||{},o=i.radius||Ao,n=i.projection||"EPSG:3857",r=t.getType();r!==jo&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,h,d=0;switch(r){case To:case Ro:case Po:case Mo:case Oo:break;case Fo:for(a=t.getCoordinates(),d=Math.abs(Go(a[0],o)),l=1,u=a.length;l<u;++l)d-=Math.abs(Go(a[l],o));break;case Io:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],d+=Math.abs(Go(s[0],o)),p=1,h=s.length;p<h;++p)d-=Math.abs(Go(s[p],o));break;case jo:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)d+=No(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return d}function Bo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],h=s[1],d=p-l,c=h-u,g=0===d&&0===c?0:(d*(n-l)+c*(r-u))/(d*d+c*c||0);return g<=0?(i=l,o=u):g>=1?(i=p,o=h):(i=l+g*d,o=u+g*c),[i,o]}function Vo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function qo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Wo(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Uo(t,e){return Math.sqrt(Wo(t,e))}function Xo(t,e){return Wo(t,Bo(t,e))}function Ko(t,e){if(e.canWrapX()){var i=So(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||So(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Yo(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function Zo(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Ho(t){!function(t,e){ji[t]=e}(t.getCode(),t),Ai(t,t,Yo)}function $o(t){return"string"==typeof t?ji[e=t]||ji[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Jo(t,e,i,o){var n,r=(t=$o(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/vi[o])}else{var a=t.getUnits();if(a==yi.DEGREES&&!o||o==yi.DEGREES)n=e;else{var s,l=nn(t,$o("EPSG:4326"));if(l===Zo&&a!==yi.DEGREES)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(Lo((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Lo(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?vi[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function Qo(t){!function(t){t.forEach(Ho)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ai(e,t,Yo)}))}))}function tn(t,e){return t?"string"==typeof t?$o(t):t:$o(e)}function en(t,e){return an(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function on(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||nn(t,e)===Yo)&&i}function nn(t,e){var i=function(t,e){var i;return t in Di&&e in Di[t]&&(i=Di[t][e]),i}(t.getCode(),e.getCode());return i||(i=Zo),i}function rn(t,e){return nn($o(t),$o(e))}function an(t,e,i){return rn(e,i)(t,void 0,t.length)}var sn,ln,un;function pn(t,e){return t}function hn(t,e){return t}function dn(t,e){return t}function cn(t,e){return t}Qo(Ei),Qo(Ii),sn=Ei,ln=Ti,un=Pi,Ii.forEach((function(t){sn.forEach((function(e){Ai(t,e,ln),Ai(e,t,un)}))}));var gn,fn=new Array(6);function mn(t){return yn(t,1,0,0,1,0,0)}function vn(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],h=e[3],d=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*h,t[3]=o*p+r*h,t[4]=i*d+n*c+a,t[5]=o*d+r*c+s,t}function yn(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function _n(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function bn(t,e,i){return vn(t,yn(fn,e,0,0,i,0,0))}function xn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function kn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];Fe(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function wn(t){var e="matrix("+t.join(", ")+")";if(ne)return e;var i=gn||(gn=document.createElement("div"));return i.style.transform=e,i.style.transform}var Sn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Cn=/^([a-z]*)$|^hsla?\(.*\)$/i;function zn(t){return"string"==typeof t?t:Rn(t)}var En,Tn,Pn=(En={},Tn=0,function(t){var e;if(En.hasOwnProperty(t))e=En[t];else{if(Tn>=1024){var i=0;for(var o in En)0==(3&i++)&&(delete En[o],--Tn)}e=function(t){var e,i,o,n,r;if(Cn.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Sn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?Fn(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Fn(r)):Fe(!1,14);return r}(t),En[t]=e,++Tn}return e});function On(t){return Array.isArray(t)?t:Pn(t)}function Fn(t){return t[0]=Re(t[0]+.5|0,0,255),t[1]=Re(t[1]+.5|0,0,255),t[2]=Re(t[2]+.5|0,0,255),t[3]=Re(t[3],0,1),t}function Rn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function Mn(t,e,i){return e+":"+t+":"+(i?zn(i):"null")}var In=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var o=Mn(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=Mn(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),jn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Dn(t,e){In.expire()}var An=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return jn(e,t),e.prototype.dispatchRenderEvent=function(t,e){Wt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;xn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),kn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var h=u.projection,d=Ko(t.slice(),h),c=[[0,0]];if(h.canWrapX()&&o){var g=So(h.getExtent());c.push([-g,0],[g,0])}for(var f=e.layerStatesArray,m=f.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=f[b],k=x.layer;if(k.hasRenderer()&&He(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?d:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var E=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*E})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Wt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,vt,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Wt()},e.prototype.scheduleExpireIconCache=function(t){In.canExpireCache()&&t.postRenderFunctions.push(Dn)},e}(ht),Ln=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Ln(e,t),e}(ut),Nn="10px sans-serif",Bn="#000",Vn="round",qn=[],Wn="round",Un="#000",Xn="center",Kn="middle",Yn=[0,0,0,0],Zn=new Zt;(new zt).setSize=function(){console.warn("labelCache is deprecated.")};var Hn,$n,Jn=null,Qn={},tr=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=or(t+" "+a+" "+i+p,r),s!=p){var h=or(t+" "+a+" "+i+s+","+p,r);l=l&&h!=e}}return!!l}function s(){for(var e=!0,i=Zn.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Zn.get(r)<100&&(a.apply(this,r.split("\n"))?(xt(Qn),Jn=null,Hn=void 0,Zn.set(r,100)):(Zn.set(r,Zn.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=ye(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Zn.get(u)&&(Zn.set(u,100,!0),a(i.style,i.weight,l)||(Zn.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),er=function(t){var e=Qn[t];if(null==e){if(ne){var i=ye(t),o=ir(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else $n||(($n=document.createElement("div")).innerHTML="M",$n.style.minHeight="0",$n.style.maxHeight="none",$n.style.height="auto",$n.style.padding="0",$n.style.border="none",$n.style.position="absolute",$n.style.display="block",$n.style.left="-99999px"),$n.style.font=t,document.body.appendChild($n),e=$n.offsetHeight,document.body.removeChild($n);Qn[t]=e}return e};function ir(t,e){return Jn||(Jn=se(1,1)),t!=Hn&&(Jn.font=t,Hn=Jn.font),Jn.measureText(e)}function or(t,e){return ir(t,e).width}function nr(t,e,i){if(e in i)return i[e];var o=or(t,e);return i[e]=o,o}function rr(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sr=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Lt(Zn,pt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return ar(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new Gn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Nt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(We,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,He(s,i)&&(s.sourceState==Ye||s.sourceState==Ke)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(Ue,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&He(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var h=o(u,p);if(h)return h}}}},e}(An),lr="layergroup",ur="size",pr="target",hr="view",dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cr="layers",gr=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(cr,i.handleLayersChanged_),r?Array.isArray(r)?r=new ri(r.slice(),{unique:!0}):Fe("function"==typeof r.getArray,43):r=new ri(void 0,{unique:!0}),i.setLayers(r),i}return dr(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Nt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Lt(t,ti,this.handleLayersAdd_,this),Lt(t,ei,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Nt);xt(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[Xt(r)]=[Lt(r,pt,this.handleLayerChange_,this),Lt(r,Et,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[Xt(e)]=[Lt(e,pt,this.handleLayerChange_,this),Lt(e,Et,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=Xt(t.element);this.listenerKeys_[e].forEach(Nt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(cr)},e.prototype.setLayers=function(t){this.set(cr,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=xo(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Ye},e}(Be),fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return fr(e,t),e}(ut),vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yr=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return vr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(mr),_r={SINGLECLICK:"singleclick",CLICK:Ot,DBLCLICK:Ft,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},br=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Lt(n,fi,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Lt(n,gi,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Dt,o.boundHandleTouchMove_,!!ae&&{passive:!1}),o}return br(e,t),e.prototype.emulateClick_=function(t){var e=new yr(_r.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new yr(_r.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new yr(_r.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==_r.POINTERUP||e.type==_r.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==_r.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new yr(_r.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Nt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new yr(_r.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?_t:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Lt(n,_r.POINTERMOVE,this.handlePointerMove_,this),Lt(n,_r.POINTERUP,this.handlePointerUp_,this),Lt(this.element_,_r.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Lt(this.element_.getRootNode(),_r.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new yr(_r.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new yr(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Nt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Dt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Nt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Nt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(zt),kr=1/0,wr=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,xt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){Fe(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=kr&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==kr?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),Sr=0,Cr=1,zr=2,Er=3,Tr=4,Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Or=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return Pr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(Et,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===zr||i===Er||i===Tr){e.removeEventListener(Et,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==Sr||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(wr);var Fr=0,Rr=1,Mr="center",Ir="resolution",jr="rotation",Dr=256;function Ar(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,h=s?s[1]:0,d=t[0]+l/2+p,c=t[2]-l/2+p,g=t[1]+u/2+h,f=t[3]-u/2+h;d>c&&(c=d=(c+d)/2),g>f&&(f=g=(f+g)/2);var m=Re(o[0],d,c),v=Re(o[1],g,f),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,d-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,g-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-f)/y)),[m,v]}}}function Lr(t){return t}function Gr(t,e,i,o){var n=So(e)/i[0],r=bo(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function Nr(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Re(o,i/2,2*e)}function Br(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Gr(t,o,s,n):t;return(void 0===i||i)&&l?Nr(r,u,e):Re(r,e,u)}}}function Vr(t){return void 0!==t?0:void 0}function qr(t){return void 0!==t?t:void 0}var Wr="XY",Ur="XYZ",Xr="XYM",Kr="XYZM";function Yr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function Zr(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],h=r[1],d=0,c=e;c<i;c+=o){var g=t[c]-p,f=t[c+1]-h;s[d++]=p+g*l-f*u,s[d++]=h+g*u+f*l;for(var m=c+2;m<c+o;++m)s[d++]=t[m]}return a&&s.length!=d&&(s.length=d),s}function Hr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var $r=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Jr=[1,0,0,1,0,0],Qr=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&mt(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return $r(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Wt()},e.prototype.closestPointXY=function(t,e,i,o){return Wt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Wt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&no(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){Wt()},e.prototype.scale=function(t,e,i){Wt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Wt()},e.prototype.getType=function(){return Wt()},e.prototype.applyTransform=function(t){Wt()},e.prototype.intersectsExtent=function(t){return Wt()},e.prototype.translate=function(t,e){Wt()},e.prototype.transform=function(t,e){var i=$o(t),o=i.getUnits()==yi.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=bo(a)/bo(r);return xn(Jr,a[0],a[3],s,-s,0,0,0),Yr(t,0,t.length,n,Jr,o),rn(i,e)(t,o,n)}:rn(i,e);return this.applyTransform(o),this},e}(Zt),ta=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ea(t){var e;return t==Wr?e=2:t==Ur||t==Xr?e=3:t==Kr&&(e=4),e}var ia=function(t){function e(){var e=t.call(this)||this;return e.layout=Wr,e.stride=2,e.flatCoordinates=null,e}return ta(e,t),e.prototype.computeExtent=function(t){return ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Wt()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=ea(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Wt()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=ea(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Wr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Wr:3==t?e=Ur:4==t&&(e=Kr);return e}(o=e.length)}this.layout=t,this.stride=o},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Zr(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=vo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],h=0,d=e;d<i;d+=o){var c=t[d]-u,g=t[d+1]-p;l[h++]=u+n*c,l[h++]=p+r*g;for(var f=d+2;f<d+o;++f)l[h++]=t[f]}s&&l.length!=h&&(l.length=h)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Hr(i,0,i.length,o,t,e,i),this.changed()}},e}(Qr);function oa(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,h=t[i+1]-u;if(0===p&&0===h)s=e;else{var d=((n-l)*p+(r-u)*h)/(p*p+h*h);if(d>1)s=i;else{if(d>0){for(var c=0;c<o;++c)a[c]=Ge(t[e+c],t[i+c],d);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function na(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=De(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function ra(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=na(t,e,s,o,n),e=s}return n}function aa(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var h,d;if(0===n){if((d=De(a,s,t[e],t[e+1]))<u){for(h=0;h<o;++h)l[h]=t[e+h];return l.length=o,d}return u}for(var c=p||[NaN,NaN],g=e+o;g<i;)if(oa(t,g-o,g,o,a,s,c),(d=De(a,s,c[0],c[1]))<u){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o,g+=o}else g+=o*Math.max((Math.sqrt(d)-Math.sqrt(u))/n|0,1);if(r&&(oa(t,i-o,e,o,a,s,c),(d=De(a,s,c[0],c[1]))<u)){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o}return u}function sa(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=aa(t,e,g,o,n,r,a,s,l,u,h),e=g}return u}function la(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function ua(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function pa(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=ua(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function ha(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var h=u.pop(),d=u.pop(),c=0,g=t[d],f=t[d+1],m=t[h],v=t[h+1],y=d+o;y<h;y+=o){var _=je(t[y],t[y+1],g,f,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,d+o<p&&u.push(d,p),p+o<h&&u.push(p,h))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function da(t,e){return e*Math.round(t/e)}function ca(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=da(t[e],n),p=da(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=da(t[e],n),l=da(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var h=da(t[e],n),d=da(t[e+1],n);if(e+=o,h!=s||d!=l){var c=s-u,g=l-p,f=h-u,m=d-p;c*m==g*f&&(c<0&&f<c||c==f||c>0&&f>c)&&(g<0&&m<g||g==m||g>0&&m>g)?(s=h,l=d):(r[a++]=s,r[a++]=l,u=s,p=l,s=h,l=d)}}return r[a++]=s,r[a++]=l,a}function ga(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ca(t,e,p,o,n,r,a),s.push(a),e=p}return a}function fa(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function ma(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=fa(t,e,u,o,r[a]),e=u}return r.length=a,r}function va(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ma(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function ya(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function _a(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ya(t,e,s,o),e=s}return n}var ba=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xa=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ba(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ha(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Wr)},e.prototype.getType=function(){return Oo},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ua(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia),ka=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wa=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return ka(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=De(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ro(this.flatCoordinates,t)},e.prototype.getType=function(){return To},e.prototype.intersectsExtent=function(t){return to(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=la(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia);function Sa(t,e,i,o,n){return!co(n,(function(n){return!Ca(t,e,i,o,n[0],n[1])}))}function Ca(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function za(t,e,i,o,n,r){if(0===i.length)return!1;if(!Ca(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(Ca(t,i[a-1],i[a],o,n,r))return!1;return!0}function Ea(t,e,i,o,n,r,a){for(var s,l,u,p,h,d,c,g=n[r+1],f=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],d=t[y-o+1],s=e;s<y;s+=o)h=t[s],c=t[s+1],(g<=d&&c<=g||d<=g&&g<=c)&&(u=(g-d)/(c-d)*(h-p)+p,f.push(u)),p=h,d=c}var _=NaN,b=-1/0;for(f.sort(dt),p=f[0],s=1,l=f.length;s<l;++s){h=f[s];var x=Math.abs(h-p);x>b&&za(t,e,i,o,u=(p+h)/2,g)&&(_=u,b=x),p=h}return isNaN(_)&&(_=n[r]),a?(a.push(_,g,b),a):[_,g,b]}function Ta(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=Ea(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function Pa(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function Oa(t,e,i,o,n){var r=po([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!Co(n,r)&&(!!Qi(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||Pa(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=eo(t,e),r=eo(t,i);if(n===qi||r===qi)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],h=e[1],d=i[0],c=i[1],g=(c-h)/(d-p),f=void 0,m=void 0;r&Wi&&!(n&Wi)&&(o=(f=d-(c-u)/g)>=a&&f<=l),o||!(r&Ui)||n&Ui||(o=(m=c-(d-l)*g)>=s&&m<=u),o||!(r&Xi)||n&Xi||(o=(f=d-(c-s)/g)>=a&&f<=l),o||!(r&Ki)||n&Ki||(o=(m=c-(d-a)*g)>=s&&m<=u)}return o}(n,t,e)})))))}function Fa(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(Oa(t,e,i,o,n)||Ca(t,e,i,o,n[0],n[1])||Ca(t,e,i,o,n[0],n[3])||Ca(t,e,i,o,n[2],n[1])||Ca(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(Sa(t,i[r-1],i[r],o,n)&&!Oa(t,i[r-1],i[r],o,n))return!1;return!0}function Ra(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Ma(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Ia(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function ja(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&Ra(t,e,l,o),e=l}return e}function Da(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=ja(t,e,i[r],o,n);return e}var Aa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),La=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Aa(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?ft(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return za(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return _a(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ja(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ma(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=vo(this.getExtent());this.flatInteriorPoint_=Ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new wa(this.getFlatInteriorPoint(),Xr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new xa(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new xa(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Ia(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ja(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=ga(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Wr,o)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return Fa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=pa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(ia),Ga=La;function Na(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new La(r,Wr,[r.length])}function Ba(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var h=[l.length],d=new La(l,r,h);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*Le(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(d,a,t.getRadius(),i),d}var Va=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function qa(t,e){setTimeout((function(){t(e)}),0)}function Wa(t){return!(t.sourceCenter&&t.targetCenter&&!Vo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ua(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var Xa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=tn(o.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,o.center&&(o.center=hn(o.center,i.projection_)),o.extent&&(o.extent=cn(o.extent,i.projection_)),i.applyOptions_(o),i}return Va(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,d=tn(t.projection,"EPSG:3857"),c=d.getExtent(),g=t.constrainOnlyCenter,f=t.extent;u||f||!d.isGlobal()||(g=!1,f=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Gr(l,i,a,o):l;if(s)return void 0===e||e?Nr(n,p,u):Re(n,u,p);var h=Math.min(p,n),d=Math.floor(ct(t,h,r));return t[d]>p&&d<t.length-1?t[d+1]:t[d]}}}(m,p,!g&&f,h):Br(i,o,p,!g&&f,h)}else{var v=(c?Math.max(So(c),bo(c)):360*vi[yi.DEGREES]/d.getMetersPerUnit())/Dr/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Gr(e,n,l,r):e,h=void 0!==i?i:0;if(u)return void 0===o||o?Nr(a,p,h):Re(a,h,p);var d=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,g=Math.min(p,a),f=Math.floor(Math.log(e/g)/Math.log(t)+c),m=Math.max(d,f);return Re(e/Math.pow(t,m),h,p)}}}(l,i,o,p,!g&&f,h):Br(i,o,p,!g&&f,h)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ar(t.extent,t.constrainOnlyCenter,e)}var i=tn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Ar(o,!1,!1)}return Lr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||Ae(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?qr:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):qr}return Vr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=bt({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),bt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var o=arguments[i];o.center&&((o=bt({},o)).center=hn(o.center,this.getProjection())),o.anchor&&((o=bt({},o)).anchor=hn(o.anchor,this.getProjection())),e[i]=o}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],h={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||li,callback:e};if(p.center&&(h.sourceCenter=a,h.targetCenter=p.center.slice(),a=h.targetCenter),void 0!==p.zoom?(h.sourceResolution=s,h.targetResolution=this.getResolutionForZoom(p.zoom),s=h.targetResolution):p.resolution&&(h.sourceResolution=s,h.targetResolution=p.resolution,s=h.targetResolution),void 0!==p.rotation){h.sourceRotation=l;var d=Le(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+d,l=h.targetRotation}Wa(h)?h.complete=!0:r+=h.duration,u.push(h)}this.animations_.push(u),this.setHint(Fr,1),this.updateAnimations_()}else e&&qa(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Fr]>0},e.prototype.getInteracting=function(){return this.hints_[Rr]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Fr,-this.hints_[Fr]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&qa(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var h=s.sourceCenter[0],d=s.sourceCenter[1],c=s.targetCenter[0],g=s.targetCenter[1];this.nextCenter_=s.targetCenter;var f=h+p*(c-h),m=d+p*(g-d);this.targetCenter_=[f,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?Le(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(Fr,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&qa(k,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,o,n,r=this.getCenterInternal();return void 0!==r&&(qo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?pn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Mr)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return dn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Fe(i,1);var o=this.getResolution();Fe(void 0!==o,2);var n=this.getRotation();return Fe(void 0!==n,3),_o(i,o,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ir)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(cn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=So(t)/i[0],n=bo(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(jr)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ua(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,o=this.minZoom_||0;if(this.resolutions_){var n=ct(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Re(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Re(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Fe(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Fe(!zo(t),25),i=Na(o=cn(t,this.getProjection()));else if(t.getType()===Do){var o;(i=Na(o=cn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),vo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,h=n.length;p<h;p+=r){var d=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,d),s=Math.min(s,c),l=Math.max(l,d),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),h=Math.cos(u),d=vo(s);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;var c=d[0]*h-d[1]*p,g=d[1]*h+d[0]*p,f=this.getConstrainedCenter([c,g],l),m=i.callback?i.callback:_t;void 0!==i.duration?this.animateInternal({resolution:l,center:f,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=f,this.applyTargetState_(!1,!0),qa(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(hn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ua(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ua(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=pn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&hn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=hn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(hn(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var i=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(jr)!==o&&this.set(jr,o),this.get(Ir)!==r&&this.set(Ir,r),this.get(Mr)&&Vo(this.get(Mr),a)||this.set(Mr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Vo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:si,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Rr,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&hn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Rr,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(Zt);function Ka(t){return t[0]>0&&t[1]>0}function Ya(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Za=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Ha=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new gr({layers:t.layers});r[lr]=a,r[pr]=t.target,r[hr]=t.view instanceof Xa?t.view:new Xa,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ri(t.controls.slice()):(Fe("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new ri(t.interactions.slice()):(Fe("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new ri(t.overlays.slice()):(Fe("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new ri;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:oe,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new ri,i.interactions=o.interactions||new ri,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Or(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(lr,i.handleLayerGroupChanged_),i.addChangeListener(hr,i.handleViewChanged_),i.addChangeListener(ur,i.handleSizeChanged_),i.addChangeListener(pr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof Xa||e.view.then((function(t){n.setView(new Xa(t))})),i.controls.addEventListener(ti,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ei,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ti,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ei,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ti,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ei,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return Za(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:vt,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||vt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:vt,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(pr)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return pn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?_n(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(lr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof ri)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=hn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?_n(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ur)},e.prototype.getView=function(){return this.get(hr)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return kr;if(!t.wantedTiles[i][e.getKey()])return kr;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new yr(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===fi||i===At||i===Rt){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[Fr]||n[Rr]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(Xe)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Xe,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Nt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Pt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(At,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(jt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ue(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new xr(this,this.moveTolerance_),_r)this.mapBrowserEventHandler_.addEventListener(_r[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Pt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(At,this.boundHandleBrowserEvent_,!!ae&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Lt(n,Rt,this.handleBrowserEvent,this),Lt(n,Mt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(jt,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Nt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Nt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Lt(t,pt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Lt(t,Et,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Nt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Lt(t,pt,this.render,this),Lt(t,Et,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Ka(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:_o(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=_o(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!zo(this.previousExtent_)&&!so(r.extent,this.previousExtent_))&&(this.dispatchEvent(new mr($t,this,n)),this.previousExtent_=no(this.previousExtent_));this.previousExtent_&&!r.viewHints[Fr]&&!r.viewHints[Rr]&&!so(r.extent,this.previousExtent_)&&(this.dispatchEvent(new mr(Jt,this,r)),Hi(r.extent,this.previousExtent_))}this.dispatchEvent(new mr(Ht,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(lr,t)},e.prototype.setSize=function(t){this.set(ur,t)},e.prototype.setTarget=function(t){this.set(pr,t)},e.prototype.setView=function(t){if(!t||t instanceof Xa)this.set(hr,t);else{this.set(hr,new Xa);var e=this;t.then((function(t){e.setView(new Xa(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Ka(e=[o,n])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Zt),$a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ja="units",Qa="degrees",ts="imperial",es="nautical",is="metric",os="us",ns=[1,2,5],rs=25.4/.28,as=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" "+ce,i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener(Ja,i.handleUnitsChanged_),i.setUnits(o.units||is),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return $a(e,t),e.prototype.getUnits=function(){return this.get(Ja)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Ja,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,o=this.getUnits(),n=o==Qa?yi.DEGREES:yi.METERS,r=Jo(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||rs)/rs,s=a*r,l="";if(o==Qa){var u=vi[yi.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==ts?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==es?(r/=1852,l="nm"):o==is?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==os?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):Fe(!1,33);for(var p,h,d,c,g=3*Math.floor(Math.log(a*r)/Math.log(10));;){d=Math.floor(g/3);var f=Math.pow(10,d);if(p=ns[(g%3+3)%3]*f,h=Math.round(p/r),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=a)break;++g}c=this.scaleBar_?this.createScaleBar(h,p,l):p.toFixed(d<0?-d:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=Jo(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||rs,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(he);function ss(t){var e=t||{},i=new ri;return(void 0===e.zoom||e.zoom)&&i.push(new ci(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new hi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Qe(e.attributionOptions)),i}var ls=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),us=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return ls(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return oo(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return Do},e.prototype.intersectsExtent=function(t){if(Co(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||co(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=la(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Zr(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Hr(i,0,i.length,o,t,e,i)),this.changed()},e}(ia);us.prototype.transform;var ps=us,hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ds(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var cs=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return hs(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Nt),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Lt(this.geometries_[t],Et,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<$i(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){no(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)lo(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return ds(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return jo},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=vo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(ds(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Qr);function gs(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],h=t[e+1],d=0,c=[0],g=e+o;g<i;g+=o){var f=t[g],m=t[g+1];d+=Math.sqrt((f-p)*(f-p)+(m-h)*(m-h)),c.push(d),p=f,h=m}var v=n*d,y=function(t,e,i){for(var o,n,r=i||dt,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(g=0;g<_;++g)b[g]=void 0===s?NaN:void 0===l?t[s+g]:Ge(t[s+g],t[s+o+g],l);return b}function fs(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var h=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var d=0;d<o-1;++d)a.push(Ge(t[(s-1)*o+d],t[s*o+d],h));return a.push(n),a}function ms(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var vs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ys=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return vs(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?ft(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return Pa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Xr&&this.layout!=Kr)return null;var i=void 0!==e&&e;return fs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return gs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return ms(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ha(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Wr)},e.prototype.getType=function(){return Po},e.prototype.intersectsExtent=function(t){return Oa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ua(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia),_s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout()),ft(s,h.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return _s(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?ft(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Xr&&this.layout!=Kr||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return fs(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return fs(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return ma(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new ys(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new ys(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];ft(t,gs(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ha(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Wr,o)},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(Oa(t,e,i[r],o,n))return!0;e=i[r]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=pa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(ia),xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ks=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return xs(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?ft(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<$i(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=De(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new wa(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,o=[],n=0,r=t.length;n<r;n+=i){var a=new wa(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(to(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ua(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ia);function ws(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=ao(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}var Ss=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout());for(var d=s.length,c=h.getEnds(),g=0,f=c.length;g<f;++g)c[g]+=d;ft(s,h.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return Ss(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;ft(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<$i(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=ra(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=sa(t,e,g,o,n,r,a,s,l,u,h),e=g[g.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(za(t,e,l,o,n,r))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=_a(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Da(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,va(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=ws(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Ta(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new ks(this.getFlatInteriorPoints().slice(),Xr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Ia(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Da(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],h=[];a=ga(t,e,p,o,n,r,a,h),s.push(h),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Wr,o)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ga(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var h=new Ga(e.slice(n,l),t,s);o.push(h),n=l}return o},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Fa(t,e,s,o,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=pa(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(ia),zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Es=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return zs(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var o=this.getStyle();return o&&t.setStyle(o),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Nt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Lt(t,Et,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(Fe("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Zt),Ts=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var o=e.dataProjection?$o(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===yi.TILE_PIXELS&&(o=$o(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return bt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Wt()},t.prototype.readFeature=function(t,e){return Wt()},t.prototype.readFeatures=function(t,e){return Wt()},t.prototype.readGeometry=function(t,e){return Wt()},t.prototype.readProjection=function(t){return Wt()},t.prototype.writeFeature=function(t,e){return Wt()},t.prototype.writeFeatures=function(t,e){return Wt()},t.prototype.writeGeometry=function(t,e){return Wt()},t}();function Ps(t,e,i){var o,n=i?$o(i.featureProjection):null,r=i?$o(i.dataProjection):null;if(o=n&&r&&!on(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var Os="arraybuffer",Fs="json",Rs="text",Ms="xml",Is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function js(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Ds=function(t){function e(){return t.call(this)||this}return Is(e,t),e.prototype.getType=function(){return Fs},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(js(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(js(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Wt()},e.prototype.readFeaturesFromObject=function(t,e){return Wt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(js(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Wt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(js(t))},e.prototype.readProjectionFromObject=function(t){return Wt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Wt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Wt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Wt()},e}(Ts),As=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ls(t,e){if(!t)return null;var i;switch(t.type){case To:i=function(t){return new wa(t.coordinates)}(t);break;case Po:i=function(t){return new ys(t.coordinates)}(t);break;case Fo:i=function(t){return new Ga(t.coordinates)}(t);break;case Ro:i=function(t){return new ks(t.coordinates)}(t);break;case Mo:i=function(t){return new bs(t.coordinates)}(t);break;case Io:i=function(t){return new Cs(t.coordinates)}(t);break;case jo:i=function(t,e){var i=t.geometries.map((function(t){return Ls(t,e)}));return new cs(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Ps(i,!1,e)}function Gs(t,e){var i,o=(t=Ps(t,!0,e)).getType();switch(o){case To:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Po:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Fo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Ro:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Io:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case jo:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=bt({},e);return delete i.featureProjection,Gs(t,i)}))}}(t,e);break;case Do:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var Ns=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=$o(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=$o(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return As(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Ls((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new Es;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Ls(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=$o(i.properties.name):"EPSG"===i.type?e=$o("EPSG:"+i.properties.code):Fe(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Gs(r,e),delete n[t.getGeometryName()]),wt(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Gs(t,this.adaptOptions(e))},e}(Ds),Bs=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Vs="fraction",qs="pixels",Ws="bottom-left",Us="bottom-right",Xs="top-left",Ks="top-right",Ys=0,Zs=1,Hs=2,$s=3,Js=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ya(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Wt()},t.prototype.getImage=function(t){return Wt()},t.prototype.getHitDetectionImage=function(){return Wt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Wt()},t.prototype.getImageSize=function(){return Wt()},t.prototype.getOrigin=function(){return Wt()},t.prototype.getSize=function(){return Wt()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ya(t)},t.prototype.listenImageChange=function(t){Wt()},t.prototype.load=function(){Wt()},t.prototype.unlistenImageChange=function(t){Wt()},t}(),Qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),tl=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Qs(e,t),e.prototype.changed=function(){this.dispatchEvent(Et)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Wt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Wt()},e}(zt),el=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function il(t,e,i){var o=t;if(o.src&&re){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Gt(o,It,e),Gt(o,Tt,i)];return function(){a.forEach(Nt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Ys)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Ys,s.imageLoadFunction_=a,s}el(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=$s,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=bo(this.extent)/this.image_.height),this.state=Hs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ys&&this.state!=$s||(this.state=Zs,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=il(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=bo(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(tl);var ol=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nl=null,rl=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return ol(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Hs){nl||(nl=se(1,1)),nl.drawImage(this.image_,0,0);try{nl.getImageData(0,0,1,1),this.tainted_=!1}catch(t){nl=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Et)},e.prototype.handleImageError_=function(){this.imageState_=$s,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Hs,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=se(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ys){this.imageState_=Zs;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=il(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Hs){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=zn(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(zt);var al=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sl=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Xs,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Vs,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Vs,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;Fe(!(void 0!==p&&l),4),Fe(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||Xt(l)),Fe(void 0!==p&&p.length>0,6);var h=void 0!==o.src?Ys:Hs;return i.color_=void 0!==o.color?On(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=In.get(e,o,r);return a||(a=new rl(t,e,i,o,n,r),In.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,h,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Xs,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return al(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Vs||this.anchorYUnits_==Vs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Vs&&(t[0]*=e[0]),this.anchorYUnits_==Vs&&(t[1]*=e[1])}if(this.anchorOrigin_!=Xs){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ks&&this.anchorOrigin_!=Us||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ws&&this.anchorOrigin_!=Us||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Xs){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Ks&&this.offsetOrigin_!=Us||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ws&&this.offsetOrigin_!=Us||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Et,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Et,t)},e}(Js),ll=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();function ul(t){return Array.isArray(t)?Rn(t):t}var pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hl=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return pl(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,o=se(i.size*t,i.size*t);this.draw_(i,o,t),e=o.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Hs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),h=p/l;if("miter"===t&&h<=i)return h*e;var d=e/2/h,c=e/2*(u/p),g=Math.sqrt((o+d)*(o+d)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*g;var f=o*Math.sin(s),m=n-Math.sqrt(o*o-f*f),v=Math.sqrt(f*f+m*m)/f;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(g,y)}return 2*g},e.prototype.createRenderOptions=function(){var t,e=Wn,i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Un),t=ul(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Wn),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();null===o&&(o=Bn),e.fillStyle=ul(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())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=On(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=se(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Bn,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Js),dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return dl(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(hl),gl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=yl,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=yl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var fl=null;function ml(t,e){if(!fl){var i=new Bs({color:"rgba(255,255,255,0.4)"}),o=new ll({color:"#3399CC",width:1.25});fl=[new gl({image:new cl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return fl}function vl(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Fo]=[new gl({fill:new Bs({color:[255,255,255,.5]})})],t[Io]=t[Fo],t[Po]=[new gl({stroke:new ll({color:e,width:5})}),new gl({stroke:new ll({color:i,width:3})})],t[Mo]=t[Po],t[Do]=t[Fo].concat(t[Po]),t[To]=[new gl({image:new cl({radius:6,fill:new Bs({color:i}),stroke:new ll({color:e,width:1.5})}),zIndex:1/0})],t[Ro]=t[To],t[jo]=t[Fo].concat(t[Po],t[To]),t}function yl(t){return t.getGeometry()}var _l=gl,bl="point",xl="line",kl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Ya(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Bs({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:bl,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ya(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function wl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Sl={
34
34
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
- read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,h=i?n-1:0,d=i?-1:1,c=t[e+h];for(h+=d,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+h],h+=d,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+h],h+=d,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,h=p>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,g=o?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=p?(s=0,a=p):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=g,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=g,a/=256,u-=8);t[i+c-g]|=128*f}},kl=Sl,wl=xl;function Sl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Sl.Varint=0,Sl.Fixed64=1,Sl.Bytes=2,Sl.Fixed32=5;var Cl=4294967296,zl=1/Cl,El="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Tl(t){return t.type===Sl.Bytes?t.readVarint()+t.pos:t.pos+1}function Pl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ol(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function Fl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Rl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Ml(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Il(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function jl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Dl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Al(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Ll(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Gl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Nl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Bl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Vl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Sl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Nl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Vl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Nl(this.buf,this.pos)+Nl(this.buf,this.pos+4)*Cl;return this.pos+=8,t},readSFixed64:function(){var t=Nl(this.buf,this.pos)+Vl(this.buf,this.pos+4)*Cl;return this.pos+=8,t},readFloat:function(){var t=wl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=wl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return Pl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return Pl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return Pl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return Pl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return Pl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return Pl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&El?function(t,e,i){return El.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Sl.Bytes)return t.push(this.readVarint(e));var i=Tl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Sl.Bytes)return t.push(this.readSVarint());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Sl.Bytes)return t.push(this.readBoolean());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Sl.Bytes)return t.push(this.readFloat());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Sl.Bytes)return t.push(this.readDouble());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Sl.Bytes)return t.push(this.readFixed32());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Sl.Bytes)return t.push(this.readSFixed32());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Sl.Bytes)return t.push(this.readFixed64());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Sl.Bytes)return t.push(this.readSFixed64());var e=Tl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Sl.Varint)for(;this.buf[this.pos++]>127;);else if(e===Sl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Sl.Fixed32)this.pos+=4;else{if(e!==Sl.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Bl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Bl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Bl(this.buf,-1&t,this.pos),Bl(this.buf,Math.floor(t*zl),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Bl(this.buf,-1&t,this.pos),Bl(this.buf,Math.floor(t*zl),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(o,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ol(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),wl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),wl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var o=this.pos-i;o>=128&&Ol(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,Sl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Rl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ml,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Al,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writeBytesField:function(t,e){this.writeTag(t,Sl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Sl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Sl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Sl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Sl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Sl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Sl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Sl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Sl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Sl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ql=[1,0,0,1,0,0],Wl=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===To?ro(this.flatCoordinates_):ao(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=vo(this.getExtent());this.flatInteriorPoints_=Ea(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Ts(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Ta(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=_s(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,o=0,n=i.length;o<n;++o){var r=i[o],a=_s(t,e,r,2,.5);ft(this.flatMidpoints_,a),e=r}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=$o(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=bo(i)/bo(e);xn(ql,i[0],i[3],o,-o,0,0,0),Yr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ql,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Wl.prototype.getEndss=Wl.prototype.getEnds,Wl.prototype.getFlatCoordinates=Wl.prototype.getOrientedFlatCoordinates;var Ul=Wl,Xl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Kl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Yl,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function Yl(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var o=null,n=i.readVarint()+i.pos;i.pos<n;)o=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(o)}}function Zl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Hl(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Zl,n,o),n}var $l=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new _i({code:"",units:yi.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Ul,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Xl(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var h=t.readVarint();r=7&h,a=h>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):Fe(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?To:Ro:2===t?i=1===e?Po:Mo:3===t&&(i=Fo);return i}(n,l.length);if(this.featureClass_===Ul)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Fo){for(var h=[],d=0,c=0,g=0,f=l.length;g<f;++g){var m=l[g];if(Ma(s,d,m,2)){if(0===h.length)continue;h[h.length-1].push(l[c])}else h.push(l.slice(c,g+1));c=g+1,d=m}p=h.length>1?new Os(s,Wr,h):new Ga(s,Wr,l)}else p=u===To?new wa(s,Wr):u===Po?new ws(s,Wr):u===Fo?new Ga(s,Wr,l):u===Ro?new Es(s,Wr):u===Mo?new Cs(s,Wr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=hs(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return ds},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=$o(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new kl(t),a=r.readFields(Kl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var h=0,d=u.length;h<d;++h){var c=Hl(r,u,h);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(ps),Jl="active",Ql=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function tu(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:si})}}var eu=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Ql(e,t),e.prototype.getActive=function(){return this.get(Jl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Jl,t)},e.prototype.setMap=function(t){this.map_=t},e}(Zt),iu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ou=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return iu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==_r.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;tu(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(eu),nu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ru(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var au=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return nu(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==_r.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==_r.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==_r.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==_r.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===_r.POINTERDOWN||e===_r.POINTERDRAG||e===_r.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==_r.POINTERUP?delete this.trackedPointers_[i]:(t.type==_r.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=kt(this.trackedPointers_)}},e}(eu);function su(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var lu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},uu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},pu=vt,hu=function(t){var e=t.originalEvent;return 0==e.button&&!(ee&&ie&&e.ctrlKey)},du=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},cu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},gu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},fu=function(t){var e=t.originalEvent;return Fe(void 0!==e,56),"mouse"==e.pointerType},mu=function(t){var e=t.originalEvent;return Fe(void 0!==e,56),e.isPrimary&&0===e.button},vu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yu=function(t){function e(e){var i=t.call(this,{stopDown:yt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:su(du,mu);return i.condition_=o.onFocusOnly?su(uu,n):n,i.noKinetic_=!1,i}return vu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=ru(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,qo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:si})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(au),_u=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bu=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:yt})||this).condition_=o.condition?o.condition:lu,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return _u(e,t),e.prototype.handleDragEvent=function(t){if(fu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Vr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!fu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!fu(t)&&(!(!hu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(au),xu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ku=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return xu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ga([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(ht),wu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Su="boxstart",Cu="boxdrag",zu="boxend",Eu="boxcancel",Tu=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return wu(e,t),e}(ut),Pu=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new ku(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:hu,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return wu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Tu(Cu,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Tu(e?zu:Eu,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Tu(Su,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(au),Ou=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fu=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:cu;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return Ou(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:si})},e}(Pu),Ru=37,Mu=38,Iu=39,ju=40,Du=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Au=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return du(t)&&gu(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return Du(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Rt){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==ju||o==Ru||o==Iu||o==Mu)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==ju?s=-r:o==Ru?a=-r:o==Iu?a=r:s=r;var l=[a,s];qo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ui,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(eu),Lu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:gu,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Lu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Rt||t.type==Mt){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;tu(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(eu),Nu=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vu="trackpad",qu="wheel",Wu=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:pu;return i.condition_=o.onFocusOnly?su(uu,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Bu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==At)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==At&&(e=o.deltaY,te&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=oe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Vu:qu);var r=i.getView();if(this.mode_===Vu&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Re(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),tu(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(eu),Uu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Uu(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Vr){var l=a.getViewport().getBoundingClientRect(),u=ru(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(au),Ku=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Ku(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=ru(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(au),Zu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hu=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return Zu(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return oo(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return Do},e.prototype.intersectsExtent=function(t){if(Co(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||co(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=la(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Zr(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Hr(i,0,i.length,o,t,e,i)),this.changed()},e}(ia);Hu.prototype.transform;var $u=Hu;function Ju(t,e,i,o,n){Qu(t,e,i||0,o||t.length-1,n||ep)}function Qu(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);Qu(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],h=i,d=o;for(tp(t,i,e),n(t[o],p)>0&&tp(t,i,o);h<d;){for(tp(t,h,d),h++,d--;n(t[h],p)<0;)h++;for(;n(t[d],p)>0;)d--}0===n(t[i],p)?tp(t,i,d):tp(t,++d,o),d<=e&&(i=d+1),e<=d&&(o=d-1)}}function tp(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function ep(t,e){return t<e?-1:t>e?1:0}class ip{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!cp(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;cp(t,s)&&(e.leaf?i.push(a):dp(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!cp(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(cp(t,r)){if(e.leaf||dp(t,r))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=gp([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=op(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!dp(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=gp(t.slice(e,i+1)),np(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=gp([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));fp(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);fp(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return np(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=up(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),ap(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=gp(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,np(i,this.toBBox),np(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=gp([t,e]),this.data.height=t.height+1,this.data.leaf=!1,np(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=rp(t,0,a,this.toBBox),s=rp(t,a,i,this.toBBox),l=hp(e,s),u=up(e)+up(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:sp,n=t.leaf?this.compareMinY:lp;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=rp(t,0,e,n),a=rp(t,i-e,i,n);let s=pp(r)+pp(a);for(let l=e;l<i-e;l++){const e=t.children[l];ap(r,t.leaf?n(e):e),s+=pp(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];ap(a,t.leaf?n(e):e),s+=pp(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)ap(e[o],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():np(t[i],this.toBBox)}}function op(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function np(t,e){rp(t,0,t.children.length,e,t)}function rp(t,e,i,o,n){n||(n=gp(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];ap(n,t.leaf?o(e):e)}return n}function ap(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function sp(t,e){return t.minX-e.minX}function lp(t,e){return t.minY-e.minY}function up(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function pp(t){return t.maxX-t.minX+(t.maxY-t.minY)}function hp(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function dp(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function cp(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function gp(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function fp(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;Ju(t,a,e,i,n),r.push(e,a,a,i)}}var mp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vp="renderOrder",yp=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return mp(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(vp)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new ip(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(vp,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:cl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Fe("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}($e),_p={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},bp=[_p.FILL],xp=[_p.STROKE],kp=[_p.BEGIN_PATH],wp=[_p.CLOSE_PATH],Sp=_p,Cp=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),zp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ep=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return zp(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],Ji(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,h,d=t[e],c=t[e+1],g=this.tmpCoordinate_,f=!0;for(u=e+o;u<i;u+=o)g[0]=t[u],g[1]=t[u+1],(h=eo(l,g))!==p?(f&&(a[s++]=d,a[s++]=c,f=!1),a[s++]=g[0],a[s++]=g[1]):h===qi?(a[s++]=g[0],a[s++]=g[1],f=!1):f=!0,d=g[0],c=g[1],p=h;return(n&&f||u===e+o)&&(a[s++]=d,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),h=this.coordinates.length;switch(u){case Io:n=t.getOrientedFlatCoordinates(),s=[];var d=t.getEndss();l=0;for(var c=0,g=d.length;c<g;++c){var f=[];l=this.drawCustomCoordinates_(n,l,d[c],p,f),s.push(f)}this.instructions.push([Sp.CUSTOM,h,s,t,i,va]),this.hitDetectionInstructions.push([Sp.CUSTOM,h,s,t,o||i,va]);break;case Fo:case Mo:a=[],n=u==Fo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([Sp.CUSTOM,h,a,t,i,ma]),this.hitDetectionInstructions.push([Sp.CUSTOM,h,a,t,o||i,ma]);break;case Po:case Do:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([Sp.CUSTOM,h,r,t,i,fa]),this.hitDetectionInstructions.push([Sp.CUSTOM,h,r,t,o||i,fa]);break;case Ro:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>h&&(this.instructions.push([Sp.CUSTOM,h,r,t,i,fa]),this.hitDetectionInstructions.push([Sp.CUSTOM,h,r,t,o||i,fa]));break;case To:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([Sp.CUSTOM,h,r,t,i]),this.hitDetectionInstructions.push([Sp.CUSTOM,h,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Sp.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Sp.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==Sp.END_GEOMETRY?r=t:o==Sp.BEGIN_GEOMETRY&&(i[2]=t,gt(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=al(o||Bn)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=al(n||Un);var r=e.getLineCap();i.lineCap=void 0!==r?r:Vn;var a=e.getLineDash();i.lineDash=a?a.slice():qn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:Wn;var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[Sp.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Sp.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!mt(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Sp.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Hi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Zi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Cp),Tp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pp=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return Tp(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([Sp.DRAW_IMAGE,n,r,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([Sp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([Sp.DRAW_IMAGE,n,r,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([Sp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(Ep),Op=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Op(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[Sp.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Sp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,qn,0],kp);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(xp),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Sp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],kp);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(xp),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(xp),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(xp),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(kp)},e}(Ep),Rp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Rp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(kp),this.hitDetectionInstructions.push(kp);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),d=[Sp.MOVE_TO_LINE_TO,p,h];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(wp),this.hitDetectionInstructions.push(wp)),e=u}return r&&(this.instructions.push(bp),this.hitDetectionInstructions.push(bp)),a&&(this.instructions.push(xp),this.hitDetectionInstructions.push(xp)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Sp.SET_FILL_STYLE,Bn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Sp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[Sp.CIRCLE,s];this.instructions.push(kp,l),this.hitDetectionInstructions.push(kp,l),void 0!==i.fillStyle&&(this.instructions.push(bp),this.hitDetectionInstructions.push(bp)),void 0!==i.strokeStyle&&(this.instructions.push(xp),this.hitDetectionInstructions.push(xp)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Sp.SET_FILL_STYLE,Bn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Sp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Sp.SET_FILL_STYLE,Bn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Sp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=da(i[o],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Ep);function Ip(t,e,i,o,n){var r,a,s,l,u,p,h,d,c,g=i,f=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(d=_-l,c=b-u,s=Math.sqrt(d*d+c*c),void 0!==p&&(v+=a,Math.acos((p*d+h*c)/(a*s))>t&&(v>m&&(m=v,g=y,f=r),v=0,y=r-n)),a=s,p=d,h=c),l=_,u=b}return(v+=s)>m?[y,r]:[g,f]}var jp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Dp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ap={Circle:Mp,Default:Ep,Image:Pp,LineString:Fp,Polygon:Mp,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return jp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==yl||s!=Po&&s!=Mo&&s!=Fo&&s!=Io){var p=n.overflow?null:[];switch(s){case To:case Ro:l=t.getFlatCoordinates();break;case Po:l=t.getFlatMidpoint();break;case Do:l=t.getCenter();break;case Mo:l=t.getFlatMidpoints(),u=2;break;case Fo:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Io:var h=t.getFlatInteriorPoints();l=[];for(k=0,w=h.length;k<w;k+=3)n.overflow||p.push(h[k+2]/this.resolution),l.push(h[k],h[k+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(O-a)/2!=l.length/u){var d=a/2;p=p.filter((function(t,e){var i=r[2*(d+e)]===l[e*u]&&r[2*(d+e)+1]===l[e*u+1];return i||--d,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=Yn&&(n.scale[0]<0||n.scale[1]<0)){var g=n.padding[0],f=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(f=-f,v=-v),n.scale[1]<0&&(g=-g,m=-m),c=[g,f,m,v]}var y=this.pixelRatio;this.instructions.push([Sp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==Yn?Yn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([Sp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!Co(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Po)b=[l.length];else if(s==Mo)b=t.getEnds();else if(s==Fo)b=t.getEnds().slice(0,1);else if(s==Io){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,E=0,T=b.length;E<T;++E){if(null==S){var P=Ip(n.maxAngle,l,C,b[E],u);C=P[0],z=P[1]}else z=b[E];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var O=r.length;C=b[E],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=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 n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||Xn,textBaseline:e.textBaseline||Kn,scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Dp[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,h=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([Sp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,h*s,p,r,1]),this.hitDetectionInstructions.push([Sp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,h,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=al(r.getColor()||Bn)):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||Vn,n.lineDash=s?s.slice():qn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||Wn,n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=al(a.getColor()||Un)}else n=null,this.textStrokeState_=n;i=this.textState_;var h=t.getFont()||Nn;tr(h);var d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=h,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||Kn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Yn,i.scale=void 0===d?[1,1]:d;var c=t.getOffsetX(),g=t.getOffsetY(),f=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Xt(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+Xt(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Ep)},Lp=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Ap[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),Gp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Np=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Gp(e,t),e.prototype.getFeatures=function(t){return Wt()},e.prototype.prepareFrame=function(t){return Wt()},e.prototype.renderFrame=function(t,e){return Wt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Ks&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Ks&&e!=Ys&&t.addEventListener(Et,this.boundHandleImageChange_),e==Us&&(t.load(),e=t.getState()),e==Ks},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ye&&t.changed()},e}(qt),Bp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vp=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Bp(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===_e(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=se()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=ko(i),n=wo(i),r=mo(i),a=fo(i);_n(e.coordinateToPixelTransform,o),_n(e.coordinateToPixelTransform,n),_n(e.coordinateToPixelTransform,r),_n(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;_n(s,o),_n(s,n),_n(s,r),_n(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new Gn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(qe,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,h=-t[0]+a,d=-t[1];return xn(this.tempTransform,s,l,u,p,-i,h,d)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=_n(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!Ji(a,_n(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(h){return"SecurityError"===h.name?new Uint8Array:o}return 0===o[3]?null:o},e}(Np),qp="Circle",Wp="Default",Up="Image",Xp="LineString",Kp="Polygon",Yp="Text";function Zp(t,e,i,o,n,r,a,s,l,u,p,h){var d=t[e],c=t[e+1],g=0,f=0,m=0,v=0;function y(){g=d,f=c,d=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((d-g)*(d-g)+(c-f)*(c-f))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=Ge(g,d,_),x=Ge(f,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=Ge(g,d,_=0===m?0:(S-v)/m),E=Ge(f,c,_);if(h){var T=[b,x,z,E];Zr(T,0,4,2,h,T,T),C=T[0]>T[2]}else C=b>z;var P,O=Math.PI,F=[],R=k+o===e;if(m=0,v=w,d=t[e=k],c=t[e+1],R){y(),P=Math.atan2(c-f,d-g),C&&(P+=P>0?-O:O);var M=(z+b)/2,I=(E+x)/2;return F[0]=[M,I,(S-r)/2,P,n],F}for(var j=0,D=n.length;j<D;){y();var A=Math.atan2(c-f,d-g);if(C&&(A+=A>0?-O:O),void 0!==P){var L=A-P;if(L+=L>O?-2*O:L<-O?2*O:0,Math.abs(L)>a)return null}P=A;for(var G=j,N=0;j<D;++j){var B=s*l(u,n[C?D-j-1:j],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(j!==G){var V=C?n.substring(D-G,D-j):n.substring(G,j);M=Ge(g,d,_=0===m?0:(r+N/2-v)/m),I=Ge(f,c,_);F.push([M,I,N/2,A,V]),r+=N}}return F}var Hp=[1/0,1/0,-1/0,-1/0],$p=[],Jp=[],Qp=[],th=[];function eh(t){return t[3].declutterBox}var ih=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 oh(t,e){return"start"!==e&&"end"!==e||ih.test(t)||(e="start"===e?"left":"right"),Dp[e]}var nh=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=oh(t,s.textAlign||Xn),h=o&&r.lineWidth?r.lineWidth:0,d=t.split("\n"),c=d.length,g=[],f=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=or(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,d,g),m=er(s.font),v=f+h,y=[],_=(v+2)*u[0],b=(m*c+h)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",h),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(ne?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*h;if(o)for(k=0;k<c;++k)y.push("strokeText",[d[k],S+w*g[k],.5*(h+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[d[k],S+w*g[k],.5*(h+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,h,d,c,g,f){var m,v=i-(a*=h[0]),y=o-(s*=h[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*h[0]+c[1],k=c[0]+b*h[1]+c[2],w=v-c[3],S=y-c[0];return(g||0!==p)&&($p[0]=w,th[0]=w,$p[1]=S,Jp[1]=S,Jp[0]=w+x,Qp[0]=Jp[0],Qp[1]=S+k,th[1]=Qp[1]),0!==p?(_n(m=xn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),$p),_n(m,Jp),_n(m,Qp),_n(m,th),oo(Math.min($p[0],Jp[0],Qp[0],th[0]),Math.min($p[1],Jp[1],Qp[1],th[1]),Math.max($p[0],Jp[0],Qp[0],th[0]),Math.max($p[1],Jp[1],Qp[1],th[1]),Hp)):oo(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),Hp),d&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:Hp[0],minY:Hp[1],maxX:Hp[2],maxY:Hp[3],value:f},canvasTransform:m,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,$p,Jp,Qp,th,r,a),rr(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=_n(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=oh(t,n.textAlign||Xn),u=Dp[n.textBaseline||Kn],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&mt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Yr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,p,h,d,c,g,f,m,v,y,_,b,x,k,w,S,C=0,z=o.length,E=0,T=0,P=0,O=null,F=null,R=this.coordinateCache_,M=this.viewRotation_,I=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},D=this.instructions!=o||this.overlaps?0:200;C<z;){var A=o[C];switch(A[0]){case Sp.BEGIN_GEOMETRY:x=A[1],S=A[3],x.getGeometry()?void 0===a||Co(a,S.getExtent())?++C:C=A[2]+1:C=A[2];break;case Sp.BEGIN_PATH:T>D&&(this.fill_(t),T=0),P>D&&(t.stroke(),P=0),T||P||(t.beginPath(),d=NaN,c=NaN),++C;break;case Sp.CIRCLE:var L=l[E=A[1]],G=l[E+1],N=l[E+2]-L,B=l[E+3]-G,V=Math.sqrt(N*N+B*B);t.moveTo(L+V,G),t.arc(L,G,V,0,2*Math.PI,!0),++C;break;case Sp.CLOSE_PATH:t.closePath(),++C;break;case Sp.CUSTOM:E=A[1],u=A[2];var q=A[3],W=A[4],U=6==A.length?A[5]:void 0;j.geometry=q,j.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,E,u,2,X):(X[0]=l[E],X[1]=l[E+1],X.length=2),W(X,j),++C;break;case Sp.DRAW_IMAGE:E=A[1],u=A[2],m=A[3],p=A[4],h=A[5];var K=A[6],Y=A[7],Z=A[8],H=A[9],$=A[10],J=A[11],Q=A[12],tt=A[13],et=A[14];if(!m&&A.length>=19){v=A[18],y=A[19],_=A[20],b=A[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,A[3]=m;var ot=A[22];p=(it.anchorX-ot)*this.pixelRatio,A[4]=p;var nt=A[23];h=(it.anchorY-nt)*this.pixelRatio,A[5]=h,K=m.height,A[6]=K,tt=m.width,A[13]=tt}var rt=void 0;A.length>24&&(rt=A[24]);var at=void 0,st=void 0,lt=void 0;A.length>16?(at=A[15],st=A[16],lt=A[17]):(at=Yn,st=!1,lt=!1),$&&I?J+=M:$||I||(J-=M);for(var ut=0;E<u;E+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[E],l[E+1],tt,K,p,h,Z,H,J,Q,n,at,st||lt,x),Y,st?O:null,lt?F:null],ht=void 0,dt=void 0;if(s&&et){var ct=u-E;if(!et[ct]){et[ct]=pt;continue}if(ht=et[ct],delete et[ct],dt=eh(ht),s.collides(dt))continue}s&&s.collides(Lt.declutterBox)||(ht&&(s&&s.insert(dt),this.replayImageOrLabel_.apply(this,ht)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case Sp.DRAW_CHARS:var gt=A[1],ft=A[2],vt=A[3],yt=A[4];b=A[5];var _t=A[6],bt=A[7],xt=A[8];_=A[9];var kt=A[10];v=A[11],y=A[12];var wt=[A[13],A[13]],St=this.textStates[y],Ct=St.font,zt=[St.scale[0]*bt,St.scale[1]*bt],Et=void 0;Ct in this.widths_?Et=this.widths_[Ct]:(Et={},this.widths_[Ct]=Et);var Tt=xs(l,gt,ft,2),Pt=Math.abs(zt[0])*nr(Ct,v,Et);if(yt||Pt<=Tt){var Ot=this.textStates[y].textAlign,Ft=Zp(l,gt,ft,2,v,(Tt-Pt)*Dp[Ot],_t,Math.abs(zt[0]),nr,Ct,Et,I?0:this.viewRotation_);t:if(Ft){var Rt=[],Mt=void 0,It=void 0,jt=void 0,Dt=void 0,At=void 0;if(_)for(Mt=0,It=Ft.length;Mt<It;++Mt){jt=(At=Ft[Mt])[4],Dt=this.createLabel(jt,y,"",_),p=At[2]+(zt[0]<0?-kt:kt),h=vt*Dt.height+2*(.5-vt)*kt*zt[1]/zt[0]-xt;var Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],wt,!1,Yn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}if(b)for(Mt=0,It=Ft.length;Mt<It;++Mt){jt=(At=Ft[Mt])[4],Dt=this.createLabel(jt,y,b,""),p=At[2],h=vt*Dt.height-xt;Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],wt,!1,Yn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}s&&s.load(Rt.map(eh));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case Sp.END_GEOMETRY:if(void 0!==r){var Bt=r(x=A[1],S);if(Bt)return Bt}++C;break;case Sp.FILL:D?T++:this.fill_(t),++C;break;case Sp.MOVE_TO_LINE_TO:for(E=A[1],u=A[2],k=l[E],f=(w=l[E+1])+.5|0,(g=k+.5|0)===d&&f===c||(t.moveTo(k,w),d=g,c=f),E+=2;E<u;E+=2)g=(k=l[E])+.5|0,f=(w=l[E+1])+.5|0,E!=u-2&&g===d&&f===c||(t.lineTo(k,w),d=g,c=f);++C;break;case Sp.SET_FILL_STYLE:O=A,this.alignFill_=A[2],T&&(this.fill_(t),T=0,P&&(t.stroke(),P=0)),t.fillStyle=A[1],++C;break;case Sp.SET_STROKE_STYLE:F=A,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,A),++C;break;case Sp.STROKE:D?P++:t.stroke(),++C;break;default:++C}}T&&this.fill_(t),P&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),rh=[Kp,qp,Xp,Up,Yp,Wp],ah=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var o=t[e];for(var n in o){var r=o[n];i[n]=new nh(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=xn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=se(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(uo(u=[1/0,1/0,-1/0,-1/0],t),Zi(u,e*(this.renderBuffer_+o),u));var h,d=function(t){if(void 0!==sh[t])return sh[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return sh[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=d.length;s<l;s++)if(i[d[s]]>0){if(!r||h!==Up&&h!==Yp||-1!==r.indexOf(t)){var u=(d[s]-3)/4,c=o-u%a,g=o-(u/a|0),f=n(t,e,c*c+g*g);if(f)return f}p.clearRect(0,0,a,a);break}}var g,f,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(dt),g=_.length-1;g>=0;--g){var b=_[g].toString();for(m=this.executorsByZIndex_[b],f=rh.length-1;f>=0;--f)if(void 0!==(v=m[h=rh[f]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Yr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return wt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(dt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,h,d,c,g=r||rh;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var f=s[l].toString();for(d=this.executorsByZIndex_[f],p=0,h=g.length;p<h;++p){void 0!==(c=d[g[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),sh={};var lh=ah,uh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ph=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return uh(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Yr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var h=n[u]-this.imageAnchorX_,d=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=h+this.imageAnchorX_,g=d+this.imageAnchorY_;xn(a,c,g,1,1,l,-c,-g),r.setTransform.apply(r,a),r.translate(c,g),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,d,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Yr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=xn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Yr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(Co(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var o=t.getFlatCoordinates();if(o){var n=t.getStride();return Yr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case To:this.drawPoint(t);break;case Po:this.drawLineString(t);break;case Fo:this.drawPolygon(t);break;case Ro:this.drawMultiPoint(t);break;case Mo:this.drawMultiLineString(t);break;case Io:this.drawMultiPolygon(t);break;case jo:this.drawGeometryCollection(t);break;case Do:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Co(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Co(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Co(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!1);i.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Co(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Co(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(mt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,o=t.textAlign?t.textAlign:Xn;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.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})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:al(o||Bn)}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),h=a||qn;this.strokeState_={lineCap:void 0!==r?r:Vn,lineDash:1===this.pixelRatio_?h:h.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Wn,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:al(n||Un)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[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_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:al(i||Bn)}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Vn,lineDash:a||qn,lineDashOffset:s||0,lineJoin:void 0!==l?l:Wn,lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:al(n||Un)}}else this.textStrokeState_=null;var h=t.getFont(),d=t.getOffsetX(),c=t.getOffsetY(),g=t.getRotateWithView(),f=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==h?h:Nn,textAlign:void 0!==y?y:Xn,textBaseline:void 0!==_?_:Kn},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==d?this.pixelRatio_*d:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0!==f?f:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(Cp),hh=.5;function dh(t,e,i,o,n,r,a){var s=se(t[0]*hh,t[1]*hh);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new ph(s,hh,n,null,a),p=i.length,h=Math.floor(16777215/p),d={},c=1;c<=p;++c){var g=i[c-1],f=g.getStyleFunction()||o;if(o){var m=f(g,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*h).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(g);if(x&&Co(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var E=se(z[0],z[1],void 0,{alpha:!1}),T=E.canvas;E.fillStyle=v,E.fillRect(0,0,T.width,T.height),k.setImage(new nl({img:T,imgSize:z,anchor:C.getAnchor(),anchorXUnits:Ns,anchorYUnits:Ns,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var P=k.getZIndex()||0;(R=d[P])||(R={},d[P]=R,R[Fo]=[],R[Do]=[],R[Po]=[],R[To]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var O=Object.keys(d).map(Number).sort(dt),F=(c=0,O.length);c<F;++c){var R=d[O[c]];for(var M in R){var I=R[M];for(y=0,_=I.length;y<_;y+=2){u.setStyle(I[y+1]);for(var j=0,D=e.length;j<D;++j)u.setTransform(e[j]),u.drawGeometry(I[y])}}}return s.getImageData(0,0,l.width,l.height)}function ch(t,e,i){var o=[];if(i){var n=Math.floor(Math.round(t[0])*hh),r=Math.floor(Math.round(t[1])*hh),a=4*(Re(n,0,i.width-1)+Re(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var gh={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Ks)return;var l=t.getBuilder(i.getZIndex(),Up);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),Yp);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Xp);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Yp);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Kp);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Yp);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Ks)return;var l=t.getBuilder(i.getZIndex(),Up);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),Yp);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Xp);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Yp);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Kp);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Yp);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,gh[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),qp);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Yp);u.setTextStyle(l),u.drawText(e,o)}}};function fh(t,e){return parseInt(Xt(t),10)-parseInt(Xt(e),10)}function mh(t,e){var i=vh(t,e);return i*i}function vh(t,e){return.5*t/e}function yh(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Ks||u==Ys?l.unlistenImageChange(n):(u==Us&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())_h(t,s,i,e);else{(0,gh[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function _h(t,e,i,o){if(e.getType()!=jo)t.getBuilder(i.getZIndex(),Wp).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)_h(t,n[r],i,o)}var bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xh=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return bh(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),h=e.pixelRatio,d=e.viewHints,c=!(d[Fr]||d[Rr]),g=this.context,f=Math.round(e.size[0]*h),m=Math.round(e.size[1]*h),v=p.getWrapX()&&s.canWrapX(),y=v?So(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,h,f,m,b*y);t.execute(g,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){yn(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),kn(this.inversePixelTransform,this.pixelTransform);var n=wn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var h=t.viewState;h.projection;var d=!1,c=!0;if(o.extent&&this.clipping){var g=cn(o.extent);(d=(c=Co(g,t.extent))&&!Qi(g,t.extent))&&this.clipUnrotated(r,t,g)}c&&this.renderWorlds(s,t),d&&r.restore(),this.postRender(r,t);var f=_e(o.opacity),m=this.container;return f!==m.style.opacity&&(m.style.opacity=f),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];_n(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=i[0]*hh,h=i[1]*hh;u.push(this.getRenderTransform(o,n,r,hh,p,h,0).slice());var d=l.getSource(),c=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!Qi(c,s)){for(var g=s[0],f=So(c),m=0,v=void 0;g<c[0];)v=f*--m,u.push(this.getRenderTransform(o,n,r,hh,p,h,v).slice()),g+=f;for(m=0,g=s[2];g>c[2];)v=f*++m,u.push(this.getRenderTransform(o,n,r,hh,p,h,v).slice()),g-=f}this.hitDetectionImageData_=dh(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(ch(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},h=function(t,e,i){var r=Xt(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,h,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[Fr],n=t.viewHints[Rr],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,h=t.pixelRatio,d=e.getRevision(),c=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=fh);var f=l.center.slice(),m=Zi(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Qi(_,t.extent)){var b=So(_),x=Math.max(So(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Ko(f,u);var k=function(t,e){var i=e.getExtent(),o=vo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=So(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&Qi(this.wrappedRenderedExtent_,m))return mt(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=f,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Lp(vh(p,h),m,p,h);this.getLayer().getDeclutter()&&(w=new Lp(vh(p,h),m,p,h));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var E=mh(p,h),T=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,E,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),P=dn(m),O=i.getFeaturesInExtent(P);g&&O.sort(g);for(C=0,z=O.length;C<z;++C)T(O[C]);this.renderedFeatures_=O;var F=S.finish(),R=new lh(m,p,h,i.getOverlaps(),F,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new lh(m,p,h,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=d,this.renderedRenderOrder_=g,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=f,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=yh(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=yh(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Vp),kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wh=function(t){function e(e){return t.call(this,e)||this}return kh(e,t),e.prototype.createRenderer=function(){return new xh(this)},e}(yp),Sh=function(){function t(t){this.rbush_=new ip(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[Xt(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[Xt(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=Xt(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[Xt(e)];so([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return wt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return oo(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Ch=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function zh(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Eh=function(t){function e(e){var i=t.call(this)||this;i.projection=$o(e.projection),i.attributions_=zh(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ye,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return Ch(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Wt()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=zh(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Zt),Th="addfeature",Ph="changefeature",Oh="clear",Fh="removefeature",Rh="featuresloadstart",Mh="featuresloadend",Ih="featuresloaderror";function jh(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Dh(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==ds&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==cs||o==gs?l=s.responseText:o==fs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==ds&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Ah(t,e){return function(i,o,n,r,a){var s=this;Dh(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||_t)}}var Lh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gh=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Lh(e,t),e}(ut),Nh=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Ye,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=_t,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(Fe(i.format_,7),i.loader_=Ah(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:jh;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new Sh:null,i.loadedExtentsRtree_=new Sh,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new ri(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Lh(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Xt(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Gh(Th,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Lt(e,Et,this.handleFeatureChange_,this),Lt(e,pt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(Fe(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],o=[],n=0,r=t.length;n<r;n++){var a=Xt(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=Xt(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var h=i.length;n<h;n++)this.dispatchEvent(new Gh(Th,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Th,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Fh,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ti,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ei,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(Nt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new Gh(Oh);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var o=e(i);if(o)return o}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),wt(this.nullGeometryFeatures_)||ft(t,kt(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||vt;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=Xt(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Gh(Ph,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:Xt(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&wt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return Qi(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Gh(Rh)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Gh(Mh,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Gh(Ih))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(so(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=Xt(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=Xt(t);this.featureChangeKeys_[e].forEach(Nt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Gh(Fh,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Fe(this.format_,7),this.url_=t,this.setLoader(Ah(t,this.format_))},e}(Eh),Bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vh="Point",qh="LineString",Wh="Polygon",Uh="Circle",Xh="drawstart",Kh="drawend",Yh="drawabort",Zh=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Bh(e,t),e}(ut);var Hh=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=yt),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case To:case Ro:return Vh;case Po:case Mo:return qh;case Fo:case Io:return Wh;case Do:return Uh;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Wh?3:2,i.maxPoints_=i.mode_===Uh?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:vt;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Uh)r=function(t,e,i){var o=e||new $u([NaN,NaN]),n=hn(t[0]),r=Wo(n,hn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Vh?a=wa:s===qh?a=ws:s===Wh&&(a=Ga),r=function(t,e,i){return e?s===Wh?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new wh({source:new Nh({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=gl(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:du,i.freehandCondition_,e.freehand?i.freehandCondition_=pu:i.freehandCondition_=e.freehandCondition?e.freehandCondition:cu,i.addChangeListener(Jl,i.updateState_),i}return Bh(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===Pt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Vh&&this.freehandCondition_(e);var i=e.type===_r.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===_r.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===_r.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===_r.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===_r.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===_r.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===_r.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new yr(_r.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Vh||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===Vh)e=!0;else if(n===Uh)e=2===this.sketchCoords_.length;else if(n===qh)i=this.sketchCoords_.length>this.minPoints_;else if(n===Wh){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),h=t[0]-p[0],d=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+d*d)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new us(new wa(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new us);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new ws(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Vh?this.sketchCoords_=t.slice():this.mode_===Wh?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new us(new ws(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new us,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Zh(Xh,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Vh?i=this.sketchCoords_:this.mode_===Wh?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Fo&&this.mode_!==Wh)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===qh||r===Uh?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Wh&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===qh||o===Uh){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Fo&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Wh){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===qh?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Wh&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===Ro?t.setGeometry(new Es([e])):this.type_===Mo?t.setGeometry(new Cs([e])):this.type_===Io&&t.setGeometry(new Os([e])),this.dispatchEvent(new Zh(Kh,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Zh(Yh,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===qh||i===Uh)e=this.sketchCoords_;else{if(i!==Wh)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new us(new wa(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Zh(Xh,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(au),$h=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Jh=[0,0,0,0],Qh=[],td="modifystart",ed="modifyend",id=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return $h(e,t),e}(ut);function od(t,e){return t.index-e.index}function nd(t,e,i){var o=e.geometry;if(o.getType()===Do){var n=o;if(1===e.index){null;var r=Wo(n.getCenter(),hn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=hn(t);return Qh[0]=hn(e.segment[0]),Qh[1]=hn(e.segment[1]),Xo(s,Qh)}function rd(t,e,i){var o=e.geometry;if(o.getType()===Do&&1===e.index){var n=o;return pn(n.getClosestPoint(hn(t)))}var r=hn(t);return Qh[0]=hn(e.segment[0]),Qh[1]=hn(e.segment[1]),pn(Bo(r,Qh))}var ad=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:mu,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==_r.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:pu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new Sh,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new wh({source:new Nh({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=gl(),function(t,e){return i[To]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new ri(n.source_.getFeatures()),n.source_.addEventListener(Th,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Fh,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ti,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ei,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return $h(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(Et,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ri;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new id(td,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(Et,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert(Yi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,geometry:e,depth:[a,o],index:u,segment:h};this.rBush_.insert(Yi(h),d)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(ro(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new us(new wa(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=_r.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=_r.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==_r.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,h=void 0,d=s.segment,c=a[1];e.length<u.getStride();)e.push(d[c][e.length]);switch(u.getType()){case To:h=e,d[0]=e,d[1]=e;break;case Ro:(h=u.getCoordinates())[s.index]=e,d[0]=e,d[1]=e;break;case Po:(h=u.getCoordinates())[s.index+c]=e,d[c]=e;break;case Mo:case Fo:(h=u.getCoordinates())[p[0]][s.index+c]=e,d[c]=e;break;case Io:(h=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,d[c]=e;break;case Do:if(d[0]=e,d[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var g=Uo(hn(u.getCenter()),hn(e));u.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(u,h)}this.createOrUpdateVertexFeature_(e,i,o)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=Yi([r]),s=this.rBush_.getInExtent(a),l={};s.sort(od);for(var u=0,p=s.length;u<p;++u){var h=s[u],d=h.segment,c=Xt(h.geometry),g=h.depth;if(g&&(c+="-"+g.join("-")),l[c]||(l[c]=new Array(2)),h.geometry.getType()!==Do||1!==h.index)if(!Vo(d[0],r)||l[c][0])if(!Vo(d[1],r)||l[c][1])Xt(d)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(h);else{if((h.geometry.getType()===Po||h.geometry.getType()===Mo)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([h,1]),l[c][1]=h}else this.dragSegments_.push([h,0]),l[c][0]=h;else Vo(rd(e,h,o),r)&&!l[c][0]&&(this.dragSegments_.push([h,0]),l[c][0]=h)}n.length&&this.willModifyFeatures_(t,[n]);for(var f=n.length-1;f>=0;--f)this.insertVertex_(n[f],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===Do){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(ro(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Yi(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new id(ed,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===To&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=dn(Zi(cn(ro(a,Jh)),e.getView().getResolution()*this.pixelTolerance_,Jh));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return nd(a,t,s)-nd(a,e,s)}))[0],h=p.segment,d=rd(a,p,s),c=e.getPixelFromCoordinate(d),g=Uo(t,c);if(n||g<=this.pixelTolerance_){var f={};if(f[Xt(h)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-a[0],this.delta_[1]=d[1]-a[1]),p.geometry.getType()===Do&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(h[0]),v=e.getPixelFromCoordinate(h[1]),y=Wo(c,m),_=Wo(c,v);g=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(d=y>_?h[1]:h[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var b={};b[Xt(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Vo(h[0],w[0])&&Vo(h[1],w[1])||Vo(h[0],w[1])&&Vo(h[1],w[0])))break;var S=Xt(o[x].geometry);S in b||(b[S]=!0,f[Xt(w)]=!0)}}return void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Mo:case Fo:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Io:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Po:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert(Yi(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert(Yi(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=_r.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new id(ed,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,h=this.dragSegments_,d={},c=!1;for(n=h.length-1;n>=0;--n)p=Xt((u=(i=h[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in d||(d[p]={}),0===i[1]?(d[p].right=u,d[p].index=u.index):1==i[1]&&(d[p].left=u,d[p].index=u.index+1);for(p in d){switch(l=d[p].right,a=d[p].left,(s=(r=d[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Mo:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Po:e.length>2&&(e.splice(r,1),c=!0);break;case Io:t=t[u.depth[1]];case Fo:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),g.push(l.segment[1])),void 0!==a&&void 0!==l){var f={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:g};this.rBush_.insert(Yi(f.segment),f)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||mt(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(au),sd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ld(t){return t.feature?t.feature:t.element?t.element:void 0}var ud=[],pd=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=vt),n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new Sh,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return sd(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=Xt(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Lt(t,Et,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=ld(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=ld(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=Xt(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=kt(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=Xt(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Nt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Nt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Lt(this.features_,ti,this.handleFeatureAdd_,this),Lt(this.features_,ei,this.handleFeatureRemove_,this)):this.source_&&o.push(Lt(this.source_,Th,this.handleFeatureAdd_,this),Lt(this.source_,Fh,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=Yi([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==Do})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=hn(e),p=1/0,h=0;h<n.length;++h){var d=n[h];ud[0]=hn(d.segment[0]),ud[1]=hn(d.segment[1]);var c=Xo(u,ud);c<p&&(l=d,p=c)}var g=l.segment;if(this.vertex_&&!this.edge_){var f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Wo(t,f),y=Wo(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Do;if(_){var b=l.feature.getGeometry();null,a=pn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else ud[0]=hn(g[0]),ud[1]=hn(g[1]),a=pn(Bo(u,ud));if(Uo(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Wo(s,f),y=Wo(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=Ba(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Yi(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Yi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,segment:h};this.rBush_.insert(Yi(h),d)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Yi(l),u)}},e}(au);function hd(t){var e=t||{},i=new ri,o=new Nu(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new bu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new ou({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new yu({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Xu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Yu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Au),i.push(new Gu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Wu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Fu({duration:e.zoomDuration})),i}var dd=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function cd(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new dd(t,e,i,o)}var gd=dd,fd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),md=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new gd(0,0,0,0),i}return fd(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==zr||i==Tr||i==Er&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==Er&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(zr)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),h=p.getRevision(),d=p.getTileGridForProjection(n),c=d.getZForResolution(r,p.zDirection),g=d.getResolution(c),f=t.extent,m=i.extent&&cn(i.extent);m&&(f=xo(f,cn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=g*y/2/v,k=g*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=d.getTileRangeForExtentAndZ(f,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),E=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var P=S.minX;P<=S.maxX;++P)for(var O=S.minY;O<=S.maxY;++O){var F=this.getTile(c,P,O,t);if(this.isDrawableTile(F)){var R=Xt(this);if(F.getState()==zr){C[c][F.tileCoord.toString()]=F;var M=F.inTransition(R);this.newTiles_||!M&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(R,t.time))continue}var I=d.getTileCoordChildTileRange(F.tileCoord,T,E),j=!1;I&&(j=z(c+1,I)),j||d.forEachTileCoordParentTileRange(F.tileCoord,z,T,E)}var D=g/r;xn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var A=wn(this.pixelTransform);this.useContainer(e,A,i.opacity);var L=this.context,G=L.canvas;kn(this.inversePixelTransform,this.pixelTransform),xn(this.tempTransform,y/2,_/2,D,D,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),bt(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,V,q=Object.keys(C).map(Number);q.sort(dt),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var W=q.length-1;W>=0;--W){var U=q[W],X=p.getTilePixelSize(U,l,n),K=d.getResolution(U)/g,Y=X[0]*K*D,Z=X[1]*K*D,H=d.getTileCoordForCoordAndZ(ko(w),U),$=d.getTileCoordExtent(H),J=_n(this.tempTransform,[v*($[0]-w[0])/g,v*(w[3]-$[3])/g]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(F=tt[et]).tileCoord,ot=H[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=H[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(P=Math.round(J[0]-ot*Y)),lt=at-(O=Math.round(J[1]-rt*Z)),ut=c===U;if(!(M=ut&&1!==F.getAlpha(Xt(this),t.time)))if(N){L.save(),V=[P,O,P+st,O,P+st,O+lt,P,O+lt];for(var pt=0,ht=N.length;pt<ht;++pt)if(c!==U&&U<B[pt]){var ct=N[pt];L.beginPath(),L.moveTo(V[0],V[1]),L.lineTo(V[2],V[3]),L.lineTo(V[4],V[5]),L.lineTo(V[6],V[7]),L.moveTo(ct[6],ct[7]),L.lineTo(ct[4],ct[5]),L.lineTo(ct[2],ct[3]),L.lineTo(ct[0],ct[1]),L.clip()}N.push(V),B.push(U)}else L.clearRect(P,O,st,lt);this.drawTileImage(F,t,P,O,st,lt,Q,ut),N&&!M?(L.restore(),this.renderedTiles.unshift(F)):this.renderedTiles.push(F),this.updateUsedTiles(t.usedTiles,p,F)}}this.renderedRevision=h,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!so(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,d,l,n,f,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),A!==G.style.transform&&(G.style.transform=A);var gt=_e(i.opacity),ft=this.container;return gt!==ft.style.opacity&&(ft.style.opacity=gt),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=Xt(this),p=s?t.getAlpha(u,e.time):1,h=p!==this.context.globalAlpha;h&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),h&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(u)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var o=Xt(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=Xt(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=Xt(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,h,d,c,g,f,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(f=i.getMinZoom();f<=a;++f)for(h=i.getTileRangeForExtentAndZ(r,f,h),d=i.getResolution(f),c=h.minX;c<=h.maxX;++c)for(g=h.minY;g<=h.maxY;++g)a-f<=s?(++y,(p=e.getTile(f,c,g,o,n)).getState()==Sr&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),d])),void 0!==l&&l(p)):e.useTile(f,c,g,n);e.updateCacheSize(y,n)},e}(Vp);md.prototype.getLayer;var vd=md,yd="image",_d="hybrid",bd="vector",xd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),kd={image:[Kp,qp,Xp,Up,Yp],hybrid:[Kp,Xp],vector:[]},wd={hybrid:[Up,Yp,Wp],vector:[Kp,qp,Xp,Up,Yp,Wp]},Sd=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return xd(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==zr&&n!==Er||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),h=n.viewHints,d=!(h[Fr]||h[Rr]);return!d&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(d||Date.now()-n.time<8)&&u.getRenderMode()!==bd&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===bd?Xt(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),h=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),d=l.getSourceTiles(e,i,t),c=Xt(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var g=function(i,n){var g=d[i];if(g.getState()!=zr)return"continue";var m=g.tileCoord,v=p.getTileCoordExtent(m),y=xo(h,v),_=Zi(y,o.getRenderBuffer()*a,f.tmpExtent),b=so(v,y)?null:_;s.dirty=!1;var x=new Lp(0,_,a,e),k=u?new Lp(0,y,a,e):void 0,w=mh(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=g.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,E=C.length;z<E;++z){var T=C[z];b&&!Co(b,T.getGeometry().getExtent())||S.call(f,T)}var P=x.finish(),O=o.getRenderMode()!==bd&&u&&1===d.length?null:y,F=new lh(O,a,e,l.getOverlaps(),P,o.getRenderBuffer());if(t.executorGroups[c].push(F),k){var R=new lh(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},f=this,m=0,v=d.length;m<v;++m)g(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Yi([t]);Zi(u,r*i,u);for(var p,h={},d=function(t,e,i){var r=t.getId();void 0===r&&(r=Xt(t));var a=h[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return h[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return h[r]=!0,o(t,s,e);n.push(h[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,g=function(o,n){var h=c[o];if(!Co(l.getTileCoordExtent(h.wrappedTileCoord),u))return"continue";var g=Xt(s),f=[h.executorGroups[g]],m=h.declutterExecutorGroups[g];m&&f.push(m),f.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,d,n))return!0}}))},f=0,m=c.length;!p&&f<m;++f)g(f);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=Xt(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),h=_n(this.renderedPixelToCoordinateTransform_,t.slice()),d=p.getTileCoordForCoordAndResolution(h,u),c=0,g=this.renderedTiles.length;c<g;++c)if(d.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===zr){var f=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!Qi(l,f)&&Ko(h,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=ko(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(h[0]-m[0])/u,(m[1]-h[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Ya(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=dh(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,hh,b[0]*hh,b[1]*hh,0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(ch(v,y,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var o=t.viewHints,n=!(o[Fr]||o[Rr]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[Xt(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,d=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(h,this.tmpExtent)[0]-d[0];return vn(bn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[Fr]||o[Rr]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=wd[a],p=e.viewState.rotation,h=this.renderedTiles,d=[],c=[],g=h.length-1;g>=0;--g)for(var f=h[g],m=this.getTileRenderTransform(f,e),v=f.executorGroups[Xt(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=f.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=d.length;S<C;++S){var z=d[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),d.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=yh(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=yh(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===bd)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[Xt(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,h=l.getTileGridForProjection(p),d=h.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*d,g=h.getResolution(s),f=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);f.canvas.width=m[0],f.canvas.height=m[1];var v=u/c;if(1!==v){var y=mn(this.tmpTransform_);bn(y,v,v),f.setTransform.apply(f,y)}var _=h.getTileCoordExtent(a,this.tmpExtent),b=c/g,x=mn(this.tmpTransform_);bn(x,b,-b),function(t,e,i){vn(t,yn(fn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(f,v,x,0,!0,kd[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(vd),Cd="preload",zd="useInterimTilesOnError",Ed=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Td=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===yd&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||_d;return Fe(r==_d||r==bd,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Ed(e,t),e.prototype.createRenderer=function(){return new Sd(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(Cd)},e.prototype.getUseInterimTilesOnError=function(){return this.get(zd)},e.prototype.setPreload=function(t){this.set(Cd,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(zd,t)},e}(yp),Pd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Od=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return Pd(e,t),e.prototype.changed=function(){this.dispatchEvent(Et)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==zr)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==zr){t.interimTile=null;break}t.getState()==Cr?e=t:t.getState()==Sr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Er&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Wt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var o=e-i+1e3/60;return o>=this.transition_?1:ai(o/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(zt),Fd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rd=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return Fd(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==Sr&&(this.setState(Cr),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Er)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(zr)},e.prototype.setLoader=function(t){this.loader_=t},e}(Od),Md=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return Fe(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Fe(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Fe(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Id(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function jd(t,e,i){return t+"/"+e+"/"+i}function Dd(t){return jd(t[0],t[1],t[2])}function Ad(t){return t.split("/").map(Number)}var Ld=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ld(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Ad(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Dd(e.tileCoord)),e.release())}.bind(this))}},e}(Md),Nd="tileloadstart",Bd="tileloadend",Vd="tileloaderror",qd=[0,0,0],Wd=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Fe((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||dt,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,Fe(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=ko(s)),Fe(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Fe(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Dr,Fe(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new gd(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?cd(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return cd(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return cd(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?cd(s,s,l,l,i):cd(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Ya(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return oo(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=qd;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),cd(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Ya(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Ya(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return oo(r,a,r+n[0]*o,a+n[1]*o,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Ya(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,h=Math.floor((t-s[0])/i+u),d=Math.floor((s[1]-e)/i+p),c=a*h/l[0],g=a*d/l[1];return o?(c=Math.ceil(c)-1,g=Math.ceil(g)-1):(c=Math.floor(c),g=Math.floor(g)),Id(r,c,g,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Ya(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),h=Math.floor((r[1]-e)/a+u),d=p/s[0],c=h/s[1];return o?(d=Math.ceil(d)-1,c=Math.ceil(c)-1):(d=Math.floor(d),c=Math.floor(c)),Id(i,d,c,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Re(ct(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Ud(t){var e=t.getDefaultTileGrid();return e||(e=Yd(t),t.setDefaultTileGrid(e)),e}function Xd(t){var e=t||{},i=e.extent||$o("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Kd(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Wd(o)}function Kd(t,e,i,o){for(var n=void 0!==e?e:42,r=bo(t),a=So(t),s=Ya(void 0!==i?i:Dr),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),h=0;h<u;++h)p[h]=l/Math.pow(2,h);return p}function Yd(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:Ni,r=Kd(t,e,i);return new Wd({extent:t,origin:yo(t,n),resolutions:r,tileSize:i})}(Zd(t),e,i,o)}function Zd(t){var e=(t=$o(t)).getExtent();if(!e){var i=180*vi[yi.DEGREES]/t.getMetersPerUnit();e=oo(-i,-i,i,i)}return e}var Hd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),$d=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&Ya(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Gd(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Hd(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=jd(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===zr)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Wt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ud(t)},e.prototype.getTileCacheForProjection=function(t){return Fe(on(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Ya(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=Zd(i);if(Ji(r,n))return e;var a=So(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,o){},e}(Eh),Jd=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Hd(e,t),e}(ut),Qd=$d;function tc(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return Fe(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function ec(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=tc(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=Le(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var ic=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oc=function(t){function e(i){var o=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return ic(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,o=Xt(i),n=i.getState();n==Cr?(this.tileLoadingKeys_[o]=!0,e=Nd):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==Er?Vd:n==zr?Bd:void 0),null!=e&&this.dispatchEvent(new Jd(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(ec(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=jd(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(Qd),nc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),rc=[],ac=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return nc(e,t),e.prototype.getContext=function(t){var e=Xt(t);return e in this.context_||(this.context_[e]=se(1,1,rc)),this.context_[e]},e.prototype.hasContext=function(t){return Xt(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=Xt(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)rc.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(Od),sc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),lc=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||Zd(o),r=e.tileGrid||Xd({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:uc,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new Gd(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:Rd,i.tileGrids_={},i}return sc(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=Ad(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===zr)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(Co(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var h=0,d=p.length;h<d;++h){var c=p[h],g=c.getGeometry();Co(t,g.getExtent())&&e.push(c)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=jd((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===Sr){i.setState(Cr);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Zi(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&xo(a,p,a);var h=u.getZForResolution(l,1);u.forEachTileCoord(a,h,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?Sr:Tr,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<zr){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===zr||e===Er){var n=a.getKey();n in i.errorTileKeys?a.getState()===zr&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===Er?i.errorTileKeys[n]=!0:a.removeEventListener(Et,l),0===i.loadingSourceTiles&&i.setState(wt(i.errorTileKeys)?zr:Er)}};a.addEventListener(Et,l),i.loadingSourceTiles++}s===Sr&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===Er}))?Er:zr)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=jd(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),h=this.getTileGridForProjection(n);if(u&&p){var d=h.getTileCoordExtent(u);Zi(d,-h.getResolution(t),d),Co(p,d)||(u=null)}var c=!0;if(null!==u){var g=this.tileGrid,f=h.getResolution(t),m=g.getZForResolution(f,1),v=h.getTileCoordExtent(u);Zi(v,-f,v),g.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new ac(l,c?Tr:Sr,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=Yd(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Ya(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(oc);function uc(t,e){t.setLoader((function(i,o,n){Dh(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var pc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hc=function(t){function e(e){return(e=bt({},e)).controls||(e.controls=ss()),e.interactions||(e.interactions=hd({onFocusOnly:!0})),t.call(this,e)||this}return pc(e,t),e.prototype.createRenderer=function(){return new sr(this)},e}(Ha),dc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var cc,gc=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return dc(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=zr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Er,this.unlistenImage_(),this.image_=((t=se(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=zr:this.state=Tr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Er&&(this.state=Sr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Sr&&(this.state=Cr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Qs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Od),fc=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=rn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&So(o)==So(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?So(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?So(this.targetProj_.getExtent()):null;var l=ko(i),u=wo(i),p=mo(i),h=fo(i),d=this.transformInv_(l),c=this.transformInv_(u),g=this.transformInv_(p),f=this.transformInv_(h),m=10+(r?Math.max(0,Math.ceil(Ie(go(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,h,d,c,g,f,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=Yi([n,r,a,s]),p=this.sourceWorldWidth_?So(u)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=So(Yi([t,e,i,o]))/this.targetWorldWidth_>.25||c;!d&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Co(u,this.maxSourceExtent_)){var g=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(g=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=g&&4!=g&&8!=g)return;if(l>0){if(!c){var f=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(f),v=void 0;if(d)v=(Le(n[0],h)+Le(a[0],h))/2-Le(m[0],h);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&g)&&this.addTriangle_(t,i,o,n,a,s),0==(14&g)&&this.addTriangle_(t,i,e,n,a,r),g&&(0==(13&g)&&this.addTriangle_(e,o,t,r,s,n),0==(7&g)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;uo(t,n[0]),uo(t,n[1]),uo(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),mc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function vc(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function yc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function _c(t,e,i,o){var n=an(i,e,t),r=Jo(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||Ji(l,n)){var u=Jo(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function bc(t,e,i,o,n,r,a,s,l,u,p,h){var d=se(Math.round(i*t),Math.round(i*e));if(bt(d,h),0===l.length)return d.canvas;function c(t){return Math.round(t*i)/i}d.scale(i,i),d.globalCompositeOperation="lighter";var g=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){lo(g,t.extent)}));var f=So(g),m=bo(g),v=se(Math.round(i*f/o),Math.round(i*m/o));bt(v,h);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-g[0],n=-(t.extent[3]-g[3]),r=So(t.extent),a=bo(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=ko(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],f=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,E=u;l=0,u=0;var T=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var h=new Array(e),d=e-1;d>=0;d--){h[d]=t[d][e]/t[d][d];for(var c=d-1;c>=0;c--)t[c][e]-=t[c][d]*h[d]}return h}([[p-=z,f-=E,0,0,k-b],[m-=z,y-=E,0,0,S-b],[0,0,p,f,w-x],[0,0,m,y,C-x]]);if(T){if(d.save(),d.beginPath(),function(){if(void 0===cc){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",vc(t,4,5,4,0),vc(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;cc=yc(e,0)||yc(e,4)||yc(e,8)}return cc}()||h===mc){d.moveTo(k,w);for(var P=b-k,O=x-w,F=0;F<4;F++)d.lineTo(k+c((F+1)*P/4),w+c(F*O/3)),3!=F&&d.lineTo(k+c((F+1)*P/4),w+c((F+1)*O/3));d.lineTo(S,C)}else d.moveTo(k,w),d.lineTo(b,x),d.lineTo(S,C);d.clip(),d.transform(T[0],T[2],T[1],T[3],b,x),d.translate(g[0]-z,g[3]-E),d.scale(o/i,-o/i),d.drawImage(v.canvas,0,0),d.restore()}})),p&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;d.beginPath(),d.moveTo(s,l),d.lineTo(n,a),d.lineTo(u,p),d.closePath(),d.stroke()})),d.restore()),d.canvas}var xc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),kc=function(t){function e(e,i,o,n,r,a,s,l,u,p,h,d){var c=t.call(this,r,Sr)||this;c.renderEdges_=void 0!==h&&h,c.contextOptions_=d,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var g=n.getTileCoordExtent(c.wrappedTileCoord_),f=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=f?xo(g,f):g;if(0===go(v))return c.state=Tr,c;var y=e.getExtent();y&&(m=m?xo(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=vo(i),r=_c(t,e,n,o);return(!isFinite(r)||r<=0)&&co(i,(function(i){return r=_c(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=Tr,c;var x=void 0!==p?p:.5;if(c.triangulation_=new fc(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=Tr,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=Re(k[1],m[1],m[3]),k[3]=Re(k[3],m[1],m[3])):k=xo(k,m)),go(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=Tr)}else c.state=Tr;return c}return xc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==zr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Er;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=bc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=zr}this.changed()},e.prototype.load=function(){if(this.state==Sr){this.state=Cr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==Sr||n==Cr){t++;var r=Lt(e,Et,(function(i){var o=e.getState();o!=zr&&o!=Er&&o!=Tr||(Nt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==Sr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Nt),this.sourcesListenerKeys_=null},e}(Od),wc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Sc(t,e){t.getImage().src=e}var Cc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Sc,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:gc,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?mc:void 0,i.renderReprojectionEdges_=!1,i}return wc(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!on(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!on(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!on(e,t)){var i=Xt(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ud(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||on(e,t))return this.tileCache;var i=Xt(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Gd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?Sr:Tr,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(Et,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!on(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=Dd(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var h=this.getTileGridForProjection(r),d=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),g=new kc(r,h,n,d,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return g.key=p,l?(g.interimTile=l,g.refreshInterimChain(),a.replace(u,g)):a.set(u,g),g}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=jd(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==Sr?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=$o(t);if(i){var o=Xt(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(oc),zc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ec=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return zc(e,t),e.prototype.getPreload=function(){return this.get(Cd)},e.prototype.setPreload=function(t){this.set(Cd,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(zd)},e.prototype.setUseInterimTilesOnError=function(t){this.set(zd,t)},e}($e),Tc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pc=function(t){function e(e){return t.call(this,e)||this}return Tc(e,t),e.prototype.createRenderer=function(){return new vd(this)},e}(Ec),Oc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fc=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Xd({extent:Zd(o),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return Oc(e,t),e}(Cc),Rc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mc='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Ic=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[Mc];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return Rc(e,t),e}(Fc);const jc=Array.isArray;function Dc(t,e){if(1===arguments.length)return e=>Dc(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!jc(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Ac=new Nh({features:[],wrapX:!1}),Lc=new wh({source:Ac,style:new ml({image:new pl({radius:3,fill:new Ls({color:"grey"})})})});function Gc(t,e){var i,o,n;const r=t&&(null==(n=null==(o=null==(i=t.getSource())?void 0:i.getFeaturesInExtent(e))?void 0:o.filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})))?void 0:n.flatMap((t=>t.flatCoordinates_)));if(r)return Dc(2,r).forEach(((t,e)=>{Ac.addFeature(new us({geometry:new wa(t),i:e}))}))}const Nc={color:"#ff0000",width:3},Bc=new rl(Nc),Vc=new rl(__spreadProps(__spreadValues({},Nc),{lineDash:[2,8]})),qc=new Ls({color:"rgba(255, 0, 0, 0.1)"}),Wc=new ll({stroke:new rl({color:"red",width:2}),points:4,radius1:15,radius2:1}),Uc=new pl({radius:6,fill:new Ls({color:"#ff0000"})}),Xc=new ml({image:new ll({fill:new Ls({color:"#fff"}),stroke:new rl({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ga){const t=e.getCoordinates()[0];return new Es(t)}}}),Kc=new Nh,Yc=new wh({source:Kc,style:[new ml({fill:qc,stroke:Bc}),Xc]});const Zc=new pd({source:Ac,pixelTolerance:15});
35
+ read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,h=i?n-1:0,d=i?-1:1,c=t[e+h];for(h+=d,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+h],h+=d,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+h],h+=d,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,h=p>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,g=o?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=p?(s=0,a=p):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=g,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=g,a/=256,u-=8);t[i+c-g]|=128*f}},Cl=El,zl=Sl;function El(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}El.Varint=0,El.Fixed64=1,El.Bytes=2,El.Fixed32=5;var Tl=4294967296,Pl=1/Tl,Ol="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Fl(t){return t.type===El.Bytes?t.readVarint()+t.pos:t.pos+1}function Rl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ml(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function Il(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function jl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Dl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Al(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ll(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Gl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Nl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Bl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Vl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function ql(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Wl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}El.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=ql(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ul(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ql(this.buf,this.pos)+ql(this.buf,this.pos+4)*Tl;return this.pos+=8,t},readSFixed64:function(){var t=ql(this.buf,this.pos)+Ul(this.buf,this.pos+4)*Tl;return this.pos+=8,t},readFloat:function(){var t=zl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=zl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return Rl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return Rl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return Rl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return Rl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return Rl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return Rl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ol?function(t,e,i){return Ol.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==El.Bytes)return t.push(this.readVarint(e));var i=Fl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==El.Bytes)return t.push(this.readSVarint());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==El.Bytes)return t.push(this.readBoolean());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==El.Bytes)return t.push(this.readFloat());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==El.Bytes)return t.push(this.readDouble());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==El.Bytes)return t.push(this.readFixed32());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==El.Bytes)return t.push(this.readSFixed32());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==El.Bytes)return t.push(this.readFixed64());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==El.Bytes)return t.push(this.readSFixed64());var e=Fl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===El.Varint)for(;this.buf[this.pos++]>127;);else if(e===El.Bytes)this.pos=this.readVarint()+this.pos;else if(e===El.Fixed32)this.pos+=4;else{if(e!==El.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Wl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Wl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Wl(this.buf,-1&t,this.pos),Wl(this.buf,Math.floor(t*Pl),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Wl(this.buf,-1&t,this.pos),Wl(this.buf,Math.floor(t*Pl),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(o,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ml(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),zl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),zl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var o=this.pos-i;o>=128&&Ml(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,El.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writeBytesField:function(t,e){this.writeTag(t,El.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,El.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,El.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,El.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,El.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,El.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,El.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,El.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,El.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,El.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Xl=[1,0,0,1,0,0],Kl=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===To?ro(this.flatCoordinates_):ao(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=vo(this.getExtent());this.flatInteriorPoints_=Ea(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ws(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Ta(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=gs(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,o=0,n=i.length;o<n;++o){var r=i[o],a=gs(t,e,r,2,.5);ft(this.flatMidpoints_,a),e=r}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=$o(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=bo(i)/bo(e);xn(Xl,i[0],i[3],o,-o,0,0,0),Yr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Xl,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Kl.prototype.getEndss=Kl.prototype.getEnds,Kl.prototype.getFlatCoordinates=Kl.prototype.getOrientedFlatCoordinates;var Yl=Kl,Zl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Hl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields($l,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function $l(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var o=null,n=i.readVarint()+i.pos;i.pos<n;)o=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(o)}}function Jl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Ql(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Jl,n,o),n}var tu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new _i({code:"",units:yi.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Yl,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Zl(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var h=t.readVarint();r=7&h,a=h>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):Fe(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?To:Ro:2===t?i=1===e?Po:Mo:3===t&&(i=Fo);return i}(n,l.length);if(this.featureClass_===Yl)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Fo){for(var h=[],d=0,c=0,g=0,f=l.length;g<f;++g){var m=l[g];if(Ma(s,d,m,2)){if(0===h.length)continue;h[h.length-1].push(l[c])}else h.push(l.slice(c,g+1));c=g+1,d=m}p=h.length>1?new Cs(s,Wr,h):new Ga(s,Wr,l)}else p=u===To?new wa(s,Wr):u===Po?new ys(s,Wr):u===Fo?new Ga(s,Wr,l):u===Ro?new ks(s,Wr):u===Mo?new bs(s,Wr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=Ps(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return Os},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=$o(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new Cl(t),a=r.readFields(Hl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var h=0,d=u.length;h<d;++h){var c=Ql(r,u,h);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Ts);function eu(t,e,i,o,n){iu(t,e,i||0,o||t.length-1,n||nu)}function iu(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);iu(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],h=i,d=o;for(ou(t,i,e),n(t[o],p)>0&&ou(t,i,o);h<d;){for(ou(t,h,d),h++,d--;n(t[h],p)<0;)h++;for(;n(t[d],p)>0;)d--}0===n(t[i],p)?ou(t,i,d):ou(t,++d,o),d<=e&&(i=d+1),e<=d&&(o=d-1)}}function ou(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function nu(t,e){return t<e?-1:t>e?1:0}class ru{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!mu(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;mu(t,s)&&(e.leaf?i.push(a):fu(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!mu(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(mu(t,r)){if(e.leaf||fu(t,r))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=vu([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=au(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!fu(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=vu(t.slice(e,i+1)),su(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=vu([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));yu(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);yu(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return su(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=du(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),uu(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=vu(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,su(i,this.toBBox),su(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=vu([t,e]),this.data.height=t.height+1,this.data.leaf=!1,su(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=lu(t,0,a,this.toBBox),s=lu(t,a,i,this.toBBox),l=gu(e,s),u=du(e)+du(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:pu,n=t.leaf?this.compareMinY:hu;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=lu(t,0,e,n),a=lu(t,i-e,i,n);let s=cu(r)+cu(a);for(let l=e;l<i-e;l++){const e=t.children[l];uu(r,t.leaf?n(e):e),s+=cu(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];uu(a,t.leaf?n(e):e),s+=cu(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)uu(e[o],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():su(t[i],this.toBBox)}}function au(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function su(t,e){lu(t,0,t.children.length,e,t)}function lu(t,e,i,o,n){n||(n=vu(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];uu(n,t.leaf?o(e):e)}return n}function uu(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function pu(t,e){return t.minX-e.minX}function hu(t,e){return t.minY-e.minY}function du(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function cu(t){return t.maxX-t.minX+(t.maxY-t.minY)}function gu(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function fu(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function mu(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function vu(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function yu(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;eu(t,a,e,i,n),r.push(e,a,a,i)}}var _u=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bu="renderOrder",xu=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return _u(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(bu)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new ru(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(bu,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:ml,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Fe("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}($e),ku={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},wu=[ku.FILL],Su=[ku.STROKE],Cu=[ku.BEGIN_PATH],zu=[ku.CLOSE_PATH],Eu=ku,Tu=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),Pu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ou=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return Pu(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],Ji(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,h,d=t[e],c=t[e+1],g=this.tmpCoordinate_,f=!0;for(u=e+o;u<i;u+=o)g[0]=t[u],g[1]=t[u+1],(h=eo(l,g))!==p?(f&&(a[s++]=d,a[s++]=c,f=!1),a[s++]=g[0],a[s++]=g[1]):h===qi?(a[s++]=g[0],a[s++]=g[1],f=!1):f=!0,d=g[0],c=g[1],p=h;return(n&&f||u===e+o)&&(a[s++]=d,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),h=this.coordinates.length;switch(u){case Io:n=t.getOrientedFlatCoordinates(),s=[];var d=t.getEndss();l=0;for(var c=0,g=d.length;c<g;++c){var f=[];l=this.drawCustomCoordinates_(n,l,d[c],p,f),s.push(f)}this.instructions.push([Eu.CUSTOM,h,s,t,i,va]),this.hitDetectionInstructions.push([Eu.CUSTOM,h,s,t,o||i,va]);break;case Fo:case Mo:a=[],n=u==Fo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([Eu.CUSTOM,h,a,t,i,ma]),this.hitDetectionInstructions.push([Eu.CUSTOM,h,a,t,o||i,ma]);break;case Po:case Do:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([Eu.CUSTOM,h,r,t,i,fa]),this.hitDetectionInstructions.push([Eu.CUSTOM,h,r,t,o||i,fa]);break;case Ro:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>h&&(this.instructions.push([Eu.CUSTOM,h,r,t,i,fa]),this.hitDetectionInstructions.push([Eu.CUSTOM,h,r,t,o||i,fa]));break;case To:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([Eu.CUSTOM,h,r,t,i]),this.hitDetectionInstructions.push([Eu.CUSTOM,h,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Eu.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Eu.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==Eu.END_GEOMETRY?r=t:o==Eu.BEGIN_GEOMETRY&&(i[2]=t,gt(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=ul(o||Bn)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=ul(n||Un);var r=e.getLineCap();i.lineCap=void 0!==r?r:Vn;var a=e.getLineDash();i.lineDash=a?a.slice():qn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:Wn;var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[Eu.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Eu.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!mt(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Eu.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Hi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Zi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Tu),Fu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ru=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return Fu(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([Eu.DRAW_IMAGE,n,r,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([Eu.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([Eu.DRAW_IMAGE,n,r,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([Eu.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(Ou),Mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Iu=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Mu(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[Eu.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Eu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,qn,0],Cu);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(Su),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Eu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Cu);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(Su),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Su),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Su),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Cu)},e}(Ou),ju=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Du=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return ju(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(Cu),this.hitDetectionInstructions.push(Cu);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),d=[Eu.MOVE_TO_LINE_TO,p,h];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(zu),this.hitDetectionInstructions.push(zu)),e=u}return r&&(this.instructions.push(wu),this.hitDetectionInstructions.push(wu)),a&&(this.instructions.push(Su),this.hitDetectionInstructions.push(Su)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Eu.SET_FILL_STYLE,Bn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Eu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[Eu.CIRCLE,s];this.instructions.push(Cu,l),this.hitDetectionInstructions.push(Cu,l),void 0!==i.fillStyle&&(this.instructions.push(wu),this.hitDetectionInstructions.push(wu)),void 0!==i.strokeStyle&&(this.instructions.push(Su),this.hitDetectionInstructions.push(Su)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Eu.SET_FILL_STYLE,Bn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Eu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Eu.SET_FILL_STYLE,Bn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Eu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=da(i[o],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Ou);function Au(t,e,i,o,n){var r,a,s,l,u,p,h,d,c,g=i,f=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(d=_-l,c=b-u,s=Math.sqrt(d*d+c*c),void 0!==p&&(v+=a,Math.acos((p*d+h*c)/(a*s))>t&&(v>m&&(m=v,g=y,f=r),v=0,y=r-n)),a=s,p=d,h=c),l=_,u=b}return(v+=s)>m?[y,r]:[g,f]}var Lu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gu={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Nu={Circle:Du,Default:Ou,Image:Ru,LineString:Iu,Polygon:Du,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Lu(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==xl||s!=Po&&s!=Mo&&s!=Fo&&s!=Io){var p=n.overflow?null:[];switch(s){case To:case Ro:l=t.getFlatCoordinates();break;case Po:l=t.getFlatMidpoint();break;case Do:l=t.getCenter();break;case Mo:l=t.getFlatMidpoints(),u=2;break;case Fo:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Io:var h=t.getFlatInteriorPoints();l=[];for(k=0,w=h.length;k<w;k+=3)n.overflow||p.push(h[k+2]/this.resolution),l.push(h[k],h[k+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(O-a)/2!=l.length/u){var d=a/2;p=p.filter((function(t,e){var i=r[2*(d+e)]===l[e*u]&&r[2*(d+e)+1]===l[e*u+1];return i||--d,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=Yn&&(n.scale[0]<0||n.scale[1]<0)){var g=n.padding[0],f=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(f=-f,v=-v),n.scale[1]<0&&(g=-g,m=-m),c=[g,f,m,v]}var y=this.pixelRatio;this.instructions.push([Eu.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==Yn?Yn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([Eu.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!Co(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Po)b=[l.length];else if(s==Mo)b=t.getEnds();else if(s==Fo)b=t.getEnds().slice(0,1);else if(s==Io){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,E=0,T=b.length;E<T;++E){if(null==S){var P=Au(n.maxAngle,l,C,b[E],u);C=P[0],z=P[1]}else z=b[E];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var O=r.length;C=b[E],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=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 n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||Xn,textBaseline:e.textBaseline||Kn,scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Gu[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,h=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([Eu.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,h*s,p,r,1]),this.hitDetectionInstructions.push([Eu.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,h,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=ul(r.getColor()||Bn)):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||Vn,n.lineDash=s?s.slice():qn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||Wn,n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=ul(a.getColor()||Un)}else n=null,this.textStrokeState_=n;i=this.textState_;var h=t.getFont()||Nn;tr(h);var d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=h,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||Kn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Yn,i.scale=void 0===d?[1,1]:d;var c=t.getOffsetX(),g=t.getOffsetY(),f=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Xt(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+Xt(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Ou)},Bu=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Nu[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),Vu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qu=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Vu(e,t),e.prototype.getFeatures=function(t){return Wt()},e.prototype.prepareFrame=function(t){return Wt()},e.prototype.renderFrame=function(t,e){return Wt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Hs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Hs&&e!=$s&&t.addEventListener(Et,this.boundHandleImageChange_),e==Ys&&(t.load(),e=t.getState()),e==Hs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ye&&t.changed()},e}(qt),Wu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Uu=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Wu(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===_e(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=se()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=ko(i),n=wo(i),r=mo(i),a=fo(i);_n(e.coordinateToPixelTransform,o),_n(e.coordinateToPixelTransform,n),_n(e.coordinateToPixelTransform,r),_n(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;_n(s,o),_n(s,n),_n(s,r),_n(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new Gn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(qe,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,h=-t[0]+a,d=-t[1];return xn(this.tempTransform,s,l,u,p,-i,h,d)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=_n(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!Ji(a,_n(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(h){return"SecurityError"===h.name?new Uint8Array:o}return 0===o[3]?null:o},e}(qu),Xu="Circle",Ku="Default",Yu="Image",Zu="LineString",Hu="Polygon",$u="Text";function Ju(t,e,i,o,n,r,a,s,l,u,p,h){var d=t[e],c=t[e+1],g=0,f=0,m=0,v=0;function y(){g=d,f=c,d=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((d-g)*(d-g)+(c-f)*(c-f))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=Ge(g,d,_),x=Ge(f,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=Ge(g,d,_=0===m?0:(S-v)/m),E=Ge(f,c,_);if(h){var T=[b,x,z,E];Zr(T,0,4,2,h,T,T),C=T[0]>T[2]}else C=b>z;var P,O=Math.PI,F=[],R=k+o===e;if(m=0,v=w,d=t[e=k],c=t[e+1],R){y(),P=Math.atan2(c-f,d-g),C&&(P+=P>0?-O:O);var M=(z+b)/2,I=(E+x)/2;return F[0]=[M,I,(S-r)/2,P,n],F}for(var j=0,D=n.length;j<D;){y();var A=Math.atan2(c-f,d-g);if(C&&(A+=A>0?-O:O),void 0!==P){var L=A-P;if(L+=L>O?-2*O:L<-O?2*O:0,Math.abs(L)>a)return null}P=A;for(var G=j,N=0;j<D;++j){var B=s*l(u,n[C?D-j-1:j],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(j!==G){var V=C?n.substring(D-G,D-j):n.substring(G,j);M=Ge(g,d,_=0===m?0:(r+N/2-v)/m),I=Ge(f,c,_);F.push([M,I,N/2,A,V]),r+=N}}return F}var Qu=[1/0,1/0,-1/0,-1/0],tp=[],ep=[],ip=[],op=[];function np(t){return t[3].declutterBox}var rp=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 ap(t,e){return"start"!==e&&"end"!==e||rp.test(t)||(e="start"===e?"left":"right"),Gu[e]}var sp=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=ap(t,s.textAlign||Xn),h=o&&r.lineWidth?r.lineWidth:0,d=t.split("\n"),c=d.length,g=[],f=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=or(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,d,g),m=er(s.font),v=f+h,y=[],_=(v+2)*u[0],b=(m*c+h)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",h),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(ne?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*h;if(o)for(k=0;k<c;++k)y.push("strokeText",[d[k],S+w*g[k],.5*(h+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[d[k],S+w*g[k],.5*(h+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,h,d,c,g,f){var m,v=i-(a*=h[0]),y=o-(s*=h[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*h[0]+c[1],k=c[0]+b*h[1]+c[2],w=v-c[3],S=y-c[0];return(g||0!==p)&&(tp[0]=w,op[0]=w,tp[1]=S,ep[1]=S,ep[0]=w+x,ip[0]=ep[0],ip[1]=S+k,op[1]=ip[1]),0!==p?(_n(m=xn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),tp),_n(m,ep),_n(m,ip),_n(m,op),oo(Math.min(tp[0],ep[0],ip[0],op[0]),Math.min(tp[1],ep[1],ip[1],op[1]),Math.max(tp[0],ep[0],ip[0],op[0]),Math.max(tp[1],ep[1],ip[1],op[1]),Qu)):oo(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),Qu),d&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:Qu[0],minY:Qu[1],maxX:Qu[2],maxY:Qu[3],value:f},canvasTransform:m,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,tp,ep,ip,op,r,a),rr(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=_n(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=ap(t,n.textAlign||Xn),u=Gu[n.textBaseline||Kn],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&mt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Yr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,p,h,d,c,g,f,m,v,y,_,b,x,k,w,S,C=0,z=o.length,E=0,T=0,P=0,O=null,F=null,R=this.coordinateCache_,M=this.viewRotation_,I=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},D=this.instructions!=o||this.overlaps?0:200;C<z;){var A=o[C];switch(A[0]){case Eu.BEGIN_GEOMETRY:x=A[1],S=A[3],x.getGeometry()?void 0===a||Co(a,S.getExtent())?++C:C=A[2]+1:C=A[2];break;case Eu.BEGIN_PATH:T>D&&(this.fill_(t),T=0),P>D&&(t.stroke(),P=0),T||P||(t.beginPath(),d=NaN,c=NaN),++C;break;case Eu.CIRCLE:var L=l[E=A[1]],G=l[E+1],N=l[E+2]-L,B=l[E+3]-G,V=Math.sqrt(N*N+B*B);t.moveTo(L+V,G),t.arc(L,G,V,0,2*Math.PI,!0),++C;break;case Eu.CLOSE_PATH:t.closePath(),++C;break;case Eu.CUSTOM:E=A[1],u=A[2];var q=A[3],W=A[4],U=6==A.length?A[5]:void 0;j.geometry=q,j.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,E,u,2,X):(X[0]=l[E],X[1]=l[E+1],X.length=2),W(X,j),++C;break;case Eu.DRAW_IMAGE:E=A[1],u=A[2],m=A[3],p=A[4],h=A[5];var K=A[6],Y=A[7],Z=A[8],H=A[9],$=A[10],J=A[11],Q=A[12],tt=A[13],et=A[14];if(!m&&A.length>=19){v=A[18],y=A[19],_=A[20],b=A[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,A[3]=m;var ot=A[22];p=(it.anchorX-ot)*this.pixelRatio,A[4]=p;var nt=A[23];h=(it.anchorY-nt)*this.pixelRatio,A[5]=h,K=m.height,A[6]=K,tt=m.width,A[13]=tt}var rt=void 0;A.length>24&&(rt=A[24]);var at=void 0,st=void 0,lt=void 0;A.length>16?(at=A[15],st=A[16],lt=A[17]):(at=Yn,st=!1,lt=!1),$&&I?J+=M:$||I||(J-=M);for(var ut=0;E<u;E+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[E],l[E+1],tt,K,p,h,Z,H,J,Q,n,at,st||lt,x),Y,st?O:null,lt?F:null],ht=void 0,dt=void 0;if(s&&et){var ct=u-E;if(!et[ct]){et[ct]=pt;continue}if(ht=et[ct],delete et[ct],dt=np(ht),s.collides(dt))continue}s&&s.collides(Lt.declutterBox)||(ht&&(s&&s.insert(dt),this.replayImageOrLabel_.apply(this,ht)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case Eu.DRAW_CHARS:var gt=A[1],ft=A[2],vt=A[3],yt=A[4];b=A[5];var _t=A[6],bt=A[7],xt=A[8];_=A[9];var kt=A[10];v=A[11],y=A[12];var wt=[A[13],A[13]],St=this.textStates[y],Ct=St.font,zt=[St.scale[0]*bt,St.scale[1]*bt],Et=void 0;Ct in this.widths_?Et=this.widths_[Ct]:(Et={},this.widths_[Ct]=Et);var Tt=ms(l,gt,ft,2),Pt=Math.abs(zt[0])*nr(Ct,v,Et);if(yt||Pt<=Tt){var Ot=this.textStates[y].textAlign,Ft=Ju(l,gt,ft,2,v,(Tt-Pt)*Gu[Ot],_t,Math.abs(zt[0]),nr,Ct,Et,I?0:this.viewRotation_);t:if(Ft){var Rt=[],Mt=void 0,It=void 0,jt=void 0,Dt=void 0,At=void 0;if(_)for(Mt=0,It=Ft.length;Mt<It;++Mt){jt=(At=Ft[Mt])[4],Dt=this.createLabel(jt,y,"",_),p=At[2]+(zt[0]<0?-kt:kt),h=vt*Dt.height+2*(.5-vt)*kt*zt[1]/zt[0]-xt;var Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],wt,!1,Yn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}if(b)for(Mt=0,It=Ft.length;Mt<It;++Mt){jt=(At=Ft[Mt])[4],Dt=this.createLabel(jt,y,b,""),p=At[2],h=vt*Dt.height-xt;Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],wt,!1,Yn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}s&&s.load(Rt.map(np));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case Eu.END_GEOMETRY:if(void 0!==r){var Bt=r(x=A[1],S);if(Bt)return Bt}++C;break;case Eu.FILL:D?T++:this.fill_(t),++C;break;case Eu.MOVE_TO_LINE_TO:for(E=A[1],u=A[2],k=l[E],f=(w=l[E+1])+.5|0,(g=k+.5|0)===d&&f===c||(t.moveTo(k,w),d=g,c=f),E+=2;E<u;E+=2)g=(k=l[E])+.5|0,f=(w=l[E+1])+.5|0,E!=u-2&&g===d&&f===c||(t.lineTo(k,w),d=g,c=f);++C;break;case Eu.SET_FILL_STYLE:O=A,this.alignFill_=A[2],T&&(this.fill_(t),T=0,P&&(t.stroke(),P=0)),t.fillStyle=A[1],++C;break;case Eu.SET_STROKE_STYLE:F=A,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,A),++C;break;case Eu.STROKE:D?P++:t.stroke(),++C;break;default:++C}}T&&this.fill_(t),P&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),lp=[Hu,Xu,Zu,Yu,$u,Ku],up=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var o=t[e];for(var n in o){var r=o[n];i[n]=new sp(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=xn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=se(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(uo(u=[1/0,1/0,-1/0,-1/0],t),Zi(u,e*(this.renderBuffer_+o),u));var h,d=function(t){if(void 0!==pp[t])return pp[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return pp[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=d.length;s<l;s++)if(i[d[s]]>0){if(!r||h!==Yu&&h!==$u||-1!==r.indexOf(t)){var u=(d[s]-3)/4,c=o-u%a,g=o-(u/a|0),f=n(t,e,c*c+g*g);if(f)return f}p.clearRect(0,0,a,a);break}}var g,f,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(dt),g=_.length-1;g>=0;--g){var b=_[g].toString();for(m=this.executorsByZIndex_[b],f=lp.length-1;f>=0;--f)if(void 0!==(v=m[h=lp[f]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Yr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return wt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(dt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,h,d,c,g=r||lp;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var f=s[l].toString();for(d=this.executorsByZIndex_[f],p=0,h=g.length;p<h;++p){void 0!==(c=d[g[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),pp={};var hp=up,dp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cp=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return dp(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Yr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var h=n[u]-this.imageAnchorX_,d=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=h+this.imageAnchorX_,g=d+this.imageAnchorY_;xn(a,c,g,1,1,l,-c,-g),r.setTransform.apply(r,a),r.translate(c,g),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,d,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Yr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=xn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Yr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(Co(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var o=t.getFlatCoordinates();if(o){var n=t.getStride();return Yr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case To:this.drawPoint(t);break;case Po:this.drawLineString(t);break;case Fo:this.drawPolygon(t);break;case Ro:this.drawMultiPoint(t);break;case Mo:this.drawMultiLineString(t);break;case Io:this.drawMultiPolygon(t);break;case jo:this.drawGeometryCollection(t);break;case Do:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Co(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Co(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Co(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!1);i.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Co(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Co(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(mt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,o=t.textAlign?t.textAlign:Xn;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.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})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:ul(o||Bn)}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),h=a||qn;this.strokeState_={lineCap:void 0!==r?r:Vn,lineDash:1===this.pixelRatio_?h:h.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Wn,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:ul(n||Un)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[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_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:ul(i||Bn)}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Vn,lineDash:a||qn,lineDashOffset:s||0,lineJoin:void 0!==l?l:Wn,lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:ul(n||Un)}}else this.textStrokeState_=null;var h=t.getFont(),d=t.getOffsetX(),c=t.getOffsetY(),g=t.getRotateWithView(),f=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==h?h:Nn,textAlign:void 0!==y?y:Xn,textBaseline:void 0!==_?_:Kn},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==d?this.pixelRatio_*d:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0!==f?f:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(Tu),gp=.5;function fp(t,e,i,o,n,r,a){var s=se(t[0]*gp,t[1]*gp);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new cp(s,gp,n,null,a),p=i.length,h=Math.floor(16777215/p),d={},c=1;c<=p;++c){var g=i[c-1],f=g.getStyleFunction()||o;if(o){var m=f(g,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*h).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(g);if(x&&Co(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var E=se(z[0],z[1],void 0,{alpha:!1}),T=E.canvas;E.fillStyle=v,E.fillRect(0,0,T.width,T.height),k.setImage(new sl({img:T,imgSize:z,anchor:C.getAnchor(),anchorXUnits:qs,anchorYUnits:qs,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var P=k.getZIndex()||0;(R=d[P])||(R={},d[P]=R,R[Fo]=[],R[Do]=[],R[Po]=[],R[To]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var O=Object.keys(d).map(Number).sort(dt),F=(c=0,O.length);c<F;++c){var R=d[O[c]];for(var M in R){var I=R[M];for(y=0,_=I.length;y<_;y+=2){u.setStyle(I[y+1]);for(var j=0,D=e.length;j<D;++j)u.setTransform(e[j]),u.drawGeometry(I[y])}}}return s.getImageData(0,0,l.width,l.height)}function mp(t,e,i){var o=[];if(i){var n=Math.floor(Math.round(t[0])*gp),r=Math.floor(Math.round(t[1])*gp),a=4*(Re(n,0,i.width-1)+Re(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var vp={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Hs)return;var l=t.getBuilder(i.getZIndex(),Yu);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),$u);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Zu);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),$u);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Hu);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),$u);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Hs)return;var l=t.getBuilder(i.getZIndex(),Yu);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),$u);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Zu);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),$u);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Hu);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),$u);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,vp[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Xu);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),$u);u.setTextStyle(l),u.drawText(e,o)}}};function yp(t,e){return parseInt(Xt(t),10)-parseInt(Xt(e),10)}function _p(t,e){var i=bp(t,e);return i*i}function bp(t,e){return.5*t/e}function xp(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Hs||u==$s?l.unlistenImageChange(n):(u==Ys&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())kp(t,s,i,e);else{(0,vp[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function kp(t,e,i,o){if(e.getType()!=jo)t.getBuilder(i.getZIndex(),Ku).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)kp(t,n[r],i,o)}var wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Sp=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return wp(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),h=e.pixelRatio,d=e.viewHints,c=!(d[Fr]||d[Rr]),g=this.context,f=Math.round(e.size[0]*h),m=Math.round(e.size[1]*h),v=p.getWrapX()&&s.canWrapX(),y=v?So(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,h,f,m,b*y);t.execute(g,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){yn(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),kn(this.inversePixelTransform,this.pixelTransform);var n=wn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var h=t.viewState;h.projection;var d=!1,c=!0;if(o.extent&&this.clipping){var g=cn(o.extent);(d=(c=Co(g,t.extent))&&!Qi(g,t.extent))&&this.clipUnrotated(r,t,g)}c&&this.renderWorlds(s,t),d&&r.restore(),this.postRender(r,t);var f=_e(o.opacity),m=this.container;return f!==m.style.opacity&&(m.style.opacity=f),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];_n(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=i[0]*gp,h=i[1]*gp;u.push(this.getRenderTransform(o,n,r,gp,p,h,0).slice());var d=l.getSource(),c=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!Qi(c,s)){for(var g=s[0],f=So(c),m=0,v=void 0;g<c[0];)v=f*--m,u.push(this.getRenderTransform(o,n,r,gp,p,h,v).slice()),g+=f;for(m=0,g=s[2];g>c[2];)v=f*++m,u.push(this.getRenderTransform(o,n,r,gp,p,h,v).slice()),g-=f}this.hitDetectionImageData_=fp(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(mp(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},h=function(t,e,i){var r=Xt(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,h,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[Fr],n=t.viewHints[Rr],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,h=t.pixelRatio,d=e.getRevision(),c=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=yp);var f=l.center.slice(),m=Zi(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Qi(_,t.extent)){var b=So(_),x=Math.max(So(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Ko(f,u);var k=function(t,e){var i=e.getExtent(),o=vo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=So(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&Qi(this.wrappedRenderedExtent_,m))return mt(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=f,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Bu(bp(p,h),m,p,h);this.getLayer().getDeclutter()&&(w=new Bu(bp(p,h),m,p,h));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var E=_p(p,h),T=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,E,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),P=dn(m),O=i.getFeaturesInExtent(P);g&&O.sort(g);for(C=0,z=O.length;C<z;++C)T(O[C]);this.renderedFeatures_=O;var F=S.finish(),R=new hp(m,p,h,i.getOverlaps(),F,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new hp(m,p,h,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=d,this.renderedRenderOrder_=g,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=f,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=xp(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=xp(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Uu),Cp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zp=function(t){function e(e){return t.call(this,e)||this}return Cp(e,t),e.prototype.createRenderer=function(){return new Sp(this)},e}(xu),Ep=function(){function t(t){this.rbush_=new ru(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[Xt(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[Xt(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=Xt(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[Xt(e)];so([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return wt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return oo(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Tp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Pp(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Op=function(t){function e(e){var i=t.call(this)||this;i.projection=$o(e.projection),i.attributions_=Pp(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ye,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return Tp(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Wt()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Pp(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Zt),Fp="addfeature",Rp="changefeature",Mp="clear",Ip="removefeature",jp="featuresloadstart",Dp="featuresloadend",Ap="featuresloaderror";function Lp(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Gp(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==Os&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==Fs||o==Rs?l=s.responseText:o==Ms?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==Os&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Np(t,e){return function(i,o,n,r,a){var s=this;Gp(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||_t)}}var Bp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vp=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Bp(e,t),e}(ut),qp=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Ye,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=_t,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(Fe(i.format_,7),i.loader_=Np(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:Lp;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new Ep:null,i.loadedExtentsRtree_=new Ep,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new ri(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Bp(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Xt(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Vp(Fp,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Lt(e,Et,this.handleFeatureChange_,this),Lt(e,pt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(Fe(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],o=[],n=0,r=t.length;n<r;n++){var a=Xt(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=Xt(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var h=i.length;n<h;n++)this.dispatchEvent(new Vp(Fp,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Fp,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Ip,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ti,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ei,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(Nt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new Vp(Mp);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var o=e(i);if(o)return o}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),wt(this.nullGeometryFeatures_)||ft(t,kt(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||vt;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=Xt(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Vp(Rp,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:Xt(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&wt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return Qi(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Vp(jp)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Vp(Dp,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Vp(Ap))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(so(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=Xt(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=Xt(t);this.featureChangeKeys_[e].forEach(Nt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Vp(Ip,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Fe(this.format_,7),this.url_=t,this.setLoader(Np(t,this.format_))},e}(Op),Wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Up=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return Wp(e,t),e.prototype.changed=function(){this.dispatchEvent(Et)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==zr)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==zr){t.interimTile=null;break}t.getState()==Cr?e=t:t.getState()==Sr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Er&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Wt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var o=e-i+1e3/60;return o>=this.transition_?1:ai(o/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(zt),Xp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Kp=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return Xp(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=zr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Er,this.unlistenImage_(),this.image_=((t=se(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=zr:this.state=Tr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Er&&(this.state=Sr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Sr&&(this.state=Cr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=il(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Up),Yp=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Zp="active",Hp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function $p(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:si})}}var Jp=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Hp(e,t),e.prototype.getActive=function(){return this.get(Zp)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Zp,t)},e.prototype.setMap=function(t){this.map_=t},e}(Zt),Qp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),th=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return Qp(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==_r.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;$p(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(Jp),eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ih(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var oh=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return eh(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==_r.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==_r.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==_r.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==_r.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===_r.POINTERDOWN||e===_r.POINTERDRAG||e===_r.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==_r.POINTERUP?delete this.trackedPointers_[i]:(t.type==_r.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=kt(this.trackedPointers_)}},e}(Jp);function nh(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var rh=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ah=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},sh=vt,lh=function(t){var e=t.originalEvent;return 0==e.button&&!(ee&&ie&&e.ctrlKey)},uh=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ph=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},hh=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},dh=function(t){var e=t.originalEvent;return Fe(void 0!==e,56),"mouse"==e.pointerType},ch=function(t){var e=t.originalEvent;return Fe(void 0!==e,56),e.isPrimary&&0===e.button},gh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fh=function(t){function e(e){var i=t.call(this,{stopDown:yt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:nh(uh,ch);return i.condition_=o.onFocusOnly?nh(ah,n):n,i.noKinetic_=!1,i}return gh(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=ih(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,qo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:si})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(oh),mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vh=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:yt})||this).condition_=o.condition?o.condition:rh,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return mh(e,t),e.prototype.handleDragEvent=function(t){if(dh(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Vr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!dh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!dh(t)&&(!(!lh(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(oh),yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_h=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return yh(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ga([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(ht),bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xh="boxstart",kh="boxdrag",wh="boxend",Sh="boxcancel",Ch=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return bh(e,t),e}(ut),zh=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new _h(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:lh,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return bh(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ch(kh,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Ch(e?wh:Sh,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ch(xh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(oh),Eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Th=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:ph;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return Eh(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:si})},e}(zh),Ph=37,Oh=38,Fh=39,Rh=40,Mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ih=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return uh(t)&&hh(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return Mh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Rt){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==Rh||o==Ph||o==Fh||o==Oh)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==Rh?s=-r:o==Ph?a=-r:o==Fh?a=r:s=r;var l=[a,s];qo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ui,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Jp),jh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Dh=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:hh,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return jh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Rt||t.type==Mt){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;$p(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Jp),Ah=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Lh="trackpad",Gh="wheel",Nh=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:sh;return i.condition_=o.onFocusOnly?nh(ah,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Ah(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==At)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==At&&(e=o.deltaY,te&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=oe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Lh:Gh);var r=i.getView();if(this.mode_===Lh&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Re(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),$p(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Jp),Bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vh=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Bh(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Vr){var l=a.getViewport().getBoundingClientRect(),u=ih(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(oh),qh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Wh=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return qh(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=ih(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(oh),Uh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xh="Point",Kh="LineString",Yh="Polygon",Zh="Circle",Hh="drawstart",$h="drawend",Jh="drawabort",Qh=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Uh(e,t),e}(ut);var td=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=yt),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case To:case Ro:return Xh;case Po:case Mo:return Kh;case Fo:case Io:return Yh;case Do:return Zh;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Yh?3:2,i.maxPoints_=i.mode_===Zh?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:vt;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Zh)r=function(t,e,i){var o=e||new ps([NaN,NaN]),n=hn(t[0]),r=Wo(n,hn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Xh?a=wa:s===Kh?a=ys:s===Yh&&(a=Ga),r=function(t,e,i){return e?s===Yh?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new zp({source:new qp({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=vl(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:uh,i.freehandCondition_,e.freehand?i.freehandCondition_=sh:i.freehandCondition_=e.freehandCondition?e.freehandCondition:ph,i.addChangeListener(Zp,i.updateState_),i}return Uh(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===Pt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Xh&&this.freehandCondition_(e);var i=e.type===_r.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===_r.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===_r.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===_r.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===_r.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===_r.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===_r.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new yr(_r.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Xh||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===Xh)e=!0;else if(n===Zh)e=2===this.sketchCoords_.length;else if(n===Kh)i=this.sketchCoords_.length>this.minPoints_;else if(n===Yh){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),h=t[0]-p[0],d=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+d*d)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Es(new wa(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new Es);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new ys(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Xh?this.sketchCoords_=t.slice():this.mode_===Yh?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Es(new ys(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Es,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Qh(Hh,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Xh?i=this.sketchCoords_:this.mode_===Yh?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Fo&&this.mode_!==Yh)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Kh||r===Zh?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Yh&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===Kh||o===Zh){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Fo&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Yh){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Kh?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Yh&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===Ro?t.setGeometry(new ks([e])):this.type_===Mo?t.setGeometry(new bs([e])):this.type_===Io&&t.setGeometry(new Cs([e])),this.dispatchEvent(new Qh($h,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Qh(Jh,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Kh||i===Zh)e=this.sketchCoords_;else{if(i!==Yh)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new Es(new wa(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Qh(Hh,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(oh),ed=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),id=[0,0,0,0],od=[],nd="modifystart",rd="modifyend",ad=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return ed(e,t),e}(ut);function sd(t,e){return t.index-e.index}function ld(t,e,i){var o=e.geometry;if(o.getType()===Do){var n=o;if(1===e.index){null;var r=Wo(n.getCenter(),hn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=hn(t);return od[0]=hn(e.segment[0]),od[1]=hn(e.segment[1]),Xo(s,od)}function ud(t,e,i){var o=e.geometry;if(o.getType()===Do&&1===e.index){var n=o;return pn(n.getClosestPoint(hn(t)))}var r=hn(t);return od[0]=hn(e.segment[0]),od[1]=hn(e.segment[1]),pn(Bo(r,od))}var pd=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:ch,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==_r.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:sh,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new Ep,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new zp({source:new qp({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=vl(),function(t,e){return i[To]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new ri(n.source_.getFeatures()),n.source_.addEventListener(Fp,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Ip,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ti,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ei,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return ed(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(Et,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ri;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new ad(nd,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(Et,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert(Yi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,geometry:e,depth:[a,o],index:u,segment:h};this.rBush_.insert(Yi(h),d)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(ro(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new Es(new wa(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=_r.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=_r.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==_r.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,h=void 0,d=s.segment,c=a[1];e.length<u.getStride();)e.push(d[c][e.length]);switch(u.getType()){case To:h=e,d[0]=e,d[1]=e;break;case Ro:(h=u.getCoordinates())[s.index]=e,d[0]=e,d[1]=e;break;case Po:(h=u.getCoordinates())[s.index+c]=e,d[c]=e;break;case Mo:case Fo:(h=u.getCoordinates())[p[0]][s.index+c]=e,d[c]=e;break;case Io:(h=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,d[c]=e;break;case Do:if(d[0]=e,d[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var g=Uo(hn(u.getCenter()),hn(e));u.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(u,h)}this.createOrUpdateVertexFeature_(e,i,o)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=Yi([r]),s=this.rBush_.getInExtent(a),l={};s.sort(sd);for(var u=0,p=s.length;u<p;++u){var h=s[u],d=h.segment,c=Xt(h.geometry),g=h.depth;if(g&&(c+="-"+g.join("-")),l[c]||(l[c]=new Array(2)),h.geometry.getType()!==Do||1!==h.index)if(!Vo(d[0],r)||l[c][0])if(!Vo(d[1],r)||l[c][1])Xt(d)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(h);else{if((h.geometry.getType()===Po||h.geometry.getType()===Mo)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([h,1]),l[c][1]=h}else this.dragSegments_.push([h,0]),l[c][0]=h;else Vo(ud(e,h,o),r)&&!l[c][0]&&(this.dragSegments_.push([h,0]),l[c][0]=h)}n.length&&this.willModifyFeatures_(t,[n]);for(var f=n.length-1;f>=0;--f)this.insertVertex_(n[f],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===Do){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(ro(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Yi(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new ad(rd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===To&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=dn(Zi(cn(ro(a,id)),e.getView().getResolution()*this.pixelTolerance_,id));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return ld(a,t,s)-ld(a,e,s)}))[0],h=p.segment,d=ud(a,p,s),c=e.getPixelFromCoordinate(d),g=Uo(t,c);if(n||g<=this.pixelTolerance_){var f={};if(f[Xt(h)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-a[0],this.delta_[1]=d[1]-a[1]),p.geometry.getType()===Do&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(h[0]),v=e.getPixelFromCoordinate(h[1]),y=Wo(c,m),_=Wo(c,v);g=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(d=y>_?h[1]:h[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var b={};b[Xt(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Vo(h[0],w[0])&&Vo(h[1],w[1])||Vo(h[0],w[1])&&Vo(h[1],w[0])))break;var S=Xt(o[x].geometry);S in b||(b[S]=!0,f[Xt(w)]=!0)}}return void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Mo:case Fo:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Io:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Po:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert(Yi(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert(Yi(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=_r.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new ad(rd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,h=this.dragSegments_,d={},c=!1;for(n=h.length-1;n>=0;--n)p=Xt((u=(i=h[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in d||(d[p]={}),0===i[1]?(d[p].right=u,d[p].index=u.index):1==i[1]&&(d[p].left=u,d[p].index=u.index+1);for(p in d){switch(l=d[p].right,a=d[p].left,(s=(r=d[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Mo:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Po:e.length>2&&(e.splice(r,1),c=!0);break;case Io:t=t[u.depth[1]];case Fo:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),g.push(l.segment[1])),void 0!==a&&void 0!==l){var f={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:g};this.rBush_.insert(Yi(f.segment),f)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||mt(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(oh),hd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function dd(t){return t.feature?t.feature:t.element?t.element:void 0}var cd=[],gd=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=vt),n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new Ep,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return hd(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=Xt(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Lt(t,Et,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=dd(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=dd(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=Xt(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=kt(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=Xt(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Nt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Nt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Lt(this.features_,ti,this.handleFeatureAdd_,this),Lt(this.features_,ei,this.handleFeatureRemove_,this)):this.source_&&o.push(Lt(this.source_,Fp,this.handleFeatureAdd_,this),Lt(this.source_,Ip,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=Yi([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==Do})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=hn(e),p=1/0,h=0;h<n.length;++h){var d=n[h];cd[0]=hn(d.segment[0]),cd[1]=hn(d.segment[1]);var c=Xo(u,cd);c<p&&(l=d,p=c)}var g=l.segment;if(this.vertex_&&!this.edge_){var f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Wo(t,f),y=Wo(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Do;if(_){var b=l.feature.getGeometry();null,a=pn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else cd[0]=hn(g[0]),cd[1]=hn(g[1]),a=pn(Bo(u,cd));if(Uo(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Wo(s,f),y=Wo(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=Ba(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Yi(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Yi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,segment:h};this.rBush_.insert(Yi(h),d)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Yi(l),u)}},e}(oh);function fd(t){var e=t||{},i=new ri,o=new Yp(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new vh),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new th({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new fh({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Vh),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Wh({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Ih),i.push(new Dh({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Nh({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Th({duration:e.zoomDuration})),i}var md=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vd=function(t){function e(e){return(e=bt({},e)).controls||(e.controls=ss()),e.interactions||(e.interactions=fd({onFocusOnly:!0})),t.call(this,e)||this}return md(e,t),e.prototype.createRenderer=function(){return new sr(this)},e}(Ha),yd=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return Fe(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Fe(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Fe(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function _d(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function bd(t,e,i){return t+"/"+e+"/"+i}function xd(t){return bd(t[0],t[1],t[2])}function kd(t){return t.split("/").map(Number)}var wd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Sd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wd(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=kd(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(xd(e.tileCoord)),e.release())}.bind(this))}},e}(yd),Cd=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function zd(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new Cd(t,e,i,o)}var Ed=Cd,Td=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pd=[],Od=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return Td(e,t),e.prototype.getContext=function(t){var e=Xt(t);return e in this.context_||(this.context_[e]=se(1,1,Pd)),this.context_[e]},e.prototype.hasContext=function(t){return Xt(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=Xt(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)Pd.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(Up),Fd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rd=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return Fd(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==Sr&&(this.setState(Cr),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Er)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(zr)},e.prototype.setLoader=function(t){this.loader_=t},e}(Up),Md=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Id=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new Ed(0,0,0,0),i}return Md(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==zr||i==Tr||i==Er&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==Er&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(zr)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),h=p.getRevision(),d=p.getTileGridForProjection(n),c=d.getZForResolution(r,p.zDirection),g=d.getResolution(c),f=t.extent,m=i.extent&&cn(i.extent);m&&(f=xo(f,cn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=g*y/2/v,k=g*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=d.getTileRangeForExtentAndZ(f,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),E=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var P=S.minX;P<=S.maxX;++P)for(var O=S.minY;O<=S.maxY;++O){var F=this.getTile(c,P,O,t);if(this.isDrawableTile(F)){var R=Xt(this);if(F.getState()==zr){C[c][F.tileCoord.toString()]=F;var M=F.inTransition(R);this.newTiles_||!M&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(R,t.time))continue}var I=d.getTileCoordChildTileRange(F.tileCoord,T,E),j=!1;I&&(j=z(c+1,I)),j||d.forEachTileCoordParentTileRange(F.tileCoord,z,T,E)}var D=g/r;xn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var A=wn(this.pixelTransform);this.useContainer(e,A,i.opacity);var L=this.context,G=L.canvas;kn(this.inversePixelTransform,this.pixelTransform),xn(this.tempTransform,y/2,_/2,D,D,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),bt(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,V,q=Object.keys(C).map(Number);q.sort(dt),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var W=q.length-1;W>=0;--W){var U=q[W],X=p.getTilePixelSize(U,l,n),K=d.getResolution(U)/g,Y=X[0]*K*D,Z=X[1]*K*D,H=d.getTileCoordForCoordAndZ(ko(w),U),$=d.getTileCoordExtent(H),J=_n(this.tempTransform,[v*($[0]-w[0])/g,v*(w[3]-$[3])/g]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(F=tt[et]).tileCoord,ot=H[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=H[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(P=Math.round(J[0]-ot*Y)),lt=at-(O=Math.round(J[1]-rt*Z)),ut=c===U;if(!(M=ut&&1!==F.getAlpha(Xt(this),t.time)))if(N){L.save(),V=[P,O,P+st,O,P+st,O+lt,P,O+lt];for(var pt=0,ht=N.length;pt<ht;++pt)if(c!==U&&U<B[pt]){var ct=N[pt];L.beginPath(),L.moveTo(V[0],V[1]),L.lineTo(V[2],V[3]),L.lineTo(V[4],V[5]),L.lineTo(V[6],V[7]),L.moveTo(ct[6],ct[7]),L.lineTo(ct[4],ct[5]),L.lineTo(ct[2],ct[3]),L.lineTo(ct[0],ct[1]),L.clip()}N.push(V),B.push(U)}else L.clearRect(P,O,st,lt);this.drawTileImage(F,t,P,O,st,lt,Q,ut),N&&!M?(L.restore(),this.renderedTiles.unshift(F)):this.renderedTiles.push(F),this.updateUsedTiles(t.usedTiles,p,F)}}this.renderedRevision=h,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!so(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,d,l,n,f,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),A!==G.style.transform&&(G.style.transform=A);var gt=_e(i.opacity),ft=this.container;return gt!==ft.style.opacity&&(ft.style.opacity=gt),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=Xt(this),p=s?t.getAlpha(u,e.time):1,h=p!==this.context.globalAlpha;h&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),h&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(u)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var o=Xt(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=Xt(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=Xt(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,h,d,c,g,f,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(f=i.getMinZoom();f<=a;++f)for(h=i.getTileRangeForExtentAndZ(r,f,h),d=i.getResolution(f),c=h.minX;c<=h.maxX;++c)for(g=h.minY;g<=h.maxY;++g)a-f<=s?(++y,(p=e.getTile(f,c,g,o,n)).getState()==Sr&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),d])),void 0!==l&&l(p)):e.useTile(f,c,g,n);e.updateCacheSize(y,n)},e}(Uu);Id.prototype.getLayer;var jd=Id,Dd="image",Ad="hybrid",Ld="vector",Gd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nd={image:[Hu,Xu,Zu,Yu,$u],hybrid:[Hu,Zu],vector:[]},Bd={hybrid:[Yu,$u,Ku],vector:[Hu,Xu,Zu,Yu,$u,Ku]},Vd=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return Gd(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==zr&&n!==Er||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),h=n.viewHints,d=!(h[Fr]||h[Rr]);return!d&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(d||Date.now()-n.time<8)&&u.getRenderMode()!==Ld&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===Ld?Xt(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),h=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),d=l.getSourceTiles(e,i,t),c=Xt(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var g=function(i,n){var g=d[i];if(g.getState()!=zr)return"continue";var m=g.tileCoord,v=p.getTileCoordExtent(m),y=xo(h,v),_=Zi(y,o.getRenderBuffer()*a,f.tmpExtent),b=so(v,y)?null:_;s.dirty=!1;var x=new Bu(0,_,a,e),k=u?new Bu(0,y,a,e):void 0,w=_p(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=g.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,E=C.length;z<E;++z){var T=C[z];b&&!Co(b,T.getGeometry().getExtent())||S.call(f,T)}var P=x.finish(),O=o.getRenderMode()!==Ld&&u&&1===d.length?null:y,F=new hp(O,a,e,l.getOverlaps(),P,o.getRenderBuffer());if(t.executorGroups[c].push(F),k){var R=new hp(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},f=this,m=0,v=d.length;m<v;++m)g(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Yi([t]);Zi(u,r*i,u);for(var p,h={},d=function(t,e,i){var r=t.getId();void 0===r&&(r=Xt(t));var a=h[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return h[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return h[r]=!0,o(t,s,e);n.push(h[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,g=function(o,n){var h=c[o];if(!Co(l.getTileCoordExtent(h.wrappedTileCoord),u))return"continue";var g=Xt(s),f=[h.executorGroups[g]],m=h.declutterExecutorGroups[g];m&&f.push(m),f.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,d,n))return!0}}))},f=0,m=c.length;!p&&f<m;++f)g(f);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=Xt(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),h=_n(this.renderedPixelToCoordinateTransform_,t.slice()),d=p.getTileCoordForCoordAndResolution(h,u),c=0,g=this.renderedTiles.length;c<g;++c)if(d.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===zr){var f=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!Qi(l,f)&&Ko(h,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=ko(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(h[0]-m[0])/u,(m[1]-h[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Ya(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=fp(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,gp,b[0]*gp,b[1]*gp,0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(mp(v,y,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var o=t.viewHints,n=!(o[Fr]||o[Rr]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[Xt(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,d=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(h,this.tmpExtent)[0]-d[0];return vn(bn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[Fr]||o[Rr]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=Bd[a],p=e.viewState.rotation,h=this.renderedTiles,d=[],c=[],g=h.length-1;g>=0;--g)for(var f=h[g],m=this.getTileRenderTransform(f,e),v=f.executorGroups[Xt(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=f.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=d.length;S<C;++S){var z=d[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),d.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=xp(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=xp(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===Ld)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[Xt(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,h=l.getTileGridForProjection(p),d=h.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*d,g=h.getResolution(s),f=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);f.canvas.width=m[0],f.canvas.height=m[1];var v=u/c;if(1!==v){var y=mn(this.tmpTransform_);bn(y,v,v),f.setTransform.apply(f,y)}var _=h.getTileCoordExtent(a,this.tmpExtent),b=c/g,x=mn(this.tmpTransform_);bn(x,b,-b),function(t,e,i){vn(t,yn(fn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(f,v,x,0,!0,Nd[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(jd),qd="preload",Wd="useInterimTilesOnError",Ud=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xd=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===Dd&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||Ad;return Fe(r==Ad||r==Ld,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Ud(e,t),e.prototype.createRenderer=function(){return new Vd(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(qd)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Wd)},e.prototype.setPreload=function(t){this.set(qd,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Wd,t)},e}(xu),Kd="tileloadstart",Yd="tileloadend",Zd="tileloaderror",Hd=[0,0,0],$d=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Fe((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||dt,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,Fe(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=ko(s)),Fe(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Fe(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Dr,Fe(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new Ed(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?zd(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return zd(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return zd(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?zd(s,s,l,l,i):zd(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Ya(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return oo(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Hd;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),zd(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Ya(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Ya(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return oo(r,a,r+n[0]*o,a+n[1]*o,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Ya(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,h=Math.floor((t-s[0])/i+u),d=Math.floor((s[1]-e)/i+p),c=a*h/l[0],g=a*d/l[1];return o?(c=Math.ceil(c)-1,g=Math.ceil(g)-1):(c=Math.floor(c),g=Math.floor(g)),_d(r,c,g,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Ya(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),h=Math.floor((r[1]-e)/a+u),d=p/s[0],c=h/s[1];return o?(d=Math.ceil(d)-1,c=Math.ceil(c)-1):(d=Math.floor(d),c=Math.floor(c)),_d(i,d,c,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Re(ct(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Jd(t){var e=t.getDefaultTileGrid();return e||(e=ec(t),t.setDefaultTileGrid(e)),e}function Qd(t){var e=t||{},i=e.extent||$o("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:tc(i,e.maxZoom,e.tileSize,e.maxResolution)};return new $d(o)}function tc(t,e,i,o){for(var n=void 0!==e?e:42,r=bo(t),a=So(t),s=Ya(void 0!==i?i:Dr),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),h=0;h<u;++h)p[h]=l/Math.pow(2,h);return p}function ec(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:Ni,r=tc(t,e,i);return new $d({extent:t,origin:yo(t,n),resolutions:r,tileSize:i})}(ic(t),e,i,o)}function ic(t){var e=(t=$o(t)).getExtent();if(!e){var i=180*vi[yi.DEGREES]/t.getMetersPerUnit();e=oo(-i,-i,i,i)}return e}var oc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&Ya(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Sd(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return oc(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=bd(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===zr)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Wt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Jd(t)},e.prototype.getTileCacheForProjection=function(t){return Fe(on(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Ya(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=ic(i);if(Ji(r,n))return e;var a=So(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,o){},e}(Op),rc=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return oc(e,t),e}(ut),ac=nc;function sc(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return Fe(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function lc(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=sc(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=Le(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var uc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pc=function(t){function e(i){var o=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return uc(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,o=Xt(i),n=i.getState();n==Cr?(this.tileLoadingKeys_[o]=!0,e=Kd):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==Er?Zd:n==zr?Yd:void 0),null!=e&&this.dispatchEvent(new rc(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(lc(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=bd(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(ac),hc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),dc=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||ic(o),r=e.tileGrid||Qd({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:cc,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new Sd(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:Rd,i.tileGrids_={},i}return hc(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=kd(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===zr)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(Co(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var h=0,d=p.length;h<d;++h){var c=p[h],g=c.getGeometry();Co(t,g.getExtent())&&e.push(c)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=bd((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===Sr){i.setState(Cr);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Zi(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&xo(a,p,a);var h=u.getZForResolution(l,1);u.forEachTileCoord(a,h,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?Sr:Tr,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<zr){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===zr||e===Er){var n=a.getKey();n in i.errorTileKeys?a.getState()===zr&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===Er?i.errorTileKeys[n]=!0:a.removeEventListener(Et,l),0===i.loadingSourceTiles&&i.setState(wt(i.errorTileKeys)?zr:Er)}};a.addEventListener(Et,l),i.loadingSourceTiles++}s===Sr&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===Er}))?Er:zr)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=bd(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),h=this.getTileGridForProjection(n);if(u&&p){var d=h.getTileCoordExtent(u);Zi(d,-h.getResolution(t),d),Co(p,d)||(u=null)}var c=!0;if(null!==u){var g=this.tileGrid,f=h.getResolution(t),m=g.getZForResolution(f,1),v=h.getTileCoordExtent(u);Zi(v,-f,v),g.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new Od(l,c?Tr:Sr,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=ec(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Ya(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(pc);function cc(t,e){t.setLoader((function(i,o,n){Gp(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var gc,fc=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=rn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&So(o)==So(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?So(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?So(this.targetProj_.getExtent()):null;var l=ko(i),u=wo(i),p=mo(i),h=fo(i),d=this.transformInv_(l),c=this.transformInv_(u),g=this.transformInv_(p),f=this.transformInv_(h),m=10+(r?Math.max(0,Math.ceil(Ie(go(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,h,d,c,g,f,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=Yi([n,r,a,s]),p=this.sourceWorldWidth_?So(u)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=So(Yi([t,e,i,o]))/this.targetWorldWidth_>.25||c;!d&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Co(u,this.maxSourceExtent_)){var g=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(g=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=g&&4!=g&&8!=g)return;if(l>0){if(!c){var f=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(f),v=void 0;if(d)v=(Le(n[0],h)+Le(a[0],h))/2-Le(m[0],h);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&g)&&this.addTriangle_(t,i,o,n,a,s),0==(14&g)&&this.addTriangle_(t,i,e,n,a,r),g&&(0==(13&g)&&this.addTriangle_(e,o,t,r,s,n),0==(7&g)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;uo(t,n[0]),uo(t,n[1]),uo(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),mc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function vc(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function yc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function _c(t,e,i,o){var n=an(i,e,t),r=Jo(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||Ji(l,n)){var u=Jo(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function bc(t,e,i,o,n,r,a,s,l,u,p,h){var d=se(Math.round(i*t),Math.round(i*e));if(bt(d,h),0===l.length)return d.canvas;function c(t){return Math.round(t*i)/i}d.scale(i,i),d.globalCompositeOperation="lighter";var g=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){lo(g,t.extent)}));var f=So(g),m=bo(g),v=se(Math.round(i*f/o),Math.round(i*m/o));bt(v,h);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-g[0],n=-(t.extent[3]-g[3]),r=So(t.extent),a=bo(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=ko(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],f=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,E=u;l=0,u=0;var T=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var h=new Array(e),d=e-1;d>=0;d--){h[d]=t[d][e]/t[d][d];for(var c=d-1;c>=0;c--)t[c][e]-=t[c][d]*h[d]}return h}([[p-=z,f-=E,0,0,k-b],[m-=z,y-=E,0,0,S-b],[0,0,p,f,w-x],[0,0,m,y,C-x]]);if(T){if(d.save(),d.beginPath(),function(){if(void 0===gc){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",vc(t,4,5,4,0),vc(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;gc=yc(e,0)||yc(e,4)||yc(e,8)}return gc}()||h===mc){d.moveTo(k,w);for(var P=b-k,O=x-w,F=0;F<4;F++)d.lineTo(k+c((F+1)*P/4),w+c(F*O/3)),3!=F&&d.lineTo(k+c((F+1)*P/4),w+c((F+1)*O/3));d.lineTo(S,C)}else d.moveTo(k,w),d.lineTo(b,x),d.lineTo(S,C);d.clip(),d.transform(T[0],T[2],T[1],T[3],b,x),d.translate(g[0]-z,g[3]-E),d.scale(o/i,-o/i),d.drawImage(v.canvas,0,0),d.restore()}})),p&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;d.beginPath(),d.moveTo(s,l),d.lineTo(n,a),d.lineTo(u,p),d.closePath(),d.stroke()})),d.restore()),d.canvas}var xc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),kc=function(t){function e(e,i,o,n,r,a,s,l,u,p,h,d){var c=t.call(this,r,Sr)||this;c.renderEdges_=void 0!==h&&h,c.contextOptions_=d,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var g=n.getTileCoordExtent(c.wrappedTileCoord_),f=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=f?xo(g,f):g;if(0===go(v))return c.state=Tr,c;var y=e.getExtent();y&&(m=m?xo(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=vo(i),r=_c(t,e,n,o);return(!isFinite(r)||r<=0)&&co(i,(function(i){return r=_c(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=Tr,c;var x=void 0!==p?p:.5;if(c.triangulation_=new fc(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=Tr,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=Re(k[1],m[1],m[3]),k[3]=Re(k[3],m[1],m[3])):k=xo(k,m)),go(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=Tr)}else c.state=Tr;return c}return xc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==zr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Er;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=bc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=zr}this.changed()},e.prototype.load=function(){if(this.state==Sr){this.state=Cr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==Sr||n==Cr){t++;var r=Lt(e,Et,(function(i){var o=e.getState();o!=zr&&o!=Er&&o!=Tr||(Nt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==Sr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Nt),this.sourcesListenerKeys_=null},e}(Up),wc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Sc(t,e){t.getImage().src=e}var Cc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Sc,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Kp,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?mc:void 0,i.renderReprojectionEdges_=!1,i}return wc(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!on(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!on(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!on(e,t)){var i=Xt(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Jd(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||on(e,t))return this.tileCache;var i=Xt(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Sd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?Sr:Tr,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(Et,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!on(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=xd(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var h=this.getTileGridForProjection(r),d=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),g=new kc(r,h,n,d,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return g.key=p,l?(g.interimTile=l,g.refreshInterimChain(),a.replace(u,g)):a.set(u,g),g}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=bd(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==Sr?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=$o(t);if(i){var o=Xt(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(pc),zc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ec=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return zc(e,t),e.prototype.getPreload=function(){return this.get(qd)},e.prototype.setPreload=function(t){this.set(qd,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Wd)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Wd,t)},e}($e),Tc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pc=function(t){function e(e){return t.call(this,e)||this}return Tc(e,t),e.prototype.createRenderer=function(){return new jd(this)},e}(Ec),Oc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fc=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Qd({extent:ic(o),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return Oc(e,t),e}(Cc),Rc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mc='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Ic=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[Mc];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return Rc(e,t),e}(Fc);const jc=Array.isArray;function Dc(t,e){if(1===arguments.length)return e=>Dc(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!jc(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Ac=new qp({features:[],wrapX:!1}),Lc=new zp({source:Ac,style:new _l({image:new cl({radius:3,fill:new Bs({color:"grey"})})})});function Gc(t,e){var i,o,n;const r=t&&(null==(n=null==(o=null==(i=t.getSource())?void 0:i.getFeaturesInExtent(e))?void 0:o.filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})))?void 0:n.flatMap((t=>t.flatCoordinates_)));if(r)return Dc(2,r).forEach(((t,e)=>{Ac.addFeature(new Es({geometry:new wa(t),i:e}))}))}const Nc={color:"#ff0000",width:3},Bc=new ll(Nc),Vc=new ll(__spreadProps(__spreadValues({},Nc),{lineDash:[2,8]})),qc=new Bs({color:"rgba(255, 0, 0, 0.1)"}),Wc=new hl({stroke:new ll({color:"red",width:2}),points:4,radius1:15,radius2:1}),Uc=new cl({radius:6,fill:new Bs({color:"#ff0000"})}),Xc=new _l({image:new hl({fill:new Bs({color:"#fff"}),stroke:new ll({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ga){const t=e.getCoordinates()[0];return new ks(t)}}}),Kc=new qp,Yc=new zp({source:Kc,style:[new _l({fill:qc,stroke:Bc}),Xc]});const Zc=new gd({source:Ac,pixelTolerance:15});
36
36
  /**
37
37
  * splaytree v3.1.0
38
38
  * Fast Splay tree for Node and browser
@@ -41,7 +41,7 @@ read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,h=i?n-1:0,d=i?
41
41
  * @license MIT
42
42
  * @preserve
43
43
  */
44
- var Hc=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function $c(t,e){return t>e?1:t<e?-1:0}function Jc(t,e,i){for(var o=new Hc(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Qc(t,e,i,o){var n=new Hc(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Jc(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function tg(t,e,i){var o=null,n=null;if(e){var r=i((e=Jc(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function eg(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&eg(t.left,r,!1,o,n),t.right&&eg(t.right,r,!0,o,n)}}var ig=function(){function t(t){void 0===t&&(t=$c),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Qc(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Hc(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Jc(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var o;return null===e?null:0===i(t,(e=Jc(t,e,i)).key)?(null===e.left?o=e.right:(o=Jc(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Jc(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Jc(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],o=!1,n=new Hc(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&rg(t,e,0,o-1,n),null===this._root)this._root=og(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Hc(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Hc(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Hc(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=ng({head:r},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return eg(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=tg(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Qc(e,i,a,o):r=Qc(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Jc(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return tg(t,this._root,this._comparator)},t}();function og(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Hc(a,s);return l.left=og(t,e,i,r),l.right=og(t,e,r+1,o),l}return null}function ng(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=ng(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=ng(t,n+1,i),a}return null}function rg(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}rg(t,e,i,s,n),rg(t,e,s+1,o,n)}}function ag(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sg(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function lg(t,e,i){return e&&sg(t.prototype,e),i&&sg(t,i),t}var ug=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},pg=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,o=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},hg=Number.EPSILON;void 0===hg&&(hg=Math.pow(2,-52));var dg=hg*hg,cg=function(t,e){if(-hg<t&&t<hg&&-hg<e&&e<hg)return 0;var i=t-e;return i*i<dg*t*e?0:t<e?-1:1},gg=function(){function t(){ag(this,t),this.reset()}return lg(t,[{key:"reset",value:function(){this.xRounder=new fg,this.yRounder=new fg}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),fg=function(){function t(){ag(this,t),this.tree=new ig,this.round(0)}return lg(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===cg(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===cg(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),mg=new gg,vg=function(t,e){return t.x*e.y-t.y*e.x},yg=function(t,e){return t.x*e.x+t.y*e.y},_g=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=vg(o,n);return cg(r,0)},bg=function(t){return Math.sqrt(yg(t,t))},xg=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return yg(n,o)/bg(n)/bg(o)},kg=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},wg=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},Sg=function(){function t(e,i){ag(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return lg(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:zg.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),lg(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},vg(l,s)/bg(l)/bg(s)),cosine:xg(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),Cg=0,zg=function(){function t(e,i,o,n){ag(this,t),this.id=++Cg,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return lg(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var d=e.comparePoint(t.leftSE.point);if(0!==d)return d;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var g=e.comparePoint(t.rightSE.point);if(0!==g)return g}if(n>r){var f=t.comparePoint(e.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),lg(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=pg(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=ug(e,a)&&0===this.comparePoint(a),u=ug(i,n)&&0===t.comparePoint(n),p=ug(e,s)&&0===this.comparePoint(s),h=ug(i,r)&&0===t.comparePoint(r);if(u&&l)return h&&!p?r:!h&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return h&&r.x===a.x&&r.y===a.y?null:a;if(h&&p)return null;if(h)return r;if(p)return s;var d=function(t,e,i,o){if(0===e.x)return wg(i,o,t.x);if(0===o.x)return wg(t,e,i.x);if(0===e.y)return kg(i,o,t.y);if(0===o.y)return kg(t,e,i.y);var n=vg(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=vg(r,e)/n,s=vg(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===d?null:ug(o,d)?mg.round(d.x,d.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new Sg(e,!0),r=new Sg(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return Sg.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Sg.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],h=i.rings.indexOf(u);-1===h?(i.rings.push(u),i.windings.push(p)):i.windings[h]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],h=0,d=e.length;h<d;h++)if(0!==i[h]){var c=e[h],g=c.poly;if(-1===p.indexOf(g))if(c.isExterior)u.push(g);else{-1===p.indexOf(g)&&p.push(g);var f=u.indexOf(c.poly);-1!==f&&u.splice(f,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Dg.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Dg.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(Dg.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=Sg.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new Sg(n,!0),new Sg(r,!1),[o],[a])}}]),t}(),Eg=function(){function t(e,i,o){if(ag(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=o,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=mg.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=mg.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(zg.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(zg.fromRing(r,n,this))}return lg(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),Tg=function(){function t(e,i){if(ag(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Eg(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,n=e.length;o<n;o++){var r=new Eg(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return lg(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Pg=function(){function t(e,i){if(ag(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new Tg(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return lg(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Og=function(){function t(e){ag(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return lg(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,h=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var d=s.getAvailableLinkedEvents();if(0===d.length){var c=u[0].point,g=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(g.x,", ").concat(g.y,"]."))}if(1===d.length){l=d[0].otherSE;break}for(var f=null,m=0,v=h.length;m<v;m++)if(h[m].point===s.point){f=m;break}if(null===f){h.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=d.sort(y)[0].otherSE;break}var _=h.splice(f)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),lg(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==_g(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===_g(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,h=[],d=u;d!=p;d+=l)h.push([e[d].x,e[d].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var o=this.events[e];Sg.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),Fg=function(){function t(e){ag(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return lg(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),Rg=function(){function t(e){ag(this,t),this.rings=e,this.polys=this._composePolys(e)}return lg(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new Fg(n));else{var r=n.enclosingRing();r.poly||e.push(new Fg(r)),r.poly.addInterior(n)}}return e}}]),t}(),Mg=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zg.compare;ag(this,t),this.queue=e,this.tree=new ig(i),this.segments=[]}return lg(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),h=0,d=p.length;h<d;h++)i.push(p[h])}var c=null;if(s){var g=s.getIntersection(e);if(null!==g&&(e.isAnEndpoint(g)||(c=g),!s.isAnEndpoint(g)))for(var f=this._splitSafely(s,g),m=0,v=f.length;m<v;m++)i.push(f[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=Sg.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),E=0,T=z.length;E<T;E++)i.push(z[E])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),Ig="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,jg="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Dg=new(function(){function t(){ag(this,t)}return lg(t,[{key:"run",value:function(t,e,i){Dg.type=t,mg.reset();for(var o=[new Pg(e,!0)],n=0,r=i.length;n<r;n++)o.push(new Pg(i[n],!1));if(Dg.numMultiPolys=o.length,"difference"===Dg.type)for(var a=o[0],s=1;s<o.length;)null!==pg(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===Dg.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],h=l+1,d=o.length;h<d;h++)if(null===pg(p.bbox,o[h].bbox))return[];for(var c=new ig(Sg.compare),g=0,f=o.length;g<f;g++)for(var m=o[g].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>Ig)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new Mg(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>Ig)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>jg)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var E=S[C];void 0===E.consumedBy&&c.insert(E)}b=c.size,x=c.pop()}mg.reset();var T=Og.factory(_.segments);return new Rg(T).getGeom()}}]),t}()),Ag=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Dg.run("union",t,i)};function Lg(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Gg(t){return"Feature"===t.type?t.geometry:t}function Ng(t,e,i){void 0===i&&(i={});var o=Gg(t),n=Gg(e),r=Ag(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return Lg({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Lg({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function Bg(t,e){const i=No(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Vg(t,e,i){const o=e.getExtent();return t.getView().fit(Zi(o,i))}function qg(t,e){const[i,o,n]=Array.from(On(t));return zn([i,o,n,e])}const Wg="https://api.os.uk/features/v1/wfs",Ug=new Nh,Xg=new Nh;function Kg(t,e,i){const o=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,a=an(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=Le(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`${Wg}?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new As,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Ug.getFeatureById(e);i?Ug.removeFeature(i):(t.setId(e),Ug.addFeature(t))})):(Ug.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Ug.addFeature(t)}))),Xg.clear(),Xg.addFeature(n.readFeature(Ug.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Ng(t,i):i}),null)))})).catch((t=>console.log(t)))}var Yg,Zg={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Hg(t){return(t=Math.round(t))<0?0:t>255?255:t}function $g(t){return t<0?0:t>1?1:t}function Jg(t){return"%"===t[t.length-1]?Hg(parseFloat(t)/100*255):Hg(parseInt(t))}function Qg(t){return"%"===t[t.length-1]?$g(parseFloat(t)/100):$g(parseFloat(t))}function tf(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Yg={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in Zg)return Zg[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=i.indexOf("("),n=i.indexOf(")");if(-1!==o&&n+1===i.length){var r=i.substr(0,o),a=i.substr(o+1,n-(o+1)).split(","),s=1;switch(r){case"rgba":if(4!==a.length)return null;s=Qg(a.pop());case"rgb":return 3!==a.length?null:[Jg(a[0]),Jg(a[1]),Jg(a[2]),s];case"hsla":if(4!==a.length)return null;s=Qg(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=Qg(a[1]),p=Qg(a[2]),h=p<=.5?p*(u+1):p+u-p*u,d=2*p-h;return[Hg(255*tf(d,h,l+1/3)),Hg(255*tf(d,h,l)),Hg(255*tf(d,h,l-1/3)),s];default:return null}}return null}}catch(T_){}var ef=function(t,e,i,o){void 0===o&&(o=1),this.r=t,this.g=e,this.b=i,this.a=o};ef.parse=function(t){if(t){if(t instanceof ef)return t;if("string"==typeof t){var e=Yg(t);if(e)return new ef(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ef.prototype.toString=function(){var t=this.toArray(),e=t[0],i=t[1],o=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(o)+","+n+")"},ef.prototype.toArray=function(){var t=this,e=t.r,i=t.g,o=t.b,n=t.a;return 0===n?[0,0,0,0]:[255*e/n,255*i/n,255*o/n,n]},ef.black=new ef(0,0,0,1),ef.white=new ef(1,1,1,1),ef.transparent=new ef(0,0,0,0),ef.red=new ef(1,0,0,1),ef.blue=new ef(0,0,1,1);var of=ef;function nf(t){return"object"==typeof t?["literal",t]:t}function rf(t,e){var i=t.stops;if(!i)return function(t,e){var i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];var o=["color"===e.type?"to-color":e.type,i,nf(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}(t,e);var o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((function(t){return!n&&e.tokens&&"string"==typeof t[1]?[t[0],df(t[1])]:[t[0],nf(t[1])]})),o?function(t,e,i){for(var o={},n={},r=[],a=0;a<i.length;a++){var s=i[a],l=s[0].zoom;void 0===o[l]&&(o[l]={zoom:l,type:t.type,property:t.property,default:t.default},n[l]=[],r.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===hf({},e)){for(var u=[af(t),["linear"],["zoom"]],p=0,h=r;p<h.length;p+=1){var d=h[p];pf(u,d,lf(o[d],e,n[d]),!1)}return u}for(var c=["step",["zoom"]],g=0,f=r;g<f.length;g+=1){var m=f[g];pf(c,m,lf(o[m],e,n[m]),!0)}return uf(c),c}(t,e,i):r?function(t,e,i,o){void 0===o&&(o=["zoom"]);var n,r=hf(t,e),a=!1;if("interval"===r)n=["step",o],a=!0;else{if("exponential"!==r)throw new Error('Unknown zoom function type "'+r+'"');var s=void 0!==t.base?t.base:1;n=[af(t),1===s?["linear"]:["exponential",s],o]}for(var l=0,u=i;l<u.length;l+=1){var p=u[l];pf(n,p[0],p[1],a)}return uf(n),n}(t,e,i):lf(t,e,i)}function af(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function sf(t,e){var i,o,n=nf((i=t.default,o=e.default,void 0!==i?i:void 0!==o?o:void 0));return void 0===n&&"resolvedImage"===e.type?"":n}function lf(t,e,i){var o=hf(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){for(var r=["case"],a=0,s=i;a<s.length;a+=1){var l=s[a];r.push(["==",n,l[0]],l[1])}return r.push(sf(t,e)),r}if("categorical"===o){for(var u=["match",n],p=0,h=i;p<h.length;p+=1){var d=h[p];pf(u,d[0],d[1],!1)}return u.push(sf(t,e)),u}if("interval"===o){for(var c=["step",["number",n]],g=0,f=i;g<f.length;g+=1){var m=f[g];pf(c,m[0],m[1],!0)}return uf(c),void 0===t.default?c:["case",["==",["typeof",n],"number"],c,nf(t.default)]}if("exponential"===o){for(var v=void 0!==t.base?t.base:1,y=[af(t),1===v?["linear"]:["exponential",v],["number",n]],_=0,b=i;_<b.length;_+=1){var x=b[_];pf(y,x[0],x[1],!1)}return void 0===t.default?y:["case",["==",["typeof",n],"number"],y,nf(t.default)]}throw new Error("Unknown property function type "+o)}function uf(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function pf(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function hf(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function df(t){for(var e=["concat"],i=/{([^{}]+)}/g,o=0,n=i.exec(t);null!==n;n=i.exec(t)){var r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}var cf=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),gf=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,o=e;i<o.length;i+=1){var n=o[i],r=n[0],a=n[1];this.bindings[r]=a}};gf.prototype.concat=function(t){return new gf(this,t)},gf.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},gf.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var ff=gf,mf={kind:"null"},vf={kind:"number"},yf={kind:"string"},_f={kind:"boolean"},bf={kind:"color"},xf={kind:"object"},kf={kind:"value"},wf={kind:"collator"},Sf={kind:"formatted"},Cf={kind:"resolvedImage"};function zf(t,e){return{kind:"array",itemType:t,N:e}}function Ef(t){if("array"===t.kind){var e=Ef(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Tf=[mf,vf,yf,_f,bf,Sf,xf,zf(kf),Cf];function Pf(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Pf(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,o=Tf;i<o.length;i+=1){if(!Pf(o[i],e))return null}}return"Expected "+Ef(t)+" but found "+Ef(e)+" instead."}function Of(t,e){return e.some((function(e){return e.kind===t.kind}))}function Ff(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Rf=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Rf.prototype.compare=function(t,e){return this.collator.compare(t,e)},Rf.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Mf=Rf,If=function(t,e,i,o,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n},jf=function(t){this.sections=t};jf.fromString=function(t){return new jf([new If(t,null,null,null,null)])},jf.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},jf.factory=function(t){return t instanceof jf?t:jf.fromString(t)},jf.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},jf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];if(o.image)t.push(["image",o.image.name]);else{t.push(o.text);var n={};o.fontStack&&(n["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(n["font-scale"]=o.scale),o.textColor&&(n["text-color"]=["rgba"].concat(o.textColor.toArray())),t.push(n)}}return t};var Df=jf,Af=function(t){this.name=t.name,this.available=t.available};Af.prototype.toString=function(){return this.name},Af.fromString=function(t){return t?new Af({name:t,available:!1}):null},Af.prototype.serialize=function(){return["image",this.name]};var Lf=Af;function Gf(t,e,i,o){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:"Invalid rgba value ["+[t,e,i,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof o?[t,e,i,o]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Nf(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof of)return!0;if(t instanceof Mf)return!0;if(t instanceof Df)return!0;if(t instanceof Lf)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1){if(!Nf(i[e]))return!1}return!0}if("object"==typeof t){for(var o in t)if(!Nf(t[o]))return!1;return!0}return!1}function Bf(t){if(null===t)return mf;if("string"==typeof t)return yf;if("boolean"==typeof t)return _f;if("number"==typeof t)return vf;if(t instanceof of)return bf;if(t instanceof Mf)return wf;if(t instanceof Df)return Sf;if(t instanceof Lf)return Cf;if(Array.isArray(t)){for(var e,i=t.length,o=0,n=t;o<n.length;o+=1){var r=Bf(n[o]);if(e){if(e===r)continue;e=kf;break}e=r}return zf(e||kf,i)}return xf}function Vf(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof of||t instanceof Df||t instanceof Lf?t.toString():JSON.stringify(t)}var qf=function(t,e){this.type=t,this.value=e};qf.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!Nf(t[1]))return e.error("invalid value");var i=t[1],o=Bf(i),n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new qf(o,i)},qf.prototype.evaluate=function(){return this.value},qf.prototype.eachChild=function(){},qf.prototype.outputDefined=function(){return!0},qf.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof of?["rgba"].concat(this.value.toArray()):this.value instanceof Df?this.value.serialize():this.value};var Wf=qf,Uf=function(t){this.name="ExpressionEvaluationError",this.message=t};Uf.prototype.toJSON=function(){return this.message};var Xf=Uf,Kf={string:yf,number:vf,boolean:_f,object:xf},Yf=function(t,e){this.type=t,this.args=e};Yf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,o=1,n=t[0];if("array"===n){var r,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in Kf)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=Kf[s],o++}else r=kf;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],o++}i=zf(r,a)}else i=Kf[n];for(var l=[];o<t.length;o++){var u=e.parse(t[o],o,kf);if(!u)return null;l.push(u)}return new Yf(i,l)},Yf.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!Pf(this.type,Bf(i)))return i;if(e===this.args.length-1)throw new Xf("Expected value to be of type "+Ef(this.type)+", but found "+Ef(Bf(i))+" instead.")}return null},Yf.prototype.eachChild=function(t){this.args.forEach(t)},Yf.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Yf.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Zf=Yf,Hf=function(t){this.type=Sf,this.sections=t};Hf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var o=[],n=!1,r=1;r<=t.length-1;++r){var a=t[r];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,vf)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,zf(yf))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,bf)))return null;var p=o[o.length-1];p.scale=s,p.font=l,p.textColor=u}else{var h=e.parse(t[r],1,kf);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:h,scale:null,font:null,textColor:null})}}return new Hf(o)},Hf.prototype.evaluate=function(t){return new Df(this.sections.map((function(e){var i=e.content.evaluate(t);return Bf(i)===Cf?new If("",i,null,null,null):new If(Vf(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Hf.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t(o.content),o.scale&&t(o.scale),o.font&&t(o.font),o.textColor&&t(o.textColor)}},Hf.prototype.outputDefined=function(){return!1},Hf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t.push(o.content.serialize());var n={};o.scale&&(n["font-scale"]=o.scale.serialize()),o.font&&(n["text-font"]=o.font.serialize()),o.textColor&&(n["text-color"]=o.textColor.serialize()),t.push(n)}return t};var $f=Hf,Jf=function(t){this.type=Cf,this.input=t};Jf.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,yf);return i?new Jf(i):e.error("No image name provided.")},Jf.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=Lf.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},Jf.prototype.eachChild=function(t){t(this.input)},Jf.prototype.outputDefined=function(){return!1},Jf.prototype.serialize=function(){return["image",this.input.serialize()]};var Qf=Jf,tm={"to-boolean":_f,"to-color":bf,"to-number":vf,"to-string":yf},em=function(t,e){this.type=t,this.args=e};em.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var o=tm[i],n=[],r=1;r<t.length;r++){var a=e.parse(t[r],r,kf);if(!a)return null;n.push(a)}return new em(o,n)},em.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,o=0,n=this.args;o<n.length;o+=1){if(i=null,(e=n[o].evaluate(t))instanceof of)return e;if("string"==typeof e){var r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Gf(e[0],e[1],e[2],e[3])))return new of(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Xf(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new Xf("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Df.fromString(Vf(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Lf.fromString(Vf(this.args[0].evaluate(t))):Vf(this.args[0].evaluate(t))},em.prototype.eachChild=function(t){this.args.forEach(t)},em.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},em.prototype.serialize=function(){if("formatted"===this.type.kind)return new $f([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Qf(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var im=em,om=["Unknown","Point","LineString","Polygon"],nm=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};nm.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},nm.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?om[this.feature.type]:this.feature.type:null},nm.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},nm.prototype.canonicalID=function(){return this.canonical},nm.prototype.properties=function(){return this.feature&&this.feature.properties||{}},nm.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,e=this.featureDistanceData.scale,i=this.featureTileCoord,o=i.x,n=i.y,r=o*e-t[0],a=n*e-t[1];return this.featureDistanceData.bearing[0]*r+this.featureDistanceData.bearing[1]*a}return 0},nm.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=of.parse(t)),e};var rm=nm,am=function(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o};am.prototype.evaluate=function(t){return this._evaluate(t,this.args)},am.prototype.eachChild=function(t){this.args.forEach(t)},am.prototype.outputDefined=function(){return!1},am.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},am.parse=function(t,e){var i,o=t[0],n=am.definitions[o];if(!n)return e.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0);for(var r=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1})),l=null,u=0,p=s;u<p.length;u+=1){var h=p[u],d=h[0],c=h[1];l=new Im(e.registry,e.path,null,e.scope);for(var g=[],f=!1,m=1;m<t.length;m++){var v=t[m],y=Array.isArray(d)?d[m-1]:d.type,_=l.parse(v,1+g.length,y);if(!_){f=!0;break}g.push(_)}if(!f)if(Array.isArray(d)&&d.length!==g.length)l.error("Expected "+d.length+" arguments, but found "+g.length+" instead.");else{for(var b=0;b<g.length;b++){var x=Array.isArray(d)?d[b]:d.type,k=g[b];l.concat(b+1).checkSubtype(x,k.type)}if(0===l.errors.length)return new am(o,r,c,g)}}if(1===s.length)(i=e.errors).push.apply(i,l.errors);else{for(var w=(s.length?s:a).map((function(t){var e,i=t[0];return e=i,Array.isArray(e)?"("+e.map(Ef).join(", ")+")":"("+Ef(e.type)+"...)"})).join(" | "),S=[],C=1;C<t.length;C++){var z=e.parse(t[C],1+S.length);if(!z)return null;S.push(Ef(z.type))}e.error("Expected arguments of type "+w+", but found ("+S.join(", ")+") instead.")}return null},am.register=function(t,e){for(var i in am.definitions=e,e)t[i]=am};var sm=am,lm=function(t,e,i){this.type=wf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};lm.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,_f);if(!o)return null;var n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,_f);if(!n)return null;var r=null;return i.locale&&!(r=e.parse(i.locale,1,yf))?null:new lm(o,n,r)},lm.prototype.evaluate=function(t){return new Mf(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},lm.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},lm.prototype.outputDefined=function(){return!1},lm.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var um=lm,pm=8192;function hm(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function dm(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function cm(t,e){var i,o=(180+t[0])/360,n=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),r=Math.pow(2,e.z);return[Math.round(o*r*pm),Math.round(n*r*pm)]}function gm(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function fm(t,e){for(var i,o,n,r,a,s,l,u=!1,p=0,h=e.length;p<h;p++)for(var d=e[p],c=0,g=d.length;c<g-1;c++){if(i=t,o=d[c],n=d[c+1],r=void 0,a=void 0,s=void 0,l=void 0,r=i[0]-o[0],a=i[1]-o[1],s=i[0]-n[0],l=i[1]-n[1],r*l-s*a==0&&r*s<=0&&a*l<=0)return!1;gm(t,d[c],d[c+1])&&(u=!u)}return u}function mm(t,e){for(var i=0;i<e.length;i++)if(fm(t,e[i]))return!0;return!1}function vm(t,e,i,o){var n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,h=a*u-l*s;return p>0&&h<0||p<0&&h>0}function ym(t,e,i){for(var o=0,n=i;o<n.length;o+=1)for(var r=n[o],a=0;a<r.length-1;++a)if(s=t,l=e,u=r[a],p=r[a+1],h=void 0,d=void 0,c=void 0,g=void 0,c=[l[0]-s[0],l[1]-s[1]],g=[p[0]-u[0],p[1]-u[1]],0!=(h=g)[0]*(d=c)[1]-h[1]*d[0]&&vm(s,l,u,p)&&vm(u,p,s,l))return!0;var s,l,u,p,h,d,c,g;return!1}function _m(t,e){for(var i=0;i<t.length;++i)if(!fm(t[i],e))return!1;for(var o=0;o<t.length-1;++o)if(ym(t[o],t[o+1],e))return!1;return!0}function bm(t,e){for(var i=0;i<e.length;i++)if(_m(t,e[i]))return!0;return!1}function xm(t,e,i){for(var o=[],n=0;n<t.length;n++){for(var r=[],a=0;a<t[n].length;a++){var s=cm(t[n][a],i);hm(e,s),r.push(s)}o.push(r)}return o}function km(t,e,i){for(var o=[],n=0;n<t.length;n++){var r=xm(t[n],e,i);o.push(r)}return o}function wm(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){var n=.5*o,r=t[0]-i[0]>n?-o:i[0]-t[0]>n?o:0;0===r&&(r=t[0]-i[2]>n?-o:i[2]-t[0]>n?o:0),t[0]+=r}hm(e,t)}function Sm(t,e,i,o){var n=Math.pow(2,o.z)*pm,r=[o.x*pm,o.y*pm],a=[];if(!t)return a;for(var s=0,l=t;s<l.length;s+=1)for(var u=0,p=l[s];u<p.length;u+=1){var h=p[u],d=[h.x+r[0],h.y+r[1]];wm(d,e,i,n),a.push(d)}return a}function Cm(t,e,i,o){var n,r=Math.pow(2,o.z)*pm,a=[o.x*pm,o.y*pm],s=[];if(!t)return s;for(var l=0,u=t;l<u.length;l+=1){for(var p=[],h=0,d=u[l];h<d.length;h+=1){var c=d[h],g=[c.x+a[0],c.y+a[1]];hm(e,g),p.push(g)}s.push(p)}if(e[2]-e[0]<=r/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var f=0,m=s;f<m.length;f+=1)for(var v=0,y=m[f];v<y.length;v+=1){wm(y[v],e,i,r)}}return s}var zm=function(t,e){this.type=_f,this.geojson=t,this.geometries=e};zm.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Nf(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var o=0;o<i.features.length;++o){var n=i.features[o].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new zm(i,i.features[o].geometry)}else if("Feature"===i.type){var r=i.geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new zm(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new zm(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},zm.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=xm(e.coordinates,o,n),a=Sm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!fm(l[s],r))return!1}if("MultiPolygon"===e.type){var u=km(e.coordinates,o,n),p=Sm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!mm(d[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=xm(e.coordinates,o,n),a=Cm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!_m(l[s],r))return!1}if("MultiPolygon"===e.type){var u=km(e.coordinates,o,n),p=Cm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!bm(d[h],u))return!1}return!0}(t,this.geometries)}return!1},zm.prototype.eachChild=function(){},zm.prototype.outputDefined=function(){return!0},zm.prototype.serialize=function(){return["within",this.geojson]};var Em=zm;function Tm(t){if(t instanceof sm){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Em)return!1;var e=!0;return t.eachChild((function(t){e&&!Tm(t)&&(e=!1)})),e}function Pm(t){if(t instanceof sm&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Pm(t)&&(e=!1)})),e}function Om(t,e){if(t instanceof sm&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!Om(t,e)&&(i=!1)})),i}var Fm=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Fm.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new Fm(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},Fm.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Fm.prototype.eachChild=function(){},Fm.prototype.outputDefined=function(){return!1},Fm.prototype.serialize=function(){return["var",this.name]};var Rm=Fm,Mm=function(t,e,i,o,n){void 0===e&&(e=[]),void 0===o&&(o=new ff),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=o,this.errors=n,this.expectedType=i};Mm.prototype.parse=function(t,e,i,o,n){return void 0===n&&(n={}),e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)},Mm.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new Zf(e,[t]):"coerce"===i?new im(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=t[0];if("string"!=typeof o)return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[o];if(n){var r=n.parse(t,this);if(!r)return null;if(this.expectedType){var a=this.expectedType,s=r.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else r=i(r,a,e.typeAnnotation||"coerce");else r=i(r,a,e.typeAnnotation||"assert")}if(!(r instanceof Wf)&&"resolvedImage"!==r.type.kind&&jm(r)){var l=new rm;try{r=new Wf(r.type,r.evaluate(l))}catch(T_){return this.error(T_.message),null}}return r}return this.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Mm.prototype.concat=function(t,e,i){var o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Mm(this.registry,o,e||null,n,this.errors)},Mm.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var o=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new cf(o,t))},Mm.prototype.checkSubtype=function(t,e){var i=Pf(t,e);return i&&this.error(i),i};var Im=Mm;function jm(t){if(t instanceof Rm)return jm(t.boundExpression);if(t instanceof sm&&"error"===t.name)return!1;if(t instanceof um)return!1;if(t instanceof Em)return!1;var e=t instanceof im||t instanceof Zf,i=!0;return t.eachChild((function(t){i=e?i&&jm(t):i&&t instanceof Wf})),!!i&&(Tm(t)&&Om(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Dm(t,e){for(var i,o,n=t.length-1,r=0,a=n,s=0;r<=a;)if(i=t[s=Math.floor((r+a)/2)],o=t[s+1],i<=e){if(s===n||e<o)return s;r=s+1}else{if(!(i>e))throw new Xf("Input is not a number.");a=s-1}return 0}var Am=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var o=0,n=i;o<n.length;o+=1){var r=n[o],a=r[0],s=r[1];this.labels.push(a),this.outputs.push(s)}};Am.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,vf);if(!i)return null;var o=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r=1;r<t.length;r+=2){var a=1===r?-1/0:t[r],s=t[r+1],l=r,u=r+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(o.length&&o[o.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,n);if(!p)return null;n=n||p.type,o.push([a,p])}return new Am(n,i,o)},Am.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;return o>=e[n-1]?i[n-1].evaluate(t):i[Dm(e,o)].evaluate(t)},Am.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},Am.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Am.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Lm=Am,Gm=Nm;function Nm(t,e,i,o){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function Bm(t,e,i){return t*(1-i)+e*i}Nm.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Nm.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Nm.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Nm.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Nm.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Vm=Object.freeze({__proto__:null,number:Bm,color:function(t,e,i){return new of(Bm(t.r,e.r,i),Bm(t.g,e.g,i),Bm(t.b,e.b,i),Bm(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,o){return Bm(t,e[o],i)}))}}),qm=.95047,Wm=1.08883,Um=4/29,Xm=6/29,Km=3*Xm*Xm,Ym=Math.PI/180,Zm=180/Math.PI;function Hm(t){return t>.008856451679035631?Math.pow(t,1/3):t/Km+Um}function $m(t){return t>Xm?t*t*t:Km*(t-Um)}function Jm(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qm(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tv(t){var e=Qm(t.r),i=Qm(t.g),o=Qm(t.b),n=Hm((.4124564*e+.3575761*i+.1804375*o)/qm),r=Hm((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-Hm((.0193339*e+.119192*i+.9503041*o)/Wm)),alpha:t.a}}function ev(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*$m(e),i=qm*$m(i),o=Wm*$m(o),new of(Jm(3.2404542*i-1.5371385*e-.4985314*o),Jm(-.969266*i+1.8760108*e+.041556*o),Jm(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function iv(t,e,i){var o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}var ov={forward:tv,reverse:ev,interpolate:function(t,e,i){return{l:Bm(t.l,e.l,i),a:Bm(t.a,e.a,i),b:Bm(t.b,e.b,i),alpha:Bm(t.alpha,e.alpha,i)}}},nv={forward:function(t){var e=tv(t),i=e.l,o=e.a,n=e.b,r=Math.atan2(n,o)*Zm;return{h:r<0?r+360:r,c:Math.sqrt(o*o+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*Ym,i=t.c;return ev({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:iv(t.h,e.h,i),c:Bm(t.c,e.c,i),l:Bm(t.l,e.l,i),alpha:Bm(t.alpha,e.alpha,i)}}},rv=function(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(var r=0,a=n;r<a.length;r+=1){var s=a[r],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function av(t,e,i,o){var n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}rv.interpolationFactor=function(t,e,i,o){var n=0;if("exponential"===t.name)n=av(e,t.base,i,o);else if("linear"===t.name)n=av(e,1,i,o);else if("cubic-bezier"===t.name){var r=t.controlPoints;n=new Gm(r[0],r[1],r[2],r[3]).solve(av(e,1,i,o))}return n},rv.parse=function(t,e){var i=t[0],o=t[1],n=t[2],r=t.slice(3);if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){var a=o[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:a}}else{if("cubic-bezier"!==o[0])return e.error("Unknown interpolation type "+String(o[0]),1,0);var s=o.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,vf)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=bf:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p<r.length;p+=2){var h=r[p],d=r[p+1],c=p+3,g=p+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',c);var f=e.parse(d,g,u);if(!f)return null;u=u||f.type,l.push([h,f])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new rv(u,i,o,n,l):e.error("Type "+Ef(u)+" is not interpolatable.")},rv.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);var r=Dm(e,o),a=e[r],s=e[r+1],l=rv.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?Vm[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?nv.reverse(nv.interpolate(nv.forward(u),nv.forward(p),l)):ov.reverse(ov.interpolate(ov.forward(u),ov.forward(p),l))},rv.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},rv.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},rv.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var sv=rv,lv=function(t,e){this.type=t,this.args=e};lv.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,o=e.expectedType;o&&"value"!==o.kind&&(i=o);for(var n=[],r=0,a=t.slice(1);r<a.length;r+=1){var s=a[r],l=e.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var u=o&&n.some((function(t){return Pf(o,t.type)}));return new lv(u?kf:i,n)},lv.prototype.evaluate=function(t){for(var e,i=null,o=0,n=0,r=this.args;n<r.length;n+=1){if(o++,(i=r[n].evaluate(t))&&i instanceof Lf&&!i.available&&(e||(e=i),i=null,o===this.args.length))return e;if(null!==i)break}return i},lv.prototype.eachChild=function(t){this.args.forEach(t)},lv.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},lv.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var uv=lv,pv=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};pv.prototype.evaluate=function(t){return this.result.evaluate(t)},pv.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1){t(i[e][1])}t(this.result)},pv.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],o=1;o<t.length-1;o+=2){var n=t[o];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",o);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",o);var r=e.parse(t[o+1],o+1);if(!r)return null;i.push([n,r])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return a?new pv(i,a):null},pv.prototype.outputDefined=function(){return this.result.outputDefined()},pv.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t.push(n,r.serialize())}return t.push(this.result.serialize()),t};var hv=pv,dv=function(t,e,i){this.type=t,this.index=e,this.input=i};dv.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,vf),o=e.parse(t[2],2,zf(e.expectedType||kf));if(!i||!o)return null;var n=o.type;return new dv(n.itemType,i,o)},dv.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Xf("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new Xf("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new Xf("Array index must be an integer, but found "+e+" instead.");return i[e]},dv.prototype.eachChild=function(t){t(this.index),t(this.input)},dv.prototype.outputDefined=function(){return!1},dv.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cv=dv,gv=function(t,e){this.type=_f,this.needle=t,this.haystack=e};gv.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,kf),o=e.parse(t[2],2,kf);return i&&o?Of(i.type,[_f,yf,vf,mf,kf])?new gv(i,o):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ef(i.type)+" instead"):null},gv.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Ff(e,["boolean","string","number","null"]))throw new Xf("Expected first argument to be of type boolean, string, number or null, but found "+Ef(Bf(e))+" instead.");if(!Ff(i,["string","array"]))throw new Xf("Expected second argument to be of type array or string, but found "+Ef(Bf(i))+" instead.");return i.indexOf(e)>=0},gv.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},gv.prototype.outputDefined=function(){return!0},gv.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fv=gv,mv=function(t,e,i){this.type=vf,this.needle=t,this.haystack=e,this.fromIndex=i};mv.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,kf),o=e.parse(t[2],2,kf);if(!i||!o)return null;if(!Of(i.type,[_f,yf,vf,mf,kf]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ef(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,vf);return n?new mv(i,o,n):null}return new mv(i,o)},mv.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Ff(e,["boolean","string","number","null"]))throw new Xf("Expected first argument to be of type boolean, string, number or null, but found "+Ef(Bf(e))+" instead.");if(!Ff(i,["string","array"]))throw new Xf("Expected second argument to be of type array or string, but found "+Ef(Bf(i))+" instead.");if(this.fromIndex){var o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}return i.indexOf(e)},mv.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},mv.prototype.outputDefined=function(){return!1},mv.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var vv=mv,yv=function(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r};yv.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var n={},r=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var p=0,h=s;p<h.length;p+=1){var d=h[p];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Bf(d)))return null}else i=Bf(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=r.length}var c=e.parse(l,a,o);if(!c)return null;o=o||c.type,r.push(c)}var g=e.parse(t[1],1,kf);if(!g)return null;var f=e.parse(t[t.length-1],t.length-1,o);return f?"value"!==g.type.kind&&e.concat(1).checkSubtype(i,g.type)?null:new yv(i,o,g,n,r,f):null},yv.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Bf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},yv.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},yv.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},yv.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],o={},n=0,r=Object.keys(this.cases).sort();n<r.length;n+=1){var a=r[n];void 0===(h=o[this.cases[a]])?(o[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=i;l<u.length;l+=1){var p=u[l],h=p[0],d=p[1];1===d.length?e.push(s(d[0])):e.push(d.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var _v=yv,bv=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};bv.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=[],n=1;n<t.length-1;n+=2){var r=e.parse(t[n],n,_f);if(!r)return null;var a=e.parse(t[n+1],n+1,i);if(!a)return null;o.push([r,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new bv(i,o,s):null},bv.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];if(n.evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},bv.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t(n),t(r)}t(this.otherwise)},bv.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},bv.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var xv=bv,kv=function(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o};kv.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,kf),o=e.parse(t[2],2,vf);if(!i||!o)return null;if(!Of(i.type,[zf(kf),yf,kf]))return e.error("Expected first argument to be of type array or string, but found "+Ef(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,vf);return n?new kv(i.type,i,o,n):null}return new kv(i.type,i,o)},kv.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Ff(e,["string","array"]))throw new Xf("Expected first argument to be of type array or string, but found "+Ef(Bf(e))+" instead.");if(this.endIndex){var o=this.endIndex.evaluate(t);return e.slice(i,o)}return e.slice(i)},kv.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},kv.prototype.outputDefined=function(){return!1},kv.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var wv=kv;function Sv(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Cv(t,e,i,o){return 0===o.compare(e,i)}function zv(t,e,i){var o="=="!==t&&"!="!==t;return function(){function n(t,e,i){this.type=_f,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],r=e.parse(t[1],1,kf);if(!r)return null;if(!Sv(i,r.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+Ef(r.type)+"'.");var a=e.parse(t[2],2,kf);if(!a)return null;if(!Sv(i,a.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+Ef(a.type)+"'.");if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Ef(r.type)+"' and '"+Ef(a.type)+"'.");o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new Zf(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new Zf(r.type,[a])));var s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,wf)))return null}return new n(r,a,s)},n.prototype.evaluate=function(n){var r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){var s=Bf(r),l=Bf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Xf('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=Bf(r),p=Bf(a);if("string"!==u.kind||"string"!==p.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}var Ev=zv("==",(function(t,e,i){return e===i}),Cv),Tv=zv("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!Cv(0,e,i,o)})),Pv=zv("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),Ov=zv(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),Fv=zv("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),Rv=zv(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0})),Mv=function(t,e,i,o,n){this.type=yf,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n};Mv.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,vf);if(!i)return null;var o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");var n=null;if(o.locale&&!(n=e.parse(o.locale,1,yf)))return null;var r=null;if(o.currency&&!(r=e.parse(o.currency,1,yf)))return null;var a=null;if(o["min-fraction-digits"]&&!(a=e.parse(o["min-fraction-digits"],1,vf)))return null;var s=null;return o["max-fraction-digits"]&&!(s=e.parse(o["max-fraction-digits"],1,vf))?null:new Mv(i,n,r,a,s)},Mv.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mv.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mv.prototype.outputDefined=function(){return!1},Mv.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Iv=Mv,jv=function(t){this.type=vf,this.input=t};jv.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+Ef(i.type)+" instead."):new jv(i):null},jv.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Xf("Expected value to be of type string or array, but found "+Ef(Bf(e))+" instead.")},jv.prototype.eachChild=function(t){t(this.input)},jv.prototype.outputDefined=function(){return!1},jv.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Dv={"==":Ev,"!=":Tv,">":Ov,"<":Pv,">=":Rv,"<=":Fv,array:Zf,at:cv,boolean:Zf,case:xv,coalesce:uv,collator:um,format:$f,image:Qf,in:fv,"index-of":vv,interpolate:sv,"interpolate-hcl":sv,"interpolate-lab":sv,length:jv,let:hv,literal:Wf,match:_v,number:Zf,"number-format":Iv,object:Zf,slice:wv,step:Lm,string:Zf,"to-boolean":im,"to-color":im,"to-number":im,"to-string":im,var:Rm,within:Em};function Av(t,e){var i=e[0],o=e[1],n=e[2],r=e[3];i=i.evaluate(t),o=o.evaluate(t),n=n.evaluate(t);var a=r?r.evaluate(t):1,s=Gf(i,o,n,a);if(s)throw new Xf(s);return new of(i/255*a,o/255*a,n/255*a,a)}function Lv(t,e){return t in e}function Gv(t,e){var i=e[t];return void 0===i?null:i}function Nv(t){return{type:t}}sm.register(Dv,{error:[{kind:"error"},[yf],function(t,e){var i=e[0];throw new Xf(i.evaluate(t))}],typeof:[yf,[kf],function(t,e){return Ef(Bf(e[0].evaluate(t)))}],"to-rgba":[zf(vf,4),[bf],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[bf,[vf,vf,vf],Av],rgba:[bf,[vf,vf,vf,vf],Av],has:{type:_f,overloads:[[[yf],function(t,e){return Lv(e[0].evaluate(t),t.properties())}],[[yf,xf],function(t,e){var i=e[0],o=e[1];return Lv(i.evaluate(t),o.evaluate(t))}]]},get:{type:kf,overloads:[[[yf],function(t,e){return Gv(e[0].evaluate(t),t.properties())}],[[yf,xf],function(t,e){var i=e[0],o=e[1];return Gv(i.evaluate(t),o.evaluate(t))}]]},"feature-state":[kf,[yf],function(t,e){return Gv(e[0].evaluate(t),t.featureState||{})}],properties:[xf,[],function(t){return t.properties()}],"geometry-type":[yf,[],function(t){return t.geometryType()}],id:[kf,[],function(t){return t.id()}],zoom:[vf,[],function(t){return t.globals.zoom}],pitch:[vf,[],function(t){return t.globals.pitch||0}],"distance-from-center":[vf,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[vf,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[vf,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[vf,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[kf,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[vf,Nv(vf),function(t,e){for(var i=0,o=0,n=e;o<n.length;o+=1){i+=n[o].evaluate(t)}return i}],"*":[vf,Nv(vf),function(t,e){for(var i=1,o=0,n=e;o<n.length;o+=1){i*=n[o].evaluate(t)}return i}],"-":{type:vf,overloads:[[[vf,vf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)-o.evaluate(t)}],[[vf],function(t,e){return-e[0].evaluate(t)}]]},"/":[vf,[vf,vf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)/o.evaluate(t)}],"%":[vf,[vf,vf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)%o.evaluate(t)}],ln2:[vf,[],function(){return Math.LN2}],pi:[vf,[],function(){return Math.PI}],e:[vf,[],function(){return Math.E}],"^":[vf,[vf,vf],function(t,e){var i=e[0],o=e[1];return Math.pow(i.evaluate(t),o.evaluate(t))}],sqrt:[vf,[vf],function(t,e){var i=e[0];return Math.sqrt(i.evaluate(t))}],log10:[vf,[vf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[vf,[vf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))}],log2:[vf,[vf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[vf,[vf],function(t,e){var i=e[0];return Math.sin(i.evaluate(t))}],cos:[vf,[vf],function(t,e){var i=e[0];return Math.cos(i.evaluate(t))}],tan:[vf,[vf],function(t,e){var i=e[0];return Math.tan(i.evaluate(t))}],asin:[vf,[vf],function(t,e){var i=e[0];return Math.asin(i.evaluate(t))}],acos:[vf,[vf],function(t,e){var i=e[0];return Math.acos(i.evaluate(t))}],atan:[vf,[vf],function(t,e){var i=e[0];return Math.atan(i.evaluate(t))}],min:[vf,Nv(vf),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[vf,Nv(vf),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[vf,[vf],function(t,e){var i=e[0];return Math.abs(i.evaluate(t))}],round:[vf,[vf],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[vf,[vf],function(t,e){var i=e[0];return Math.floor(i.evaluate(t))}],ceil:[vf,[vf],function(t,e){var i=e[0];return Math.ceil(i.evaluate(t))}],"filter-==":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1];return t.properties()[i.value]===o.value}],"filter-id-==":[_f,[kf],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[_f,[yf],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<r}],"filter-id-<":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<n}],"filter->":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>r}],"filter-id->":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>n}],"filter-<=":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<=n}],"filter->=":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>=n}],"filter-has":[_f,[kf],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[_f,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[_f,[zf(yf)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[_f,[zf(kf)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[_f,[yf,zf(kf)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[_f,[yf,zf(kf)],function(t,e){var i=e[0],o=e[1];return function(t,e,i,o){for(;i<=o;){var n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[i.value],o.value,0,o.value.length-1)}],all:{type:_f,overloads:[[[_f,_f],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)&&o.evaluate(t)}],[Nv(_f),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(!o[i].evaluate(t))return!1}return!0}]]},any:{type:_f,overloads:[[[_f,_f],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)||o.evaluate(t)}],[Nv(_f),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(o[i].evaluate(t))return!0}return!1}]]},"!":[_f,[_f],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[_f,[yf],function(t,e){var i=e[0],o=t.globals&&t.globals.isSupportedScript;return!o||o(i.evaluate(t))}],upcase:[yf,[yf],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[yf,[yf],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[yf,Nv(kf),function(t,e){return e.map((function(e){return Vf(e.evaluate(t))})).join("")}],"resolved-locale":[yf,[wf],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Bv=Dv;function Vv(t){return{result:"success",value:t}}function qv(t){return{result:"error",value:t}}function Wv(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}var Uv=function(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new rm,this._defaultValue=e?"color"===(i=e).type&&Wv(i.default)?new of(0,0,0,0):"color"===i.type?of.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Xv(t,e){var i=new Im(Bv,[],e?function(t){var e={color:bf,string:yf,number:vf,enum:yf,boolean:_f,formatted:Sf,resolvedImage:Cf};if("array"===t.type)return zf(e[t.value]||kf,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Vv(new Uv(o,e)):qv(i.errors)}Uv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)},Uv.prototype.evaluate=function(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var l=this.expression.evaluate(this._evaluator);if(null==l||"number"==typeof l&&l!=l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new Xf("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(l)+" instead.");return l}catch(T_){return this._warningHistory[T_.message]||(this._warningHistory[T_.message]=!0,"undefined"!=typeof console&&console.warn(T_.message)),this._defaultValue}};var Kv=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Pm(e.expression)};Kv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Kv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)};var Yv=function(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Pm(e.expression),this.interpolationType=o};function Zv(t,e){if("error"===(t=Xv(t,e)).result)return t;var i,o=t.value.expression,n=Tm(o);if(!n&&("data-driven"!==(i=e)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return qv([new cf("","data expressions not supported")]);var r=Om(o,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return qv([new cf("","zoom expressions not supported")]);var a=Hv(o);if(!a&&!r)return qv([new cf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof cf)return qv([a]);if(a instanceof sv&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return qv([new cf("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Vv(new Kv(n?"constant":"source",t.value));var s=a instanceof sv?a.interpolation:void 0;return Vv(new Yv(n?"camera":"composite",t.value,a.labels,s))}function Hv(t){var e=null;if(t instanceof hv)e=Hv(t.result);else if(t instanceof uv)for(var i=0,o=t.args;i<o.length;i+=1){var n=o[i];if(e=Hv(n))break}else(t instanceof Lm||t instanceof sv)&&t.input instanceof sm&&"zoom"===t.input.name&&(e=t);return e instanceof cf||t.eachChild((function(t){var i=Hv(t);i instanceof cf?e=i:!e&&i?e=new cf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new cf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function $v(t){if(Array.isArray(t))return t.map($v);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=$v(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}Yv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Yv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)},Yv.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?sv.interpolationFactor(this.interpolationType,t,e,i):0};var Jv={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Qv(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var o=i[e];if(!Qv(o)&&"boolean"!=typeof o)return!1}return!0;default:return!0}}function ty(t,e){if(void 0===e&&(e="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};Qv(t)||(t=sy(t));var i=t,o=!0;try{o=function(t){if(!oy(t))return t;var e=$v(t);return iy(e),e=ey(e)}(i)}catch(T_){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(i,null,2)+"\n ")}var n=Jv["filter_"+e],r=Xv(o,n),a=null;if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));a=function(t,e,i){return r.value.evaluate(t,e,{},i)};var s=null,l=null;if(o!==i){var u=Xv(i,n);if("error"===u.result)throw new Error(u.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,e,i,o,n){return u.value.evaluate(t,e,{},i,void 0,void 0,o,n)},l=!Tm(u.value.expression)}return{filter:a=a,dynamicFilter:s||void 0,needGeometry:ay(o),needFeature:!!l}}function ey(t){if(!Array.isArray(t))return t;var e=function(t){if(ny.has(t[0]))for(var e=1;e<t.length;e++){if(oy(t[e]))return!0}return t}(t);return!0===e?e:e.map((function(t){return ey(t)}))}function iy(t){var e=!1,i=[];if("case"===t[0]){for(var o=1;o<t.length-1;o+=2)e=e||oy(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||oy(t[1]);for(var n=2;n<t.length-1;n+=2)i.push(t[n+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||oy(t[1]);for(var r=1;r<t.length-1;r+=2)i.push(t[r+1])}e&&(t.length=0,t.push.apply(t,["any"].concat(i)));for(var a=1;a<t.length;a++)iy(t[a])}function oy(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;for(var e,i=1;i<t.length;i++){if(oy(t[i]))return!0}return!1}var ny=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ry(t,e){return t<e?-1:t>e?1:0}function ay(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(ay(t[e]))return!0;return!1}function sy(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?ly(t[1],t[2],"=="):"!="===i?hy(ly(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?ly(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(sy))):"all"===i?["all"].concat(t.slice(1).map(sy)):"none"===i?["all"].concat(t.slice(1).map(sy).map(hy)):"in"===i?uy(t[1],t.slice(2)):"!in"===i?hy(uy(t[1],t.slice(2))):"has"===i?py(t[1]):"!has"===i?hy(py(t[1])):"within"!==i||t}function ly(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function uy(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ry)]]:["filter-in-small",t,["literal",e]]}}function py(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function hy(t){return["!",t]}var dy=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function cy(t,e){var i={};for(var o in t)"ref"!==o&&(i[o]=t[o]);return dy.forEach((function(t){t in e&&(i[t]=e[t])})),i}var gy={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},fy=" ",my=/(italic|oblique)$/i,vy={},yy=function(t,e,i){var o=vy[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var h in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):my.test(p)&&(p=p.replace(my,""),r=u[u.length-1].replace(p,"")),gy){var d=u.length>1?u[u.length-2].toLowerCase():"";if(p==h||p==h.replace("-","")||d+"-"+p==h){n=gy[h],u.pop(),d&&h.startsWith(d)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(fy).replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(fy)&&(c='"'+c+'"'),a.push(c)}o=vy[t]=[r,n,a]}return o[0]+fy+o[1]+fy+e+"px"+(i?"/"+i:"")+fy+o[2]};function _y(t){return t*Math.PI/180}var by=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function xy(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var ky,wy=Array(256).join(" ");function Sy(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=wy.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function Cy(){return ky||(ky=xy(1,1).getContext("2d")),ky}function zy(t,e){return Cy().measureText(t).width+(t.length-1)*e}var Ey={};function Ty(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(Ty(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=Ey[l];if(!u){var p=t.split(" ");if(p.length>1){var h=Cy();h.font=e;for(var d=h.measureText("M").width*i,c="",g=[],f=0,m=p.length;f<m;++f){var v=p[f],y=c+(c?" ":"")+v;zy(y,o)<=d?c=y:(c&&g.push(c),c=v)}c&&g.push(c);for(var _=0,b=g.length;_<b&&b>1;++_){var x=g[_];if(zy(x,o)<.35*d){var k=_>0?zy(g[_-1],o):1/0,w=_<b-1?zy(g[_+1],o):1/0;g.splice(_,1),b-=1,k<w?(g[_-1]+=" "+x,_-=1):g[_]=x+" "+g[_]}}for(var S=0,C=g.length-1;S<C;++S){var z=g[S],E=g[S+1];if(zy(z,o)>.7*d&&zy(E,o)<.6*d){var T=z.split(" "),P=T.pop();zy(P,o)<.2*d&&(g[S]=T.join(" "),g[S+1]=P+" "+E),C-=1}}u=g.join("\n")}else u=t;u=Sy(u,o),Ey[l]=u}return u}var Py,Oy,Fy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Ry={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},My={},Iy={zoom:0};function jy(t,e,i,o,n,r,a){var s=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[s]||(r[s]={});var l,u=r[s];if(!u[i]){var p=(t[e]||My)[i],h=Jv[e+"_"+t.type][i];void 0===p&&(p=h.default);var d=(l=p,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in Bv);if(!d&&Wv(p)&&(p=rf(p,h),d=!0),d){var c=function(t,e){var i=Zv(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(p,h);u[i]=c.evaluate.bind(c)}else"color"==h.type&&(p=of.parse(p)),u[i]=function(){return p}}return Iy.zoom=o,u[i](Iy,n,a)}function Dy(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=ty(e).filter),Iy.zoom=o,n[t](Iy,i)}function Ay(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Ly=/^([^]*)\{(.*)\}([^]*)$/;function Gy(t,e){var i;do{if(i=t.match(Ly)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function Ny(t,e,i,o,n,r,a){if(void 0===o&&(o=by),void 0===n&&(n=void 0),void 0===r&&(r=void 0),void 0===a&&(a=void 0),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var h,d=function(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var o=0;o<t.length;o++)"ref"in t[o]&&(t[o]=cy(t[o],e[t[o].ref]));return t}(e.layers),c={},g=[],f={},m={},v={},y={},_=0,b=d.length;_<b;++_){var x=d[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(h){if(x.source!==h)throw new Error('Layer "'+k+'" does not use source "'+h)}else{h=x.source;var S=e.sources[h];if(!S)throw new Error('Source "'+h+'" is not defined');var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'+h+'" is not of type "vector" or "geojson", but "'+C+'"')}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),g.push(k)}}var E=new rl,T=new Ls,P=[],O=function(e,i){var r=e.getProperties(),u=c[r.layer];if(u){var p=o.indexOf(i);-1==p&&(p=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(i,o));for(var h=Fy[e.getGeometry().getType()],d={properties:r,type:h},g=t.get("mapbox-featurestate")[e.getId()],_=-1,b=0,x=u.length;b<x;++b){var k=u[b],w=k.layer,S=w.id,C=w.layout||My,z=w.paint||My;if(!("none"===C.visibility||"minzoom"in w&&p<w.minzoom||"maxzoom"in w&&p>=w.maxzoom)){var O=w.filter;if(!O||Dy(S,O,d,p,y)){var F=void 0,R=void 0,M=void 0,I=void 0,j=void 0,D=void 0,A=k.index;if(3==h&&("fill"==w.type||"fill-extrusion"==w.type))if(R=jy(w,"paint",w.type+"-opacity",p,d,v,g),w.type+"-pattern"in z){var L=jy(w,"paint",w.type+"-pattern",p,d,v,g);if(L){var G="string"==typeof L?Gy(L,r):L.toString();if(s&&n&&n[G]){++_,(D=P[_])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new ml({fill:new Ls}),P[_]=D),M=D.getFill(),D.setZIndex(A);var N=G+"."+R,B=m[N];if(!B){var V=n[G],q=xy(V.width,V.height),W=q.getContext("2d");W.globalAlpha=R,W.drawImage(s,V.x,V.y,V.width,V.height,0,0,V.width,V.height),B=W.createPattern(q,"repeat"),m[N]=B}M.setColor(B)}}}else F=Ay(jy(w,"paint",w.type+"-color",p,d,v,g),R),w.type+"-outline-color"in z&&(j=Ay(jy(w,"paint",w.type+"-outline-color",p,d,v,g),R)),j||(j=F),(F||j)&&(++_,(!(D=P[_])||F&&!D.getFill()||!F&&D.getFill()||j&&!D.getStroke()||!j&&D.getStroke()||D.getText())&&(D=new ml({fill:F?new Ls:void 0,stroke:j?new rl:void 0}),P[_]=D),F&&(M=D.getFill()).setColor(F),j&&((I=D.getStroke()).setColor(j),I.setWidth(.5)),D.setZIndex(A));if(1!=h&&"line"==w.type){F=!("line-pattern"in z)&&"line-color"in z?Ay(jy(w,"paint","line-color",p,d,v,g),jy(w,"paint","line-opacity",p,d,v,g)):void 0;var U=jy(w,"paint","line-width",p,d,v,g);F&&U>0&&(++_,(D=P[_])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new ml({stroke:new rl}),P[_]=D),(I=D.getStroke()).setLineCap(jy(w,"layout","line-cap",p,d,v,g)),I.setLineJoin(jy(w,"layout","line-join",p,d,v,g)),I.setMiterLimit(jy(w,"layout","line-miter-limit",p,d,v,g)),I.setColor(F),I.setWidth(U),I.setLineDash(z["line-dasharray"]?jy(w,"paint","line-dasharray",p,d,v,g).map((function(t){return t*U})):null),D.setZIndex(A))}var X=!1,K=null,Y=0,Z=void 0,H=void 0,$=void 0;if((1==h||2==h)&&"icon-image"in C){var J=jy(w,"layout","icon-image",p,d,v,g);if(J){Z="string"==typeof J?Gy(J,r):J.toString();var Q=void 0;if(s&&n&&n[Z]){var tt=jy(w,"layout","icon-rotation-alignment",p,d,v,g);if(2==h){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var it=et.getExtent();if(Math.sqrt(Math.max(Math.pow((it[2]-it[0])/i,2),Math.pow((it[3]-it[1])/i,2)))>150){var ot="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(Oy||(Oy=new Ul("Point",Py=[NaN,NaN],[],{},null)),Q=Oy,Py[0]=ot[0],Py[1]=ot[1],"line"===jy(w,"layout","symbol-placement",p,d,v,g)&&"map"===tt)for(var nt=et.getStride(),rt=et.getFlatCoordinates(),at=0,st=rt.length-nt;at<st;at+=nt){var lt=rt[at],ut=rt[at+1],pt=rt[at+nt],ht=rt[at+nt+1],dt=Math.min(lt,pt),ct=Math.min(ut,ht),gt=Math.max(lt,pt),ft=Math.max(ut,ht);if(ot[0]>=dt&&ot[0]<=gt&&ot[1]>=ct&&ot[1]<=ft){Y=Math.atan2(ut-ht,pt-lt);break}}}}}if(2!==h||Q){var mt=jy(w,"layout","icon-size",p,d,v,g),vt=void 0!==z["icon-color"]?jy(w,"paint","icon-color",p,d,v,g):null;if(!vt||0!==vt.a){var yt=Z+"."+mt;if(null!==vt&&(yt+="."+vt),!(H=f[yt])){var _t=n[Z];H=new nl({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[_t.width,_t.height],offset:[_t.x,_t.y],rotateWithView:"map"===tt,scale:mt/_t.pixelRatio,displacement:"icon-offset"in C?jy(w,"layout","icon-offset",p,d,v,g).map((function(t){return-t*_t.pixelRatio})):void 0}),f[yt]=H}}H&&(++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new ml,P[_]=D),D.setGeometry(Q),H.setRotation(Y+_y(jy(w,"layout","icon-rotate",p,d,v,g))),H.setOpacity(jy(w,"paint","icon-opacity",p,d,v,g)),H.setAnchor(Ry[jy(w,"layout","icon-anchor",p,d,v,g)]),D.setImage(H),K=D.getText(),D.setText(void 0),D.setZIndex(A),X=!0,$=!1)}else $=!0}}}if(1==h&&"circle"===w.type){++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new ml,P[_]=D);var bt="circle-radius"in z?jy(w,"paint","circle-radius",p,d,v,g):5,xt=Ay(jy(w,"paint","circle-stroke-color",p,d,v,g),jy(w,"paint","circle-stroke-opacity",p,d,v,g)),kt=Ay(jy(w,"paint","circle-color",p,d,v,g),jy(w,"paint","circle-opacity",p,d,v,g)),wt=jy(w,"paint","circle-stroke-width",p,d,v,g),St=bt+"."+xt+"."+kt+"."+wt;(H=f[St])||(H=new pl({radius:bt,stroke:xt&&wt>0?new rl({width:wt,color:xt}):void 0,fill:kt?new Ls({color:kt}):void 0}),f[St]=H),D.setImage(H),K=D.getText(),D.setText(void 0),D.setGeometry(void 0),D.setZIndex(A),X=!0}var Ct=void 0,zt=void 0,Et=void 0,Tt=void 0,Pt=void 0,Ot=void 0;if("text-field"in C){Tt=Math.round(jy(w,"layout","text-size",p,d,v,g));var Ft=jy(w,"layout","text-font",p,d,v,g);Et=jy(w,"layout","text-line-height",p,d,v,g),(zt=yy(a?a(Ft):Ft,Tt,Et)).includes("sans-serif")||(zt+=",sans-serif"),Pt=jy(w,"layout","text-letter-spacing",p,d,v,g),Ot=jy(w,"layout","text-max-width",p,d,v,g);var Rt=jy(w,"layout","text-field",p,d,v,g);Ct="object"==typeof Rt&&Rt.sections?1===Rt.sections.length?Rt.toString():Rt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):Ft,n=yy(a?a(o):o,Tt*(e.scale||1),Et),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=h){for(var s=0,l=(r=Ty(r,n,Ot,Pt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(Sy(r,Pt),n)}),[]):Gy(Rt,r).trim(),R=jy(w,"paint","text-opacity",p,d,v,g)}if(Ct&&R&&!$){X||(++_,(D=P[_])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new ml,P[_]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(K||new _l({padding:[2,2,2,2]})),K=D.getText();var Mt=C["text-transform"];"uppercase"==Mt?Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toUpperCase()})):Ct.toUpperCase():"lowercase"==Mt&&(Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toLowerCase()})):Ct.toLowerCase());var It=Array.isArray(Ct)?Ct:2==h?Sy(Ct,Pt):Ty(Ct,zt,Ot,Pt);K.setText(It),K.setFont(zt),K.setRotation(_y(jy(w,"layout","text-rotate",p,d,v,g)));var jt=jy(w,"layout","text-anchor",p,d,v,g),Dt=X||1==h?"point":jy(w,"layout","symbol-placement",p,d,v,g);K.setPlacement(Dt),K.setOverflow("point"===Dt);var At=jy(w,"paint","text-halo-width",p,d,v,g),Lt=jy(w,"layout","text-offset",p,d,v,g),Gt=jy(w,"paint","text-translate",p,d,v,g),Nt=0,Bt=0;if("point"==Dt){var Vt="center";-1!==jt.indexOf("left")?(Vt="left",Bt=At):-1!==jt.indexOf("right")&&(Vt="right",Bt=-At),K.setTextAlign(Vt);var qt=jy(w,"layout","text-rotation-alignment",p,d,v,g);K.setRotateWithView("map"==qt)}else K.setMaxAngle(_y(jy(w,"layout","text-max-angle",p,d,v,g))*Ct.length/It.length),K.setTextAlign(),K.setRotateWithView(!1);var Wt="middle";0==jt.indexOf("bottom")?(Wt="bottom",Nt=-At-.5*(Et-1)*Tt):0==jt.indexOf("top")&&(Wt="top",Nt=At+.5*(Et-1)*Tt),K.setTextBaseline(Wt),K.setOffsetX(Lt[0]*Tt+Bt+Gt[0]),K.setOffsetY(Lt[1]*Tt+Nt+Gt[1]),T.setColor(Ay(jy(w,"paint","text-color",p,d,v,g),R)),K.setFill(T);var Ut=Ay(jy(w,"paint","text-halo-color",p,d,v,g),R);if(Ut){E.setColor(Ut),At*=2;var Xt=.5*Tt;E.setWidth(At<=Xt?At:Xt),K.setStroke(E)}else K.setStroke(void 0);var Kt=jy(w,"layout","text-padding",p,d,v,g),Yt=K.getPadding();Kt!==Yt[0]&&(Yt[0]=Kt,Yt[1]=Kt,Yt[2]=Kt,Yt[3]=Kt),D.setZIndex(A)}}}}return _>-1?(P.length=_+1,P):void 0}};return t.setStyle(O),t.set("mapbox-source",h),t.set("mapbox-layers",g),t.set("mapbox-featurestate",{}),O}new As;s`.ol-box {
44
+ var Hc=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function $c(t,e){return t>e?1:t<e?-1:0}function Jc(t,e,i){for(var o=new Hc(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Qc(t,e,i,o){var n=new Hc(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Jc(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function tg(t,e,i){var o=null,n=null;if(e){var r=i((e=Jc(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function eg(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&eg(t.left,r,!1,o,n),t.right&&eg(t.right,r,!0,o,n)}}var ig=function(){function t(t){void 0===t&&(t=$c),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Qc(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Hc(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Jc(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var o;return null===e?null:0===i(t,(e=Jc(t,e,i)).key)?(null===e.left?o=e.right:(o=Jc(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Jc(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Jc(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],o=!1,n=new Hc(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&rg(t,e,0,o-1,n),null===this._root)this._root=og(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Hc(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Hc(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Hc(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=ng({head:r},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return eg(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=tg(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Qc(e,i,a,o):r=Qc(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Jc(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return tg(t,this._root,this._comparator)},t}();function og(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Hc(a,s);return l.left=og(t,e,i,r),l.right=og(t,e,r+1,o),l}return null}function ng(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=ng(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=ng(t,n+1,i),a}return null}function rg(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}rg(t,e,i,s,n),rg(t,e,s+1,o,n)}}function ag(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sg(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function lg(t,e,i){return e&&sg(t.prototype,e),i&&sg(t,i),t}var ug=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},pg=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,o=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},hg=Number.EPSILON;void 0===hg&&(hg=Math.pow(2,-52));var dg=hg*hg,cg=function(t,e){if(-hg<t&&t<hg&&-hg<e&&e<hg)return 0;var i=t-e;return i*i<dg*t*e?0:t<e?-1:1},gg=function(){function t(){ag(this,t),this.reset()}return lg(t,[{key:"reset",value:function(){this.xRounder=new fg,this.yRounder=new fg}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),fg=function(){function t(){ag(this,t),this.tree=new ig,this.round(0)}return lg(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===cg(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===cg(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),mg=new gg,vg=function(t,e){return t.x*e.y-t.y*e.x},yg=function(t,e){return t.x*e.x+t.y*e.y},_g=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=vg(o,n);return cg(r,0)},bg=function(t){return Math.sqrt(yg(t,t))},xg=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return yg(n,o)/bg(n)/bg(o)},kg=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},wg=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},Sg=function(){function t(e,i){ag(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return lg(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:zg.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),lg(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},vg(l,s)/bg(l)/bg(s)),cosine:xg(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),Cg=0,zg=function(){function t(e,i,o,n){ag(this,t),this.id=++Cg,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return lg(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var d=e.comparePoint(t.leftSE.point);if(0!==d)return d;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var g=e.comparePoint(t.rightSE.point);if(0!==g)return g}if(n>r){var f=t.comparePoint(e.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),lg(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=pg(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=ug(e,a)&&0===this.comparePoint(a),u=ug(i,n)&&0===t.comparePoint(n),p=ug(e,s)&&0===this.comparePoint(s),h=ug(i,r)&&0===t.comparePoint(r);if(u&&l)return h&&!p?r:!h&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return h&&r.x===a.x&&r.y===a.y?null:a;if(h&&p)return null;if(h)return r;if(p)return s;var d=function(t,e,i,o){if(0===e.x)return wg(i,o,t.x);if(0===o.x)return wg(t,e,i.x);if(0===e.y)return kg(i,o,t.y);if(0===o.y)return kg(t,e,i.y);var n=vg(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=vg(r,e)/n,s=vg(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===d?null:ug(o,d)?mg.round(d.x,d.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new Sg(e,!0),r=new Sg(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return Sg.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Sg.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],h=i.rings.indexOf(u);-1===h?(i.rings.push(u),i.windings.push(p)):i.windings[h]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],h=0,d=e.length;h<d;h++)if(0!==i[h]){var c=e[h],g=c.poly;if(-1===p.indexOf(g))if(c.isExterior)u.push(g);else{-1===p.indexOf(g)&&p.push(g);var f=u.indexOf(c.poly);-1!==f&&u.splice(f,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Dg.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Dg.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(Dg.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=Sg.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new Sg(n,!0),new Sg(r,!1),[o],[a])}}]),t}(),Eg=function(){function t(e,i,o){if(ag(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=o,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=mg.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=mg.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(zg.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(zg.fromRing(r,n,this))}return lg(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),Tg=function(){function t(e,i){if(ag(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Eg(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,n=e.length;o<n;o++){var r=new Eg(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return lg(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Pg=function(){function t(e,i){if(ag(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new Tg(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return lg(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Og=function(){function t(e){ag(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return lg(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,h=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var d=s.getAvailableLinkedEvents();if(0===d.length){var c=u[0].point,g=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(g.x,", ").concat(g.y,"]."))}if(1===d.length){l=d[0].otherSE;break}for(var f=null,m=0,v=h.length;m<v;m++)if(h[m].point===s.point){f=m;break}if(null===f){h.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=d.sort(y)[0].otherSE;break}var _=h.splice(f)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),lg(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==_g(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===_g(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,h=[],d=u;d!=p;d+=l)h.push([e[d].x,e[d].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var o=this.events[e];Sg.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),Fg=function(){function t(e){ag(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return lg(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),Rg=function(){function t(e){ag(this,t),this.rings=e,this.polys=this._composePolys(e)}return lg(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new Fg(n));else{var r=n.enclosingRing();r.poly||e.push(new Fg(r)),r.poly.addInterior(n)}}return e}}]),t}(),Mg=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zg.compare;ag(this,t),this.queue=e,this.tree=new ig(i),this.segments=[]}return lg(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),h=0,d=p.length;h<d;h++)i.push(p[h])}var c=null;if(s){var g=s.getIntersection(e);if(null!==g&&(e.isAnEndpoint(g)||(c=g),!s.isAnEndpoint(g)))for(var f=this._splitSafely(s,g),m=0,v=f.length;m<v;m++)i.push(f[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=Sg.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),E=0,T=z.length;E<T;E++)i.push(z[E])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),Ig="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,jg="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Dg=new(function(){function t(){ag(this,t)}return lg(t,[{key:"run",value:function(t,e,i){Dg.type=t,mg.reset();for(var o=[new Pg(e,!0)],n=0,r=i.length;n<r;n++)o.push(new Pg(i[n],!1));if(Dg.numMultiPolys=o.length,"difference"===Dg.type)for(var a=o[0],s=1;s<o.length;)null!==pg(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===Dg.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],h=l+1,d=o.length;h<d;h++)if(null===pg(p.bbox,o[h].bbox))return[];for(var c=new ig(Sg.compare),g=0,f=o.length;g<f;g++)for(var m=o[g].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>Ig)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new Mg(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>Ig)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>jg)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var E=S[C];void 0===E.consumedBy&&c.insert(E)}b=c.size,x=c.pop()}mg.reset();var T=Og.factory(_.segments);return new Rg(T).getGeom()}}]),t}()),Ag=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Dg.run("union",t,i)};function Lg(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Gg(t){return"Feature"===t.type?t.geometry:t}function Ng(t,e,i){void 0===i&&(i={});var o=Gg(t),n=Gg(e),r=Ag(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return Lg({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Lg({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function Bg(t,e){const i=No(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Vg(t,e,i){const o=e.getExtent();return t.getView().fit(Zi(o,i))}function qg(t,e){const[i,o,n]=Array.from(On(t));return zn([i,o,n,e])}const Wg="https://api.os.uk/features/v1/wfs",Ug=new qp,Xg=new qp;function Kg(t,e,i){const o=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,a=an(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=Le(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`${Wg}?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new Ns,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Ug.getFeatureById(e);i?Ug.removeFeature(i):(t.setId(e),Ug.addFeature(t))})):(Ug.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Ug.addFeature(t)}))),Xg.clear(),Xg.addFeature(n.readFeature(Ug.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Ng(t,i):i}),null)))})).catch((t=>console.log(t)))}var Yg,Zg={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Hg(t){return(t=Math.round(t))<0?0:t>255?255:t}function $g(t){return t<0?0:t>1?1:t}function Jg(t){return"%"===t[t.length-1]?Hg(parseFloat(t)/100*255):Hg(parseInt(t))}function Qg(t){return"%"===t[t.length-1]?$g(parseFloat(t)/100):$g(parseFloat(t))}function tf(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Yg={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in Zg)return Zg[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=i.indexOf("("),n=i.indexOf(")");if(-1!==o&&n+1===i.length){var r=i.substr(0,o),a=i.substr(o+1,n-(o+1)).split(","),s=1;switch(r){case"rgba":if(4!==a.length)return null;s=Qg(a.pop());case"rgb":return 3!==a.length?null:[Jg(a[0]),Jg(a[1]),Jg(a[2]),s];case"hsla":if(4!==a.length)return null;s=Qg(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=Qg(a[1]),p=Qg(a[2]),h=p<=.5?p*(u+1):p+u-p*u,d=2*p-h;return[Hg(255*tf(d,h,l+1/3)),Hg(255*tf(d,h,l)),Hg(255*tf(d,h,l-1/3)),s];default:return null}}return null}}catch(T_){}var ef=function(t,e,i,o){void 0===o&&(o=1),this.r=t,this.g=e,this.b=i,this.a=o};ef.parse=function(t){if(t){if(t instanceof ef)return t;if("string"==typeof t){var e=Yg(t);if(e)return new ef(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ef.prototype.toString=function(){var t=this.toArray(),e=t[0],i=t[1],o=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(o)+","+n+")"},ef.prototype.toArray=function(){var t=this,e=t.r,i=t.g,o=t.b,n=t.a;return 0===n?[0,0,0,0]:[255*e/n,255*i/n,255*o/n,n]},ef.black=new ef(0,0,0,1),ef.white=new ef(1,1,1,1),ef.transparent=new ef(0,0,0,0),ef.red=new ef(1,0,0,1),ef.blue=new ef(0,0,1,1);var of=ef;function nf(t){return"object"==typeof t?["literal",t]:t}function rf(t,e){var i=t.stops;if(!i)return function(t,e){var i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];var o=["color"===e.type?"to-color":e.type,i,nf(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}(t,e);var o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((function(t){return!n&&e.tokens&&"string"==typeof t[1]?[t[0],df(t[1])]:[t[0],nf(t[1])]})),o?function(t,e,i){for(var o={},n={},r=[],a=0;a<i.length;a++){var s=i[a],l=s[0].zoom;void 0===o[l]&&(o[l]={zoom:l,type:t.type,property:t.property,default:t.default},n[l]=[],r.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===hf({},e)){for(var u=[af(t),["linear"],["zoom"]],p=0,h=r;p<h.length;p+=1){var d=h[p];pf(u,d,lf(o[d],e,n[d]),!1)}return u}for(var c=["step",["zoom"]],g=0,f=r;g<f.length;g+=1){var m=f[g];pf(c,m,lf(o[m],e,n[m]),!0)}return uf(c),c}(t,e,i):r?function(t,e,i,o){void 0===o&&(o=["zoom"]);var n,r=hf(t,e),a=!1;if("interval"===r)n=["step",o],a=!0;else{if("exponential"!==r)throw new Error('Unknown zoom function type "'+r+'"');var s=void 0!==t.base?t.base:1;n=[af(t),1===s?["linear"]:["exponential",s],o]}for(var l=0,u=i;l<u.length;l+=1){var p=u[l];pf(n,p[0],p[1],a)}return uf(n),n}(t,e,i):lf(t,e,i)}function af(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function sf(t,e){var i,o,n=nf((i=t.default,o=e.default,void 0!==i?i:void 0!==o?o:void 0));return void 0===n&&"resolvedImage"===e.type?"":n}function lf(t,e,i){var o=hf(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){for(var r=["case"],a=0,s=i;a<s.length;a+=1){var l=s[a];r.push(["==",n,l[0]],l[1])}return r.push(sf(t,e)),r}if("categorical"===o){for(var u=["match",n],p=0,h=i;p<h.length;p+=1){var d=h[p];pf(u,d[0],d[1],!1)}return u.push(sf(t,e)),u}if("interval"===o){for(var c=["step",["number",n]],g=0,f=i;g<f.length;g+=1){var m=f[g];pf(c,m[0],m[1],!0)}return uf(c),void 0===t.default?c:["case",["==",["typeof",n],"number"],c,nf(t.default)]}if("exponential"===o){for(var v=void 0!==t.base?t.base:1,y=[af(t),1===v?["linear"]:["exponential",v],["number",n]],_=0,b=i;_<b.length;_+=1){var x=b[_];pf(y,x[0],x[1],!1)}return void 0===t.default?y:["case",["==",["typeof",n],"number"],y,nf(t.default)]}throw new Error("Unknown property function type "+o)}function uf(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function pf(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function hf(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function df(t){for(var e=["concat"],i=/{([^{}]+)}/g,o=0,n=i.exec(t);null!==n;n=i.exec(t)){var r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}var cf=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),gf=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,o=e;i<o.length;i+=1){var n=o[i],r=n[0],a=n[1];this.bindings[r]=a}};gf.prototype.concat=function(t){return new gf(this,t)},gf.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},gf.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var ff=gf,mf={kind:"null"},vf={kind:"number"},yf={kind:"string"},_f={kind:"boolean"},bf={kind:"color"},xf={kind:"object"},kf={kind:"value"},wf={kind:"collator"},Sf={kind:"formatted"},Cf={kind:"resolvedImage"};function zf(t,e){return{kind:"array",itemType:t,N:e}}function Ef(t){if("array"===t.kind){var e=Ef(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Tf=[mf,vf,yf,_f,bf,Sf,xf,zf(kf),Cf];function Pf(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Pf(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,o=Tf;i<o.length;i+=1){if(!Pf(o[i],e))return null}}return"Expected "+Ef(t)+" but found "+Ef(e)+" instead."}function Of(t,e){return e.some((function(e){return e.kind===t.kind}))}function Ff(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Rf=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Rf.prototype.compare=function(t,e){return this.collator.compare(t,e)},Rf.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Mf=Rf,If=function(t,e,i,o,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n},jf=function(t){this.sections=t};jf.fromString=function(t){return new jf([new If(t,null,null,null,null)])},jf.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},jf.factory=function(t){return t instanceof jf?t:jf.fromString(t)},jf.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},jf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];if(o.image)t.push(["image",o.image.name]);else{t.push(o.text);var n={};o.fontStack&&(n["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(n["font-scale"]=o.scale),o.textColor&&(n["text-color"]=["rgba"].concat(o.textColor.toArray())),t.push(n)}}return t};var Df=jf,Af=function(t){this.name=t.name,this.available=t.available};Af.prototype.toString=function(){return this.name},Af.fromString=function(t){return t?new Af({name:t,available:!1}):null},Af.prototype.serialize=function(){return["image",this.name]};var Lf=Af;function Gf(t,e,i,o){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:"Invalid rgba value ["+[t,e,i,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof o?[t,e,i,o]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Nf(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof of)return!0;if(t instanceof Mf)return!0;if(t instanceof Df)return!0;if(t instanceof Lf)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1){if(!Nf(i[e]))return!1}return!0}if("object"==typeof t){for(var o in t)if(!Nf(t[o]))return!1;return!0}return!1}function Bf(t){if(null===t)return mf;if("string"==typeof t)return yf;if("boolean"==typeof t)return _f;if("number"==typeof t)return vf;if(t instanceof of)return bf;if(t instanceof Mf)return wf;if(t instanceof Df)return Sf;if(t instanceof Lf)return Cf;if(Array.isArray(t)){for(var e,i=t.length,o=0,n=t;o<n.length;o+=1){var r=Bf(n[o]);if(e){if(e===r)continue;e=kf;break}e=r}return zf(e||kf,i)}return xf}function Vf(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof of||t instanceof Df||t instanceof Lf?t.toString():JSON.stringify(t)}var qf=function(t,e){this.type=t,this.value=e};qf.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!Nf(t[1]))return e.error("invalid value");var i=t[1],o=Bf(i),n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new qf(o,i)},qf.prototype.evaluate=function(){return this.value},qf.prototype.eachChild=function(){},qf.prototype.outputDefined=function(){return!0},qf.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof of?["rgba"].concat(this.value.toArray()):this.value instanceof Df?this.value.serialize():this.value};var Wf=qf,Uf=function(t){this.name="ExpressionEvaluationError",this.message=t};Uf.prototype.toJSON=function(){return this.message};var Xf=Uf,Kf={string:yf,number:vf,boolean:_f,object:xf},Yf=function(t,e){this.type=t,this.args=e};Yf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,o=1,n=t[0];if("array"===n){var r,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in Kf)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=Kf[s],o++}else r=kf;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],o++}i=zf(r,a)}else i=Kf[n];for(var l=[];o<t.length;o++){var u=e.parse(t[o],o,kf);if(!u)return null;l.push(u)}return new Yf(i,l)},Yf.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!Pf(this.type,Bf(i)))return i;if(e===this.args.length-1)throw new Xf("Expected value to be of type "+Ef(this.type)+", but found "+Ef(Bf(i))+" instead.")}return null},Yf.prototype.eachChild=function(t){this.args.forEach(t)},Yf.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Yf.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Zf=Yf,Hf=function(t){this.type=Sf,this.sections=t};Hf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var o=[],n=!1,r=1;r<=t.length-1;++r){var a=t[r];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,vf)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,zf(yf))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,bf)))return null;var p=o[o.length-1];p.scale=s,p.font=l,p.textColor=u}else{var h=e.parse(t[r],1,kf);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:h,scale:null,font:null,textColor:null})}}return new Hf(o)},Hf.prototype.evaluate=function(t){return new Df(this.sections.map((function(e){var i=e.content.evaluate(t);return Bf(i)===Cf?new If("",i,null,null,null):new If(Vf(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Hf.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t(o.content),o.scale&&t(o.scale),o.font&&t(o.font),o.textColor&&t(o.textColor)}},Hf.prototype.outputDefined=function(){return!1},Hf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t.push(o.content.serialize());var n={};o.scale&&(n["font-scale"]=o.scale.serialize()),o.font&&(n["text-font"]=o.font.serialize()),o.textColor&&(n["text-color"]=o.textColor.serialize()),t.push(n)}return t};var $f=Hf,Jf=function(t){this.type=Cf,this.input=t};Jf.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,yf);return i?new Jf(i):e.error("No image name provided.")},Jf.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=Lf.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},Jf.prototype.eachChild=function(t){t(this.input)},Jf.prototype.outputDefined=function(){return!1},Jf.prototype.serialize=function(){return["image",this.input.serialize()]};var Qf=Jf,tm={"to-boolean":_f,"to-color":bf,"to-number":vf,"to-string":yf},em=function(t,e){this.type=t,this.args=e};em.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var o=tm[i],n=[],r=1;r<t.length;r++){var a=e.parse(t[r],r,kf);if(!a)return null;n.push(a)}return new em(o,n)},em.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,o=0,n=this.args;o<n.length;o+=1){if(i=null,(e=n[o].evaluate(t))instanceof of)return e;if("string"==typeof e){var r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Gf(e[0],e[1],e[2],e[3])))return new of(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Xf(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new Xf("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Df.fromString(Vf(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Lf.fromString(Vf(this.args[0].evaluate(t))):Vf(this.args[0].evaluate(t))},em.prototype.eachChild=function(t){this.args.forEach(t)},em.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},em.prototype.serialize=function(){if("formatted"===this.type.kind)return new $f([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Qf(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var im=em,om=["Unknown","Point","LineString","Polygon"],nm=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};nm.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},nm.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?om[this.feature.type]:this.feature.type:null},nm.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},nm.prototype.canonicalID=function(){return this.canonical},nm.prototype.properties=function(){return this.feature&&this.feature.properties||{}},nm.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,e=this.featureDistanceData.scale,i=this.featureTileCoord,o=i.x,n=i.y,r=o*e-t[0],a=n*e-t[1];return this.featureDistanceData.bearing[0]*r+this.featureDistanceData.bearing[1]*a}return 0},nm.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=of.parse(t)),e};var rm=nm,am=function(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o};am.prototype.evaluate=function(t){return this._evaluate(t,this.args)},am.prototype.eachChild=function(t){this.args.forEach(t)},am.prototype.outputDefined=function(){return!1},am.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},am.parse=function(t,e){var i,o=t[0],n=am.definitions[o];if(!n)return e.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0);for(var r=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1})),l=null,u=0,p=s;u<p.length;u+=1){var h=p[u],d=h[0],c=h[1];l=new Im(e.registry,e.path,null,e.scope);for(var g=[],f=!1,m=1;m<t.length;m++){var v=t[m],y=Array.isArray(d)?d[m-1]:d.type,_=l.parse(v,1+g.length,y);if(!_){f=!0;break}g.push(_)}if(!f)if(Array.isArray(d)&&d.length!==g.length)l.error("Expected "+d.length+" arguments, but found "+g.length+" instead.");else{for(var b=0;b<g.length;b++){var x=Array.isArray(d)?d[b]:d.type,k=g[b];l.concat(b+1).checkSubtype(x,k.type)}if(0===l.errors.length)return new am(o,r,c,g)}}if(1===s.length)(i=e.errors).push.apply(i,l.errors);else{for(var w=(s.length?s:a).map((function(t){var e,i=t[0];return e=i,Array.isArray(e)?"("+e.map(Ef).join(", ")+")":"("+Ef(e.type)+"...)"})).join(" | "),S=[],C=1;C<t.length;C++){var z=e.parse(t[C],1+S.length);if(!z)return null;S.push(Ef(z.type))}e.error("Expected arguments of type "+w+", but found ("+S.join(", ")+") instead.")}return null},am.register=function(t,e){for(var i in am.definitions=e,e)t[i]=am};var sm=am,lm=function(t,e,i){this.type=wf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};lm.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,_f);if(!o)return null;var n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,_f);if(!n)return null;var r=null;return i.locale&&!(r=e.parse(i.locale,1,yf))?null:new lm(o,n,r)},lm.prototype.evaluate=function(t){return new Mf(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},lm.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},lm.prototype.outputDefined=function(){return!1},lm.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var um=lm,pm=8192;function hm(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function dm(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function cm(t,e){var i,o=(180+t[0])/360,n=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),r=Math.pow(2,e.z);return[Math.round(o*r*pm),Math.round(n*r*pm)]}function gm(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function fm(t,e){for(var i,o,n,r,a,s,l,u=!1,p=0,h=e.length;p<h;p++)for(var d=e[p],c=0,g=d.length;c<g-1;c++){if(i=t,o=d[c],n=d[c+1],r=void 0,a=void 0,s=void 0,l=void 0,r=i[0]-o[0],a=i[1]-o[1],s=i[0]-n[0],l=i[1]-n[1],r*l-s*a==0&&r*s<=0&&a*l<=0)return!1;gm(t,d[c],d[c+1])&&(u=!u)}return u}function mm(t,e){for(var i=0;i<e.length;i++)if(fm(t,e[i]))return!0;return!1}function vm(t,e,i,o){var n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,h=a*u-l*s;return p>0&&h<0||p<0&&h>0}function ym(t,e,i){for(var o=0,n=i;o<n.length;o+=1)for(var r=n[o],a=0;a<r.length-1;++a)if(s=t,l=e,u=r[a],p=r[a+1],h=void 0,d=void 0,c=void 0,g=void 0,c=[l[0]-s[0],l[1]-s[1]],g=[p[0]-u[0],p[1]-u[1]],0!=(h=g)[0]*(d=c)[1]-h[1]*d[0]&&vm(s,l,u,p)&&vm(u,p,s,l))return!0;var s,l,u,p,h,d,c,g;return!1}function _m(t,e){for(var i=0;i<t.length;++i)if(!fm(t[i],e))return!1;for(var o=0;o<t.length-1;++o)if(ym(t[o],t[o+1],e))return!1;return!0}function bm(t,e){for(var i=0;i<e.length;i++)if(_m(t,e[i]))return!0;return!1}function xm(t,e,i){for(var o=[],n=0;n<t.length;n++){for(var r=[],a=0;a<t[n].length;a++){var s=cm(t[n][a],i);hm(e,s),r.push(s)}o.push(r)}return o}function km(t,e,i){for(var o=[],n=0;n<t.length;n++){var r=xm(t[n],e,i);o.push(r)}return o}function wm(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){var n=.5*o,r=t[0]-i[0]>n?-o:i[0]-t[0]>n?o:0;0===r&&(r=t[0]-i[2]>n?-o:i[2]-t[0]>n?o:0),t[0]+=r}hm(e,t)}function Sm(t,e,i,o){var n=Math.pow(2,o.z)*pm,r=[o.x*pm,o.y*pm],a=[];if(!t)return a;for(var s=0,l=t;s<l.length;s+=1)for(var u=0,p=l[s];u<p.length;u+=1){var h=p[u],d=[h.x+r[0],h.y+r[1]];wm(d,e,i,n),a.push(d)}return a}function Cm(t,e,i,o){var n,r=Math.pow(2,o.z)*pm,a=[o.x*pm,o.y*pm],s=[];if(!t)return s;for(var l=0,u=t;l<u.length;l+=1){for(var p=[],h=0,d=u[l];h<d.length;h+=1){var c=d[h],g=[c.x+a[0],c.y+a[1]];hm(e,g),p.push(g)}s.push(p)}if(e[2]-e[0]<=r/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var f=0,m=s;f<m.length;f+=1)for(var v=0,y=m[f];v<y.length;v+=1){wm(y[v],e,i,r)}}return s}var zm=function(t,e){this.type=_f,this.geojson=t,this.geometries=e};zm.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Nf(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var o=0;o<i.features.length;++o){var n=i.features[o].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new zm(i,i.features[o].geometry)}else if("Feature"===i.type){var r=i.geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new zm(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new zm(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},zm.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=xm(e.coordinates,o,n),a=Sm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!fm(l[s],r))return!1}if("MultiPolygon"===e.type){var u=km(e.coordinates,o,n),p=Sm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!mm(d[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=xm(e.coordinates,o,n),a=Cm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!_m(l[s],r))return!1}if("MultiPolygon"===e.type){var u=km(e.coordinates,o,n),p=Cm(t.geometry(),i,o,n);if(!dm(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!bm(d[h],u))return!1}return!0}(t,this.geometries)}return!1},zm.prototype.eachChild=function(){},zm.prototype.outputDefined=function(){return!0},zm.prototype.serialize=function(){return["within",this.geojson]};var Em=zm;function Tm(t){if(t instanceof sm){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Em)return!1;var e=!0;return t.eachChild((function(t){e&&!Tm(t)&&(e=!1)})),e}function Pm(t){if(t instanceof sm&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Pm(t)&&(e=!1)})),e}function Om(t,e){if(t instanceof sm&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!Om(t,e)&&(i=!1)})),i}var Fm=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Fm.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new Fm(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},Fm.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Fm.prototype.eachChild=function(){},Fm.prototype.outputDefined=function(){return!1},Fm.prototype.serialize=function(){return["var",this.name]};var Rm=Fm,Mm=function(t,e,i,o,n){void 0===e&&(e=[]),void 0===o&&(o=new ff),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=o,this.errors=n,this.expectedType=i};Mm.prototype.parse=function(t,e,i,o,n){return void 0===n&&(n={}),e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)},Mm.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new Zf(e,[t]):"coerce"===i?new im(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=t[0];if("string"!=typeof o)return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[o];if(n){var r=n.parse(t,this);if(!r)return null;if(this.expectedType){var a=this.expectedType,s=r.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else r=i(r,a,e.typeAnnotation||"coerce");else r=i(r,a,e.typeAnnotation||"assert")}if(!(r instanceof Wf)&&"resolvedImage"!==r.type.kind&&jm(r)){var l=new rm;try{r=new Wf(r.type,r.evaluate(l))}catch(T_){return this.error(T_.message),null}}return r}return this.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Mm.prototype.concat=function(t,e,i){var o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Mm(this.registry,o,e||null,n,this.errors)},Mm.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var o=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new cf(o,t))},Mm.prototype.checkSubtype=function(t,e){var i=Pf(t,e);return i&&this.error(i),i};var Im=Mm;function jm(t){if(t instanceof Rm)return jm(t.boundExpression);if(t instanceof sm&&"error"===t.name)return!1;if(t instanceof um)return!1;if(t instanceof Em)return!1;var e=t instanceof im||t instanceof Zf,i=!0;return t.eachChild((function(t){i=e?i&&jm(t):i&&t instanceof Wf})),!!i&&(Tm(t)&&Om(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Dm(t,e){for(var i,o,n=t.length-1,r=0,a=n,s=0;r<=a;)if(i=t[s=Math.floor((r+a)/2)],o=t[s+1],i<=e){if(s===n||e<o)return s;r=s+1}else{if(!(i>e))throw new Xf("Input is not a number.");a=s-1}return 0}var Am=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var o=0,n=i;o<n.length;o+=1){var r=n[o],a=r[0],s=r[1];this.labels.push(a),this.outputs.push(s)}};Am.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,vf);if(!i)return null;var o=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r=1;r<t.length;r+=2){var a=1===r?-1/0:t[r],s=t[r+1],l=r,u=r+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(o.length&&o[o.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,n);if(!p)return null;n=n||p.type,o.push([a,p])}return new Am(n,i,o)},Am.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;return o>=e[n-1]?i[n-1].evaluate(t):i[Dm(e,o)].evaluate(t)},Am.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},Am.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Am.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Lm=Am,Gm=Nm;function Nm(t,e,i,o){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function Bm(t,e,i){return t*(1-i)+e*i}Nm.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Nm.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Nm.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Nm.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Nm.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Vm=Object.freeze({__proto__:null,number:Bm,color:function(t,e,i){return new of(Bm(t.r,e.r,i),Bm(t.g,e.g,i),Bm(t.b,e.b,i),Bm(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,o){return Bm(t,e[o],i)}))}}),qm=.95047,Wm=1.08883,Um=4/29,Xm=6/29,Km=3*Xm*Xm,Ym=Math.PI/180,Zm=180/Math.PI;function Hm(t){return t>.008856451679035631?Math.pow(t,1/3):t/Km+Um}function $m(t){return t>Xm?t*t*t:Km*(t-Um)}function Jm(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qm(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tv(t){var e=Qm(t.r),i=Qm(t.g),o=Qm(t.b),n=Hm((.4124564*e+.3575761*i+.1804375*o)/qm),r=Hm((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-Hm((.0193339*e+.119192*i+.9503041*o)/Wm)),alpha:t.a}}function ev(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*$m(e),i=qm*$m(i),o=Wm*$m(o),new of(Jm(3.2404542*i-1.5371385*e-.4985314*o),Jm(-.969266*i+1.8760108*e+.041556*o),Jm(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function iv(t,e,i){var o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}var ov={forward:tv,reverse:ev,interpolate:function(t,e,i){return{l:Bm(t.l,e.l,i),a:Bm(t.a,e.a,i),b:Bm(t.b,e.b,i),alpha:Bm(t.alpha,e.alpha,i)}}},nv={forward:function(t){var e=tv(t),i=e.l,o=e.a,n=e.b,r=Math.atan2(n,o)*Zm;return{h:r<0?r+360:r,c:Math.sqrt(o*o+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*Ym,i=t.c;return ev({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:iv(t.h,e.h,i),c:Bm(t.c,e.c,i),l:Bm(t.l,e.l,i),alpha:Bm(t.alpha,e.alpha,i)}}},rv=function(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(var r=0,a=n;r<a.length;r+=1){var s=a[r],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function av(t,e,i,o){var n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}rv.interpolationFactor=function(t,e,i,o){var n=0;if("exponential"===t.name)n=av(e,t.base,i,o);else if("linear"===t.name)n=av(e,1,i,o);else if("cubic-bezier"===t.name){var r=t.controlPoints;n=new Gm(r[0],r[1],r[2],r[3]).solve(av(e,1,i,o))}return n},rv.parse=function(t,e){var i=t[0],o=t[1],n=t[2],r=t.slice(3);if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){var a=o[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:a}}else{if("cubic-bezier"!==o[0])return e.error("Unknown interpolation type "+String(o[0]),1,0);var s=o.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,vf)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=bf:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p<r.length;p+=2){var h=r[p],d=r[p+1],c=p+3,g=p+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',c);var f=e.parse(d,g,u);if(!f)return null;u=u||f.type,l.push([h,f])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new rv(u,i,o,n,l):e.error("Type "+Ef(u)+" is not interpolatable.")},rv.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);var r=Dm(e,o),a=e[r],s=e[r+1],l=rv.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?Vm[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?nv.reverse(nv.interpolate(nv.forward(u),nv.forward(p),l)):ov.reverse(ov.interpolate(ov.forward(u),ov.forward(p),l))},rv.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},rv.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},rv.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var sv=rv,lv=function(t,e){this.type=t,this.args=e};lv.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,o=e.expectedType;o&&"value"!==o.kind&&(i=o);for(var n=[],r=0,a=t.slice(1);r<a.length;r+=1){var s=a[r],l=e.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var u=o&&n.some((function(t){return Pf(o,t.type)}));return new lv(u?kf:i,n)},lv.prototype.evaluate=function(t){for(var e,i=null,o=0,n=0,r=this.args;n<r.length;n+=1){if(o++,(i=r[n].evaluate(t))&&i instanceof Lf&&!i.available&&(e||(e=i),i=null,o===this.args.length))return e;if(null!==i)break}return i},lv.prototype.eachChild=function(t){this.args.forEach(t)},lv.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},lv.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var uv=lv,pv=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};pv.prototype.evaluate=function(t){return this.result.evaluate(t)},pv.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1){t(i[e][1])}t(this.result)},pv.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],o=1;o<t.length-1;o+=2){var n=t[o];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",o);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",o);var r=e.parse(t[o+1],o+1);if(!r)return null;i.push([n,r])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return a?new pv(i,a):null},pv.prototype.outputDefined=function(){return this.result.outputDefined()},pv.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t.push(n,r.serialize())}return t.push(this.result.serialize()),t};var hv=pv,dv=function(t,e,i){this.type=t,this.index=e,this.input=i};dv.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,vf),o=e.parse(t[2],2,zf(e.expectedType||kf));if(!i||!o)return null;var n=o.type;return new dv(n.itemType,i,o)},dv.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Xf("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new Xf("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new Xf("Array index must be an integer, but found "+e+" instead.");return i[e]},dv.prototype.eachChild=function(t){t(this.index),t(this.input)},dv.prototype.outputDefined=function(){return!1},dv.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cv=dv,gv=function(t,e){this.type=_f,this.needle=t,this.haystack=e};gv.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,kf),o=e.parse(t[2],2,kf);return i&&o?Of(i.type,[_f,yf,vf,mf,kf])?new gv(i,o):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ef(i.type)+" instead"):null},gv.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Ff(e,["boolean","string","number","null"]))throw new Xf("Expected first argument to be of type boolean, string, number or null, but found "+Ef(Bf(e))+" instead.");if(!Ff(i,["string","array"]))throw new Xf("Expected second argument to be of type array or string, but found "+Ef(Bf(i))+" instead.");return i.indexOf(e)>=0},gv.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},gv.prototype.outputDefined=function(){return!0},gv.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fv=gv,mv=function(t,e,i){this.type=vf,this.needle=t,this.haystack=e,this.fromIndex=i};mv.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,kf),o=e.parse(t[2],2,kf);if(!i||!o)return null;if(!Of(i.type,[_f,yf,vf,mf,kf]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ef(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,vf);return n?new mv(i,o,n):null}return new mv(i,o)},mv.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Ff(e,["boolean","string","number","null"]))throw new Xf("Expected first argument to be of type boolean, string, number or null, but found "+Ef(Bf(e))+" instead.");if(!Ff(i,["string","array"]))throw new Xf("Expected second argument to be of type array or string, but found "+Ef(Bf(i))+" instead.");if(this.fromIndex){var o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}return i.indexOf(e)},mv.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},mv.prototype.outputDefined=function(){return!1},mv.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var vv=mv,yv=function(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r};yv.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var n={},r=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var p=0,h=s;p<h.length;p+=1){var d=h[p];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Bf(d)))return null}else i=Bf(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=r.length}var c=e.parse(l,a,o);if(!c)return null;o=o||c.type,r.push(c)}var g=e.parse(t[1],1,kf);if(!g)return null;var f=e.parse(t[t.length-1],t.length-1,o);return f?"value"!==g.type.kind&&e.concat(1).checkSubtype(i,g.type)?null:new yv(i,o,g,n,r,f):null},yv.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Bf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},yv.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},yv.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},yv.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],o={},n=0,r=Object.keys(this.cases).sort();n<r.length;n+=1){var a=r[n];void 0===(h=o[this.cases[a]])?(o[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=i;l<u.length;l+=1){var p=u[l],h=p[0],d=p[1];1===d.length?e.push(s(d[0])):e.push(d.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var _v=yv,bv=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};bv.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=[],n=1;n<t.length-1;n+=2){var r=e.parse(t[n],n,_f);if(!r)return null;var a=e.parse(t[n+1],n+1,i);if(!a)return null;o.push([r,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new bv(i,o,s):null},bv.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];if(n.evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},bv.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t(n),t(r)}t(this.otherwise)},bv.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},bv.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var xv=bv,kv=function(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o};kv.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,kf),o=e.parse(t[2],2,vf);if(!i||!o)return null;if(!Of(i.type,[zf(kf),yf,kf]))return e.error("Expected first argument to be of type array or string, but found "+Ef(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,vf);return n?new kv(i.type,i,o,n):null}return new kv(i.type,i,o)},kv.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Ff(e,["string","array"]))throw new Xf("Expected first argument to be of type array or string, but found "+Ef(Bf(e))+" instead.");if(this.endIndex){var o=this.endIndex.evaluate(t);return e.slice(i,o)}return e.slice(i)},kv.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},kv.prototype.outputDefined=function(){return!1},kv.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var wv=kv;function Sv(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Cv(t,e,i,o){return 0===o.compare(e,i)}function zv(t,e,i){var o="=="!==t&&"!="!==t;return function(){function n(t,e,i){this.type=_f,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],r=e.parse(t[1],1,kf);if(!r)return null;if(!Sv(i,r.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+Ef(r.type)+"'.");var a=e.parse(t[2],2,kf);if(!a)return null;if(!Sv(i,a.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+Ef(a.type)+"'.");if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Ef(r.type)+"' and '"+Ef(a.type)+"'.");o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new Zf(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new Zf(r.type,[a])));var s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,wf)))return null}return new n(r,a,s)},n.prototype.evaluate=function(n){var r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){var s=Bf(r),l=Bf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Xf('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=Bf(r),p=Bf(a);if("string"!==u.kind||"string"!==p.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}var Ev=zv("==",(function(t,e,i){return e===i}),Cv),Tv=zv("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!Cv(0,e,i,o)})),Pv=zv("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),Ov=zv(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),Fv=zv("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),Rv=zv(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0})),Mv=function(t,e,i,o,n){this.type=yf,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n};Mv.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,vf);if(!i)return null;var o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");var n=null;if(o.locale&&!(n=e.parse(o.locale,1,yf)))return null;var r=null;if(o.currency&&!(r=e.parse(o.currency,1,yf)))return null;var a=null;if(o["min-fraction-digits"]&&!(a=e.parse(o["min-fraction-digits"],1,vf)))return null;var s=null;return o["max-fraction-digits"]&&!(s=e.parse(o["max-fraction-digits"],1,vf))?null:new Mv(i,n,r,a,s)},Mv.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mv.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mv.prototype.outputDefined=function(){return!1},Mv.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Iv=Mv,jv=function(t){this.type=vf,this.input=t};jv.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+Ef(i.type)+" instead."):new jv(i):null},jv.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Xf("Expected value to be of type string or array, but found "+Ef(Bf(e))+" instead.")},jv.prototype.eachChild=function(t){t(this.input)},jv.prototype.outputDefined=function(){return!1},jv.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Dv={"==":Ev,"!=":Tv,">":Ov,"<":Pv,">=":Rv,"<=":Fv,array:Zf,at:cv,boolean:Zf,case:xv,coalesce:uv,collator:um,format:$f,image:Qf,in:fv,"index-of":vv,interpolate:sv,"interpolate-hcl":sv,"interpolate-lab":sv,length:jv,let:hv,literal:Wf,match:_v,number:Zf,"number-format":Iv,object:Zf,slice:wv,step:Lm,string:Zf,"to-boolean":im,"to-color":im,"to-number":im,"to-string":im,var:Rm,within:Em};function Av(t,e){var i=e[0],o=e[1],n=e[2],r=e[3];i=i.evaluate(t),o=o.evaluate(t),n=n.evaluate(t);var a=r?r.evaluate(t):1,s=Gf(i,o,n,a);if(s)throw new Xf(s);return new of(i/255*a,o/255*a,n/255*a,a)}function Lv(t,e){return t in e}function Gv(t,e){var i=e[t];return void 0===i?null:i}function Nv(t){return{type:t}}sm.register(Dv,{error:[{kind:"error"},[yf],function(t,e){var i=e[0];throw new Xf(i.evaluate(t))}],typeof:[yf,[kf],function(t,e){return Ef(Bf(e[0].evaluate(t)))}],"to-rgba":[zf(vf,4),[bf],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[bf,[vf,vf,vf],Av],rgba:[bf,[vf,vf,vf,vf],Av],has:{type:_f,overloads:[[[yf],function(t,e){return Lv(e[0].evaluate(t),t.properties())}],[[yf,xf],function(t,e){var i=e[0],o=e[1];return Lv(i.evaluate(t),o.evaluate(t))}]]},get:{type:kf,overloads:[[[yf],function(t,e){return Gv(e[0].evaluate(t),t.properties())}],[[yf,xf],function(t,e){var i=e[0],o=e[1];return Gv(i.evaluate(t),o.evaluate(t))}]]},"feature-state":[kf,[yf],function(t,e){return Gv(e[0].evaluate(t),t.featureState||{})}],properties:[xf,[],function(t){return t.properties()}],"geometry-type":[yf,[],function(t){return t.geometryType()}],id:[kf,[],function(t){return t.id()}],zoom:[vf,[],function(t){return t.globals.zoom}],pitch:[vf,[],function(t){return t.globals.pitch||0}],"distance-from-center":[vf,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[vf,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[vf,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[vf,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[kf,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[vf,Nv(vf),function(t,e){for(var i=0,o=0,n=e;o<n.length;o+=1){i+=n[o].evaluate(t)}return i}],"*":[vf,Nv(vf),function(t,e){for(var i=1,o=0,n=e;o<n.length;o+=1){i*=n[o].evaluate(t)}return i}],"-":{type:vf,overloads:[[[vf,vf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)-o.evaluate(t)}],[[vf],function(t,e){return-e[0].evaluate(t)}]]},"/":[vf,[vf,vf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)/o.evaluate(t)}],"%":[vf,[vf,vf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)%o.evaluate(t)}],ln2:[vf,[],function(){return Math.LN2}],pi:[vf,[],function(){return Math.PI}],e:[vf,[],function(){return Math.E}],"^":[vf,[vf,vf],function(t,e){var i=e[0],o=e[1];return Math.pow(i.evaluate(t),o.evaluate(t))}],sqrt:[vf,[vf],function(t,e){var i=e[0];return Math.sqrt(i.evaluate(t))}],log10:[vf,[vf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[vf,[vf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))}],log2:[vf,[vf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[vf,[vf],function(t,e){var i=e[0];return Math.sin(i.evaluate(t))}],cos:[vf,[vf],function(t,e){var i=e[0];return Math.cos(i.evaluate(t))}],tan:[vf,[vf],function(t,e){var i=e[0];return Math.tan(i.evaluate(t))}],asin:[vf,[vf],function(t,e){var i=e[0];return Math.asin(i.evaluate(t))}],acos:[vf,[vf],function(t,e){var i=e[0];return Math.acos(i.evaluate(t))}],atan:[vf,[vf],function(t,e){var i=e[0];return Math.atan(i.evaluate(t))}],min:[vf,Nv(vf),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[vf,Nv(vf),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[vf,[vf],function(t,e){var i=e[0];return Math.abs(i.evaluate(t))}],round:[vf,[vf],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[vf,[vf],function(t,e){var i=e[0];return Math.floor(i.evaluate(t))}],ceil:[vf,[vf],function(t,e){var i=e[0];return Math.ceil(i.evaluate(t))}],"filter-==":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1];return t.properties()[i.value]===o.value}],"filter-id-==":[_f,[kf],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[_f,[yf],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<r}],"filter-id-<":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<n}],"filter->":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>r}],"filter-id->":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>n}],"filter-<=":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<=n}],"filter->=":[_f,[yf,kf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[_f,[kf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>=n}],"filter-has":[_f,[kf],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[_f,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[_f,[zf(yf)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[_f,[zf(kf)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[_f,[yf,zf(kf)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[_f,[yf,zf(kf)],function(t,e){var i=e[0],o=e[1];return function(t,e,i,o){for(;i<=o;){var n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[i.value],o.value,0,o.value.length-1)}],all:{type:_f,overloads:[[[_f,_f],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)&&o.evaluate(t)}],[Nv(_f),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(!o[i].evaluate(t))return!1}return!0}]]},any:{type:_f,overloads:[[[_f,_f],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)||o.evaluate(t)}],[Nv(_f),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(o[i].evaluate(t))return!0}return!1}]]},"!":[_f,[_f],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[_f,[yf],function(t,e){var i=e[0],o=t.globals&&t.globals.isSupportedScript;return!o||o(i.evaluate(t))}],upcase:[yf,[yf],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[yf,[yf],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[yf,Nv(kf),function(t,e){return e.map((function(e){return Vf(e.evaluate(t))})).join("")}],"resolved-locale":[yf,[wf],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Bv=Dv;function Vv(t){return{result:"success",value:t}}function qv(t){return{result:"error",value:t}}function Wv(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}var Uv=function(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new rm,this._defaultValue=e?"color"===(i=e).type&&Wv(i.default)?new of(0,0,0,0):"color"===i.type?of.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Xv(t,e){var i=new Im(Bv,[],e?function(t){var e={color:bf,string:yf,number:vf,enum:yf,boolean:_f,formatted:Sf,resolvedImage:Cf};if("array"===t.type)return zf(e[t.value]||kf,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Vv(new Uv(o,e)):qv(i.errors)}Uv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)},Uv.prototype.evaluate=function(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var l=this.expression.evaluate(this._evaluator);if(null==l||"number"==typeof l&&l!=l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new Xf("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(l)+" instead.");return l}catch(T_){return this._warningHistory[T_.message]||(this._warningHistory[T_.message]=!0,"undefined"!=typeof console&&console.warn(T_.message)),this._defaultValue}};var Kv=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Pm(e.expression)};Kv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Kv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)};var Yv=function(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Pm(e.expression),this.interpolationType=o};function Zv(t,e){if("error"===(t=Xv(t,e)).result)return t;var i,o=t.value.expression,n=Tm(o);if(!n&&("data-driven"!==(i=e)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return qv([new cf("","data expressions not supported")]);var r=Om(o,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return qv([new cf("","zoom expressions not supported")]);var a=Hv(o);if(!a&&!r)return qv([new cf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof cf)return qv([a]);if(a instanceof sv&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return qv([new cf("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Vv(new Kv(n?"constant":"source",t.value));var s=a instanceof sv?a.interpolation:void 0;return Vv(new Yv(n?"camera":"composite",t.value,a.labels,s))}function Hv(t){var e=null;if(t instanceof hv)e=Hv(t.result);else if(t instanceof uv)for(var i=0,o=t.args;i<o.length;i+=1){var n=o[i];if(e=Hv(n))break}else(t instanceof Lm||t instanceof sv)&&t.input instanceof sm&&"zoom"===t.input.name&&(e=t);return e instanceof cf||t.eachChild((function(t){var i=Hv(t);i instanceof cf?e=i:!e&&i?e=new cf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new cf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function $v(t){if(Array.isArray(t))return t.map($v);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=$v(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}Yv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Yv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)},Yv.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?sv.interpolationFactor(this.interpolationType,t,e,i):0};var Jv={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Qv(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var o=i[e];if(!Qv(o)&&"boolean"!=typeof o)return!1}return!0;default:return!0}}function ty(t,e){if(void 0===e&&(e="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};Qv(t)||(t=sy(t));var i=t,o=!0;try{o=function(t){if(!oy(t))return t;var e=$v(t);return iy(e),e=ey(e)}(i)}catch(T_){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(i,null,2)+"\n ")}var n=Jv["filter_"+e],r=Xv(o,n),a=null;if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));a=function(t,e,i){return r.value.evaluate(t,e,{},i)};var s=null,l=null;if(o!==i){var u=Xv(i,n);if("error"===u.result)throw new Error(u.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,e,i,o,n){return u.value.evaluate(t,e,{},i,void 0,void 0,o,n)},l=!Tm(u.value.expression)}return{filter:a=a,dynamicFilter:s||void 0,needGeometry:ay(o),needFeature:!!l}}function ey(t){if(!Array.isArray(t))return t;var e=function(t){if(ny.has(t[0]))for(var e=1;e<t.length;e++){if(oy(t[e]))return!0}return t}(t);return!0===e?e:e.map((function(t){return ey(t)}))}function iy(t){var e=!1,i=[];if("case"===t[0]){for(var o=1;o<t.length-1;o+=2)e=e||oy(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||oy(t[1]);for(var n=2;n<t.length-1;n+=2)i.push(t[n+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||oy(t[1]);for(var r=1;r<t.length-1;r+=2)i.push(t[r+1])}e&&(t.length=0,t.push.apply(t,["any"].concat(i)));for(var a=1;a<t.length;a++)iy(t[a])}function oy(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;for(var e,i=1;i<t.length;i++){if(oy(t[i]))return!0}return!1}var ny=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ry(t,e){return t<e?-1:t>e?1:0}function ay(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(ay(t[e]))return!0;return!1}function sy(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?ly(t[1],t[2],"=="):"!="===i?hy(ly(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?ly(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(sy))):"all"===i?["all"].concat(t.slice(1).map(sy)):"none"===i?["all"].concat(t.slice(1).map(sy).map(hy)):"in"===i?uy(t[1],t.slice(2)):"!in"===i?hy(uy(t[1],t.slice(2))):"has"===i?py(t[1]):"!has"===i?hy(py(t[1])):"within"!==i||t}function ly(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function uy(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ry)]]:["filter-in-small",t,["literal",e]]}}function py(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function hy(t){return["!",t]}var dy=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function cy(t,e){var i={};for(var o in t)"ref"!==o&&(i[o]=t[o]);return dy.forEach((function(t){t in e&&(i[t]=e[t])})),i}var gy={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},fy=" ",my=/(italic|oblique)$/i,vy={},yy=function(t,e,i){var o=vy[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var h in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):my.test(p)&&(p=p.replace(my,""),r=u[u.length-1].replace(p,"")),gy){var d=u.length>1?u[u.length-2].toLowerCase():"";if(p==h||p==h.replace("-","")||d+"-"+p==h){n=gy[h],u.pop(),d&&h.startsWith(d)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(fy).replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(fy)&&(c='"'+c+'"'),a.push(c)}o=vy[t]=[r,n,a]}return o[0]+fy+o[1]+fy+e+"px"+(i?"/"+i:"")+fy+o[2]};function _y(t){return t*Math.PI/180}var by=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function xy(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var ky,wy=Array(256).join(" ");function Sy(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=wy.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function Cy(){return ky||(ky=xy(1,1).getContext("2d")),ky}function zy(t,e){return Cy().measureText(t).width+(t.length-1)*e}var Ey={};function Ty(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(Ty(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=Ey[l];if(!u){var p=t.split(" ");if(p.length>1){var h=Cy();h.font=e;for(var d=h.measureText("M").width*i,c="",g=[],f=0,m=p.length;f<m;++f){var v=p[f],y=c+(c?" ":"")+v;zy(y,o)<=d?c=y:(c&&g.push(c),c=v)}c&&g.push(c);for(var _=0,b=g.length;_<b&&b>1;++_){var x=g[_];if(zy(x,o)<.35*d){var k=_>0?zy(g[_-1],o):1/0,w=_<b-1?zy(g[_+1],o):1/0;g.splice(_,1),b-=1,k<w?(g[_-1]+=" "+x,_-=1):g[_]=x+" "+g[_]}}for(var S=0,C=g.length-1;S<C;++S){var z=g[S],E=g[S+1];if(zy(z,o)>.7*d&&zy(E,o)<.6*d){var T=z.split(" "),P=T.pop();zy(P,o)<.2*d&&(g[S]=T.join(" "),g[S+1]=P+" "+E),C-=1}}u=g.join("\n")}else u=t;u=Sy(u,o),Ey[l]=u}return u}var Py,Oy,Fy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Ry={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},My={},Iy={zoom:0};function jy(t,e,i,o,n,r,a){var s=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[s]||(r[s]={});var l,u=r[s];if(!u[i]){var p=(t[e]||My)[i],h=Jv[e+"_"+t.type][i];void 0===p&&(p=h.default);var d=(l=p,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in Bv);if(!d&&Wv(p)&&(p=rf(p,h),d=!0),d){var c=function(t,e){var i=Zv(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(p,h);u[i]=c.evaluate.bind(c)}else"color"==h.type&&(p=of.parse(p)),u[i]=function(){return p}}return Iy.zoom=o,u[i](Iy,n,a)}function Dy(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=ty(e).filter),Iy.zoom=o,n[t](Iy,i)}function Ay(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Ly=/^([^]*)\{(.*)\}([^]*)$/;function Gy(t,e){var i;do{if(i=t.match(Ly)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function Ny(t,e,i,o,n,r,a){if(void 0===o&&(o=by),void 0===n&&(n=void 0),void 0===r&&(r=void 0),void 0===a&&(a=void 0),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var h,d=function(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var o=0;o<t.length;o++)"ref"in t[o]&&(t[o]=cy(t[o],e[t[o].ref]));return t}(e.layers),c={},g=[],f={},m={},v={},y={},_=0,b=d.length;_<b;++_){var x=d[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(h){if(x.source!==h)throw new Error('Layer "'+k+'" does not use source "'+h)}else{h=x.source;var S=e.sources[h];if(!S)throw new Error('Source "'+h+'" is not defined');var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'+h+'" is not of type "vector" or "geojson", but "'+C+'"')}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),g.push(k)}}var E=new ll,T=new Bs,P=[],O=function(e,i){var r=e.getProperties(),u=c[r.layer];if(u){var p=o.indexOf(i);-1==p&&(p=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(i,o));for(var h=Fy[e.getGeometry().getType()],d={properties:r,type:h},g=t.get("mapbox-featurestate")[e.getId()],_=-1,b=0,x=u.length;b<x;++b){var k=u[b],w=k.layer,S=w.id,C=w.layout||My,z=w.paint||My;if(!("none"===C.visibility||"minzoom"in w&&p<w.minzoom||"maxzoom"in w&&p>=w.maxzoom)){var O=w.filter;if(!O||Dy(S,O,d,p,y)){var F=void 0,R=void 0,M=void 0,I=void 0,j=void 0,D=void 0,A=k.index;if(3==h&&("fill"==w.type||"fill-extrusion"==w.type))if(R=jy(w,"paint",w.type+"-opacity",p,d,v,g),w.type+"-pattern"in z){var L=jy(w,"paint",w.type+"-pattern",p,d,v,g);if(L){var G="string"==typeof L?Gy(L,r):L.toString();if(s&&n&&n[G]){++_,(D=P[_])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new _l({fill:new Bs}),P[_]=D),M=D.getFill(),D.setZIndex(A);var N=G+"."+R,B=m[N];if(!B){var V=n[G],q=xy(V.width,V.height),W=q.getContext("2d");W.globalAlpha=R,W.drawImage(s,V.x,V.y,V.width,V.height,0,0,V.width,V.height),B=W.createPattern(q,"repeat"),m[N]=B}M.setColor(B)}}}else F=Ay(jy(w,"paint",w.type+"-color",p,d,v,g),R),w.type+"-outline-color"in z&&(j=Ay(jy(w,"paint",w.type+"-outline-color",p,d,v,g),R)),j||(j=F),(F||j)&&(++_,(!(D=P[_])||F&&!D.getFill()||!F&&D.getFill()||j&&!D.getStroke()||!j&&D.getStroke()||D.getText())&&(D=new _l({fill:F?new Bs:void 0,stroke:j?new ll:void 0}),P[_]=D),F&&(M=D.getFill()).setColor(F),j&&((I=D.getStroke()).setColor(j),I.setWidth(.5)),D.setZIndex(A));if(1!=h&&"line"==w.type){F=!("line-pattern"in z)&&"line-color"in z?Ay(jy(w,"paint","line-color",p,d,v,g),jy(w,"paint","line-opacity",p,d,v,g)):void 0;var U=jy(w,"paint","line-width",p,d,v,g);F&&U>0&&(++_,(D=P[_])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new _l({stroke:new ll}),P[_]=D),(I=D.getStroke()).setLineCap(jy(w,"layout","line-cap",p,d,v,g)),I.setLineJoin(jy(w,"layout","line-join",p,d,v,g)),I.setMiterLimit(jy(w,"layout","line-miter-limit",p,d,v,g)),I.setColor(F),I.setWidth(U),I.setLineDash(z["line-dasharray"]?jy(w,"paint","line-dasharray",p,d,v,g).map((function(t){return t*U})):null),D.setZIndex(A))}var X=!1,K=null,Y=0,Z=void 0,H=void 0,$=void 0;if((1==h||2==h)&&"icon-image"in C){var J=jy(w,"layout","icon-image",p,d,v,g);if(J){Z="string"==typeof J?Gy(J,r):J.toString();var Q=void 0;if(s&&n&&n[Z]){var tt=jy(w,"layout","icon-rotation-alignment",p,d,v,g);if(2==h){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var it=et.getExtent();if(Math.sqrt(Math.max(Math.pow((it[2]-it[0])/i,2),Math.pow((it[3]-it[1])/i,2)))>150){var ot="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(Oy||(Oy=new Yl("Point",Py=[NaN,NaN],[],{},null)),Q=Oy,Py[0]=ot[0],Py[1]=ot[1],"line"===jy(w,"layout","symbol-placement",p,d,v,g)&&"map"===tt)for(var nt=et.getStride(),rt=et.getFlatCoordinates(),at=0,st=rt.length-nt;at<st;at+=nt){var lt=rt[at],ut=rt[at+1],pt=rt[at+nt],ht=rt[at+nt+1],dt=Math.min(lt,pt),ct=Math.min(ut,ht),gt=Math.max(lt,pt),ft=Math.max(ut,ht);if(ot[0]>=dt&&ot[0]<=gt&&ot[1]>=ct&&ot[1]<=ft){Y=Math.atan2(ut-ht,pt-lt);break}}}}}if(2!==h||Q){var mt=jy(w,"layout","icon-size",p,d,v,g),vt=void 0!==z["icon-color"]?jy(w,"paint","icon-color",p,d,v,g):null;if(!vt||0!==vt.a){var yt=Z+"."+mt;if(null!==vt&&(yt+="."+vt),!(H=f[yt])){var _t=n[Z];H=new sl({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[_t.width,_t.height],offset:[_t.x,_t.y],rotateWithView:"map"===tt,scale:mt/_t.pixelRatio,displacement:"icon-offset"in C?jy(w,"layout","icon-offset",p,d,v,g).map((function(t){return-t*_t.pixelRatio})):void 0}),f[yt]=H}}H&&(++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new _l,P[_]=D),D.setGeometry(Q),H.setRotation(Y+_y(jy(w,"layout","icon-rotate",p,d,v,g))),H.setOpacity(jy(w,"paint","icon-opacity",p,d,v,g)),H.setAnchor(Ry[jy(w,"layout","icon-anchor",p,d,v,g)]),D.setImage(H),K=D.getText(),D.setText(void 0),D.setZIndex(A),X=!0,$=!1)}else $=!0}}}if(1==h&&"circle"===w.type){++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new _l,P[_]=D);var bt="circle-radius"in z?jy(w,"paint","circle-radius",p,d,v,g):5,xt=Ay(jy(w,"paint","circle-stroke-color",p,d,v,g),jy(w,"paint","circle-stroke-opacity",p,d,v,g)),kt=Ay(jy(w,"paint","circle-color",p,d,v,g),jy(w,"paint","circle-opacity",p,d,v,g)),wt=jy(w,"paint","circle-stroke-width",p,d,v,g),St=bt+"."+xt+"."+kt+"."+wt;(H=f[St])||(H=new cl({radius:bt,stroke:xt&&wt>0?new ll({width:wt,color:xt}):void 0,fill:kt?new Bs({color:kt}):void 0}),f[St]=H),D.setImage(H),K=D.getText(),D.setText(void 0),D.setGeometry(void 0),D.setZIndex(A),X=!0}var Ct=void 0,zt=void 0,Et=void 0,Tt=void 0,Pt=void 0,Ot=void 0;if("text-field"in C){Tt=Math.round(jy(w,"layout","text-size",p,d,v,g));var Ft=jy(w,"layout","text-font",p,d,v,g);Et=jy(w,"layout","text-line-height",p,d,v,g),(zt=yy(a?a(Ft):Ft,Tt,Et)).includes("sans-serif")||(zt+=",sans-serif"),Pt=jy(w,"layout","text-letter-spacing",p,d,v,g),Ot=jy(w,"layout","text-max-width",p,d,v,g);var Rt=jy(w,"layout","text-field",p,d,v,g);Ct="object"==typeof Rt&&Rt.sections?1===Rt.sections.length?Rt.toString():Rt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):Ft,n=yy(a?a(o):o,Tt*(e.scale||1),Et),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=h){for(var s=0,l=(r=Ty(r,n,Ot,Pt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(Sy(r,Pt),n)}),[]):Gy(Rt,r).trim(),R=jy(w,"paint","text-opacity",p,d,v,g)}if(Ct&&R&&!$){X||(++_,(D=P[_])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new _l,P[_]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(K||new kl({padding:[2,2,2,2]})),K=D.getText();var Mt=C["text-transform"];"uppercase"==Mt?Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toUpperCase()})):Ct.toUpperCase():"lowercase"==Mt&&(Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toLowerCase()})):Ct.toLowerCase());var It=Array.isArray(Ct)?Ct:2==h?Sy(Ct,Pt):Ty(Ct,zt,Ot,Pt);K.setText(It),K.setFont(zt),K.setRotation(_y(jy(w,"layout","text-rotate",p,d,v,g)));var jt=jy(w,"layout","text-anchor",p,d,v,g),Dt=X||1==h?"point":jy(w,"layout","symbol-placement",p,d,v,g);K.setPlacement(Dt),K.setOverflow("point"===Dt);var At=jy(w,"paint","text-halo-width",p,d,v,g),Lt=jy(w,"layout","text-offset",p,d,v,g),Gt=jy(w,"paint","text-translate",p,d,v,g),Nt=0,Bt=0;if("point"==Dt){var Vt="center";-1!==jt.indexOf("left")?(Vt="left",Bt=At):-1!==jt.indexOf("right")&&(Vt="right",Bt=-At),K.setTextAlign(Vt);var qt=jy(w,"layout","text-rotation-alignment",p,d,v,g);K.setRotateWithView("map"==qt)}else K.setMaxAngle(_y(jy(w,"layout","text-max-angle",p,d,v,g))*Ct.length/It.length),K.setTextAlign(),K.setRotateWithView(!1);var Wt="middle";0==jt.indexOf("bottom")?(Wt="bottom",Nt=-At-.5*(Et-1)*Tt):0==jt.indexOf("top")&&(Wt="top",Nt=At+.5*(Et-1)*Tt),K.setTextBaseline(Wt),K.setOffsetX(Lt[0]*Tt+Bt+Gt[0]),K.setOffsetY(Lt[1]*Tt+Nt+Gt[1]),T.setColor(Ay(jy(w,"paint","text-color",p,d,v,g),R)),K.setFill(T);var Ut=Ay(jy(w,"paint","text-halo-color",p,d,v,g),R);if(Ut){E.setColor(Ut),At*=2;var Xt=.5*Tt;E.setWidth(At<=Xt?At:Xt),K.setStroke(E)}else K.setStroke(void 0);var Kt=jy(w,"layout","text-padding",p,d,v,g),Yt=K.getPadding();Kt!==Yt[0]&&(Yt[0]=Kt,Yt[1]=Kt,Yt[2]=Kt,Yt[3]=Kt),D.setZIndex(A)}}}}return _>-1?(P.length=_+1,P):void 0}};return t.setStyle(O),t.set("mapbox-source",h),t.set("mapbox-layers",g),t.set("mapbox-featurestate",{}),O}new Ns;s`.ol-box {
45
45
  box-sizing: border-box;
46
46
  border-radius: 2px;
47
47
  border: 1.5px solid rgb(179,197,219);
@@ -366,7 +366,7 @@ var Hc=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
366
366
  left: 0;
367
367
  z-index: 100;
368
368
  background: white;
369
- }`,qy=Object.freeze,Wy=Object.defineProperty,Uy=Object.getOwnPropertyDescriptor,Xy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Uy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Wy(e,i,r),r};t.MyMap=class extends nt{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osFeaturesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new Pc({source:r?new Fc({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new Ic({attributions:[Mc]})}));var n,r;const a=function(t,e){let i=new Td({declutter:!0,source:new lc({format:new $l,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Ny(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new hc({target:e,layers:[i?a:o],view:new Xa({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",h="EPSG:3857",Eo(u,rn(p,h),void 0,d)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:en([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:ss({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new as({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:hd({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,h,d;this.map=s;const c=(g=this.drawPointer,new Hh({source:Kc,type:"Polygon",style:new ml({stroke:Vc,fill:qc,image:"crosshair"===g?Wc:Uc})}));var g;const f=function(t){return new ad({source:Kc,style:new ml({image:"crosshair"===t?Wc:Uc})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Vg(s,Xg,this.featureBuffer):b.getFeatures().length>0?Vg(s,b,this.geojsonBuffer):(s.getView().setCenter(en([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Kc.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Zc))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new he({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new Nh;if("FeatureCollection"===this.geojsonData.type){let t=(new As).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new As).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new wh({source:b,style:new ml({stroke:new rl({color:this.geojsonColor,width:3}),fill:new Ls({color:this.geojsonFill?qg(this.geojsonColor,.2):qg(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Vg(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",Bg(t,this.areaUnit))}if(this.drawMode){Kc.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new As).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Kc.addFeature(t),Vg(s,Kc,this.drawGeojsonDataBuffer)}s.addLayer(Yc),t||s.addInteraction(c),s.addInteraction(f),s.addInteraction(Zc),Kc.on("change",(()=>{var t;const e=Kc.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new As).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",Bg(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(Lc),Yc.setZIndex(1001),this.zoom<t){Ac.clear();const t=s.getView().calculateExtent(s.getSize());Gc(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?Ac.clear():setTimeout((()=>{Ac.clear();const t=s.getView().calculateExtent(s.getSize());Gc(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Kg(en([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{Kg(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,new wh({source:Xg,style:new ml({stroke:new rl({width:3,color:k}),fill:new Ls({color:qg(k,w?.2:0)})})}));s.addLayer(t),Xg.on("change",(()=>{if("ready"===Xg.getState()&&Xg.getFeatures().length>0){Vg(s,Xg,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new As).writeFeaturesObject(Xg.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Xg.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",Bg(t,this.areaUnit))}}))}var k,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return A(By||(By=qy(Wy(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:qy(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}},t.MyMap.styles=a(Vy),Xy([st({type:String})],t.MyMap.prototype,"id",2),Xy([st({type:Number})],t.MyMap.prototype,"latitude",2),Xy([st({type:Number})],t.MyMap.prototype,"longitude",2),Xy([st({type:Number})],t.MyMap.prototype,"zoom",2),Xy([st({type:Number})],t.MyMap.prototype,"minZoom",2),Xy([st({type:Number})],t.MyMap.prototype,"maxZoom",2),Xy([st({type:Boolean})],t.MyMap.prototype,"drawMode",2),Xy([st({type:Object})],t.MyMap.prototype,"drawGeojsonData",2),Xy([st({type:Number})],t.MyMap.prototype,"drawGeojsonDataBuffer",2),Xy([st({type:String})],t.MyMap.prototype,"drawPointer",2),Xy([st({type:Boolean})],t.MyMap.prototype,"showFeaturesAtPoint",2),Xy([st({type:Boolean})],t.MyMap.prototype,"clickFeatures",2),Xy([st({type:String})],t.MyMap.prototype,"featureColor",2),Xy([st({type:Boolean})],t.MyMap.prototype,"featureFill",2),Xy([st({type:Number})],t.MyMap.prototype,"featureBuffer",2),Xy([st({type:Object})],t.MyMap.prototype,"geojsonData",2),Xy([st({type:String})],t.MyMap.prototype,"geojsonColor",2),Xy([st({type:Boolean})],t.MyMap.prototype,"geojsonFill",2),Xy([st({type:Number})],t.MyMap.prototype,"geojsonBuffer",2),Xy([st({type:Boolean})],t.MyMap.prototype,"disableVectorTiles",2),Xy([st({type:String})],t.MyMap.prototype,"osVectorTilesApiKey",2),Xy([st({type:String})],t.MyMap.prototype,"osFeaturesApiKey",2),Xy([st({type:String})],t.MyMap.prototype,"osCopyright",2),Xy([st({type:Boolean})],t.MyMap.prototype,"hideResetControl",2),Xy([st({type:Boolean})],t.MyMap.prototype,"staticMode",2),Xy([st({type:String})],t.MyMap.prototype,"areaUnit",2),Xy([st({type:Boolean})],t.MyMap.prototype,"showScale",2),Xy([st({type:Boolean})],t.MyMap.prototype,"useScaleBarStyle",2),t.MyMap=Xy([rt("my-map")],t.MyMap);var Ky,Yy={exports:{}};Ky=Yy,function(t,e){Ky.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,h,d,c,g=t&u.F,f=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=f?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=f?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in f&&(i=e),i)d=((h=!g&&_&&void 0!==_[p])?_:i)[p],c=y&&h?s(d,o):v&&"function"==typeof d?s(Function.call,d):d,_&&a(_,p,d,t&u.U),b[p]!=d&&r(b,p,c),v&&x[p]!=d&&(x[p]=d)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return I})),i.d(e,"render",(function(){return j})),i.d(e,"rerender",(function(){return g})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var h=new o;return h.nodeName=t,h.children=p,h.attributes=null==e?void 0:e,h.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(h),h}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var h=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==d.push(t)&&(n.debounceRendering||u)(g)}function g(){var t,e=d;for(d=[];t=e.pop();)t._dirty&&R(t)}function f(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===h.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(F(n,u,3,i,o),t=n.base):(r&&!s&&(M(r),t=a=null),n=P(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),F(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!f(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,h=r.__preactattr_,d=e.children;if(null==h){h=r.__preactattr_={};for(var c=r.attributes,g=c.length;g--;)h[c[g].name]=c[g].value}return!w&&d&&1===d.length&&"string"==typeof d[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=d[0]&&(p.nodeValue=d[0]):(d&&d.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,h,d,c=t.childNodes,g=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],E=S.__preactattr_;null!=(T=k&&E?S._component?S._component.__key:E.key:null)?(y++,m[T]=S):(E||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(g[x++]=S)}if(0!==k)for(w=0;w<k;w++){var T;if(u=null,null!=(T=(l=e[w]).key))y&&void 0!==m[T]&&(u=m[T],m[T]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==g[r]&&(p=a=g[r],d=n,"string"==typeof(h=l)||"number"==typeof h?void 0!==p.splitText:"string"==typeof h.nodeName?!p._componentConstructor&&f(p,h.nodeName):d||p._componentConstructor===h.nodeName)){u=a,g[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=g[x--])&&z(u,!1)}(r,d,i,o,w||null!=h.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,h),k=a,r}function z(t,e){var i=t._component;i?M(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),E(t))}function E(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var T=[];function P(t,e,i){var o,n=T.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),I.call(o,e,i)):((o=new I(e,i)).constructor=t,o.render=O);n--;)if(T[n].constructor===t)return o.nextBase=T[n].nextBase,T.splice(n,1),o;return o}function O(t,e,i){return this.constructor(t,i)}function F(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,h=t.context,d=t.prevProps||u,c=t.prevState||p,g=t.prevContext||h,f=t.base,v=t.nextBase,y=f||v,_=t._component,E=!1,T=g;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),f&&(t.props=d,t.state=c,t.context=g,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,h)?E=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,h),t.props=u,t.state=p,t.context=h),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!E){r=t.render(u,p,h),t.getChildContext&&(h=l(l({},h),t.getChildContext())),f&&t.getSnapshotBeforeUpdate&&(T=t.getSnapshotBeforeUpdate(d,c));var O,I,j=r&&r.nodeName;if("function"==typeof j){var D=m(r);(a=_)&&a.constructor===j&&D.key==a.__key?F(a,D,1,h,!1):(O=a,t._component=a=P(j,D,h),a.nextBase=a.nextBase||v,a._parentComponent=t,F(a,D,0,h,!1),R(a,1,i,!0)),I=a.base}else s=y,(O=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),I=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,h,i||!f,y&&y.parentNode,!0));if(y&&I!==y&&a!==_){var A=y.parentNode;A&&I!==A&&(A.replaceChild(I,y),O||(y._component=null,z(y,!1)))}if(O&&M(O),(t.base=I)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=I;I._component=L,I._componentConstructor=L.constructor}}for(!f||i?b.unshift(t):E||(t.componentDidUpdate&&t.componentDidUpdate(d,c,T),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function M(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?M(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),T.push(t),E(e)),t.__ref&&t.__ref(null)}function I(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function j(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(I.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var D={h:s,createElement:s,cloneElement:p,Component:I,render:j,rerender:g,options:n};e.default=D},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,h=6==t,d=5==t||h,c=e||s;return function(e,s,g){for(var f,m,v=r(e),y=n(v),_=o(s,g,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((d||x in y)&&(m=_(f=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return f;case 6:return x;case 2:k.push(f)}else if(p)return!1;return h?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,h=r.f;u<l;)for(var d,c=s(arguments[u++]),g=p?o(c).concat(p(c)):o(c),f=g.length,m=0;m<f;)h.call(c,d=g[m++])&&(i[d]=c[d]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var h=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var h=n&&p();this.handleComponentBlur({menuOpen:h,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,h=i.name,d=i.placeholder,c=i.required,g=i.showAllValues,f=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,E=k.query,T=k.selected,P=k.ariaHint,O=k.validChoiceMade,F=this.hasAutoselect(),R=-1===w,M=0===z.length,I=0!==E.length,j=E.length>=u,D=this.props.showNoOptionsFound&&R&&M&&I&&j,A=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",V=-1!==w&&null!==w,q=r+"__menu",W=q+"--"+a,U=q+"--"+(C||D?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[T]),Z=Y&&0===Y.toLowerCase().indexOf(E.toLowerCase())&&F?E+Y.substr(E.length):"",H=l+"__assistiveHint",$=P?{"aria-describedby":H}:null;return g&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:A,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:E.length,minQueryLength:u,selectedOption:this.templateInputValue(z[T]),selectedOptionIndex:T,validChoiceMade:O,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!V&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},$,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:h,placeholder:d,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:E})),t,(0,o.createElement)("ul",{className:q+" "+W+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?T===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),D&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},f())),(0,o.createElement)("span",{id:H,style:{display:"none"}},b()))},e}(o.Component);(e.default=h).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],h=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,h=e.tSelectedOption,d=e.tResults,c=this.state,g=c.bump,f=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?h(s,n,l):"";return t=v?u(a):y?p():d(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&f&&g?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!f||g?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var Zy,Hy=bl(Yy.exports),$y=s`@charset "UTF-8";
369
+ }`,qy=Object.freeze,Wy=Object.defineProperty,Uy=Object.getOwnPropertyDescriptor,Xy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Uy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Wy(e,i,r),r};t.MyMap=class extends nt{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBorderNone=!1,this.featureBuffer=40,this.showMarker=!1,this.markerLatitude=this.latitude,this.markerLongitude=this.longitude,this.markerColor="#000000",this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osFeaturesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new Pc({source:r?new Fc({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new Ic({attributions:[Mc]})}));var n,r;const a=function(t,e){let i=new Xd({declutter:!0,source:new dc({format:new tu,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Ny(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new vd({target:e,layers:[i?a:o],view:new Xa({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",h="EPSG:3857",Eo(u,rn(p,h),void 0,d)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:en([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:ss({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new as({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:fd({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,h,d;this.map=s;const c=(g=this.drawPointer,new td({source:Kc,type:"Polygon",style:new _l({stroke:Vc,fill:qc,image:"crosshair"===g?Wc:Uc})}));var g;const f=function(t){return new pd({source:Kc,style:new _l({image:"crosshair"===t?Wc:Uc})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Vg(s,Xg,this.featureBuffer):b.getFeatures().length>0?Vg(s,b,this.geojsonBuffer):(s.getView().setCenter(en([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Kc.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Zc))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new he({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new qp;if("FeatureCollection"===this.geojsonData.type){let t=(new Ns).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Ns).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new zp({source:b,style:new _l({stroke:new ll({color:this.geojsonColor,width:3}),fill:new Bs({color:this.geojsonFill?qg(this.geojsonColor,.2):qg(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Vg(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",Bg(t,this.areaUnit))}if(this.drawMode){Kc.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Ns).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Kc.addFeature(t),Vg(s,Kc,this.drawGeojsonDataBuffer)}s.addLayer(Yc),t||s.addInteraction(c),s.addInteraction(f),s.addInteraction(Zc),Kc.on("change",(()=>{var t;const e=Kc.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new Ns).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",Bg(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(Lc),Yc.setZIndex(1001),this.zoom<t){Ac.clear();const t=s.getView().calculateExtent(s.getSize());Gc(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?Ac.clear():setTimeout((()=>{Ac.clear();const t=s.getView().calculateExtent(s.getSize());Gc(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Kg(en([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{Kg(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,S=this.featureBorderNone,new zp({source:Xg,style:new _l({stroke:S?void 0:new ll({width:3,color:k}),fill:new Bs({color:qg(k,w?.2:0)})})}));s.addLayer(t),Xg.on("change",(()=>{if("ready"===Xg.getState()&&Xg.getFeatures().length>0){Vg(s,Xg,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Ns).writeFeaturesObject(Xg.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Xg.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",Bg(t,this.areaUnit))}}))}var k,w,S;if(this.showMarker){const t=new wa(en([this.markerLongitude,this.markerLatitude])),e=new zp({source:new qp({features:[new Es(t)]}),style:new _l({image:new cl({radius:9,fill:new Bs({color:this.markerColor})})})});s.addLayer(e)}setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return A(By||(By=qy(Wy(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:qy(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}},t.MyMap.styles=a(Vy),Xy([st({type:String})],t.MyMap.prototype,"id",2),Xy([st({type:Number})],t.MyMap.prototype,"latitude",2),Xy([st({type:Number})],t.MyMap.prototype,"longitude",2),Xy([st({type:Number})],t.MyMap.prototype,"zoom",2),Xy([st({type:Number})],t.MyMap.prototype,"minZoom",2),Xy([st({type:Number})],t.MyMap.prototype,"maxZoom",2),Xy([st({type:Boolean})],t.MyMap.prototype,"drawMode",2),Xy([st({type:Object})],t.MyMap.prototype,"drawGeojsonData",2),Xy([st({type:Number})],t.MyMap.prototype,"drawGeojsonDataBuffer",2),Xy([st({type:String})],t.MyMap.prototype,"drawPointer",2),Xy([st({type:Boolean})],t.MyMap.prototype,"showFeaturesAtPoint",2),Xy([st({type:Boolean})],t.MyMap.prototype,"clickFeatures",2),Xy([st({type:String})],t.MyMap.prototype,"featureColor",2),Xy([st({type:Boolean})],t.MyMap.prototype,"featureFill",2),Xy([st({type:Boolean})],t.MyMap.prototype,"featureBorderNone",2),Xy([st({type:Number})],t.MyMap.prototype,"featureBuffer",2),Xy([st({type:Boolean})],t.MyMap.prototype,"showMarker",2),Xy([st({type:Number})],t.MyMap.prototype,"markerLatitude",2),Xy([st({type:Number})],t.MyMap.prototype,"markerLongitude",2),Xy([st({type:String})],t.MyMap.prototype,"markerColor",2),Xy([st({type:Object})],t.MyMap.prototype,"geojsonData",2),Xy([st({type:String})],t.MyMap.prototype,"geojsonColor",2),Xy([st({type:Boolean})],t.MyMap.prototype,"geojsonFill",2),Xy([st({type:Number})],t.MyMap.prototype,"geojsonBuffer",2),Xy([st({type:Boolean})],t.MyMap.prototype,"disableVectorTiles",2),Xy([st({type:String})],t.MyMap.prototype,"osVectorTilesApiKey",2),Xy([st({type:String})],t.MyMap.prototype,"osFeaturesApiKey",2),Xy([st({type:String})],t.MyMap.prototype,"osCopyright",2),Xy([st({type:Boolean})],t.MyMap.prototype,"hideResetControl",2),Xy([st({type:Boolean})],t.MyMap.prototype,"staticMode",2),Xy([st({type:String})],t.MyMap.prototype,"areaUnit",2),Xy([st({type:Boolean})],t.MyMap.prototype,"showScale",2),Xy([st({type:Boolean})],t.MyMap.prototype,"useScaleBarStyle",2),t.MyMap=Xy([rt("my-map")],t.MyMap);var Ky,Yy={exports:{}};Ky=Yy,function(t,e){Ky.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,h,d,c,g=t&u.F,f=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=f?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=f?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in f&&(i=e),i)d=((h=!g&&_&&void 0!==_[p])?_:i)[p],c=y&&h?s(d,o):v&&"function"==typeof d?s(Function.call,d):d,_&&a(_,p,d,t&u.U),b[p]!=d&&r(b,p,c),v&&x[p]!=d&&(x[p]=d)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return I})),i.d(e,"render",(function(){return j})),i.d(e,"rerender",(function(){return g})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var h=new o;return h.nodeName=t,h.children=p,h.attributes=null==e?void 0:e,h.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(h),h}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var h=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==d.push(t)&&(n.debounceRendering||u)(g)}function g(){var t,e=d;for(d=[];t=e.pop();)t._dirty&&R(t)}function f(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===h.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(F(n,u,3,i,o),t=n.base):(r&&!s&&(M(r),t=a=null),n=P(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),F(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!f(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,h=r.__preactattr_,d=e.children;if(null==h){h=r.__preactattr_={};for(var c=r.attributes,g=c.length;g--;)h[c[g].name]=c[g].value}return!w&&d&&1===d.length&&"string"==typeof d[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=d[0]&&(p.nodeValue=d[0]):(d&&d.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,h,d,c=t.childNodes,g=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],E=S.__preactattr_;null!=(T=k&&E?S._component?S._component.__key:E.key:null)?(y++,m[T]=S):(E||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(g[x++]=S)}if(0!==k)for(w=0;w<k;w++){var T;if(u=null,null!=(T=(l=e[w]).key))y&&void 0!==m[T]&&(u=m[T],m[T]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==g[r]&&(p=a=g[r],d=n,"string"==typeof(h=l)||"number"==typeof h?void 0!==p.splitText:"string"==typeof h.nodeName?!p._componentConstructor&&f(p,h.nodeName):d||p._componentConstructor===h.nodeName)){u=a,g[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=g[x--])&&z(u,!1)}(r,d,i,o,w||null!=h.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,h),k=a,r}function z(t,e){var i=t._component;i?M(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),E(t))}function E(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var T=[];function P(t,e,i){var o,n=T.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),I.call(o,e,i)):((o=new I(e,i)).constructor=t,o.render=O);n--;)if(T[n].constructor===t)return o.nextBase=T[n].nextBase,T.splice(n,1),o;return o}function O(t,e,i){return this.constructor(t,i)}function F(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,h=t.context,d=t.prevProps||u,c=t.prevState||p,g=t.prevContext||h,f=t.base,v=t.nextBase,y=f||v,_=t._component,E=!1,T=g;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),f&&(t.props=d,t.state=c,t.context=g,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,h)?E=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,h),t.props=u,t.state=p,t.context=h),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!E){r=t.render(u,p,h),t.getChildContext&&(h=l(l({},h),t.getChildContext())),f&&t.getSnapshotBeforeUpdate&&(T=t.getSnapshotBeforeUpdate(d,c));var O,I,j=r&&r.nodeName;if("function"==typeof j){var D=m(r);(a=_)&&a.constructor===j&&D.key==a.__key?F(a,D,1,h,!1):(O=a,t._component=a=P(j,D,h),a.nextBase=a.nextBase||v,a._parentComponent=t,F(a,D,0,h,!1),R(a,1,i,!0)),I=a.base}else s=y,(O=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),I=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,h,i||!f,y&&y.parentNode,!0));if(y&&I!==y&&a!==_){var A=y.parentNode;A&&I!==A&&(A.replaceChild(I,y),O||(y._component=null,z(y,!1)))}if(O&&M(O),(t.base=I)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=I;I._component=L,I._componentConstructor=L.constructor}}for(!f||i?b.unshift(t):E||(t.componentDidUpdate&&t.componentDidUpdate(d,c,T),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function M(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?M(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),T.push(t),E(e)),t.__ref&&t.__ref(null)}function I(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function j(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(I.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var D={h:s,createElement:s,cloneElement:p,Component:I,render:j,rerender:g,options:n};e.default=D},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,h=6==t,d=5==t||h,c=e||s;return function(e,s,g){for(var f,m,v=r(e),y=n(v),_=o(s,g,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((d||x in y)&&(m=_(f=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return f;case 6:return x;case 2:k.push(f)}else if(p)return!1;return h?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,h=r.f;u<l;)for(var d,c=s(arguments[u++]),g=p?o(c).concat(p(c)):o(c),f=g.length,m=0;m<f;)h.call(c,d=g[m++])&&(i[d]=c[d]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var h=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var h=n&&p();this.handleComponentBlur({menuOpen:h,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,h=i.name,d=i.placeholder,c=i.required,g=i.showAllValues,f=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,E=k.query,T=k.selected,P=k.ariaHint,O=k.validChoiceMade,F=this.hasAutoselect(),R=-1===w,M=0===z.length,I=0!==E.length,j=E.length>=u,D=this.props.showNoOptionsFound&&R&&M&&I&&j,A=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",V=-1!==w&&null!==w,q=r+"__menu",W=q+"--"+a,U=q+"--"+(C||D?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[T]),Z=Y&&0===Y.toLowerCase().indexOf(E.toLowerCase())&&F?E+Y.substr(E.length):"",H=l+"__assistiveHint",$=P?{"aria-describedby":H}:null;return g&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:A,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:E.length,minQueryLength:u,selectedOption:this.templateInputValue(z[T]),selectedOptionIndex:T,validChoiceMade:O,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!V&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},$,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:h,placeholder:d,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:E})),t,(0,o.createElement)("ul",{className:q+" "+W+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?T===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),D&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},f())),(0,o.createElement)("span",{id:H,style:{display:"none"}},b()))},e}(o.Component);(e.default=h).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],h=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,h=e.tSelectedOption,d=e.tResults,c=this.state,g=c.bump,f=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?h(s,n,l):"";return t=v?u(a):y?p():d(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&f&&g?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!f||g?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var Zy,Hy=wl(Yy.exports),$y=s`@charset "UTF-8";
370
370
  .govuk-link {
371
371
  font-family: "GDS Transport", arial, sans-serif;
372
372
  -webkit-font-smoothing: antialiased;