Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Created July 2, 2020 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/576c57eecd647647aef46613950f34de to your computer and use it in GitHub Desktop.
Save ThomasG77/576c57eecd647647aef46613950f34de to your computer and use it in GitHub Desktop.
(function () {function uh(a){return a&&a.__esModule?{d:a.default}:{d:a}}var Uf={};var Wf={};var Gd={};var Se={};function ca(){return function(){throw new Error("Unimplemented abstract method.")}()}var bo=0;function ga(t){return t.ol_uid||(t.ol_uid=String(++bo))}var Ye="6.3.1";var lo=Se&&Se.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),tg=function(t){function r(r){var e=this,o="Assertion failed. See https://openlayers.org/en/"+("latest"===Ye?Ye:"v"+Ye.split("-")[0])+"/doc/errors/#"+r+" for details.";return(e=t.call(this,o)||this).code=r,e.name="AssertionError",e.message=o,e}return lo(r,t),r}(Error);Se.default=tg;var ra={ADD:"add",REMOVE:"remove"};var Wc={};var ub={PROPERTYCHANGE:"propertychange"};var ye={};function fa(e,t,n,$,r){if($&&$!==e&&(n=n.bind($)),r){var i=n;n=function(){e.removeEventListener(t,n),i.apply(this,arguments)}}var s={target:e,type:t,listener:n};return e.addEventListener(t,n),s}function Ec(e,t,n,$){return fa(e,t,n,$,!0)}function ja(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),zc(e))}var Da="function"==typeof Object.assign?Object.assign:function(e,r){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1,o=arguments.length;n<o;++n){var $=arguments[n];if(null!=$)for(var s in $)$.hasOwnProperty(s)&&(t[s]=$[s])}return t};function zc(e){for(var r in e)delete e[r]}var df="function"==typeof Object.values?Object.values:function(e){var r=[];for(var t in e)r.push(e[t]);return r};function Sc(e){var r;for(r in e)return!1;return!r}var Rg={};var fh=function(){function t(){this.disposed_=!1}return t.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function Ia(){return!0}function Jb(){return!1}function jb(){}function iq($){var r,e,t,o=!1;return function(){var p=Array.prototype.slice.call(arguments);return o&&this===t&&xc(p,e)||(o=!0,t=this,e=p,r=$.apply(this,arguments)),r}}function gq(r,e,n){for(var t,$,u=n||tb,o=0,l=r.length,i=!1;o<l;)($=+u(r[t=o+(l-o>>1)],e))<0?o=t+1:(l=t,i=!$);return i?o:~o}function tb(r,e){return r>e?1:r<e?-1:0}function Vc(r,e){return r.indexOf(e)>=0}function Af(r,e,n){var t=r.length;if(r[0]<=e)return 0;if(e<=r[t-1])return t-1;var $=void 0;if(n>0){for($=1;$<t;++$)if(r[$]<e)return $-1}else if(n<0){for($=1;$<t;++$)if(r[$]<=e)return $}else for($=1;$<t;++$){if(r[$]==e)return $;if(r[$]<e)return r[$-1]-e<e-r[$]?$-1:$}return t-1}function $p(r,e,n){for(;e<n;){var t=r[e];r[e]=r[n],r[n]=t,++e,--n}}function Pa(r,e){for(var n=Array.isArray(e)?e:[e],t=n.length,$=0;$<t;$++)r[r.length]=n[$]}function xc(r,e){var n=r.length;if(n!==e.length)return!1;for(var t=0;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Sp(r,e,n){var t=e||tb;return r.every(function(e,$){if(0===$)return!0;var u=t(r[$-1],e);return!(u>0||n&&0===u)})}var Ha=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();function Rp(t){t.stopPropagation()}var Pp=Rg&&Rg.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Nb=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_={},n.dispatching_={},n.listeners_={},n}return Pp(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_[t];n||(n=[],this.listeners_[t]=n),-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new Ha(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var i,r=this.listeners_[n];if(r){n in this.dispatching_||(this.dispatching_[n]=0,this.pendingRemovals_[n]=0),++this.dispatching_[n];for(var s=0,o=r.length;s<o;++s)if(!1===(i="handleEvent"in r[s]?r[s].handleEvent(e):r[s].call(this,e))||e.propagationStopped){i=!1;break}if(--this.dispatching_[n],0===this.dispatching_[n]){var p=this.pendingRemovals_[n];for(delete this.pendingRemovals_[n];p--;)this.removeEventListener(n,jb);delete this.dispatching_[n]}return i}},e.prototype.disposeInternal=function(){zc(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},e.prototype.removeEventListener=function(t,e){var n=this.listeners_[t];if(n){var i=n.indexOf(e);-1!==i&&(t in this.pendingRemovals_?(n[i]=jb,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}},e}(fh);Rg.default=Nb;var ba={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};var Op=ye&&ye.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Oe=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Op(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(ba.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),o=0;o<r;++o)n[o]=fa(this,t[o],e);return n}return fa(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),o=0;o<r;++o)n[o]=Ec(this,t[o],e);return n}return Ec(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var r=0,n=t.length;r<n;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(Nb);function Mp(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)ja(t[e]);else ja(t)}ye.unByKey=Mp,ye.default=Oe;var Mi=Wc&&Wc.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function h(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(h.prototype=r.prototype,new h)}}(),Re=function(e){function t(t,r,h){var n=e.call(this,t)||this;return n.key=r,n.oldValue=h,n}return Mi(t,e),t}(Ha);Wc.ObjectEvent=Re;var Oa=function(e){function t(t){var r=e.call(this)||this;return ga(r),r.values_={},void 0!==t&&r.setProperties(t),r}return Mi(t,e),t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return Da({},this.values_)},t.prototype.notify=function(e,t){var r;r=qa(e),this.dispatchEvent(new Re(r,e,t)),r=ub.PROPERTYCHANGE,this.dispatchEvent(new Re(r,e,t))},t.prototype.set=function(e,t,r){if(r)this.values_[e]=t;else{var h=this.values_[e];this.values_[e]=t,h!==t&&this.notify(e,h)}},t.prototype.setProperties=function(e,t){for(var r in e)this.set(r,e[r],t)},t.prototype.unset=function(e,t){if(e in this.values_){var r=this.values_[e];delete this.values_[e],t||this.notify(e,r)}},t}(Oe),Te={};function qa(e){return Te.hasOwnProperty(e)?Te[e]:Te[e]="change:"+e}Wc.getChangeEventType=qa,Wc.default=Oa;var Ak=Gd&&Gd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uh={LENGTH:"length"},Bc=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.element=r,o.index=n,o}return Ak(e,t),e}(Ha);Gd.CollectionEvent=Bc;var za=function(t){function e(e,r){var n=t.call(this)||this,o=r||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var i=0,a=n.array_.length;i<a;++i)n.assertUnique_(n.array_[i],i);return n.updateLength_(),n}return Ak(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(Uh.LENGTH)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Bc(ra.ADD,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Bc(ra.REMOVE,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Bc(ra.REMOVE,n,t)),this.dispatchEvent(new Bc(ra.ADD,e,t))}else{for(var o=r;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(Uh.LENGTH,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new tg(58)},e}(Oa);Gd.default=za;var ef={};var gf={};var Lp=gf&&gf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qc=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.map=r,o.frameState=void 0!==n?n:null,o}return Lp(e,t),e}(Ha);gf.default=Qc;var Kp=ef&&ef.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Kf=function(t){function e(e,o,n,r,i){var p=t.call(this,e,o,i)||this;return p.originalEvent=n,p.pixel_=null,p.coordinate_=null,p.dragging=void 0!==r&&r,p}return Kp(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:!0,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:!0,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Qc);ef.default=Kf;var Mf={};var wh=null,zh=null;function Ip(){Element.prototype.setPointerCapture=Element.prototype.setCapture,Element.prototype.releasePointerCapture=Element.prototype.releaseCapture}function jg(e,t,r){e.addEventListener(t,function(e){var n=new MouseEvent(r,e);n.pointerId=1,n.isPrimary=!0,n.pointerType="mouse",n.width=1,n.height=1,n.tiltX=0,n.tiltY=0,"buttons"in e&&0!==e.buttons?n.pressure=.5:n.pressure=0;var o=e.target;null!==zh&&(o=zh,"mouseup"===t&&(zh=null)),o.dispatchEvent(n),n.defaultPrevented&&e.preventDefault()})}function sg(e,t,r){e.addEventListener(t,function(e){for(var n=e.changedTouches,o=n.length,i=0;i<o;i++){var a=new CustomEvent(r,{bubbles:!0,cancelable:!0});a.ctrlKey=e.ctrlKey,a.shiftKey=e.shiftKey,a.altKey=e.altKey,a.metaKey=e.metaKey;var u=n.item(i);a.clientX=u.clientX,a.clientY=u.clientY,a.screenX=u.screenX,a.screenY=u.screenY,a.pageX=u.pageX,a.pageY=u.pageY;var $=u.target.getBoundingClientRect();a.offsetX=u.clientX-$.left,a.offsetY=u.clientY-$.top,a.pointerId=1+u.identifier,a.button=0,a.buttons=1,a.movementX=0,a.movementY=0,a.region=null,a.relatedTarget=null,a.x=a.clientX,a.y=a.clientY,a.pointerType="touch",a.width=1,a.height=1,a.tiltX=0,a.tiltY=0,a.pressure=1,"touchstart"===t&&null===wh&&(wh=u.identifier),a.isPrimary=u.identifier===wh,"touchend"===t&&a.isPrimary&&(wh=null),e.target.dispatchEvent(a),a.defaultPrevented&&e.preventDefault()}})}"PointerEvent"in window||(Ip(),"TouchEvent"in window||(jg(document,"mousedown","pointerdown"),jg(document,"mousemove","pointermove"),jg(document,"mouseup","pointerup")),sg(document,"touchstart","pointerdown"),sg(document,"touchmove","pointermove"),sg(document,"touchend","pointerup"));var sc="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Hp=-1!==sc.indexOf("firefox");var a=-1!==sc.indexOf("safari")&&-1==sc.indexOf("chrom");var Ep=-1!==sc.indexOf("webkit")&&-1==sc.indexOf("edge");var Bp=-1!==sc.indexOf("macintosh");var ue="undefined"!=typeof devicePixelRatio?devicePixelRatio:1;var qe="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope;var mj="undefined"!=typeof Image&&Image.prototype.decode;var Fj=function(){var e=!1;try{var $=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,$),window.removeEventListener("_",null,$)}catch(r){}return e}();var ha={SINGLECLICK:"singleclick",CLICK:ba.CLICK,DBLCLICK:ba.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var sh={};var vp=sh&&sh.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),fb=function(t){function r(r,e,o,n,$){var p=t.call(this,r,e,o,n,$)||this;return p.pointerEvent=o,p}return vp(r,t),r}(Kf);sh.default=fb;var gb={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var up=Mf&&Mf.__extends||function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Hh=function(e){function t(t,o){var i=e.call(this,t)||this;i.map_=t,i.clickTimeoutId_,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=o?o*ue:ue,i.down_=null;var r=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=r,i.pointerdownListenerKey_=fa(r,gb.POINTERDOWN,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=fa(r,gb.POINTERMOVE,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(ba.TOUCHMOVE,i.boundHandleTouchMove_,!!Fj&&{passive:!1}),i}return up(t,e),t.prototype.emulateClick_=function(e){var t=new fb(ha.CLICK,this.map_,e);this.dispatchEvent(t),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new fb(ha.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var t=new fb(ha.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}.bind(this),250)},t.prototype.updateActivePointers_=function(e){var t=e;t.type==ha.POINTERUP||t.type==ha.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==ha.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},t.prototype.handlePointerUp_=function(e){this.updateActivePointers_(e);var t=new fb(ha.POINTERUP,this.map_,e);this.dispatchEvent(t),t.propagationStopped||this.dragging_||!this.isMouseActionButton_(e)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(ja),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},t.prototype.isMouseActionButton_=function(e){return 0===e.button},t.prototype.handlePointerDown_=function(e){this.updateActivePointers_(e);var t=new fb(ha.POINTERDOWN,this.map_,e);this.dispatchEvent(t),this.down_=e,0===this.dragListenerKeys_.length&&this.dragListenerKeys_.push(fa(document,ha.POINTERMOVE,this.handlePointerMove_,this),fa(document,ha.POINTERUP,this.handlePointerUp_,this),fa(this.element_,ha.POINTERCANCEL,this.handlePointerUp_,this))},t.prototype.handlePointerMove_=function(e){if(this.isMoving_(e)){this.dragging_=!0;var t=new fb(ha.POINTERDRAG,this.map_,e,this.dragging_);this.dispatchEvent(t)}},t.prototype.relayEvent_=function(e){this.originalPointerMoveEvent_=e;var t=!(!this.down_||!this.isMoving_(e));this.dispatchEvent(new fb(e.type,this.map_,e,t))},t.prototype.handleTouchMove_=function(e){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||e.preventDefault()},t.prototype.isMoving_=function(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(ja(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ba.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ja(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ja),this.dragListenerKeys_.length=0,this.element_=null,e.prototype.disposeInternal.call(this)},t}(Nb);Mf.default=Hh;var kc={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var Ba={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var Xb={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var je={};var ea={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ia(r,$){if(!r)throw new tg($)}var fe=1/0;var sp=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,zc(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){ia(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=fe&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],s=i[t],o=t;t<n>>1;){var u=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),p=h<n&&i[h]<i[u]?h:u;e[t]=e[p],i[t]=i[p],t=p}e[t]=r,i[t]=s,this.siftDown_(o,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,r=i[e],s=n[e];e>t;){var o=this.getParentIndex_(e);if(!(n[o]>s))break;i[e]=i[o],n[e]=n[o],e=o}i[e]=r,n[e]=s},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,s=this.priorities_,o=0,u=r.length;for(e=0;e<u;++e)(i=n(t=r[e]))==fe?delete this.queuedElements_[this.keyFunction_(t)]:(s[o]=i,r[o++]=t);r.length=o,s.length=o,this.heapify_()},t}();var rp=je&&je.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yi=function(t){function e(e,i){var r=t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()})||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=i,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return rp(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(ba.CHANGE,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(e.hifi&&i===ea.LOADED||i===ea.ERROR||i===ea.EMPTY){e.removeEventListener(ba.CHANGE,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,r,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==ea.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,i.load())},e}(sp);function ej(t,e,i,r,n){if(!(t&&i in t.wantedTiles))return fe;if(!t.wantedTiles[i][e.getKey()])return fe;var o=t.viewState.center,a=r[0]-o[0],$=r[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+$*$)/n}je.default=Yi,je.getTilePriority=ej;var Yb={};var pp=42;var zf=256;function yj(t,$,e){return function(r,a,c,o){if(r){var n=$?0:c[0]*a,x=$?0:c[1]*a,p=t[0]+n/2,z=t[2]-n/2,R=t[1]+x/2,h=t[3]-x/2;p>z&&(z=p=(z+p)/2),R>h&&(h=R=(h+R)/2);var m=wa(r[0],p,z),M=wa(r[1],R,h),i=30*a;return o&&e&&(m+=-i*Math.log(1+Math.max(0,p-r[0])/i)+i*Math.log(1+Math.max(0,r[0]-z)/i),M+=-i*Math.log(1+Math.max(0,R-r[1])/i)+i*Math.log(1+Math.max(0,r[1]-h)/i)),[m,M]}}}function np(t){return t}function wa(r,e,t){return Math.min(Math.max(r,e),t)}var lp="cosh"in Math?Math.cosh:function(r){var e=Math.exp(r);return(e+1/e)/2};function jp(r,e,t,$,o,a){var n=o-t,s=a-$;if(0!==n||0!==s){var p=((r-t)*n+(e-$)*s)/(n*n+s*s);p>1?(t=o,$=a):p>0&&(t+=n*p,$+=s*p)}return Db(r,e,t,$)}function Db(r,e,t,$){var o=t-r,a=$-e;return o*o+a*a}function ip(r){for(var e=r.length,t=0;t<e;t++){for(var $=t,o=Math.abs(r[t][t]),a=t+1;a<e;a++){var n=Math.abs(r[a][t]);n>o&&(o=n,$=a)}if(0===o)return null;var s=r[$];r[$]=r[t],r[t]=s;for(var p=t+1;p<e;p++)for(var x=-r[p][t]/r[t][t],u=t;u<e+1;u++)t==u?r[p][u]=0:r[p][u]+=x*r[t][u]}for(var B=new Array(e),G=e-1;G>=0;G--){B[G]=r[G][e]/r[G][G];for(var i=G-1;i>=0;i--)r[i][e]-=r[i][G]*B[G]}return B}function Dk(r){return 180*r/Math.PI}function eb(r){return r*Math.PI/180}function ac(r,e){var t=r%e;return t*e<0?t+e:t}function oc(r,e,t){return r+t*(e-r)}function eg(o,t,e,n){var r=ta(t)/e[0],a=Va(t)/e[1];return n?Math.min(o,Math.max(r,a)):Math.min(o,Math.min(r,a))}function gg(o,t,e){var n=Math.min(o,t);return n*=Math.log(1+50*Math.max(0,o/t-1))/50+1,e&&(n=Math.max(n,e),n/=Math.log(1+50*Math.max(0,e/o-1))/50+1),wa(n,e/2,2*t)}function hp(o,t,e,n){return function(r,a,$,l){if(void 0!==r){var i=o[0],p=o[o.length-1],m=e?eg(i,e,$,n):i;if(l)return void 0===t||t?gg(r,m,p):wa(r,p,m);var u=Math.min(m,r),h=Math.floor(Af(o,u,a));return o[h]>m&&h<o.length-1?o[h+1]:o[h]}}}function gp(o,t,e,n,r,a){return function($,l,i,p){if(void 0!==$){var m=r?eg(t,r,i,a):t,u=void 0!==e?e:0;if(p)return void 0===n||n?gg($,m,u):wa($,u,m);var h=Math.ceil(Math.log(t/m)/Math.log(o)-1e-9),M=-l*(.5-1e-9)+.5,c=Math.min(m,$),s=Math.floor(Math.log(t/c)/Math.log(o)+M),v=Math.max(h,s),g=t/Math.pow(o,v);return wa(g,u,m)}}}function Th(o,t,e,n,r){return function(a,$,l,i){if(void 0!==a){var p=n?eg(o,n,l,r):o;return(void 0===e||e)&&i?gg(a,p,t):wa(a,t,p)}}}function va(r){for(var t=Fa(),e=0,$=r.length;e<$;++e)nc(t,r[e]);return t}function fp(r,t,e){return Sa(Math.min.apply(null,r),Math.min.apply(null,t),Math.max.apply(null,r),Math.max.apply(null,t),e)}function Yd(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function qi(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function $b(r,t,e){var $,i;return($=t<r[0]?r[0]-t:r[2]<t?t-r[2]:0)*$+(i=e<r[1]?r[1]-e:r[3]<e?e-r[3]:0)*i}function xi(r,t){return Dg(r,t[0],t[1])}function kb(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function Dg(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function Fg(r,t){var e=r[0],$=r[1],i=r[2],o=r[3],n=t[0],p=t[1],a=xa.UNKNOWN;return n<e?a|=xa.LEFT:n>i&&(a|=xa.RIGHT),p<$?a|=xa.BELOW:p>o&&(a|=xa.ABOVE),a===xa.UNKNOWN&&(a=xa.INTERSECTING),a}function Fa(){return[1/0,1/0,-1/0,-1/0]}function Sa(r,t,e,$,i){return i?(i[0]=r,i[1]=t,i[2]=e,i[3]=$,i):[r,t,e,$]}function ec(r){return Sa(1/0,1/0,-1/0,-1/0,r)}function Wd(r,t){var e=r[0],$=r[1];return Sa(e,$,e,$,t)}function dp(r,t){return bp(ec(t),r)}function ij(r,t,e,$,i){return pj(ec(i),r,t,e,$)}function mc(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Fe(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function nc(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function bp(r,t){for(var e=0,$=t.length;e<$;++e)nc(r,t[e]);return r}function pj(r,t,e,$,i){for(;e<$;e+=i)Zo(r,t[e],t[e+1]);return r}function Zo(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function wj(r,t){var e;return(e=t(vb(r)))?e:(e=t(Sb(r)))?e:(e=t(Ob(r)))?e:(e=t(Ya(r)))||!1}function Vd(r){var t=0;return uf(r)||(t=ta(r)*Va(r)),t}function vb(r){return[r[0],r[1]]}function Sb(r){return[r[2],r[1]]}function Qb(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function Yo(r,t){var e;return t===Yc.BOTTOM_LEFT?e=vb(r):t===Yc.BOTTOM_RIGHT?e=Sb(r):t===Yc.TOP_LEFT?e=Ya(r):t===Yc.TOP_RIGHT?e=Ob(r):ia(!1,13),e}function nk(r,t,e,$,i){var o=t*$[0]/2,n=t*$[1]/2,p=Math.cos(e),a=Math.sin(e),x=o*p,D=o*a,Q=n*p,s=n*a,c=r[0],u=r[1],d=c-x+s,g=c-x-s,m=c+x-s,f=c+x+s,h=u-D-Q,l=u-D+Q,E=u+D+Q,R=u+D-Q;return Sa(Math.min(d,g,m,f),Math.min(h,l,E,R),Math.max(d,g,m,f),Math.max(h,l,E,R),i)}function Va(r){return r[3]-r[1]}function Rc(r,t,e){var $=e||Fa();return Ga(r,t)?(r[0]>t[0]?$[0]=r[0]:$[0]=t[0],r[1]>t[1]?$[1]=r[1]:$[1]=t[1],r[2]<t[2]?$[2]=r[2]:$[2]=t[2],r[3]<t[3]?$[3]=r[3]:$[3]=t[3]):ec($),$}function Ya(r){return[r[0],r[3]]}function Ob(r){return[r[2],r[3]]}function ta(r){return r[2]-r[0]}function Ga(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function uf(r){return r[2]<r[0]||r[3]<r[1]}function Xo(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function Lh(r,t){var e=(r[2]-r[0])/2*(t-1),$=(r[3]-r[1])/2*(t-1);r[0]-=e,r[2]+=e,r[1]-=$,r[3]+=$}function Wo(r,t,e){var $=!1,i=Fg(r,t),o=Fg(r,e);if(i===xa.INTERSECTING||o===xa.INTERSECTING)$=!0;else{var n=r[0],p=r[1],a=r[2],x=r[3],D=t[0],Q=t[1],s=e[0],c=e[1],u=(c-Q)/(s-D),d=void 0,g=void 0;o&xa.ABOVE&&!(i&xa.ABOVE)&&($=(d=s-(c-x)/u)>=n&&d<=a),$||!(o&xa.RIGHT)||i&xa.RIGHT||($=(g=c-(s-a)*u)>=p&&g<=x),$||!(o&xa.BELOW)||i&xa.BELOW||($=(d=s-(c-p)/u)>=n&&d<=a),$||!(o&xa.LEFT)||i&xa.LEFT||($=(g=c-(s-n)*u)>=p&&g<=x)}return $}function To(r,t,e,$){var i=[];if($>1)for(var o=r[2]-r[0],n=r[3]-r[1],p=0;p<$;++p)i.push(r[0]+o*p/$,r[1],r[2],r[1]+n*p/$,r[2]-o*p/$,r[3],r[0],r[3]-n*p/$);else i=[r[0],r[1],r[2],r[1],r[2],r[3],r[0],r[3]];t(i,i,2);for(var a=[],x=[],D=(p=0,i.length);p<D;p+=2)a.push(i[p]),x.push(i[p+1]);return fp(a,x,e)}function Qo(r,t){var e=t.getExtent(),$=Qb(r);if(t.canWrapX()&&($[0]<e[0]||$[0]>=e[2])){var i=ta(e),o=Math.floor(($[0]-e[0])/i)*i;r[0]-=o,r[2]-=o}return r}var Yc={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var xa={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Bf(e){return void 0!==e?0:void 0}function Zh(e){return void 0!==e?e:void 0}function Oo(e){var o=2*Math.PI/e;return function(e,r){return r?e:void 0!==e?e=Math.floor(e/o+.5)*o:void 0}}function No(e){var o=e||eb(5);return function(e,r){return r?e:void 0!==e?Math.abs(e)<=o?0:e:void 0}}var ya={ANIMATING:0,INTERACTING:1};var Ma={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Ko(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Io(t,e){var r=e.getRadius(),$=e.getCenter(),n=$[0],s=$[1],o=t[0]-n,a=t[1]-s;0===o&&0===a&&(o=1);var p=Math.sqrt(o*o+a*a);return[n+r*o/p,s+r*a/p]}function Sd(t,e){var r,$,n=t[0],s=t[1],o=e[0],a=e[1],p=o[0],j=o[1],i=a[0],G=a[1],x=i-p,c=G-j,u=0===x&&0===c?0:(x*(n-p)+c*(s-j))/(x*x+c*c||0);return u<=0?(r=p,$=j):u>=1?(r=i,$=G):(r=p+u*x,$=j+u*c),[r,$]}function $a(t,e){for(var r=!0,$=t.length-1;$>=0;--$)if(t[$]!=e[$]){r=!1;break}return r}function Qf(t,e){var r=Math.cos(e),$=Math.sin(e),n=t[0]*r-t[1]*$,s=t[1]*r+t[0]*$;return t[0]=n,t[1]=s,t}function Go(t,e){return t[0]*=e,t[1]*=e,t}function Ja(t,e){var r=t[0]-e[0],$=t[1]-e[1];return r*r+$*$}function Rd(t,e){return Math.sqrt(Ja(t,e))}function Qd(t,e){return Ja(t,Sd(t,e))}function $i(t,e){var r=e.getExtent();if(e.canWrapX()&&(t[0]<r[0]||t[0]>=r[2])){var $=ta(r),n=Math.floor((t[0]-r[0])/$);t[0]-=n*$}return t}function _i(e){return Math.pow(e,3)}function Mb(e){return 1-_i(1-e)}function Eo(e){return 3*e*e-2*e*e*e}function Do(e){return e}var aa={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};var Eb={};var sa={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var xg={};var Tc={};var Eg={};function Lb(r,t,e,$,o,a){for(var n=a||[],s=0,f=t;f<e;f+=$){var l=r[f],p=r[f+1];n[s++]=o[0]*l+o[2]*p+o[4],n[s++]=o[1]*l+o[3]*p+o[5]}return a&&n.length!=s&&(n.length=s),n}function zj(r,t,e,$,o,a,n){for(var s=n||[],f=Math.cos(o),l=Math.sin(o),p=a[0],w=a[1],x=0,G=t;G<e;G+=$){var L=r[G]-p,v=r[G+1]-w;s[x++]=p+L*f-v*l,s[x++]=w+L*l+v*f;for(var h=G+2;h<G+$;++h)s[x++]=r[h]}return n&&s.length!=x&&(s.length=x),s}function Co(r,t,e,$,o,a,n,s){for(var f=s||[],l=n[0],p=n[1],w=0,x=t;x<e;x+=$){var G=r[x]-l,L=r[x+1]-p;f[w++]=l+o*G,f[w++]=p+a*L;for(var v=x+2;v<x+$;++v)f[w++]=r[v]}return s&&f.length!=w&&(f.length=w),f}function Bj(r,t,e,$,o,a,n){for(var s=n||[],f=0,l=t;l<e;l+=$){s[f++]=r[l]+o,s[f++]=r[l+1]+a;for(var p=l+2;p<l+$;++p)s[f++]=r[p]}return n&&s.length!=f&&(s.length=f),s}function Og(t,r,o){var $;if(void 0!==r){for(var e=0,i=t.length;e<i;++e)r[e]=t[e];$=r}else $=t.slice();return $}function Lj(t,r,o){if(void 0!==r&&t!==r){for(var $=0,e=t.length;$<e;++$)r[$]=t[$];t=r}return t}function yo(t){fo(t.getCode(),t),Kd(t,t,Og)}function xo(t){t.forEach(yo)}function ua(t){return"string"==typeof t?go(t):t||null}function Vg(t,r,o,$){var e,i=(t=ua(t)).getPointResolutionFunc();if(i)e=i(r,o),$&&$!==t.getUnits()&&(n=t.getMetersPerUnit())&&(e=e*n/bb[$]);else if(t.getUnits()==Ca.DEGREES&&!$||$==Ca.DEGREES)e=r;else{var n,s=yc(t,ua("EPSG:4326")),a=[o[0]-r/2,o[1],o[0]+r/2,o[1],o[0],o[1]-r/2,o[0],o[1]+r/2];a=s(a,a,2),e=(Ce(a.slice(0,2),a.slice(2,4))+Ce(a.slice(4,6),a.slice(6,8)))/2,void 0!==(n=$?bb[$]:t.getMetersPerUnit())&&(e/=n)}return e}function sk(t){xo(t),t.forEach(function(r){t.forEach(function(t){r!==t&&Kd(r,t,Og)})})}function wo(t,r,o,$){t.forEach(function(t){r.forEach(function(r){Kd(t,r,o),Kd(r,t,$)})})}function dh(t,r){return t?"string"==typeof t?ua(t):t:ua(r)}function Kb(t,r){if(t===r)return!0;var o=t.getUnits()===r.getUnits();return t.getCode()===r.getCode()?o:yc(t,r)===Og&&o}function yc(t,r){var o=t.getCode(),$=r.getCode(),e=ho(o,$);return e||(e=Lj),e}function ad(t,r){return yc(ua(t),ua(r))}function rh(t,r,o){return ad(r,o)(t,void 0,t.length)}function yh(t,r,o,$){var e=ad(r,o);return To(t,e,void 0,$)}var Nd=6371008.8;function Ce(e,t,r){var $=r||Nd,a=eb(e[1]),o=eb(t[1]),n=(o-a)/2,E=eb(t[0]-e[0])/2,R=Math.sin(n)*Math.sin(n)+Math.sin(E)*Math.sin(E)*Math.cos(a)*Math.cos(o);return 2*$*Math.atan2(Math.sqrt(R),Math.sqrt(1-R))}function Ee(e,t){for(var r=0,$=0,a=e.length;$<a-1;++$)r+=Ce(e[$],e[$+1],t);return r}function qo(e,t){var r=t||{},$=r.radius||Nd,a=r.projection||"EPSG:3857",o=e.getType();o!==aa.GEOMETRY_COLLECTION&&(e=e.clone().transform(a,"EPSG:4326"));var n,E,R,p,s,i,q=0;switch(o){case aa.POINT:case aa.MULTI_POINT:break;case aa.LINE_STRING:case aa.LINEAR_RING:q=Ee(n=e.getCoordinates(),$);break;case aa.MULTI_LINE_STRING:case aa.POLYGON:for(R=0,p=(n=e.getCoordinates()).length;R<p;++R)q+=Ee(n[R],$);break;case aa.MULTI_POLYGON:for(R=0,p=(n=e.getCoordinates()).length;R<p;++R)for(s=0,i=(E=n[R]).length;s<i;++s)q+=Ee(E[s],$);break;case aa.GEOMETRY_COLLECTION:var m=e.getGeometries();for(R=0,p=m.length;R<p;++R)q+=qo(m[R],t);break;default:throw new Error("Unsupported geometry type: "+o);}return q}function Md(e,t){for(var r=0,$=e.length,a=e[$-1][0],o=e[$-1][1],n=0;n<$;n++){var E=e[n][0],R=e[n][1];r+=eb(E-a)*(2+Math.sin(eb(o))+Math.sin(eb(R))),a=E,o=R}return r*t*t/2}function oo(e,t){var r=t||{},$=r.radius||Nd,a=r.projection||"EPSG:3857",o=e.getType();o!==aa.GEOMETRY_COLLECTION&&(e=e.clone().transform(a,"EPSG:4326"));var n,E,R,p,s,i,q=0;switch(o){case aa.POINT:case aa.MULTI_POINT:case aa.LINE_STRING:case aa.MULTI_LINE_STRING:case aa.LINEAR_RING:break;case aa.POLYGON:for(n=e.getCoordinates(),q=Math.abs(Md(n[0],$)),R=1,p=n.length;R<p;++R)q-=Math.abs(Md(n[R],$));break;case aa.MULTI_POLYGON:for(R=0,p=(n=e.getCoordinates()).length;R<p;++R)for(E=n[R],q+=Math.abs(Md(E[0],$)),s=1,i=E.length;s<i;++s)q-=Math.abs(Md(E[s],$));break;case aa.GEOMETRY_COLLECTION:var m=e.getGeometries();for(R=0,p=m.length;R<p;++R)q+=oo(m[R],t);break;default:throw new Error("Unsupported geometry type: "+o);}return q}function mo(e,t,r,$){var a=$||Nd,o=eb(e[1]),n=eb(e[0]),E=t/a,R=Math.asin(Math.sin(o)*Math.cos(E)+Math.cos(o)*Math.sin(E)*Math.cos(r)),p=n+Math.atan2(Math.sin(r)*Math.sin(E)*Math.cos(o),Math.cos(E)-Math.sin(o)*Math.sin(R));return[Dk(p),Dk(R)]}var nb={};var b=arguments[0];var Ca={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},bb={};bb[Ca.DEGREES]=2*Math.PI*6370997/360,bb[Ca.FEET]=.3048,bb[Ca.METERS]=1,bb[Ca.USFEET]=1200/3937;var Vh=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_||bb[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}();var ko=nb&&nb.__extends||function(){var o=function($,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,$){o.__proto__=$}||function(o,$){for(var r in $)$.hasOwnProperty(r)&&(o[r]=$[r])})($,r)};return function($,r){function t(){this.constructor=$}o($,r),$.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}}(),Ic=6378137;nb.RADIUS=Ic;var Hb=Math.PI*Ic;nb.HALF_SIZE=Hb;var mi=[-Hb,-Hb,Hb,Hb];nb.EXTENT=mi;var oi=[-180,-85,180,85];nb.WORLD_EXTENT=oi;var Gb=function(o){function $($){return o.call(this,{code:$,units:Ca.METERS,extent:mi,global:!0,worldExtent:oi,getPointResolution:function(o,$){return o/lp($[1]/Ic)}})||this}return ko($,o),$}(Vh),Ue=[new Gb("EPSG:3857"),new Gb("EPSG:102100"),new Gb("EPSG:102113"),new Gb("EPSG:900913"),new Gb("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Gb("urn:ogc:def:crs:EPSG::3857"),new Gb("http://www.opengis.net/gml/srs/epsg.xml#3857")];function si(o,$,r){var t=o.length,e=r>1?r:2,s=$;void 0===s&&(s=e>2?o.slice():new Array(t));for(var n=Hb,l=0;l<t;l+=e){s[l]=n*o[l]/180;var h=Ic*Math.log(Math.tan(Math.PI*(+o[l+1]+90)/360));h>n?h=n:h<-n&&(h=-n),s[l+1]=h}return s}function vi(o,$,r){var t=o.length,e=r>1?r:2,s=$;void 0===s&&(s=e>2?o.slice():new Array(t));for(var n=0;n<t;n+=e)s[n]=180*o[n]/Hb,s[n+1]=360*Math.atan(Math.exp(o[n+1]/Ic))/Math.PI-90;return s}nb.PROJECTIONS=Ue,nb.fromEPSG4326=si,nb.toEPSG4326=vi;var cc={};var jo=cc&&cc.__extends||function(){var n=function(r,$){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var $ in r)r.hasOwnProperty($)&&(n[$]=r[$])})(r,$)};return function(r,$){function e(){this.constructor=r}n(r,$),r.prototype=null===$?Object.create($):(e.prototype=$.prototype,new e)}}(),Bi=6378137;cc.RADIUS=Bi;var Xe=[-180,-90,180,90];cc.EXTENT=Xe;var Li=Math.PI*Bi/180;cc.METERS_PER_UNIT=Li;var Cb=function(n){function r(r,$){return n.call(this,{code:r,units:Ca.DEGREES,extent:Xe,axisOrientation:$,global:!0,metersPerUnit:Li,worldExtent:Xe})||this}return jo(r,n),r}(Vh),af=[new Cb("CRS:84"),new Cb("EPSG:4326","neu"),new Cb("urn:ogc:def:crs:EPSG::4326","neu"),new Cb("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Cb("urn:ogc:def:crs:OGC:1.3:CRS84"),new Cb("urn:ogc:def:crs:OGC:2:84"),new Cb("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Cb("urn:x-ogc:def:crs:EPSG:4326","neu")];cc.PROJECTIONS=af;var Ac={};function Kd($,r,e){var t=$.getCode(),o=r.getCode();t in Ac||(Ac[t]={}),Ac[t][o]=e}function ho($,r){var e;return $ in Ac&&r in Ac[$]&&(e=Ac[$][r]),e}var Vi={};function go($){return Vi[$]||null}function fo($,t){Vi[$]=t}var rb=null;function Ka(){return rb}function Ib(t,r){return rb?rh(t,r,rb):t}function ka(t,r){return rb?rh(t,rb,r):t}function $c(t,r){return rb?yh(t,r,rb):t}function sb(t,r){return rb?yh(t,rb,r):t}function eo(){sk(Ue),sk(af),wo(af,Ue,si,vi)}eo();var c=new Array(6);function Ta(){return[1,0,0,1,0,0]}function $n(e,$,t,r,o,p,n){return e[0]=$,e[1]=t,e[2]=r,e[3]=o,e[4]=p,e[5]=n,e}function Zn(e,$){return e[0]=$[0],e[1]=$[1],e[2]=$[2],e[3]=$[3],e[4]=$[4],e[5]=$[5],e}function pa(e,$){var t=$[0],r=$[1];return $[0]=e[0]*t+e[2]*r+e[4],$[1]=e[1]*t+e[3]*r+e[5],$}function Yn(e,$,t){return $n(e,$,0,0,t,0,0)}function mb(e,$,t,r,o,p,n,A){var P=Math.sin(p),s=Math.cos(p);return e[0]=r*s,e[1]=o*P,e[2]=-r*P,e[3]=o*s,e[4]=n*r*s-A*r*P+$,e[5]=n*o*P+A*o*s+t,e}function Hf(e,$){var t=Xn($);ia(0!==t,32);var r=$[0],o=$[1],p=$[2],n=$[3],A=$[4],P=$[5];return e[0]=n/t,e[1]=-o/t,e[2]=-p/t,e[3]=r/t,e[4]=(p*P-n*A)/t,e[5]=-(r*P-o*A)/t,e}function Xn(e){return e[0]*e[3]-e[1]*e[2]}function Jf(e){return"matrix("+e.join(", ")+")"}var Vn=Eg&&Eg.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),Gj=Ta(),Lf=function(t){function r(){var r=t.call(this)||this;return r.extent_=Fa(),r.extentRevision_=-1,r.simplifiedGeometryMaxMinSquaredTolerance=0,r.simplifiedGeometryRevision=0,r.simplifyTransformedInternal=iq(function(t,r,e){if(!e)return this.getSimplifiedGeometry(r);var o=this.clone();return o.applyTransform(e),o.getSimplifiedGeometry(r)}),r}return Vn(r,t),r.prototype.simplifyTransformed=function(t,r){return this.simplifyTransformedInternal(this.getRevision(),t,r)},r.prototype.clone=function(){return ca()},r.prototype.closestPointXY=function(t,r,e,o){return ca()},r.prototype.containsXY=function(t,r){var e=this.getClosestPoint([t,r]);return e[0]===t&&e[1]===r},r.prototype.getClosestPoint=function(t,r){var e=r||[NaN,NaN];return this.closestPointXY(t[0],t[1],e,1/0),e},r.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},r.prototype.computeExtent=function(t){return ca()},r.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),Xo(this.extent_,t)},r.prototype.rotate=function(t,r){ca()},r.prototype.scale=function(t,r,e){ca()},r.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},r.prototype.getSimplifiedGeometry=function(t){return ca()},r.prototype.getType=function(){return ca()},r.prototype.applyTransform=function(t){ca()},r.prototype.intersectsExtent=function(t){return ca()},r.prototype.translate=function(t,r){ca()},r.prototype.transform=function(t,r){var e=ua(t),o=e.getUnits()==Ca.TILE_PIXELS?function(t,o,n){var s=e.getExtent(),i=e.getWorldExtent(),$=Va(i)/Va(s);return mb(Gj,i[0],i[3],$,-$,0,0,0),Lb(t,0,t.length,n,Gj,o),ad(e,r)(t,o,n)}:ad(e,r);return this.applyTransform(o),this},r}(Oa);Eg.default=Lf;var Un=Tc&&Tc.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),db=function(t){function r(){var r=t.call(this)||this;return r.layout=sa.XY,r.stride=2,r.flatCoordinates=null,r}return Un(r,t),r.prototype.computeExtent=function(t){return ij(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinates=function(){return ca()},r.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},r.prototype.getFlatCoordinates=function(){return this.flatCoordinates},r.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},r.prototype.getLayout=function(){return this.layout},r.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var r=this.getSimplifiedGeometryInternal(t);return r.getFlatCoordinates().length<this.flatCoordinates.length?r:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},r.prototype.getSimplifiedGeometryInternal=function(t){return this},r.prototype.getStride=function(){return this.stride},r.prototype.setFlatCoordinates=function(t,r){this.stride=Pf(t),this.layout=t,this.flatCoordinates=r},r.prototype.setCoordinates=function(t,r){ca()},r.prototype.setLayout=function(t,r,e){var o;if(t)o=Pf(t);else{for(var i=0;i<e;++i){if(0===r.length)return this.layout=sa.XY,void(this.stride=2);r=r[0]}t=Sn(o=r.length)}this.layout=t,this.stride=o},r.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},r.prototype.rotate=function(t,r){var e=this.getFlatCoordinates();if(e){var o=this.getStride();zj(e,0,e.length,o,t,r,e),this.changed()}},r.prototype.scale=function(t,r,e){var o=r;void 0===o&&(o=t);var i=e;i||(i=Qb(this.getExtent()));var n=this.getFlatCoordinates();if(n){var a=this.getStride();Co(n,0,n.length,a,t,o,i,n),this.changed()}},r.prototype.translate=function(t,r){var e=this.getFlatCoordinates();if(e){var o=this.getStride();Bj(e,0,e.length,o,t,r,e),this.changed()}},r}(Lf);function Sn(t){var r;return 2==t?r=sa.XY:3==t?r=sa.XYZ:4==t&&(r=sa.XYZM),r}function Pf(t){var r;return t==sa.XY?r=2:t==sa.XYZ||t==sa.XYM?r=3:t==sa.XYZM&&(r=4),r}function Yj(t,r,e){var o=t.getFlatCoordinates();if(o){var i=t.getStride();return Lb(o,0,o.length,i,r,e)}return null}Tc.getStrideForLayout=Pf,Tc.transformGeom2D=Yj,Tc.default=db;function ck(r,n,$,e){for(var i=0,t=r[$-e],a=r[$-e+1];n<$;n+=e){var o=r[n],g=r[n+1];i+=a*o-t*g,t=o,a=g}return i/2}function jk(r,n,$,e){for(var i=0,t=0,a=$.length;t<a;++t){var o=$[t];i+=ck(r,n,o,e),n=o}return i}function On(r,n,$,e){for(var i=0,t=0,a=$.length;t<a;++t){var o=$[t];i+=jk(r,n,o,e),n=o[o.length-1]}return i}function qk(r,a,t,e,$,s,o){var n,i=r[a],l=r[a+1],M=r[t]-i,u=r[t+1]-l;if(0===M&&0===u)n=a;else{var x=(($-i)*M+(s-l)*u)/(M*M+u*u);if(x>1)n=t;else{if(x>0){for(var p=0;p<e;++p)o[p]=oc(r[a+p],r[t+p],x);return void(o.length=e)}n=a}}for(p=0;p<e;++p)o[p]=r[n+p];o.length=e}function Rf(r,a,t,e,$){var s=r[a],o=r[a+1];for(a+=e;a<t;a+=e){var n=r[a],i=r[a+1],l=Db(s,o,n,i);l>$&&($=l),s=n,o=i}return $}function Sf(r,a,t,e,$){for(var s=0,o=t.length;s<o;++s){var n=t[s];$=Rf(r,a,n,e,$),a=n}return $}function Ln(r,a,t,e,$){for(var s=0,o=t.length;s<o;++s){var n=t[s];$=Sf(r,a,n,e,$),a=n[n.length-1]}return $}function Vf(r,a,t,e,$,s,o,n,i,l,M){if(a==t)return l;var u,x;if(0===$){if((x=Db(o,n,r[a],r[a+1]))<l){for(u=0;u<e;++u)i[u]=r[a+u];return i.length=e,x}return l}for(var p=M||[NaN,NaN],f=a+e;f<t;)if(qk(r,f-e,f,e,o,n,p),(x=Db(o,n,p[0],p[1]))<l){for(l=x,u=0;u<e;++u)i[u]=p[u];i.length=e,f+=e}else f+=e*Math.max((Math.sqrt(x)-Math.sqrt(l))/$|0,1);if(s&&(qk(r,t-e,a,e,o,n,p),(x=Db(o,n,p[0],p[1]))<l)){for(l=x,u=0;u<e;++u)i[u]=p[u];i.length=e}return l}function Ae(r,a,t,e,$,s,o,n,i,l,M){for(var u=M||[NaN,NaN],x=0,p=t.length;x<p;++x){var f=t[x];l=Vf(r,a,f,e,$,s,o,n,i,l,u),a=f}return l}function Kn(r,a,t,e,$,s,o,n,i,l,M){for(var u=M||[NaN,NaN],x=0,p=t.length;x<p;++x){var f=t[x];l=Ae(r,a,f,e,$,s,o,n,i,l,u),a=f[f.length-1]}return l}function Ek(e,r,t,o){for(var a=0,$=t.length;a<$;++a)e[r++]=t[a];return r}function Cd(e,r,t,o){for(var a=0,$=t.length;a<$;++a)for(var n=t[a],d=0;d<o;++d)e[r++]=n[d];return r}function $f(e,r,t,o,a){for(var $=a||[],n=0,d=0,l=t.length;d<l;++d){var f=Cd(e,r,t[d],o);$[n++]=f,r=f}return $.length=n,$}function In(e,r,t,o,a){for(var $=a||[],n=0,d=0,l=t.length;d<l;++d){var f=$f(e,r,t[d],o,$[n]);$[n++]=f,r=f[f.length-1]}return $.length=n,$}function Nc(r,n,t,e,o){for(var a=void 0!==o?o:[],l=0,i=n;i<t;i+=e)a[l++]=r.slice(i,i+e);return a.length=l,a}function Bd(r,n,t,e,o){for(var a=void 0!==o?o:[],l=0,i=0,$=t.length;i<$;++i){var f=t[i];a[l++]=Nc(r,n,f,e,a[l]),n=f}return a.length=l,a}function Bh(r,n,t,e,o){for(var a=void 0!==o?o:[],l=0,i=0,$=t.length;i<$;++i){var f=t[i];a[l++]=Bd(r,n,f,e,a[l]),n=f[f.length-1]}return a.length=l,a}function fg(r,t,$,e,p,a,o){var n=($-t)/e;if(n<3){for(;t<$;t+=e)a[o++]=r[t],a[o++]=r[t+1];return o}var u=new Array(n);u[0]=1,u[n-1]=1;for(var i=[t,$-e],s=0;i.length>0;){for(var E=i.pop(),I=i.pop(),x=0,l=r[I],c=r[I+1],f=r[E],g=r[E+1],d=I+e;d<E;d+=e){var v=r[d],y=r[d+1],h=jp(v,y,l,c,f,g);h>x&&(s=d,x=h)}x>p&&(u[(s-t)/e]=1,I+e<s&&i.push(I,s),s+e<E&&i.push(s,E))}for(d=0;d<n;++d)u[d]&&(a[o++]=r[t+d*e],a[o++]=r[t+d*e+1]);return o}function Hn(r,t,$,e,p,a,o,n){for(var u=0,i=$.length;u<i;++u){var s=$[u];o=fg(r,t,s,e,p,a,o),n.push(o),t=s}return o}function Vb(r,t){return t*Math.round(r/t)}function En(r,t,$,e,p,a,o){if(t==$)return o;var n,u,i=Vb(r[t],p),s=Vb(r[t+1],p);t+=e,a[o++]=i,a[o++]=s;do{if(n=Vb(r[t],p),u=Vb(r[t+1],p),(t+=e)==$)return a[o++]=n,a[o++]=u,o}while(n==i&&u==s);for(;t<$;){var E=Vb(r[t],p),I=Vb(r[t+1],p);if(t+=e,E!=n||I!=u){var x=n-i,l=u-s,c=E-i,f=I-s;x*f==l*c&&(x<0&&c<x||x==c||x>0&&c>x)&&(l<0&&f<l||l==f||l>0&&f>l)?(n=E,u=I):(a[o++]=n,a[o++]=u,i=n,s=u,n=E,u=I)}}return a[o++]=n,a[o++]=u,o}function Kh(r,t,$,e,p,a,o,n){for(var u=0,i=$.length;u<i;++u){var s=$[u];o=En(r,t,s,e,p,a,o),n.push(o),t=s}return o}function Dn(r,t,$,e,p,a,o,n){for(var u=0,i=$.length;u<i;++u){var s=$[u],E=[];o=Kh(r,t,s,e,p,a,o,E),n.push(E),t=s[s.length-1]}return o}var Cn=xg&&xg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),mg=function(t){function e(e,r){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?o.setCoordinates(e,r):o.setFlatCoordinates(r,e),o}return Cn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,o){return o<$b(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Rf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Vf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,o))},e.prototype.getArea=function(){return ck(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Nc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=fg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,sa.XY)},e.prototype.getType=function(){return aa.LINEAR_RING},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=Cd(this.flatCoordinates,0,t,this.stride),this.changed()},e}(db);xg.default=mg;var ng={};var Bn=ng&&ng.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),ob=function(t){function e(e,r){var o=t.call(this)||this;return o.setCoordinates(e,r),o}return Bn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,o){var n=this.flatCoordinates,i=Db(t,e,n[0],n[1]);if(i<o){for(var s=this.stride,a=0;a<s;++a)r[a]=n[a];return r.length=s,i}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return Wd(this.flatCoordinates,t)},e.prototype.getType=function(){return aa.POINT},e.prototype.intersectsExtent=function(t){return Dg(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=Ek(this.flatCoordinates,0,t,this.stride),this.changed()},e}(db);ng.default=ob;function An(n,r,t,i,e){return!wj(e,function(e){return!Zb(n,r,t,i,e[0],e[1])})}function Zb(n,r,t,i,e,$){for(var o=0,a=n[t-i],d=n[t-i+1];r<t;r+=i){var s=n[r],l=n[r+1];d<=$?l>$&&(s-a)*($-d)-(e-a)*(l-d)>0&&o++:l<=$&&(s-a)*($-d)-(e-a)*(l-d)<0&&o--,a=s,d=l}return 0!==o}function ug(n,r,t,i,e,$){if(0===t.length)return!1;if(!Zb(n,r,t[0],i,e,$))return!1;for(var o=1,a=t.length;o<a;++o)if(Zb(n,t[o-1],t[o],i,e,$))return!1;return!0}function zn(n,r,t,i,e,$){if(0===t.length)return!1;for(var o=0,a=t.length;o<a;++o){var d=t[o];if(ug(n,r,d,i,e,$))return!0;r=d[d.length-1]}return!1}function Xh(r,t,e,o,n,$,i){for(var a,v,s,N,p,f,u,g=n[$+1],D=[],U=0,l=e.length;U<l;++U){var x=e[U];for(N=r[x-o],f=r[x-o+1],a=t;a<x;a+=o)p=r[a],u=r[a+1],(g<=f&&u<=g||f<=g&&g<=u)&&(s=(g-f)/(u-f)*(p-N)+N,D.push(s)),N=p,f=u}var y=NaN,h=-1/0;for(D.sort(tb),N=D[0],a=1,v=D.length;a<v;++a){p=D[a];var A=Math.abs(p-N);A>h&&(s=(N+p)/2,ug(r,t,e,o,s,g)&&(y=s,h=A)),N=p}return isNaN(y)&&(y=n[$]),i?(i.push(y,g,h),i):[y,g,h]}function yn(r,t,e,o,n){for(var $=[],i=0,a=e.length;i<a;++i){var v=e[i];$=Xh(r,t,v,o,n,2*i,$),t=v[v.length-1]}return $}function yd(r,i,t,e,n){var $=pj(Fa(),r,i,t,e);return!!Ga(n,$)&&(!!kb(n,$)||$[0]>=n[0]&&$[2]<=n[2]||$[1]>=n[1]&&$[3]<=n[3]||ci(r,i,t,e,function(r,i){return Wo(n,r,i)}))}function xn(r,i,t,e,n){for(var $=0,s=t.length;$<s;++$){if(yd(r,i,t[$],e,n))return!0;i=t[$]}return!1}function vn(r,i,t,e,n){return!!yd(r,i,t,e,n)||!!Zb(r,i,t,e,n[0],n[1])||!!Zb(r,i,t,e,n[0],n[3])||!!Zb(r,i,t,e,n[2],n[1])||!!Zb(r,i,t,e,n[2],n[3])}function ai(r,i,t,e,n){if(!vn(r,i,t[0],e,n))return!1;if(1===t.length)return!0;for(var $=1,s=t.length;$<s;++$)if(An(r,t[$-1],t[$],e,n)&&!yd(r,t[$-1],t[$],e,n))return!1;return!0}function un(r,i,t,e,n){for(var $=0,s=t.length;$<s;++$){var o=t[$];if(ai(r,i,o,e,n))return!0;i=o[o.length-1]}return!1}function ci(r,$,o,t,e){for(var f,i=[r[$],r[$+1]],a=[];$+t<o;$+=t){if(a[0]=r[$+t],a[1]=r[$+t+1],f=e(i,a))return f;i[0]=a[0],i[1]=a[1]}return!1}function di(r,e,n,i){for(var $=0,t=r[n-i],o=r[n-i+1];e<n;e+=i){var s=r[e],a=r[e+1];$+=(s-t)*(a+o),t=s,o=a}return $>0}function ei(r,e,n,i,$){for(var t=void 0!==$&&$,o=0,s=n.length;o<s;++o){var a=n[o],c=di(r,e,a,i);if(0===o){if(t&&c||!t&&!c)return!1}else if(t&&!c||!t&&c)return!1;e=a}return!0}function on(r,e,n,i,$){for(var t=0,o=n.length;t<o;++t){var s=n[t];if(!ei(r,e,s,i,$))return!1;s.length&&(e=s[s.length-1])}return!0}function yg(r,e,n,i,$){for(var t=void 0!==$&&$,o=0,s=n.length;o<s;++o){var a=n[o],c=di(r,e,a,i);(0===o?t&&c||!t&&!c:t&&!c||!t&&c)&&nn(r,e,a,i),e=a}return e}function li(r,e,n,i,$){for(var t=0,o=n.length;t<o;++t)e=yg(r,e,n[t],i,$);return e}function nn(o,r,e,$){for(;r<e-$;){for(var t=0;t<$;++t){var a=o[r+t];o[r+t]=o[e-$+t],o[e-$+t]=a}r+=$,e-=$}}var hn=Eb&&Eb.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),_a=function(t){function e(e,r,i){var o=t.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,void 0!==r&&i?(o.setFlatCoordinates(r,e),o.ends_=i):o.setCoordinates(e,r),o}return hn(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Pa(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,i){return i<$b(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Sf(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ae(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,i))},e.prototype.containsXY=function(t,e){return ug(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return jk(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),yg(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Bd(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Qb(this.getExtent());this.flatInteriorPoint_=Xh(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ob(this.getFlatInteriorPoint(),sa.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new mg(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,i=[],o=0,n=0,s=r.length;n<s;++n){var a=r[n],$=new mg(e.slice(o,a),t);i.push($),o=a}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;ei(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=yg(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=Kh(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,i),new e(r,sa.XY,i)},e.prototype.getType=function(){return aa.POLYGON},e.prototype.intersectsExtent=function(t){return ai(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=$f(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(db);function gn(t,e,r,i){for(var o=r||32,n=[],s=0;s<o;++s)Pa(n,mo(t,e,2*Math.PI*s/o,i));return n.push(n[0],n[1]),new _a(n,sa.XY,[n.length])}function _b(t){var e=t[0],r=t[1],i=t[2],o=t[3],n=[e,r,e,o,i,o,i,r,e,r];return new _a(n,sa.XY,[n.length])}function dc(t,e,r){for(var i=e||32,o=t.getStride(),n=t.getLayout(),s=t.getCenter(),a=o*(i+1),$=new Array(a),w=0;w<a;w+=o){$[w]=0,$[w+1]=0;for(var l=2;l<o;l++)$[w+l]=s[l]}var p=[$.length],h=new _a($,n,p);return Ng(h,s,t.getRadius(),r),h}function Ng(t,e,r,i){for(var o=t.getFlatCoordinates(),n=t.getStride(),s=o.length/n-1,a=i||0,$=0;$<=s;++$){var w=$*n,l=a+2*ac($,s)*Math.PI/s;o[w]=e[0]+r*Math.cos(l),o[w+1]=e[1]+r*Math.sin(l)}t.changed()}Eb.default=_a,Eb.circular=gn,Eb.fromExtent=_b,Eb.fromCircle=dc,Eb.makeRegular=Ng;var fn=Yb&&Yb.__extends||function(){var t=function(o,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])})(o,e)};return function(o,e){function i(){this.constructor=o}t(o,e),o.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Pg=0,td=function(t){function o(o){var e=t.call(this)||this,i=Da({},o);return e.hints_=[0,0],e.animations_=[],e.updateAnimationKey_,e.projection_=dh(i.projection,"EPSG:3857"),e.viewportSize_=[100,100],e.targetCenter_=null,e.targetResolution_,e.targetRotation_,e.cancelAnchor_=void 0,i.center&&(i.center=ka(i.center,e.projection_)),i.extent&&(i.extent=sb(i.extent,e.projection_)),e.applyOptions_(i),e}return fn(o,t),o.prototype.applyOptions_=function(t){var o=Gi(t);this.maxResolution_=o.maxResolution,this.minResolution_=o.minResolution,this.zoomFactor_=o.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=o.minZoom;var e=Fi(t),i=o.constraint,n=Ii(t);this.constraints_={center:e,resolution:i,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},o.prototype.getUpdatedOptions_=function(t){var o=Da({},this.options_);return void 0!==o.resolution?o.resolution=this.getResolution():o.zoom=this.getZoom(),o.center=this.getCenterInternal(),o.rotation=this.getRotation(),Da({},o,t)},o.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var o=new Array(arguments.length),e=0;e<o.length;++e){var i=arguments[e];i.center&&((i=Da({},i)).center=ka(i.center,this.getProjection())),i.anchor&&((i=Da({},i)).anchor=ka(i.anchor,this.getProjection())),o[e]=i}this.animateInternal.apply(this,o)},o.prototype.animateInternal=function(t){var o,e=arguments.length;if(e>1&&"function"==typeof arguments[e-1]&&(o=arguments[e-1],--e),!this.isDef()){var i=arguments[e-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(o&&sd(o,!0))}for(var n=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,h=[],p=0;p<e;++p){var $=arguments[p],u={start:n,complete:!1,anchor:$.anchor,duration:void 0!==$.duration?$.duration:1e3,easing:$.easing||Eo,callback:o};if($.center&&(u.sourceCenter=r,u.targetCenter=$.center.slice(),r=u.targetCenter),void 0!==$.zoom?(u.sourceResolution=s,u.targetResolution=this.getResolutionForZoom($.zoom),s=u.targetResolution):$.resolution&&(u.sourceResolution=s,u.targetResolution=$.resolution,s=u.targetResolution),void 0!==$.rotation){u.sourceRotation=a;var l=ac($.rotation-a+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=a+l,a=u.targetRotation}Ki(u)?u.complete=!0:n+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(ya.ANIMATING,1),this.updateAnimations_()},o.prototype.getAnimating=function(){return this.hints_[ya.ANIMATING]>0},o.prototype.getInteracting=function(){return this.hints_[ya.INTERACTING]>0},o.prototype.cancelAnimations=function(){var t;this.setHint(ya.ANIMATING,-this.hints_[ya.ANIMATING]);for(var o=0,e=this.animations_.length;o<e;++o){var i=this.animations_[o];if(i[0].callback&&sd(i[0].callback,!1),!t)for(var n=0,r=i.length;n<r;++n){var s=i[n];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},o.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),o=!1,e=this.animations_.length-1;e>=0;--e){for(var i=this.animations_[e],n=!0,r=0,s=i.length;r<s;++r){var a=i[r];if(!a.complete){var h=t-a.start,p=a.duration>0?h/a.duration:1;p>=1?(a.complete=!0,p=1):n=!1;var $=a.easing(p);if(a.sourceCenter){var u=a.sourceCenter[0],l=a.sourceCenter[1],c=u+$*(a.targetCenter[0]-u),m=l+$*(a.targetCenter[1]-l);this.targetCenter_=[c,m]}if(a.sourceResolution&&a.targetResolution){var g=1===$?a.targetResolution:a.sourceResolution+$*(a.targetResolution-a.sourceResolution);if(a.anchor){var E=this.getViewportSize_(this.getRotation()),N=this.constraints_.resolution(g,0,E,!0);this.targetCenter_=this.calculateCenterZoom(N,a.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var _=1===$?ac(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+$*(a.targetRotation-a.sourceRotation);if(a.anchor){var q=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(q,a.anchor)}this.targetRotation_=_}if(this.applyTargetState_(!0),o=!0,!a.complete)break}}if(n){this.animations_[e]=null,this.setHint(ya.ANIMATING,-1);var R=i[0].callback;R&&sd(R,!0)}}this.animations_=this.animations_.filter(Boolean),o&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},o.prototype.calculateCenterRotate=function(t,o){var e,i=this.getCenterInternal();return void 0!==i&&(e=[i[0]-o[0],i[1]-o[1]],Qf(e,t-this.getRotation()),Ko(e,o)),e},o.prototype.calculateCenterZoom=function(t,o){var e,i=this.getCenterInternal(),n=this.getResolution();void 0!==i&&void 0!==n&&(e=[o[0]-t*(o[0]-i[0])/n,o[1]-t*(o[1]-i[1])/n]);return e},o.prototype.getViewportSize_=function(t){var o=this.viewportSize_;if(t){var e=o[0],i=o[1];return[Math.abs(e*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(e*Math.sin(t))+Math.abs(i*Math.cos(t))]}return o},o.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.resolveConstraints(0)},o.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Ib(t,this.getProjection()):t},o.prototype.getCenterInternal=function(){return this.get(Ma.CENTER)},o.prototype.getConstraints=function(){return this.constraints_},o.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},o.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},o.prototype.calculateExtent=function(t){var o=this.calculateExtentInternal(t);return $c(o,this.getProjection())},o.prototype.calculateExtentInternal=function(t){var o=t||this.getViewportSize_(),e=this.getCenterInternal();ia(e,1);var i=this.getResolution();ia(void 0!==i,2);var n=this.getRotation();return ia(void 0!==n,3),nk(e,i,n,o)},o.prototype.getMaxResolution=function(){return this.maxResolution_},o.prototype.getMinResolution=function(){return this.minResolution_},o.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},o.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},o.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},o.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},o.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},o.prototype.getProjection=function(){return this.projection_},o.prototype.getResolution=function(){return this.get(Ma.RESOLUTION)},o.prototype.getResolutions=function(){return this.resolutions_},o.prototype.getResolutionForExtent=function(t,o){return this.getResolutionForExtentInternal(sb(t,this.getProjection()),o)},o.prototype.getResolutionForExtentInternal=function(t,o){var e=o||this.getViewportSize_(),i=ta(t)/e[0],n=Va(t)/e[1];return Math.max(i,n)},o.prototype.getResolutionForValueFunction=function(t){var o=t||2,e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(o);return function(t){return e/Math.pow(o,t*n)}},o.prototype.getRotation=function(){return this.get(Ma.ROTATION)},o.prototype.getValueForResolutionFunction=function(t){var o=Math.log(t||2),e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/o;return function(t){return Math.log(e/t)/o/n}},o.prototype.getState=function(){var t=this.getCenterInternal(),o=this.getProjection(),e=this.getResolution(),i=this.getRotation();return{center:t.slice(0),projection:void 0!==o?o:null,resolution:e,rotation:i,zoom:this.getZoom()}},o.prototype.getZoom=function(){var t,o=this.getResolution();return void 0!==o&&(t=this.getZoomForResolution(o)),t},o.prototype.getZoomForResolution=function(t){var o,e,i=this.minZoom_||0;if(this.resolutions_){var n=Af(this.resolutions_,t,1);i=n,o=this.resolutions_[n],e=n==this.resolutions_.length-1?2:o/this.resolutions_[n+1]}else o=this.maxResolution_,e=this.zoomFactor_;return i+Math.log(o/t)/Math.log(e)},o.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var o=wa(Math.floor(t),0,this.resolutions_.length-2),e=this.resolutions_[o]/this.resolutions_[o+1];return this.resolutions_[o]/Math.pow(e,wa(t-o,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},o.prototype.fit=function(t,o){var e,i=Da({size:this.getViewportSize_()},o||{});if(ia(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){ia(!uf(t),25);var n=sb(t,this.getProjection());e=_b(n)}else if(t.getType()===aa.CIRCLE){n=sb(t.getExtent(),this.getProjection());(e=_b(n)).rotate(this.getRotation(),Qb(n))}else{var r=Ka();e=r?t.clone().transform(r,this.getProjection()):t}this.fitInternal(e,i)},o.prototype.fitInternal=function(t,o){var e=o||{},i=e.size;i||(i=this.getViewportSize_());var n,r=void 0!==e.padding?e.padding:[0,0,0,0],s=void 0!==e.nearest&&e.nearest;n=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;for(var a=t.getFlatCoordinates(),h=this.getRotation(),p=Math.cos(-h),$=Math.sin(-h),u=1/0,l=1/0,c=-1/0,m=-1/0,g=t.getStride(),E=0,N=a.length;E<N;E+=g){var _=a[E]*p-a[E+1]*$,q=a[E]*$+a[E+1]*p;u=Math.min(u,_),l=Math.min(l,q),c=Math.max(c,_),m=Math.max(m,q)}var R=this.getResolutionForExtentInternal([u,l,c,m],[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);R=isNaN(R)?n:Math.max(R,n),R=this.getConstrainedResolution(R,s?0:1),$=-$;var v=(u+c)/2,f=(l+m)/2,d=[(v+=(r[1]-r[3])/2*R)*p-(f+=(r[0]-r[2])/2*R)*$,f*p+v*$],y=e.callback?e.callback:jb;void 0!==e.duration?this.animateInternal({resolution:R,center:this.getConstrainedCenter(d,R),duration:e.duration,easing:e.easing},y):(this.targetResolution_=R,this.targetCenter_=d,this.applyTargetState_(!1,!0),sd(y,!0))},o.prototype.centerOn=function(t,o,e){this.centerOnInternal(ka(t,this.getProjection()),o,e)},o.prototype.centerOnInternal=function(t,o,e){var i=this.getRotation(),n=Math.cos(-i),r=Math.sin(-i),s=t[0]*n-t[1]*r,a=t[1]*n+t[0]*r,h=this.getResolution(),p=(s+=(o[0]/2-e[0])*h)*n-(a+=(e[1]-o[1]/2)*h)*(r=-r),$=a*n+s*r;this.setCenterInternal([p,$])},o.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},o.prototype.adjustCenter=function(t){var o=Ib(this.targetCenter_,this.getProjection());this.setCenter([o[0]+t[0],o[1]+t[1]])},o.prototype.adjustCenterInternal=function(t){var o=this.targetCenter_;this.setCenterInternal([o[0]+t[0],o[1]+t[1]])},o.prototype.adjustResolution=function(t,o){var e=o&&ka(o,this.getProjection());this.adjustResolutionInternal(t,e)},o.prototype.adjustResolutionInternal=function(t,o){var e=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,i,e);o&&(this.targetCenter_=this.calculateCenterZoom(n,o)),this.targetResolution_*=t,this.applyTargetState_()},o.prototype.adjustZoom=function(t,o){this.adjustResolution(Math.pow(this.zoomFactor_,-t),o)},o.prototype.adjustRotation=function(t,o){o&&(o=ka(o,this.getProjection())),this.adjustRotationInternal(t,o)},o.prototype.adjustRotationInternal=function(t,o){var e=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,e);o&&(this.targetCenter_=this.calculateCenterRotate(i,o)),this.targetRotation_+=t,this.applyTargetState_()},o.prototype.setCenter=function(t){this.setCenterInternal(ka(t,this.getProjection()))},o.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},o.prototype.setHint=function(t,o){return this.hints_[t]+=o,this.changed(),this.hints_[t]},o.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},o.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},o.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},o.prototype.applyTargetState_=function(t,o){var e=this.getAnimating()||this.getInteracting()||o,i=this.constraints_.rotation(this.targetRotation_,e),n=this.getViewportSize_(i),r=this.constraints_.resolution(this.targetResolution_,0,n,e),s=this.constraints_.center(this.targetCenter_,r,n,e);this.get(Ma.ROTATION)!==i&&this.set(Ma.ROTATION,i),this.get(Ma.RESOLUTION)!==r&&this.set(Ma.RESOLUTION,r),this.get(Ma.CENTER)&&$a(this.get(Ma.CENTER),s)||this.set(Ma.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},o.prototype.resolveConstraints=function(t,o,e){var i=void 0!==t?t:200,n=o||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,n,s),h=this.constraints_.center(this.targetCenter_,a,s);if(0===i&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=h,void this.applyTargetState_();var p=e||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===r&&this.getCenterInternal()&&$a(this.getCenterInternal(),h)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:h,resolution:a,duration:i,easing:Mb,anchor:p}))},o.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(ya.INTERACTING,1)},o.prototype.endInteraction=function(t,o,e){var i=e&&ka(e,this.getProjection());this.endInteractionInternal(t,o,i)},o.prototype.endInteractionInternal=function(t,o,e){this.setHint(ya.INTERACTING,-1),this.resolveConstraints(t,o,e)},o.prototype.getConstrainedCenter=function(t,o){var e=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,o||this.getResolution(),e)},o.prototype.getConstrainedZoom=function(t,o){var e=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(e,o))},o.prototype.getConstrainedResolution=function(t,o){var e=o||0,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)},o}(Oa);function sd(t,o){setTimeout(function(){t(o)},0)}function Fi(t){if(void 0!==t.extent){var o=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return yj(t.extent,t.constrainOnlyCenter,o)}var e=dh(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){var i=e.getExtent().slice();return i[0]=-1/0,i[2]=1/0,yj(i,!1,!1)}return np}function Gi(t){var o,e,i,n=void 0!==t.minZoom?t.minZoom:Pg,r=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,$=dh(t.projection,"EPSG:3857"),u=$.getExtent(),l=t.constrainOnlyCenter,c=t.extent;if(a||c||!$.isGlobal()||(l=!1,c=u),void 0!==t.resolutions){var m=t.resolutions;e=m[n],i=void 0!==m[r]?m[r]:m[m.length-1],o=t.constrainResolution?hp(m,h,!l&&c,p):Th(e,i,h,!l&&c,p)}else{var g=(u?Math.max(ta(u),Va(u)):360*bb[Ca.DEGREES]/$.getMetersPerUnit())/zf/Math.pow(2,Pg),E=g/Math.pow(2,28-Pg);void 0!==(e=t.maxResolution)?n=0:e=g/Math.pow(s,n),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?e/Math.pow(s,r):g/Math.pow(s,r):E),r=n+Math.floor(Math.log(e/i)/Math.log(s)),i=e/Math.pow(s,r-n),o=t.constrainResolution?gp(s,e,i,h,!l&&c,p):Th(e,i,h,!l&&c,p)}return{constraint:o,maxResolution:e,minResolution:i,minZoom:n,zoomFactor:s}}function Ii(t){if(void 0===t.enableRotation||t.enableRotation){var o=t.constrainRotation;return void 0===o||!0===o?No():!1===o?Zh:"number"==typeof o?Oo(o):Zh}return Bf}function Ki(t){return!(t.sourceCenter&&t.targetCenter&&!$a(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation}Yb.createCenterConstraint=Fi,Yb.createResolutionConstraint=Gi,Yb.createRotationConstraint=Ii,Yb.isNoopAnimation=Ki,Yb.default=td;function La(e,o,r){var t=r&&r.length?r.shift():qe?new OffscreenCanvas(e||300,o||300):document.createElement("canvas");return e&&(t.width=e),o&&(t.height=o),t.getContext("2d")}function en(e){var o=e.offsetWidth,r=getComputedStyle(e);return o+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function dn(e){var o=e.offsetHeight,r=getComputedStyle(e);return o+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function ic(e,o){var r=o.parentNode;r&&r.replaceChild(e,o)}function qd(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}function Qi(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function cn(e,o){for(var r=e.childNodes,t=0;;++t){var n=r[t],$=o[t];if(!n&&!$)break;n!==$&&(n?$?e.insertBefore($,n):(e.removeChild(n),--t):e.appendChild($))}}var lh={};var qh={};var la={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source"};var bn=qh&&qh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Be=function(t){function e(e){var r=t.call(this)||this,o=Da({},e);return o[la.OPACITY]=void 0!==e.opacity?e.opacity:1,ia("number"==typeof o[la.OPACITY],64),o[la.VISIBLE]=void 0===e.visible||e.visible,o[la.Z_INDEX]=e.zIndex,o[la.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,o[la.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,o[la.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,o[la.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,r.setProperties(o),r.state_=null,r}return bn(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},r=this.getZIndex();return e.opacity=wa(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return ca()},e.prototype.getLayerStatesArray=function(t){return ca()},e.prototype.getExtent=function(){return this.get(la.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(la.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(la.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(la.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(la.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(la.OPACITY)},e.prototype.getSourceState=function(){return ca()},e.prototype.getVisible=function(){return this.get(la.VISIBLE)},e.prototype.getZIndex=function(){return this.get(la.Z_INDEX)},e.prototype.setExtent=function(t){this.set(la.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(la.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(la.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(la.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(la.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){ia("number"==typeof t,64),this.set(la.OPACITY,t)},e.prototype.setVisible=function(t){this.set(la.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(la.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(Oa);qh.default=Be;var Wb={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var an=lh&&lh.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),De={LAYERS:"layers"},fj=function(e){function t(t){var n=this,r=t||{},i=Da({},r);delete i.layers;var o=r.layers;return(n=e.call(this,i)||this).layersListenerKeys_=[],n.listenerKeys_={},n.addEventListener(qa(De.LAYERS),n.handleLayersChanged_),o?Array.isArray(o)?o=new za(o.slice(),{unique:!0}):ia("function"==typeof o.getArray,43):o=new za(void 0,{unique:!0}),n.setLayers(o),n}return an(t,e),t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(ja),this.layersListenerKeys_.length=0;var e=this.getLayers();for(var t in this.layersListenerKeys_.push(fa(e,ra.ADD,this.handleLayersAdd_,this),fa(e,ra.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[t].forEach(ja);zc(this.listenerKeys_);for(var n=e.getArray(),r=0,i=n.length;r<i;r++){var o=n[r];this.listenerKeys_[ga(o)]=[fa(o,ub.PROPERTYCHANGE,this.handleLayerChange_,this),fa(o,ba.CHANGE,this.handleLayerChange_,this)]}this.changed()},t.prototype.handleLayersAdd_=function(e){var t=e.element;this.listenerKeys_[ga(t)]=[fa(t,ub.PROPERTYCHANGE,this.handleLayerChange_,this),fa(t,ba.CHANGE,this.handleLayerChange_,this)],this.changed()},t.prototype.handleLayersRemove_=function(e){var t=e.element,n=ga(t);this.listenerKeys_[n].forEach(ja),delete this.listenerKeys_[n],this.changed()},t.prototype.getLayers=function(){return this.get(De.LAYERS)},t.prototype.setLayers=function(e){this.set(De.LAYERS,e)},t.prototype.getLayersArray=function(e){var t=void 0!==e?e:[];return this.getLayers().forEach(function(e){e.getLayersArray(t)}),t},t.prototype.getLayerStatesArray=function(e){var t=void 0!==e?e:[],n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});for(var r=this.getLayerState(),i=n,o=t.length;i<o;i++){var s=t[i];s.opacity*=r.opacity,s.visible=s.visible&&r.visible,s.maxResolution=Math.min(s.maxResolution,r.maxResolution),s.minResolution=Math.max(s.minResolution,r.minResolution),s.minZoom=Math.max(s.minZoom,r.minZoom),s.maxZoom=Math.min(s.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==s.extent?s.extent=Rc(s.extent,r.extent):s.extent=r.extent)}return t},t.prototype.getSourceState=function(){return Wb.READY},t}(Be);lh.default=fj;function _m($){return $[0]>0&&$[1]>0}function $m($,r,e){return void 0===e&&(e=[0,0]),e[0]=$[0]*r+.5|0,e[1]=$[1]*r+.5|0,e}function xb($,r){return Array.isArray($)?$:(void 0===r?r=[$,$]:(r[0]=$,r[1]=$),r)}var Zm=Wf&&Wf.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),He=function(e){function t(t){var r=e.call(this)||this,i=Ym(t);r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,r.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:ue,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=Ta(),r.pixelToCoordinateTransform_=Ta(),r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=new Hh(r,t.moveTolerance);var n=r.handleMapBrowserEvent.bind(r);for(var o in ha)r.mapBrowserEventHandler_.addEventListener(ha[o],n);r.keyboardEventTarget_=i.keyboardEventTarget,r.keyHandlerKeys_=null;var a=r.handleBrowserEvent.bind(r);return r.viewport_.addEventListener(ba.CONTEXTMENU,a,!1),r.viewport_.addEventListener(ba.WHEEL,a,!!Fj&&{passive:!1}),r.controls=i.controls||new za,r.interactions=i.interactions||new za,r.overlays_=i.overlays,r.overlayIdIndex_={},r.renderer_=null,r.handleResize_,r.postRenderFunctions_=[],r.tileQueue_=new Yi(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addEventListener(qa(Ba.LAYERGROUP),r.handleLayerGroupChanged_),r.addEventListener(qa(Ba.VIEW),r.handleViewChanged_),r.addEventListener(qa(Ba.SIZE),r.handleSizeChanged_),r.addEventListener(qa(Ba.TARGET),r.handleTargetChanged_),r.setProperties(i.values),r.controls.forEach(function(e){e.setMap(this)}.bind(r)),r.controls.addEventListener(ra.ADD,function(e){e.element.setMap(this)}.bind(r)),r.controls.addEventListener(ra.REMOVE,function(e){e.element.setMap(null)}.bind(r)),r.interactions.forEach(function(e){e.setMap(this)}.bind(r)),r.interactions.addEventListener(ra.ADD,function(e){e.element.setMap(this)}.bind(r)),r.interactions.addEventListener(ra.REMOVE,function(e){e.element.setMap(null)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r.overlays_.addEventListener(ra.ADD,function(e){this.addOverlayInternal_(e.element)}.bind(r)),r.overlays_.addEventListener(ra.REMOVE,function(e){var t=e.element.getId();void 0!==t&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}.bind(r)),r}return Zm(t,e),t.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},t.prototype.addControl=function(e){this.getControls().push(e)},t.prototype.addInteraction=function(e){this.getInteractions().push(e)},t.prototype.addLayer=function(e){this.getLayerGroup().getLayers().push(e)},t.prototype.addOverlay=function(e){this.getOverlays().push(e)},t.prototype.addOverlayInternal_=function(e){var t=e.getId();void 0!==t&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)},t.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),this.viewport_.removeEventListener(ba.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ba.WHEEL,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(ba.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.setTarget(null),e.prototype.disposeInternal.call(this)},t.prototype.forEachFeatureAtPixel=function(e,t,r){if(this.frameState_){var i=this.getCoordinateFromPixelInternal(e),n=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==r.layerFilter?r.layerFilter:Ia,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,n,a,t,null,o,null)}},t.prototype.getFeaturesAtPixel=function(e,t){var r=[];return this.forEachFeatureAtPixel(e,function(e){r.push(e)},t),r},t.prototype.forEachLayerAtPixel=function(e,t,r){if(this.frameState_){var i=r||{},n=void 0!==i.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=i.layerFilter||Ia;return this.renderer_.forEachLayerAtPixel(e,this.frameState_,n,t,o)}},t.prototype.hasFeatureAtPixel=function(e,t){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(e),i=void 0!==(t=void 0!==t?t:{}).layerFilter?t.layerFilter:Ia,n=void 0!==t.hitTolerance?t.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==t.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,n,o,i,null)},t.prototype.getEventCoordinate=function(e){return this.getCoordinateFromPixel(this.getEventPixel(e))},t.prototype.getEventCoordinateInternal=function(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))},t.prototype.getEventPixel=function(e){var t=this.viewport_.getBoundingClientRect(),r="changedTouches"in e?e.changedTouches[0]:e;return[r.clientX-t.left,r.clientY-t.top]},t.prototype.getTarget=function(){return this.get(Ba.TARGET)},t.prototype.getTargetElement=function(){var e=this.getTarget();return void 0!==e?"string"==typeof e?document.getElementById(e):e:null},t.prototype.getCoordinateFromPixel=function(e){return Ib(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())},t.prototype.getCoordinateFromPixelInternal=function(e){var t=this.frameState_;return t?pa(t.pixelToCoordinateTransform,e.slice()):null},t.prototype.getControls=function(){return this.controls},t.prototype.getOverlays=function(){return this.overlays_},t.prototype.getOverlayById=function(e){var t=this.overlayIdIndex_[e.toString()];return void 0!==t?t:null},t.prototype.getInteractions=function(){return this.interactions},t.prototype.getLayerGroup=function(){return this.get(Ba.LAYERGROUP)},t.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},t.prototype.getLoading=function(){for(var e=this.getLayerGroup().getLayerStatesArray(),t=0,r=e.length;t<r;++t){var i=e[t].layer.getSource();if(i&&i.loading)return!0}return!1},t.prototype.getPixelFromCoordinate=function(e){var t=ka(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)},t.prototype.getPixelFromCoordinateInternal=function(e){var t=this.frameState_;return t?pa(t.coordinateToPixelTransform,e.slice(0,2)):null},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.getSize=function(){return this.get(Ba.SIZE)},t.prototype.getView=function(){return this.get(Ba.VIEW)},t.prototype.getViewport=function(){return this.viewport_},t.prototype.getOverlayContainer=function(){return this.overlayContainer_},t.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},t.prototype.getTilePriority=function(e,t,r,i){return ej(this.frameState_,e,t,r,i)},t.prototype.handleBrowserEvent=function(e,t){var r=t||e.type,i=new Kf(r,this,e);this.handleMapBrowserEvent(i)},t.prototype.handleMapBrowserEvent=function(e){if(this.frameState_){var t=e.originalEvent.target;if(e.dragging||!this.overlayContainerStopEvent_.contains(t)&&(document.body.contains(t)||this.viewport_.getRootNode&&this.viewport_.getRootNode().contains(t))){e.frameState=this.frameState_;var r=this.getInteractions().getArray();if(!1!==this.dispatchEvent(e))for(var i=r.length-1;i>=0;i--){var n=r[i];if(n.getActive())if(!n.handleEvent(e))break}}}},t.prototype.handlePostRender=function(){var e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){var r=this.maxTilesLoading_,i=r;if(e){var n=e.viewHints;if(n[ya.ANIMATING]||n[ya.INTERACTING]){var o=!mj&&Date.now()-e.time>8;r=o?0:8,i=o?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,i))}!e||!this.hasListener(Xb.RENDERCOMPLETE)||e.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Xb.RENDERCOMPLETE,e);for(var a=this.postRenderFunctions_,s=0,p=a.length;s<p;++s)a[s](this,e);a.length=0},t.prototype.handleSizeChanged_=function(){this.getView()&&this.getView().resolveConstraints(0),this.render()},t.prototype.handleTargetChanged_=function(){var e;if(this.getTarget()&&(e=this.getTargetElement()),this.keyHandlerKeys_){for(var t=0,r=this.keyHandlerKeys_.length;t<r;++t)ja(this.keyHandlerKeys_[t]);this.keyHandlerKeys_=null}if(e){e.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer());var i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.keyHandlerKeys_=[fa(i,ba.KEYDOWN,this.handleBrowserEvent,this),fa(i,ba.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(ba.RESIZE,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),qd(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(ba.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},t.prototype.handleTileChange_=function(){this.render()},t.prototype.handleViewPropertyChanged_=function(){this.render()},t.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(ja(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(ja(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=fa(e,ub.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=fa(e,ba.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()},t.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(ja),this.layerGroupPropertyListenerKeys_=null);var e=this.getLayerGroup();e&&(this.layerGroupPropertyListenerKeys_=[fa(e,ub.PROPERTYCHANGE,this.render,this),fa(e,ba.CHANGE,this.render,this)]),this.render()},t.prototype.isRendered=function(){return!!this.frameState_},t.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},t.prototype.redrawText=function(){for(var e=this.getLayerGroup().getLayerStatesArray(),t=0,r=e.length;t<r;++t){var i=e[t].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}},t.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},t.prototype.removeControl=function(e){return this.getControls().remove(e)},t.prototype.removeInteraction=function(e){return this.getInteractions().remove(e)},t.prototype.removeLayer=function(e){return this.getLayerGroup().getLayers().remove(e)},t.prototype.removeOverlay=function(e){return this.getOverlays().remove(e)},t.prototype.renderFrame_=function(e){var t=this.getSize(),r=this.getView(),i=this.frameState_,n=null;if(void 0!==t&&_m(t)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();n={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:i?i.declutterItems:[],extent:nk(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{}}}if(this.frameState_=n,this.renderer_.renderFrame(n),n){if(n.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,n.postRenderFunctions),i)(!this.previousExtent_||!uf(this.previousExtent_)&&!mc(n.extent,this.previousExtent_))&&(this.dispatchEvent(new Qc(kc.MOVESTART,this,i)),this.previousExtent_=ec(this.previousExtent_));this.previousExtent_&&!n.viewHints[ya.ANIMATING]&&!n.viewHints[ya.INTERACTING]&&!mc(n.extent,this.previousExtent_)&&(this.dispatchEvent(new Qc(kc.MOVEEND,this,n)),qi(n.extent,this.previousExtent_))}this.dispatchEvent(new Qc(kc.POSTRENDER,this,n)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},t.prototype.setLayerGroup=function(e){this.set(Ba.LAYERGROUP,e)},t.prototype.setSize=function(e){this.set(Ba.SIZE,e)},t.prototype.setTarget=function(e){this.set(Ba.TARGET,e)},t.prototype.setView=function(e){this.set(Ba.VIEW,e)},t.prototype.updateSize=function(){var e=this.getTargetElement();if(e){var t=getComputedStyle(e);this.setSize([e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},t.prototype.updateViewportSize_=function(){var e=this.getView();if(e){var t=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(t=[parseInt(r.width,10),parseInt(r.height,10)]),e.setViewportSize(t)}},t}(Oa);function Ym(e){var t=null;void 0!==e.keyboardEventTarget&&(t="string"==typeof e.keyboardEventTarget?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);var r,i,n,o={},a=e.layers&&"function"==typeof e.layers.getLayers?e.layers:new fj({layers:e.layers});return o[Ba.LAYERGROUP]=a,o[Ba.TARGET]=e.target,o[Ba.VIEW]=void 0!==e.view?e.view:new td,void 0!==e.controls&&(Array.isArray(e.controls)?r=new za(e.controls.slice()):(ia("function"==typeof e.controls.getArray,47),r=e.controls)),void 0!==e.interactions&&(Array.isArray(e.interactions)?i=new za(e.interactions.slice()):(ia("function"==typeof e.interactions.getArray,48),i=e.interactions)),void 0!==e.overlays?Array.isArray(e.overlays)?n=new za(e.overlays.slice()):(ia("function"==typeof e.overlays.getArray,49),n=e.overlays):n=new za,{controls:r,interactions:i,keyboardEventTarget:t,overlays:n,values:o}}Wf.default=He;function Wm(o){var r=o||{},t=new za;return(void 0===r.zoom||r.zoom)&&t.push(new ak(r.zoomOptions)),(void 0===r.rotate||r.rotate)&&t.push(new Wj(r.rotateOptions)),(void 0===r.attribution||r.attribution)&&t.push(new Rj(r.attributionOptions)),t}var od={};var Le={};var Um=Le&&Le.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wa=function(e){function t(t){var r=e.call(this)||this;return r.element=t.element?t.element:null,r.target_=null,r.map_=null,r.listenerKeys=[],r.render_=t.render?t.render:jb,t.target&&r.setTarget(t.target),r}return Um(t,e),t.prototype.disposeInternal=function(){qd(this.element),e.prototype.disposeInternal.call(this)},t.prototype.getMap=function(){return this.map_},t.prototype.setMap=function(e){this.map_&&qd(this.element);for(var t=0,r=this.listenerKeys.length;t<r;++t)ja(this.listenerKeys[t]);(this.listenerKeys.length=0,this.map_=e,this.map_)&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==jb&&this.listenerKeys.push(fa(e,kc.POSTRENDER,this.render,this)),e.render())},t.prototype.render=function(e){this.render_.call(this,e)},t.prototype.setTarget=function(e){this.target_="string"==typeof e?document.getElementById(e):e},t}(Oa);Le.default=Wa;var nd="ol-hidden";var Rm="ol-selectable";var Xa="ol-unselectable";var Qm="ol-unsupported";var Pb="ol-control";var jd="ol-collapsed";var Pm=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"),Ij=["style","variant","weight","size","lineHeight","family"],Kj=function(e){var $=e.match(Pm);if(!$)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},t=0,a=Ij.length;t<a;++t){var o=$[t+1];void 0!==o&&(r[Ij[t]]=o)}return r.families=r.family.split(/,\s?/),r};var id={};var Nm=id&&id.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ve=function(e){function r(r){var t=this,n=Da({},r);delete n.source,(t=e.call(this,n)||this).mapPrecomposeKey_=null,t.mapRenderKey_=null,t.sourceChangeKey_=null,t.renderer_=null,r.render&&(t.render=r.render),r.map&&t.setMap(r.map),t.addEventListener(qa(la.SOURCE),t.handleSourcePropertyChange_);var o=r.source?r.source:null;return t.setSource(o),t}return Nm(r,e),r.prototype.getLayersArray=function(e){var r=e||[];return r.push(this),r},r.prototype.getLayerStatesArray=function(e){var r=e||[];return r.push(this.getLayerState()),r},r.prototype.getSource=function(){return this.get(la.SOURCE)||null},r.prototype.getSourceState=function(){var e=this.getSource();return e?e.getState():Wb.UNDEFINED},r.prototype.handleSourceChange_=function(){this.changed()},r.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(ja(this.sourceChangeKey_),this.sourceChangeKey_=null);var e=this.getSource();e&&(this.sourceChangeKey_=fa(e,ba.CHANGE,this.handleSourceChange_,this)),this.changed()},r.prototype.getFeatures=function(e){return this.renderer_.getFeatures(e)},r.prototype.render=function(e,r){var t=this.getRenderer();if(t.prepareFrame(e))return t.renderFrame(e,r)},r.prototype.setMap=function(e){this.mapPrecomposeKey_&&(ja(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(ja(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=fa(e,Xb.PRECOMPOSE,function(e){var r=e.frameState.layerStatesArray,t=this.getLayerState(!1);ia(!r.some(function(e){return e.layer===t.layer}),67),r.push(t)},this),this.mapRenderKey_=fa(this,ba.CHANGE,e.render,e),this.changed())},r.prototype.setSource=function(e){this.set(la.SOURCE,e)},r.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},r.prototype.hasRenderer=function(){return!!this.renderer_},r.prototype.createRenderer=function(){return null},r.prototype.disposeInternal=function(){this.setSource(null),e.prototype.disposeInternal.call(this)},r}(Be);function Zc(e,r){if(!e.visible)return!1;var t=r.resolution;if(t<e.minResolution||t>=e.maxResolution)return!1;var n=r.zoom;return n>e.minZoom&&n<=e.maxZoom}id.inView=Zc,id.default=Ve;var Lm=od&&od.__extends||function(){var e=function(t,l){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(t,l)};return function(t,l){function r(){this.constructor=t}e(t,l),t.prototype=null===l?Object.create(l):(r.prototype=l.prototype,new r)}}(),Rj=function(e){function t(t){var l=this,r=t||{};(l=e.call(this,{element:document.createElement("div"),render:r.render||Sj,target:r.target})||this).ulElement_=document.createElement("ul"),l.collapsed_=void 0===r.collapsed||r.collapsed,l.overrideCollapsible_=void 0!==r.collapsible,l.collapsible_=void 0===r.collapsible||r.collapsible,l.collapsible_||(l.collapsed_=!1);var o=void 0!==r.className?r.className:"ol-attribution",i=void 0!==r.tipLabel?r.tipLabel:"Attributions",a=void 0!==r.collapseLabel?r.collapseLabel:"\xBB";"string"==typeof a?(l.collapseLabel_=document.createElement("span"),l.collapseLabel_.textContent=a):l.collapseLabel_=a;var s=void 0!==r.label?r.label:"i";"string"==typeof s?(l.label_=document.createElement("span"),l.label_.textContent=s):l.label_=s;var n=l.collapsible_&&!l.collapsed_?l.collapseLabel_:l.label_,p=document.createElement("button");p.setAttribute("type","button"),p.title=i,p.appendChild(n),p.addEventListener(ba.CLICK,l.handleClick_.bind(l),!1);var c=o+" "+Xa+" "+Pb+(l.collapsed_&&l.collapsible_?" "+jd:"")+(l.collapsible_?"":" ol-uncollapsible"),d=l.element;return d.className=c,d.appendChild(l.ulElement_),d.appendChild(p),l.renderedAttributions_=[],l.renderedVisible_=!0,l}return Lm(t,e),t.prototype.collectSourceAttributions_=function(e){for(var t={},l=[],r=e.layerStatesArray,o=0,i=r.length;o<i;++o){var a=r[o];if(Zc(a,e.viewState)){var s=a.layer.getSource();if(s){var n=s.getAttributions();if(n){var p=n(e);if(p)if(this.overrideCollapsible_||!1!==s.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(p))for(var c=0,d=p.length;c<d;++c)p[c]in t||(l.push(p[c]),t[p[c]]=!0);else p in t||(l.push(p),t[p]=!0)}}}}return l},t.prototype.updateElement_=function(e){if(e){var t=this.collectSourceAttributions_(e),l=t.length>0;if(this.renderedVisible_!=l&&(this.element.style.display=l?"":"none",this.renderedVisible_=l),!xc(t,this.renderedAttributions_)){Qi(this.ulElement_);for(var r=0,o=t.length;r<o;++r){var i=document.createElement("li");i.innerHTML=t[r],this.ulElement_.appendChild(i)}this.renderedAttributions_=t}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t.prototype.handleClick_=function(e){e.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(jd),this.collapsed_?ic(this.collapseLabel_,this.label_):ic(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(e){this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t}(Wa);function Sj(e){this.updateElement_(e.frameState)}od.render=Sj,od.default=Rj;var gd={};var Jm=gd&&gd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Wj=function(t){function e(e){var r=this,o=e||{};r=t.call(this,{element:document.createElement("div"),render:o.render||Xj,target:o.target})||this;var s=void 0!==o.className?o.className:"ol-rotate",a=void 0!==o.label?o.label:"\u21E7";r.label_=null,"string"==typeof a?(r.label_=document.createElement("span"),r.label_.className="ol-compass",r.label_.textContent=a):(r.label_=a,r.label_.classList.add("ol-compass"));var i=o.tipLabel?o.tipLabel:"Reset rotation",n=document.createElement("button");n.className=s+"-reset",n.setAttribute("type","button"),n.title=i,n.appendChild(r.label_),n.addEventListener(ba.CLICK,r.handleClick_.bind(r),!1);var l=s+" "+Xa+" "+Pb,$=r.element;return $.className=l,$.appendChild(n),r.callResetNorth_=o.resetNorth?o.resetNorth:void 0,r.duration_=void 0!==o.duration?o.duration:250,r.autoHide_=void 0===o.autoHide||o.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(nd),r}return Jm(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:Mb}):t.setRotation(0))}},e}(Wa);function Xj(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var o="rotate("+r+"rad)";if(this.autoHide_){var s=this.element.classList.contains(nd);s||0!==r?s&&0!==r&&this.element.classList.remove(nd):this.element.classList.add(nd)}this.label_.style.transform=o}this.rotation_=r}}gd.render=Xj,gd.default=Wj;var Ze={};var Im=Ze&&Ze.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ak=function(t){function e(e){var o=this,n=e||{};o=t.call(this,{element:document.createElement("div"),target:n.target})||this;var r=void 0!==n.className?n.className:"ol-zoom",a=void 0!==n.delta?n.delta:1,i=void 0!==n.zoomInLabel?n.zoomInLabel:"+",p=void 0!==n.zoomOutLabel?n.zoomOutLabel:"\u2212",l=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",d=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",s=document.createElement("button");s.className=r+"-in",s.setAttribute("type","button"),s.title=l,s.appendChild("string"==typeof i?document.createTextNode(i):i),s.addEventListener(ba.CLICK,o.handleClick_.bind(o,a),!1);var u=document.createElement("button");u.className=r+"-out",u.setAttribute("type","button"),u.title=d,u.appendChild("string"==typeof p?document.createTextNode(p):p),u.addEventListener(ba.CLICK,o.handleClick_.bind(o,-a),!1);var c=r+" "+Xa+" "+Pb,$=o.element;return $.className=c,$.appendChild(s),$.appendChild(u),o.duration_=void 0!==n.duration?n.duration:250,o}return Im(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 o=e.getZoom();if(void 0!==o){var n=e.getConstrainedZoom(o+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:Mb})):e.setZoom(n)}}},e}(Wa);Ze.default=ak;var _e={};var Hm=_e&&_e.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function l(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(l.prototype=r.prototype,new l)}}(),fk=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],gk={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},Fm=function(e){function t(t){var r=this,l=t||{};(r=e.call(this,{element:document.createElement("div"),target:l.target})||this).cssClassName_=void 0!==l.className?l.className:"ol-full-screen";var s=void 0!==l.label?l.label:"\u2922";r.labelNode_="string"==typeof s?document.createTextNode(s):s;var n=void 0!==l.labelActive?l.labelActive:"\xD7";r.labelActiveNode_="string"==typeof n?document.createTextNode(n):n,r.button_=document.createElement("button");var o=l.tipLabel?l.tipLabel:"Toggle full-screen";r.setClassName_(r.button_,bf()),r.button_.setAttribute("type","button"),r.button_.title=o,r.button_.appendChild(r.labelNode_),r.button_.addEventListener(ba.CLICK,r.handleClick_.bind(r),!1);var u=r.cssClassName_+" "+Xa+" "+Pb+" "+(kk()?"":Qm),c=r.element;return c.className=u,c.appendChild(r.button_),r.keys_=void 0!==l.keys&&l.keys,r.source_=l.source,r}return Hm(t,e),t.prototype.handleClick_=function(e){e.preventDefault(),this.handleFullScreen_()},t.prototype.handleFullScreen_=function(){if(kk()){var e=this.getMap();if(e)if(bf())Am();else{var t=void 0;t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?Cm(t):ok(t)}}},t.prototype.handleFullScreenChange_=function(){var e=this.getMap();bf()?(this.setClassName_(this.button_,!0),ic(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(gk.ENTERFULLSCREEN)):(this.setClassName_(this.button_,!1),ic(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(gk.LEAVEFULLSCREEN)),e&&e.updateSize()},t.prototype.setClassName_=function(e,t){var r=this.cssClassName_+"-true",l=this.cssClassName_+"-false",s=t?r:l;e.classList.remove(r),e.classList.remove(l),e.classList.add(s)},t.prototype.setMap=function(t){if(e.prototype.setMap.call(this,t),t)for(var r=0,l=fk.length;r<l;++r)this.listenerKeys.push(fa(document,fk[r],this.handleFullScreenChange_,this))},t}(Wa);function kk(){var e=document.body;return!!(e.webkitRequestFullscreen||e.msRequestFullscreen&&document.msFullscreenEnabled||e.requestFullscreen&&document.fullscreenEnabled)}function bf(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function ok(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function Cm(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():ok(e)}function Am(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}_e.default=Fm;var cd={};var zm=cd&&cd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),ff="projection",yk="coordinateFormat",ym=function(t){function e(e){var r=this,o=e||{},n=document.createElement("div");return n.className=void 0!==o.className?o.className:"ol-mouse-position",(r=t.call(this,{element:n,render:o.render||Bk,target:o.target})||this).addEventListener(qa(ff),r.handleProjectionChanged_),o.coordinateFormat&&r.setCoordinateFormat(o.coordinateFormat),o.projection&&r.setProjection(o.projection),r.undefinedHTML_=void 0!==o.undefinedHTML?o.undefinedHTML:"&#160;",r.renderOnMouseOut_=!!r.undefinedHTML_,r.renderedHTML_=n.innerHTML,r.mapProjection_=null,r.transform_=null,r}return zm(e,t),e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get(yk)},e.prototype.getProjection=function(){return this.get(ff)},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},e.prototype.handleMouseOut=function(t){this.updateHTML_(null)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var r=e.getViewport();this.listenerKeys.push(fa(r,gb.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(fa(r,gb.POINTEROUT,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set(yk,t)},e.prototype.setProjection=function(t){this.set(ff,ua(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var r=this.getProjection();this.transform_=r?yc(this.mapProjection_,r):Lj}var o=this.getMap().getCoordinateFromPixelInternal(t);if(o){var n=Ka();n&&(this.transform_=yc(this.mapProjection_,n)),this.transform_(o,o);var i=this.getCoordinateFormat();e=i?i(o):o.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e}(Wa);function Bk(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}cd.render=Bk,cd.default=ym;var ed={};var jf={};var kf={};var xm=kf&&kf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mf=function(t){function e(e,r,n,o){var $=t.call(this,e)||this;return $.inversePixelTransform=r,$.frameState=n,$.context=o,$}return xm(e,t),e}(Ha);kf.default=mf;var nf={};var wm=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,tm=/^([a-z]*)$|^hsla?\(.*\)$/i;function rm(r){return"string"==typeof r?r:Gh(r)}function pm(r){var e=document.createElement("div");if(e.style.color=r,""!==e.style.color){document.body.appendChild(e);var $=getComputedStyle(e).color;return document.body.removeChild(e),$}return""}var om=function(){var r={},e=0;return function($){var t;if(r.hasOwnProperty($))t=r[$];else{if(e>=1024){var o=0;for(var a in r)0==(3&o++)&&(delete r[a],--e)}t=lm($),r[$]=t,++e}return t}}();function Dh(r){return Array.isArray(r)?r:om(r)}function lm(r){var e,$,t,o,a;if(tm.exec(r)&&(r=pm(r)),wm.exec(r)){var u=r.length-1,n=void 0;n=u<=4?1:2;var c=4===u||8===u;e=parseInt(r.substr(1+0*n,n),16),$=parseInt(r.substr(1+1*n,n),16),t=parseInt(r.substr(1+2*n,n),16),o=c?parseInt(r.substr(1+3*n,n),16):255,1==n&&(e=(e<<4)+e,$=($<<4)+$,t=(t<<4)+t,c&&(o=(o<<4)+o)),a=[e,$,t,o/255]}else 0==r.indexOf("rgba(")?Fh(a=r.slice(5,-1).split(",").map(Number)):0==r.indexOf("rgb(")?((a=r.slice(4,-1).split(",").map(Number)).push(1),Fh(a)):ia(!1,14);return a}function Fh(r){return r[0]=wa(r[0]+.5|0,0,255),r[1]=wa(r[1]+.5|0,0,255),r[2]=wa(r[2]+.5|0,0,255),r[3]=wa(r[3],0,1),r}function Gh(r){var e=r[0];e!=(0|e)&&(e=e+.5|0);var $=r[1];$!=(0|$)&&($=$+.5|0);var t=r[2];return t!=(0|t)&&(t=t+.5|0),"rgba("+e+","+$+","+t+","+(void 0===r[3]?1:r[3])+")"}var km=function(){function e(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return e.prototype.clear=function(){this.cache_={},this.cacheSize_=0},e.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},e.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var t in this.cache_){var r=this.cache_[t];0!=(3&e++)||r.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},e.prototype.get=function(e,t,r){var i=Ih(e,t,r);return i in this.cache_?this.cache_[i]:null},e.prototype.set=function(e,t,r,i){var o=Ih(e,t,r);this.cache_[o]=i,++this.cacheSize_},e.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},e}();function Ih(e,t,r){return t+":"+e+":"+(r?rm(r):"null")}var hd=new km;function im(e,r){r&&r.clear();for(var t=e.declutterItems,$=t.length-1;$>=0;--$)for(var o=t[$],i=o.items,n=0,a=i.length;n<a;n+=3)r=i[n].renderDeclutter(i[n+1],i[n+2],o.opacity,r);return t.length=0,r}var wf={};function Za(r){return Array.isArray(r)?Gh(r):r}var Nh=function(){function t(){}return t.prototype.drawCustom=function(t,o,e){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,o){},t.prototype.drawFeature=function(t,o){},t.prototype.drawGeometryCollection=function(t,o){},t.prototype.drawLineString=function(t,o){},t.prototype.drawMultiLineString=function(t,o){},t.prototype.drawMultiPoint=function(t,o){},t.prototype.drawMultiPolygon=function(t,o){},t.prototype.drawPoint=function(t,o){},t.prototype.drawPolygon=function(t,o){},t.prototype.drawText=function(t,o){},t.prototype.setFillStrokeStyle=function(t,o){},t.prototype.setImageStyle=function(t,o){},t.prototype.setTextStyle=function(t,o){},t}();var Oh="10px sans-serif";var ib="#000";var tc="round";var ld=[];var md=0;var qc="round";var Pc=10;var Mc="#000";var Hc="center";var rd="middle";var fc=[0,0,0,0];var Cc=1;var lb=new Oa;var gm=new Nb;gm.setSize=function(){console.warn("labelCache is deprecated.")};var fm,xd=null,Nf={};var em=function(){var e,t,$=100,r="32px ",i=["monospace","serif"],a=i.length,o="wmytzilWMYTZIL@#/&?$%10\uF013";function n(e,$,n){for(var s=!0,A=0;A<a;++A){var x=i[A];if(t=Ad(e+" "+$+" "+r+x,o),n!=x){var p=Ad(e+" "+$+" "+r+n+","+x,o);s=s&&p!=t}}return!!s}function s(){for(var t=!0,r=lb.getKeys(),i=0,a=r.length;i<a;++i){var o=r[i];lb.get(o)<$&&(n.apply(this,o.split("\n"))?(zc(Nf),xd=null,fm=void 0,lb.set(o,$)):(lb.set(o,lb.get(o)+1,!0),t=!1))}t&&(clearInterval(e),e=void 0)}return function(t){var r=Kj(t);if(r)for(var i=r.families,a=0,o=i.length;a<o;++a){var A=i[a],x=r.style+"\n"+r.weight+"\n"+A;void 0===lb.get(x)&&(lb.set(x,$,!0),n(r.style,r.weight,A)||(lb.set(x,0,!0),void 0===e&&(e=setInterval(s,32))))}}}();var dm=function(){var e,t=Nf;return function($){var r=t[$];if(null==r)if(qe){var i=Kj($),a=fi($,"\u017Dg"),o=isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight);Nf[$]=o*(a.actualBoundingBoxAscent+a.actualBoundingBoxDescent)}else e||((e=document.createElement("div")).innerHTML="M",e.style.margin="0 !important",e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=$,document.body.appendChild(e),r=e.offsetHeight,t[$]=r,document.body.removeChild(e);return r}}();function fi(e,t){return xd||(xd=La(1,1)),e!=fm&&(xd.font=e,fm=xd.font),xd.measureText(t)}function Ad(e,t){return fi(e,t).width}function hi(e,t,$){if(t in $)return $[t];var r=Ad(e,t);return $[t]=r,r}function cm(e,t,$){for(var r=t.length,i=0,a=0;a<r;++a){var o=Ad(e,t[a]);i=Math.max(i,o),$.push(o)}return i}function ji(e,t,$,r){0!==t&&(e.translate($,r),e.rotate(t),e.translate(-$,-r))}function ki(e,t,$,r,i,a,o,n,s,A,x){e.save(),1!==$&&(e.globalAlpha*=$),t&&e.setTransform.apply(e,t),r.contextInstructions?(e.translate(s,A),e.scale(x,x),bm(r,e)):e.drawImage(r,i,a,o,n,s,A,o*x,n*x),e.restore()}function bm(e,t){for(var $=e.contextInstructions,r=0,i=$.length;r<i;r+=2)Array.isArray($[r+1])?t[$[r]].apply(t,$[r+1]):t[$[r]]=$[r+1]}var Tf=null;function jq(e){return qe?Jf(e):(Tf||(Tf=La(1,1).canvas),Tf.style.transform=Jf(e),Tf.style.transform)}var _l=wf&&wf.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pi=function(t){function e(e,i,o,r,s,a,n){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=r,l.viewRotation_=s,l.squaredTolerance_=a,l.userTransform_=n,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,l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=0,l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=Ta(),l}return _l(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var r=Lb(t,e,i,2,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.tmpLocalTransform_,n=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=n*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var h=0,f=r.length;h<f;h+=2){var _=r[h]-this.imageAnchorX_,m=r[h+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_){var p=_+this.imageAnchorX_,g=m+this.imageAnchorY_;mb(a,p,g,this.imageScale_,this.imageScale_,l,-p,-g),s.setTransform.apply(s,a)}s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,_,m,this.imageWidth_,this.imageHeight_)}0===l&&1==this.imageScale_||s.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(s.globalAlpha=n)}},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 r=Lb(t,e,i,o,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var n=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_){var h=mb(this.tmpLocalTransform_,n,l,this.textScale_,this.textScale_,a,-n,-l);s.setTransform.apply(s,h)}this.textStrokeState_&&s.strokeText(this.text_,n,l),this.textFillState_&&s.fillText(this.text_,n,l)}0===a&&1==this.textScale_||s.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,i,o,r){var s=this.context_,a=Lb(t,e,i,o,this.transform_,this.pixelCoordinates_);s.moveTo(a[0],a[1]);var n=a.length;r&&(n-=2);for(var l=2;l<n;l+=2)s.lineTo(a[l],a[l+1]);return r&&s.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var r=0,s=i.length;r<s;++r)e=this.moveToLineTo_(t,e,i[r],o,!0);return e},e.prototype.drawCircle=function(t){if(Ga(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=Yj(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],r=Math.sqrt(i*i+o*o),s=this.context_;s.beginPath(),s.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.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 aa.POINT:this.drawPoint(t);break;case aa.LINE_STRING:this.drawLineString(t);break;case aa.POLYGON:this.drawPolygon(t);break;case aa.MULTI_POINT:this.drawMultiPoint(t);break;case aa.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case aa.MULTI_POLYGON:this.drawMultiPolygon(t);break;case aa.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case aa.CIRCLE:this.drawCircle(t);}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Ga(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_)),Ga(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(Ga(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),r=0,s=t.getEnds(),a=t.getStride();i.beginPath();for(var n=0,l=s.length;n<l;++n)r=this.moveToLineTo_(o,r,s[n],a,!1);i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoints();this.drawText_(h,0,h.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Ga(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_)),Ga(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,r=t.getEndss(),s=t.getStride();e.beginPath();for(var a=0,n=r.length;a<n;++a){var l=r[a];o=this.drawRings_(i,o,l,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var h=t.getFlatInteriorPoints();this.drawText_(h,0,h.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&&(xc(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:Hc;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){if(t){var i=t.getColor();this.fillState_={fillStyle:Za(i||ib)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),n=e.getLineJoin(),l=e.getWidth(),h=e.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:tc,lineDash:s||ld,lineDashOffset:a||md,lineJoin:void 0!==n?n:qc,lineWidth:this.pixelRatio_*(void 0!==l?l:Cc),miterLimit:void 0!==h?h:Pc,strokeStyle:Za(o||Mc)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),o=t.getOrigin(),r=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=r[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageWidth_=r[0]}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Za(i||ib)}}else this.textFillState_=null;var o=t.getStroke();if(o){var r=o.getColor(),s=o.getLineCap(),a=o.getLineDash(),n=o.getLineDashOffset(),l=o.getLineJoin(),h=o.getWidth(),f=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==s?s:tc,lineDash:a||ld,lineDashOffset:n||md,lineJoin:void 0!==l?l:qc,lineWidth:void 0!==h?h:Cc,miterLimit:void 0!==f?f:Pc,strokeStyle:Za(r||Mc)}}else this.textStrokeState_=null;var _=t.getFont(),m=t.getOffsetX(),p=t.getOffsetY(),g=t.getRotateWithView(),$=t.getRotation(),x=t.getScale(),S=t.getText(),c=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:void 0!==_?_:Oh,textAlign:void 0!==c?c:Hc,textBaseline:void 0!==d?d:rd},this.text_=void 0!==S?S:"",this.textOffsetX_=void 0!==m?this.pixelRatio_*m:0,this.textOffsetY_=void 0!==p?this.pixelRatio_*p:0,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0!==$?$:0,this.textScale_=this.pixelRatio_*(void 0!==x?x:1)}else this.text_=""},e}(Nh);wf.default=pi;var oa={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};var na={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var $l=.5,ti={Point:Il,LineString:Nl,Polygon:Fl,MultiPoint:Hl,MultiLineString:Ll,MultiPolygon:Kl,GeometryCollection:Ol,Circle:Rl};function Wl(e,r){return parseInt(ga(e),10)-parseInt(ga(r),10)}function Vl(e,r){var t=wi(e,r);return t*t}function wi(e,r){return $l*e/r}function Rl(e,r,t,a){var $=t.getFill(),i=t.getStroke();if($||i){var n=e.getBuilder(t.getZIndex(),na.CIRCLE);n.setFillStrokeStyle($,i),n.drawCircle(r,a)}var o=t.getText();if(o){var l=e.getBuilder(t.getZIndex(),na.TEXT);l.setTextStyle(o,e.addDeclutter(!1)),l.drawText(r,a)}}function yi(e,r,t,a,$,i){var n=!1,o=t.getImage();if(o){var l=o.getImageState();l==oa.LOADED||l==oa.ERROR?o.unlistenImageChange($):(l==oa.IDLE&&o.load(),l=o.getImageState(),o.listenImageChange($),n=!0)}return Ql(e,r,t,a,i),n}function Ql(e,r,t,a,$){var i=t.getGeometryFunction()(r);if(i){var n=i.simplifyTransformed(a,$);if(t.getRenderer())Ai(e,n,t,r);else(0,ti[n.getType()])(e,n,t,r)}}function Ai(e,r,t,a){if(r.getType()!=aa.GEOMETRY_COLLECTION)e.getBuilder(t.getZIndex(),na.DEFAULT).drawCustom(r,a,t.getRenderer());else for(var $=r.getGeometries(),i=0,n=$.length;i<n;++i)Ai(e,$[i],t,a)}function Ol(e,r,t,a){var $,i,n=r.getGeometriesArray();for($=0,i=n.length;$<i;++$){(0,ti[n[$].getType()])(e,n[$],t,a)}}function Nl(e,r,t,a){var $=t.getStroke();if($){var i=e.getBuilder(t.getZIndex(),na.LINE_STRING);i.setFillStrokeStyle(null,$),i.drawLineString(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!1)),o.drawText(r,a)}}function Ll(e,r,t,a){var $=t.getStroke();if($){var i=e.getBuilder(t.getZIndex(),na.LINE_STRING);i.setFillStrokeStyle(null,$),i.drawMultiLineString(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!1)),o.drawText(r,a)}}function Kl(e,r,t,a){var $=t.getFill(),i=t.getStroke();if(i||$){var n=e.getBuilder(t.getZIndex(),na.POLYGON);n.setFillStrokeStyle($,i),n.drawMultiPolygon(r,a)}var o=t.getText();if(o){var l=e.getBuilder(t.getZIndex(),na.TEXT);l.setTextStyle(o,e.addDeclutter(!1)),l.drawText(r,a)}}function Il(e,r,t,a){var $=t.getImage();if($){if($.getImageState()!=oa.LOADED)return;var i=e.getBuilder(t.getZIndex(),na.IMAGE);i.setImageStyle($,e.addDeclutter(!1)),i.drawPoint(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!!$)),o.drawText(r,a)}}function Hl(e,r,t,a){var $=t.getImage();if($){if($.getImageState()!=oa.LOADED)return;var i=e.getBuilder(t.getZIndex(),na.IMAGE);i.setImageStyle($,e.addDeclutter(!1)),i.drawMultiPoint(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!!$)),o.drawText(r,a)}}function Fl(e,r,t,a){var $=t.getFill(),i=t.getStroke();if($||i){var n=e.getBuilder(t.getZIndex(),na.POLYGON);n.setFillStrokeStyle($,i),n.drawPolygon(r,a)}var o=t.getText();if(o){var l=e.getBuilder(t.getZIndex(),na.TEXT);l.setTextStyle(o,e.addDeclutter(!1)),l.drawText(r,a)}}var El=nf&&nf.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),Ji=function(e){function r(r){var t=e.call(this)||this;return t.map_=r,t.declutterTree_=null,t}return El(r,e),r.prototype.dispatchRenderEvent=function(e,r){ca()},r.prototype.calculateMatrices2D=function(e){var r=e.viewState,t=e.coordinateToPixelTransform,o=e.pixelToCoordinateTransform;mb(t,e.size[0]/2,e.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),Hf(o,t)},r.prototype.forEachFeatureAtCoordinate=function(e,r,t,o,n,a,i,$){var c,p=r.viewState;function u(e,r,t){return n.call(a,r,e?t:null)}var h=p.projection,s=$i(e.slice(),h),l=[[0,0]];if(h.canWrapX()&&o){var f=h.getExtent(),I=ta(f);l.push([-I,0],[I,0])}var d,m=r.layerStatesArray,v=m.length;this.declutterTree_&&(d=this.declutterTree_.all().map(function(e){return e.value}));for(var y=[],_=0;_<l.length;_++)for(var x=v-1;x>=0;--x){var g=m[x],j=g.layer;if(j.hasRenderer()&&Zc(g,p)&&i.call($,j)){var C=j.getRenderer(),T=j.getSource();if(C&&T){var q=T.getWrapX()?s:e,E=u.bind(null,g.managed);y[0]=q[0]+l[_][0],y[1]=q[1]+l[_][1],c=C.forEachFeatureAtCoordinate(y,r,t,E,d)}if(c)return c}}},r.prototype.forEachLayerAtPixel=function(e,r,t,o,n){return ca()},r.prototype.hasFeatureAtCoordinate=function(e,r,t,o,n,a){return void 0!==this.forEachFeatureAtCoordinate(e,r,t,o,Ia,this,n,a)},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(e){this.declutterTree_=im(e,this.declutterTree_)},r.prototype.scheduleExpireIconCache=function(e){hd.canExpireCache()&&e.postRenderFunctions.push(Dl)},r}(fh);function Dl(e,r){hd.expire()}nf.default=Ji;var Cl=jf&&jf.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),hg=function(e){function r(r){var t=e.call(this,r)||this;t.fontChangeListenerKey_=fa(lb,ub.PROPERTYCHANGE,r.redrawText.bind(r)),t.element_=document.createElement("div");var n=t.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",t.element_.className=Xa+" ol-layers";var s=r.getViewport();return s.insertBefore(t.element_,s.firstChild||null),t.children_=[],t.renderedVisible_=!0,t}return Cl(r,e),r.prototype.dispatchRenderEvent=function(e,r){var t=this.getMap();if(t.hasListener(e)){var n=new mf(e,void 0,r);t.dispatchEvent(n)}},r.prototype.disposeInternal=function(){ja(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),e.prototype.disposeInternal.call(this)},r.prototype.renderFrame=function(r){if(r){this.calculateMatrices2D(r),this.dispatchRenderEvent(Xb.PRECOMPOSE,r);var t=r.layerStatesArray.sort(function(e,r){return e.zIndex-r.zIndex}),n=r.viewState;this.children_.length=0;for(var s=null,i=0,a=t.length;i<a;++i){var o=t[i];if(r.layerIndex=i,Zc(o,n)&&(o.sourceState==Wb.READY||o.sourceState==Wb.UNDEFINED)){var $=o.layer.render(r,s);$&&$!==s&&(this.children_.push($),s=$)}}e.prototype.renderFrame.call(this,r),cn(this.element_,this.children_),this.dispatchRenderEvent(Xb.POSTCOMPOSE,r),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(r)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},r.prototype.forEachLayerAtPixel=function(e,r,t,n,s){for(var i=r.viewState,a=r.layerStatesArray,o=a.length-1;o>=0;--o){var $=a[o],l=$.layer;if(l.hasRenderer()&&Zc($,i)&&s(l)){var p=l.getRenderer().getDataAtPixel(e,r,t);if(p){var c=n(l,p);if(c)return c}}}},r}(Ji);jf.default=hg;var ig={};var Ea={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var Bl=ig&&ig.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Aa={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},Ri=function(t){function e(e){var i=t.call(this)||this;i.options=e,i.id=e.id,i.insertFirst=void 0===e.insertFirst||e.insertFirst,i.stopEvent=void 0===e.stopEvent||e.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==e.className?e.className:"ol-overlay-container "+Rm,i.element.style.position="absolute";var n=e.autoPan;return n&&"object"!=typeof n&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),i.autoPan=n||!1,i.rendered={transform_:"",visible:!0},i.mapPostrenderListenerKey=null,i.addEventListener(qa(Aa.ELEMENT),i.handleElementChanged),i.addEventListener(qa(Aa.MAP),i.handleMapChanged),i.addEventListener(qa(Aa.OFFSET),i.handleOffsetChanged),i.addEventListener(qa(Aa.POSITION),i.handlePositionChanged),i.addEventListener(qa(Aa.POSITIONING),i.handlePositioningChanged),void 0!==e.element&&i.setElement(e.element),i.setOffset(void 0!==e.offset?e.offset:[0,0]),i.setPositioning(void 0!==e.positioning?e.positioning:Ea.TOP_LEFT),void 0!==e.position&&i.setPosition(e.position),i}return Bl(e,t),e.prototype.getElement=function(){return this.get(Aa.ELEMENT)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Aa.MAP)},e.prototype.getOffset=function(){return this.get(Aa.OFFSET)},e.prototype.getPosition=function(){return this.get(Aa.POSITION)},e.prototype.getPositioning=function(){return this.get(Aa.POSITIONING)},e.prototype.handleElementChanged=function(){Qi(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(qd(this.element),ja(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=fa(t,kc.POSTRENDER,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Aa.ELEMENT,t)},e.prototype.setMap=function(t){this.set(Aa.MAP,t)},e.prototype.setOffset=function(t){this.set(Aa.OFFSET,t)},e.prototype.setPosition=function(t){this.set(Aa.POSITION,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Aa.POSITION)){var i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),o=this.getRect(n,[en(n),dn(n)]),r=void 0===t.margin?20:t.margin;if(!kb(i,o)){var s=o[0]-i[0],a=i[2]-o[2],p=o[1]-i[1],$=i[3]-o[3],c=[0,0];if(s<0?c[0]=s-r:a<0&&(c[0]=Math.abs(a)+r),p<0?c[1]=p-r:$<0&&(c[1]=Math.abs($)+r),0!==c[0]||0!==c[1]){var l=e.getView().getCenterInternal(),d=e.getPixelFromCoordinateInternal(l),h=[d[0]+c[0],d[1]+c[1]],P=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(h),duration:P.duration,easing:P.easing})}}}},e.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,o=i.top+window.pageYOffset;return[n,o,n+e[0],o+e[1]]},e.prototype.setPositioning=function(t){this.set(Aa.POSITIONING,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,n=this.getOffset(),o=this.getPositioning();this.setVisible(!0);var r=Math.round(t[0]+n[0])+"px",s=Math.round(t[1]+n[1])+"px",a="0%",p="0%";o==Ea.BOTTOM_RIGHT||o==Ea.CENTER_RIGHT||o==Ea.TOP_RIGHT?a="-100%":o!=Ea.BOTTOM_CENTER&&o!=Ea.CENTER_CENTER&&o!=Ea.TOP_CENTER||(a="-50%"),o==Ea.BOTTOM_LEFT||o==Ea.BOTTOM_CENTER||o==Ea.BOTTOM_RIGHT?p="-100%":o!=Ea.CENTER_LEFT&&o!=Ea.CENTER_CENTER&&o!=Ea.CENTER_RIGHT||(p="-50%");var $="translate("+a+", "+p+") translate("+r+", "+s+")";this.rendered.transform_!=$&&(this.rendered.transform_=$,i.transform=$,i.msTransform=$)},e.prototype.getOptions=function(){return this.options},e}(Oa);ig.default=Ri;var Si=ed&&ed.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pd=.75,Kc=.1,Al=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t.prototype.createRenderer=function(){return new hg(this)},t}(He),zl=function(e){function t(t){var i=this,o=t||{};(i=e.call(this,{element:document.createElement("div"),render:o.render||Xi,target:o.target})||this).boundHandleRotationChanged_=i.handleRotationChanged_.bind(i),i.collapsed_=void 0===o.collapsed||o.collapsed,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1),i.rotateWithView_=void 0!==o.rotateWithView&&o.rotateWithView,i.viewExtent_=void 0;var r=void 0!==o.className?o.className:"ol-overviewmap",a=void 0!==o.tipLabel?o.tipLabel:"Overview map",n=void 0!==o.collapseLabel?o.collapseLabel:"\xAB";"string"==typeof n?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=n):i.collapseLabel_=n;var l=void 0!==o.label?o.label:"\xBB";"string"==typeof l?(i.label_=document.createElement("span"),i.label_.textContent=l):i.label_=l;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_,s=document.createElement("button");s.setAttribute("type","button"),s.title=a,s.appendChild(p),s.addEventListener(ba.CLICK,i.handleClick_.bind(i),!1),i.ovmapDiv_=document.createElement("div"),i.ovmapDiv_.className="ol-overviewmap-map",i.view_=o.view,i.ovmap_=new Al({view:o.view});var h=i.ovmap_;o.layers&&o.layers.forEach(function(e){h.addLayer(e)});var $=document.createElement("div");$.className="ol-overviewmap-box",$.style.boxSizing="border-box",i.boxOverlay_=new Ri({position:[0,0],positioning:Ea.CENTER_CENTER,element:$}),i.ovmap_.addOverlay(i.boxOverlay_);var v=r+" "+Xa+" "+Pb+(i.collapsed_&&i.collapsible_?" "+jd:"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;d.className=v,d.appendChild(i.ovmapDiv_),d.appendChild(s);var c=i,_=i.boxOverlay_,u=i.boxOverlay_.getElement(),M=function(e){var t,i={clientX:(t=e).clientX,clientY:t.clientY},o=h.getEventCoordinateInternal(i);_.setPosition(o)},A=function(e){var t=h.getEventCoordinateInternal(e);c.getMap().getView().setCenterInternal(t),window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",A)};return u.addEventListener("mousedown",function(){window.addEventListener("mousemove",M),window.addEventListener("mouseup",A)}),i}return Si(t,e),t.prototype.setMap=function(t){var i=this.getMap();if(t!==i){if(i){var o=i.getView();o&&this.unbindView_(o),this.ovmap_.setTarget(null)}if(e.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(fa(t,ub.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var r=t.getView();r&&(this.bindView_(r),r.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},t.prototype.handleMapPropertyChange_=function(e){if(e.key===Ba.VIEW){var t=e.oldValue;t&&this.unbindView_(t);var i=this.getMap().getView();this.bindView_(i)}},t.prototype.bindView_=function(e){if(!this.view_){var t=new td({projection:e.getProjection()});this.ovmap_.setView(t)}e.addEventListener(qa(Ma.ROTATION),this.boundHandleRotationChanged_),this.handleRotationChanged_()},t.prototype.unbindView_=function(e){e.removeEventListener(qa(Ma.ROTATION),this.boundHandleRotationChanged_)},t.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},t.prototype.validateExtent_=function(){var e=this.getMap(),t=this.ovmap_;if(e.isRendered()&&t.isRendered()){var i=e.getSize(),o=e.getView().calculateExtentInternal(i);if(!this.viewExtent_||!mc(o,this.viewExtent_)){this.viewExtent_=o;var r=t.getSize(),a=t.getView().calculateExtentInternal(r),n=t.getPixelFromCoordinateInternal(Ya(o)),l=t.getPixelFromCoordinateInternal(Sb(o)),p=Math.abs(n[0]-l[0]),s=Math.abs(n[1]-l[1]),h=r[0],$=r[1];p<h*Kc||s<$*Kc||p>h*Pd||s>$*Pd?this.resetExtent_():kb(a,o)||this.recenter_()}}},t.prototype.resetExtent_=function(){if(0!==Pd&&0!==Kc){var e=this.getMap(),t=this.ovmap_,i=e.getSize(),o=e.getView().calculateExtentInternal(i),r=t.getView(),a=Math.log(Pd/Kc)/Math.LN2,n=1/(Math.pow(2,a/2)*Kc);Lh(o,n),r.fitInternal(_b(o))}},t.prototype.recenter_=function(){var e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())},t.prototype.updateBox_=function(){var e=this.getMap(),t=this.ovmap_;if(e.isRendered()&&t.isRendered()){var i=e.getSize(),o=e.getView(),r=t.getView(),a=this.rotateWithView_?0:-o.getRotation(),n=this.boxOverlay_,l=this.boxOverlay_.getElement(),p=o.getCenterInternal(),s=o.getResolution(),h=r.getResolution(),$=i[0]*s/h,v=i[1]*s/h;if(n.setPosition(p),l){l.style.width=$+"px",l.style.height=v+"px";var d="rotate("+a+"rad)";l.style.transform=d}}},t.prototype.handleClick_=function(e){e.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(jd),this.collapsed_?ic(this.collapseLabel_,this.label_):ic(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var e=this.ovmap_;if(!this.collapsed_){if(e.isRendered())return this.viewExtent_=void 0,void e.render();e.updateSize(),this.resetExtent_(),Ec(e,kc.POSTRENDER,function(e){this.updateBox_()},this)}},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(e){this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.setRotateWithView=function(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},t.prototype.getOverviewMap=function(){return this.ovmap_},t}(Wa);function Xi(e){this.validateExtent_(),this.updateBox_()}ed.render=Xi,ed.default=zl;var Jc={};var yl=Jc&&Jc.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),rg="units",zb={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};Jc.Units=zb;var xl=[1,2,5],vl=function(e){function t(t){var r=this,i=t||{},s=void 0!==i.className?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return(r=e.call(this,{element:document.createElement("div"),render:i.render||cj,target:i.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=s+"-inner",r.element.className=s+" "+Xa,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==i.minWidth?i.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(qa(rg),r.handleUnitsChanged_),r.setUnits(i.units||zb.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r}return yl(t,e),t.prototype.getUnits=function(){return this.get(rg)},t.prototype.handleUnitsChanged_=function(){this.updateElement_()},t.prototype.setUnits=function(e){this.set(rg,e)},t.prototype.updateElement_=function(){var e=this.viewState_;if(e){var t=e.center,r=e.projection,i=this.getUnits(),s=i==zb.DEGREES?Ca.DEGREES:Ca.METERS,n=Vg(r,e.resolution,t,s),a=this.minWidth_*n,o="";if(i==zb.DEGREES){var d=bb[Ca.DEGREES];(a*=d)<d/60?(o="\u2033",n*=3600):a<d?(o="\u2032",n*=60):o="\xB0"}else i==zb.IMPERIAL?a<.9144?(o="in",n/=.0254):a<1609.344?(o="ft",n/=.3048):(o="mi",n/=1609.344):i==zb.NAUTICAL?(n/=1852,o="nm"):i==zb.METRIC?a<.001?(o="\u03BCm",n*=1e6):a<1?(o="mm",n*=1e3):a<1e3?o="m":(o="km",n/=1e3):i==zb.US?a<.9144?(o="in",n*=39.37):a<1609.344?(o="ft",n/=.30480061):(o="mi",n/=1609.3472):ia(!1,33);for(var l,$,p,c,h=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){p=Math.floor(h/3);var _=Math.pow(10,p);if(l=xl[(h%3+3)%3]*_,$=Math.round(l/n),isNaN($))return this.element.style.display="none",void(this.renderedVisible_=!1);if($>=this.minWidth_)break;++h}c=this.scaleBar_?this.createScaleBar($,l,o):l.toFixed(p<0?-p:0)+" "+o,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=$&&(this.innerElement_.style.width=$+"px",this.renderedWidth_=$),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t.prototype.createScaleBar=function(e,t,r){for(var i="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],n=e/this.scaleBarSteps_,a="#ffffff",o=0;o<this.scaleBarSteps_;o++)0===o&&s.push(this.createMarker("absolute",o)),s.push("<div><div class=\"ol-scale-singlebar\" style=\"width: "+n+"px;background-color: "+a+";\"></div>"+this.createMarker("relative",o)+(o%2==0||2===this.scaleBarSteps_?this.createStepText(o,e,!1,t,r):"")+"</div>"),o===this.scaleBarSteps_-1&&s.push(this.createStepText(o+1,e,!0,t,r)),a="#ffffff"===a?"#000000":"#ffffff";return"<div style=\"display: flex;\">"+(this.scaleBarText_?"<div class=\"ol-scale-text\" style=\"width: "+e+"px;\">"+i+"</div>":"")+s.join("")+"</div>"},t.prototype.createMarker=function(e,t){return"<div class=\"ol-scale-step-marker\" style=\"position: "+e+";top: "+("absolute"===e?3:-10)+"px;\"></div>"},t.prototype.createStepText=function(e,t,r,i,s){var n=(0===e?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(0===e?"":" "+s);return"<div class=\"ol-scale-step-text\" style=\"margin-left: "+(0===e?-3:t/this.scaleBarSteps_*-1)+"px;text-align: "+(0===e?"left":"center")+"; min-width: "+(0===e?0:t/this.scaleBarSteps_*2)+"px;left: "+(r?t+"px":"unset")+";\">"+n+"</div>"},t.prototype.getScaleForResolution=function(){var e=this.getMap().getView().getResolution(),t=this.viewState_.projection.getMetersPerUnit();return parseFloat(e.toString())*t*39.37*(25.4/.28)},t}(Wa);function cj(e){var t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}Jc.render=cj,Jc.default=vl;var Td={};var ul=Td&&Td.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dc={VERTICAL:0,HORIZONTAL:1},sl=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,{element:document.createElement("div"),render:r.render||hj})||this).dragListenerKeys_=[],i.currentResolution_=void 0,i.direction_=Dc.VERTICAL,i.dragging_,i.heightLimit_=0,i.widthLimit_=0,i.startX_,i.startY_,i.thumbSize_=null,i.sliderInitialized_=!1,i.duration_=void 0!==r.duration?r.duration:200;var n=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=n+"-thumb "+Xa;var s=i.element;return s.className=n+" "+Xa+" "+Pb,s.appendChild(o),s.addEventListener(gb.POINTERDOWN,i.handleDraggerStart_.bind(i),!1),s.addEventListener(gb.POINTERMOVE,i.handleDraggerDrag_.bind(i),!1),s.addEventListener(gb.POINTERUP,i.handleDraggerEnd_.bind(i),!1),s.addEventListener(ba.CLICK,i.handleContainerClick_.bind(i),!1),o.addEventListener(ba.CLICK,Rp,!1),i}return ul(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight,r=t.firstElementChild,n=getComputedStyle(r),o=r.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=r.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);this.thumbSize_=[o,s],e>i?(this.direction_=Dc.HORIZONTAL,this.widthLimit_=e-o):(this.direction_=Dc.VERTICAL,this.heightLimit_=i-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i),n=e.getConstrainedZoom(e.getZoomForResolution(r));e.animateInternal({zoom:n,duration:this.duration_,easing:Mb})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var i=this.handleDraggerDrag_,r=this.handleDraggerEnd_;this.dragListenerKeys_.push(fa(document,gb.POINTERMOVE,i,this),fa(document,gb.POINTERUP,r,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,i=t.clientY-this.startY_,r=this.getRelativePosition_(e,i);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(ja),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==Dc.HORIZONTAL?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){var i;return i=this.direction_===Dc.HORIZONTAL?t/this.widthLimit_:e/this.heightLimit_,wa(i,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return wa(1-e(t),0,1)},e}(Wa);function hj(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}}Td.render=hj,Td.default=sl;var wg={};var ql=wg&&wg.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pl=function(t){function e(e){var n=this,o=e||{};(n=t.call(this,{element:document.createElement("div"),target:o.target})||this).extent=o.extent?o.extent:null;var r=void 0!==o.className?o.className:"ol-zoom-extent",i=void 0!==o.label?o.label:"E",a=void 0!==o.tipLabel?o.tipLabel:"Fit to extent",$=document.createElement("button");$.setAttribute("type","button"),$.title=a,$.appendChild("string"==typeof i?document.createTextNode(i):i),$.addEventListener(ba.CLICK,n.handleClick_.bind(n),!1);var l=r+" "+Xa+" "+Pb,p=n.element;return p.className=l,p.appendChild($),n}return ql(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(_b(e))},e}(Wa);wg.default=pl;function ol(o){var a=o||{},r=new za,e=new nl(-.005,.05,100);return(void 0===a.altShiftDragRotate||a.altShiftDragRotate)&&r.push(new Uj),(void 0===a.doubleClickZoom||a.doubleClickZoom)&&r.push(new vj({delta:a.zoomDelta,duration:a.zoomDuration})),(void 0===a.dragPan||a.dragPan)&&r.push(new Qj({condition:a.onFocusOnly?be:void 0,kinetic:e})),(void 0===a.pinchRotate||a.pinchRotate)&&r.push(new uk),(void 0===a.pinchZoom||a.pinchZoom)&&r.push(new xk({duration:a.zoomDuration})),(void 0===a.keyboard||a.keyboard)&&(r.push(new ik),r.push(new mk({delta:a.zoomDelta,duration:a.zoomDuration}))),(void 0===a.mouseWheelZoom||a.mouseWheelZoom)&&r.push(new rk({condition:a.onFocusOnly?be:void 0,duration:a.zoomDuration})),(void 0===a.shiftDragZoom||a.shiftDragZoom)&&r.push(new dk({duration:a.zoomDuration})),r}var nl=function(){function t(t,i,n){this.decay_=t,this.minVelocity_=i,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var n=i-3;n>0&&this.points_[n+2]>t;)n-=3;var e=this.points_[i+2]-this.points_[n+2];if(e<1e3/60)return!1;var s=this.points_[i]-this.points_[n],o=this.points_[i+1]-this.points_[n+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/e,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var Bg={};var Fc={};var Zd={ACTIVE:"active"};var ll=Fc&&Fc.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ab=function(t){function e(e){var r=t.call(this)||this;return e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return ll(e,t),e.prototype.getActive=function(){return this.get(Zd.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Zd.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(Oa);function sj(t,e,r){var n=t.getCenterInternal();if(n){var o=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:Do,center:t.getConstrainedCenter(o)})}}function _d(t,e,r,n){var o=t.getZoom();if(void 0!==o){var p=t.getConstrainedZoom(o+e),a=t.getResolutionForZoom(p);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:Mb})}}Fc.pan=sj,Fc.zoomByDelta=_d,Fc.default=Ab;var jl=Bg&&Bg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),vj=function(t){function e(e){var r=t.call(this,{handleEvent:il})||this,a=e||{};return r.delta_=a.delta?a.delta:1,r.duration_=void 0!==a.duration?a.duration:250,r}return jl(e,t),e}(Ab);function il(t){var e=!1;if(t.type==ha.DBLCLICK){var r=t.originalEvent,a=t.map,n=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_,$=a.getView();_d($,o,n,this.duration_),t.preventDefault(),e=!0}return!e}Bg.default=vj;var Hg={};var hl=function(e){var t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey};var gl=function(e){var t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey};var be=function(e){return e.target.getTargetElement()===document.activeElement};var Lg=Ia;var Cj=function(e){var t=e.originalEvent;return 0==t.button&&!(Ep&&Bp&&t.ctrlKey)};var Dj=Jb;var Ej=function(e){return e.type==ha.SINGLECLICK};var Mg=function(e){var t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey};var ce=function(e){var t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey};var Hj=function(e){var t=e.originalEvent.target.tagName;return"INPUT"!==t&&"SELECT"!==t&&"TEXTAREA"!==t};var gc=function(e){var t=e.pointerEvent;return ia(void 0!==t,56),"mouse"==t.pointerType};var Jj=function(e){var t=e.pointerEvent;return ia(void 0!==t,56),t.isPrimary&&0===t.button};var ge={};var fl=ge&&ge.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Na=function(e){function t(t){var n=this,r=t||{};return n=e.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return fl(t,e),t.prototype.getPointerCount=function(){return this.targetPointers.length},t.prototype.handleDownEvent=function(e){return!1},t.prototype.handleDragEvent=function(e){},t.prototype.handleEvent=function(e){if(!e.pointerEvent)return!0;var t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==ha.POINTERDRAG)this.handleDragEvent(e);else if(e.type==ha.POINTERUP){var n=this.handleUpEvent(e);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(e.type==ha.POINTERDOWN){var r=this.handleDownEvent(e);this.handlingDownUpSequence=r,t=this.stopDown(r)}else e.type==ha.POINTERMOVE&&this.handleMoveEvent(e);return!t},t.prototype.handleMoveEvent=function(e){},t.prototype.handleUpEvent=function(e){return!1},t.prototype.stopDown=function(e){return e},t.prototype.updateTrackedPointers_=function(e){if(el(e)){var t=e.pointerEvent,n=t.pointerId.toString();e.type==ha.POINTERUP?delete this.trackedPointers_[n]:e.type==ha.POINTERDOWN?this.trackedPointers_[n]=t:n in this.trackedPointers_&&(this.trackedPointers_[n]=t),this.targetPointers=df(this.trackedPointers_)}},t}(Ab);function ke(e){for(var t=e.length,n=0,r=0,o=0;o<t;o++)n+=e[o].clientX,r+=e[o].clientY;return[n/t,r/t]}function el(e){var t=e.type;return t===ha.POINTERDOWN||t===ha.POINTERDRAG||t===ha.POINTERUP}ge.centroid=ke,ge.default=Na;var bl=Hg&&Hg.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function i(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Qj=function(t){function n(n){var e=t.call(this,{stopDown:Jb})||this,i=n||{};return e.kinetic_=i.kinetic,e.lastCentroid=null,e.lastPointersCount_,e.panning_=!1,e.condition_=i.condition?i.condition:al,e.noKinetic_=!1,e}return bl(n,t),n.prototype.conditionInternal_=function(t){var n=!0;return t.map.getTargetElement().hasAttribute("tabindex")&&(n=be(t)),n&&this.condition_(t)},n.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var n=this.targetPointers,e=ke(n);if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(e[0],e[1]),this.lastCentroid){var i=[this.lastCentroid[0]-e[0],e[1]-this.lastCentroid[1]],r=t.map.getView();Go(i,r.getResolution()),Qf(i,r.getRotation()),r.adjustCenterInternal(i)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=e,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()},n.prototype.handleUpEvent=function(t){var n=t.map,e=n.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var i=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=e.getCenterInternal(),a=n.getPixelFromCoordinateInternal(o),s=n.getCoordinateFromPixelInternal([a[0]-i*Math.cos(r),a[1]-i*Math.sin(r)]);e.animateInternal({center:e.getConstrainedCenter(s),duration:500,easing:Mb})}return this.panning_&&(this.panning_=!1,e.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.conditionInternal_(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},n}(Na);function al(t){return Mg(t)&&Jj(t)}Hg.default=Qj;var Wg={};var $k=Wg&&Wg.__extends||function(){var t=function(n,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])})(n,o)};return function(n,o){function e(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),Uj=function(t){function n(n){var o=this,e=n||{};return(o=t.call(this,{stopDown:Jb})||this).condition_=e.condition?e.condition:gl,o.lastAngle_=void 0,o.duration_=void 0!==e.duration?e.duration:250,o}return $k(n,t),n.prototype.handleDragEvent=function(t){if(gc(t)){var n=t.map,o=n.getView();if(o.getConstraints().rotation!==Bf){var e=n.getSize(),r=t.pixel,i=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(void 0!==this.lastAngle_){var a=i-this.lastAngle_;o.adjustRotationInternal(-a)}this.lastAngle_=i}}},n.prototype.handleUpEvent=function(t){return!gc(t)||(t.map.getView().endInteraction(this.duration_),!1)},n.prototype.handleDownEvent=function(t){return!!gc(t)&&!(!Cj(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)},n}(Na);Wg.default=Uj;var Yg={};var Zg={};var $g={};var Zk=$g&&$g.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Zj=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return Zk(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px",r.top=Math.min(t[1],e[1])+"px",r.width=Math.abs(e[0]-t[0])+"px",r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new _a([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(fh);$g.default=Zj;var $j=Zg&&Zg.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),ah={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},bh=function(t){function n(n,e,o){var r=t.call(this,n)||this;return r.coordinate=e,r.mapBrowserEvent=o,r}return $j(n,t),n}(Ha),bk=function(t){function n(n){var e=t.call(this)||this,o=n||{};return e.box_=new Zj(o.className||"ol-dragbox"),e.minArea_=void 0!==o.minArea?o.minArea:64,e.onBoxEnd_=o.onBoxEnd?o.onBoxEnd:jb,e.startPixel_=null,e.condition_=o.condition?o.condition:Cj,e.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:e.defaultBoxEndCondition,e}return $j(n,t),n.prototype.defaultBoxEndCondition=function(t,n,e){var o=e[0]-n[0],r=e[1]-n[1];return o*o+r*r>=this.minArea_},n.prototype.getGeometry=function(){return this.box_.getGeometry()},n.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new bh(ah.BOXDRAG,t.coordinate,t))},n.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new bh(ah.BOXEND,t.coordinate,t))),!1},n.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new bh(ah.BOXSTART,t.coordinate,t)),!0)},n}(Na);Zg.default=bk;var Xk=Yg&&Yg.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),dk=function(t){function e(e){var o=this,r=e||{},n=r.condition?r.condition:ce;return(o=t.call(this,{condition:n,className:r.className||"ol-dragzoom",minArea:r.minArea,onBoxEnd:Wk})||this).duration_=void 0!==r.duration?r.duration:200,o.out_=void 0!==r.out&&r.out,o}return Xk(e,t),e}(bk);function Wk(){var t=this.getMap(),e=t.getView(),o=t.getSize(),r=this.getGeometry().getExtent();if(this.out_){var n=e.calculateExtentInternal(o),i=dp([t.getPixelFromCoordinateInternal(vb(r)),t.getPixelFromCoordinateInternal(Ob(r))]),a=e.getResolutionForExtentInternal(i,o);Lh(n,1/a),r=n}var $=e.getConstrainedResolution(e.getResolutionForExtentInternal(r,o)),p=e.getConstrainedCenter(Qb(r),$);e.animateInternal({resolution:$,center:p,duration:this.duration_,easing:Mb})}Yg.default=dk;var eh={};var Rb={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Uk=eh&&eh.__extends||function(){var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])})(t,e)};return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ik=function(o){function t(t){var e=o.call(this,{handleEvent:Sk})||this,r=t||{};return e.defaultCondition_=function(o){return Mg(o)&&Hj(o)},e.condition_=void 0!==r.condition?r.condition:e.defaultCondition_,e.duration_=void 0!==r.duration?r.duration:100,e.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,e}return Uk(t,o),t}(Ab);function Sk(o){var t=!1;if(o.type==ba.KEYDOWN){var e=o.originalEvent.keyCode;if(this.condition_(o)&&(e==Rb.DOWN||e==Rb.LEFT||e==Rb.RIGHT||e==Rb.UP)){var r=o.map.getView(),n=r.getResolution()*this.pixelDelta_,i=0,$=0;e==Rb.DOWN?$=-n:e==Rb.LEFT?i=-n:e==Rb.RIGHT?i=n:$=n;var a=[i,$];Qf(a,r.getRotation()),sj(r,a,this.duration_),o.preventDefault(),t=!0}}return!t}eh.default=ik;var hh={};var Rk=hh&&hh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mk=function(t){function e(e){var r=t.call(this,{handleEvent:Qk})||this,n=e||{};return r.condition_=n.condition?n.condition:Hj,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Rk(e,t),e}(Ab);function Qk(t){var e=!1;if(t.type==ba.KEYDOWN||t.type==ba.KEYPRESS){var r=t.originalEvent.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var n=t.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_,i=n.getView();_d(i,o,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}hh.default=mk;var ve={};var Pk=ve&&ve.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),xe={TRACKPAD:"trackpad",WHEEL:"wheel"};ve.Mode=xe;var rk=function(t){function e(e){var o=this,i=e||{};return(o=t.call(this,i)||this).totalDelta_=0,o.lastDelta_=0,o.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,o.duration_=void 0!==i.duration?i.duration:250,o.timeout_=void 0!==i.timeout?i.timeout:80,o.useAnchor_=void 0===i.useAnchor||i.useAnchor,o.condition_=i.condition?i.condition:Lg,o.lastAnchor_=null,o.startTime_=void 0,o.timeoutId_,o.mode_=void 0,o.trackpadEventGap_=400,o.trackpadTimeoutId_,o.deltaPerZoom_=300,o}return Pk(e,t),e.prototype.conditionInternal_=function(t){var e=!0;return t.map.getTargetElement().hasAttribute("tabindex")&&(e=be(t)),e&&this.condition_(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.conditionInternal_(t))return!0;if(t.type!==ba.WHEEL)return!0;t.preventDefault();var e,o=t.map,i=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==ba.WHEEL&&(e=i.deltaY,Hp&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=ue),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?xe.TRACKPAD:xe.WHEEL);var a=o.getView();if(this.mode_===xe.TRACKPAD&&!a.getConstrainResolution())return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=e;var n=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,o),n),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var o=-wa(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;e.getConstrainResolution()&&(o=o?o>0?1:-1:0),_d(e,o,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}(Ab);ve.default=rk;var mh={};var Nk=mh&&mh.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),uk=function(t){function n(n){var e=this,r=n||{},o=r;return o.stopDown||(o.stopDown=Jb),(e=t.call(this,o)||this).anchor_=null,e.lastAngle_=void 0,e.rotating_=!1,e.rotationDelta_=0,e.threshold_=void 0!==r.threshold?r.threshold:.3,e.duration_=void 0!==r.duration?r.duration:250,e}return Nk(n,t),n.prototype.handleDragEvent=function(t){var n=0,e=this.targetPointers[0],r=this.targetPointers[1],o=Math.atan2(r.clientY-e.clientY,r.clientX-e.clientX);if(void 0!==this.lastAngle_){var i=o-this.lastAngle_;this.rotationDelta_+=i,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),n=i}this.lastAngle_=o;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Bf){var h=a.getViewport().getBoundingClientRect(),l=ke(this.targetPointers);l[0]-=h.left,l[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(l),this.rotating_&&(a.render(),s.adjustRotationInternal(n,this.anchor_))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Na);mh.default=uk;var oh={};var Mk=oh&&oh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xk=function(t){function e(e){var r=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Jb),(r=t.call(this,o)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Mk(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],o=r.clientX-n.clientX,i=r.clientY-n.clientY,a=Math.sqrt(o*o+i*i);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,c=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),u=ke(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),s.render(),c.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Na);oh.default=xk;var ph={};var zk=ph&&ph.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lk={ADD_FEATURES:"addfeatures"},Jk=function(t){function e(e,r,n,o){var i=t.call(this,e)||this;return i.features=n,i.file=r,i.projection=o,i}return zk(e,t),e}(Ha),Ik=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{handleEvent:Ia})||this).formatConstructors_=n.formatConstructors?n.formatConstructors:[],r.projection_=n.projection?ua(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return zk(e,t),e.prototype.handleResult_=function(t,e){var r=e.target.result,n=this.getMap(),o=this.projection_;o||(o=n.getView().getProjection());for(var i=this.formatConstructors_,s=[],$=0,a=i.length;$<a;++$){var p=new i[$];if((s=this.tryReadFeatures_(p,r,{featureProjection:o}))&&s.length>0)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(s)),this.dispatchEvent(new Jk(Lk.ADD_FEATURES,t,s,o))},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[fa(e,ba.DROP,Gk,this),fa(e,ba.DRAGENTER,jh,this),fa(e,ba.DRAGOVER,jh,this),fa(e,ba.DROP,jh,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(n){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(ja),this.dropListenKeys_=null)},e}(Ab);function Gk(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var o=e.item(r),i=new FileReader;i.addEventListener(ba.LOAD,this.handleResult_.bind(this,o)),i.readAsText(o)}}function jh(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}ph.default=Ik;var th={};var wn=th&&th.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Hk=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,i)||this).condition_=i.condition?i.condition:ce,n.lastAngle_=void 0,n.lastMagnitude_=void 0,n.lastScaleDelta_=0,n.duration_=void 0!==i.duration?i.duration:400,n}return wn(e,t),e.prototype.handleDragEvent=function(t){if(gc(t)){var e=t.map,n=e.getSize(),i=t.pixel,o=i[0]-n[0]/2,a=n[1]/2-i[1],r=Math.atan2(a,o),s=Math.sqrt(o*o+a*a),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-r;l.adjustRotationInternal(u)}this.lastAngle_=r,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!gc(t))return!0;var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!gc(t)&&!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0)},e}(Na);th.default=Hk;var _c={};var ze={};var Kk=ze&&ze.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ab=function(e){function t(t){var r=e.call(this)||this;if(r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addEventListener(qa(r.geometryName_),r.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){var n=t;r.setGeometry(n)}else{var o=t;r.setProperties(o)}return r}return Kk(t,e),t.prototype.clone=function(){var e=new t(this.getProperties());e.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&e.setGeometry(r.clone());var n=this.getStyle();return n&&e.setStyle(n),e},t.prototype.getGeometry=function(){return this.get(this.geometryName_)},t.prototype.getId=function(){return this.id_},t.prototype.getGeometryName=function(){return this.geometryName_},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.handleGeometryChange_=function(){this.changed()},t.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(ja(this.geometryChangeKey_),this.geometryChangeKey_=null);var e=this.getGeometry();e&&(this.geometryChangeKey_=fa(e,ba.CHANGE,this.handleGeometryChange_,this)),this.changed()},t.prototype.setGeometry=function(e){this.set(this.geometryName_,e)},t.prototype.setStyle=function(e){this.style_=e,this.styleFunction_=e?wk(e):void 0,this.changed()},t.prototype.setId=function(e){this.id_=e,this.changed()},t.prototype.setGeometryName=function(e){this.removeEventListener(qa(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=e,this.addEventListener(qa(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},t}(Oa);function wk(e){return"function"==typeof e?e:(Array.isArray(e)?t=e:(ia("function"==typeof e.getZIndex,41),t=[e]),function(){return t});var t}ze.createStyleFunction=wk,ze.default=ab;var nh={};var Ok=nh&&nh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Gc=function(t){function e(e,r,o){var i=t.call(this)||this;if(void 0!==o&&void 0===r)i.setFlatCoordinates(o,e);else{var s=r||0;i.setCenterAndRadius(e,s,o)}return i}return Ok(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,o){var i=this.flatCoordinates,s=t-i[0],n=e-i[1],a=s*s+n*n;if(a<o){if(0===a)for(var p=0;p<this.stride;++p)r[p]=i[p];else{var d=this.getRadius()/Math.sqrt(a);r[0]=i[0]+d*s,r[1]=i[1]+d*n;for(p=2;p<this.stride;++p)r[p]=i[p]}return r.length=this.stride,a}return o},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,o=t-r[0],i=e-r[1];return o*o+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return Sa(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return aa.CIRCLE},e.prototype.intersectsExtent=function(t){var e=this.getExtent();if(Ga(t,e)){var r=this.getCenter();return t[0]<=r[0]&&t[2]>=r[0]||t[1]<=r[1]&&t[3]>=r[1]||wj(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+r;for(var i=1;i<e;++i)o[e+i]=t[i];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,i=Ek(o,0,t,this.stride);o[i++]=o[0]+e;for(var s=1,n=this.stride;s<n;++s)o[i++]=o[s];o.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),o=this.getStride();this.setCenter(zj(r,0,r.length,o,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),o=this.getStride();this.setCenter(Bj(r,0,r.length,o,t,e,r)),this.changed()},e}(db);Gc.prototype.transform,nh.default=Gc;var ih={};function lk(r,e,t,i,n,$){var o=NaN,l=NaN,a=(t-e)/i;if(1===a)o=r[e],l=r[e+1];else if(2==a)o=(1-n)*r[e]+n*r[e+i],l=(1-n)*r[e+1]+n*r[e+i+1];else if(0!==a){for(var u=r[e],p=r[e+1],f=0,s=[0],q=e+i;q<t;q+=i){var D=r[q],T=r[q+1];f+=Math.sqrt((D-u)*(D-u)+(T-p)*(T-p)),s.push(f),u=D,p=T}var v=n*f,c=gq(s,v);if(c<0){var g=(v-s[-c-2])/(s[-c-1]-s[-c-2]),x=e+(-c-2)*i;o=oc(r[x],r[x+i],g),l=oc(r[x+1],r[x+i+1],g)}else o=r[e+c*i],l=r[e+c*i+1]}return $?($[0]=o,$[1]=l,$):[o,l]}function gh(r,e,t,i,n,$){if(t==e)return null;var o;if(n<r[e+i-1])return $?((o=r.slice(e,e+i))[i-1]=n,o):null;if(r[t-1]<n)return $?((o=r.slice(t-i,t))[i-1]=n,o):null;if(n==r[e+i-1])return r.slice(e,e+i);for(var l=e/i,a=t/i;l<a;){var u=l+a>>1;n<r[(u+1)*i-1]?a=u:l=u+1}var p=r[l*i-1];if(n==p)return r.slice((l-1)*i,(l-1)*i+i);var f=(n-p)/(r[(l+1)*i-1]-p);o=[];for(var s=0;s<i-1;++s)o.push(oc(r[(l-1)*i+s],r[l*i+s],f));return o.push(n),o}function Tk(r,e,t,i,n,$,o){if(o)return gh(r,e,t[t.length-1],i,n,$);var l;if(n<r[i-1])return $?((l=r.slice(0,i))[i-1]=n,l):null;if(r[r.length-1]<n)return $?((l=r.slice(r.length-i))[i-1]=n,l):null;for(var a=0,u=t.length;a<u;++a){var p=t[a];if(e!=p){if(n<r[e+i-1])return null;if(n<=r[p-1])return gh(r,e,p,i,n,!1);e=p}}return null}function hk(r,n,t,e){for(var $=r[n],i=r[n+1],x=0,Z=n+e;Z<t;Z+=e){var g=r[Z],o=r[Z+1];x+=Math.sqrt((g-$)*(g-$)+(o-i)*(o-i)),$=g,i=o}return x}var Vk=ih&&ih.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Tb=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 Vk(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?Pa(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<$b(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Rf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Vf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return ci(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=sa.XYM&&this.layout!=sa.XYZM)return null;var i=void 0!==e&&e;return gh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return Nc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return lk(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},e.prototype.getLength=function(){return hk(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=fg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,sa.XY)},e.prototype.getType=function(){return aa.LINE_STRING},e.prototype.intersectsExtent=function(t){return yd(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=Cd(this.flatCoordinates,0,t,this.stride),this.changed()},e}(db);ih.default=Tb;var ch={};var Yk=ch&&ch.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),_g=function(t){function e(e,r,i){var o=t.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(e[0]))o.setCoordinates(e,r);else if(void 0!==r&&i)o.setFlatCoordinates(r,e),o.ends_=i;else{for(var s=o.getLayout(),n=e,a=[],f=[],l=0,$=n.length;l<$;++l){var p=n[l];0===l&&(s=p.getLayout()),Pa(a,p.getFlatCoordinates()),f.push(a.length)}o.setFlatCoordinates(s,a),o.ends_=f}return o}return Yk(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?Pa(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,i){return i<$b(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Sf(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ae(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,i))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=sa.XYM&&this.layout!=sa.XYZM||0===this.flatCoordinates.length)return null;var i=void 0!==e&&e,o=void 0!==r&&r;return Tk(this.flatCoordinates,0,this.ends_,this.stride,t,i,o)},e.prototype.getCoordinates=function(){return Bd(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 Tb(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,i=[],o=0,s=0,n=e.length;s<n;++s){var a=e[s],f=new Tb(t.slice(o,a),r);i.push(f),o=a}return i},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,i=this.ends_,o=this.stride,s=0,n=i.length;s<n;++s){var a=i[s],f=lk(e,r,a,o,.5);Pa(t,f),r=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=Hn(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,i),new e(r,sa.XY,i)},e.prototype.getType=function(){return aa.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return xn(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=$f(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(db);ch.default=_g;var Xg={};var _k=Xg&&Xg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),me=function(t){function e(e,r){var o=t.call(this)||this;return r&&!Array.isArray(e[0])?o.setFlatCoordinates(r,e):o.setCoordinates(e,r),o}return _k(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?Pa(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,o){if(o<$b(this.getExtent(),t,e))return o;for(var i=this.flatCoordinates,n=this.stride,s=0,a=i.length;s<a;s+=n){var u=Db(t,e,i[s],i[s+1]);if(u<o){o=u;for(var d=0;d<n;++d)r[d]=i[s+d];r.length=n}}return o},e.prototype.getCoordinates=function(){return Nc(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 ob(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,o=[],i=0,n=t.length;i<n;i+=r){var s=new ob(t.slice(i,i+r),e);o.push(s)}return o},e.prototype.getType=function(){return aa.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,o=0,i=e.length;o<i;o+=r){var n=e[o],s=e[o+1];if(Dg(t,n,s))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Cd(this.flatCoordinates,0,t,this.stride),this.changed()},e}(db);Xg.default=me;var Ug={};function cl(r,e,t,$){for(var n=[],a=Fa(),i=0,o=t.length;i<o;++i){var s=t[i];a=ij(r,e,s[0],$),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),e=s[s.length-1]}return n}var dl=Ug&&Ug.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tg=function(t){function e(e,i,r){var o=t.call(this)||this;if(o.endss_=[],o.flatInteriorPointsRevision_=-1,o.flatInteriorPoints_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var s=o.getLayout(),n=e,a=[],h=[],l=0,u=n.length;l<u;++l){var $=n[l];0===l&&(s=$.getLayout());for(var d=a.length,p=$.getEnds(),f=0,c=p.length;f<c;++f)p[f]+=d;Pa(a,$.getFlatCoordinates()),h.push(p)}i=s,e=a,r=h}return void 0!==i&&r?(o.setFlatCoordinates(i,e),o.endss_=r):o.setCoordinates(e,i),o}return dl(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;Pa(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,o=(e=t.getEnds().slice()).length;r<o;++r)e[r]+=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),r=0;r<t;++r)i[r]=this.endss_[r].slice();return new e(this.flatCoordinates.slice(),this.layout,i)},e.prototype.closestPointXY=function(t,e,i,r){return r<$b(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ln(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Kn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.containsXY=function(t,e){return zn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return On(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),li(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Bh(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=cl(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=yn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new me(this.getFlatInteriorPoints().slice(),sa.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;on(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=li(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=Dn(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,r),new e(i,sa.XY,r)},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 r=this.endss_[t].slice(),o=r[r.length-1];if(0!==e)for(var s=0,n=r.length;s<n;++s)r[s]-=e;return new _a(this.flatCoordinates.slice(e,o),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],o=0,s=0,n=i.length;s<n;++s){var a=i[s].slice(),h=a[a.length-1];if(0!==o)for(var l=0,u=a.length;l<u;++l)a[l]-=o;var $=new _a(e.slice(o,h),t,a);r.push($),o=h}return r},e.prototype.getType=function(){return aa.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return un(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=In(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(db);Ug.default=Tg;var Qg={};var Jg={};var Ig={};var Gg={};var uj=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.displacement_=t.displacement}return t.prototype.clone=function(){return new t({opacity:this.getOpacity(),scale:this.getScale(),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.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return ca()},t.prototype.getImage=function(t){return ca()},t.prototype.getHitDetectionImage=function(t){return ca()},t.prototype.getImageState=function(){return ca()},t.prototype.getImageSize=function(){return ca()},t.prototype.getHitDetectionImageSize=function(){return ca()},t.prototype.getOrigin=function(){return ca()},t.prototype.getSize=function(){return ca()},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},t.prototype.listenImageChange=function(t){ca()},t.prototype.load=function(){ca()},t.prototype.unlistenImageChange=function(t){ca()},t}();var kl=Gg&&Gg.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),qj=function(t){function i(i){var e=this,r=void 0!==i.rotateWithView&&i.rotateWithView;return(e=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==i.rotation?i.rotation:0,scale:1,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this).canvas_=null,e.hitDetectionCanvas_=null,e.fill_=void 0!==i.fill?i.fill:null,e.origin_=[0,0],e.points_=i.points,e.radius_=void 0!==i.radius?i.radius:i.radius1,e.radius2_=i.radius2,e.angle_=void 0!==i.angle?i.angle:0,e.stroke_=void 0!==i.stroke?i.stroke:null,e.anchor_=null,e.size_=null,e.imageSize_=null,e.hitDetectionImageSize_=null,e.render(),e}return kl(i,t),i.prototype.clone=function(){var t=new i({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},i.prototype.getAnchor=function(){return this.anchor_},i.prototype.getAngle=function(){return this.angle_},i.prototype.getFill=function(){return this.fill_},i.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},i.prototype.getImage=function(t){return this.canvas_},i.prototype.getImageSize=function(){return this.imageSize_},i.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},i.prototype.getImageState=function(){return oa.LOADED},i.prototype.getOrigin=function(){return this.origin_},i.prototype.getPoints=function(){return this.points_},i.prototype.getRadius=function(){return this.radius_},i.prototype.getRadius2=function(){return this.radius2_},i.prototype.getSize=function(){return this.size_},i.prototype.getStroke=function(){return this.stroke_},i.prototype.listenImageChange=function(t){},i.prototype.load=function(){},i.prototype.unlistenImageChange=function(t){},i.prototype.render=function(){var t,i=tc,e=qc,r=0,o=null,s=0,n=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Mc),t=Za(t),void 0===(n=this.stroke_.getWidth())&&(n=Cc),o=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=qc),void 0===(i=this.stroke_.getLineCap())&&(i=tc),void 0===(r=this.stroke_.getMiterLimit())&&(r=Pc));var a=2*(this.radius_+n)+1,l={strokeStyle:t,strokeWidth:n,size:a,lineCap:i,lineDash:o,lineDashOffset:s,lineJoin:e,miterLimit:r},h=La(a,a);this.canvas_=h.canvas;var u=a=this.canvas_.width,p=this.getDisplacement();this.draw_(l,h,0,0),this.createHitDetectionCanvas_(l),this.anchor_=[a/2-p[0],a/2+p[1]],this.size_=[a,a],this.imageSize_=[u,u]},i.prototype.draw_=function(t,i,e,r){var o,s,n;i.setTransform(1,0,0,1,0,0),i.translate(e,r),i.beginPath();var a=this.points_;if(a===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(a*=2),o=0;o<=a;o++)s=2*o*Math.PI/a-Math.PI/2+this.angle_,n=o%2==0?this.radius_:l,i.lineTo(t.size/2+n*Math.cos(s),t.size/2+n*Math.sin(s))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=ib),i.fillStyle=Za(h),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,i.setLineDash&&t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke()),i.closePath()},i.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.hitDetectionCanvas_=this.canvas_,this.fill_){var i=this.fill_.getColor(),e=0;if("string"==typeof i&&(i=Dh(i)),null===i?e=1:Array.isArray(i)&&(e=4===i.length?i[3]:1),0===e){var r=La(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r,0,0)}}},i.prototype.drawHitDetectionCanvas_=function(t,i,e,r){i.setTransform(1,0,0,1,0,0),i.translate(e,r),i.beginPath();var o=this.points_;if(o===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var s=void 0!==this.radius2_?this.radius2_:this.radius_;s!==this.radius_&&(o*=2);var n=void 0,a=void 0,l=void 0;for(n=0;n<=o;n++)l=2*n*Math.PI/o-Math.PI/2+this.angle_,a=n%2==0?this.radius_:s,i.lineTo(t.size/2+a*Math.cos(l),t.size/2+a*Math.sin(l))}i.fillStyle=ib,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.stroke()),i.closePath()},i}(uj);Gg.default=qj;var ml=Ig&&Ig.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ag=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return ml(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(qj);Ig.default=Ag;var zg=function(){function o(o){var r=o||{};this.color_=void 0!==r.color?r.color:null}return o.prototype.clone=function(){var r=this.getColor();return new o({color:Array.isArray(r)?r.slice():r||void 0})},o.prototype.getColor=function(){return this.color_},o.prototype.setColor=function(o){this.color_=o},o}();var Xd=function(){function t(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width}return t.prototype.clone=function(){var i=this.getColor();return new t({color:Array.isArray(i)?i.slice():i||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}();var Xc=function(){function e(e){var t=e||{};this.geometry_=null,this.geometryFunction_=bj,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}return e.prototype.clone=function(){var t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new e({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.setRenderer=function(e){this.renderer_=e},e.prototype.getGeometry=function(){return this.geometry_},e.prototype.getGeometryFunction=function(){return this.geometryFunction_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(e){this.fill_=e},e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(e){this.image_=e},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(e){this.stroke_=e},e.prototype.getText=function(){return this.text_},e.prototype.setText=function(e){this.text_=e},e.prototype.getZIndex=function(){return this.zIndex_},e.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=bj,this.geometry_=e},e.prototype.setZIndex=function(e){this.zIndex_=e},e}();function rl(e){var t;if("function"==typeof e)t=e;else{var r;if(Array.isArray(e))r=e;else ia("function"==typeof e.getZIndex,41),r=[e];t=function(){return r}}return t}var gj=null;function tl(e,t){if(!gj){var r=new zg({color:"rgba(255,255,255,0.4)"}),o=new Xd({color:"#3399CC",width:1.25});gj=[new Xc({image:new Ag({fill:r,stroke:o,radius:5}),fill:r,stroke:o})]}return gj}function Lc(){var e={},t=[255,255,255,1],r=[0,153,255,1];return e[aa.POLYGON]=[new Xc({fill:new zg({color:[255,255,255,.5]})})],e[aa.MULTI_POLYGON]=e[aa.POLYGON],e[aa.LINE_STRING]=[new Xc({stroke:new Xd({color:t,width:5})}),new Xc({stroke:new Xd({color:r,width:3})})],e[aa.MULTI_LINE_STRING]=e[aa.LINE_STRING],e[aa.CIRCLE]=e[aa.POLYGON].concat(e[aa.LINE_STRING]),e[aa.POINT]=[new Xc({image:new Ag({radius:6,fill:new zg({color:r}),stroke:new Xd({color:t,width:1.5})}),zIndex:1/0})],e[aa.MULTI_POINT]=e[aa.POINT],e[aa.GEOMETRY_COLLECTION]=e[aa.POLYGON].concat(e[aa.LINE_STRING],e[aa.POINT]),e}function bj(e){return e.getGeometry()}var wl=Jg&&Jg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),aj={RENDER_ORDER:"renderOrder"},Zi=function(t){function e(e){var r=this,n=e||{},i=Da({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return wl(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(aj.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(aj.RENDER_ORDER,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:tl,this.styleFunction_=null===t?void 0:rl(this.style_),this.changed()},e}(Ve);Jg.default=Zi;var pg={};var og={};var da={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},Ld=[da.FILL];var Bb=[da.STROKE];var Fb=[da.BEGIN_PATH];var Hi=[da.CLOSE_PATH];var Gl=og&&og.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vc=function(t){function e(e,i,r,n){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=n,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Gl(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatCoordinates=function(t,e,i,r,n,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=r);var u,$,l,p=t[e],c=t[e+1],h=this.tmpCoordinate_,d=!0;for(u=e+r;u<i;u+=r)h[0]=t[u],h[1]=t[u+1],(l=Fg(a,h))!==$?(d&&(this.coordinates[s++]=p,this.coordinates[s++]=c),this.coordinates[s++]=h[0],this.coordinates[s++]=h[1],d=!1):l===xa.INTERSECTING?(this.coordinates[s++]=h[0],this.coordinates[s++]=h[1],d=!1):d=!0,p=h[0],c=h[1],$=l;return(n&&d||u===e+r)&&(this.coordinates[s++]=p,this.coordinates[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o],u=this.appendFlatCoordinates(t,e,a,r,!1,!1);n.push(u),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var r,n,o,s,a,u=t.getType(),$=t.getStride(),l=this.coordinates.length;if(u==aa.MULTI_POLYGON){r=(t=t).getOrientedFlatCoordinates(),s=[];var p=t.getEndss();a=0;for(var c=0,h=p.length;c<h;++c){var d=[];a=this.drawCustomCoordinates_(r,a,p[c],$,d),s.push(d)}this.instructions.push([da.CUSTOM,l,s,t,i,Bh])}else u==aa.POLYGON||u==aa.MULTI_LINE_STRING?(o=[],r=u==aa.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(r,0,t.getEnds(),$,o),this.instructions.push([da.CUSTOM,l,o,t,i,Bd])):u==aa.LINE_STRING||u==aa.MULTI_POINT?(r=t.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,$,!1,!1),this.instructions.push([da.CUSTOM,l,n,t,i,Nc])):u==aa.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([da.CUSTOM,l,n,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var i=t.getExtent();this.beginGeometryInstruction1_=[da.BEGIN_GEOMETRY,e,0,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[da.BEGIN_GEOMETRY,e,0,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,r,n=e.length,o=-1;for(t=0;t<n;++t)(r=(i=e[t])[0])==da.END_GEOMETRY?o=t:r==da.BEGIN_GEOMETRY&&(i[2]=t,$p(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var r=t.getColor();i.fillStyle=Za(r||ib)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=Za(n||Mc);var o=e.getLineCap();i.lineCap=void 0!==o?o:tc;var s=e.getLineDash();i.lineDash=s?s.slice():ld;var a=e.getLineDashOffset();i.lineDashOffset=a||md;var u=e.getLineJoin();i.lineJoin=void 0!==u?u:qc;var $=e.getWidth();i.lineWidth=void 0!==$?$:Cc;var l=e.getMiterLimit();i.miterLimit=void 0!==l?l:Pc,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=[da.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[da.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,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!xc(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[da.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=qi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Yd(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Nh);og.default=vc;var cg={};var Jl=cg&&cg.__extends||function(){var t=function(i,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])})(i,o)};return function(i,o){function e(){this.constructor=i}t(i,o),i.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),Ei=function(t){function i(i,o,e,h){var s=t.call(this,i,o,e,h)||this;return s.declutterGroups_=null,s.hitDetectionImage_=null,s.image_=null,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s}return Jl(i,t),i.prototype.drawCoordinates_=function(t,i,o,e){return this.appendFlatCoordinates(t,i,o,e,!1,!1)},i.prototype.drawPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var o=t.getFlatCoordinates(),e=t.getStride(),h=this.coordinates.length,s=this.drawCoordinates_(o,0,o.length,e);this.instructions.push([da.DRAW_IMAGE,h,s,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([da.DRAW_IMAGE,h,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(i)}},i.prototype.drawMultiPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var o=t.getFlatCoordinates(),e=t.getStride(),h=this.coordinates.length,s=this.drawCoordinates_(o,0,o.length,e);this.instructions.push([da.DRAW_IMAGE,h,s,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([da.DRAW_IMAGE,h,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(i)}},i.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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)},i.prototype.setImageStyle=function(t,i){var o=t.getAnchor(),e=t.getSize(),h=t.getHitDetectionImage(1),s=t.getImage(1),r=t.getOrigin();this.anchorX_=o[0],this.anchorY_=o[1],this.declutterGroups_=i,this.hitDetectionImage_=h,this.image_=s,this.height_=e[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=e[0]},i}(vc);cg.default=Ei;var bg={};var Ml=bg&&bg.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function s(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}}(),Ci=function(t){function i(i,e,s,n){return t.call(this,i,e,s,n)||this}return Ml(i,t),i.prototype.drawFlatCoordinates_=function(t,i,e,s){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,i,e,s,!1,!1),r=[da.MOVE_TO_LINE_TO,n,o];return this.instructions.push(r),this.hitDetectionInstructions.push(r),e},i.prototype.drawLineString=function(t,i){var e=this.state,s=e.strokeStyle,n=e.lineWidth;if(void 0!==s&&void 0!==n){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([da.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],Fb);var o=t.getFlatCoordinates(),r=t.getStride();this.drawFlatCoordinates_(o,0,o.length,r),this.hitDetectionInstructions.push(Bb),this.endGeometry(i)}},i.prototype.drawMultiLineString=function(t,i){var e=this.state,s=e.strokeStyle,n=e.lineWidth;if(void 0!==s&&void 0!==n){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([da.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],Fb);for(var o=t.getEnds(),r=t.getFlatCoordinates(),p=t.getStride(),a=0,h=0,u=o.length;h<u;++h)a=this.drawFlatCoordinates_(r,a,o[h],p);this.hitDetectionInstructions.push(Bb),this.endGeometry(i)}},i.prototype.finish=function(){var i=this.state;return null!=i.lastStroke&&i.lastStroke!=this.coordinates.length&&this.instructions.push(Bb),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},i.prototype.applyStroke=function(i){null!=i.lastStroke&&i.lastStroke!=this.coordinates.length&&(this.instructions.push(Bb),i.lastStroke=this.coordinates.length),i.lastStroke=0,t.prototype.applyStroke.call(this,i),this.instructions.push(Fb)},i}(vc);bg.default=Ci;var ag={};var Pl=ag&&ag.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function s(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}}(),_f=function(t){function i(i,e,s,o){return t.call(this,i,e,s,o)||this}return Pl(i,t),i.prototype.drawFlatCoordinatess_=function(t,i,e,s){var o=this.state,n=void 0!==o.fillStyle,r=void 0!==o.strokeStyle,l=e.length;this.instructions.push(Fb),this.hitDetectionInstructions.push(Fb);for(var h=0;h<l;++h){var a=e[h],$=this.coordinates.length,u=this.appendFlatCoordinates(t,i,a,s,!0,!r),c=[da.MOVE_TO_LINE_TO,$,u];this.instructions.push(c),this.hitDetectionInstructions.push(c),r&&(this.instructions.push(Hi),this.hitDetectionInstructions.push(Hi)),i=a}return n&&(this.instructions.push(Ld),this.hitDetectionInstructions.push(Ld)),r&&(this.instructions.push(Bb),this.hitDetectionInstructions.push(Bb)),i},i.prototype.drawCircle=function(t,i){var e=this.state,s=e.fillStyle,o=e.strokeStyle;if(void 0!==s||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,i),void 0!==e.fillStyle&&this.hitDetectionInstructions.push([da.SET_FILL_STYLE,ib]),void 0!==e.strokeStyle&&this.hitDetectionInstructions.push([da.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset]);var n=t.getFlatCoordinates(),r=t.getStride(),l=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,r,!1,!1);var h=[da.CIRCLE,l];this.instructions.push(Fb,h),this.hitDetectionInstructions.push(Fb,h),void 0!==e.fillStyle&&(this.instructions.push(Ld),this.hitDetectionInstructions.push(Ld)),void 0!==e.strokeStyle&&(this.instructions.push(Bb),this.hitDetectionInstructions.push(Bb)),this.endGeometry(i)}},i.prototype.drawPolygon=function(t,i){var e=this.state,s=e.fillStyle,o=e.strokeStyle;if(void 0!==s||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,i),void 0!==e.fillStyle&&this.hitDetectionInstructions.push([da.SET_FILL_STYLE,ib]),void 0!==e.strokeStyle&&this.hitDetectionInstructions.push([da.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset]);var n=t.getEnds(),r=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(r,0,n,l),this.endGeometry(i)}},i.prototype.drawMultiPolygon=function(t,i){var e=this.state,s=e.fillStyle,o=e.strokeStyle;if(void 0!==s||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,i),void 0!==e.fillStyle&&this.hitDetectionInstructions.push([da.SET_FILL_STYLE,ib]),void 0!==e.strokeStyle&&this.hitDetectionInstructions.push([da.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset]);for(var n=t.getEndss(),r=t.getOrientedFlatCoordinates(),l=t.getStride(),h=0,a=0,$=n.length;a<$;++a)h=this.drawFlatCoordinatess_(r,h,n[a],l);this.endGeometry(i)}},i.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var i=this.tolerance;if(0!==i)for(var e=this.coordinates,s=0,o=e.length;s<o;++s)e[s]=Vb(e[s],i);return t.prototype.finish.call(this)},i.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)},i}(vc);ag.default=_f;var Hd={};function Sl(h,t,r,$,a){var n,o,C,i,c,e,u,v,p,s=r,x=r,g=0,k=0,m=r;for(n=r;n<$;n+=a){var d=t[n],f=t[n+1];void 0!==i&&(v=d-i,p=f-c,C=Math.sqrt(v*v+p*p),void 0!==e&&(k+=o,Math.acos((e*v+u*p)/(o*C))>h&&(k>g&&(g=k,s=m,x=n),k=0,m=n-a)),o=C,e=v,u=p),i=d,c=f}return(k+=C)>g?[m,n]:[s,x]}var Tl={POINT:"point",LINE:"line"};var Ul=Hd&&Hd.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uc={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};Hd.TEXT_ALIGN=uc;var ui=function(t){function e(e,i,r,s){var o=t.call(this,e,i,r,s)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return Ul(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_,r=this.textStrokeState_,s=this.textState_;if(""!==this.text_&&s&&(i||r)){var o,l,a=this.coordinates.length,n=t.getType(),$=null,h=2,p=2;if(s.placement===Tl.LINE){if(!Ga(this.getBufferedMaxExtent(),t.getExtent()))return;var u=void 0;if($=t.getFlatCoordinates(),p=t.getStride(),n==aa.LINE_STRING)u=[$.length];else if(n==aa.MULTI_LINE_STRING)u=t.getEnds();else if(n==aa.POLYGON)u=t.getEnds().slice(0,1);else if(n==aa.MULTI_POLYGON){var f=t.getEndss();for(u=[],o=0,l=f.length;o<l;++o)u.push(f[o][0])}this.beginGeometry(t,e);for(var d=s.textAlign,c=0,_=void 0,x=0,g=u.length;x<g;++x){if(null==d){var S=Sl(s.maxAngle,$,c,u[x],p);c=S[0],_=S[1]}else _=u[x];for(o=c;o<_;o+=p)this.coordinates.push($[o],$[o+1]);h=this.coordinates.length,c=u[x];var y=this.declutterGroups_?0===x?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(a,h,y),a=h}this.endGeometry(e)}else{var m=null;switch(s.overflow||(m=[]),n){case aa.POINT:case aa.MULTI_POINT:h=($=t.getFlatCoordinates()).length;break;case aa.LINE_STRING:$=t.getFlatMidpoint();break;case aa.CIRCLE:$=t.getCenter();break;case aa.MULTI_LINE_STRING:h=($=t.getFlatMidpoints()).length;break;case aa.POLYGON:$=t.getFlatInteriorPoint(),s.overflow||m.push($[2]/this.resolution),p=3;break;case aa.MULTI_POLYGON:var D=t.getFlatInteriorPoints();for($=[],o=0,l=D.length;o<l;o+=3)s.overflow||m.push(D[o+2]/this.resolution),$.push(D[o],D[o+1]);if(0==(h=$.length))return;}h=this.appendFlatCoordinates($,0,h,p,!1,!1),this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var w=this.pixelRatio;this.instructions.push([da.DRAW_IMAGE,a,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1,NaN,s.padding==fc?fc:s.padding.map(function(t){return t*w}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,m]),this.hitDetectionInstructions.push([da.DRAW_IMAGE,a,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1/this.pixelRatio,NaN,s.padding,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,m]),this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Hc,textBaseline:e.textBaseline||rd,scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e,i){var r=this.textStrokeState_,s=this.textState_,o=this.strokeKey_,l=this.textKey_,a=this.fillKey_;this.saveTextStates_();var n=this.pixelRatio,$=uc[s.textBaseline],h=this.textOffsetY_*n,p=this.text_,u=s.scale,f=r?r.lineWidth*u/2:0;this.instructions.push([da.DRAW_CHARS,t,e,$,i,s.overflow,a,s.maxAngle,n,h,o,f*n,p,l,1]),this.hitDetectionInstructions.push([da.DRAW_CHARS,t,e,$,i,s.overflow,a,s.maxAngle,1,h,o,f,p,l,1/n])},e.prototype.setTextStyle=function(t,e){var i,r,s;if(t){this.declutterGroups_=e;var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=Za(o.getColor()||ib)):(r=null,this.textFillState_=r);var l=t.getStroke();if(l){(s=this.textStrokeState_)||(s={},this.textStrokeState_=s);var a=l.getLineDash(),n=l.getLineDashOffset(),$=l.getWidth(),h=l.getMiterLimit();s.lineCap=l.getLineCap()||tc,s.lineDash=a?a.slice():ld,s.lineDashOffset=void 0===n?md:n,s.lineJoin=l.getLineJoin()||qc,s.lineWidth=void 0===$?Cc:$,s.miterLimit=void 0===h?Pc:h,s.strokeStyle=Za(l.getColor()||Mc)}else s=null,this.textStrokeState_=s;i=this.textState_;var p=t.getFont()||Oh;em(p);var u=t.getScale();i.overflow=t.getOverflow(),i.font=p,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||rd,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||fc,i.scale=void 0===u?1:u;var f=t.getOffsetX(),d=t.getOffsetY(),c=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==c&&c,this.textRotation_=void 0===_?0:_,this.strokeKey_=s?("string"==typeof s.strokeStyle?s.strokeStyle:ga(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+ga(r.fillStyle):""}else this.text_=""},e}(vc);Hd.default=ui;var Xl={Circle:_f,Default:vc,Image:Ei,LineString:Ci,Polygon:_f,Text:ui},Yl=function(){function e(e,r,t,i,d){this.declutter_=d,this.declutterGroups_=null,this.tolerance_=e,this.maxExtent_=r,this.pixelRatio_=i,this.resolution_=t,this.buildersByZIndex_={}}return e.prototype.addDeclutter=function(e){var r=null;return this.declutter_&&(e?(r=this.declutterGroups_)[0][4]++:(r=[Fa()],this.declutterGroups_=r,r[0].push(1))),r},e.prototype.finish=function(){var e={};for(var r in this.buildersByZIndex_){e[r]=e[r]||{};var t=this.buildersByZIndex_[r];for(var i in t){var d=t[i].finish();e[r][i]=d}}return e},e.prototype.getBuilder=function(e,r){var t=void 0!==e?e.toString():"0",i=this.buildersByZIndex_[t];void 0===i&&(i={},this.buildersByZIndex_[t]=i);var d=i[r];void 0===d&&(d=new(0,Xl[r])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[r]=d);return d},e}();function Zl(t,a,r,h,$,e,o,x,M,p,n){for(var P,i,v=[],w=t[a]>t[r-h],J=$.length,N=t[a],l=t[a+1],s=t[a+=h],I=t[a+1],f=0,u=Math.sqrt(Math.pow(s-N,2)+Math.pow(I-l,2)),d=!1,m=0;m<J;++m){for(var q=$[P=w?J-m-1:m],O=x*M(p,q,n),T=e+O/2;a<r-h&&f+u<T;)N=s,l=I,s=t[a+=h],I=t[a+1],f+=u,u=Math.sqrt(Math.pow(s-N,2)+Math.pow(I-l,2));var c=T-f,b=Math.atan2(I-l,s-N);if(w&&(b+=b>0?-Math.PI:Math.PI),void 0!==i){var g=b-i;if(d=d||0!==g,g+=g>Math.PI?-2*Math.PI:g<-Math.PI?2*Math.PI:0,Math.abs(g)>o)return null}i=b;var j=c/u,k=oc(N,s,j),y=oc(l,I,j);v[P]=[k,y,O/2,b,q],e+=O}return d?v:[[v[0][0],v[0][1],v[0][2],v[0][3],$]]}var Yf,Dd={},d=arguments[0];!function(t,i){"object"==typeof Dd?Dd=i():"function"==typeof Yf&&Yf.amd?Yf(i):(t=t||self).RBush=i()}(Dd,function(){function t(t,r,e,a,o){!function t(n,r,e,a,o){for(;a>e;){if(a-e>600){var h=a-e+1,s=r-e+1,l=Math.log(h),f=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*f*(h-f)/h)*(s-h/2<0?-1:1),u=Math.max(e,Math.floor(r-s*f/h+p)),m=Math.min(a,Math.floor(r+(h-s)*f/h+p));t(n,r,u,m,o)}var c=n[r],d=e,x=a;for(i(n,e,r),o(n[a],c)>0&&i(n,e,a);d<x;){for(i(n,d,x),d++,x--;o(n[d],c)<0;)d++;for(;o(n[x],c)>0;)x--}0===o(n[e],c)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,o||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return t<i?-1:t>i?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r<i.length;r++)if(n(t,i[r]))return r;return-1}function a(t,i){o(t,0,t.children.length,i,t)}function o(t,i,n,r,e){e||(e=c(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var a=i;a<n;a++){var o=t.children[a];h(e,t.leaf?r(o):o)}return e}function h(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function l(t,i){return t.minY-i.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function m(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function c(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=e)){var h=n+Math.ceil((r-n)/e/2)*e;t(i,h,n,r,a),o.push(n,h,h,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!m(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a<i.children.length;a++){var o=i.children[a],h=i.leaf?r(o):o;m(t,h)&&(i.leaf?n.push(o):u(t,h)?this._all(o,n):e.push(o))}i=e.pop()}return n},r.prototype.collides=function(t){var i=this.data;if(!m(t,i))return!1;for(var n=[];i;){for(var r=0;r<i.children.length;r++){var e=i.children[r],a=i.leaf?this.toBBox(e):e;if(m(t,a)){if(i.leaf||u(t,a))return!0;n.push(e)}}i=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0;i<t.length;i++)this.insert(t[i]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length){if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=c([]),this},r.prototype.remove=function(t,i){if(!t)return this;for(var n,r,a,o=this.data,h=this.toBBox(t),s=[],l=[];o||s.length;){if(o||(o=s.pop(),r=s[s.length-1],n=l.pop(),a=!0),o.leaf){var f=e(t,o.children,i);if(-1!==f)return o.children.splice(f,1),s.push(o),this._condense(s),this}a||o.leaf||!u(o,h)?r?(n++,o=r.children[n],a=!1):o=null:(s.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,i){return t.minX-i.minX},r.prototype.compareMinY=function(t,i){return t.minY-i.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,i){for(var n=[];t;)t.leaf?i.push.apply(i,t.children):n.push.apply(n,t.children),t=n.pop();return i},r.prototype._build=function(t,i,n,r){var e,o=n-i+1,h=this._maxEntries;if(o<=h)return a(e=c(t.slice(i,n+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(o)/Math.log(h)),h=Math.ceil(o/Math.pow(h,r-1))),(e=c([])).leaf=!1,e.height=r;var s=Math.ceil(o/h),l=s*Math.ceil(Math.sqrt(h));d(t,i,n,l,this.compareMinX);for(var f=i;f<=n;f+=l){var p=Math.min(f+l-1,n);d(t,f,p,s,this.compareMinY);for(var u=f;u<=p;u+=s){var m=Math.min(u+s-1,p);e.children.push(this._build(t,u,m,r-1))}}return a(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,i,n,r){for(;r.push(i),!i.leaf&&r.length-1!==n;){for(var e=1/0,a=1/0,o=void 0,h=0;h<i.children.length;h++){var s=i.children[h],l=f(s),p=(u=t,m=s,(Math.max(m.maxX,u.maxX)-Math.min(m.minX,u.minX))*(Math.max(m.maxY,u.maxY)-Math.min(m.minY,u.minY))-l);p<a?(a=p,e=l<e?l:e,o=s):p===a&&l<e&&(e=l,o=s)}i=o||i.children[0]}var u,m;return i},r.prototype._insert=function(t,i,n){var r=n?t:this.toBBox(t),e=[],a=this._chooseSubtree(r,this.data,i,e);for(a.children.push(t),h(a,r);i>=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var o=this._chooseSplitIndex(n,e,r),h=c(n.children.splice(o,n.children.length-o));h.height=n.height,h.leaf=n.leaf,a(n,this.toBBox),a(h,this.toBBox),i?t[i-1].children.push(h):this._splitRoot(n,h)},r.prototype._splitRoot=function(t,i){this.data=c([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,h,s,l,p,u=1/0,m=1/0,c=i;c<=n-i;c++){var d=o(t,0,c,this.toBBox),x=o(t,c,n,this.toBBox),v=(e=d,a=x,h=void 0,s=void 0,l=void 0,p=void 0,h=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),p=Math.min(e.maxY,a.maxY),Math.max(0,l-h)*Math.max(0,p-s)),M=f(d)+f(x);v<u?(u=v,r=c,m=M<m?M:m):v===u&&M<m&&(m=M,r=c)}return r||n-i},r.prototype._chooseSplitAxis=function(t,i,n){var r=t.leaf?this.compareMinX:s,e=t.leaf?this.compareMinY:l;this._allDistMargin(t,i,n,r)<this._allDistMargin(t,i,n,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,i,n,r){t.children.sort(r);for(var e=this.toBBox,a=o(t,0,i,e),s=o(t,n-i,n,e),l=p(a)+p(s),f=i;f<n-i;f++){var u=t.children[f];h(a,t.leaf?e(u):u),l+=p(a)}for(var m=n-i-1;m>=i;m--){var c=t.children[m];h(s,t.leaf?e(c):c),l+=p(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)h(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});var Ub=Fa(),Oc=Ta(),pb=[],Ua=[],cb=[],qb=[],hm=function(){function t(t,e,r,i){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Ta(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,i){var a=t+e+r+i;if(this.labels_[a])return this.labels_[a];var $=i?this.strokeStates[i]:null,p=r?this.fillStates[r]:null,s=this.textStates[e],o=this.pixelRatio,n=s.scale*o,l=uc[s.textAlign||Hc],h=i&&$.lineWidth?$.lineWidth:0,E=t.split("\n"),v=E.length,m=[],u=cm(s.font,E,m),c=dm(s.font),K=c*v,Z=u+h,f=[],d={width:Math.ceil((Z+2)*n),height:Math.ceil((K+h)*n),contextInstructions:f};(1!=n&&f.push("scale",[n,n]),f.push("font",s.font),i)&&(f.push("strokeStyle",$.strokeStyle),f.push("lineWidth",h),f.push("lineCap",$.lineCap),f.push("lineJoin",$.lineJoin),f.push("miterLimit",$.miterLimit),(qe?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(f.push("setLineDash",[$.lineDash]),f.push("lineDashOffset",$.lineDashOffset)));r&&f.push("fillStyle",p.fillStyle),f.push("textBaseline","middle"),f.push("textAlign","center");var _,x=.5-l,g=l*Z+x*h;if(i)for(_=0;_<v;++_)f.push("strokeText",[E[_],g+x*m[_],.5*(h+c)+_*c]);if(r)for(_=0;_<v;++_)f.push("fillText",[E[_],g+x*m[_],.5*(h+c)+_*c]);return this.labels_[a]=d,d},t.prototype.replayTextBackground_=function(t,e,r,i,a,$,p){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,a),t.lineTo.apply(t,e),$&&(this.alignFill_=$[2],this.fill_(t)),p&&(this.setStrokeStyle_(t,p),t.stroke())},t.prototype.replayImageOrLabel_=function(t,e,r,i,a,$,p,s,o,n,l,h,E,v,m,u,c,K){var Z=c||K;e-=a*=E,r-=$*=E;var f=m+n>i.width?i.width-n:m,d=s+l>i.height?i.height-l:s,_=u[3]+f*E+u[1],x=u[0]+d*E+u[2],g=e-u[3],T=r-u[0];(Z||0!==h)&&(pb[0]=g,qb[0]=g,pb[1]=T,Ua[1]=T,Ua[0]=g+_,cb[0]=Ua[0],cb[1]=T+x,qb[1]=cb[1]);var y=null;if(0!==h){var I=e+a,b=r+$;y=mb(Oc,I,b,1,1,h,-I,-b),pa(Oc,pb),pa(Oc,Ua),pa(Oc,cb),pa(Oc,qb),Sa(Math.min(pb[0],Ua[0],cb[0],qb[0]),Math.min(pb[1],Ua[1],cb[1],qb[1]),Math.max(pb[0],Ua[0],cb[0],qb[0]),Math.max(pb[1],Ua[1],cb[1],qb[1]),Ub)}else Sa(g,T,g+_,T+x,Ub);var S=t.canvas,C=K?K[2]*E/2:0,k=Ub[0]-C<=S.width&&Ub[2]+C>=0&&Ub[1]-C<=S.height&&Ub[3]+C>=0;if(v&&(e=Math.round(e),r=Math.round(r)),p){if(!k&&1==p[4])return;Fe(p,Ub);var L=k?[t,y?y.slice(0):null,o,i,n,l,f,d,e,r,E]:null;L&&(Z&&L.push(c,K,pb.slice(0),Ua.slice(0),cb.slice(0),qb.slice(0)),p.push(L))}else k&&(Z&&this.replayTextBackground_(t,pb,Ua,cb,qb,c,K),ki(t,y,o,i,n,l,f,d,e,r,E))},t.prototype.fill_=function(t){if(this.alignFill_){var e=pa(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,r,i){if(t&&t.length>5){var a=t[4];if(1==a||a==t.length-5){var $={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};var $C6Up$$interop$default=uh(Dd);if(i||(i=new $C6Up$$interop$default.d(9)),!i.collides($)){i.insert($);for(var p=5,s=t.length;p<s;++p){var o=t[p],n=o[0],l=n.globalAlpha;l!==r&&(n.globalAlpha=r),o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),ki.apply(void 0,o),l!==r&&(n.globalAlpha=l)}}t.length=5,ec(t)}}return i},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,i){var a=this.textStates[e],$=this.createLabel(t,e,i,r),p=this.strokeStates[r],s=this.pixelRatio,o=uc[a.textAlign||Hc],n=uc[a.textBaseline||rd],l=p&&p.lineWidth?p.lineWidth:0;return{label:$,anchorX:o*($.width/s-2*a.scale)+2*(.5-o)*l,anchorY:n*$.height/s+2*(.5-n)*l}},t.prototype.execute_=function(t,e,r,i,a,$){var p;this.declutterItems.length=0,this.pixelCoordinates_&&xc(e,this.renderedTransform_)?p=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),p=Lb(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Zn(this.renderedTransform_,e));for(var s,o,n,l,h,E,v,m,u,c,K,Z,f,d,_,x,g,T=0,y=r.length,I=0,b=0,S=0,C=null,k=null,L=this.coordinateCache_,R=this.viewRotation_,O=Math.round(1e12*Math.atan2(-e[1],e[0]))/1e12,w={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:R},A=this.instructions!=r||this.overlaps?0:200;T<y;){var D=r[T];switch(D[0]){case da.BEGIN_GEOMETRY:(_=D[1]).getGeometry()?void 0===$||Ga($,D[3])?++T:T=D[2]+1:T=D[2];break;case da.BEGIN_PATH:b>A&&(this.fill_(t),b=0),S>A&&(t.stroke(),S=0),b||S||(t.beginPath(),l=NaN,h=NaN),++T;break;case da.CIRCLE:var M=p[I=D[1]],q=p[I+1],N=p[I+2]-M,P=p[I+3]-q,W=Math.sqrt(N*N+P*P);t.moveTo(M+W,q),t.arc(M,q,W,0,2*Math.PI,!0),++T;break;case da.CLOSE_PATH:t.closePath(),++T;break;case da.CUSTOM:I=D[1],s=D[2];var j=D[3],B=D[4],F=6==D.length?D[5]:void 0;w.geometry=j,w.feature=_,T in L||(L[T]=[]);var G=L[T];F?F(p,I,s,2,G):(G[0]=p[I],G[1]=p[I+1],G.length=2),B(G,w),++T;break;case da.DRAW_IMAGE:I=D[1],s=D[2],c=D[3],o=D[4],n=D[5],u=a?null:D[6];var X=D[7],Y=D[8],H=D[9],U=D[10],J=D[11],V=D[12],z=D[13],Q=D[14];if(!c&&D.length>=19){K=D[18],Z=D[19],f=D[20],d=D[21];var tt=this.drawLabelWithPointPlacement_(K,Z,f,d);c=tt.label,D[3]=c;var et=D[22];o=(tt.anchorX-et)*this.pixelRatio,D[4]=o;var rt=D[23];n=(tt.anchorY-rt)*this.pixelRatio,D[5]=n,X=c.height,D[7]=X,Q=c.width,D[14]=Q}var it=void 0;D.length>24&&(it=D[24]);var at=void 0,$t=void 0,pt=void 0;D.length>16?(at=D[15],$t=D[16],pt=D[17]):(at=fc,$t=!1,pt=!1),J&&O?V+=R:J||O||(V-=R);for(var st=0,ot=0;I<s;I+=2)if(!(it&&it[st++]<Q/this.pixelRatio)){if(u){var nt=Math.floor(ot);u.length<nt+1&&((m=Fa()).push(u[0][4]),u.push(m)),m=u[nt]}this.replayImageOrLabel_(t,p[I],p[I+1],c,o,n,m,X,Y,H,U,V,z,i,Q,at,$t?C:null,pt?k:null),m&&(ot===Math.floor(ot)&&this.declutterItems.push(this,m,_),ot+=1/m[4])}++T;break;case da.DRAW_CHARS:var lt=D[1],ht=D[2],Et=D[3];m=a?null:D[4];var vt=D[5];d=D[6];var mt=D[7],ut=D[8],ct=D[9];f=D[10];var Kt=D[11];K=D[12],Z=D[13];var Zt=D[14],ft=this.textStates[Z],dt=ft.font,_t=ft.scale*ut,xt=void 0;dt in this.widths_?xt=this.widths_[dt]:(xt={},this.widths_[dt]=xt);var gt=hk(p,lt,ht,2),Tt=_t*hi(dt,K,xt);if(vt||Tt<=gt){var yt=this.textStates[Z].textAlign,It=(gt-Tt)*uc[yt],bt=Zl(p,lt,ht,2,K,It,mt,_t,hi,dt,xt);if(bt){var St=void 0,Ct=void 0,kt=void 0,Lt=void 0,Rt=void 0;if(f)for(St=0,Ct=bt.length;St<Ct;++St)kt=(Rt=bt[St])[4],Lt=this.createLabel(kt,Z,"",f),o=Rt[2]+Kt,n=Et*Lt.height+2*(.5-Et)*Kt-ct,this.replayImageOrLabel_(t,Rt[0],Rt[1],Lt,o,n,m,Lt.height,1,0,0,Rt[3],Zt,!1,Lt.width,fc,null,null);if(d)for(St=0,Ct=bt.length;St<Ct;++St)kt=(Rt=bt[St])[4],Lt=this.createLabel(kt,Z,d,""),o=Rt[2],n=Et*Lt.height-ct,this.replayImageOrLabel_(t,Rt[0],Rt[1],Lt,o,n,m,Lt.height,1,0,0,Rt[3],Zt,!1,Lt.width,fc,null,null)}}this.declutterItems.push(this,m,_),++T;break;case da.END_GEOMETRY:if(void 0!==a){var Ot=a(_=D[1]);if(Ot)return Ot}++T;break;case da.FILL:A?b++:this.fill_(t),++T;break;case da.MOVE_TO_LINE_TO:for(I=D[1],s=D[2],x=p[I],v=(g=p[I+1])+.5|0,(E=x+.5|0)===l&&v===h||(t.moveTo(x,g),l=E,h=v),I+=2;I<s;I+=2)E=(x=p[I])+.5|0,v=(g=p[I+1])+.5|0,I!=s-2&&E===l&&v===h||(t.lineTo(x,g),l=E,h=v);++T;break;case da.SET_FILL_STYLE:C=D,this.alignFill_=D[2],b&&(this.fill_(t),b=0,S&&(t.stroke(),S=0)),t.fillStyle=D[1],++T;break;case da.SET_STROKE_STYLE:k=D,S&&(t.stroke(),S=0),this.setStrokeStyle_(t,D),++T;break;case da.STROKE:A?S++:t.stroke(),++T;break;default:++T;}}b&&this.fill_(t),S&&t.stroke()},t.prototype.execute=function(t,e,r,i){this.viewRotation_=r,this.execute_(t,e,this.instructions,i,void 0,void 0)},t.prototype.executeHitDetection=function(t,e,r,i,a){return this.viewRotation_=r,this.execute_(t,e,this.hitDetectionInstructions,!0,i,a)},t}();var vf=[na.POLYGON,na.CIRCLE,na.LINE_STRING,na.IMAGE,na.TEXT,na.DEFAULT],jm=function(){function r(r,e,t,i,o,n){this.maxExtent_=r,this.overlaps_=i,this.pixelRatio_=t,this.resolution_=e,this.renderBuffer_=n,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ta(),this.createExecutors_(o)}return r.prototype.clip=function(r,e){var t=this.getClipCoords(e);r.beginPath(),r.moveTo(t[0],t[1]),r.lineTo(t[2],t[3]),r.lineTo(t[4],t[5]),r.lineTo(t[6],t[7]),r.clip()},r.prototype.createExecutors_=function(r){for(var e in r){var t=this.executorsByZIndex_[e];void 0===t&&(t={},this.executorsByZIndex_[e]=t);var i=r[e];for(var o in i){var n=i[o];t[o]=new hm(this.resolution_,this.pixelRatio_,this.overlaps_,n)}}},r.prototype.hasExecutors=function(r){for(var e in this.executorsByZIndex_)for(var t=this.executorsByZIndex_[e],i=0,o=r.length;i<o;++i)if(r[i]in t)return!0;return!1},r.prototype.forEachFeatureAtCoordinate=function(r,e,t,i,o,n){var $=2*(i=Math.round(i))+1,c=mb(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-t,-r[0],-r[1]);this.hitDetectionContext_||(this.hitDetectionContext_=La($,$));var a,l=this.hitDetectionContext_;l.canvas.width!==$||l.canvas.height!==$?(l.canvas.width=$,l.canvas.height=$):l.clearRect(0,0,$,$),void 0!==this.renderBuffer_&&(a=Fa(),nc(a,r),Yd(a,e*(this.renderBuffer_+i),a));var s,p=mm(i);function u(r){for(var e=l.getImageData(0,0,$,$).data,t=0;t<$;t++)for(var i=0;i<$;i++)if(p[t][i]&&e[4*(i*$+t)+3]>0){var c=void 0;return(!n||s!=na.IMAGE&&s!=na.TEXT||-1!==n.indexOf(r))&&(c=o(r)),c||void l.clearRect(0,0,$,$)}}var E,g,f,v,d,h=Object.keys(this.executorsByZIndex_).map(Number);for(h.sort(tb),E=h.length-1;E>=0;--E){var x=h[E].toString();for(f=this.executorsByZIndex_[x],g=vf.length-1;g>=0;--g)if(void 0!==(v=f[s=vf[g]])&&(d=v.executeHitDetection(l,c,t,u,a)))return d}},r.prototype.getClipCoords=function(r){var e=this.maxExtent_;if(!e)return null;var t=e[0],i=e[1],o=e[2],n=e[3],$=[t,i,t,n,o,n,o,i];return Lb($,0,8,2,r,$),$},r.prototype.isEmpty=function(){return Sc(this.executorsByZIndex_)},r.prototype.execute=function(r,e,t,i,o,n){var $=Object.keys(this.executorsByZIndex_).map(Number);$.sort(tb),this.maxExtent_&&(r.save(),this.clip(r,e));var c,a,l,s,p,u,E=o||vf;for(c=0,a=$.length;c<a;++c){var g=$[c].toString();for(p=this.executorsByZIndex_[g],l=0,s=E.length;l<s;++l){var f=E[l];if(void 0!==(u=p[f]))if(!n||f!=na.IMAGE&&f!=na.TEXT)u.execute(r,e,t,i);else{var v=n[g];v?v.push(u,e.slice(0)):n[g]=[u,e.slice(0)]}}}this.maxExtent_&&r.restore()},r}(),tf={0:[[!0]]};function wb(r,e,t){var i,o=Math.floor(r.length/2);if(e>=o)for(i=o;i<e;i++)r[i][t]=!0;else if(e<o)for(i=e+1;i<o;i++)r[i][t]=!0}function mm(r){if(void 0!==tf[r])return tf[r];for(var e=2*r+1,t=new Array(e),i=0;i<e;i++)t[i]=new Array(e);for(var o=r,n=0,$=0;o>=n;)wb(t,r+o,r+n),wb(t,r+n,r+o),wb(t,r-n,r+o),wb(t,r-o,r+n),wb(t,r-o,r-n),wb(t,r-n,r-o),wb(t,r+n,r-o),wb(t,r+o,r-n),2*(($+=1+2*++n)-o)+1>0&&($+=1-2*(o-=1));return tf[r]=t,t}function nm(r,e,t,i,o,n){for(var $=Object.keys(r).map(Number).sort(tb),c=0,a=$.length;c<a;++c)for(var l=r[$[c].toString()],s=void 0,p=0,u=l.length;p<u;){var E=l[p++];E!==s&&(s=E,n.push({items:E.declutterItems,opacity:i}));var g=l[p++];E.execute(e,g,t,o)}}var rf={};var qf={};var qm=qf&&qf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Ah=function(t){function e(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r}return qm(e,t),e.prototype.getFeatures=function(t){return ca()},e.prototype.prepareFrame=function(t){return ca()},e.prototype.renderFrame=function(t,e){return ca()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(o,a){var n=this.loadedTileCallback.bind(this,r,o);return t.forEachLoadedTile(e,o,a,n)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,o,a){},e.prototype.getDataAtPixel=function(t,e,r){return ca()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===oa.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=oa.LOADED&&e!=oa.ERROR&&t.addEventListener(ba.CHANGE,this.boundHandleImageChange_),e==oa.IDLE&&(t.load(),e=t.getState()),e==oa.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Wb.READY&&t.changed()},e}(Oe);qf.default=Ah;var sm=rf&&rf.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),pf=function(t){function r(r){var e=t.call(this,r)||this;return e.container=null,e.renderedResolution,e.tempTransform_=Ta(),e.pixelTransform=Ta(),e.inversePixelTransform=Ta(),e.context=null,e.containerReused=!1,e}return sm(r,t),r.prototype.useContainer=function(t,r,e){var o,n,a=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===a&&($=t.firstElementChild)instanceof HTMLCanvasElement&&(n=$.getContext("2d"));if(n&&n.canvas.style.transform===r?(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=a;var i=o.style;i.position="absolute",i.width="100%",i.height="100%";var $=(n=La()).canvas;o.appendChild($),(i=$.style).position="absolute",i.left="0",i.transformOrigin="top left",this.container=o,this.context=n}},r.prototype.clip=function(t,r,e){var o=r.pixelRatio,n=r.size[0]*o/2,a=r.size[1]*o/2,i=r.viewState.rotation,$=Ya(e),p=Ob(e),s=Sb(e),f=vb(e);pa(r.coordinateToPixelTransform,$),pa(r.coordinateToPixelTransform,p),pa(r.coordinateToPixelTransform,s),pa(r.coordinateToPixelTransform,f),t.save(),ji(t,-i,n,a),t.beginPath(),t.moveTo($[0]*o,$[1]*o),t.lineTo(p[0]*o,p[1]*o),t.lineTo(s[0]*o,s[1]*o),t.lineTo(f[0]*o,f[1]*o),t.clip(),ji(t,i,n,a)},r.prototype.clipUnrotated=function(t,r,e){var o=Ya(e),n=Ob(e),a=Sb(e),i=vb(e);pa(r.coordinateToPixelTransform,o),pa(r.coordinateToPixelTransform,n),pa(r.coordinateToPixelTransform,a),pa(r.coordinateToPixelTransform,i);var $=this.inversePixelTransform;pa($,o),pa($,n),pa($,a),pa($,i),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(a[0]),Math.round(a[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.clip()},r.prototype.dispatchRenderEvent_=function(t,r,e){var o=this.getLayer();if(o.hasListener(t)){var n=new mf(t,this.inversePixelTransform,e,r);o.dispatchEvent(n)}},r.prototype.preRender=function(t,r){this.dispatchRenderEvent_(Xb.PRERENDER,t,r)},r.prototype.postRender=function(t,r){this.dispatchRenderEvent_(Xb.POSTRENDER,t,r)},r.prototype.getRenderTransform=function(t,r,e,o,n,a,i){var $=n/2,p=a/2,s=o/r,f=-s,v=-t[0]+i,m=-t[1];return mb(this.tempTransform_,$,p,s,f,-e,v,m)},r.prototype.getDataAtPixel=function(t,r,e){var o,n=pa(this.inversePixelTransform,t.slice()),a=this.context;try{o=a.getImageData(Math.round(n[0]),Math.round(n[1]),1,1).data}catch(i){return"SecurityError"===i.name?new Uint8Array:o}return 0===o[3]?null:o},r}(Ah);rf.default=pf;function um(e,t,r,a,o,i,n){var $=e[0]/2,c=e[1]/2,m=La($,c);m.imageSmoothingEnabled=!1;for(var g=m.canvas,p=new pi(m,.5,o,null,n),s=r.length,h=Math.floor(16777215/s),l={},C=1;C<=s;++C){var v=r[C-1],M=v.getStyleFunction()||a;if(a){var u=M(v,i);if(u){Array.isArray(u)||(u=[u]);for(var d="#"+("000000"+(C*h).toString(16)).slice(-6),y=0,f=u.length;y<f;++y){var I=u[y],x=I.clone(),S=x.getFill();S&&S.setColor(d);var D=x.getStroke();D&&D.setColor(d),x.setText(void 0);var w=I.getImage();if(w){var T=w.getImageSize();if(!T)continue;var G=document.createElement("canvas");G.width=T[0],G.height=T[1];var j=G.getContext("2d",{alpha:!1});j.fillStyle=d;var q=j.canvas;j.fillRect(0,0,q.width,q.height);var E=T?T[0]:q.width,b=T?T[1]:q.height;La(E,b).drawImage(q,0,0),x.setImage(new Pj({img:q,imgSize:T,anchor:w.getAnchor(),anchorXUnits:yb.PIXELS,anchorYUnits:yb.PIXELS,offset:w.getOrigin(),size:w.getSize(),opacity:w.getOpacity(),scale:w.getScale(),rotation:w.getRotation(),rotateWithView:w.getRotateWithView()}))}var A=Number(x.getZIndex());(L=l[A])||(L={},l[A]=L,L[aa.POLYGON]=[],L[aa.CIRCLE]=[],L[aa.LINE_STRING]=[],L[aa.POINT]=[]);var N=x.getGeometryFunction()(v);N&&Ga(o,N.getExtent())&&L[N.getType().replace("Multi","")].push(N,x)}}}}for(var O=Object.keys(l).map(Number).sort(tb),R=(C=0,O.length);C<R;++C){var L=l[O[C]];for(var U in L){var z=L[U];for(y=0,f=z.length;y<f;y+=2){p.setStyle(z[y+1]);for(var F=0,P=t.length;F<P;++F)p.setTransform(t[F]),p.drawGeometry(z[y])}}}return document.body.appendChild(m.canvas),m.getImageData(0,0,g.width,g.height)}function vm(e,t,r){var a=[];if(r){var o=4*(Math.round(e[0]/2)+Math.round(e[1]/2)*r.width),i=r.data[o],n=r.data[o+1],$=r.data[o+2]+256*(n+256*i),c=Math.floor(16777215/t.length);$&&$%c==0&&a.push(t[$/c-1])}return a}var of={};var yb={FRACTION:"fraction",PIXELS:"pixels"};var dd={};var Jd={};var cf={};var Bm=cf&&cf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),pk=function(t){function e(e,r,o,n){var p=t.call(this)||this;return p.extent=e,p.pixelRatio_=o,p.resolution=r,p.state=n,p}return Bm(e,t),e.prototype.changed=function(){this.dispatchEvent(ba.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return ca()},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(){ca()},e}(Nb);cf.default=pk;var Dm=Jd&&Jd.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Em=function(t){function e(e,n,i,r,o,a){var $=t.call(this,e,n,i,oa.IDLE)||this;return $.src_=r,$.image_=new Image,null!==o&&($.image_.crossOrigin=o),$.unlisten_=null,$.state=oa.IDLE,$.imageLoadFunction_=a,$}return Dm(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=oa.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Va(this.extent)/this.image_.height),this.state=oa.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=oa.IDLE&&this.state!=oa.ERROR||(this.state=oa.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=fd(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(pk);function fd(t,e,n){var i=t;if(i.src&&mj){var r=i.decode(),o=!0;return r.then(function(){o&&e()}).catch(function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())}),function(){o=!1}}var a=[Ec(i,ba.LOAD,e),Ec(i,ba.ERROR,n)];return function(){a.forEach(ja)}}Jd.listenImage=fd,Jd.default=Em;var Gm=dd&&dd.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),ek=function(t){function e(e,i,a,n,r,s){var o=t.call(this)||this;return o.hitDetectionImage_=null,o.image_=e||new Image,null!==n&&(o.image_.crossOrigin=n),o.canvas_=s?document.createElement("canvas"):null,o.color_=s,o.unlisten_=null,o.imageState_=r,o.size_=a,o.src_=i,o.tainted_,o}return Gm(e,t),e.prototype.isTainted_=function(t){if(void 0===this.tainted_&&this.imageState_===oa.LOADED){t||(t=La(1,1)).drawImage(this.image_,0,0);try{t.getImageData(0,0,1,1),this.tainted_=!1}catch(e){this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(ba.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=oa.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=oa.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.isTainted_()){var e=this.size_[0],i=this.size_[1],a=La(e,i);a.fillRect(0,0,e,i),this.hitDetectionImage_=a.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_==oa.IDLE){this.imageState_=oa.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=fd(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(){if(this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");if(t.drawImage(this.image_,0,0),this.isTainted_(t)){var e=this.color_;return t.globalCompositeOperation="multiply",t.fillStyle="rgb("+e[0]+","+e[1]+","+e[2]+")",t.fillRect(0,0,this.image_.width,this.image_.height),t.globalCompositeOperation="destination-in",void t.drawImage(this.image_,0,0)}for(var i=t.getImageData(0,0,this.image_.width,this.image_.height),a=i.data,n=this.color_[0]/255,r=this.color_[1]/255,s=this.color_[2]/255,o=0,h=a.length;o<h;o+=4)a[o]*=n,a[o+1]*=r,a[o+2]*=s;t.putImageData(i,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Nb);function _j(t,e,i,a,n,r){var s=hd.get(e,a,r);return s||(s=new ek(t,e,i,a,n,r),hd.set(e,a,r,s)),s}dd.get=_j,dd.default=ek;var Qa={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Km=of&&of.__extends||function(){var i=function(t,o){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}i(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),Pj=function(i){function t(t){var o=this,r=t||{},n=void 0!==r.opacity?r.opacity:1,e=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,c=void 0!==r.rotateWithView&&r.rotateWithView;(o=i.call(this,{opacity:n,rotation:e,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:c})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],o.normalizedAnchor_=null,o.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:Qa.TOP_LEFT,o.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:yb.FRACTION,o.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:yb.FRACTION,o.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var a=void 0!==r.img?r.img:null,h=void 0!==r.imgSize?r.imgSize:null,$=r.src;ia(!(void 0!==$&&a),4),ia(!a||a&&h,5),void 0!==$&&0!==$.length||!a||($=a.src||ga(a)),ia(void 0!==$&&$.length>0,6);var g=void 0!==r.src?oa.IDLE:oa.LOADED;return o.color_=void 0!==r.color?Dh(r.color):null,o.iconImage_=_j(a,$,h,o.crossOrigin_,g,o.color_),o.offset_=void 0!==r.offset?r.offset:[0,0],o.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:Qa.TOP_LEFT,o.origin_=null,o.size_=void 0!==r.size?r.size:null,o}return Km(t,i),t.prototype.clone=function(){return new t({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:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var i=this.anchor_,t=this.getSize();if(this.anchorXUnits_==yb.FRACTION||this.anchorYUnits_==yb.FRACTION){if(!t)return null;i=this.anchor_.slice(),this.anchorXUnits_==yb.FRACTION&&(i[0]*=t[0]),this.anchorYUnits_==yb.FRACTION&&(i[1]*=t[1])}if(this.anchorOrigin_!=Qa.TOP_LEFT){if(!t)return null;i===this.anchor_&&(i=this.anchor_.slice()),this.anchorOrigin_!=Qa.TOP_RIGHT&&this.anchorOrigin_!=Qa.BOTTOM_RIGHT||(i[0]=-i[0]+t[0]),this.anchorOrigin_!=Qa.BOTTOM_LEFT&&this.anchorOrigin_!=Qa.BOTTOM_RIGHT||(i[1]=-i[1]+t[1])}return this.normalizedAnchor_=i,this.normalizedAnchor_},t.prototype.setAnchor=function(i){this.anchor_=i,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(i){return this.iconImage_.getImage(i)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(i){return this.iconImage_.getHitDetectionImage(i)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var i=this.offset_,t=this.getDisplacement();if(this.offsetOrigin_!=Qa.TOP_LEFT){var o=this.getSize(),r=this.iconImage_.getSize();if(!o||!r)return null;i=i.slice(),this.offsetOrigin_!=Qa.TOP_RIGHT&&this.offsetOrigin_!=Qa.BOTTOM_RIGHT||(i[0]=r[0]-o[0]-i[0]),this.offsetOrigin_!=Qa.BOTTOM_LEFT&&this.offsetOrigin_!=Qa.BOTTOM_RIGHT||(i[1]=r[1]-o[1]-i[1])}return i[0]+=t[0],i[1]+=t[1],this.origin_=i,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(i){this.iconImage_.addEventListener(ba.CHANGE,i)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(i){this.iconImage_.removeEventListener(ba.CHANGE,i)},t}(uj);of.default=Pj;var Mm=pg&&pg.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Mj=function(e){function t(t){var r=e.call(this,t)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=Fa(),r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r}return Mm(t,e),t.prototype.useContainer=function(t,r,i){i<1&&(t=null),e.prototype.useContainer.call(this,t,r,i)},t.prototype.renderFrame=function(e,t){var r=e.pixelRatio,i=e.layerStatesArray[e.layerIndex];Yn(this.pixelTransform,1/r,1/r),Hf(this.inversePixelTransform,this.pixelTransform);var n=Jf(this.pixelTransform);this.useContainer(t,n,i.opacity);var a=this.context,o=a.canvas,s=this.replayGroup_;if(!s||s.isEmpty())return!this.containerReused&&o.width>0&&(o.width=0),this.container;var $=Math.round(e.size[0]*r),d=Math.round(e.size[1]*r);o.width!=$||o.height!=d?(o.width=$,o.height=d,o.style.transform!==n&&(o.style.transform=n)):this.containerReused||a.clearRect(0,0,$,d),this.preRender(a,e);var p=e.extent,u=e.viewState,h=u.center,c=u.resolution,l=u.projection,g=u.rotation,m=l.getExtent(),F=this.getLayer().getSource(),f=!1;if(i.extent){var v=sb(i.extent,l);(f=!kb(v,e.extent)&&Ga(v,e.extent))&&this.clip(a,e,v)}var _=e.viewHints,y=!(_[ya.ANIMATING]||_[ya.INTERACTING]),x=this.getRenderTransform(h,c,g,r,$,d,0),R=this.getLayer().getDeclutter()?{}:null;if(s.execute(a,x,g,y,void 0,R),F.getWrapX()&&l.canWrapX()&&!kb(m,p)){for(var I=p[0],w=ta(m),E=0,T=void 0;I<m[0];){T=w*--E;var C=this.getRenderTransform(h,c,g,r,$,d,T);s.execute(a,C,g,y,void 0,R),I+=w}for(E=0,I=p[2];I>m[2];){T=w*++E;var j=this.getRenderTransform(h,c,g,r,$,d,T);s.execute(a,j,g,y,void 0,R),I-=w}}if(R){var G=e.viewHints,S=!(G[ya.ANIMATING]||G[ya.INTERACTING]);nm(R,a,g,1,S,e.declutterItems)}f&&a.restore(),this.postRender(a,e);var A=i.opacity,D=this.container;return A!==parseFloat(D.style.opacity)&&(D.style.opacity=1===A?"":A),this.container},t.prototype.getFeatures=function(e){return new Promise(function(t,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];pa(this.pixelTransform,i);var n=this.renderedCenter_,a=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,$=this.renderedExtent_,d=this.getLayer(),p=[],u=i[0]/2,h=i[1]/2;p.push(this.getRenderTransform(n,a,o,.5,u,h,0).slice());var c=d.getSource(),l=s.getExtent();if(c.getWrapX()&&s.canWrapX()&&!kb(l,$)){for(var g=$[0],m=ta(l),F=0,f=void 0;g<l[0];)f=m*--F,p.push(this.getRenderTransform(n,a,o,.5,u,h,f).slice()),g+=m;for(F=0,g=$[2];g>l[2];)f=m*++F,p.push(this.getRenderTransform(n,a,o,.5,u,h,f).slice()),g-=m}this.hitDetectionImageData_=um(i,p,this.renderedFeatures_,d.getStyleFunction(),$,a,o)}t(vm(e,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},t.prototype.forEachFeatureAtCoordinate=function(e,t,r,i,n){if(this.replayGroup_){var a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),$={};return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,r,function(e){var t=ga(e);if(!(t in $))return $[t]=!0,i(e,s)},s.getDeclutter()?n:null)}},t.prototype.handleFontsChanged=function(){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},t.prototype.handleStyleImageChange_=function(e){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(e){var t=this.getLayer(),r=t.getSource();if(!r)return!1;var i=e.viewHints[ya.ANIMATING],n=e.viewHints[ya.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(!this.dirty_&&!a&&i||!o&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=e.extent,$=e.viewState,d=$.projection,p=$.resolution,u=e.pixelRatio,h=t.getRevision(),c=t.getRenderBuffer(),l=t.getRenderOrder();void 0===l&&(l=Wl);var g=$.center.slice(),m=Yd(s,c*p),F=[m.slice()],f=d.getExtent();if(r.getWrapX()&&d.canWrapX()&&!kb(f,e.extent)){var v=ta(f),_=Math.max(ta(m)/2,v);m[0]=f[0]-_,m[2]=f[2]+_,$i(g,d);var y=Qo(F[0],d);y[0]<f[0]&&y[2]<f[2]?F.push([y[0]+v,y[1],y[2]+v,y[3]]):y[0]>f[0]&&y[2]>f[2]&&F.push([y[0]-v,y[1],y[2]-v,y[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==h&&this.renderedRenderOrder_==l&&kb(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var x,R=new Yl(wi(p,u),m,p,u,t.getDeclutter()),I=Ka();if(I){for(var w=0,E=F.length;w<E;++w)r.loadFeatures($c(F[w],d),p,I);x=yc(I,d)}else for(w=0,E=F.length;w<E;++w)r.loadFeatures(F[w],p,d);var T=Vl(p,u),C=function(e){var r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,p)),r){var n=this.renderFeature(e,T,r,R,x);this.dirty_=this.dirty_||n}}.bind(this),j=$c(m,d),G=r.getFeaturesInExtent(j);l&&G.sort(l);for(w=0,E=G.length;w<E;++w)C(G[w]);this.renderedFeatures_=G;var S=R.finish(),A=new jm(m,p,u,r.getOverlaps(),S,t.getRenderBuffer());return this.renderedResolution_=p,this.renderedRevision_=h,this.renderedRenderOrder_=l,this.renderedExtent_=m,this.renderedRotation_=$.rotation,this.renderedCenter_=g,this.renderedProjection_=d,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},t.prototype.renderFeature=function(e,t,r,i,n){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var o=0,s=r.length;o<s;++o)a=yi(i,e,r[o],t,this.boundHandleStyleImageChange_,n)||a;else a=yi(i,e,r,t,this.boundHandleStyleImageChange_,n);return a},t}(pf);pg.default=Mj;var Om=Qg&&Qg.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),wc=function(e){function r(r){return e.call(this,r)||this}return Om(r,e),r.prototype.createRenderer=function(){return new Mj(this)},r}(Zi);Qg.default=wc;var kd={};var rc={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var Sm=!1;function Tm(e,t,r,$){return function(o,a,s){var i=new XMLHttpRequest;i.open("GET","function"==typeof e?e(o,a,s):e,!0),t.getType()==rc.ARRAY_BUFFER&&(i.responseType="arraybuffer"),i.withCredentials=Sm,i.onload=function(e){if(!i.status||i.status>=200&&i.status<300){var a=t.getType(),n=void 0;a==rc.JSON||a==rc.TEXT?n=i.responseText:a==rc.XML?(n=i.responseXML)||(n=new DOMParser().parseFromString(i.responseText,"application/xml")):a==rc.ARRAY_BUFFER&&(n=i.response),n?r.call(this,t.readFeatures(n,{extent:o,featureProjection:s}),t.readProjection(n)):$.call(this)}else $.call(this)}.bind(this),i.onerror=function(){$.call(this)}.bind(this),i.send()}}function tj(e,t){return Tm(e,t,function(e,t){"function"==typeof this.addFeatures&&this.addFeatures(e)},jb)}function Vm(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Je={};var Xm=Je&&Je.__extends||function(){var t=function(r,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])})(r,o)};return function(r,o){function e(){this.constructor=r}t(r,o),r.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),Ie=function(t){function r(r){var o=t.call(this)||this;return o.projection_=ua(r.projection),o.attributions_=lj(r.attributions),o.attributionsCollapsible_=void 0===r.attributionsCollapsible||r.attributionsCollapsible,o.loading=!1,o.state_=void 0!==r.state?r.state:Wb.READY,o.wrapX_=void 0!==r.wrapX&&r.wrapX,o}return Xm(r,t),r.prototype.getAttributions=function(){return this.attributions_},r.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},r.prototype.getProjection=function(){return this.projection_},r.prototype.getResolutions=function(){return ca()},r.prototype.getState=function(){return this.state_},r.prototype.getWrapX=function(){return this.wrapX_},r.prototype.refresh=function(){this.changed()},r.prototype.setAttributions=function(t){this.attributions_=lj(t),this.changed()},r.prototype.setState=function(t){this.state_=t,this.changed()},r}(Oa);function lj(t){return t?Array.isArray(t)?function(r){return t}:"function"==typeof t?t:function(r){return[t]}:null}Je.default=Ie;var Ra={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var pd=function(){function t(t){var $C6Up$$interop$default=uh(Dd);this.rbush_=new $C6Up$$interop$default.d(t),this.items_={}}return t.prototype.insert=function(t,r){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:r};this.rbush_.insert(i),this.items_[ga(r)]=i},t.prototype.load=function(t,r){for(var i=new Array(r.length),e=0,n=r.length;e<n;e++){var o=t[e],s=r[e],u={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[e]=u,this.items_[ga(s)]=u}this.rbush_.load(i)},t.prototype.remove=function(t){var r=ga(t),i=this.items_[r];return delete this.items_[r],null!==this.rbush_.remove(i)},t.prototype.update=function(t,r){var i=this.items_[ga(r)],e=[i.minX,i.minY,i.maxX,i.maxY];mc(e,t)||(this.remove(r),this.insert(t,r))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(r).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,r){return this.forEach_(this.getInExtent(t),r)},t.prototype.forEach_=function(t,r){for(var i,e=0,n=t.length;e<n;e++)if(i=r(t[e]))return i;return i},t.prototype.isEmpty=function(){return Sc(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var r=this.rbush_.toJSON();return Sa(r.minX,r.minY,r.maxX,r.maxY,t)},t.prototype.concat=function(t){for(var r in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[r]=t.items_[r]},t}();var dj=kd&&kd.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),lc=function(e){function t(t,r){var o=e.call(this,t)||this;return o.feature=r,o}return dj(t,e),t}(Ha);kd.VectorSourceEvent=lc;var jc=function(e){function t(t){var r=this,o=t||{};(r=e.call(this,{attributions:o.attributions,projection:void 0,state:Wb.READY,wrapX:void 0===o.wrapX||o.wrapX})||this).loader_=jb,r.format_=o.format,r.overlaps_=void 0===o.overlaps||o.overlaps,r.url_=o.url,void 0!==o.loader?r.loader_=o.loader:void 0!==r.url_&&(ia(r.format_,7),r.loader_=tj(r.url_,r.format_)),r.strategy_=void 0!==o.strategy?o.strategy:Vm;var i,n,s=void 0===o.useSpatialIndex||o.useSpatialIndex;return r.featuresRtree_=s?new pd:null,r.loadedExtentsRtree_=new pd,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(o.features)?n=o.features:o.features&&(n=(i=o.features).getArray()),s||void 0!==i||(i=new za(n)),void 0!==n&&r.addFeaturesInternal(n),void 0!==i&&r.bindFeaturesCollection_(i),r}return dj(t,e),t.prototype.addFeature=function(e){this.addFeatureInternal(e),this.changed()},t.prototype.addFeatureInternal=function(e){var t=ga(e);if(this.addToIndex_(t,e)){this.setupChangeEvents_(t,e);var r=e.getGeometry();if(r){var o=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new lc(Ra.ADDFEATURE,e))}else this.featuresCollection_&&this.featuresCollection_.remove(e)},t.prototype.setupChangeEvents_=function(e,t){this.featureChangeKeys_[e]=[fa(t,ba.CHANGE,this.handleFeatureChange_,this),fa(t,ub.PROPERTYCHANGE,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(e,t){var r=!0,o=t.getId();return void 0!==o&&(o.toString()in this.idIndex_?r=!1:this.idIndex_[o.toString()]=t),r&&(ia(!(e in this.uidIndex_),30),this.uidIndex_[e]=t),r},t.prototype.addFeatures=function(e){this.addFeaturesInternal(e),this.changed()},t.prototype.addFeaturesInternal=function(e){for(var t=[],r=[],o=[],i=0,n=e.length;i<n;i++){var s=e[i],a=ga(s);this.addToIndex_(a,s)&&r.push(s)}i=0;for(var u=r.length;i<u;i++){s=r[i],a=ga(s);this.setupChangeEvents_(a,s);var $=s.getGeometry();if($){var l=$.getExtent();t.push(l),o.push(s)}else this.nullGeometryFeatures_[a]=s}this.featuresRtree_&&this.featuresRtree_.load(t,o);i=0;for(var p=r.length;i<p;i++)this.dispatchEvent(new lc(Ra.ADDFEATURE,r[i]))},t.prototype.bindFeaturesCollection_=function(e){var t=!1;this.addEventListener(Ra.ADDFEATURE,function(r){t||(t=!0,e.push(r.feature),t=!1)}),this.addEventListener(Ra.REMOVEFEATURE,function(r){t||(t=!0,e.remove(r.feature),t=!1)}),e.addEventListener(ra.ADD,function(e){t||(t=!0,this.addFeature(e.element),t=!1)}.bind(this)),e.addEventListener(ra.REMOVE,function(e){t||(t=!0,this.removeFeature(e.element),t=!1)}.bind(this)),this.featuresCollection_=e},t.prototype.clear=function(e){if(e){for(var t in this.featureChangeKeys_){this.featureChangeKeys_[t].forEach(ja)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new lc(Ra.CLEAR);this.dispatchEvent(o),this.changed()},t.prototype.forEachFeature=function(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},t.prototype.forEachFeatureAtCoordinateDirect=function(e,t){var r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,function(r){return r.getGeometry().intersectsCoordinate(e)?t(r):void 0})},t.prototype.forEachFeatureInExtent=function(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},t.prototype.forEachFeatureIntersectingExtent=function(e,t){return this.forEachFeatureInExtent(e,function(r){if(r.getGeometry().intersectsExtent(e)){var o=t(r);if(o)return o}})},t.prototype.getFeaturesCollection=function(){return this.featuresCollection_},t.prototype.getFeatures=function(){var e;return this.featuresCollection_?e=this.featuresCollection_.getArray():this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Sc(this.nullGeometryFeatures_)||Pa(e,df(this.nullGeometryFeatures_))),e},t.prototype.getFeaturesAtCoordinate=function(e){var t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t},t.prototype.getFeaturesInExtent=function(e){return this.featuresRtree_?this.featuresRtree_.getInExtent(e):this.featuresCollection_?this.featuresCollection_.getArray():[]},t.prototype.getClosestFeatureToCoordinate=function(e,t){var r=e[0],o=e[1],i=null,n=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],u=t||Ia;return this.featuresRtree_.forEachInExtent(a,function(e){if(u(e)){var t=e.getGeometry(),$=s;if((s=t.closestPointXY(r,o,n,s))<$){i=e;var l=Math.sqrt(s);a[0]=r-l,a[1]=o-l,a[2]=r+l,a[3]=o+l}}}),i},t.prototype.getExtent=function(e){return this.featuresRtree_.getExtent(e)},t.prototype.getFeatureById=function(e){var t=this.idIndex_[e.toString()];return void 0!==t?t:null},t.prototype.getFeatureByUid=function(e){var t=this.uidIndex_[e];return void 0!==t?t:null},t.prototype.getFormat=function(){return this.format_},t.prototype.getOverlaps=function(){return this.overlaps_},t.prototype.getUrl=function(){return this.url_},t.prototype.handleFeatureChange_=function(e){var t=e.target,r=ga(t),o=t.getGeometry();if(o){var i=o.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,t)):this.featuresRtree_&&this.featuresRtree_.update(i,t)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[r]=t);var n=t.getId();if(void 0!==n){var s=n.toString();this.idIndex_[s]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[s]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[r]=t;this.changed(),this.dispatchEvent(new lc(Ra.CHANGEFEATURE,t))},t.prototype.hasFeature=function(e){var t=e.getId();return void 0!==t?t in this.idIndex_:ga(e)in this.uidIndex_},t.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Sc(this.nullGeometryFeatures_)},t.prototype.loadFeatures=function(e,t,r){var o=this.loadedExtentsRtree_,i=this.strategy_(e,t);this.loading=!1;for(var n=function(e,n){var a=i[e];o.forEachInExtent(a,function(e){return kb(e.extent,a)})||(s.loader_.call(s,a,t,r),o.insert(a,{extent:a.slice()}),s.loading=s.loader_!==jb)},s=this,a=0,u=i.length;a<u;++a)n(a)},t.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),e.prototype.refresh.call(this)},t.prototype.removeLoadedExtent=function(e){var t,r=this.loadedExtentsRtree_;r.forEachInExtent(e,function(r){if(mc(r.extent,e))return t=r,!0}),t&&r.remove(t)},t.prototype.removeFeature=function(e){var t=ga(e);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.removeFeatureInternal(e),this.changed()},t.prototype.removeFeatureInternal=function(e){var t=ga(e);this.featureChangeKeys_[t].forEach(ja),delete this.featureChangeKeys_[t];var r=e.getId();void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[t],this.dispatchEvent(new lc(Ra.REMOVEFEATURE,e))},t.prototype.removeFromIdIndex_=function(e){var t=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===e){delete this.idIndex_[r],t=!0;break}return t},t.prototype.setLoader=function(e){this.loader_=e},t.prototype.setUrl=function(e){ia(this.format_,7),this.setLoader(tj(e,this.format_))},t}(Ie);kd.default=jc;var Ni=_c&&_c.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ma={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},ud={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"},vd=function(e){function t(t,i){var r=e.call(this,t)||this;return r.feature=i,r}return Ni(t,e),t}(Ha),ni=function(e){function t(t){var i=this,r=t;r.stopDown||(r.stopDown=Jb),(i=e.call(this,r)||this).shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.freehand_=!1,i.source_=t.source?t.source:null,i.features_=t.features?t.features:null,i.snapTolerance_=t.snapTolerance?t.snapTolerance:12,i.type_=t.type,i.mode_=mn(i.type_),i.stopClick_=!!t.stopClick,i.minPoints_=t.minPoints?t.minPoints:i.mode_===ma.POLYGON?3:2,i.maxPoints_=t.maxPoints?t.maxPoints:1/0,i.finishCondition_=t.finishCondition?t.finishCondition:Ia;var o=t.geometryFunction;if(!o)if(i.type_===aa.CIRCLE)o=function(e,t,i){var r=t||new Gc([NaN,NaN]),o=ka(e[0],i),n=Ja(o,ka(e[1],i));r.setCenterAndRadius(o,Math.sqrt(n));var s=Ka();return s&&r.transform(i,s),r};else{var n,s=i.mode_;s===ma.POINT?n=ob:s===ma.LINE_STRING?n=Tb:s===ma.POLYGON&&(n=_a),o=function(e,t,i){var r=t;return r?s===ma.POLYGON?e[0].length?r.setCoordinates([e[0].concat([e[0][0]])]):r.setCoordinates([]):r.setCoordinates(e):r=new n(e),r}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,i.overlay_=new wc({source:new jc({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:jn(),updateWhileInteracting:!0}),i.geometryName_=t.geometryName,i.condition_=t.condition?t.condition:Mg,i.freehandCondition_,t.freehand?i.freehandCondition_=Lg:i.freehandCondition_=t.freehandCondition?t.freehandCondition:ce,i.addEventListener(qa(Zd.ACTIVE),i.updateState_),i}return Ni(t,e),t.prototype.setMap=function(t){e.prototype.setMap.call(this,t),this.updateState_()},t.prototype.getOverlay=function(){return this.overlay_},t.prototype.handleEvent=function(t){t.originalEvent.type===ba.CONTEXTMENU&&t.preventDefault(),this.freehand_=this.mode_!==ma.POINT&&this.freehandCondition_(t);var i=t.type===ha.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&t.type===ha.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.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_&&t.type===ha.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),r=!1):this.freehand_&&t.type===ha.POINTERDOWN?r=!1:i?(r=t.type===ha.POINTERMOVE)&&this.freehand_?r=this.handlePointerMove_(t):("mouse"==t.pointerEvent.pointerType||t.type===ha.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t):t.type===ha.DBLCLICK&&(r=!1),e.prototype.handleEvent.call(this,t)&&r},t.prototype.handleDownEvent=function(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new fb(ha.POINTERMOVE,e.map,e.pointerEvent,!1,e.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)},t.prototype.handleUpEvent=function(e){var t=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);var i=this.mode_===ma.CIRCLE;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(e)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate):(this.startDrawing_(e),this.mode_===ma.POINT&&this.finishDrawing()),t=!1):this.freehand_&&this.abortDrawing(),!t&&this.stopClick_&&e.stopPropagation(),t},t.prototype.handlePointerMove_=function(e){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var t=this.downPx_,i=e.pixel,r=t[0]-i[0],o=t[1]-i[1],n=r*r+o*o;if(this.shouldHandle_=this.freehand_?n>this.squaredClickTolerance_:n<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(e):this.createOrUpdateSketchPoint_(e),!0},t.prototype.atFinish_=function(e){var t=!1;if(this.sketchFeature_){var i=!1,r=[this.finishCoordinate_];if(this.mode_===ma.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===ma.POLYGON){var o=this.sketchCoords_;i=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var n=e.map,s=0,a=r.length;s<a;s++){var $=r[s],h=n.getPixelFromCoordinate($),p=e.pixel,d=p[0]-h[0],_=p[1]-h[1],c=this.freehand_?1:this.snapTolerance_;if(t=Math.sqrt(d*d+_*_)<=c){this.finishCoordinate_=$;break}}}return t},t.prototype.createOrUpdateSketchPoint_=function(e){var t=e.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new ab(new ob(t)),this.updateSketchFeatures_())},t.prototype.startDrawing_=function(e){var t=e.coordinate,i=e.map.getView().getProjection();this.finishCoordinate_=t,this.mode_===ma.POINT?this.sketchCoords_=t.slice():this.mode_===ma.POLYGON?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new ab(new Tb(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,i);this.sketchFeature_=new ab,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new vd(ud.DRAWSTART,this.sketchFeature_))},t.prototype.modifyDrawing_=function(e){var t,i,r,o=e.coordinate,n=this.sketchFeature_.getGeometry(),s=e.map.getView().getProjection();(this.mode_===ma.POINT?i=this.sketchCoords_:this.mode_===ma.POLYGON?(i=(t=this.sketchCoords_[0])[t.length-1],this.atFinish_(e)&&(o=this.finishCoordinate_.slice())):i=(t=this.sketchCoords_)[t.length-1],i[0]=o[0],i[1]=o[1],this.geometryFunction_(this.sketchCoords_,n,s),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(o);if(n.getType()==aa.POLYGON&&this.mode_!==ma.POLYGON){this.sketchLine_||(this.sketchLine_=new ab);var a=n.getLinearRing(0);(r=this.sketchLine_.getGeometry())?(r.setFlatCoordinates(a.getLayout(),a.getFlatCoordinates()),r.changed()):(r=new Tb(a.getFlatCoordinates(),a.getLayout()),this.sketchLine_.setGeometry(r))}else this.sketchLineCoords_&&(r=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},t.prototype.addToDrawing_=function(e){var t,i,r=this.sketchFeature_.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===ma.LINE_STRING?(this.finishCoordinate_=e.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():t=!0),i.push(e.slice()),this.geometryFunction_(i,r,o)):this.mode_===ma.POLYGON&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():t=!0),i.push(e.slice()),t&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,r,o)),this.updateSketchFeatures_(),t&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var e,t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===ma.LINE_STRING?((e=this.sketchCoords_).splice(-2,1),this.geometryFunction_(e,t,i),e.length>=2&&(this.finishCoordinate_=e[e.length-2].slice())):this.mode_===ma.POLYGON&&((e=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,i)),0===e.length&&this.abortDrawing(),this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var e=this.abortDrawing_();if(e){var t=this.sketchCoords_,i=e.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===ma.LINE_STRING?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_===ma.POLYGON&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_===aa.MULTI_POINT?e.setGeometry(new me([t])):this.type_===aa.MULTI_LINE_STRING?e.setGeometry(new _g([t])):this.type_===aa.MULTI_POLYGON&&e.setGeometry(new Tg([t])),this.dispatchEvent(new vd(ud.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e)}},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),e},t.prototype.abortDrawing=function(){var e=this.abortDrawing_();e&&this.dispatchEvent(new vd(ud.DRAWABORT,e))},t.prototype.appendCoordinates=function(e){var t=this.mode_,i=[];t===ma.LINE_STRING?i=this.sketchCoords_:t===ma.POLYGON&&(i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var r=i.pop(),o=0;o<e.length;o++)this.addToDrawing_(e[o]);this.addToDrawing_(r)},t.prototype.extend=function(e){var t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new vd(ud.DRAWSTART,this.sketchFeature_))},t.prototype.updateSketchFeatures_=function(){var e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);var t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)},t.prototype.updateState_=function(){var e=this.getMap(),t=this.getActive();e&&t||this.abortDrawing(),this.overlay_.setMap(t?e:null)},t}(Na);function jn(){var e=Lc();return function(t,i){return e[t.getGeometry().getType()]}}function kn(e,t){return function(i,r,o){var n=ka(i[0],o),s=ka(i[1],o),a=Math.sqrt(Ja(n,s)),$=r||dc(new Gc(n),e),h=t;if(!t){var p=s[0]-n[0],d=s[1]-n[1];h=Math.atan(d/p)-(p<0?Math.PI:0)}Ng($,n,a,h);var _=Ka();return _&&$.transform(o,_),$}}function ln(){return function(e,t,i){var r=va(e.map(function(e){return ka(e,i)})),o=[[vb(r),Sb(r),Ob(r),Ya(r),vb(r)]],n=t;n?n.setCoordinates(o):n=new _a(o);var s=Ka();return s&&n.transform(i,s),n}}function mn(e){var t;return e===aa.POINT||e===aa.MULTI_POINT?t=ma.POINT:e===aa.LINE_STRING||e===aa.MULTI_LINE_STRING?t=ma.LINE_STRING:e===aa.POLYGON||e===aa.MULTI_POLYGON?t=ma.POLYGON:e===aa.CIRCLE&&(t=ma.CIRCLE),t}_c.createRegularPolygon=kn,_c.createBox=ln,_c.default=ni;var Cg={};var gi=Cg&&Cg.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pn={EXTENTCHANGED:"extentchanged"},qn=function(e){function t(t){var r=e.call(this,pn.EXTENTCHANGED)||this;return r.extent=t,r}return gi(t,e),t}(Ha),rn=function(e){function t(t){var r=this,n=t||{};return(r=e.call(this,n)||this).extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,t||(t={}),r.extentOverlay_=new wc({source:new jc({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:sn(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new wc({source:new jc({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:tn(),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&r.setExtent(t.extent),r}return gi(t,e),t.prototype.snapToVertex_=function(e,t){var r=t.getCoordinateFromPixelInternal(e),n=this.getExtentInternal();if(n){var o=Fk(n);o.sort(function(e,t){return Qd(r,e)-Qd(r,t)});var i=o[0],a=Sd(r,i),$=t.getPixelFromCoordinateInternal(a);if(Rd(e,$)<=this.pixelTolerance_){var l=t.getPixelFromCoordinateInternal(i[0]),p=t.getPixelFromCoordinateInternal(i[1]),u=Ja($,l),s=Ja($,p),c=Math.sqrt(Math.min(u,s));return this.snappedToVertex_=c<=this.pixelTolerance_,this.snappedToVertex_&&(a=u>s?i[1]:i[0]),a}}return null},t.prototype.handlePointerMove_=function(e){var t=e.pixel,r=e.map,n=this.snapToVertex_(t,r);n||(n=r.getCoordinateFromPixelInternal(t)),this.createOrUpdatePointerFeature_(n)},t.prototype.createOrUpdateExtentFeature_=function(e){var t=this.extentFeature_;return t?e?t.setGeometry(_b(e)):t.setGeometry(void 0):(t=e?new ab(_b(e)):new ab({}),this.extentFeature_=t,this.extentOverlay_.getSource().addFeature(t)),t},t.prototype.createOrUpdatePointerFeature_=function(e){var t=this.vertexFeature_;t?t.getGeometry().setCoordinates(e):(t=new ab(new ob(e)),this.vertexFeature_=t,this.vertexOverlay_.getSource().addFeature(t));return t},t.prototype.handleEvent=function(t){return!t.pointerEvent||(t.type!=ha.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),e.prototype.handleEvent.call(this,t),!1)},t.prototype.handleDownEvent=function(e){var t=e.pixel,r=e.map,n=this.getExtentInternal(),o=this.snapToVertex_(t,r),i=function(e){var t=null,r=null;return e[0]==n[0]?t=n[2]:e[0]==n[2]&&(t=n[0]),e[1]==n[1]?r=n[3]:e[1]==n[3]&&(r=n[1]),null!==t&&null!==r?[t,r]:null};if(o&&n){var a=o[0]==n[0]||o[0]==n[2]?o[0]:null,$=o[1]==n[1]||o[1]==n[3]?o[1]:null;null!==a&&null!==$?this.pointerHandler_=bi(i(o)):null!==a?this.pointerHandler_=_h(i([a,n[1]]),i([a,n[3]])):null!==$&&(this.pointerHandler_=_h(i([n[0],$]),i([n[2],$])))}else o=r.getCoordinateFromPixelInternal(t),this.setExtent([o[0],o[1],o[0],o[1]]),this.pointerHandler_=bi(o);return!0},t.prototype.handleDragEvent=function(e){if(this.pointerHandler_){var t=e.coordinate;this.setExtent(this.pointerHandler_(t)),this.createOrUpdatePointerFeature_(t)}return!0},t.prototype.handleUpEvent=function(e){this.pointerHandler_=null;var t=this.getExtentInternal();return t&&0!==Vd(t)||this.setExtent(null),!1},t.prototype.setMap=function(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),e.prototype.setMap.call(this,t)},t.prototype.getExtent=function(){return $c(this.getExtentInternal(),this.getMap().getView().getProjection())},t.prototype.getExtentInternal=function(){return this.extent_},t.prototype.setExtent=function(e){this.extent_=e||null,this.createOrUpdateExtentFeature_(e),this.dispatchEvent(new qn(this.extent_))},t}(Na);function sn(){var e=Lc();return function(t,r){return e[aa.POLYGON]}}function tn(){var e=Lc();return function(t,r){return e[aa.POINT]}}function bi(e){return function(t){return va([e,t])}}function _h(e,t){return e[0]==t[0]?function(r){return va([e,[r[0],t[1]]])}:e[1]==t[1]?function(r){return va([e,[t[0],r[1]]])}:null}function Fk(e){return[[[e[0],e[1]],[e[0],e[3]]],[[e[0],e[3]],[e[2],e[3]]],[[e[2],e[3]],[e[2],e[1]]],[[e[2],e[1]],[e[0],e[1]]]]}Cg.default=rn;var wd={};var Yh=wd&&wd.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Wh=0,Uc=1,Rh=[0,0,0,0],hc=[],kg={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"},zd=function(e){function t(t,r,o){var i=e.call(this,t)||this;return i.features=r,i.mapBrowserEvent=o,i}return Yh(t,e),t}(Ha);wd.ModifyEvent=zd;var Fn=function(e){function t(t){var r,o=e.call(this,t)||this;if(o.boundHandleFeatureChange_=o.handleFeatureChange_.bind(o),o.condition_=t.condition?t.condition:Jj,o.defaultDeleteCondition_=function(e){return hl(e)&&Ej(e)},o.deleteCondition_=t.deleteCondition?t.deleteCondition:o.defaultDeleteCondition_,o.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:Lg,o.vertexFeature_=null,o.vertexSegments_=null,o.lastPixel_=[0,0],o.ignoreNextSingleClick_=!1,o.modified_=!1,o.rBush_=new pd,o.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,o.snappedToVertex_=!1,o.changingFeature_=!1,o.dragSegments_=[],o.overlay_=new wc({source:new jc({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:Jn(),updateWhileAnimating:!0,updateWhileInteracting:!0}),o.SEGMENT_WRITERS_={Point:o.writePointGeometry_.bind(o),LineString:o.writeLineStringGeometry_.bind(o),LinearRing:o.writeLineStringGeometry_.bind(o),Polygon:o.writePolygonGeometry_.bind(o),MultiPoint:o.writeMultiPointGeometry_.bind(o),MultiLineString:o.writeMultiLineStringGeometry_.bind(o),MultiPolygon:o.writeMultiPolygonGeometry_.bind(o),Circle:o.writeCircleGeometry_.bind(o),GeometryCollection:o.writeGeometryCollectionGeometry_.bind(o)},o.source_=null,t.source?(o.source_=t.source,r=new za(o.source_.getFeatures()),o.source_.addEventListener(Ra.ADDFEATURE,o.handleSourceAdd_.bind(o)),o.source_.addEventListener(Ra.REMOVEFEATURE,o.handleSourceRemove_.bind(o))):r=t.features,!r)throw new Error("The modify interaction requires features or a source");return o.features_=r,o.features_.forEach(o.addFeature_.bind(o)),o.features_.addEventListener(ra.ADD,o.handleFeatureAdd_.bind(o)),o.features_.addEventListener(ra.REMOVE,o.handleFeatureRemove_.bind(o)),o.lastPointerEvent_=null,o}return Yh(t,e),t.prototype.addFeature_=function(e){var t=e.getGeometry();if(t){var r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),e.addEventListener(ba.CHANGE,this.boundHandleFeatureChange_)},t.prototype.willModifyFeatures_=function(e){this.modified_||(this.modified_=!0,this.dispatchEvent(new zd(kg.MODIFYSTART,this.features_,e)))},t.prototype.removeFeature_=function(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(ba.CHANGE,this.boundHandleFeatureChange_)},t.prototype.removeFeatureSegmentData_=function(e){var t=this.rBush_,r=[];t.forEach(function(t){e===t.feature&&r.push(t)});for(var o=r.length-1;o>=0;--o){for(var i=r[o],n=this.dragSegments_.length-1;n>=0;--n)this.dragSegments_[n][0]===i&&this.dragSegments_.splice(n,1);t.remove(i)}},t.prototype.setActive=function(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.prototype.setActive.call(this,t)},t.prototype.setMap=function(t){this.overlay_.setMap(t),e.prototype.setMap.call(this,t)},t.prototype.getOverlay=function(){return this.overlay_},t.prototype.handleSourceAdd_=function(e){e.feature&&this.features_.push(e.feature)},t.prototype.handleSourceRemove_=function(e){e.feature&&this.features_.remove(e.feature)},t.prototype.handleFeatureAdd_=function(e){this.addFeature_(e.element)},t.prototype.handleFeatureChange_=function(e){if(!this.changingFeature_){var t=e.target;this.removeFeature_(t),this.addFeature_(t)}},t.prototype.handleFeatureRemove_=function(e){var t=e.element;this.removeFeature_(t)},t.prototype.writePointGeometry_=function(e,t){var r=t.getCoordinates(),o={feature:e,geometry:t,segment:[r,r]};this.rBush_.insert(t.getExtent(),o)},t.prototype.writeMultiPointGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o){var n=r[o],a={feature:e,geometry:t,depth:[o],index:o,segment:[n,n]};this.rBush_.insert(t.getExtent(),a)}},t.prototype.writeLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length-1;o<i;++o){var n=r.slice(o,o+2),a={feature:e,geometry:t,index:o,segment:n};this.rBush_.insert(va(n),a)}},t.prototype.writeMultiLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o)for(var n=r[o],a=0,s=n.length-1;a<s;++a){var $=n.slice(a,a+2),p={feature:e,geometry:t,depth:[o],index:a,segment:$};this.rBush_.insert(va($),p)}},t.prototype.writePolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o)for(var n=r[o],a=0,s=n.length-1;a<s;++a){var $=n.slice(a,a+2),p={feature:e,geometry:t,depth:[o],index:a,segment:$};this.rBush_.insert(va($),p)}},t.prototype.writeMultiPolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o)for(var n=r[o],a=0,s=n.length;a<s;++a)for(var $=n[a],p=0,m=$.length-1;p<m;++p){var u=$.slice(p,p+2),d={feature:e,geometry:t,depth:[a,o],index:p,segment:u};this.rBush_.insert(va(u),d)}},t.prototype.writeCircleGeometry_=function(e,t){var r=t.getCenter(),o={feature:e,geometry:t,index:Wh,segment:[r,r]},i={feature:e,geometry:t,index:Uc,segment:[r,r]},n=[o,i];o.featureSegments=n,i.featureSegments=n,this.rBush_.insert(Wd(r),o);var a=t,s=Ka();if(s&&this.getMap()){var $=this.getMap().getView().getProjection();a=a.clone().transform(s,$),a=dc(a).transform($,s)}this.rBush_.insert(a.getExtent(),i)},t.prototype.writeGeometryCollectionGeometry_=function(e,t){for(var r=t.getGeometriesArray(),o=0;o<r.length;++o){var i=r[o];(0,this.SEGMENT_WRITERS_[i.getType()])(e,i)}},t.prototype.createOrUpdateVertexFeature_=function(e){var t=this.vertexFeature_;t?t.getGeometry().setCoordinates(e):(t=new ab(new ob(e)),this.vertexFeature_=t,this.overlay_.getSource().addFeature(t));return t},t.prototype.handleEvent=function(t){return!t.pointerEvent||(this.lastPointerEvent_=t,t.map.getView().getInteracting()||t.type!=ha.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(r=!(t.type!=ha.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==ha.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),e.prototype.handleEvent.call(this,t)&&!r);var r},t.prototype.handleDragEvent=function(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e);for(var t=e.coordinate,r=0,o=this.dragSegments_.length;r<o;++r){for(var i=this.dragSegments_[r],n=i[0],a=n.depth,s=n.geometry,$=void 0,p=n.segment,m=i[1];t.length<s.getStride();)t.push(p[m][t.length]);switch(s.getType()){case aa.POINT:$=t,p[0]=t,p[1]=t;break;case aa.MULTI_POINT:($=s.getCoordinates())[n.index]=t,p[0]=t,p[1]=t;break;case aa.LINE_STRING:($=s.getCoordinates())[n.index+m]=t,p[m]=t;break;case aa.MULTI_LINE_STRING:case aa.POLYGON:($=s.getCoordinates())[a[0]][n.index+m]=t,p[m]=t;break;case aa.MULTI_POLYGON:($=s.getCoordinates())[a[1]][a[0]][n.index+m]=t,p[m]=t;break;case aa.CIRCLE:if(p[0]=t,p[1]=t,n.index===Wh)this.changingFeature_=!0,s.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0;var u=e.map.getView().getProjection(),d=Rd(ka(s.getCenter(),u),ka(t,u)),x=Ka();if(x){var g=s.clone().transform(x,u);g.setRadius(d),d=g.transform(u,x).getRadius()}s.setRadius(d),this.changingFeature_=!1}}$&&this.setGeometryCoordinates_(s,$)}this.createOrUpdateVertexFeature_(t)},t.prototype.handleDownEvent=function(e){if(!this.condition_(e))return!1;var t=e.coordinate;this.handlePointerAtPixel_(e.pixel,e.map,t),this.dragSegments_.length=0,this.modified_=!1;var r=this.vertexFeature_;if(r){var o=e.map.getView().getProjection(),i=[],n=r.getGeometry().getCoordinates(),a=va([n]),s=this.rBush_.getInExtent(a),$={};s.sort(Gn);for(var p=0,m=s.length;p<m;++p){var u=s[p],d=u.segment,x=ga(u.feature),g=u.depth;if(g&&(x+="-"+g.join("-")),$[x]||($[x]=new Array(2)),u.geometry.getType()!==aa.CIRCLE||u.index!==Uc){if(!$a(d[0],n)||$[x][0]){if(!$a(d[1],n)||$[x][1])ga(d)in this.vertexSegments_&&!$[x][0]&&!$[x][1]&&this.insertVertexCondition_(e)&&i.push([u,n]);else{if((u.geometry.getType()===aa.LINE_STRING||u.geometry.getType()===aa.MULTI_LINE_STRING)&&$[x][0]&&0===$[x][0].index)continue;this.dragSegments_.push([u,1]),$[x][1]=u}}else this.dragSegments_.push([u,0]),$[x][0]=u;}else{var h=xh(t,u,o);$a(h,n)&&!$[x][0]&&(this.dragSegments_.push([u,0]),$[x][0]=u)}}i.length&&this.willModifyFeatures_(e);for(var l=i.length-1;l>=0;--l)this.insertVertex_.apply(this,i[l])}return!!this.vertexFeature_},t.prototype.handleUpEvent=function(e){for(var t=this.dragSegments_.length-1;t>=0;--t){var r=this.dragSegments_[t][0],o=r.geometry;if(o.getType()===aa.CIRCLE){var i=o.getCenter(),n=r.featureSegments[0],a=r.featureSegments[1];n.segment[0]=i,n.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(Wd(i),n);var s=o,$=Ka();if($){var p=e.map.getView().getProjection();s=s.clone().transform($,p),s=dc(s).transform(p,$)}this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(va(r.segment),r)}return this.modified_&&(this.dispatchEvent(new zd(kg.MODIFYEND,this.features_,e)),this.modified_=!1),!1},t.prototype.handlePointerMove_=function(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)},t.prototype.handlePointerAtPixel_=function(e,t,r){var o=r||t.getCoordinateFromPixel(e),i=t.getView().getProjection(),n=sb(Wd(o,Rh),i),a=t.getView().getResolution()*this.pixelTolerance_,s=$c(Yd(n,a,Rh),i),$=this.rBush_.getInExtent(s);if($.length>0){$.sort(function(e,t){return Eh(o,e,i)-Eh(o,t,i)});var p=$[0],m=p.segment,u=xh(o,p,i),d=t.getPixelFromCoordinate(u),x=Rd(e,d);if(x<=this.pixelTolerance_){var g={};if(p.geometry.getType()===aa.CIRCLE&&p.index===Uc)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(u);else{var h=t.getPixelFromCoordinate(m[0]),l=t.getPixelFromCoordinate(m[1]),c=Ja(d,h),_=Ja(d,l);x=Math.sqrt(Math.min(c,_)),this.snappedToVertex_=x<=this.pixelTolerance_,this.snappedToVertex_&&(u=c>_?m[1]:m[0]),this.createOrUpdateVertexFeature_(u);for(var v=1,y=$.length;v<y;++v){var q=$[v].segment;if(!($a(m[0],q[0])&&$a(m[1],q[1])||$a(m[0],q[1])&&$a(m[1],q[0])))break;g[ga(q)]=!0}}return g[ga(m)]=!0,void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},t.prototype.insertVertex_=function(e,t){for(var r,o=e.segment,i=e.feature,n=e.geometry,a=e.depth,s=e.index;t.length<n.getStride();)t.push(0);switch(n.getType()){case aa.MULTI_LINE_STRING:case aa.POLYGON:(r=n.getCoordinates())[a[0]].splice(s+1,0,t);break;case aa.MULTI_POLYGON:(r=n.getCoordinates())[a[1]][a[0]].splice(s+1,0,t);break;case aa.LINE_STRING:(r=n.getCoordinates()).splice(s+1,0,t);break;default:return;}this.setGeometryCoordinates_(n,r);var $=this.rBush_;$.remove(e),this.updateSegmentIndices_(n,s,a,1);var p={segment:[o[0],t],feature:i,geometry:n,depth:a,index:s};$.insert(va(p.segment),p),this.dragSegments_.push([p,1]);var m={segment:[t,o[1]],feature:i,geometry:n,depth:a,index:s+1};$.insert(va(m.segment),m),this.dragSegments_.push([m,0]),this.ignoreNextSingleClick_=!0},t.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ha.POINTERDRAG){var e=this.lastPointerEvent_;this.willModifyFeatures_(e);var t=this.removeVertex_();return this.dispatchEvent(new zd(kg.MODIFYEND,this.features_,e)),this.modified_=!1,t}return!1},t.prototype.removeVertex_=function(){var e,t,r,o,i,n,a,s,$,p,m,u=this.dragSegments_,d={},x=!1;for(i=u.length-1;i>=0;--i)p=(r=u[i])[0],m=ga(p.feature),p.depth&&(m+="-"+p.depth.join("-")),m in d||(d[m]={}),0===r[1]?(d[m].right=p,d[m].index=p.index):1==r[1]&&(d[m].left=p,d[m].index=p.index+1);for(m in d){switch($=d[m].right,a=d[m].left,(s=(n=d[m].index)-1)<0&&(s=0),e=t=(o=(p=void 0!==a?a:$).geometry).getCoordinates(),x=!1,o.getType()){case aa.MULTI_LINE_STRING:t[p.depth[0]].length>2&&(t[p.depth[0]].splice(n,1),x=!0);break;case aa.LINE_STRING:t.length>2&&(t.splice(n,1),x=!0);break;case aa.MULTI_POLYGON:e=e[p.depth[1]];case aa.POLYGON:(e=e[p.depth[0]]).length>4&&(n==e.length-1&&(n=0),e.splice(n,1),x=!0,0===n&&(e.pop(),e.push(e[0]),s=e.length-1));}if(x){this.setGeometryCoordinates_(o,t);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==$&&(this.rBush_.remove($),g.push($.segment[1])),void 0!==a&&void 0!==$){var h={depth:p.depth,feature:p.feature,geometry:p.geometry,index:s,segment:g};this.rBush_.insert(va(h.segment),h)}this.updateSegmentIndices_(o,n,p.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),u.length=0}}return x},t.prototype.setGeometryCoordinates_=function(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1},t.prototype.updateSegmentIndices_=function(e,t,r,o){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(void 0===r||void 0===i.depth||xc(i.depth,r))&&i.index>t&&(i.index+=o)})},t}(Na);function Gn(e,t){return e.index-t.index}function Eh(e,t,r){var o=t.geometry;if(o.getType()===aa.CIRCLE){var i=o;if(t.index===Uc){var n=Ka();n&&(i=i.clone().transform(n,r));var a=Ja(i.getCenter(),ka(e,r)),s=Math.sqrt(a)-i.getRadius();return s*s}}var $=ka(e,r);return hc[0]=ka(t.segment[0],r),hc[1]=ka(t.segment[1],r),Qd($,hc)}function xh(e,t,r){var o=t.geometry;if(o.getType()===aa.CIRCLE&&t.index===Uc){var i=o,n=Ka();return n&&(i=i.clone().transform(n,r)),Ib(i.getClosestPoint(ka(e,r)),r)}var a=ka(e,r);return hc[0]=ka(t.segment[0],r),hc[1]=ka(t.segment[1],r),Ib(Sd(a,hc),r)}function Jn(){var e=Lc();return function(t,r){return e[aa.POINT]}}wd.default=Fn;var Xf={};var vk=Xf&&Xf.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Mn={SELECT:"select"},Nn=function(e){function t(t,r,i,o){var n=e.call(this,t)||this;return n.selected=r,n.deselected=i,n.mapBrowserEvent=o,n}return vk(t,e),t}(Ha),Ed={},Pn=function(e){function t(t){var r,i=e.call(this,{handleEvent:Qn})||this,o=t||{};if(i.boundAddFeature_=i.addFeature_.bind(i),i.boundRemoveFeature_=i.removeFeature_.bind(i),i.condition_=o.condition?o.condition:Ej,i.addCondition_=o.addCondition?o.addCondition:Dj,i.removeCondition_=o.removeCondition?o.removeCondition:Dj,i.toggleCondition_=o.toggleCondition?o.toggleCondition:ce,i.multi_=!!o.multi&&o.multi,i.filter_=o.filter?o.filter:Ia,i.hitTolerance_=o.hitTolerance?o.hitTolerance:0,i.style_=void 0!==o.style?o.style:Rn(),i.features_=o.features||new za,o.layers){if("function"==typeof o.layers)r=o.layers;else{var n=o.layers;r=function(e){return Vc(n,e)}}}else r=Ia;return i.layerFilter_=r,i.featureLayerAssociation_={},i}return vk(t,e),t.prototype.addFeatureLayerAssociation_=function(e,t){this.featureLayerAssociation_[ga(e)]=t},t.prototype.getFeatures=function(){return this.features_},t.prototype.getHitTolerance=function(){return this.hitTolerance_},t.prototype.getLayer=function(e){return this.featureLayerAssociation_[ga(e)]},t.prototype.setHitTolerance=function(e){this.hitTolerance_=e},t.prototype.setMap=function(t){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),e.prototype.setMap.call(this,t),t?(this.features_.addEventListener(ra.ADD,this.boundAddFeature_),this.features_.addEventListener(ra.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(ra.ADD,this.boundAddFeature_),this.features_.removeEventListener(ra.REMOVE,this.boundRemoveFeature_))},t.prototype.addFeature_=function(e){var t=e.element;this.style_&&this.applySelectedStyle_(t)},t.prototype.removeFeature_=function(e){var t=e.element;this.style_&&this.restorePreviousStyle_(t)},t.prototype.getStyle=function(){return this.style_},t.prototype.applySelectedStyle_=function(e){var t=ga(e);t in Ed||(Ed[t]=e.getStyle()),e.setStyle(this.style_)},t.prototype.restorePreviousStyle_=function(e){var r=ga(e),i=this.getMap().getInteractions().getArray().filter(function(r){return r instanceof t&&r.getStyle()&&-1!==r.getFeatures().getArray().indexOf(e)});i.length>0?e.setStyle(i[i.length-1].getStyle()):(e.setStyle(Ed[r]),delete Ed[r])},t.prototype.removeFeatureLayerAssociation_=function(e){delete this.featureLayerAssociation_[ga(e)]},t}(Ab);function Qn(e){if(!this.condition_(e))return!0;var t=this.addCondition_(e),r=this.removeCondition_(e),i=this.toggleCondition_(e),o=!t&&!r&&!i,n=e.map,a=this.getFeatures(),$=[],s=[];if(o){zc(this.featureLayerAssociation_),n.forEachFeatureAtPixel(e.pixel,function(e,t){if(this.filter_(e,t))return s.push(e),this.addFeatureLayerAssociation_(e,t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=a.getLength()-1;l>=0;--l){var u=a.item(l),p=s.indexOf(u);p>-1?s.splice(p,1):(a.remove(u),$.push(u))}0!==s.length&&a.extend(s)}else{n.forEachFeatureAtPixel(e.pixel,function(e,o){if(this.filter_(e,o))return!t&&!i||Vc(a.getArray(),e)?(r||i)&&Vc(a.getArray(),e)&&($.push(e),this.removeFeatureLayerAssociation_(e)):(s.push(e),this.addFeatureLayerAssociation_(e,o)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var c=$.length-1;c>=0;--c)a.remove($[c]);a.extend(s)}return(s.length>0||$.length>0)&&this.dispatchEvent(new Nn(Mn.SELECT,s,$,e)),!0}function Rn(){var e=Lc();return Pa(e[aa.POLYGON],e[aa.LINE_STRING]),Pa(e[aa.GEOMETRY_COLLECTION],e[aa.LINE_STRING]),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}Xf.default=Pn;var Of={};var Tn=Of&&Of.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Nj(e){return e.feature?e.feature:e.element?e.element:void 0}var bc=[],Wn=function(e){function t(t){var r=this,n=t||{},o=n;return o.handleDownEvent||(o.handleDownEvent=Ia),o.stopDown||(o.stopDown=Jb),(r=e.call(this,o)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new pd,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return Tn(t,e),t.prototype.addFeature=function(e,t){var r=void 0===t||t,n=ga(e),o=e.getGeometry();if(o){var i=this.SEGMENT_WRITERS_[o.getType()];i&&(this.indexedFeaturesExtents_[n]=o.getExtent(Fa()),i(e,o))}r&&(this.featureChangeListenerKeys_[n]=fa(e,ba.CHANGE,this.handleFeatureChange_,this))},t.prototype.forEachFeatureAdd_=function(e){this.addFeature(e)},t.prototype.forEachFeatureRemove_=function(e){this.removeFeature(e)},t.prototype.getFeatures_=function(){var e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e},t.prototype.handleEvent=function(t){var r=this.snapTo(t.pixel,t.coordinate,t.map);return r.snapped&&(t.coordinate=r.vertex.slice(0,2),t.pixel=r.vertexPixel),e.prototype.handleEvent.call(this,t)},t.prototype.handleFeatureAdd_=function(e){var t=Nj(e);this.addFeature(t)},t.prototype.handleFeatureRemove_=function(e){var t=Nj(e);this.removeFeature(t)},t.prototype.handleFeatureChange_=function(e){var t=e.target;if(this.handlingDownUpSequence){var r=ga(t);r in this.pendingFeatures_||(this.pendingFeatures_[r]=t)}else this.updateFeature_(t)},t.prototype.handleUpEvent=function(e){var t=df(this.pendingFeatures_);return t.length&&(t.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},t.prototype.removeFeature=function(e,t){var r=void 0===t||t,n=ga(e),o=this.indexedFeaturesExtents_[n];if(o){var i=this.rBush_,a=[];i.forEachInExtent(o,function(t){e===t.feature&&a.push(t)});for(var s=a.length-1;s>=0;--s)i.remove(a[s])}r&&(ja(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},t.prototype.setMap=function(t){var r=this.getMap(),n=this.featuresListenerKeys_,o=this.getFeatures_();r&&(n.forEach(ja),n.length=0,o.forEach(this.forEachFeatureRemove_.bind(this))),e.prototype.setMap.call(this,t),t&&(this.features_?n.push(fa(this.features_,ra.ADD,this.handleFeatureAdd_,this),fa(this.features_,ra.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(fa(this.source_,Ra.ADDFEATURE,this.handleFeatureAdd_,this),fa(this.source_,Ra.REMOVEFEATURE,this.handleFeatureRemove_,this)),o.forEach(this.forEachFeatureAdd_.bind(this)))},t.prototype.snapTo=function(e,t,r){var n=r.getCoordinateFromPixel([e[0]-this.pixelTolerance_,e[1]+this.pixelTolerance_]),o=r.getCoordinateFromPixel([e[0]+this.pixelTolerance_,e[1]-this.pixelTolerance_]),i=va([n,o]),a=this.rBush_.getInExtent(i);this.vertex_&&!this.edge_&&(a=a.filter(function(e){return e.feature.getGeometry().getType()!==aa.CIRCLE}));var s=!1,$=null,p=null;if(0===a.length)return{snapped:s,vertex:$,vertexPixel:p};for(var u,l=r.getView().getProjection(),h=ka(t,l),m=1/0,d=0;d<a.length;++d){var c=a[d];bc[0]=ka(c.segment[0],l),bc[1]=ka(c.segment[1],l);var g=Qd(h,bc);g<m&&(u=c,m=g)}var G=u.segment;if(this.vertex_&&!this.edge_){var v=r.getPixelFromCoordinate(G[0]),f=r.getPixelFromCoordinate(G[1]),_=Ja(e,v),y=Ja(e,f);Math.sqrt(Math.min(_,y))<=this.pixelTolerance_&&(s=!0,$=_>y?G[1]:G[0],p=r.getPixelFromCoordinate($))}else if(this.edge_){var N=u.feature.getGeometry().getType()===aa.CIRCLE;if(N){var W=u.feature.getGeometry(),x=Ka();x&&(W=W.clone().transform(x,l)),$=Ib(Io(h,W),l)}else bc[0]=ka(G[0],l),bc[1]=ka(G[1],l),$=Ib(Sd(h,bc),l);if(p=r.getPixelFromCoordinate($),Rd(e,p)<=this.pixelTolerance_&&(s=!0,this.vertex_&&!N)){v=r.getPixelFromCoordinate(G[0]),f=r.getPixelFromCoordinate(G[1]),_=Ja(p,v),y=Ja(p,f);Math.sqrt(Math.min(_,y))<=this.pixelTolerance_&&($=_>y?G[1]:G[0],p=r.getPixelFromCoordinate($))}}return s&&(p=[Math.round(p[0]),Math.round(p[1])]),{snapped:s,vertex:$,vertexPixel:p}},t.prototype.updateFeature_=function(e){this.removeFeature(e,!1),this.addFeature(e,!1)},t.prototype.writeCircleGeometry_=function(e,t){var r=this.getMap().getView().getProjection(),n=t,o=Ka();o&&(n=n.clone().transform(o,r));var i=dc(n);o&&i.transform(r,o);for(var a=i.getCoordinates()[0],s=0,$=a.length-1;s<$;++s){var p=a.slice(s,s+2),u={feature:e,segment:p};this.rBush_.insert(va(p),u)}},t.prototype.writeGeometryCollectionGeometry_=function(e,t){for(var r=t.getGeometriesArray(),n=0;n<r.length;++n){var o=this.SEGMENT_WRITERS_[r[n].getType()];o&&o(e,r[n])}},t.prototype.writeLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length-1;n<o;++n){var i=r.slice(n,n+2),a={feature:e,segment:i};this.rBush_.insert(va(i),a)}},t.prototype.writeMultiLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length-1;a<s;++a){var $=i.slice(a,a+2),p={feature:e,segment:$};this.rBush_.insert(va($),p)}},t.prototype.writeMultiPointGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n){var i=r[n],a={feature:e,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}},t.prototype.writeMultiPolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length;a<s;++a)for(var $=i[a],p=0,u=$.length-1;p<u;++p){var l=$.slice(p,p+2),h={feature:e,segment:l};this.rBush_.insert(va(l),h)}},t.prototype.writePointGeometry_=function(e,t){var r=t.getCoordinates(),n={feature:e,segment:[r,r]};this.rBush_.insert(t.getExtent(),n)},t.prototype.writePolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length-1;a<s;++a){var $=i.slice(a,a+2),p={feature:e,segment:$};this.rBush_.insert(va($),p)}},t}(Na);Of.default=Wn;var Fd={};var xj=Fd&&Fd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),Ef={TRANSLATESTART:"translatestart",TRANSLATING:"translating",TRANSLATEEND:"translateend"},Id=function(t){function e(e,r,a,n,o){var i=t.call(this,e)||this;return i.features=r,i.coordinate=a,i.startCoordinate=n,i.mapBrowserEvent=o,i}return xj(e,t),e}(Ha);Fd.TranslateEvent=Id;var _n=function(t){function e(e){var r,a=this,n=e||{};if((a=t.call(this,n)||this).lastCoordinate_=null,a.startCoordinate_=null,a.features_=void 0!==n.features?n.features:null,n.layers){if("function"==typeof n.layers)r=n.layers;else{var o=n.layers;r=function(t){return Vc(o,t)}}}else r=Ia;return a.layerFilter_=r,a.filter_=n.filter?n.filter:Ia,a.hitTolerance_=n.hitTolerance?n.hitTolerance:0,a.lastFeature_=null,a.addEventListener(qa(Zd.ACTIVE),a.handleActiveChanged_),a}return xj(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new za([this.lastFeature_]);return this.dispatchEvent(new Id(Ef.TRANSLATESTART,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new za([this.lastFeature_]);return this.dispatchEvent(new Id(Ef.TRANSLATEEND,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],a=e[1]-this.lastCoordinate_[1],n=this.features_||new za([this.lastFeature_]);n.forEach(function(t){var e=t.getGeometry();e.translate(r,a),t.setGeometry(e)}),this.lastCoordinate_=e,this.dispatchEvent(new Id(Ef.TRANSLATING,n,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||Vc(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Na);Fd.default=_n;var ao=Uf&&Uf.__extends||function(){var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e])})(t,e)};return function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),nj=function(r){function t(t){return(t=Da({},t)).controls||(t.controls=Wm()),t.interactions||(t.interactions=ol()),r.call(this,t)||this}return ao(t,r),t.prototype.createRenderer=function(){return new hg(this)},t}(He);Uf.default=nj;var co=.5;var hb=!0;var lf={};var hf={};var bd={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var io=hf&&hf.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t])})(e,t)};return function(e,t){function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),zi=function(r){function e(e){var t=this,o=e||{},n=Da({},o);return delete n.preload,delete n.useInterimTilesOnError,(t=r.call(this,n)||this).setPreload(void 0!==o.preload?o.preload:0),t.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),t}return io(e,r),e.prototype.getPreload=function(){return this.get(bd.PRELOAD)},e.prototype.setPreload=function(r){this.set(bd.PRELOAD,r)},e.prototype.getUseInterimTilesOnError=function(){return this.get(bd.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(r){this.set(bd.USE_INTERIM_TILES_ON_ERROR,r)},e}(Ve);hf.default=zi;var Qe={};var Ne=function(){function t(t,i,n,e){this.minX=t,this.maxX=i,this.minY=n,this.maxY=e}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,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=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 Ke(t,i,n,e,m){return void 0!==m?(m.minX=t,m.maxX=i,m.minY=n,m.maxY=e,m):new Ne(t,i,n,e)}var no=Qe&&Qe.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ge=function(e){function t(t){var r=e.call(this,t)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Fa(),r.tmpTileRange_=new Ne(0,0,0,0),r}return no(t,e),t.prototype.isDrawableTile=function(e){var t=this.getLayer(),r=e.getState(),i=t.getUseInterimTilesOnError();return r==ea.LOADED||r==ea.EMPTY||r==ea.ERROR&&!i},t.prototype.getTile=function(e,t,r,i){var o=i.pixelRatio,n=i.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(e,t,r,o,n);return s.getState()==ea.ERROR&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(ea.LOADED)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},t.prototype.loadedTileCallback=function(t,r,i){return!!this.isDrawableTile(i)&&e.prototype.loadedTileCallback.call(this,t,r,i)},t.prototype.prepareFrame=function(e){return!!this.getLayer().getSource()},t.prototype.renderFrame=function(e,t){var r=e.layerStatesArray[e.layerIndex],i=e.viewState,o=i.projection,n=i.resolution,a=i.center,s=i.rotation,l=e.pixelRatio,h=this.getLayer(),p=h.getSource(),$=p.getRevision(),d=p.getTileGridForProjection(o),u=d.getZForResolution(n,p.zDirection),c=d.getResolution(u),m=e.extent,g=r.extent&&sb(r.extent,o);g&&(m=Rc(m,sb(r.extent,o)));var T=p.getTilePixelRatio(l),f=Math.round(e.size[0]*T),v=Math.round(e.size[1]*T);if(s){var x=Math.round(Math.sqrt(f*f+v*v));f=x,v=x}var M=c*f/2/T,k=c*v/2/T,y=[a[0]-M,a[1]-k,a[0]+M,a[1]+k],R=d.getTileRangeForExtentAndZ(m,u),_={};_[u]={};var w=this.createLoadedTileFinder(p,o,_),E=this.tmpExtent,S=this.tmpTileRange_;this.newTiles_=!1;for(var C=R.minX;C<=R.maxX;++C)for(var j=R.minY;j<=R.maxY;++j){var P=this.getTile(u,C,j,e);if(this.isDrawableTile(P)){var b=ga(this);if(P.getState()==ea.LOADED){_[u][P.tileCoord.toString()]=P;var I=P.inTransition(b);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(P)||(this.newTiles_=!0)}if(1===P.getAlpha(b,e.time))continue}var O=d.getTileCoordChildTileRange(P.tileCoord,S,E),q=!1;O&&(q=w(u+1,O)),q||d.forEachTileCoordParentTileRange(P.tileCoord,w,S,E)}var A=c/n;mb(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/T,1/T,s,-f/2,-v/2);var L=jq(this.pixelTransform);this.useContainer(t,L,r.opacity);var U=this.context,D=U.canvas;Hf(this.inversePixelTransform,this.pixelTransform),mb(this.tempTransform_,f/2,v/2,A,A,0,-f/2,-v/2),D.width!=f||D.height!=v?(D.width=f,D.height=v):this.containerReused||U.clearRect(0,0,f,v),g&&this.clipUnrotated(U,e,g),this.preRender(U,e),this.renderedTiles.length=0;var F,z,Y,Z=Object.keys(_).map(Number);Z.sort(tb),1!==r.opacity||this.containerReused&&!p.getOpaque(e.viewState.projection)?(F=[],z=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var X=Z[K],G=p.getTilePixelSize(X,l,o),Q=d.getResolution(X)/c,N=G[0]*Q*A,B=G[1]*Q*A,H=d.getTileCoordForCoordAndZ(Ya(y),X),J=d.getTileCoordExtent(H),V=pa(this.tempTransform_,[T*(J[0]-y[0])/c,T*(y[3]-J[3])/c]),W=T*p.getGutterForProjection(o),ee=_[X];for(var te in ee){var re=(P=ee[te]).tileCoord,ie=V[0]-(H[1]-re[1])*N,oe=Math.round(ie+N),ne=V[1]-(H[2]-re[2])*B,ae=Math.round(ne+B),se=oe-(C=Math.round(ie)),le=ae-(j=Math.round(ne)),he=u===X;if(!(I=he&&1!==P.getAlpha(ga(this),e.time)))if(F){U.save(),Y=[C,j,C+se,j,C+se,j+le,C,j+le];for(var pe=0,$e=F.length;pe<$e;++pe)if(u!==X&&X<z[pe]){var de=F[pe];U.beginPath(),U.moveTo(Y[0],Y[1]),U.lineTo(Y[2],Y[3]),U.lineTo(Y[4],Y[5]),U.lineTo(Y[6],Y[7]),U.moveTo(de[6],de[7]),U.lineTo(de[4],de[5]),U.lineTo(de[2],de[3]),U.lineTo(de[0],de[1]),U.clip()}F.push(Y),z.push(X)}else U.clearRect(C,j,se,le);this.drawTileImage(P,e,C,j,se,le,W,he,r.opacity),F&&!I&&U.restore(),this.renderedTiles.push(P),this.updateUsedTiles(e.usedTiles,p,P)}}return this.renderedRevision=$,this.renderedResolution=c,this.extentChanged=!this.renderedExtent_||!mc(this.renderedExtent_,y),this.renderedExtent_=y,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(e,p,d,l,o,m,u,h.getPreload()),this.scheduleExpireCache(e,p),this.postRender(U,e),r.extent&&U.restore(),L!==D.style.transform&&(D.style.transform=L),this.container},t.prototype.drawTileImage=function(e,t,r,i,o,n,a,s,l){var h=this.getTileImage(e);if(h){var p=ga(this),$=s?e.getAlpha(p,t.time):1,d=l*$,u=d!==this.context.globalAlpha;u&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(h,a,a,h.width-2*a,h.height-2*a,r,i,o,n),u&&this.context.restore(),1!==$?t.animate=!0:s&&e.endTransition(p)}},t.prototype.getImage=function(){var e=this.context;return e?e.canvas:null},t.prototype.getTileImage=function(e){return e.getImage()},t.prototype.scheduleExpireCache=function(e,t){if(t.canExpireCache()){var r=function(e,t,r){var i=ga(e);i in r.usedTiles&&e.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,t);e.postRenderFunctions.push(r)}},t.prototype.updateUsedTiles=function(e,t,r){var i=ga(t);i in e||(e[i]={}),e[i][r.getKey()]=!0},t.prototype.manageTilePyramid=function(e,t,r,i,o,n,a,s,l){var h=ga(t);h in e.wantedTiles||(e.wantedTiles[h]={});var p,$,d,u,c,m,g=e.wantedTiles[h],T=e.tileQueue;for(m=r.getMinZoom();m<=a;++m)for($=r.getTileRangeForExtentAndZ(n,m,$),d=r.getResolution(m),u=$.minX;u<=$.maxX;++u)for(c=$.minY;c<=$.maxY;++c)a-m<=s?((p=t.getTile(m,u,c,i,o)).getState()==ea.IDLE&&(g[p.getKey()]=!0,T.isKeyQueued(p.getKey())||T.enqueue([p,h,r.getTileCoordCenter(p.tileCoord),d])),void 0!==l&&l(p)):t.useTile(m,u,c,o)},t}(pf);Ge.prototype.getLayer,Qe.default=Ge;var po=lf&&lf.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),Jh=function(e){function r(r){return e.call(this,r)||this}return po(r,e),r.prototype.createRenderer=function(){return new Ge(this)},r}(zi);lf.default=Jh;function ro(e,r){var t=/\{z\}/g,p=/\{x\}/g,o=/\{y\}/g,$=/\{-y\}/g;return function(n,a,l){return n?e.replace(t,n[0].toString()).replace(p,n[1].toString()).replace(o,n[2].toString()).replace($,function(){var e=n[0],t=r.getFullTileRange(e);return ia(t,55),(t.getHeight()-n[2]-1).toString()}):void 0}}function so(e,r){for(var t=e.length,p=new Array(t),o=0;o<t;++o)p[o]=ro(e[o],r);return to(p)}function to(e){return 1===e.length?e[0]:function(r,t,p){if(r){var o=Ao(r),$=ac(o,e.length);return e[$](r,t,p)}}}function uo(e,r,t){}function vo(e){var r=[],t=/\{([a-z])-([a-z])\}/.exec(e);if(t){var p=t[1].charCodeAt(0),o=t[2].charCodeAt(0),$=void 0;for($=p;$<=o;++$)r.push(e.replace(t[0],String.fromCharCode($)));return r}if(t=/\{(\d+)-(\d+)\}/.exec(e)){for(var n=parseInt(t[2],10),a=parseInt(t[1],10);a<=n;a++)r.push(e.replace(t[0],a.toString()));return r}return r.push(e),r}function tk(e,t,$,r){return void 0!==r?(r[0]=e,r[1]=t,r[2]=$,r):[e,t,$]}function Od(e,t,$){return e+"/"+t+"/"+$}function Oj(e){return Od(e[0],e[1],e[2])}function zo(e){return e.split("/").map(Number)}function Ao(e){return(e[1]<<e[0])+e[2]}function Bo(e,t){var $=e[0],r=e[1],a=e[2];if(t.getMinZoom()>$||$>t.getMaxZoom())return!1;var n,o=t.getExtent();return!(n=o?t.getTileRangeForExtentAndZ(o,$):t.getFullTileRange($))||n.containsXY(r,a)}var Kg={};var qg={};var lg={};var Fo=lg&&lg.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zf=function(t){function e(e,i,r){var n=t.call(this)||this,o=r||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.hifi=!0,n.key="",n.transition_=void 0===o.transition?250:o.transition,n.transitionStarts_={},n}return Fo(e,t),e.prototype.changed=function(){this.dispatchEvent(ba.CHANGE)},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()==ea.LOADED)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()==ea.LOADED){t.interimTile=null;break}t.getState()==ea.LOADING?e=t:t.getState()==ea.IDLE?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!==ea.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){ca()},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 r=e-i+1e3/60;return r>=this.transition_?1:_i(r/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}(Nb);lg.default=Zf;var Ho=qg&&qg.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Di=function(t){function e(e,i,s,r,n,a){var o=t.call(this,e,i,a)||this;return o.crossOrigin_=r,o.src_=s,o.image_=new Image,null!==r&&(o.image_.crossOrigin=r),o.unlisten_=null,o.tileLoadFunction_=n,o}return Ho(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=ea.ERROR,this.unlistenImage_(),this.image_=Jo(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=ea.LOADED:this.state=ea.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==ea.ERROR&&(this.state=ea.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ea.IDLE&&(this.state=ea.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=fd(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Zf);function Jo(){var t=La(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}qg.default=Di;var If={};var Lo=function(){function e(e){this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},e.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},e.prototype.forEach=function(e){for(var t=this.oldest_;t;)e(t.value_,t.key_,this),t=t.newer},e.prototype.get=function(e,t){var r=this.entries_[e];return ia(void 0!==r,15),r===this.newest_?r.value_:(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r,r.value_)},e.prototype.remove=function(e){var t=this.entries_[e];return ia(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var e,t=new Array(this.count_),r=0;for(e=this.newest_;e;e=e.older)t[r++]=e.key_;return t},e.prototype.getValues=function(){var e,t=new Array(this.count_),r=0;for(e=this.newest_;e;e=e.older)t[r++]=e.value_;return t},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},e.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},e.prototype.set=function(e,t){ia(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},e.prototype.setSize=function(e){this.highWaterMark=e},e}();var Mo=If&&If.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Df=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Mo(t,e),t.prototype.expireCache=function(e){for(;this.canExpireCache();){if(this.peekLast().getKey()in e)break;this.pop().release()}},t.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var e=this.peekFirstKey(),t=zo(e)[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Oj(e.tileCoord)),e.release())}.bind(this))}},t}(Lo);If.default=Df;var Cf={};function Po(e,t,r,a){var o=rh(r,t,e),$=Vg(t,a,r),n=t.getMetersPerUnit();void 0!==n&&($*=n);var i=e.getMetersPerUnit();void 0!==i&&($/=i);var l=e.getExtent();if(!l||xi(l,o)){var s=Vg(e,$,o)/$;isFinite(s)&&s>0&&($/=s)}return $}function yf(e,t,r,a){var o=r-e,$=a-t,n=Math.sqrt(o*o+$*$);return[Math.round(r+o/n),Math.round(a+$/n)]}function Ro(e,t,r,a,o,$,n,i,l,s,c){var p=La(Math.round(r*e),Math.round(r*t));if(0===l.length)return p.canvas;p.scale(r,r);var u=Fa();l.forEach(function(e,t,r){Fe(u,e.extent)});var g=ta(u),v=Va(u),U=La(Math.round(r*g/a),Math.round(r*v/a)),m=r/a;l.forEach(function(e,t,r){var a=e.extent[0]-u[0],o=-(e.extent[3]-u[3]),$=ta(e.extent),n=Va(e.extent);U.drawImage(e.image,s,s,e.image.width-2*s,e.image.height-2*s,a*m,o*m,$*m,n*m)});var h=Ya(n);return i.getTriangles().forEach(function(e,t,o){var n=e.source,i=e.target,l=n[0][0],s=n[0][1],c=n[1][0],g=n[1][1],v=n[2][0],m=n[2][1],d=(i[0][0]-h[0])/$,f=-(i[0][1]-h[1])/$,x=(i[1][0]-h[0])/$,P=-(i[1][1]-h[1])/$,C=(i[2][0]-h[0])/$,M=-(i[2][1]-h[1])/$,T=l,E=s;l=0,s=0,c-=T,g-=E,v-=T,m-=E;var j=ip([[c,g,0,0,x-d],[v,m,0,0,C-d],[0,0,c,g,P-f],[0,0,v,m,M-f]]);if(j){p.save(),p.beginPath();var q=(d+x+C)/3,R=(f+P+M)/3,S=yf(q,R,d,f),b=yf(q,R,x,P),k=yf(q,R,C,M);p.moveTo(b[0],b[1]),p.lineTo(S[0],S[1]),p.lineTo(k[0],k[1]),p.clip(),p.transform(j[0],j[2],j[1],j[3],d,f),p.translate(u[0]-T,u[3]-E),p.scale(a/r,-a/r),p.drawImage(U.canvas,0,0),p.restore()}}),c&&(p.save(),p.strokeStyle="black",p.lineWidth=1,i.getTriangles().forEach(function(e,t,r){var a=e.target,o=(a[0][0]-h[0])/$,n=-(a[0][1]-h[1])/$,i=(a[1][0]-h[0])/$,l=-(a[1][1]-h[1])/$,s=(a[2][0]-h[0])/$,c=-(a[2][1]-h[1])/$;p.beginPath(),p.moveTo(i,l),p.lineTo(o,n),p.lineTo(s,c),p.closePath(),p.stroke()}),p.restore()),p.canvas}var So=10,Ph=.25,Uo=function(){function t(t,i,r,o,e,s){this.sourceProj_=t,this.targetProj_=i;var a={},n=ad(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return a[i]||(a[i]=n(t)),a[i]},this.maxSourceExtent_=o,this.errorThresholdSquared_=e*e,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&ta(o)==ta(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ta(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ta(this.targetProj_.getExtent()):null;var h=Ya(r),$=Ob(r),u=Sb(r),d=vb(r),_=this.transformInv_(h),c=this.transformInv_($),l=this.transformInv_(u),p=this.transformInv_(d),m=So+(s?Math.max(0,Math.ceil(Math.log2(Vd(r)/(s*s*256*256)))):0);if(this.addQuad_(h,$,u,d,_,c,l,p,m),this.wrapsXInSource_){var f=1/0;this.triangles_.forEach(function(t,i,r){f=Math.min(f,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])-f>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-f>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-f>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-f>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var r=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-r<this.sourceWorldWidth_/2&&(t.source=i)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,i,r,o,e,s){this.triangles_.push({source:[o,e,s],target:[t,i,r]})},t.prototype.addQuad_=function(t,i,r,o,e,s,a,n,h){var $=va([e,s,a,n]),u=this.sourceWorldWidth_?ta($)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,_=this.sourceProj_.canWrapX()&&u>.5&&u<1,c=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var l=va([t,i,r,o]);c=ta(l)/this.targetWorldWidth_>Ph||c}!_&&this.sourceProj_.isGlobal()&&u&&(c=u>Ph||c)}if(c||!this.maxSourceExtent_||Ga($,this.maxSourceExtent_)){if(!(c||isFinite(e[0])&&isFinite(e[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(n[0])&&isFinite(n[1]))){if(!(h>0))return;c=!0}if(h>0){if(!c){var p=[(t[0]+r[0])/2,(t[1]+r[1])/2],m=this.transformInv_(p),f=void 0;if(_)f=(ac(e[0],d)+ac(a[0],d))/2-ac(m[0],d);else f=(e[0]+a[0])/2-m[0];var g=(e[1]+a[1])/2-m[1];c=f*f+g*g>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var W=[(i[0]+r[0])/2,(i[1]+r[1])/2],R=this.transformInv_(W),B=[(o[0]+t[0])/2,(o[1]+t[1])/2],Y=this.transformInv_(B);this.addQuad_(t,i,W,B,e,s,R,Y,h-1),this.addQuad_(B,W,r,o,Y,R,a,n,h-1)}else{var v=[(t[0]+i[0])/2,(t[1]+i[1])/2],I=this.transformInv_(v),x=[(r[0]+o[0])/2,(r[1]+o[1])/2],E=this.transformInv_(x);this.addQuad_(t,v,x,o,e,I,E,n,h-1),this.addQuad_(v,i,r,x,I,s,a,E,h-1)}return}}if(_){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,r,o,e,a,n),this.addTriangle_(t,i,r,e,s,a)}},t.prototype.calculateSourceExtent=function(){var t=Fa();return this.triangles_.forEach(function(i,r,o){var e=i.source;nc(t,e[0]),nc(t,e[1]),nc(t,e[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var Vo=Cf&&Cf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Mh=function(t){function e(e,r,i,o,l,s,$,n,a,d,p){var u=t.call(this,l,ea.IDLE)||this;u.renderEdges_=void 0!==p&&p,u.pixelRatio_=$,u.gutter_=n,u.canvas_=null,u.sourceTileGrid_=r,u.targetTileGrid_=o,u.wrappedTileCoord_=s||l,u.sourceTiles_=[],u.sourcesListenerKeys_=null,u.sourceZ_=0;var c=o.getTileCoordExtent(u.wrappedTileCoord_),_=u.targetTileGrid_.getExtent(),O=u.sourceTileGrid_.getExtent(),T=_?Rc(c,_):c;if(0===Vd(T))return u.state=ea.EMPTY,u;var h=e.getExtent();h&&(O=O?Rc(O,h):h);var g=o.getResolution(u.wrappedTileCoord_[0]),W=Qb(T),m=Po(e,i,W,g);if(!isFinite(m)||m<=0)return u.state=ea.EMPTY,u;var f=void 0!==d?d:co;if(u.triangulation_=new Uo(e,i,T,O,m*f,g),0===u.triangulation_.getTriangles().length)return u.state=ea.EMPTY,u;u.sourceZ_=r.getZForResolution(m);var E=u.triangulation_.calculateSourceExtent();if(O&&(e.canWrapX()?(E[1]=wa(E[1],O[1],O[3]),E[3]=wa(E[3],O[1],O[3])):E=Rc(E,O)),Vd(E)){for(var v=r.getTileRangeForExtentAndZ(E,u.sourceZ_),S=v.minX;S<=v.maxX;S++)for(var x=v.minY;x<=v.maxY;x++){var y=a(u.sourceZ_,S,x,$);y&&u.sourceTiles_.push(y)}0===u.sourceTiles_.length&&(u.state=ea.EMPTY)}else u.state=ea.EMPTY;return u}return Vo(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,i){e&&e.getState()==ea.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=ea.ERROR;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),i="number"==typeof r?r:r[0],o="number"==typeof r?r:r[1],l=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),$=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Ro(i,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),l,$,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=ea.LOADED}this.changed()},e.prototype.load=function(){if(this.state==ea.IDLE){this.state=ea.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,i){var o=e.getState();if(o==ea.IDLE||o==ea.LOADING){t++;var l=fa(e,ba.CHANGE,function(r){var i=e.getState();i!=ea.LOADED&&i!=ea.ERROR&&i!=ea.EMPTY||(ja(l),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(l)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,r){t.getState()==ea.IDLE&&t.load()}),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(ja),this.sourcesListenerKeys_=null},e}(Zf);Cf.default=Mh;var xf={};var Ud={};function rj(e){var r=e.getDefaultTileGrid();return r||(r=cp(e),e.setDefaultTileGrid(r)),r}function $o(e,r,t){var x=r[0],o=e.getTileCoordCenter(r),$=kh(t);if(xi($,o))return r;var i=ta($),n=Math.ceil(($[0]-o[0])/i);return o[0]+=i*n,e.getTileCoordForCoordAndZ(o,x)}function _o(e,r,t,x){var o=void 0!==x?x:Yc.TOP_LEFT,$=oj(e,r,t);return new $h({extent:e,origin:Yo(e,o),resolutions:$,tileSize:t})}function ap(e){var r=e||{},t=r.extent||ua("EPSG:3857").getExtent(),x={extent:t,minZoom:r.minZoom,tileSize:r.tileSize,resolutions:oj(t,r.maxZoom,r.tileSize,r.maxResolution)};return new $h(x)}function oj(e,r,t,x){for(var o=void 0!==r?r:pp,$=Va(e),i=ta(e),n=xb(void 0!==t?t:zf),E=x>0?x:Math.max(i/n[0],$/n[1]),p=o+1,R=new Array(p),a=0;a<p;++a)R[a]=E/Math.pow(2,a);return R}function cp(e,r,t,x){return _o(kh(e),r,t,x)}function kh(e){var r=(e=ua(e)).getExtent();if(!r){var t=180*bb[Ca.DEGREES]/e.getMetersPerUnit();r=Sa(-t,-t,t,t)}return r}var ep=[0,0,0],$h=function(){function t(t){var i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,ia(Sp(this.resolutions_,function(t,i){return i-t},!0),17),!t.origins)for(var e=0,o=this.resolutions_.length-1;e<o;++e)if(i){if(this.resolutions_[e]/this.resolutions_[e+1]!==i){i=void 0;break}}else i=this.resolutions_[e]/this.resolutions_[e+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,ia(this.origins_.length==this.resolutions_.length,20));var r=t.extent;void 0===r||this.origin_||this.origins_||(this.origin_=Ya(r)),ia(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,ia(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:zf,ia(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==r?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,i){return new Ne(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):r&&this.calculateTileRanges_(r)}return t.prototype.forEachTileCoord=function(t,i,e){for(var o=this.getTileRangeForExtentAndZ(t,i),r=o.minX,n=o.maxX;r<=n;++r)for(var s=o.minY,l=o.maxY;s<=l;++s)e([i,r,s])},t.prototype.forEachTileCoordParentTileRange=function(t,i,e,o){var r,n,s,l=null,p=t[0]-1;for(2===this.zoomFactor_?(n=t[1],s=t[2]):l=this.getTileCoordExtent(t,o);p>=this.minZoom;){if(2===this.zoomFactor_?(n=Math.floor(n/2),s=Math.floor(s/2),r=Ke(n,n,s,s,e)):r=this.getTileRangeForExtentAndZ(l,p,e),i(p,r))return!0;--p}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,i,e){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],r=2*t[2];return Ke(o,o+1,r,r+1,i)}var n=this.getTileCoordExtent(t,e);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null},t.prototype.getTileRangeExtent=function(t,i,e){var o=this.getOrigin(t),r=this.getResolution(t),n=xb(this.getTileSize(t),this.tmpSize_),s=o[0]+i.minX*n[0]*r,l=o[0]+(i.maxX+1)*n[0]*r,p=o[1]+i.minY*n[1]*r,h=o[1]+(i.maxY+1)*n[1]*r;return Sa(s,p,l,h,e)},t.prototype.getTileRangeForExtentAndZ=function(t,i,e){var o=ep;this.getTileCoordForXYAndZ_(t[0],t[3],i,!1,o);var r=o[1],n=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],i,!0,o),Ke(r,o[1],n,o[2],e)},t.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]),e=this.getResolution(t[0]),o=xb(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*o[0]*e,i[1]-(t[2]+.5)*o[1]*e]},t.prototype.getTileCoordExtent=function(t,i){var e=this.getOrigin(t[0]),o=this.getResolution(t[0]),r=xb(this.getTileSize(t[0]),this.tmpSize_),n=e[0]+t[1]*r[0]*o,s=e[1]-(t[2]+1)*r[1]*o,l=n+r[0]*o,p=s+r[1]*o;return Sa(n,s,l,p,i)},t.prototype.getTileCoordForCoordAndResolution=function(t,i,e){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,e)},t.prototype.getTileCoordForXYAndResolution_=function(t,i,e,o,r){var n=this.getZForResolution(e),s=e/this.getResolution(n),l=this.getOrigin(n),p=xb(this.getTileSize(n),this.tmpSize_),h=o?.5:0,a=o?.5:0,u=Math.floor((t-l[0])/e+h),$=Math.floor((l[1]-i)/e+a),g=s*u/p[0],d=s*$/p[1];return o?(g=Math.ceil(g)-1,d=Math.ceil(d)-1):(g=Math.floor(g),d=Math.floor(d)),tk(n,g,d,r)},t.prototype.getTileCoordForXYAndZ_=function(t,i,e,o,r){var n=this.getOrigin(e),s=this.getResolution(e),l=xb(this.getTileSize(e),this.tmpSize_),p=o?.5:0,h=o?.5:0,a=Math.floor((t-n[0])/s+p),u=Math.floor((n[1]-i)/s+h),$=a/l[0],g=u/l[1];return o?($=Math.ceil($)-1,g=Math.ceil(g)-1):($=Math.floor($),g=Math.floor(g)),tk(e,$,g,r)},t.prototype.getTileCoordForCoordAndZ=function(t,i,e){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,e)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},t.prototype.getZForResolution=function(t,i){var e=Af(this.resolutions_,t,i||0);return wa(e,this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var i=this.resolutions_.length,e=new Array(i),o=this.minZoom;o<i;++o)e[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=e},t}();var Sh=Ud&&Ud.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qh=function(e){function t(t){var i=e.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX})||this;i.opaque_=void 0!==t.opaque&&t.opaque,i.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,i.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;var r=[256,256],o=t.tileGrid;o&&xb(o.getTileSize(o.getMinZoom()),r);var n="undefined"!=typeof screen,a=n?screen.availWidth||screen.width:1920,p=n?screen.availHeight||screen.height:1080,c=4*Math.ceil(a/r[0])*Math.ceil(p/r[1]);return i.tileCache=new Df(Math.max(c,t.cacheSize||0)),i.tmpSize=[0,0],i.key_=t.key||"",i.tileOptions={transition:t.transition},i.zDirection=t.zDirection?t.zDirection:0,i}return Sh(t,e),t.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},t.prototype.expireCache=function(e,t){var i=this.getTileCacheForProjection(e);i&&i.expireCache(t)},t.prototype.forEachLoadedTile=function(e,t,i,r){var o=this.getTileCacheForProjection(e);if(!o)return!1;for(var n,a,p,c=!0,l=i.minX;l<=i.maxX;++l)for(var $=i.minY;$<=i.maxY;++$)a=Od(t,l,$),p=!1,o.containsKey(a)&&(p=(n=o.get(a)).getState()===ea.LOADED)&&(p=!1!==r(n)),p||(c=!1);return c},t.prototype.getGutterForProjection=function(e){return 0},t.prototype.getKey=function(){return this.key_},t.prototype.setKey=function(e){this.key_!==e&&(this.key_=e,this.changed())},t.prototype.getOpaque=function(e){return this.opaque_},t.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},t.prototype.getTile=function(e,t,i,r,o){return ca()},t.prototype.getTileGrid=function(){return this.tileGrid},t.prototype.getTileGridForProjection=function(e){return this.tileGrid?this.tileGrid:rj(e)},t.prototype.getTileCacheForProjection=function(e){var t=this.getProjection();return t&&!Kb(t,e)?null:this.tileCache},t.prototype.getTilePixelRatio=function(e){return this.tilePixelRatio_},t.prototype.getTilePixelSize=function(e,t,i){var r=this.getTileGridForProjection(i),o=this.getTilePixelRatio(t),n=xb(r.getTileSize(e),this.tmpSize);return 1==o?n:$m(n,o,this.tmpSize)},t.prototype.getTileCoordForTileUrlFunction=function(e,t){var i=void 0!==t?t:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=$o(r,e,i)),Bo(e,r)?e:null},t.prototype.clear=function(){this.tileCache.clear()},t.prototype.refresh=function(){this.clear(),e.prototype.refresh.call(this)},t.prototype.useTile=function(e,t,i,r){},t}(Ie),Ck=function(e){function t(t,i){var r=e.call(this,t)||this;return r.tile=i,r}return Sh(t,e),t}(Ha);Ud.TileSourceEvent=Ck,Ud.default=Qh;var Ff={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var kp=xf&&xf.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tj=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,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.generateTileUrlFunction_=!e.tileUrlFunction,i.tileLoadFunction=e.tileLoadFunction,i.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(i):uo,i.urls=null,e.urls?i.setUrls(e.urls):e.url&&i.setUrl(e.url),i.tileLoadingKeys_={},i}return kp(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,r=ga(i),n=i.getState();n==ea.LOADING?(this.tileLoadingKeys_[r]=!0,e=Ff.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=n==ea.ERROR?Ff.TILELOADERROR:n==ea.LOADED?Ff.TILELOADEND:void 0),null!=e&&this.dispatchEvent(new Ck(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=vo(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(so(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,i){var r=Od(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(Qh);xf.default=Tj;var mp=Kg&&Kg.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Aj=function(e){function t(t){var i=e.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:op,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return i.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,i.tileClass=void 0!==t.tileClass?t.tileClass:Di,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,i.renderReprojectionEdges_=!1,i}return mp(t,e),t.prototype.canExpireCache=function(){if(!hb)return e.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},t.prototype.expireCache=function(t,i){if(hb){var r=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==r?i:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==r?i:{})}}else e.prototype.expireCache.call(this,t,i)},t.prototype.getGutterForProjection=function(e){return hb&&this.getProjection()&&e&&!Kb(this.getProjection(),e)?0:this.getGutter()},t.prototype.getGutter=function(){return 0},t.prototype.getOpaque=function(t){return!(hb&&this.getProjection()&&t&&!Kb(this.getProjection(),t))&&e.prototype.getOpaque.call(this,t)},t.prototype.getTileGridForProjection=function(t){if(!hb)return e.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(!this.tileGrid||i&&!Kb(i,t)){var r=ga(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=rj(t)),this.tileGridForProjection[r]}return this.tileGrid},t.prototype.getTileCacheForProjection=function(t){if(!hb)return e.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||Kb(i,t))return this.tileCache;var r=ga(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Df(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},t.prototype.createTile_=function(e,t,i,r,o,n){var l=[e,t,i],c=this.getTileCoordForTileUrlFunction(l,o),a=c?this.tileUrlFunction(c,r,o):void 0,u=new this.tileClass(l,void 0!==a?ea.IDLE:ea.EMPTY,void 0!==a?a:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=n,u.addEventListener(ba.CHANGE,this.handleTileChange.bind(this)),u},t.prototype.getTile=function(e,t,i,r,o){var n=this.getProjection();if(hb&&n&&o&&!Kb(n,o)){var l=this.getTileCacheForProjection(o),c=[e,t,i],a=void 0,u=Oj(c);l.containsKey(u)&&(a=l.get(u));var s=this.getKey();if(a&&a.key==s)return a;var $=this.getTileGridForProjection(n),p=this.getTileGridForProjection(o),h=this.getTileCoordForTileUrlFunction(c,o),d=new Mh(n,$,o,p,c,h,this.getTilePixelRatio(r),this.getGutter(),function(e,t,i,r){return this.getTileInternal(e,t,i,r,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return d.key=s,a?(d.interimTile=a,d.refreshInterimChain(),l.replace(u,d)):l.set(u,d),d}return this.getTileInternal(e,t,i,r,n||o)},t.prototype.getTileInternal=function(e,t,i,r,o){var n=null,l=Od(e,t,i),c=this.getKey();if(this.tileCache.containsKey(l)){if((n=this.tileCache.get(l)).key!=c){var a=n;n=this.createTile_(e,t,i,r,o,c),a.getState()==ea.IDLE?n.interimTile=a.interimTile:n.interimTile=a,n.refreshInterimChain(),this.tileCache.replace(l,n)}}else n=this.createTile_(e,t,i,r,o,c),this.tileCache.set(l,n);return n},t.prototype.setRenderReprojectionEdges=function(e){if(hb&&this.renderReprojectionEdges_!=e){for(var t in this.renderReprojectionEdges_=e,this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}},t.prototype.setTileGridForProjection=function(e,t){if(hb){var i=ua(e);if(i){var r=ga(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}},t}(Tj);function op(e,t){e.getImage().src=t}Kg.default=Aj;var sf={};var qp=sf&&sf.__extends||function(){var t=function(o,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])})(o,r)};return function(o,r){function e(){this.constructor=o}t(o,r),o.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),Wi=function(t){function o(o){var r=o||{},e=void 0!==r.projection?r.projection:"EPSG:3857",i=void 0!==r.tileGrid?r.tileGrid:ap({extent:kh(e),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,opaque:r.opaque,projection:e,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return qp(o,t),o}(Aj);sf.default=Wi;var $d={};var tp=$d&&$d.__extends||function(){var o=function(t,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var r in t)t.hasOwnProperty(r)&&(o[r]=t[r])})(t,r)};return function(t,r){function e(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),Ch="&#169; <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors.";$d.ATTRIBUTION=Ch;var vh=function(o){function t(t){var r,e=t||{};r=void 0!==e.attributions?e.attributions:[Ch];var n=void 0!==e.crossOrigin?e.crossOrigin:"anonymous",i=void 0!==e.url?e.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return o.call(this,{attributions:r,cacheSize:e.cacheSize,crossOrigin:n,opaque:void 0===e.opaque||e.opaque,maxZoom:void 0!==e.maxZoom?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,url:i,wrapX:e.wrapX,attributionsCollapsible:!1})||this}return tp(t,o),t}(Wi);$d.default=vh;var wp=!0;try{new ImageData(10,10)}catch(_){wp=!1}var xp=document.createElement("canvas").getContext("2d");function yp(a,t,e){if(wp)return new ImageData(a,t,e);var $=xp.createImageData(t,e);return $.data.set(a),$}var zp=yp;var Ap=zp;function Ui(e){var t=!0;try{new ImageData(10,10)}catch(a){t=!1}function r(e,r,a){return t?new ImageData(e,r,a):{data:e,width:r,height:a}}return function(t){var a,n,i=t.buffers,s=t.meta,o=t.imageOps,u=t.width,h=t.height,l=i.length,f=i[0].byteLength;if(o){var p=new Array(l);for(n=0;n<l;++n)p[n]=r(new Uint8ClampedArray(i[n]),u,h);a=e(p,s).data}else{a=new Uint8ClampedArray(f);var $=new Array(l),c=new Array(l);for(n=0;n<l;++n)$[n]=new Uint8ClampedArray(i[n]),c[n]=[0,0,0,0];for(var _=0;_<f;_+=4){for(var v=0;v<l;++v){var g=$[v];c[v][0]=g[_],c[v][1]=g[_+1],c[v][2]=g[_+2],c[v][3]=g[_+3]}var d=e(c,s);a[_]=d[0],a[_+1]=d[1],a[_+2]=d[2],a[_+3]=d[3]}}return a.buffer}}function Cp(e,t){var r=Object.keys(e.lib||{}).map(function(t){return"var "+t+" = "+e.lib[t].toString()+";"}).concat(["var __minion__ = ("+Ui.toString()+")(",e.operation.toString(),");","self.addEventListener(\"message\", function(event) {"," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),a=new Blob(r,{type:"text/javascript"}),n=URL.createObjectURL(a),i=new Worker(n);return i.addEventListener("message",t),i}function Dp(e,t){var r=Ui(e.operation);return{postMessage:function(e){setTimeout(function(){t({data:{buffer:r(e),meta:e.meta}})},0)}}}function pc(e){var t;this._imageOps=!!e.imageOps;var r=[];if(t=0===e.threads?0:this._imageOps?1:e.threads||1)for(var a=0;a<t;++a)r[a]=Cp(e,this._onWorkerMessage.bind(this,a));else r[0]=Dp(e,this._onWorkerMessage.bind(this,0));this._workers=r,this._queue=[],this._maxQueueLength=e.queue||1/0,this._running=0,this._dataLookup={},this._job=null}pc.prototype.process=function(e,t,r){this._enqueue({inputs:e,meta:t,callback:r}),this._dispatch()},pc.prototype.destroy=function(){for(var e in this)this[e]=null;this._destroyed=!0},pc.prototype._enqueue=function(e){for(this._queue.push(e);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},pc.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var e=this._job=this._queue.shift(),t=e.inputs[0].width,r=e.inputs[0].height,a=e.inputs.map(function(e){return e.data.buffer}),n=this._workers.length;if(this._running=n,1===n)this._workers[0].postMessage({buffers:a,meta:e.meta,imageOps:this._imageOps,width:t,height:r},a);else for(var i=e.inputs[0].data.length,s=4*Math.ceil(i/4/n),o=0;o<n;++o){for(var u=o*s,h=[],l=0,f=a.length;l<f;++l)h.push(a[o].slice(u,u+s));this._workers[o].postMessage({buffers:h,meta:e.meta,imageOps:this._imageOps,width:t,height:r},h)}}},pc.prototype._onWorkerMessage=function(e,t){this._destroyed||(this._dataLookup[e]=t.data,--this._running,0===this._running&&this._resolveJob())},pc.prototype._resolveJob=function(){var e,t,r=this._job,a=this._workers.length;if(1===a)e=new Uint8ClampedArray(this._dataLookup[0].buffer),t=this._dataLookup[0].meta;else{var n=r.inputs[0].data.length;e=new Uint8ClampedArray(n),t=new Array(n);for(var i=4*Math.ceil(n/4/a),s=0;s<a;++s){var o=this._dataLookup[s].buffer,u=s*i;e.set(new Uint8ClampedArray(o),u),t[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},r.callback(null,Ap(e,r.inputs[0].width,r.inputs[0].height),t),this._dispatch()};var vg={};var Gp=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,r){var o;if(r){var e=r.dataProjection?ua(r.dataProjection):this.readProjection(t);r.extent&&e&&e.getUnits()===Ca.TILE_PIXELS&&(e=ua(e)).setWorldExtent(r.extent),o={dataProjection:e,featureProjection:r.featureProjection}}return this.adaptOptions(o)},t.prototype.adaptOptions=function(t){return Da({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return ca()},t.prototype.readFeature=function(t,r){return ca()},t.prototype.readFeatures=function(t,r){return ca()},t.prototype.readGeometry=function(t,r){return ca()},t.prototype.readProjection=function(t){return ca()},t.prototype.writeFeature=function(t,r){return ca()},t.prototype.writeFeatures=function(t,r){return ca()},t.prototype.writeGeometry=function(t,r){return ca()},t}();function Oi(t,r,o){var e,n=o?ua(o.featureProjection):null,i=o?ua(o.dataProjection):null;if(e=n&&i&&!Kb(n,i)?(r?t.clone():t).transform(r?n:i,r?i:n):t,r&&o&&void 0!==o.decimals){var $=Math.pow(10,o.decimals);e===t&&(e=t.clone()),e.applyTransform(function(t){for(var r=0,o=t.length;r<o;++r)t[r]=Math.round(t[r]*$)/$;return t})}return e}var dg={};var Jp=dg&&dg.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),kj=function(t){function r(){return t.call(this)||this}return Jp(r,t),r.prototype.getType=function(){return rc.JSON},r.prototype.readFeature=function(t,r){return this.readFeatureFromObject(we(t),this.getReadOptions(t,r))},r.prototype.readFeatures=function(t,r){return this.readFeaturesFromObject(we(t),this.getReadOptions(t,r))},r.prototype.readFeatureFromObject=function(t,r){return ca()},r.prototype.readFeaturesFromObject=function(t,r){return ca()},r.prototype.readGeometry=function(t,r){return this.readGeometryFromObject(we(t),this.getReadOptions(t,r))},r.prototype.readGeometryFromObject=function(t,r){return ca()},r.prototype.readProjection=function(t){return this.readProjectionFromObject(we(t))},r.prototype.readProjectionFromObject=function(t){return ca()},r.prototype.writeFeature=function(t,r){return JSON.stringify(this.writeFeatureObject(t,r))},r.prototype.writeFeatureObject=function(t,r){return ca()},r.prototype.writeFeatures=function(t,r){return JSON.stringify(this.writeFeaturesObject(t,r))},r.prototype.writeFeaturesObject=function(t,r){return ca()},r.prototype.writeGeometry=function(t,r){return JSON.stringify(this.writeGeometryObject(t,r))},r.prototype.writeGeometryObject=function(t,r){return ca()},r}(Gp);function we(t){if("string"==typeof t){var r=JSON.parse(t);return r||null}return null!==t?t:null}dg.default=kj;var Pe={};var Np=Pe&&Pe.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Vj=function(e){function t(t){var r=e.call(this)||this;return r.geometries_=t||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return Np(t,e),t.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(ja),this.changeEventsKeys_.length=0},t.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var e=0,t=this.geometries_.length;e<t;++e)this.changeEventsKeys_.push(fa(this.geometries_[e],ba.CHANGE,this.changed,this))},t.prototype.clone=function(){var e=new t(null);return e.setGeometries(this.geometries_),e},t.prototype.closestPointXY=function(e,t,r,i){if(i<$b(this.getExtent(),e,t))return i;for(var o=this.geometries_,n=0,s=o.length;n<s;++n)i=o[n].closestPointXY(e,t,r,i);return i},t.prototype.containsXY=function(e,t){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)if(r[i].containsXY(e,t))return!0;return!1},t.prototype.computeExtent=function(e){ec(e);for(var t=this.geometries_,r=0,i=t.length;r<i;++r)Fe(e,t[r].getExtent());return e},t.prototype.getGeometries=function(){return Pi(this.geometries_)},t.prototype.getGeometriesArray=function(){return this.geometries_},t.prototype.getGeometriesArrayRecursive=function(){for(var e=[],t=this.geometries_,r=0,i=t.length;r<i;++r)t[r].getType()===this.getType()?e=e.concat(t[r].getGeometriesArrayRecursive()):e.push(t[r]);return e},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],i=this.geometries_,o=!1,n=0,s=i.length;n<s;++n){var p=i[n],a=p.getSimplifiedGeometry(e);r.push(a),a!==p&&(o=!0)}if(o){var h=new t(null);return h.setGeometriesArray(r),h}return this.simplifiedGeometryMaxMinSquaredTolerance=e,this},t.prototype.getType=function(){return aa.GEOMETRY_COLLECTION},t.prototype.intersectsExtent=function(e){for(var t=this.geometries_,r=0,i=t.length;r<i;++r)if(t[r].intersectsExtent(e))return!0;return!1},t.prototype.isEmpty=function(){return 0===this.geometries_.length},t.prototype.rotate=function(e,t){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)r[i].rotate(e,t);this.changed()},t.prototype.scale=function(e,t,r){var i=r;i||(i=Qb(this.getExtent()));for(var o=this.geometries_,n=0,s=o.length;n<s;++n)o[n].scale(e,t,i);this.changed()},t.prototype.setGeometries=function(e){this.setGeometriesArray(Pi(e))},t.prototype.setGeometriesArray=function(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()},t.prototype.applyTransform=function(e){for(var t=this.geometries_,r=0,i=t.length;r<i;++r)t[r].applyTransform(e);this.changed()},t.prototype.translate=function(e,t){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)r[i].translate(e,t);this.changed()},t.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),e.prototype.disposeInternal.call(this)},t}(Lf);function Pi(e){for(var t=[],r=0,i=e.length;r<i;++r)t.push(e[r].clone());return t}Pe.default=Vj;var Qp=vg&&vg.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),ri=function(e){function r(r){var t=this,o=r||{};return(t=e.call(this)||this).dataProjection=ua(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(t.defaultFeatureProjection=ua(o.featureProjection)),t.geometryName_=o.geometryName,t.extractGeometryName_=o.extractGeometryName,t}return Qp(r,e),r.prototype.readFeatureFromObject=function(e,r){var t=null,o=Sg((t="Feature"===e.type?e:{type:"Feature",geometry:e,properties:null}).geometry,r),i=new ab;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in t!==void 0&&i.setGeometryName(t.geometry_name),i.setGeometry(o),"id"in t&&i.setId(t.id),t.properties&&i.setProperties(t.properties,!0),i},r.prototype.readFeaturesFromObject=function(e,r){var t=null;if("FeatureCollection"===e.type){t=[];for(var o=e.features,i=0,$=o.length;i<$;++i)t.push(this.readFeatureFromObject(o[i],r))}else t=[this.readFeatureFromObject(e,r)];return t},r.prototype.readGeometryFromObject=function(e,r){return Sg(e,r)},r.prototype.readProjectionFromObject=function(e){var r,t=e.crs;return t?"name"==t.type?r=ua(t.properties.name):"EPSG"===t.type?r=ua("EPSG:"+t.properties.code):ia(!1,36):r=this.dataProjection,r},r.prototype.writeFeatureObject=function(e,r){r=this.adaptOptions(r);var t={type:"Feature",geometry:null,properties:null},o=e.getId();void 0!==o&&(t.id=o);var i=e.getGeometry();i&&(t.geometry=Gf(i,r));var $=e.getProperties();return delete $[e.getGeometryName()],Sc($)||(t.properties=$),t},r.prototype.writeFeaturesObject=function(e,r){r=this.adaptOptions(r);for(var t=[],o=0,i=e.length;o<i;++o)t.push(this.writeFeatureObject(e[o],r));return{type:"FeatureCollection",features:t}},r.prototype.writeGeometryObject=function(e,r){return Gf(e,this.adaptOptions(r))},r}(kj);function Sg(e,r){if(!e)return null;var t;switch(e.type){case aa.POINT:t=Up(e);break;case aa.LINE_STRING:t=Vp(e);break;case aa.POLYGON:t=Zp(e);break;case aa.MULTI_POINT:t=Xp(e);break;case aa.MULTI_LINE_STRING:t=Wp(e);break;case aa.MULTI_POLYGON:t=Yp(e);break;case aa.GEOMETRY_COLLECTION:t=Tp(e);break;default:throw new Error("Unsupported GeoJSON type: "+e.type);}return Oi(t,!1,r)}function Tp(e,r){var t=e.geometries.map(function(e){return Sg(e,r)});return new Vj(t)}function Up(e){return new ob(e.coordinates)}function Vp(e){return new Tb(e.coordinates)}function Wp(e){return new _g(e.coordinates)}function Xp(e){return new me(e.coordinates)}function Yp(e){return new Tg(e.coordinates)}function Zp(e){return new _a(e.coordinates)}function Gf(e,r){var t,o=(e=Oi(e,!0,r)).getType();switch(o){case aa.POINT:t=eq(e,r);break;case aa.LINE_STRING:t=aq(e,r);break;case aa.POLYGON:t=fq(e,r);break;case aa.MULTI_POINT:t=cq(e,r);break;case aa.MULTI_LINE_STRING:t=bq(e,r);break;case aa.MULTI_POLYGON:t=dq(e,r);break;case aa.GEOMETRY_COLLECTION:t=_p(e,r);break;case aa.CIRCLE:t={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o);}return t}function _p(e,r){return{type:"GeometryCollection",geometries:e.getGeometriesArray().map(function(e){var t=Da({},r);return delete t.featureProjection,Gf(e,t)})}}function aq(e,r){return{type:"LineString",coordinates:e.getCoordinates()}}function bq(e,r){return{type:"MultiLineString",coordinates:e.getCoordinates()}}function cq(e,r){return{type:"MultiPoint",coordinates:e.getCoordinates()}}function dq(e,r){var t;return r&&(t=r.rightHanded),{type:"MultiPolygon",coordinates:e.getCoordinates(t)}}function eq(e,r){return{type:"Point",coordinates:e.getCoordinates()}}function fq(e,r){var t;return r&&(t=r.rightHanded),{type:"Polygon",coordinates:e.getCoordinates(t)}}vg.default=ri;var Ti,hq=new Jh({source:new vh}),We=new jc({wrapX:!1}),Fp=new wc({source:We}),ii=new nj({layers:[hq,Fp],target:"map",view:new td({center:[-11e6,46e5],zoom:4})}),Me=document.getElementById("type"),am=document.getElementById("export");function jj(){"None"!==Me.value&&(Ti=new ni({source:We,type:Me.value,freehand:!0}),ii.addInteraction(Ti))}am.addEventListener("click",function(e){console.log("clicked");var r=new ri({dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}).writeFeatures(We.getFeatures().map(function(e){var r=e.clone();return r.getGeometry()instanceof Gc&&r.setGeometry(dc(r.getGeometry())),r}));console.log(r)}),Me.onchange=function(){ii.removeInteraction(Ti),jj()},jj();})();
(function () {function xh(a){return a&&a.__esModule?{d:a.default}:{d:a}}var Bd=this;var $f={};var Gf={};var Hd={};var Bf={};function ca(){return function(){throw new Error("Unimplemented abstract method.")}()}var go=0;function ga(t){return t.ol_uid||(t.ol_uid=String(++go))}var pf="6.3.1";var po=Bf&&Bf.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),yf=function(t){function r(r){var e=this,o="Assertion failed. See https://openlayers.org/en/"+("latest"===pf?pf:"v"+pf.split("-")[0])+"/doc/errors/#"+r+" for details.";return(e=t.call(this,o)||this).code=r,e.name="AssertionError",e.message=o,e}return po(r,t),r}(Error);Bf.default=yf;var ra={ADD:"add",REMOVE:"remove"};var Sc={};var ub={PROPERTYCHANGE:"propertychange"};var ze={};function fa(e,t,n,$,r){if($&&$!==e&&(n=n.bind($)),r){var i=n;n=function(){e.removeEventListener(t,n),i.apply(this,arguments)}}var s={target:e,type:t,listener:n};return e.addEventListener(t,n),s}function Ec(e,t,n,$){return fa(e,t,n,$,!0)}function ja(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),wc(e))}var Ca="function"==typeof Object.assign?Object.assign:function(e,r){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1,o=arguments.length;n<o;++n){var $=arguments[n];if(null!=$)for(var s in $)$.hasOwnProperty(s)&&(t[s]=$[s])}return t};function wc(e){for(var r in e)delete e[r]}var Oe="function"==typeof Object.values?Object.values:function(e){var r=[];for(var t in e)r.push(e[t]);return r};function Qc(e){var r;for(r in e)return!1;return!r}var Ye={};var mf=function(){function t(){this.disposed_=!1}return t.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function La(){return!0}function Mb(){return!1}function qb(){}function lq($){var r,e,t,o=!1;return function(){var p=Array.prototype.slice.call(arguments);return o&&this===t&&pc(p,e)||(o=!0,t=this,e=p,r=$.apply(this,arguments)),r}}function jq(r,e,n){for(var t,$,u=n||xb,o=0,l=r.length,i=!1;o<l;)($=+u(r[t=o+(l-o>>1)],e))<0?o=t+1:(l=t,i=!$);return i?o:~o}function xb(r,e){return r>e?1:r<e?-1:0}function Rc(r,e){return r.indexOf(e)>=0}function Lg(r,e,n){var t=r.length;if(r[0]<=e)return 0;if(e<=r[t-1])return t-1;var $=void 0;if(n>0){for($=1;$<t;++$)if(r[$]<e)return $-1}else if(n<0){for($=1;$<t;++$)if(r[$]<=e)return $}else for($=1;$<t;++$){if(r[$]==e)return $;if(r[$]<e)return r[$-1]-e<e-r[$]?$-1:$}return t-1}function iq(r,e,n){for(;e<n;){var t=r[e];r[e]=r[n],r[n]=t,++e,--n}}function Na(r,e){for(var n=Array.isArray(e)?e:[e],t=n.length,$=0;$<t;$++)r[r.length]=n[$]}function pc(r,e){var n=r.length;if(n!==e.length)return!1;for(var t=0;t<n;t++)if(r[t]!==e[t])return!1;return!0}function hq(r,e,n){var t=e||xb;return r.every(function(e,$){if(0===$)return!0;var u=t(r[$-1],e);return!(u>0||n&&0===u)})}var Ea=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();function _p(t){t.stopPropagation()}var Tp=Ye&&Ye.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Pb=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_={},n.dispatching_={},n.listeners_={},n}return Tp(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_[t];n||(n=[],this.listeners_[t]=n),-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new Ea(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var i,r=this.listeners_[n];if(r){n in this.dispatching_||(this.dispatching_[n]=0,this.pendingRemovals_[n]=0),++this.dispatching_[n];for(var s=0,o=r.length;s<o;++s)if(!1===(i="handleEvent"in r[s]?r[s].handleEvent(e):r[s].call(this,e))||e.propagationStopped){i=!1;break}if(--this.dispatching_[n],0===this.dispatching_[n]){var p=this.pendingRemovals_[n];for(delete this.pendingRemovals_[n];p--;)this.removeEventListener(n,qb);delete this.dispatching_[n]}return i}},e.prototype.disposeInternal=function(){wc(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},e.prototype.removeEventListener=function(t,e){var n=this.listeners_[t];if(n){var i=n.indexOf(e);-1!==i&&(t in this.pendingRemovals_?(n[i]=qb,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}},e}(mf);Ye.default=Pb;var ba={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};var Sp=ze&&ze.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vf=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Sp(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(ba.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),o=0;o<r;++o)n[o]=fa(this,t[o],e);return n}return fa(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),o=0;o<r;++o)n[o]=Ec(this,t[o],e);return n}return Ec(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var r=0,n=t.length;r<n;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(Pb);function Qp(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)ja(t[e]);else ja(t)}ze.unByKey=Qp,ze.default=vf;var Dk=Sc&&Sc.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function h(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(h.prototype=r.prototype,new h)}}(),wf=function(e){function t(t,r,h){var n=e.call(this,t)||this;return n.key=r,n.oldValue=h,n}return Dk(t,e),t}(Ea);Sc.ObjectEvent=wf;var Oa=function(e){function t(t){var r=e.call(this)||this;return ga(r),r.values_={},void 0!==t&&r.setProperties(t),r}return Dk(t,e),t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return Ca({},this.values_)},t.prototype.notify=function(e,t){var r;r=qa(e),this.dispatchEvent(new wf(r,e,t)),r=ub.PROPERTYCHANGE,this.dispatchEvent(new wf(r,e,t))},t.prototype.set=function(e,t,r){if(r)this.values_[e]=t;else{var h=this.values_[e];this.values_[e]=t,h!==t&&this.notify(e,h)}},t.prototype.setProperties=function(e,t){for(var r in e)this.set(r,e[r],t)},t.prototype.unset=function(e,t){if(e in this.values_){var r=this.values_[e];delete this.values_[e],t||this.notify(e,r)}},t}(vf),zf={};function qa(e){return zf.hasOwnProperty(e)?zf[e]:zf[e]="change:"+e}Sc.getChangeEventType=qa,Sc.default=Oa;var Ui=Hd&&Hd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uj={LENGTH:"length"},Bc=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.element=r,o.index=n,o}return Ui(e,t),e}(Ea);Hd.CollectionEvent=Bc;var za=function(t){function e(e,r){var n=t.call(this)||this,o=r||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var i=0,a=n.array_.length;i<a;++i)n.assertUnique_(n.array_[i],i);return n.updateLength_(),n}return Ui(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(uj.LENGTH)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Bc(ra.ADD,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Bc(ra.REMOVE,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Bc(ra.REMOVE,n,t)),this.dispatchEvent(new Bc(ra.ADD,e,t))}else{for(var o=r;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(uj.LENGTH,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new yf(58)},e}(Oa);Hd.default=za;var Rf={};var bg={};var Pp=bg&&bg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hc=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.map=r,o.frameState=void 0!==n?n:null,o}return Pp(e,t),e}(Ea);bg.default=Hc;var Np=Rf&&Rf.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ug=function(t){function e(e,o,n,r,i){var p=t.call(this,e,o,i)||this;return p.originalEvent=n,p.pixel_=null,p.coordinate_=null,p.dragging=void 0!==r&&r,p}return Np(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:!0,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:!0,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Hc);Rf.default=ug;var Dg={};var yj=null,Nj=null;function Mp(){Element.prototype.setPointerCapture=Element.prototype.setCapture,Element.prototype.releasePointerCapture=Element.prototype.releaseCapture}function Sg(e,t,r){e.addEventListener(t,function(e){var n=new MouseEvent(r,e);n.pointerId=1,n.isPrimary=!0,n.pointerType="mouse",n.width=1,n.height=1,n.tiltX=0,n.tiltY=0,"buttons"in e&&0!==e.buttons?n.pressure=.5:n.pressure=0;var o=e.target;null!==Nj&&(o=Nj,"mouseup"===t&&(Nj=null)),o.dispatchEvent(n),n.defaultPrevented&&e.preventDefault()})}function lh(e,t,r){e.addEventListener(t,function(e){for(var n=e.changedTouches,o=n.length,i=0;i<o;i++){var a=new CustomEvent(r,{bubbles:!0,cancelable:!0});a.ctrlKey=e.ctrlKey,a.shiftKey=e.shiftKey,a.altKey=e.altKey,a.metaKey=e.metaKey;var u=n.item(i);a.clientX=u.clientX,a.clientY=u.clientY,a.screenX=u.screenX,a.screenY=u.screenY,a.pageX=u.pageX,a.pageY=u.pageY;var $=u.target.getBoundingClientRect();a.offsetX=u.clientX-$.left,a.offsetY=u.clientY-$.top,a.pointerId=1+u.identifier,a.button=0,a.buttons=1,a.movementX=0,a.movementY=0,a.region=null,a.relatedTarget=null,a.x=a.clientX,a.y=a.clientY,a.pointerType="touch",a.width=1,a.height=1,a.tiltX=0,a.tiltY=0,a.pressure=1,"touchstart"===t&&null===yj&&(yj=u.identifier),a.isPrimary=u.identifier===yj,"touchend"===t&&a.isPrimary&&(yj=null),e.target.dispatchEvent(a),a.defaultPrevented&&e.preventDefault()}})}"PointerEvent"in window||(Mp(),"TouchEvent"in window||(Sg(document,"mousedown","pointerdown"),Sg(document,"mousemove","pointermove"),Sg(document,"mouseup","pointerup")),lh(document,"touchstart","pointerdown"),lh(document,"touchmove","pointermove"),lh(document,"touchend","pointerup"));var jc="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Lp=-1!==jc.indexOf("firefox");var a=-1!==jc.indexOf("safari")&&-1==jc.indexOf("chrom");var Ip=-1!==jc.indexOf("webkit")&&-1==jc.indexOf("edge");var Gp=-1!==jc.indexOf("macintosh");var ve="undefined"!=typeof devicePixelRatio?devicePixelRatio:1;var ue="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope;var gj="undefined"!=typeof Image&&Image.prototype.decode;var kj=function(){var e=!1;try{var $=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,$),window.removeEventListener("_",null,$)}catch(r){}return e}();var ha={SINGLECLICK:"singleclick",CLICK:ba.CLICK,DBLCLICK:ba.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var We={};var Fp=We&&We.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),gb=function(t){function r(r,e,o,n,$){var p=t.call(this,r,e,o,n,$)||this;return p.pointerEvent=o,p}return Fp(r,t),r}(ug);We.default=gb;var hb={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Cp=Dg&&Dg.__extends||function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Gk=function(e){function t(t,o){var i=e.call(this,t)||this;i.map_=t,i.clickTimeoutId_,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=o?o*ve:ve,i.down_=null;var r=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=r,i.pointerdownListenerKey_=fa(r,hb.POINTERDOWN,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=fa(r,hb.POINTERMOVE,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(ba.TOUCHMOVE,i.boundHandleTouchMove_,!!kj&&{passive:!1}),i}return Cp(t,e),t.prototype.emulateClick_=function(e){var t=new gb(ha.CLICK,this.map_,e);this.dispatchEvent(t),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new gb(ha.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var t=new gb(ha.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}.bind(this),250)},t.prototype.updateActivePointers_=function(e){var t=e;t.type==ha.POINTERUP||t.type==ha.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==ha.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},t.prototype.handlePointerUp_=function(e){this.updateActivePointers_(e);var t=new gb(ha.POINTERUP,this.map_,e);this.dispatchEvent(t),t.propagationStopped||this.dragging_||!this.isMouseActionButton_(e)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(ja),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},t.prototype.isMouseActionButton_=function(e){return 0===e.button},t.prototype.handlePointerDown_=function(e){this.updateActivePointers_(e);var t=new gb(ha.POINTERDOWN,this.map_,e);this.dispatchEvent(t),this.down_=e,0===this.dragListenerKeys_.length&&this.dragListenerKeys_.push(fa(document,ha.POINTERMOVE,this.handlePointerMove_,this),fa(document,ha.POINTERUP,this.handlePointerUp_,this),fa(this.element_,ha.POINTERCANCEL,this.handlePointerUp_,this))},t.prototype.handlePointerMove_=function(e){if(this.isMoving_(e)){this.dragging_=!0;var t=new gb(ha.POINTERDRAG,this.map_,e,this.dragging_);this.dispatchEvent(t)}},t.prototype.relayEvent_=function(e){this.originalPointerMoveEvent_=e;var t=!(!this.down_||!this.isMoving_(e));this.dispatchEvent(new gb(e.type,this.map_,e,t))},t.prototype.handleTouchMove_=function(e){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||e.preventDefault()},t.prototype.isMoving_=function(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(ja(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ba.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ja(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ja),this.dragListenerKeys_.length=0,this.element_=null,e.prototype.disposeInternal.call(this)},t}(Pb);Dg.default=Gk;var dc={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var Ba={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var ac={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var ke={};var da={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ia(r,$){if(!r)throw new yf($)}var ge=1/0;var wp=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,wc(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){ia(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=ge&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],s=i[t],o=t;t<n>>1;){var u=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),p=h<n&&i[h]<i[u]?h:u;e[t]=e[p],i[t]=i[p],t=p}e[t]=r,i[t]=s,this.siftDown_(o,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,r=i[e],s=n[e];e>t;){var o=this.getParentIndex_(e);if(!(n[o]>s))break;i[e]=i[o],n[e]=n[o],e=o}i[e]=r,n[e]=s},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,s=this.priorities_,o=0,u=r.length;for(e=0;e<u;++e)(i=n(t=r[e]))==ge?delete this.queuedElements_[this.keyFunction_(t)]:(s[o]=i,r[o++]=t);r.length=o,s.length=o,this.heapify_()},t}();var vp=ke&&ke.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pi=function(t){function e(e,i){var r=t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()})||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=i,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return vp(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(ba.CHANGE,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(e.hifi&&i===da.LOADED||i===da.ERROR||i===da.EMPTY){e.removeEventListener(ba.CHANGE,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,r,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==da.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,i.load())},e}(wp);function Qi(t,e,i,r,n){if(!(t&&i in t.wantedTiles))return ge;if(!t.wantedTiles[i][e.getKey()])return ge;var o=t.viewState.center,a=r[0]-o[0],$=r[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+$*$)/n}ke.default=Pi,ke.getTilePriority=Qi;var $b={};var tp=42;var Jf=256;function mj(t,$,e){return function(r,a,c,o){if(r){var n=$?0:c[0]*a,x=$?0:c[1]*a,p=t[0]+n/2,z=t[2]-n/2,R=t[1]+x/2,h=t[3]-x/2;p>z&&(z=p=(z+p)/2),R>h&&(h=R=(h+R)/2);var m=wa(r[0],p,z),M=wa(r[1],R,h),i=30*a;return o&&e&&(m+=-i*Math.log(1+Math.max(0,p-r[0])/i)+i*Math.log(1+Math.max(0,r[0]-z)/i),M+=-i*Math.log(1+Math.max(0,R-r[1])/i)+i*Math.log(1+Math.max(0,r[1]-h)/i)),[m,M]}}}function sp(t){return t}function wa(r,e,t){return Math.min(Math.max(r,e),t)}var qp="cosh"in Math?Math.cosh:function(r){var e=Math.exp(r);return(e+1/e)/2};function op(r,e,t,$,o,a){var n=o-t,s=a-$;if(0!==n||0!==s){var p=((r-t)*n+(e-$)*s)/(n*n+s*s);p>1?(t=o,$=a):p>0&&(t+=n*p,$+=s*p)}return Wb(r,e,t,$)}function Wb(r,e,t,$){var o=t-r,a=$-e;return o*o+a*a}function mp(r){for(var e=r.length,t=0;t<e;t++){for(var $=t,o=Math.abs(r[t][t]),a=t+1;a<e;a++){var n=Math.abs(r[a][t]);n>o&&(o=n,$=a)}if(0===o)return null;var s=r[$];r[$]=r[t],r[t]=s;for(var p=t+1;p<e;p++)for(var x=-r[p][t]/r[t][t],u=t;u<e+1;u++)t==u?r[p][u]=0:r[p][u]+=x*r[t][u]}for(var B=new Array(e),G=e-1;G>=0;G--){B[G]=r[G][e]/r[G][G];for(var i=G-1;i>=0;i--)r[i][e]-=r[i][G]*B[G]}return B}function wk(r){return 180*r/Math.PI}function pb(r){return r*Math.PI/180}function Ub(r,e){var t=r%e;return t*e<0?t+e:t}function kc(r,e,t){return r+t*(e-r)}function wg(o,t,e,n){var r=ta(t)/e[0],a=ab(t)/e[1];return n?Math.min(o,Math.max(r,a)):Math.min(o,Math.min(r,a))}function Ag(o,t,e){var n=Math.min(o,t);return n*=Math.log(1+50*Math.max(0,o/t-1))/50+1,e&&(n=Math.max(n,e),n/=Math.log(1+50*Math.max(0,e/o-1))/50+1),wa(n,e/2,2*t)}function kp(o,t,e,n){return function(r,a,$,l){if(void 0!==r){var i=o[0],p=o[o.length-1],m=e?wg(i,e,$,n):i;if(l)return void 0===t||t?Ag(r,m,p):wa(r,p,m);var u=Math.min(m,r),h=Math.floor(Lg(o,u,a));return o[h]>m&&h<o.length-1?o[h+1]:o[h]}}}function jp(o,t,e,n,r,a){return function($,l,i,p){if(void 0!==$){var m=r?wg(t,r,i,a):t,u=void 0!==e?e:0;if(p)return void 0===n||n?Ag($,m,u):wa($,u,m);var h=Math.ceil(Math.log(t/m)/Math.log(o)-1e-9),M=-l*(.5-1e-9)+.5,c=Math.min(m,$),s=Math.floor(Math.log(t/c)/Math.log(o)+M),v=Math.max(h,s),g=t/Math.pow(o,v);return wa(g,u,m)}}}function Sh(o,t,e,n,r){return function(a,$,l,i){if(void 0!==a){var p=n?wg(o,n,l,r):o;return(void 0===e||e)&&i?Ag(a,p,t):wa(a,t,p)}}}function ua(r){for(var t=Ga(),e=0,$=r.length;e<$;++e)yc(t,r[e]);return t}function ip(r,t,e){return Ra(Math.min.apply(null,r),Math.min.apply(null,t),Math.max.apply(null,r),Math.max.apply(null,t),e)}function Zd(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function pi(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function Rb(r,t,e){var $,i;return($=t<r[0]?r[0]-t:r[2]<t?t-r[2]:0)*$+(i=e<r[1]?r[1]-e:r[3]<e?e-r[3]:0)*i}function vi(r,t){return Be(r,t[0],t[1])}function fb(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function Be(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function De(r,t){var e=r[0],$=r[1],i=r[2],o=r[3],n=t[0],p=t[1],a=xa.UNKNOWN;return n<e?a|=xa.LEFT:n>i&&(a|=xa.RIGHT),p<$?a|=xa.BELOW:p>o&&(a|=xa.ABOVE),a===xa.UNKNOWN&&(a=xa.INTERSECTING),a}function Ga(){return[1/0,1/0,-1/0,-1/0]}function Ra(r,t,e,$,i){return i?(i[0]=r,i[1]=t,i[2]=e,i[3]=$,i):[r,t,e,$]}function sc(r){return Ra(1/0,1/0,-1/0,-1/0,r)}function Xd(r,t){var e=r[0],$=r[1];return Ra(e,$,e,$,t)}function hp(r,t){return gp(sc(t),r)}function aj(r,t,e,$,i){return oj(sc(i),r,t,e,$)}function vc(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Se(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function yc(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function gp(r,t){for(var e=0,$=t.length;e<$;++e)yc(r,t[e]);return r}function oj(r,t,e,$,i){for(;e<$;e+=i)ep(r,t[e],t[e+1]);return r}function ep(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function sj(r,t){var e;return(e=t(Bb(r)))?e:(e=t(Hb(r)))?e:(e=t(_b(r)))?e:(e=t(Ya(r)))||!1}function Wd(r){var t=0;return Af(r)||(t=ta(r)*ab(r)),t}function Bb(r){return[r[0],r[1]]}function Hb(r){return[r[2],r[1]]}function Gb(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function cp(r,t){var e;return t===Xc.BOTTOM_LEFT?e=Bb(r):t===Xc.BOTTOM_RIGHT?e=Hb(r):t===Xc.TOP_LEFT?e=Ya(r):t===Xc.TOP_RIGHT?e=_b(r):ia(!1,13),e}function Pj(r,t,e,$,i){var o=t*$[0]/2,n=t*$[1]/2,p=Math.cos(e),a=Math.sin(e),x=o*p,D=o*a,Q=n*p,s=n*a,c=r[0],u=r[1],d=c-x+s,g=c-x-s,m=c+x-s,f=c+x+s,h=u-D-Q,l=u-D+Q,E=u+D+Q,R=u+D-Q;return Ra(Math.min(d,g,m,f),Math.min(h,l,E,R),Math.max(d,g,m,f),Math.max(h,l,E,R),i)}function ab(r){return r[3]-r[1]}function Lc(r,t,e){var $=e||Ga();return Fa(r,t)?(r[0]>t[0]?$[0]=r[0]:$[0]=t[0],r[1]>t[1]?$[1]=r[1]:$[1]=t[1],r[2]<t[2]?$[2]=r[2]:$[2]=t[2],r[3]<t[3]?$[3]=r[3]:$[3]=t[3]):sc($),$}function Ya(r){return[r[0],r[3]]}function _b(r){return[r[2],r[3]]}function ta(r){return r[2]-r[0]}function Fa(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Af(r){return r[2]<r[0]||r[3]<r[1]}function $o(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function Ch(r,t){var e=(r[2]-r[0])/2*(t-1),$=(r[3]-r[1])/2*(t-1);r[0]-=e,r[2]+=e,r[1]-=$,r[3]+=$}function Zo(r,t,e){var $=!1,i=De(r,t),o=De(r,e);if(i===xa.INTERSECTING||o===xa.INTERSECTING)$=!0;else{var n=r[0],p=r[1],a=r[2],x=r[3],D=t[0],Q=t[1],s=e[0],c=e[1],u=(c-Q)/(s-D),d=void 0,g=void 0;o&xa.ABOVE&&!(i&xa.ABOVE)&&($=(d=s-(c-x)/u)>=n&&d<=a),$||!(o&xa.RIGHT)||i&xa.RIGHT||($=(g=c-(s-a)*u)>=p&&g<=x),$||!(o&xa.BELOW)||i&xa.BELOW||($=(d=s-(c-p)/u)>=n&&d<=a),$||!(o&xa.LEFT)||i&xa.LEFT||($=(g=c-(s-n)*u)>=p&&g<=x)}return $}function Yo(r,t,e,$){var i=[];if($>1)for(var o=r[2]-r[0],n=r[3]-r[1],p=0;p<$;++p)i.push(r[0]+o*p/$,r[1],r[2],r[1]+n*p/$,r[2]-o*p/$,r[3],r[0],r[3]-n*p/$);else i=[r[0],r[1],r[2],r[1],r[2],r[3],r[0],r[3]];t(i,i,2);for(var a=[],x=[],D=(p=0,i.length);p<D;p+=2)a.push(i[p]),x.push(i[p+1]);return ip(a,x,e)}function Xo(r,t){var e=t.getExtent(),$=Gb(r);if(t.canWrapX()&&($[0]<e[0]||$[0]>=e[2])){var i=ta(e),o=Math.floor(($[0]-e[0])/i)*i;r[0]-=o,r[2]-=o}return r}var Xc={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var xa={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Hf(e){return void 0!==e?0:void 0}function Wh(e){return void 0!==e?e:void 0}function Uo(e){var o=2*Math.PI/e;return function(e,r){return r?e:void 0!==e?e=Math.floor(e/o+.5)*o:void 0}}function Ro(e){var o=e||pb(5);return function(e,r){return r?e:void 0!==e?Math.abs(e)<=o?0:e:void 0}}var ya={ANIMATING:0,INTERACTING:1};var Ma={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Po(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Oo(t,e){var r=e.getRadius(),$=e.getCenter(),n=$[0],s=$[1],o=t[0]-n,a=t[1]-s;0===o&&0===a&&(o=1);var p=Math.sqrt(o*o+a*a);return[n+r*o/p,s+r*a/p]}function Td(t,e){var r,$,n=t[0],s=t[1],o=e[0],a=e[1],p=o[0],j=o[1],i=a[0],G=a[1],x=i-p,c=G-j,u=0===x&&0===c?0:(x*(n-p)+c*(s-j))/(x*x+c*c||0);return u<=0?(r=p,$=j):u>=1?(r=i,$=G):(r=p+u*x,$=j+u*c),[r,$]}function Xa(t,e){for(var r=!0,$=t.length-1;$>=0;--$)if(t[$]!=e[$]){r=!1;break}return r}function hg(t,e){var r=Math.cos(e),$=Math.sin(e),n=t[0]*r-t[1]*$,s=t[1]*r+t[0]*$;return t[0]=n,t[1]=s,t}function Lo(t,e){return t[0]*=e,t[1]*=e,t}function Ka(t,e){var r=t[0]-e[0],$=t[1]-e[1];return r*r+$*$}function Sd(t,e){return Math.sqrt(Ka(t,e))}function Rd(t,e){return Ka(t,Td(t,e))}function $i(t,e){var r=e.getExtent();if(e.canWrapX()&&(t[0]<r[0]||t[0]>=r[2])){var $=ta(r),n=Math.floor((t[0]-r[0])/$);t[0]-=n*$}return t}function _i(e){return Math.pow(e,3)}function Ob(e){return 1-_i(1-e)}function Jo(e){return 3*e*e-2*e*e*e}function Ho(e){return e}var aa={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};var Lb={};var pa={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Gg={};var Tc={};var Og={};function Jb(r,t,e,$,o,a){for(var n=a||[],s=0,f=t;f<e;f+=$){var l=r[f],p=r[f+1];n[s++]=o[0]*l+o[2]*p+o[4],n[s++]=o[1]*l+o[3]*p+o[5]}return a&&n.length!=s&&(n.length=s),n}function vj(r,t,e,$,o,a,n){for(var s=n||[],f=Math.cos(o),l=Math.sin(o),p=a[0],w=a[1],x=0,G=t;G<e;G+=$){var L=r[G]-p,v=r[G+1]-w;s[x++]=p+L*f-v*l,s[x++]=w+L*l+v*f;for(var h=G+2;h<G+$;++h)s[x++]=r[h]}return n&&s.length!=x&&(s.length=x),s}function Fo(r,t,e,$,o,a,n,s){for(var f=s||[],l=n[0],p=n[1],w=0,x=t;x<e;x+=$){var G=r[x]-l,L=r[x+1]-p;f[w++]=l+o*G,f[w++]=p+a*L;for(var v=x+2;v<x+$;++v)f[w++]=r[v]}return s&&f.length!=w&&(f.length=w),f}function Aj(r,t,e,$,o,a,n){for(var s=n||[],f=0,l=t;l<e;l+=$){s[f++]=r[l]+o,s[f++]=r[l+1]+a;for(var p=l+2;p<l+$;++p)s[f++]=r[p]}return n&&s.length!=f&&(s.length=f),s}function ah(t,r,o){var $;if(void 0!==r){for(var e=0,i=t.length;e<i;++e)r[e]=t[e];$=r}else $=t.slice();return $}function Mj(t,r,o){if(void 0!==r&&t!==r){for(var $=0,e=t.length;$<e;++$)r[$]=t[$];t=r}return t}function Eo(t){io(t.getCode(),t),Ld(t,t,ah)}function Do(t){t.forEach(Eo)}function va(t){return"string"==typeof t?ko(t):t||null}function mh(t,r,o,$){var e,i=(t=va(t)).getPointResolutionFunc();if(i)e=i(r,o),$&&$!==t.getUnits()&&(n=t.getMetersPerUnit())&&(e=e*n/Wa[$]);else if(t.getUnits()==Da.DEGREES&&!$||$==Da.DEGREES)e=r;else{var n,s=ic(t,va("EPSG:4326")),a=[o[0]-r/2,o[1],o[0]+r/2,o[1],o[0],o[1]-r/2,o[0],o[1]+r/2];a=s(a,a,2),e=(Ie(a.slice(0,2),a.slice(2,4))+Ie(a.slice(4,6),a.slice(6,8)))/2,void 0!==(n=$?Wa[$]:t.getMetersPerUnit())&&(e/=n)}return e}function rk(t){Do(t),t.forEach(function(r){t.forEach(function(t){r!==t&&Ld(r,t,ah)})})}function zo(t,r,o,$){t.forEach(function(t){r.forEach(function(r){Ld(t,r,o),Ld(r,t,$)})})}function qh(t,r){return t?"string"==typeof t?va(t):t:va(r)}function Eb(t,r){if(t===r)return!0;var o=t.getUnits()===r.getUnits();return t.getCode()===r.getCode()?o:ic(t,r)===ah&&o}function ic(t,r){var o=t.getCode(),$=r.getCode(),e=lo(o,$);return e||(e=Mj),e}function _c(t,r){return ic(va(t),va(r))}function Ge(t,r,o){return _c(r,o)(t,void 0,t.length)}function Hk(t,r,o,$){var e=_c(r,o);return Yo(t,e,void 0,$)}var Pd=6371008.8;function Ie(e,t,r){var $=r||Pd,a=pb(e[1]),o=pb(t[1]),n=(o-a)/2,E=pb(t[0]-e[0])/2,R=Math.sin(n)*Math.sin(n)+Math.sin(E)*Math.sin(E)*Math.cos(a)*Math.cos(o);return 2*$*Math.atan2(Math.sqrt(R),Math.sqrt(1-R))}function Ke(e,t){for(var r=0,$=0,a=e.length;$<a-1;++$)r+=Ie(e[$],e[$+1],t);return r}function yo(e,t){var r=t||{},$=r.radius||Pd,a=r.projection||"EPSG:3857",o=e.getType();o!==aa.GEOMETRY_COLLECTION&&(e=e.clone().transform(a,"EPSG:4326"));var n,E,R,p,s,i,q=0;switch(o){case aa.POINT:case aa.MULTI_POINT:break;case aa.LINE_STRING:case aa.LINEAR_RING:q=Ke(n=e.getCoordinates(),$);break;case aa.MULTI_LINE_STRING:case aa.POLYGON:for(R=0,p=(n=e.getCoordinates()).length;R<p;++R)q+=Ke(n[R],$);break;case aa.MULTI_POLYGON:for(R=0,p=(n=e.getCoordinates()).length;R<p;++R)for(s=0,i=(E=n[R]).length;s<i;++s)q+=Ke(E[s],$);break;case aa.GEOMETRY_COLLECTION:var m=e.getGeometries();for(R=0,p=m.length;R<p;++R)q+=yo(m[R],t);break;default:throw new Error("Unsupported geometry type: "+o);}return q}function Md(e,t){for(var r=0,$=e.length,a=e[$-1][0],o=e[$-1][1],n=0;n<$;n++){var E=e[n][0],R=e[n][1];r+=pb(E-a)*(2+Math.sin(pb(o))+Math.sin(pb(R))),a=E,o=R}return r*t*t/2}function xo(e,t){var r=t||{},$=r.radius||Pd,a=r.projection||"EPSG:3857",o=e.getType();o!==aa.GEOMETRY_COLLECTION&&(e=e.clone().transform(a,"EPSG:4326"));var n,E,R,p,s,i,q=0;switch(o){case aa.POINT:case aa.MULTI_POINT:case aa.LINE_STRING:case aa.MULTI_LINE_STRING:case aa.LINEAR_RING:break;case aa.POLYGON:for(n=e.getCoordinates(),q=Math.abs(Md(n[0],$)),R=1,p=n.length;R<p;++R)q-=Math.abs(Md(n[R],$));break;case aa.MULTI_POLYGON:for(R=0,p=(n=e.getCoordinates()).length;R<p;++R)for(E=n[R],q+=Math.abs(Md(E[0],$)),s=1,i=E.length;s<i;++s)q-=Math.abs(Md(E[s],$));break;case aa.GEOMETRY_COLLECTION:var m=e.getGeometries();for(R=0,p=m.length;R<p;++R)q+=xo(m[R],t);break;default:throw new Error("Unsupported geometry type: "+o);}return q}function ro(e,t,r,$){var a=$||Pd,o=pb(e[1]),n=pb(e[0]),E=t/a,R=Math.asin(Math.sin(o)*Math.cos(E)+Math.cos(o)*Math.sin(E)*Math.cos(r)),p=n+Math.atan2(Math.sin(r)*Math.sin(E)*Math.cos(o),Math.cos(E)-Math.sin(o)*Math.sin(R));return[wk(p),wk(R)]}var ob={};var b=arguments[0];var Da={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Wa={};Wa[Da.DEGREES]=2*Math.PI*6370997/360,Wa[Da.FEET]=.3048,Wa[Da.METERS]=1,Wa[Da.USFEET]=1200/3937;var Vh=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_||Wa[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}();var no=ob&&ob.__extends||function(){var o=function($,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,$){o.__proto__=$}||function(o,$){for(var r in $)$.hasOwnProperty(r)&&(o[r]=$[r])})($,r)};return function($,r){function t(){this.constructor=$}o($,r),$.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}}(),Ic=6378137;ob.RADIUS=Ic;var Sb=Math.PI*Ic;ob.HALF_SIZE=Sb;var ci=[-Sb,-Sb,Sb,Sb];ob.EXTENT=ci;var ji=[-180,-85,180,85];ob.WORLD_EXTENT=ji;var Kb=function(o){function $($){return o.call(this,{code:$,units:Da.METERS,extent:ci,global:!0,worldExtent:ji,getPointResolution:function(o,$){return o/qp($[1]/Ic)}})||this}return no($,o),$}(Vh),Ze=[new Kb("EPSG:3857"),new Kb("EPSG:102100"),new Kb("EPSG:102113"),new Kb("EPSG:900913"),new Kb("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Kb("urn:ogc:def:crs:EPSG::3857"),new Kb("http://www.opengis.net/gml/srs/epsg.xml#3857")];function si(o,$,r){var t=o.length,e=r>1?r:2,s=$;void 0===s&&(s=e>2?o.slice():new Array(t));for(var n=Sb,l=0;l<t;l+=e){s[l]=n*o[l]/180;var h=Ic*Math.log(Math.tan(Math.PI*(+o[l+1]+90)/360));h>n?h=n:h<-n&&(h=-n),s[l+1]=h}return s}function ti(o,$,r){var t=o.length,e=r>1?r:2,s=$;void 0===s&&(s=e>2?o.slice():new Array(t));for(var n=0;n<t;n+=e)s[n]=180*o[n]/Sb,s[n+1]=360*Math.atan(Math.exp(o[n+1]/Ic))/Math.PI-90;return s}ob.PROJECTIONS=Ze,ob.fromEPSG4326=si,ob.toEPSG4326=ti;var zc={};var mo=zc&&zc.__extends||function(){var n=function(r,$){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var $ in r)r.hasOwnProperty($)&&(n[$]=r[$])})(r,$)};return function(r,$){function e(){this.constructor=r}n(r,$),r.prototype=null===$?Object.create($):(e.prototype=$.prototype,new e)}}(),Ci=6378137;zc.RADIUS=Ci;var ef=[-180,-90,180,90];zc.EXTENT=ef;var Mi=Math.PI*Ci/180;zc.METERS_PER_UNIT=Mi;var Cb=function(n){function r(r,$){return n.call(this,{code:r,units:Da.DEGREES,extent:ef,axisOrientation:$,global:!0,metersPerUnit:Mi,worldExtent:ef})||this}return mo(r,n),r}(Vh),jf=[new Cb("CRS:84"),new Cb("EPSG:4326","neu"),new Cb("urn:ogc:def:crs:EPSG::4326","neu"),new Cb("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Cb("urn:ogc:def:crs:OGC:1.3:CRS84"),new Cb("urn:ogc:def:crs:OGC:2:84"),new Cb("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Cb("urn:x-ogc:def:crs:EPSG:4326","neu")];zc.PROJECTIONS=jf;var Ac={};function Ld($,r,e){var t=$.getCode(),o=r.getCode();t in Ac||(Ac[t]={}),Ac[t][o]=e}function lo($,r){var e;return $ in Ac&&r in Ac[$]&&(e=Ac[$][r]),e}var Vi={};function ko($){return Vi[$]||null}function io($,t){Vi[$]=t}var nb=null;function Ia(){return nb}function Ib(t,r){return nb?Ge(t,r,nb):t}function ka(t,r){return nb?Ge(t,nb,r):t}function $c(t,r){return nb?Hk(t,r,nb):t}function Ab(t,r){return nb?Hk(t,nb,r):t}function ho(){rk(Ze),rk(jf),zo(jf,Ze,si,ti)}ho();var c=new Array(6);function Za(){return[1,0,0,1,0,0]}function fo(e,$,t,r,o,p,n){return e[0]=$,e[1]=t,e[2]=r,e[3]=o,e[4]=p,e[5]=n,e}function co(e,$){return e[0]=$[0],e[1]=$[1],e[2]=$[2],e[3]=$[3],e[4]=$[4],e[5]=$[5],e}function sa(e,$){var t=$[0],r=$[1];return $[0]=e[0]*t+e[2]*r+e[4],$[1]=e[1]*t+e[3]*r+e[5],$}function _n(e,$,t){return fo(e,$,0,0,t,0,0)}function rb(e,$,t,r,o,p,n,A){var P=Math.sin(p),s=Math.cos(p);return e[0]=r*s,e[1]=o*P,e[2]=-r*P,e[3]=o*s,e[4]=n*r*s-A*r*P+$,e[5]=n*o*P+A*o*s+t,e}function Kf(e,$){var t=$n($);ia(0!==t,32);var r=$[0],o=$[1],p=$[2],n=$[3],A=$[4],P=$[5];return e[0]=n/t,e[1]=-o/t,e[2]=-p/t,e[3]=r/t,e[4]=(p*P-n*A)/t,e[5]=-(r*P-o*A)/t,e}function $n(e){return e[0]*e[3]-e[1]*e[2]}function Pf(e){return"matrix("+e.join(", ")+")"}var Zn=Og&&Og.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),Hj=Za(),Qf=function(t){function r(){var r=t.call(this)||this;return r.extent_=Ga(),r.extentRevision_=-1,r.simplifiedGeometryMaxMinSquaredTolerance=0,r.simplifiedGeometryRevision=0,r.simplifyTransformedInternal=lq(function(t,r,e){if(!e)return this.getSimplifiedGeometry(r);var o=this.clone();return o.applyTransform(e),o.getSimplifiedGeometry(r)}),r}return Zn(r,t),r.prototype.simplifyTransformed=function(t,r){return this.simplifyTransformedInternal(this.getRevision(),t,r)},r.prototype.clone=function(){return ca()},r.prototype.closestPointXY=function(t,r,e,o){return ca()},r.prototype.containsXY=function(t,r){var e=this.getClosestPoint([t,r]);return e[0]===t&&e[1]===r},r.prototype.getClosestPoint=function(t,r){var e=r||[NaN,NaN];return this.closestPointXY(t[0],t[1],e,1/0),e},r.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},r.prototype.computeExtent=function(t){return ca()},r.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),$o(this.extent_,t)},r.prototype.rotate=function(t,r){ca()},r.prototype.scale=function(t,r,e){ca()},r.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},r.prototype.getSimplifiedGeometry=function(t){return ca()},r.prototype.getType=function(){return ca()},r.prototype.applyTransform=function(t){ca()},r.prototype.intersectsExtent=function(t){return ca()},r.prototype.translate=function(t,r){ca()},r.prototype.transform=function(t,r){var e=va(t),o=e.getUnits()==Da.TILE_PIXELS?function(t,o,n){var s=e.getExtent(),i=e.getWorldExtent(),$=ab(i)/ab(s);return rb(Hj,i[0],i[3],$,-$,0,0,0),Jb(t,0,t.length,n,Hj,o),_c(e,r)(t,o,n)}:_c(e,r);return this.applyTransform(o),this},r}(Oa);Og.default=Qf;var Yn=Tc&&Tc.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),eb=function(t){function r(){var r=t.call(this)||this;return r.layout=pa.XY,r.stride=2,r.flatCoordinates=null,r}return Yn(r,t),r.prototype.computeExtent=function(t){return aj(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinates=function(){return ca()},r.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},r.prototype.getFlatCoordinates=function(){return this.flatCoordinates},r.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},r.prototype.getLayout=function(){return this.layout},r.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var r=this.getSimplifiedGeometryInternal(t);return r.getFlatCoordinates().length<this.flatCoordinates.length?r:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},r.prototype.getSimplifiedGeometryInternal=function(t){return this},r.prototype.getStride=function(){return this.stride},r.prototype.setFlatCoordinates=function(t,r){this.stride=Vf(t),this.layout=t,this.flatCoordinates=r},r.prototype.setCoordinates=function(t,r){ca()},r.prototype.setLayout=function(t,r,e){var o;if(t)o=Vf(t);else{for(var i=0;i<e;++i){if(0===r.length)return this.layout=pa.XY,void(this.stride=2);r=r[0]}t=Wn(o=r.length)}this.layout=t,this.stride=o},r.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},r.prototype.rotate=function(t,r){var e=this.getFlatCoordinates();if(e){var o=this.getStride();vj(e,0,e.length,o,t,r,e),this.changed()}},r.prototype.scale=function(t,r,e){var o=r;void 0===o&&(o=t);var i=e;i||(i=Gb(this.getExtent()));var n=this.getFlatCoordinates();if(n){var a=this.getStride();Fo(n,0,n.length,a,t,o,i,n),this.changed()}},r.prototype.translate=function(t,r){var e=this.getFlatCoordinates();if(e){var o=this.getStride();Aj(e,0,e.length,o,t,r,e),this.changed()}},r}(Qf);function Wn(t){var r;return 2==t?r=pa.XY:3==t?r=pa.XYZ:4==t&&(r=pa.XYZM),r}function Vf(t){var r;return t==pa.XY?r=2:t==pa.XYZ||t==pa.XYM?r=3:t==pa.XYZM&&(r=4),r}function Uj(t,r,e){var o=t.getFlatCoordinates();if(o){var i=t.getStride();return Jb(o,0,o.length,i,r,e)}return null}Tc.getStrideForLayout=Vf,Tc.transformGeom2D=Uj,Tc.default=eb;function Zj(r,n,$,e){for(var i=0,t=r[$-e],a=r[$-e+1];n<$;n+=e){var o=r[n],g=r[n+1];i+=a*o-t*g,t=o,a=g}return i/2}function dk(r,n,$,e){for(var i=0,t=0,a=$.length;t<a;++t){var o=$[t];i+=Zj(r,n,o,e),n=o}return i}function Vn(r,n,$,e){for(var i=0,t=0,a=$.length;t<a;++t){var o=$[t];i+=dk(r,n,o,e),n=o[o.length-1]}return i}function lk(r,a,t,e,$,s,o){var n,i=r[a],l=r[a+1],M=r[t]-i,u=r[t+1]-l;if(0===M&&0===u)n=a;else{var x=(($-i)*M+(s-l)*u)/(M*M+u*u);if(x>1)n=t;else{if(x>0){for(var p=0;p<e;++p)o[p]=kc(r[a+p],r[t+p],x);return void(o.length=e)}n=a}}for(p=0;p<e;++p)o[p]=r[n+p];o.length=e}function Wf(r,a,t,e,$){var s=r[a],o=r[a+1];for(a+=e;a<t;a+=e){var n=r[a],i=r[a+1],l=Wb(s,o,n,i);l>$&&($=l),s=n,o=i}return $}function Xf(r,a,t,e,$){for(var s=0,o=t.length;s<o;++s){var n=t[s];$=Wf(r,a,n,e,$),a=n}return $}function Tn(r,a,t,e,$){for(var s=0,o=t.length;s<o;++s){var n=t[s];$=Xf(r,a,n,e,$),a=n[n.length-1]}return $}function Zf(r,a,t,e,$,s,o,n,i,l,M){if(a==t)return l;var u,x;if(0===$){if((x=Wb(o,n,r[a],r[a+1]))<l){for(u=0;u<e;++u)i[u]=r[a+u];return i.length=e,x}return l}for(var p=M||[NaN,NaN],f=a+e;f<t;)if(lk(r,f-e,f,e,o,n,p),(x=Wb(o,n,p[0],p[1]))<l){for(l=x,u=0;u<e;++u)i[u]=p[u];i.length=e,f+=e}else f+=e*Math.max((Math.sqrt(x)-Math.sqrt(l))/$|0,1);if(s&&(lk(r,t-e,a,e,o,n,p),(x=Wb(o,n,p[0],p[1]))<l)){for(l=x,u=0;u<e;++u)i[u]=p[u];i.length=e}return l}function Pe(r,a,t,e,$,s,o,n,i,l,M){for(var u=M||[NaN,NaN],x=0,p=t.length;x<p;++x){var f=t[x];l=Zf(r,a,f,e,$,s,o,n,i,l,u),a=f}return l}function Pn(r,a,t,e,$,s,o,n,i,l,M){for(var u=M||[NaN,NaN],x=0,p=t.length;x<p;++x){var f=t[x];l=Pe(r,a,f,e,$,s,o,n,i,l,u),a=f[f.length-1]}return l}function Fk(e,r,t,o){for(var a=0,$=t.length;a<$;++a)e[r++]=t[a];return r}function Dd(e,r,t,o){for(var a=0,$=t.length;a<$;++a)for(var n=t[a],d=0;d<o;++d)e[r++]=n[d];return r}function gg(e,r,t,o,a){for(var $=a||[],n=0,d=0,l=t.length;d<l;++d){var f=Dd(e,r,t[d],o);$[n++]=f,r=f}return $.length=n,$}function Mn(e,r,t,o,a){for(var $=a||[],n=0,d=0,l=t.length;d<l;++d){var f=gg(e,r,t[d],o,$[n]);$[n++]=f,r=f[f.length-1]}return $.length=n,$}function Mc(r,n,t,e,o){for(var a=void 0!==o?o:[],l=0,i=n;i<t;i+=e)a[l++]=r.slice(i,i+e);return a.length=l,a}function Cd(r,n,t,e,o){for(var a=void 0!==o?o:[],l=0,i=0,$=t.length;i<$;++i){var f=t[i];a[l++]=Mc(r,n,f,e,a[l]),n=f}return a.length=l,a}function Bh(r,n,t,e,o){for(var a=void 0!==o?o:[],l=0,i=0,$=t.length;i<$;++i){var f=t[i];a[l++]=Cd(r,n,f,e,a[l]),n=f[f.length-1]}return a.length=l,a}function lg(r,t,$,e,p,a,o){var n=($-t)/e;if(n<3){for(;t<$;t+=e)a[o++]=r[t],a[o++]=r[t+1];return o}var u=new Array(n);u[0]=1,u[n-1]=1;for(var i=[t,$-e],s=0;i.length>0;){for(var E=i.pop(),I=i.pop(),x=0,l=r[I],c=r[I+1],f=r[E],g=r[E+1],d=I+e;d<E;d+=e){var v=r[d],y=r[d+1],h=op(v,y,l,c,f,g);h>x&&(s=d,x=h)}x>p&&(u[(s-t)/e]=1,I+e<s&&i.push(I,s),s+e<E&&i.push(s,E))}for(d=0;d<n;++d)u[d]&&(a[o++]=r[t+d*e],a[o++]=r[t+d*e+1]);return o}function Ln(r,t,$,e,p,a,o,n){for(var u=0,i=$.length;u<i;++u){var s=$[u];o=lg(r,t,s,e,p,a,o),n.push(o),t=s}return o}function Vb(r,t){return t*Math.round(r/t)}function Jn(r,t,$,e,p,a,o){if(t==$)return o;var n,u,i=Vb(r[t],p),s=Vb(r[t+1],p);t+=e,a[o++]=i,a[o++]=s;do{if(n=Vb(r[t],p),u=Vb(r[t+1],p),(t+=e)==$)return a[o++]=n,a[o++]=u,o}while(n==i&&u==s);for(;t<$;){var E=Vb(r[t],p),I=Vb(r[t+1],p);if(t+=e,E!=n||I!=u){var x=n-i,l=u-s,c=E-i,f=I-s;x*f==l*c&&(x<0&&c<x||x==c||x>0&&c>x)&&(l<0&&f<l||l==f||l>0&&f>l)?(n=E,u=I):(a[o++]=n,a[o++]=u,i=n,s=u,n=E,u=I)}}return a[o++]=n,a[o++]=u,o}function Lh(r,t,$,e,p,a,o,n){for(var u=0,i=$.length;u<i;++u){var s=$[u];o=Jn(r,t,s,e,p,a,o),n.push(o),t=s}return o}function In(r,t,$,e,p,a,o,n){for(var u=0,i=$.length;u<i;++u){var s=$[u],E=[];o=Lh(r,t,s,e,p,a,o,E),n.push(E),t=s[s.length-1]}return o}var Fn=Gg&&Gg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),pg=function(t){function e(e,r){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?o.setCoordinates(e,r):o.setFlatCoordinates(r,e),o}return Fn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,o){return o<Rb(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Zf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,o))},e.prototype.getArea=function(){return Zj(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Mc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=lg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,pa.XY)},e.prototype.getType=function(){return aa.LINEAR_RING},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=Dd(this.flatCoordinates,0,t,this.stride),this.changed()},e}(eb);Gg.default=pg;var qg={};var En=qg&&qg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),kb=function(t){function e(e,r){var o=t.call(this)||this;return o.setCoordinates(e,r),o}return En(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,o){var n=this.flatCoordinates,i=Wb(t,e,n[0],n[1]);if(i<o){for(var s=this.stride,a=0;a<s;++a)r[a]=n[a];return r.length=s,i}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return Xd(this.flatCoordinates,t)},e.prototype.getType=function(){return aa.POINT},e.prototype.intersectsExtent=function(t){return Be(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=Fk(this.flatCoordinates,0,t,this.stride),this.changed()},e}(eb);qg.default=kb;function Dn(n,r,t,i,e){return!sj(e,function(e){return!Zb(n,r,t,i,e[0],e[1])})}function Zb(n,r,t,i,e,$){for(var o=0,a=n[t-i],d=n[t-i+1];r<t;r+=i){var s=n[r],l=n[r+1];d<=$?l>$&&(s-a)*($-d)-(e-a)*(l-d)>0&&o++:l<=$&&(s-a)*($-d)-(e-a)*(l-d)<0&&o--,a=s,d=l}return 0!==o}function zg(n,r,t,i,e,$){if(0===t.length)return!1;if(!Zb(n,r,t[0],i,e,$))return!1;for(var o=1,a=t.length;o<a;++o)if(Zb(n,t[o-1],t[o],i,e,$))return!1;return!0}function Cn(n,r,t,i,e,$){if(0===t.length)return!1;for(var o=0,a=t.length;o<a;++o){var d=t[o];if(zg(n,r,d,i,e,$))return!0;r=d[d.length-1]}return!1}function Yh(r,t,e,o,n,$,i){for(var a,v,s,N,p,f,u,g=n[$+1],D=[],U=0,l=e.length;U<l;++U){var x=e[U];for(N=r[x-o],f=r[x-o+1],a=t;a<x;a+=o)p=r[a],u=r[a+1],(g<=f&&u<=g||f<=g&&g<=u)&&(s=(g-f)/(u-f)*(p-N)+N,D.push(s)),N=p,f=u}var y=NaN,h=-1/0;for(D.sort(xb),N=D[0],a=1,v=D.length;a<v;++a){p=D[a];var A=Math.abs(p-N);A>h&&(s=(N+p)/2,zg(r,t,e,o,s,g)&&(y=s,h=A)),N=p}return isNaN(y)&&(y=n[$]),i?(i.push(y,g,h),i):[y,g,h]}function Bn(r,t,e,o,n){for(var $=[],i=0,a=e.length;i<a;++i){var v=e[i];$=Yh(r,t,v,o,n,2*i,$),t=v[v.length-1]}return $}function zd(r,i,t,e,n){var $=oj(Ga(),r,i,t,e);return!!Fa(n,$)&&(!!fb(n,$)||$[0]>=n[0]&&$[2]<=n[2]||$[1]>=n[1]&&$[3]<=n[3]||di(r,i,t,e,function(r,i){return Zo(n,r,i)}))}function An(r,i,t,e,n){for(var $=0,s=t.length;$<s;++$){if(zd(r,i,t[$],e,n))return!0;i=t[$]}return!1}function Ik(r,i,t,e,n){return!!zd(r,i,t,e,n)||!!Zb(r,i,t,e,n[0],n[1])||!!Zb(r,i,t,e,n[0],n[3])||!!Zb(r,i,t,e,n[2],n[1])||!!Zb(r,i,t,e,n[2],n[3])}function bi(r,i,t,e,n){if(!Ik(r,i,t[0],e,n))return!1;if(1===t.length)return!0;for(var $=1,s=t.length;$<s;++$)if(Dn(r,t[$-1],t[$],e,n)&&!zd(r,t[$-1],t[$],e,n))return!1;return!0}function yn(r,i,t,e,n){for(var $=0,s=t.length;$<s;++$){var o=t[$];if(bi(r,i,o,e,n))return!0;i=o[o.length-1]}return!1}function di(r,$,o,t,e){for(var f,i=[r[$],r[$+1]],a=[];$+t<o;$+=t){if(a[0]=r[$+t],a[1]=r[$+t+1],f=e(i,a))return f;i[0]=a[0],i[1]=a[1]}return!1}function ei(r,e,n,i){for(var $=0,t=r[n-i],o=r[n-i+1];e<n;e+=i){var s=r[e],a=r[e+1];$+=(s-t)*(a+o),t=s,o=a}return $>0}function fi(r,e,n,i,$){for(var t=void 0!==$&&$,o=0,s=n.length;o<s;++o){var a=n[o],c=ei(r,e,a,i);if(0===o){if(t&&c||!t&&!c)return!1}else if(t&&!c||!t&&c)return!1;e=a}return!0}function wn(r,e,n,i,$){for(var t=0,o=n.length;t<o;++t){var s=n[t];if(!fi(r,e,s,i,$))return!1;s.length&&(e=s[s.length-1])}return!0}function Eg(r,e,n,i,$){for(var t=void 0!==$&&$,o=0,s=n.length;o<s;++o){var a=n[o],c=ei(r,e,a,i);(0===o?t&&c||!t&&!c:t&&!c||!t&&c)&&vn(r,e,a,i),e=a}return e}function mi(r,e,n,i,$){for(var t=0,o=n.length;t<o;++t)e=Eg(r,e,n[t],i,$);return e}function vn(o,r,e,$){for(;r<e-$;){for(var t=0;t<$;++t){var a=o[r+t];o[r+t]=o[e-$+t],o[e-$+t]=a}r+=$,e-=$}}var pn=Lb&&Lb.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),bb=function(t){function e(e,r,i){var o=t.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,void 0!==r&&i?(o.setFlatCoordinates(r,e),o.ends_=i):o.setCoordinates(e,r),o}return pn(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Na(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,i){return i<Rb(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xf(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pe(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,i))},e.prototype.containsXY=function(t,e){return zg(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return dk(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Eg(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Cd(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Gb(this.getExtent());this.flatInteriorPoint_=Yh(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new kb(this.getFlatInteriorPoint(),pa.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new pg(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,i=[],o=0,n=0,s=r.length;n<s;++n){var a=r[n],$=new pg(e.slice(o,a),t);i.push($),o=a}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;fi(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Eg(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=Lh(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,i),new e(r,pa.XY,i)},e.prototype.getType=function(){return aa.POLYGON},e.prototype.intersectsExtent=function(t){return bi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=gg(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(eb);function on(t,e,r,i){for(var o=r||32,n=[],s=0;s<o;++s)Na(n,ro(t,e,2*Math.PI*s/o,i));return n.push(n[0],n[1]),new bb(n,pa.XY,[n.length])}function Db(t){var e=t[0],r=t[1],i=t[2],o=t[3],n=[e,r,e,o,i,o,i,r,e,r];return new bb(n,pa.XY,[n.length])}function oc(t,e,r){for(var i=e||32,o=t.getStride(),n=t.getLayout(),s=t.getCenter(),a=o*(i+1),$=new Array(a),w=0;w<a;w+=o){$[w]=0,$[w+1]=0;for(var l=2;l<o;l++)$[w+l]=s[l]}var p=[$.length],h=new bb($,n,p);return Pg(h,s,t.getRadius(),r),h}function Pg(t,e,r,i){for(var o=t.getFlatCoordinates(),n=t.getStride(),s=o.length/n-1,a=i||0,$=0;$<=s;++$){var w=$*n,l=a+2*Ub($,s)*Math.PI/s;o[w]=e[0]+r*Math.cos(l),o[w+1]=e[1]+r*Math.sin(l)}t.changed()}Lb.default=bb,Lb.circular=on,Lb.fromExtent=Db,Lb.fromCircle=oc,Lb.makeRegular=Pg;var jn=$b&&$b.__extends||function(){var t=function(o,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])})(o,e)};return function(o,e){function i(){this.constructor=o}t(o,e),o.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Qg=0,wd=function(t){function o(o){var e=t.call(this)||this,i=Ca({},o);return e.hints_=[0,0],e.animations_=[],e.updateAnimationKey_,e.projection_=qh(i.projection,"EPSG:3857"),e.viewportSize_=[100,100],e.targetCenter_=null,e.targetResolution_,e.targetRotation_,e.cancelAnchor_=void 0,i.center&&(i.center=ka(i.center,e.projection_)),i.extent&&(i.extent=Ab(i.extent,e.projection_)),e.applyOptions_(i),e}return jn(o,t),o.prototype.applyOptions_=function(t){var o=Gi(t);this.maxResolution_=o.maxResolution,this.minResolution_=o.minResolution,this.zoomFactor_=o.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=o.minZoom;var e=Ei(t),i=o.constraint,n=Ii(t);this.constraints_={center:e,resolution:i,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},o.prototype.getUpdatedOptions_=function(t){var o=Ca({},this.options_);return void 0!==o.resolution?o.resolution=this.getResolution():o.zoom=this.getZoom(),o.center=this.getCenterInternal(),o.rotation=this.getRotation(),Ca({},o,t)},o.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var o=new Array(arguments.length),e=0;e<o.length;++e){var i=arguments[e];i.center&&((i=Ca({},i)).center=ka(i.center,this.getProjection())),i.anchor&&((i=Ca({},i)).anchor=ka(i.anchor,this.getProjection())),o[e]=i}this.animateInternal.apply(this,o)},o.prototype.animateInternal=function(t){var o,e=arguments.length;if(e>1&&"function"==typeof arguments[e-1]&&(o=arguments[e-1],--e),!this.isDef()){var i=arguments[e-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(o&&ud(o,!0))}for(var n=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,h=[],p=0;p<e;++p){var $=arguments[p],u={start:n,complete:!1,anchor:$.anchor,duration:void 0!==$.duration?$.duration:1e3,easing:$.easing||Jo,callback:o};if($.center&&(u.sourceCenter=r,u.targetCenter=$.center.slice(),r=u.targetCenter),void 0!==$.zoom?(u.sourceResolution=s,u.targetResolution=this.getResolutionForZoom($.zoom),s=u.targetResolution):$.resolution&&(u.sourceResolution=s,u.targetResolution=$.resolution,s=u.targetResolution),void 0!==$.rotation){u.sourceRotation=a;var l=Ub($.rotation-a+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=a+l,a=u.targetRotation}Ji(u)?u.complete=!0:n+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(ya.ANIMATING,1),this.updateAnimations_()},o.prototype.getAnimating=function(){return this.hints_[ya.ANIMATING]>0},o.prototype.getInteracting=function(){return this.hints_[ya.INTERACTING]>0},o.prototype.cancelAnimations=function(){var t;this.setHint(ya.ANIMATING,-this.hints_[ya.ANIMATING]);for(var o=0,e=this.animations_.length;o<e;++o){var i=this.animations_[o];if(i[0].callback&&ud(i[0].callback,!1),!t)for(var n=0,r=i.length;n<r;++n){var s=i[n];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},o.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),o=!1,e=this.animations_.length-1;e>=0;--e){for(var i=this.animations_[e],n=!0,r=0,s=i.length;r<s;++r){var a=i[r];if(!a.complete){var h=t-a.start,p=a.duration>0?h/a.duration:1;p>=1?(a.complete=!0,p=1):n=!1;var $=a.easing(p);if(a.sourceCenter){var u=a.sourceCenter[0],l=a.sourceCenter[1],c=u+$*(a.targetCenter[0]-u),m=l+$*(a.targetCenter[1]-l);this.targetCenter_=[c,m]}if(a.sourceResolution&&a.targetResolution){var g=1===$?a.targetResolution:a.sourceResolution+$*(a.targetResolution-a.sourceResolution);if(a.anchor){var E=this.getViewportSize_(this.getRotation()),N=this.constraints_.resolution(g,0,E,!0);this.targetCenter_=this.calculateCenterZoom(N,a.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var _=1===$?Ub(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+$*(a.targetRotation-a.sourceRotation);if(a.anchor){var q=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(q,a.anchor)}this.targetRotation_=_}if(this.applyTargetState_(!0),o=!0,!a.complete)break}}if(n){this.animations_[e]=null,this.setHint(ya.ANIMATING,-1);var R=i[0].callback;R&&ud(R,!0)}}this.animations_=this.animations_.filter(Boolean),o&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},o.prototype.calculateCenterRotate=function(t,o){var e,i=this.getCenterInternal();return void 0!==i&&(e=[i[0]-o[0],i[1]-o[1]],hg(e,t-this.getRotation()),Po(e,o)),e},o.prototype.calculateCenterZoom=function(t,o){var e,i=this.getCenterInternal(),n=this.getResolution();void 0!==i&&void 0!==n&&(e=[o[0]-t*(o[0]-i[0])/n,o[1]-t*(o[1]-i[1])/n]);return e},o.prototype.getViewportSize_=function(t){var o=this.viewportSize_;if(t){var e=o[0],i=o[1];return[Math.abs(e*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(e*Math.sin(t))+Math.abs(i*Math.cos(t))]}return o},o.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.resolveConstraints(0)},o.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Ib(t,this.getProjection()):t},o.prototype.getCenterInternal=function(){return this.get(Ma.CENTER)},o.prototype.getConstraints=function(){return this.constraints_},o.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},o.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},o.prototype.calculateExtent=function(t){var o=this.calculateExtentInternal(t);return $c(o,this.getProjection())},o.prototype.calculateExtentInternal=function(t){var o=t||this.getViewportSize_(),e=this.getCenterInternal();ia(e,1);var i=this.getResolution();ia(void 0!==i,2);var n=this.getRotation();return ia(void 0!==n,3),Pj(e,i,n,o)},o.prototype.getMaxResolution=function(){return this.maxResolution_},o.prototype.getMinResolution=function(){return this.minResolution_},o.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},o.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},o.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},o.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},o.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},o.prototype.getProjection=function(){return this.projection_},o.prototype.getResolution=function(){return this.get(Ma.RESOLUTION)},o.prototype.getResolutions=function(){return this.resolutions_},o.prototype.getResolutionForExtent=function(t,o){return this.getResolutionForExtentInternal(Ab(t,this.getProjection()),o)},o.prototype.getResolutionForExtentInternal=function(t,o){var e=o||this.getViewportSize_(),i=ta(t)/e[0],n=ab(t)/e[1];return Math.max(i,n)},o.prototype.getResolutionForValueFunction=function(t){var o=t||2,e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(o);return function(t){return e/Math.pow(o,t*n)}},o.prototype.getRotation=function(){return this.get(Ma.ROTATION)},o.prototype.getValueForResolutionFunction=function(t){var o=Math.log(t||2),e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/o;return function(t){return Math.log(e/t)/o/n}},o.prototype.getState=function(){var t=this.getCenterInternal(),o=this.getProjection(),e=this.getResolution(),i=this.getRotation();return{center:t.slice(0),projection:void 0!==o?o:null,resolution:e,rotation:i,zoom:this.getZoom()}},o.prototype.getZoom=function(){var t,o=this.getResolution();return void 0!==o&&(t=this.getZoomForResolution(o)),t},o.prototype.getZoomForResolution=function(t){var o,e,i=this.minZoom_||0;if(this.resolutions_){var n=Lg(this.resolutions_,t,1);i=n,o=this.resolutions_[n],e=n==this.resolutions_.length-1?2:o/this.resolutions_[n+1]}else o=this.maxResolution_,e=this.zoomFactor_;return i+Math.log(o/t)/Math.log(e)},o.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var o=wa(Math.floor(t),0,this.resolutions_.length-2),e=this.resolutions_[o]/this.resolutions_[o+1];return this.resolutions_[o]/Math.pow(e,wa(t-o,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},o.prototype.fit=function(t,o){var e,i=Ca({size:this.getViewportSize_()},o||{});if(ia(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){ia(!Af(t),25);var n=Ab(t,this.getProjection());e=Db(n)}else if(t.getType()===aa.CIRCLE){n=Ab(t.getExtent(),this.getProjection());(e=Db(n)).rotate(this.getRotation(),Gb(n))}else{var r=Ia();e=r?t.clone().transform(r,this.getProjection()):t}this.fitInternal(e,i)},o.prototype.fitInternal=function(t,o){var e=o||{},i=e.size;i||(i=this.getViewportSize_());var n,r=void 0!==e.padding?e.padding:[0,0,0,0],s=void 0!==e.nearest&&e.nearest;n=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;for(var a=t.getFlatCoordinates(),h=this.getRotation(),p=Math.cos(-h),$=Math.sin(-h),u=1/0,l=1/0,c=-1/0,m=-1/0,g=t.getStride(),E=0,N=a.length;E<N;E+=g){var _=a[E]*p-a[E+1]*$,q=a[E]*$+a[E+1]*p;u=Math.min(u,_),l=Math.min(l,q),c=Math.max(c,_),m=Math.max(m,q)}var R=this.getResolutionForExtentInternal([u,l,c,m],[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);R=isNaN(R)?n:Math.max(R,n),R=this.getConstrainedResolution(R,s?0:1),$=-$;var v=(u+c)/2,f=(l+m)/2,d=[(v+=(r[1]-r[3])/2*R)*p-(f+=(r[0]-r[2])/2*R)*$,f*p+v*$],y=e.callback?e.callback:qb;void 0!==e.duration?this.animateInternal({resolution:R,center:this.getConstrainedCenter(d,R),duration:e.duration,easing:e.easing},y):(this.targetResolution_=R,this.targetCenter_=d,this.applyTargetState_(!1,!0),ud(y,!0))},o.prototype.centerOn=function(t,o,e){this.centerOnInternal(ka(t,this.getProjection()),o,e)},o.prototype.centerOnInternal=function(t,o,e){var i=this.getRotation(),n=Math.cos(-i),r=Math.sin(-i),s=t[0]*n-t[1]*r,a=t[1]*n+t[0]*r,h=this.getResolution(),p=(s+=(o[0]/2-e[0])*h)*n-(a+=(e[1]-o[1]/2)*h)*(r=-r),$=a*n+s*r;this.setCenterInternal([p,$])},o.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},o.prototype.adjustCenter=function(t){var o=Ib(this.targetCenter_,this.getProjection());this.setCenter([o[0]+t[0],o[1]+t[1]])},o.prototype.adjustCenterInternal=function(t){var o=this.targetCenter_;this.setCenterInternal([o[0]+t[0],o[1]+t[1]])},o.prototype.adjustResolution=function(t,o){var e=o&&ka(o,this.getProjection());this.adjustResolutionInternal(t,e)},o.prototype.adjustResolutionInternal=function(t,o){var e=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,i,e);o&&(this.targetCenter_=this.calculateCenterZoom(n,o)),this.targetResolution_*=t,this.applyTargetState_()},o.prototype.adjustZoom=function(t,o){this.adjustResolution(Math.pow(this.zoomFactor_,-t),o)},o.prototype.adjustRotation=function(t,o){o&&(o=ka(o,this.getProjection())),this.adjustRotationInternal(t,o)},o.prototype.adjustRotationInternal=function(t,o){var e=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,e);o&&(this.targetCenter_=this.calculateCenterRotate(i,o)),this.targetRotation_+=t,this.applyTargetState_()},o.prototype.setCenter=function(t){this.setCenterInternal(ka(t,this.getProjection()))},o.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},o.prototype.setHint=function(t,o){return this.hints_[t]+=o,this.changed(),this.hints_[t]},o.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},o.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},o.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},o.prototype.applyTargetState_=function(t,o){var e=this.getAnimating()||this.getInteracting()||o,i=this.constraints_.rotation(this.targetRotation_,e),n=this.getViewportSize_(i),r=this.constraints_.resolution(this.targetResolution_,0,n,e),s=this.constraints_.center(this.targetCenter_,r,n,e);this.get(Ma.ROTATION)!==i&&this.set(Ma.ROTATION,i),this.get(Ma.RESOLUTION)!==r&&this.set(Ma.RESOLUTION,r),this.get(Ma.CENTER)&&Xa(this.get(Ma.CENTER),s)||this.set(Ma.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},o.prototype.resolveConstraints=function(t,o,e){var i=void 0!==t?t:200,n=o||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,n,s),h=this.constraints_.center(this.targetCenter_,a,s);if(0===i&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=h,void this.applyTargetState_();var p=e||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===r&&this.getCenterInternal()&&Xa(this.getCenterInternal(),h)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:h,resolution:a,duration:i,easing:Ob,anchor:p}))},o.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(ya.INTERACTING,1)},o.prototype.endInteraction=function(t,o,e){var i=e&&ka(e,this.getProjection());this.endInteractionInternal(t,o,i)},o.prototype.endInteractionInternal=function(t,o,e){this.setHint(ya.INTERACTING,-1),this.resolveConstraints(t,o,e)},o.prototype.getConstrainedCenter=function(t,o){var e=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,o||this.getResolution(),e)},o.prototype.getConstrainedZoom=function(t,o){var e=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(e,o))},o.prototype.getConstrainedResolution=function(t,o){var e=o||0,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)},o}(Oa);function ud(t,o){setTimeout(function(){t(o)},0)}function Ei(t){if(void 0!==t.extent){var o=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return mj(t.extent,t.constrainOnlyCenter,o)}var e=qh(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){var i=e.getExtent().slice();return i[0]=-1/0,i[2]=1/0,mj(i,!1,!1)}return sp}function Gi(t){var o,e,i,n=void 0!==t.minZoom?t.minZoom:Qg,r=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,$=qh(t.projection,"EPSG:3857"),u=$.getExtent(),l=t.constrainOnlyCenter,c=t.extent;if(a||c||!$.isGlobal()||(l=!1,c=u),void 0!==t.resolutions){var m=t.resolutions;e=m[n],i=void 0!==m[r]?m[r]:m[m.length-1],o=t.constrainResolution?kp(m,h,!l&&c,p):Sh(e,i,h,!l&&c,p)}else{var g=(u?Math.max(ta(u),ab(u)):360*Wa[Da.DEGREES]/$.getMetersPerUnit())/Jf/Math.pow(2,Qg),E=g/Math.pow(2,28-Qg);void 0!==(e=t.maxResolution)?n=0:e=g/Math.pow(s,n),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?e/Math.pow(s,r):g/Math.pow(s,r):E),r=n+Math.floor(Math.log(e/i)/Math.log(s)),i=e/Math.pow(s,r-n),o=t.constrainResolution?jp(s,e,i,h,!l&&c,p):Sh(e,i,h,!l&&c,p)}return{constraint:o,maxResolution:e,minResolution:i,minZoom:n,zoomFactor:s}}function Ii(t){if(void 0===t.enableRotation||t.enableRotation){var o=t.constrainRotation;return void 0===o||!0===o?Ro():!1===o?Wh:"number"==typeof o?Uo(o):Wh}return Hf}function Ji(t){return!(t.sourceCenter&&t.targetCenter&&!Xa(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation}$b.createCenterConstraint=Ei,$b.createResolutionConstraint=Gi,$b.createRotationConstraint=Ii,$b.isNoopAnimation=Ji,$b.default=wd;function Ja(e,o,r){var t=r&&r.length?r.shift():ue?new OffscreenCanvas(e||300,o||300):document.createElement("canvas");return e&&(t.width=e),o&&(t.height=o),t.getContext("2d")}function hn(e){var o=e.offsetWidth,r=getComputedStyle(e);return o+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function gn(e){var o=e.offsetHeight,r=getComputedStyle(e);return o+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function hc(e,o){var r=o.parentNode;r&&r.replaceChild(e,o)}function qd(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}function Ri(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function fn(e,o){for(var r=e.childNodes,t=0;;++t){var n=r[t],$=o[t];if(!n&&!$)break;n!==$&&(n?$?e.insertBefore($,n):(e.removeChild(n),--t):e.appendChild($))}}var th={};var uh={};var ma={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source"};var en=uh&&uh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Ce=function(t){function e(e){var r=t.call(this)||this,o=Ca({},e);return o[ma.OPACITY]=void 0!==e.opacity?e.opacity:1,ia("number"==typeof o[ma.OPACITY],64),o[ma.VISIBLE]=void 0===e.visible||e.visible,o[ma.Z_INDEX]=e.zIndex,o[ma.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,o[ma.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,o[ma.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,o[ma.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,r.setProperties(o),r.state_=null,r}return en(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},r=this.getZIndex();return e.opacity=wa(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return ca()},e.prototype.getLayerStatesArray=function(t){return ca()},e.prototype.getExtent=function(){return this.get(ma.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(ma.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(ma.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(ma.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(ma.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(ma.OPACITY)},e.prototype.getSourceState=function(){return ca()},e.prototype.getVisible=function(){return this.get(ma.VISIBLE)},e.prototype.getZIndex=function(){return this.get(ma.Z_INDEX)},e.prototype.setExtent=function(t){this.set(ma.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(ma.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(ma.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(ma.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(ma.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){ia("number"==typeof t,64),this.set(ma.OPACITY,t)},e.prototype.setVisible=function(t){this.set(ma.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(ma.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(Oa);uh.default=Ce;var Tb={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var dn=th&&th.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fe={LAYERS:"layers"},ej=function(e){function t(t){var n=this,r=t||{},i=Ca({},r);delete i.layers;var o=r.layers;return(n=e.call(this,i)||this).layersListenerKeys_=[],n.listenerKeys_={},n.addEventListener(qa(Fe.LAYERS),n.handleLayersChanged_),o?Array.isArray(o)?o=new za(o.slice(),{unique:!0}):ia("function"==typeof o.getArray,43):o=new za(void 0,{unique:!0}),n.setLayers(o),n}return dn(t,e),t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(ja),this.layersListenerKeys_.length=0;var e=this.getLayers();for(var t in this.layersListenerKeys_.push(fa(e,ra.ADD,this.handleLayersAdd_,this),fa(e,ra.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[t].forEach(ja);wc(this.listenerKeys_);for(var n=e.getArray(),r=0,i=n.length;r<i;r++){var o=n[r];this.listenerKeys_[ga(o)]=[fa(o,ub.PROPERTYCHANGE,this.handleLayerChange_,this),fa(o,ba.CHANGE,this.handleLayerChange_,this)]}this.changed()},t.prototype.handleLayersAdd_=function(e){var t=e.element;this.listenerKeys_[ga(t)]=[fa(t,ub.PROPERTYCHANGE,this.handleLayerChange_,this),fa(t,ba.CHANGE,this.handleLayerChange_,this)],this.changed()},t.prototype.handleLayersRemove_=function(e){var t=e.element,n=ga(t);this.listenerKeys_[n].forEach(ja),delete this.listenerKeys_[n],this.changed()},t.prototype.getLayers=function(){return this.get(Fe.LAYERS)},t.prototype.setLayers=function(e){this.set(Fe.LAYERS,e)},t.prototype.getLayersArray=function(e){var t=void 0!==e?e:[];return this.getLayers().forEach(function(e){e.getLayersArray(t)}),t},t.prototype.getLayerStatesArray=function(e){var t=void 0!==e?e:[],n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});for(var r=this.getLayerState(),i=n,o=t.length;i<o;i++){var s=t[i];s.opacity*=r.opacity,s.visible=s.visible&&r.visible,s.maxResolution=Math.min(s.maxResolution,r.maxResolution),s.minResolution=Math.max(s.minResolution,r.minResolution),s.minZoom=Math.max(s.minZoom,r.minZoom),s.maxZoom=Math.min(s.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==s.extent?s.extent=Lc(s.extent,r.extent):s.extent=r.extent)}return t},t.prototype.getSourceState=function(){return Tb.READY},t}(Ce);th.default=ej;function cn($){return $[0]>0&&$[1]>0}function bn($,r,e){return void 0===e&&(e=[0,0]),e[0]=$[0]*r+.5|0,e[1]=$[1]*r+.5|0,e}function zb($,r){return Array.isArray($)?$:(void 0===r?r=[$,$]:(r[0]=$,r[1]=$),r)}var an=Gf&&Gf.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Je=function(e){function t(t){var r=e.call(this)||this,i=_m(t);r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,r.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:ve,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=Za(),r.pixelToCoordinateTransform_=Za(),r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=new Gk(r,t.moveTolerance);var n=r.handleMapBrowserEvent.bind(r);for(var o in ha)r.mapBrowserEventHandler_.addEventListener(ha[o],n);r.keyboardEventTarget_=i.keyboardEventTarget,r.keyHandlerKeys_=null;var a=r.handleBrowserEvent.bind(r);return r.viewport_.addEventListener(ba.CONTEXTMENU,a,!1),r.viewport_.addEventListener(ba.WHEEL,a,!!kj&&{passive:!1}),r.controls=i.controls||new za,r.interactions=i.interactions||new za,r.overlays_=i.overlays,r.overlayIdIndex_={},r.renderer_=null,r.handleResize_,r.postRenderFunctions_=[],r.tileQueue_=new Pi(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addEventListener(qa(Ba.LAYERGROUP),r.handleLayerGroupChanged_),r.addEventListener(qa(Ba.VIEW),r.handleViewChanged_),r.addEventListener(qa(Ba.SIZE),r.handleSizeChanged_),r.addEventListener(qa(Ba.TARGET),r.handleTargetChanged_),r.setProperties(i.values),r.controls.forEach(function(e){e.setMap(this)}.bind(r)),r.controls.addEventListener(ra.ADD,function(e){e.element.setMap(this)}.bind(r)),r.controls.addEventListener(ra.REMOVE,function(e){e.element.setMap(null)}.bind(r)),r.interactions.forEach(function(e){e.setMap(this)}.bind(r)),r.interactions.addEventListener(ra.ADD,function(e){e.element.setMap(this)}.bind(r)),r.interactions.addEventListener(ra.REMOVE,function(e){e.element.setMap(null)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r.overlays_.addEventListener(ra.ADD,function(e){this.addOverlayInternal_(e.element)}.bind(r)),r.overlays_.addEventListener(ra.REMOVE,function(e){var t=e.element.getId();void 0!==t&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}.bind(r)),r}return an(t,e),t.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},t.prototype.addControl=function(e){this.getControls().push(e)},t.prototype.addInteraction=function(e){this.getInteractions().push(e)},t.prototype.addLayer=function(e){this.getLayerGroup().getLayers().push(e)},t.prototype.addOverlay=function(e){this.getOverlays().push(e)},t.prototype.addOverlayInternal_=function(e){var t=e.getId();void 0!==t&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)},t.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),this.viewport_.removeEventListener(ba.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ba.WHEEL,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(ba.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.setTarget(null),e.prototype.disposeInternal.call(this)},t.prototype.forEachFeatureAtPixel=function(e,t,r){if(this.frameState_){var i=this.getCoordinateFromPixelInternal(e),n=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==r.layerFilter?r.layerFilter:La,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,n,a,t,null,o,null)}},t.prototype.getFeaturesAtPixel=function(e,t){var r=[];return this.forEachFeatureAtPixel(e,function(e){r.push(e)},t),r},t.prototype.forEachLayerAtPixel=function(e,t,r){if(this.frameState_){var i=r||{},n=void 0!==i.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=i.layerFilter||La;return this.renderer_.forEachLayerAtPixel(e,this.frameState_,n,t,o)}},t.prototype.hasFeatureAtPixel=function(e,t){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(e),i=void 0!==(t=void 0!==t?t:{}).layerFilter?t.layerFilter:La,n=void 0!==t.hitTolerance?t.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==t.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,n,o,i,null)},t.prototype.getEventCoordinate=function(e){return this.getCoordinateFromPixel(this.getEventPixel(e))},t.prototype.getEventCoordinateInternal=function(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))},t.prototype.getEventPixel=function(e){var t=this.viewport_.getBoundingClientRect(),r="changedTouches"in e?e.changedTouches[0]:e;return[r.clientX-t.left,r.clientY-t.top]},t.prototype.getTarget=function(){return this.get(Ba.TARGET)},t.prototype.getTargetElement=function(){var e=this.getTarget();return void 0!==e?"string"==typeof e?document.getElementById(e):e:null},t.prototype.getCoordinateFromPixel=function(e){return Ib(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())},t.prototype.getCoordinateFromPixelInternal=function(e){var t=this.frameState_;return t?sa(t.pixelToCoordinateTransform,e.slice()):null},t.prototype.getControls=function(){return this.controls},t.prototype.getOverlays=function(){return this.overlays_},t.prototype.getOverlayById=function(e){var t=this.overlayIdIndex_[e.toString()];return void 0!==t?t:null},t.prototype.getInteractions=function(){return this.interactions},t.prototype.getLayerGroup=function(){return this.get(Ba.LAYERGROUP)},t.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},t.prototype.getLoading=function(){for(var e=this.getLayerGroup().getLayerStatesArray(),t=0,r=e.length;t<r;++t){var i=e[t].layer.getSource();if(i&&i.loading)return!0}return!1},t.prototype.getPixelFromCoordinate=function(e){var t=ka(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)},t.prototype.getPixelFromCoordinateInternal=function(e){var t=this.frameState_;return t?sa(t.coordinateToPixelTransform,e.slice(0,2)):null},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.getSize=function(){return this.get(Ba.SIZE)},t.prototype.getView=function(){return this.get(Ba.VIEW)},t.prototype.getViewport=function(){return this.viewport_},t.prototype.getOverlayContainer=function(){return this.overlayContainer_},t.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},t.prototype.getTilePriority=function(e,t,r,i){return Qi(this.frameState_,e,t,r,i)},t.prototype.handleBrowserEvent=function(e,t){var r=t||e.type,i=new ug(r,this,e);this.handleMapBrowserEvent(i)},t.prototype.handleMapBrowserEvent=function(e){if(this.frameState_){var t=e.originalEvent.target;if(e.dragging||!this.overlayContainerStopEvent_.contains(t)&&(document.body.contains(t)||this.viewport_.getRootNode&&this.viewport_.getRootNode().contains(t))){e.frameState=this.frameState_;var r=this.getInteractions().getArray();if(!1!==this.dispatchEvent(e))for(var i=r.length-1;i>=0;i--){var n=r[i];if(n.getActive())if(!n.handleEvent(e))break}}}},t.prototype.handlePostRender=function(){var e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){var r=this.maxTilesLoading_,i=r;if(e){var n=e.viewHints;if(n[ya.ANIMATING]||n[ya.INTERACTING]){var o=!gj&&Date.now()-e.time>8;r=o?0:8,i=o?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,i))}!e||!this.hasListener(ac.RENDERCOMPLETE)||e.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(ac.RENDERCOMPLETE,e);for(var a=this.postRenderFunctions_,s=0,p=a.length;s<p;++s)a[s](this,e);a.length=0},t.prototype.handleSizeChanged_=function(){this.getView()&&this.getView().resolveConstraints(0),this.render()},t.prototype.handleTargetChanged_=function(){var e;if(this.getTarget()&&(e=this.getTargetElement()),this.keyHandlerKeys_){for(var t=0,r=this.keyHandlerKeys_.length;t<r;++t)ja(this.keyHandlerKeys_[t]);this.keyHandlerKeys_=null}if(e){e.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer());var i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.keyHandlerKeys_=[fa(i,ba.KEYDOWN,this.handleBrowserEvent,this),fa(i,ba.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(ba.RESIZE,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),qd(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(ba.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},t.prototype.handleTileChange_=function(){this.render()},t.prototype.handleViewPropertyChanged_=function(){this.render()},t.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(ja(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(ja(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=fa(e,ub.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=fa(e,ba.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()},t.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(ja),this.layerGroupPropertyListenerKeys_=null);var e=this.getLayerGroup();e&&(this.layerGroupPropertyListenerKeys_=[fa(e,ub.PROPERTYCHANGE,this.render,this),fa(e,ba.CHANGE,this.render,this)]),this.render()},t.prototype.isRendered=function(){return!!this.frameState_},t.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},t.prototype.redrawText=function(){for(var e=this.getLayerGroup().getLayerStatesArray(),t=0,r=e.length;t<r;++t){var i=e[t].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}},t.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},t.prototype.removeControl=function(e){return this.getControls().remove(e)},t.prototype.removeInteraction=function(e){return this.getInteractions().remove(e)},t.prototype.removeLayer=function(e){return this.getLayerGroup().getLayers().remove(e)},t.prototype.removeOverlay=function(e){return this.getOverlays().remove(e)},t.prototype.renderFrame_=function(e){var t=this.getSize(),r=this.getView(),i=this.frameState_,n=null;if(void 0!==t&&cn(t)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();n={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:i?i.declutterItems:[],extent:Pj(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{}}}if(this.frameState_=n,this.renderer_.renderFrame(n),n){if(n.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,n.postRenderFunctions),i)(!this.previousExtent_||!Af(this.previousExtent_)&&!vc(n.extent,this.previousExtent_))&&(this.dispatchEvent(new Hc(dc.MOVESTART,this,i)),this.previousExtent_=sc(this.previousExtent_));this.previousExtent_&&!n.viewHints[ya.ANIMATING]&&!n.viewHints[ya.INTERACTING]&&!vc(n.extent,this.previousExtent_)&&(this.dispatchEvent(new Hc(dc.MOVEEND,this,n)),pi(n.extent,this.previousExtent_))}this.dispatchEvent(new Hc(dc.POSTRENDER,this,n)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},t.prototype.setLayerGroup=function(e){this.set(Ba.LAYERGROUP,e)},t.prototype.setSize=function(e){this.set(Ba.SIZE,e)},t.prototype.setTarget=function(e){this.set(Ba.TARGET,e)},t.prototype.setView=function(e){this.set(Ba.VIEW,e)},t.prototype.updateSize=function(){var e=this.getTargetElement();if(e){var t=getComputedStyle(e);this.setSize([e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},t.prototype.updateViewportSize_=function(){var e=this.getView();if(e){var t=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(t=[parseInt(r.width,10),parseInt(r.height,10)]),e.setViewportSize(t)}},t}(Oa);function _m(e){var t=null;void 0!==e.keyboardEventTarget&&(t="string"==typeof e.keyboardEventTarget?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);var r,i,n,o={},a=e.layers&&"function"==typeof e.layers.getLayers?e.layers:new ej({layers:e.layers});return o[Ba.LAYERGROUP]=a,o[Ba.TARGET]=e.target,o[Ba.VIEW]=void 0!==e.view?e.view:new wd,void 0!==e.controls&&(Array.isArray(e.controls)?r=new za(e.controls.slice()):(ia("function"==typeof e.controls.getArray,47),r=e.controls)),void 0!==e.interactions&&(Array.isArray(e.interactions)?i=new za(e.interactions.slice()):(ia("function"==typeof e.interactions.getArray,48),i=e.interactions)),void 0!==e.overlays?Array.isArray(e.overlays)?n=new za(e.overlays.slice()):(ia("function"==typeof e.overlays.getArray,49),n=e.overlays):n=new za,{controls:r,interactions:i,keyboardEventTarget:t,overlays:n,values:o}}Gf.default=Je;function $m(o){var r=o||{},t=new za;return(void 0===r.zoom||r.zoom)&&t.push(new bk(r.zoomOptions)),(void 0===r.rotate||r.rotate)&&t.push(new Xj(r.rotateOptions)),(void 0===r.attribution||r.attribution)&&t.push(new Sj(r.attributionOptions)),t}var od={};var Me={};var Zm=Me&&Me.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ta=function(e){function t(t){var r=e.call(this)||this;return r.element=t.element?t.element:null,r.target_=null,r.map_=null,r.listenerKeys=[],r.render_=t.render?t.render:qb,t.target&&r.setTarget(t.target),r}return Zm(t,e),t.prototype.disposeInternal=function(){qd(this.element),e.prototype.disposeInternal.call(this)},t.prototype.getMap=function(){return this.map_},t.prototype.setMap=function(e){this.map_&&qd(this.element);for(var t=0,r=this.listenerKeys.length;t<r;++t)ja(this.listenerKeys[t]);(this.listenerKeys.length=0,this.map_=e,this.map_)&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==qb&&this.listenerKeys.push(fa(e,dc.POSTRENDER,this.render,this)),e.render())},t.prototype.render=function(e){this.render_.call(this,e)},t.prototype.setTarget=function(e){this.target_="string"==typeof e?document.getElementById(e):e},t}(Oa);Me.default=Ta;var nd="ol-hidden";var Xm="ol-selectable";var Va="ol-unselectable";var Vm="ol-unsupported";var Nb="ol-control";var kd="ol-collapsed";var Sm=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"),Jj=["style","variant","weight","size","lineHeight","family"],Lj=function(e){var $=e.match(Sm);if(!$)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},t=0,a=Jj.length;t<a;++t){var o=$[t+1];void 0!==o&&(r[Jj[t]]=o)}return r.families=r.family.split(/,\s?/),r};var jd={};var Rm=jd&&jd.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),Xe=function(e){function r(r){var t=this,n=Ca({},r);delete n.source,(t=e.call(this,n)||this).mapPrecomposeKey_=null,t.mapRenderKey_=null,t.sourceChangeKey_=null,t.renderer_=null,r.render&&(t.render=r.render),r.map&&t.setMap(r.map),t.addEventListener(qa(ma.SOURCE),t.handleSourcePropertyChange_);var o=r.source?r.source:null;return t.setSource(o),t}return Rm(r,e),r.prototype.getLayersArray=function(e){var r=e||[];return r.push(this),r},r.prototype.getLayerStatesArray=function(e){var r=e||[];return r.push(this.getLayerState()),r},r.prototype.getSource=function(){return this.get(ma.SOURCE)||null},r.prototype.getSourceState=function(){var e=this.getSource();return e?e.getState():Tb.UNDEFINED},r.prototype.handleSourceChange_=function(){this.changed()},r.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(ja(this.sourceChangeKey_),this.sourceChangeKey_=null);var e=this.getSource();e&&(this.sourceChangeKey_=fa(e,ba.CHANGE,this.handleSourceChange_,this)),this.changed()},r.prototype.getFeatures=function(e){return this.renderer_.getFeatures(e)},r.prototype.render=function(e,r){var t=this.getRenderer();if(t.prepareFrame(e))return t.renderFrame(e,r)},r.prototype.setMap=function(e){this.mapPrecomposeKey_&&(ja(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(ja(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=fa(e,ac.PRECOMPOSE,function(e){var r=e.frameState.layerStatesArray,t=this.getLayerState(!1);ia(!r.some(function(e){return e.layer===t.layer}),67),r.push(t)},this),this.mapRenderKey_=fa(this,ba.CHANGE,e.render,e),this.changed())},r.prototype.setSource=function(e){this.set(ma.SOURCE,e)},r.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},r.prototype.hasRenderer=function(){return!!this.renderer_},r.prototype.createRenderer=function(){return null},r.prototype.disposeInternal=function(){this.setSource(null),e.prototype.disposeInternal.call(this)},r}(Ce);function Yc(e,r){if(!e.visible)return!1;var t=r.resolution;if(t<e.minResolution||t>=e.maxResolution)return!1;var n=r.zoom;return n>e.minZoom&&n<=e.maxZoom}jd.inView=Yc,jd.default=Xe;var Qm=od&&od.__extends||function(){var e=function(t,l){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(t,l)};return function(t,l){function r(){this.constructor=t}e(t,l),t.prototype=null===l?Object.create(l):(r.prototype=l.prototype,new r)}}(),Sj=function(e){function t(t){var l=this,r=t||{};(l=e.call(this,{element:document.createElement("div"),render:r.render||Tj,target:r.target})||this).ulElement_=document.createElement("ul"),l.collapsed_=void 0===r.collapsed||r.collapsed,l.overrideCollapsible_=void 0!==r.collapsible,l.collapsible_=void 0===r.collapsible||r.collapsible,l.collapsible_||(l.collapsed_=!1);var o=void 0!==r.className?r.className:"ol-attribution",i=void 0!==r.tipLabel?r.tipLabel:"Attributions",a=void 0!==r.collapseLabel?r.collapseLabel:"\xBB";"string"==typeof a?(l.collapseLabel_=document.createElement("span"),l.collapseLabel_.textContent=a):l.collapseLabel_=a;var s=void 0!==r.label?r.label:"i";"string"==typeof s?(l.label_=document.createElement("span"),l.label_.textContent=s):l.label_=s;var n=l.collapsible_&&!l.collapsed_?l.collapseLabel_:l.label_,p=document.createElement("button");p.setAttribute("type","button"),p.title=i,p.appendChild(n),p.addEventListener(ba.CLICK,l.handleClick_.bind(l),!1);var c=o+" "+Va+" "+Nb+(l.collapsed_&&l.collapsible_?" "+kd:"")+(l.collapsible_?"":" ol-uncollapsible"),d=l.element;return d.className=c,d.appendChild(l.ulElement_),d.appendChild(p),l.renderedAttributions_=[],l.renderedVisible_=!0,l}return Qm(t,e),t.prototype.collectSourceAttributions_=function(e){for(var t={},l=[],r=e.layerStatesArray,o=0,i=r.length;o<i;++o){var a=r[o];if(Yc(a,e.viewState)){var s=a.layer.getSource();if(s){var n=s.getAttributions();if(n){var p=n(e);if(p)if(this.overrideCollapsible_||!1!==s.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(p))for(var c=0,d=p.length;c<d;++c)p[c]in t||(l.push(p[c]),t[p[c]]=!0);else p in t||(l.push(p),t[p]=!0)}}}}return l},t.prototype.updateElement_=function(e){if(e){var t=this.collectSourceAttributions_(e),l=t.length>0;if(this.renderedVisible_!=l&&(this.element.style.display=l?"":"none",this.renderedVisible_=l),!pc(t,this.renderedAttributions_)){Ri(this.ulElement_);for(var r=0,o=t.length;r<o;++r){var i=document.createElement("li");i.innerHTML=t[r],this.ulElement_.appendChild(i)}this.renderedAttributions_=t}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t.prototype.handleClick_=function(e){e.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(kd),this.collapsed_?hc(this.collapseLabel_,this.label_):hc(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(e){this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t}(Ta);function Tj(e){this.updateElement_(e.frameState)}od.render=Tj,od.default=Sj;var hd={};var Om=hd&&hd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Xj=function(t){function e(e){var r=this,o=e||{};r=t.call(this,{element:document.createElement("div"),render:o.render||Yj,target:o.target})||this;var s=void 0!==o.className?o.className:"ol-rotate",a=void 0!==o.label?o.label:"\u21E7";r.label_=null,"string"==typeof a?(r.label_=document.createElement("span"),r.label_.className="ol-compass",r.label_.textContent=a):(r.label_=a,r.label_.classList.add("ol-compass"));var i=o.tipLabel?o.tipLabel:"Reset rotation",n=document.createElement("button");n.className=s+"-reset",n.setAttribute("type","button"),n.title=i,n.appendChild(r.label_),n.addEventListener(ba.CLICK,r.handleClick_.bind(r),!1);var l=s+" "+Va+" "+Nb,$=r.element;return $.className=l,$.appendChild(n),r.callResetNorth_=o.resetNorth?o.resetNorth:void 0,r.duration_=void 0!==o.duration?o.duration:250,r.autoHide_=void 0===o.autoHide||o.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(nd),r}return Om(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:Ob}):t.setRotation(0))}},e}(Ta);function Yj(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var o="rotate("+r+"rad)";if(this.autoHide_){var s=this.element.classList.contains(nd);s||0!==r?s&&0!==r&&this.element.classList.remove(nd):this.element.classList.add(nd)}this.label_.style.transform=o}this.rotation_=r}}hd.render=Yj,hd.default=Xj;var af={};var Mm=af&&af.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),bk=function(t){function e(e){var o=this,n=e||{};o=t.call(this,{element:document.createElement("div"),target:n.target})||this;var r=void 0!==n.className?n.className:"ol-zoom",a=void 0!==n.delta?n.delta:1,i=void 0!==n.zoomInLabel?n.zoomInLabel:"+",p=void 0!==n.zoomOutLabel?n.zoomOutLabel:"\u2212",l=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",d=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",s=document.createElement("button");s.className=r+"-in",s.setAttribute("type","button"),s.title=l,s.appendChild("string"==typeof i?document.createTextNode(i):i),s.addEventListener(ba.CLICK,o.handleClick_.bind(o,a),!1);var u=document.createElement("button");u.className=r+"-out",u.setAttribute("type","button"),u.title=d,u.appendChild("string"==typeof p?document.createTextNode(p):p),u.addEventListener(ba.CLICK,o.handleClick_.bind(o,-a),!1);var c=r+" "+Va+" "+Nb,$=o.element;return $.className=c,$.appendChild(s),$.appendChild(u),o.duration_=void 0!==n.duration?n.duration:250,o}return Mm(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 o=e.getZoom();if(void 0!==o){var n=e.getConstrainedZoom(o+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:Ob})):e.setZoom(n)}}},e}(Ta);af.default=bk;var bf={};var Km=bf&&bf.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function l(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(l.prototype=r.prototype,new l)}}(),gk=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],hk={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},Jm=function(e){function t(t){var r=this,l=t||{};(r=e.call(this,{element:document.createElement("div"),target:l.target})||this).cssClassName_=void 0!==l.className?l.className:"ol-full-screen";var s=void 0!==l.label?l.label:"\u2922";r.labelNode_="string"==typeof s?document.createTextNode(s):s;var n=void 0!==l.labelActive?l.labelActive:"\xD7";r.labelActiveNode_="string"==typeof n?document.createTextNode(n):n,r.button_=document.createElement("button");var o=l.tipLabel?l.tipLabel:"Toggle full-screen";r.setClassName_(r.button_,df()),r.button_.setAttribute("type","button"),r.button_.title=o,r.button_.appendChild(r.labelNode_),r.button_.addEventListener(ba.CLICK,r.handleClick_.bind(r),!1);var u=r.cssClassName_+" "+Va+" "+Nb+" "+(kk()?"":Vm),c=r.element;return c.className=u,c.appendChild(r.button_),r.keys_=void 0!==l.keys&&l.keys,r.source_=l.source,r}return Km(t,e),t.prototype.handleClick_=function(e){e.preventDefault(),this.handleFullScreen_()},t.prototype.handleFullScreen_=function(){if(kk()){var e=this.getMap();if(e)if(df())Gm();else{var t=void 0;t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?Im(t):ok(t)}}},t.prototype.handleFullScreenChange_=function(){var e=this.getMap();df()?(this.setClassName_(this.button_,!0),hc(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(hk.ENTERFULLSCREEN)):(this.setClassName_(this.button_,!1),hc(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(hk.LEAVEFULLSCREEN)),e&&e.updateSize()},t.prototype.setClassName_=function(e,t){var r=this.cssClassName_+"-true",l=this.cssClassName_+"-false",s=t?r:l;e.classList.remove(r),e.classList.remove(l),e.classList.add(s)},t.prototype.setMap=function(t){if(e.prototype.setMap.call(this,t),t)for(var r=0,l=gk.length;r<l;++r)this.listenerKeys.push(fa(document,gk[r],this.handleFullScreenChange_,this))},t}(Ta);function kk(){var e=document.body;return!!(e.webkitRequestFullscreen||e.msRequestFullscreen&&document.msFullscreenEnabled||e.requestFullscreen&&document.fullscreenEnabled)}function df(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function ok(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function Im(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():ok(e)}function Gm(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}bf.default=Jm;var cd={};var Dm=cd&&cd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),gf="projection",xk="coordinateFormat",Bm=function(t){function e(e){var r=this,o=e||{},n=document.createElement("div");return n.className=void 0!==o.className?o.className:"ol-mouse-position",(r=t.call(this,{element:n,render:o.render||Bk,target:o.target})||this).addEventListener(qa(gf),r.handleProjectionChanged_),o.coordinateFormat&&r.setCoordinateFormat(o.coordinateFormat),o.projection&&r.setProjection(o.projection),r.undefinedHTML_=void 0!==o.undefinedHTML?o.undefinedHTML:"&#160;",r.renderOnMouseOut_=!!r.undefinedHTML_,r.renderedHTML_=n.innerHTML,r.mapProjection_=null,r.transform_=null,r}return Dm(e,t),e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get(xk)},e.prototype.getProjection=function(){return this.get(gf)},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},e.prototype.handleMouseOut=function(t){this.updateHTML_(null)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var r=e.getViewport();this.listenerKeys.push(fa(r,hb.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(fa(r,hb.POINTEROUT,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set(xk,t)},e.prototype.setProjection=function(t){this.set(gf,va(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var r=this.getProjection();this.transform_=r?ic(this.mapProjection_,r):Mj}var o=this.getMap().getCoordinateFromPixelInternal(t);if(o){var n=Ia();n&&(this.transform_=ic(this.mapProjection_,n)),this.transform_(o,o);var i=this.getCoordinateFormat();e=i?i(o):o.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e}(Ta);function Bk(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}cd.render=Bk,cd.default=Bm;var Jd={};var kf={};var lf={};var Am=lf&&lf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nf=function(t){function e(e,r,n,o){var $=t.call(this,e)||this;return $.inversePixelTransform=r,$.frameState=n,$.context=o,$}return Am(e,t),e}(Ea);lf.default=nf;var of={};var zm=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ym=/^([a-z]*)$|^hsla?\(.*\)$/i;function xm(r){return"string"==typeof r?r:Hh(r)}function um(r){var e=document.createElement("div");if(e.style.color=r,""!==e.style.color){document.body.appendChild(e);var $=getComputedStyle(e).color;return document.body.removeChild(e),$}return""}var sm=function(){var r={},e=0;return function($){var t;if(r.hasOwnProperty($))t=r[$];else{if(e>=1024){var o=0;for(var a in r)0==(3&o++)&&(delete r[a],--e)}t=qm($),r[$]=t,++e}return t}}();function Eh(r){return Array.isArray(r)?r:sm(r)}function qm(r){var e,$,t,o,a;if(ym.exec(r)&&(r=um(r)),zm.exec(r)){var u=r.length-1,n=void 0;n=u<=4?1:2;var c=4===u||8===u;e=parseInt(r.substr(1+0*n,n),16),$=parseInt(r.substr(1+1*n,n),16),t=parseInt(r.substr(1+2*n,n),16),o=c?parseInt(r.substr(1+3*n,n),16):255,1==n&&(e=(e<<4)+e,$=($<<4)+$,t=(t<<4)+t,c&&(o=(o<<4)+o)),a=[e,$,t,o/255]}else 0==r.indexOf("rgba(")?Gh(a=r.slice(5,-1).split(",").map(Number)):0==r.indexOf("rgb(")?((a=r.slice(4,-1).split(",").map(Number)).push(1),Gh(a)):ia(!1,14);return a}function Gh(r){return r[0]=wa(r[0]+.5|0,0,255),r[1]=wa(r[1]+.5|0,0,255),r[2]=wa(r[2]+.5|0,0,255),r[3]=wa(r[3],0,1),r}function Hh(r){var e=r[0];e!=(0|e)&&(e=e+.5|0);var $=r[1];$!=(0|$)&&($=$+.5|0);var t=r[2];return t!=(0|t)&&(t=t+.5|0),"rgba("+e+","+$+","+t+","+(void 0===r[3]?1:r[3])+")"}var pm=function(){function e(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return e.prototype.clear=function(){this.cache_={},this.cacheSize_=0},e.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},e.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var t in this.cache_){var r=this.cache_[t];0!=(3&e++)||r.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},e.prototype.get=function(e,t,r){var i=Jh(e,t,r);return i in this.cache_?this.cache_[i]:null},e.prototype.set=function(e,t,r,i){var o=Jh(e,t,r);this.cache_[o]=i,++this.cacheSize_},e.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},e}();function Jh(e,t,r){return t+":"+e+":"+(r?xm(r):"null")}var gd=new pm;function mm(e,r){r&&r.clear();for(var t=e.declutterItems,$=t.length-1;$>=0;--$)for(var o=t[$],i=o.items,n=0,a=i.length;n<a;n+=3)r=i[n].renderDeclutter(i[n+1],i[n+2],o.opacity,r);return t.length=0,r}var xf={};function $a(r){return Array.isArray(r)?Hh(r):r}var Oh=function(){function t(){}return t.prototype.drawCustom=function(t,o,e){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,o){},t.prototype.drawFeature=function(t,o){},t.prototype.drawGeometryCollection=function(t,o){},t.prototype.drawLineString=function(t,o){},t.prototype.drawMultiLineString=function(t,o){},t.prototype.drawMultiPoint=function(t,o){},t.prototype.drawMultiPolygon=function(t,o){},t.prototype.drawPoint=function(t,o){},t.prototype.drawPolygon=function(t,o){},t.prototype.drawText=function(t,o){},t.prototype.setFillStrokeStyle=function(t,o){},t.prototype.setImageStyle=function(t,o){},t.prototype.setTextStyle=function(t,o){},t}();var Ph="10px sans-serif";var lb="#000";var tc="round";var ld=[];var md=0;var qc="round";var Pc=10;var Nc="#000";var Gc="center";var rd="middle";var gc=[0,0,0,0];var Dc=1;var db=new Oa;var lm=new Pb;lm.setSize=function(){console.warn("labelCache is deprecated.")};var jm,vd=null,Of={};var hm=function(){var e,t,$=100,r="32px ",i=["monospace","serif"],a=i.length,o="wmytzilWMYTZIL@#/&?$%10\uF013";function n(e,$,n){for(var s=!0,A=0;A<a;++A){var x=i[A];if(t=yd(e+" "+$+" "+r+x,o),n!=x){var p=yd(e+" "+$+" "+r+n+","+x,o);s=s&&p!=t}}return!!s}function s(){for(var t=!0,r=db.getKeys(),i=0,a=r.length;i<a;++i){var o=r[i];db.get(o)<$&&(n.apply(this,o.split("\n"))?(wc(Of),vd=null,jm=void 0,db.set(o,$)):(db.set(o,db.get(o)+1,!0),t=!1))}t&&(clearInterval(e),e=void 0)}return function(t){var r=Lj(t);if(r)for(var i=r.families,a=0,o=i.length;a<o;++a){var A=i[a],x=r.style+"\n"+r.weight+"\n"+A;void 0===db.get(x)&&(db.set(x,$,!0),n(r.style,r.weight,A)||(db.set(x,0,!0),void 0===e&&(e=setInterval(s,32))))}}}();var gm=function(){var e,t=Of;return function($){var r=t[$];if(null==r)if(ue){var i=Lj($),a=gi($,"\u017Dg"),o=isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight);Of[$]=o*(a.actualBoundingBoxAscent+a.actualBoundingBoxDescent)}else e||((e=document.createElement("div")).innerHTML="M",e.style.margin="0 !important",e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=$,document.body.appendChild(e),r=e.offsetHeight,t[$]=r,document.body.removeChild(e);return r}}();function gi(e,t){return vd||(vd=Ja(1,1)),e!=jm&&(vd.font=e,jm=vd.font),vd.measureText(t)}function yd(e,t){return gi(e,t).width}function ii(e,t,$){if(t in $)return $[t];var r=yd(e,t);return $[t]=r,r}function fm(e,t,$){for(var r=t.length,i=0,a=0;a<r;++a){var o=yd(e,t[a]);i=Math.max(i,o),$.push(o)}return i}function ki(e,t,$,r){0!==t&&(e.translate($,r),e.rotate(t),e.translate(-$,-r))}function li(e,t,$,r,i,a,o,n,s,A,x){e.save(),1!==$&&(e.globalAlpha*=$),t&&e.setTransform.apply(e,t),r.contextInstructions?(e.translate(s,A),e.scale(x,x),em(r,e)):e.drawImage(r,i,a,o,n,s,A,o*x,n*x),e.restore()}function em(e,t){for(var $=e.contextInstructions,r=0,i=$.length;r<i;r+=2)Array.isArray($[r+1])?t[$[r]].apply(t,$[r+1]):t[$[r]]=$[r+1]}var Uf=null;function mq(e){return ue?Pf(e):(Uf||(Uf=Ja(1,1).canvas),Uf.style.transform=Pf(e),Uf.style.transform)}var dm=xf&&xf.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qi=function(t){function e(e,i,o,r,s,a,n){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=r,l.viewRotation_=s,l.squaredTolerance_=a,l.userTransform_=n,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,l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=0,l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=Za(),l}return dm(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var r=Jb(t,e,i,2,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.tmpLocalTransform_,n=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=n*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var h=0,f=r.length;h<f;h+=2){var _=r[h]-this.imageAnchorX_,m=r[h+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_){var p=_+this.imageAnchorX_,g=m+this.imageAnchorY_;rb(a,p,g,this.imageScale_,this.imageScale_,l,-p,-g),s.setTransform.apply(s,a)}s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,_,m,this.imageWidth_,this.imageHeight_)}0===l&&1==this.imageScale_||s.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(s.globalAlpha=n)}},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 r=Jb(t,e,i,o,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var n=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_){var h=rb(this.tmpLocalTransform_,n,l,this.textScale_,this.textScale_,a,-n,-l);s.setTransform.apply(s,h)}this.textStrokeState_&&s.strokeText(this.text_,n,l),this.textFillState_&&s.fillText(this.text_,n,l)}0===a&&1==this.textScale_||s.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,i,o,r){var s=this.context_,a=Jb(t,e,i,o,this.transform_,this.pixelCoordinates_);s.moveTo(a[0],a[1]);var n=a.length;r&&(n-=2);for(var l=2;l<n;l+=2)s.lineTo(a[l],a[l+1]);return r&&s.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var r=0,s=i.length;r<s;++r)e=this.moveToLineTo_(t,e,i[r],o,!0);return e},e.prototype.drawCircle=function(t){if(Fa(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=Uj(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],r=Math.sqrt(i*i+o*o),s=this.context_;s.beginPath(),s.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.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 aa.POINT:this.drawPoint(t);break;case aa.LINE_STRING:this.drawLineString(t);break;case aa.POLYGON:this.drawPolygon(t);break;case aa.MULTI_POINT:this.drawMultiPoint(t);break;case aa.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case aa.MULTI_POLYGON:this.drawMultiPolygon(t);break;case aa.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case aa.CIRCLE:this.drawCircle(t);}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Fa(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_)),Fa(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(Fa(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),r=0,s=t.getEnds(),a=t.getStride();i.beginPath();for(var n=0,l=s.length;n<l;++n)r=this.moveToLineTo_(o,r,s[n],a,!1);i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoints();this.drawText_(h,0,h.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Fa(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_)),Fa(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,r=t.getEndss(),s=t.getStride();e.beginPath();for(var a=0,n=r.length;a<n;++a){var l=r[a];o=this.drawRings_(i,o,l,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var h=t.getFlatInteriorPoints();this.drawText_(h,0,h.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&&(pc(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:Gc;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){if(t){var i=t.getColor();this.fillState_={fillStyle:$a(i||lb)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),n=e.getLineJoin(),l=e.getWidth(),h=e.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:tc,lineDash:s||ld,lineDashOffset:a||md,lineJoin:void 0!==n?n:qc,lineWidth:this.pixelRatio_*(void 0!==l?l:Dc),miterLimit:void 0!==h?h:Pc,strokeStyle:$a(o||Nc)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),o=t.getOrigin(),r=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=r[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageWidth_=r[0]}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:$a(i||lb)}}else this.textFillState_=null;var o=t.getStroke();if(o){var r=o.getColor(),s=o.getLineCap(),a=o.getLineDash(),n=o.getLineDashOffset(),l=o.getLineJoin(),h=o.getWidth(),f=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==s?s:tc,lineDash:a||ld,lineDashOffset:n||md,lineJoin:void 0!==l?l:qc,lineWidth:void 0!==h?h:Dc,miterLimit:void 0!==f?f:Pc,strokeStyle:$a(r||Nc)}}else this.textStrokeState_=null;var _=t.getFont(),m=t.getOffsetX(),p=t.getOffsetY(),g=t.getRotateWithView(),$=t.getRotation(),x=t.getScale(),S=t.getText(),c=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:void 0!==_?_:Ph,textAlign:void 0!==c?c:Gc,textBaseline:void 0!==d?d:rd},this.text_=void 0!==S?S:"",this.textOffsetX_=void 0!==m?this.pixelRatio_*m:0,this.textOffsetY_=void 0!==p?this.pixelRatio_*p:0,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0!==$?$:0,this.textScale_=this.pixelRatio_*(void 0!==x?x:1)}else this.text_=""},e}(Oh);xf.default=qi;var oa={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};var na={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var cm=.5,ui={Point:Ml,LineString:Rl,Polygon:Jl,MultiPoint:Ll,MultiLineString:Pl,MultiPolygon:Ol,GeometryCollection:Sl,Circle:Xl};function am(e,r){return parseInt(ga(e),10)-parseInt(ga(r),10)}function _l(e,r){var t=xi(e,r);return t*t}function xi(e,r){return cm*e/r}function Xl(e,r,t,a){var $=t.getFill(),i=t.getStroke();if($||i){var n=e.getBuilder(t.getZIndex(),na.CIRCLE);n.setFillStrokeStyle($,i),n.drawCircle(r,a)}var o=t.getText();if(o){var l=e.getBuilder(t.getZIndex(),na.TEXT);l.setTextStyle(o,e.addDeclutter(!1)),l.drawText(r,a)}}function zi(e,r,t,a,$,i){var n=!1,o=t.getImage();if(o){var l=o.getImageState();l==oa.LOADED||l==oa.ERROR?o.unlistenImageChange($):(l==oa.IDLE&&o.load(),l=o.getImageState(),o.listenImageChange($),n=!0)}return Wl(e,r,t,a,i),n}function Wl(e,r,t,a,$){var i=t.getGeometryFunction()(r);if(i){var n=i.simplifyTransformed(a,$);if(t.getRenderer())Bi(e,n,t,r);else(0,ui[n.getType()])(e,n,t,r)}}function Bi(e,r,t,a){if(r.getType()!=aa.GEOMETRY_COLLECTION)e.getBuilder(t.getZIndex(),na.DEFAULT).drawCustom(r,a,t.getRenderer());else for(var $=r.getGeometries(),i=0,n=$.length;i<n;++i)Bi(e,$[i],t,a)}function Sl(e,r,t,a){var $,i,n=r.getGeometriesArray();for($=0,i=n.length;$<i;++$){(0,ui[n[$].getType()])(e,n[$],t,a)}}function Rl(e,r,t,a){var $=t.getStroke();if($){var i=e.getBuilder(t.getZIndex(),na.LINE_STRING);i.setFillStrokeStyle(null,$),i.drawLineString(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!1)),o.drawText(r,a)}}function Pl(e,r,t,a){var $=t.getStroke();if($){var i=e.getBuilder(t.getZIndex(),na.LINE_STRING);i.setFillStrokeStyle(null,$),i.drawMultiLineString(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!1)),o.drawText(r,a)}}function Ol(e,r,t,a){var $=t.getFill(),i=t.getStroke();if(i||$){var n=e.getBuilder(t.getZIndex(),na.POLYGON);n.setFillStrokeStyle($,i),n.drawMultiPolygon(r,a)}var o=t.getText();if(o){var l=e.getBuilder(t.getZIndex(),na.TEXT);l.setTextStyle(o,e.addDeclutter(!1)),l.drawText(r,a)}}function Ml(e,r,t,a){var $=t.getImage();if($){if($.getImageState()!=oa.LOADED)return;var i=e.getBuilder(t.getZIndex(),na.IMAGE);i.setImageStyle($,e.addDeclutter(!1)),i.drawPoint(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!!$)),o.drawText(r,a)}}function Ll(e,r,t,a){var $=t.getImage();if($){if($.getImageState()!=oa.LOADED)return;var i=e.getBuilder(t.getZIndex(),na.IMAGE);i.setImageStyle($,e.addDeclutter(!1)),i.drawMultiPoint(r,a)}var n=t.getText();if(n){var o=e.getBuilder(t.getZIndex(),na.TEXT);o.setTextStyle(n,e.addDeclutter(!!$)),o.drawText(r,a)}}function Jl(e,r,t,a){var $=t.getFill(),i=t.getStroke();if($||i){var n=e.getBuilder(t.getZIndex(),na.POLYGON);n.setFillStrokeStyle($,i),n.drawPolygon(r,a)}var o=t.getText();if(o){var l=e.getBuilder(t.getZIndex(),na.TEXT);l.setTextStyle(o,e.addDeclutter(!1)),l.drawText(r,a)}}var Il=of&&of.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),Ki=function(e){function r(r){var t=e.call(this)||this;return t.map_=r,t.declutterTree_=null,t}return Il(r,e),r.prototype.dispatchRenderEvent=function(e,r){ca()},r.prototype.calculateMatrices2D=function(e){var r=e.viewState,t=e.coordinateToPixelTransform,o=e.pixelToCoordinateTransform;rb(t,e.size[0]/2,e.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),Kf(o,t)},r.prototype.forEachFeatureAtCoordinate=function(e,r,t,o,n,a,i,$){var c,p=r.viewState;function u(e,r,t){return n.call(a,r,e?t:null)}var h=p.projection,s=$i(e.slice(),h),l=[[0,0]];if(h.canWrapX()&&o){var f=h.getExtent(),I=ta(f);l.push([-I,0],[I,0])}var d,m=r.layerStatesArray,v=m.length;this.declutterTree_&&(d=this.declutterTree_.all().map(function(e){return e.value}));for(var y=[],_=0;_<l.length;_++)for(var x=v-1;x>=0;--x){var g=m[x],j=g.layer;if(j.hasRenderer()&&Yc(g,p)&&i.call($,j)){var C=j.getRenderer(),T=j.getSource();if(C&&T){var q=T.getWrapX()?s:e,E=u.bind(null,g.managed);y[0]=q[0]+l[_][0],y[1]=q[1]+l[_][1],c=C.forEachFeatureAtCoordinate(y,r,t,E,d)}if(c)return c}}},r.prototype.forEachLayerAtPixel=function(e,r,t,o,n){return ca()},r.prototype.hasFeatureAtCoordinate=function(e,r,t,o,n,a){return void 0!==this.forEachFeatureAtCoordinate(e,r,t,o,La,this,n,a)},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(e){this.declutterTree_=mm(e,this.declutterTree_)},r.prototype.scheduleExpireIconCache=function(e){gd.canExpireCache()&&e.postRenderFunctions.push(Gl)},r}(mf);function Gl(e,r){gd.expire()}of.default=Ki;var Fl=kf&&kf.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),ig=function(e){function r(r){var t=e.call(this,r)||this;t.fontChangeListenerKey_=fa(db,ub.PROPERTYCHANGE,r.redrawText.bind(r)),t.element_=document.createElement("div");var n=t.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",t.element_.className=Va+" ol-layers";var s=r.getViewport();return s.insertBefore(t.element_,s.firstChild||null),t.children_=[],t.renderedVisible_=!0,t}return Fl(r,e),r.prototype.dispatchRenderEvent=function(e,r){var t=this.getMap();if(t.hasListener(e)){var n=new nf(e,void 0,r);t.dispatchEvent(n)}},r.prototype.disposeInternal=function(){ja(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),e.prototype.disposeInternal.call(this)},r.prototype.renderFrame=function(r){if(r){this.calculateMatrices2D(r),this.dispatchRenderEvent(ac.PRECOMPOSE,r);var t=r.layerStatesArray.sort(function(e,r){return e.zIndex-r.zIndex}),n=r.viewState;this.children_.length=0;for(var s=null,i=0,a=t.length;i<a;++i){var o=t[i];if(r.layerIndex=i,Yc(o,n)&&(o.sourceState==Tb.READY||o.sourceState==Tb.UNDEFINED)){var $=o.layer.render(r,s);$&&$!==s&&(this.children_.push($),s=$)}}e.prototype.renderFrame.call(this,r),fn(this.element_,this.children_),this.dispatchRenderEvent(ac.POSTCOMPOSE,r),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(r)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},r.prototype.forEachLayerAtPixel=function(e,r,t,n,s){for(var i=r.viewState,a=r.layerStatesArray,o=a.length-1;o>=0;--o){var $=a[o],l=$.layer;if(l.hasRenderer()&&Yc($,i)&&s(l)){var p=l.getRenderer().getDataAtPixel(e,r,t);if(p){var c=n(l,p);if(c)return c}}}},r}(Ki);kf.default=ig;var jg={};var Ha={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var El=jg&&jg.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Aa={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},Si=function(t){function e(e){var i=t.call(this)||this;i.options=e,i.id=e.id,i.insertFirst=void 0===e.insertFirst||e.insertFirst,i.stopEvent=void 0===e.stopEvent||e.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==e.className?e.className:"ol-overlay-container "+Xm,i.element.style.position="absolute";var n=e.autoPan;return n&&"object"!=typeof n&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),i.autoPan=n||!1,i.rendered={transform_:"",visible:!0},i.mapPostrenderListenerKey=null,i.addEventListener(qa(Aa.ELEMENT),i.handleElementChanged),i.addEventListener(qa(Aa.MAP),i.handleMapChanged),i.addEventListener(qa(Aa.OFFSET),i.handleOffsetChanged),i.addEventListener(qa(Aa.POSITION),i.handlePositionChanged),i.addEventListener(qa(Aa.POSITIONING),i.handlePositioningChanged),void 0!==e.element&&i.setElement(e.element),i.setOffset(void 0!==e.offset?e.offset:[0,0]),i.setPositioning(void 0!==e.positioning?e.positioning:Ha.TOP_LEFT),void 0!==e.position&&i.setPosition(e.position),i}return El(e,t),e.prototype.getElement=function(){return this.get(Aa.ELEMENT)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Aa.MAP)},e.prototype.getOffset=function(){return this.get(Aa.OFFSET)},e.prototype.getPosition=function(){return this.get(Aa.POSITION)},e.prototype.getPositioning=function(){return this.get(Aa.POSITIONING)},e.prototype.handleElementChanged=function(){Ri(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(qd(this.element),ja(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=fa(t,dc.POSTRENDER,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Aa.ELEMENT,t)},e.prototype.setMap=function(t){this.set(Aa.MAP,t)},e.prototype.setOffset=function(t){this.set(Aa.OFFSET,t)},e.prototype.setPosition=function(t){this.set(Aa.POSITION,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Aa.POSITION)){var i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),o=this.getRect(n,[hn(n),gn(n)]),r=void 0===t.margin?20:t.margin;if(!fb(i,o)){var s=o[0]-i[0],a=i[2]-o[2],p=o[1]-i[1],$=i[3]-o[3],c=[0,0];if(s<0?c[0]=s-r:a<0&&(c[0]=Math.abs(a)+r),p<0?c[1]=p-r:$<0&&(c[1]=Math.abs($)+r),0!==c[0]||0!==c[1]){var l=e.getView().getCenterInternal(),d=e.getPixelFromCoordinateInternal(l),h=[d[0]+c[0],d[1]+c[1]],P=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(h),duration:P.duration,easing:P.easing})}}}},e.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,o=i.top+window.pageYOffset;return[n,o,n+e[0],o+e[1]]},e.prototype.setPositioning=function(t){this.set(Aa.POSITIONING,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,n=this.getOffset(),o=this.getPositioning();this.setVisible(!0);var r=Math.round(t[0]+n[0])+"px",s=Math.round(t[1]+n[1])+"px",a="0%",p="0%";o==Ha.BOTTOM_RIGHT||o==Ha.CENTER_RIGHT||o==Ha.TOP_RIGHT?a="-100%":o!=Ha.BOTTOM_CENTER&&o!=Ha.CENTER_CENTER&&o!=Ha.TOP_CENTER||(a="-50%"),o==Ha.BOTTOM_LEFT||o==Ha.BOTTOM_CENTER||o==Ha.BOTTOM_RIGHT?p="-100%":o!=Ha.CENTER_LEFT&&o!=Ha.CENTER_CENTER&&o!=Ha.CENTER_RIGHT||(p="-50%");var $="translate("+a+", "+p+") translate("+r+", "+s+")";this.rendered.transform_!=$&&(this.rendered.transform_=$,i.transform=$,i.msTransform=$)},e.prototype.getOptions=function(){return this.options},e}(Oa);jg.default=Si;var Ti=Jd&&Jd.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Od=.75,ad=.1,Dl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ti(t,e),t.prototype.createRenderer=function(){return new ig(this)},t}(Je),Cl=function(e){function t(t){var i=this,o=t||{};(i=e.call(this,{element:document.createElement("div"),render:o.render||Yi,target:o.target})||this).boundHandleRotationChanged_=i.handleRotationChanged_.bind(i),i.collapsed_=void 0===o.collapsed||o.collapsed,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1),i.rotateWithView_=void 0!==o.rotateWithView&&o.rotateWithView,i.viewExtent_=void 0;var r=void 0!==o.className?o.className:"ol-overviewmap",a=void 0!==o.tipLabel?o.tipLabel:"Overview map",n=void 0!==o.collapseLabel?o.collapseLabel:"\xAB";"string"==typeof n?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=n):i.collapseLabel_=n;var l=void 0!==o.label?o.label:"\xBB";"string"==typeof l?(i.label_=document.createElement("span"),i.label_.textContent=l):i.label_=l;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_,s=document.createElement("button");s.setAttribute("type","button"),s.title=a,s.appendChild(p),s.addEventListener(ba.CLICK,i.handleClick_.bind(i),!1),i.ovmapDiv_=document.createElement("div"),i.ovmapDiv_.className="ol-overviewmap-map",i.view_=o.view,i.ovmap_=new Dl({view:o.view});var h=i.ovmap_;o.layers&&o.layers.forEach(function(e){h.addLayer(e)});var $=document.createElement("div");$.className="ol-overviewmap-box",$.style.boxSizing="border-box",i.boxOverlay_=new Si({position:[0,0],positioning:Ha.CENTER_CENTER,element:$}),i.ovmap_.addOverlay(i.boxOverlay_);var v=r+" "+Va+" "+Nb+(i.collapsed_&&i.collapsible_?" "+kd:"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;d.className=v,d.appendChild(i.ovmapDiv_),d.appendChild(s);var c=i,_=i.boxOverlay_,u=i.boxOverlay_.getElement(),M=function(e){var t,i={clientX:(t=e).clientX,clientY:t.clientY},o=h.getEventCoordinateInternal(i);_.setPosition(o)},A=function(e){var t=h.getEventCoordinateInternal(e);c.getMap().getView().setCenterInternal(t),window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",A)};return u.addEventListener("mousedown",function(){window.addEventListener("mousemove",M),window.addEventListener("mouseup",A)}),i}return Ti(t,e),t.prototype.setMap=function(t){var i=this.getMap();if(t!==i){if(i){var o=i.getView();o&&this.unbindView_(o),this.ovmap_.setTarget(null)}if(e.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(fa(t,ub.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var r=t.getView();r&&(this.bindView_(r),r.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},t.prototype.handleMapPropertyChange_=function(e){if(e.key===Ba.VIEW){var t=e.oldValue;t&&this.unbindView_(t);var i=this.getMap().getView();this.bindView_(i)}},t.prototype.bindView_=function(e){if(!this.view_){var t=new wd({projection:e.getProjection()});this.ovmap_.setView(t)}e.addEventListener(qa(Ma.ROTATION),this.boundHandleRotationChanged_),this.handleRotationChanged_()},t.prototype.unbindView_=function(e){e.removeEventListener(qa(Ma.ROTATION),this.boundHandleRotationChanged_)},t.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},t.prototype.validateExtent_=function(){var e=this.getMap(),t=this.ovmap_;if(e.isRendered()&&t.isRendered()){var i=e.getSize(),o=e.getView().calculateExtentInternal(i);if(!this.viewExtent_||!vc(o,this.viewExtent_)){this.viewExtent_=o;var r=t.getSize(),a=t.getView().calculateExtentInternal(r),n=t.getPixelFromCoordinateInternal(Ya(o)),l=t.getPixelFromCoordinateInternal(Hb(o)),p=Math.abs(n[0]-l[0]),s=Math.abs(n[1]-l[1]),h=r[0],$=r[1];p<h*ad||s<$*ad||p>h*Od||s>$*Od?this.resetExtent_():fb(a,o)||this.recenter_()}}},t.prototype.resetExtent_=function(){if(0!==Od&&0!==ad){var e=this.getMap(),t=this.ovmap_,i=e.getSize(),o=e.getView().calculateExtentInternal(i),r=t.getView(),a=Math.log(Od/ad)/Math.LN2,n=1/(Math.pow(2,a/2)*ad);Ch(o,n),r.fitInternal(Db(o))}},t.prototype.recenter_=function(){var e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())},t.prototype.updateBox_=function(){var e=this.getMap(),t=this.ovmap_;if(e.isRendered()&&t.isRendered()){var i=e.getSize(),o=e.getView(),r=t.getView(),a=this.rotateWithView_?0:-o.getRotation(),n=this.boxOverlay_,l=this.boxOverlay_.getElement(),p=o.getCenterInternal(),s=o.getResolution(),h=r.getResolution(),$=i[0]*s/h,v=i[1]*s/h;if(n.setPosition(p),l){l.style.width=$+"px",l.style.height=v+"px";var d="rotate("+a+"rad)";l.style.transform=d}}},t.prototype.handleClick_=function(e){e.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(kd),this.collapsed_?hc(this.collapseLabel_,this.label_):hc(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var e=this.ovmap_;if(!this.collapsed_){if(e.isRendered())return this.viewExtent_=void 0,void e.render();e.updateSize(),this.resetExtent_(),Ec(e,dc.POSTRENDER,function(e){this.updateBox_()},this)}},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(e){this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.setRotateWithView=function(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},t.prototype.getOverviewMap=function(){return this.ovmap_},t}(Ta);function Yi(e){this.validateExtent_(),this.updateBox_()}Jd.render=Yi,Jd.default=Cl;var Jc={};var Bl=Jc&&Jc.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),tg="units",yb={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};Jc.Units=yb;var Al=[1,2,5],zl=function(e){function t(t){var r=this,i=t||{},s=void 0!==i.className?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return(r=e.call(this,{element:document.createElement("div"),render:i.render||dj,target:i.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=s+"-inner",r.element.className=s+" "+Va,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==i.minWidth?i.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(qa(tg),r.handleUnitsChanged_),r.setUnits(i.units||yb.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r}return Bl(t,e),t.prototype.getUnits=function(){return this.get(tg)},t.prototype.handleUnitsChanged_=function(){this.updateElement_()},t.prototype.setUnits=function(e){this.set(tg,e)},t.prototype.updateElement_=function(){var e=this.viewState_;if(e){var t=e.center,r=e.projection,i=this.getUnits(),s=i==yb.DEGREES?Da.DEGREES:Da.METERS,n=mh(r,e.resolution,t,s),a=this.minWidth_*n,o="";if(i==yb.DEGREES){var d=Wa[Da.DEGREES];(a*=d)<d/60?(o="\u2033",n*=3600):a<d?(o="\u2032",n*=60):o="\xB0"}else i==yb.IMPERIAL?a<.9144?(o="in",n/=.0254):a<1609.344?(o="ft",n/=.3048):(o="mi",n/=1609.344):i==yb.NAUTICAL?(n/=1852,o="nm"):i==yb.METRIC?a<.001?(o="\u03BCm",n*=1e6):a<1?(o="mm",n*=1e3):a<1e3?o="m":(o="km",n/=1e3):i==yb.US?a<.9144?(o="in",n*=39.37):a<1609.344?(o="ft",n/=.30480061):(o="mi",n/=1609.3472):ia(!1,33);for(var l,$,p,c,h=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){p=Math.floor(h/3);var _=Math.pow(10,p);if(l=Al[(h%3+3)%3]*_,$=Math.round(l/n),isNaN($))return this.element.style.display="none",void(this.renderedVisible_=!1);if($>=this.minWidth_)break;++h}c=this.scaleBar_?this.createScaleBar($,l,o):l.toFixed(p<0?-p:0)+" "+o,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=$&&(this.innerElement_.style.width=$+"px",this.renderedWidth_=$),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t.prototype.createScaleBar=function(e,t,r){for(var i="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],n=e/this.scaleBarSteps_,a="#ffffff",o=0;o<this.scaleBarSteps_;o++)0===o&&s.push(this.createMarker("absolute",o)),s.push("<div><div class=\"ol-scale-singlebar\" style=\"width: "+n+"px;background-color: "+a+";\"></div>"+this.createMarker("relative",o)+(o%2==0||2===this.scaleBarSteps_?this.createStepText(o,e,!1,t,r):"")+"</div>"),o===this.scaleBarSteps_-1&&s.push(this.createStepText(o+1,e,!0,t,r)),a="#ffffff"===a?"#000000":"#ffffff";return"<div style=\"display: flex;\">"+(this.scaleBarText_?"<div class=\"ol-scale-text\" style=\"width: "+e+"px;\">"+i+"</div>":"")+s.join("")+"</div>"},t.prototype.createMarker=function(e,t){return"<div class=\"ol-scale-step-marker\" style=\"position: "+e+";top: "+("absolute"===e?3:-10)+"px;\"></div>"},t.prototype.createStepText=function(e,t,r,i,s){var n=(0===e?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(0===e?"":" "+s);return"<div class=\"ol-scale-step-text\" style=\"margin-left: "+(0===e?-3:t/this.scaleBarSteps_*-1)+"px;text-align: "+(0===e?"left":"center")+"; min-width: "+(0===e?0:t/this.scaleBarSteps_*2)+"px;left: "+(r?t+"px":"unset")+";\">"+n+"</div>"},t.prototype.getScaleForResolution=function(){var e=this.getMap().getView().getResolution(),t=this.viewState_.projection.getMetersPerUnit();return parseFloat(e.toString())*t*39.37*(25.4/.28)},t}(Ta);function dj(e){var t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}Jc.render=dj,Jc.default=zl;var Ud={};var yl=Ud&&Ud.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wc={VERTICAL:0,HORIZONTAL:1},wl=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,{element:document.createElement("div"),render:r.render||ij})||this).dragListenerKeys_=[],i.currentResolution_=void 0,i.direction_=Wc.VERTICAL,i.dragging_,i.heightLimit_=0,i.widthLimit_=0,i.startX_,i.startY_,i.thumbSize_=null,i.sliderInitialized_=!1,i.duration_=void 0!==r.duration?r.duration:200;var n=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=n+"-thumb "+Va;var s=i.element;return s.className=n+" "+Va+" "+Nb,s.appendChild(o),s.addEventListener(hb.POINTERDOWN,i.handleDraggerStart_.bind(i),!1),s.addEventListener(hb.POINTERMOVE,i.handleDraggerDrag_.bind(i),!1),s.addEventListener(hb.POINTERUP,i.handleDraggerEnd_.bind(i),!1),s.addEventListener(ba.CLICK,i.handleContainerClick_.bind(i),!1),o.addEventListener(ba.CLICK,_p,!1),i}return yl(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight,r=t.firstElementChild,n=getComputedStyle(r),o=r.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=r.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);this.thumbSize_=[o,s],e>i?(this.direction_=Wc.HORIZONTAL,this.widthLimit_=e-o):(this.direction_=Wc.VERTICAL,this.heightLimit_=i-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i),n=e.getConstrainedZoom(e.getZoomForResolution(r));e.animateInternal({zoom:n,duration:this.duration_,easing:Ob})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var i=this.handleDraggerDrag_,r=this.handleDraggerEnd_;this.dragListenerKeys_.push(fa(document,hb.POINTERMOVE,i,this),fa(document,hb.POINTERUP,r,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,i=t.clientY-this.startY_,r=this.getRelativePosition_(e,i);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(ja),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==Wc.HORIZONTAL?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){var i;return i=this.direction_===Wc.HORIZONTAL?t/this.widthLimit_:e/this.heightLimit_,wa(i,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return wa(1-e(t),0,1)},e}(Ta);function ij(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}}Ud.render=ij,Ud.default=wl;var yg={};var vl=yg&&yg.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),tl=function(t){function e(e){var n=this,o=e||{};(n=t.call(this,{element:document.createElement("div"),target:o.target})||this).extent=o.extent?o.extent:null;var r=void 0!==o.className?o.className:"ol-zoom-extent",i=void 0!==o.label?o.label:"E",a=void 0!==o.tipLabel?o.tipLabel:"Fit to extent",$=document.createElement("button");$.setAttribute("type","button"),$.title=a,$.appendChild("string"==typeof i?document.createTextNode(i):i),$.addEventListener(ba.CLICK,n.handleClick_.bind(n),!1);var l=r+" "+Va+" "+Nb,p=n.element;return p.className=l,p.appendChild($),n}return vl(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Db(e))},e}(Ta);yg.default=tl;function rl(o){var a=o||{},r=new za,e=new ql(-.005,.05,100);return(void 0===a.altShiftDragRotate||a.altShiftDragRotate)&&r.push(new Vj),(void 0===a.doubleClickZoom||a.doubleClickZoom)&&r.push(new wj({delta:a.zoomDelta,duration:a.zoomDuration})),(void 0===a.dragPan||a.dragPan)&&r.push(new Rj({condition:a.onFocusOnly?ce:void 0,kinetic:e})),(void 0===a.pinchRotate||a.pinchRotate)&&r.push(new vk),(void 0===a.pinchZoom||a.pinchZoom)&&r.push(new yk({duration:a.zoomDuration})),(void 0===a.keyboard||a.keyboard)&&(r.push(new jk),r.push(new nk({delta:a.zoomDelta,duration:a.zoomDuration}))),(void 0===a.mouseWheelZoom||a.mouseWheelZoom)&&r.push(new sk({condition:a.onFocusOnly?ce:void 0,duration:a.zoomDuration})),(void 0===a.shiftDragZoom||a.shiftDragZoom)&&r.push(new ek({duration:a.zoomDuration})),r}var ql=function(){function t(t,i,n){this.decay_=t,this.minVelocity_=i,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var n=i-3;n>0&&this.points_[n+2]>t;)n-=3;var e=this.points_[i+2]-this.points_[n+2];if(e<1e3/60)return!1;var s=this.points_[i]-this.points_[n],o=this.points_[i+1]-this.points_[n+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/e,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var Cg={};var Fc={};var $d={ACTIVE:"active"};var pl=Fc&&Fc.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sb=function(t){function e(e){var r=t.call(this)||this;return e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return pl(e,t),e.prototype.getActive=function(){return this.get($d.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set($d.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(Oa);function tj(t,e,r){var n=t.getCenterInternal();if(n){var o=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:Ho,center:t.getConstrainedCenter(o)})}}function be(t,e,r,n){var o=t.getZoom();if(void 0!==o){var p=t.getConstrainedZoom(o+e),a=t.getResolutionForZoom(p);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:Ob})}}Fc.pan=tj,Fc.zoomByDelta=be,Fc.default=sb;var ol=Cg&&Cg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),wj=function(t){function e(e){var r=t.call(this,{handleEvent:ml})||this,a=e||{};return r.delta_=a.delta?a.delta:1,r.duration_=void 0!==a.duration?a.duration:250,r}return ol(e,t),e}(sb);function ml(t){var e=!1;if(t.type==ha.DBLCLICK){var r=t.originalEvent,a=t.map,n=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_,$=a.getView();be($,o,n,this.duration_),t.preventDefault(),e=!0}return!e}Cg.default=wj;var Jg={};var kl=function(e){var t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey};var jl=function(e){var t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey};var ce=function(e){return e.target.getTargetElement()===document.activeElement};var Mg=La;var Dj=function(e){var t=e.originalEvent;return 0==t.button&&!(Ip&&Gp&&t.ctrlKey)};var Ej=Mb;var Fj=function(e){return e.type==ha.SINGLECLICK};var Ng=function(e){var t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey};var fe=function(e){var t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey};var Ij=function(e){var t=e.originalEvent.target.tagName;return"INPUT"!==t&&"SELECT"!==t&&"TEXTAREA"!==t};var cc=function(e){var t=e.pointerEvent;return ia(void 0!==t,56),"mouse"==t.pointerType};var Kj=function(e){var t=e.pointerEvent;return ia(void 0!==t,56),t.isPrimary&&0===t.button};var je={};var il=je&&je.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pa=function(e){function t(t){var n=this,r=t||{};return n=e.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return il(t,e),t.prototype.getPointerCount=function(){return this.targetPointers.length},t.prototype.handleDownEvent=function(e){return!1},t.prototype.handleDragEvent=function(e){},t.prototype.handleEvent=function(e){if(!e.pointerEvent)return!0;var t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==ha.POINTERDRAG)this.handleDragEvent(e);else if(e.type==ha.POINTERUP){var n=this.handleUpEvent(e);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(e.type==ha.POINTERDOWN){var r=this.handleDownEvent(e);this.handlingDownUpSequence=r,t=this.stopDown(r)}else e.type==ha.POINTERMOVE&&this.handleMoveEvent(e);return!t},t.prototype.handleMoveEvent=function(e){},t.prototype.handleUpEvent=function(e){return!1},t.prototype.stopDown=function(e){return e},t.prototype.updateTrackedPointers_=function(e){if(hl(e)){var t=e.pointerEvent,n=t.pointerId.toString();e.type==ha.POINTERUP?delete this.trackedPointers_[n]:e.type==ha.POINTERDOWN?this.trackedPointers_[n]=t:n in this.trackedPointers_&&(this.trackedPointers_[n]=t),this.targetPointers=Oe(this.trackedPointers_)}},t}(sb);function me(e){for(var t=e.length,n=0,r=0,o=0;o<t;o++)n+=e[o].clientX,r+=e[o].clientY;return[n/t,r/t]}function hl(e){var t=e.type;return t===ha.POINTERDOWN||t===ha.POINTERDRAG||t===ha.POINTERUP}je.centroid=me,je.default=Pa;var gl=Jg&&Jg.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function i(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Rj=function(t){function n(n){var e=t.call(this,{stopDown:Mb})||this,i=n||{};return e.kinetic_=i.kinetic,e.lastCentroid=null,e.lastPointersCount_,e.panning_=!1,e.condition_=i.condition?i.condition:fl,e.noKinetic_=!1,e}return gl(n,t),n.prototype.conditionInternal_=function(t){var n=!0;return t.map.getTargetElement().hasAttribute("tabindex")&&(n=ce(t)),n&&this.condition_(t)},n.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var n=this.targetPointers,e=me(n);if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(e[0],e[1]),this.lastCentroid){var i=[this.lastCentroid[0]-e[0],e[1]-this.lastCentroid[1]],r=t.map.getView();Lo(i,r.getResolution()),hg(i,r.getRotation()),r.adjustCenterInternal(i)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=e,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()},n.prototype.handleUpEvent=function(t){var n=t.map,e=n.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var i=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=e.getCenterInternal(),a=n.getPixelFromCoordinateInternal(o),s=n.getCoordinateFromPixelInternal([a[0]-i*Math.cos(r),a[1]-i*Math.sin(r)]);e.animateInternal({center:e.getConstrainedCenter(s),duration:500,easing:Ob})}return this.panning_&&(this.panning_=!1,e.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.conditionInternal_(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},n}(Pa);function fl(t){return Ng(t)&&Kj(t)}Jg.default=Rj;var Xg={};var cl=Xg&&Xg.__extends||function(){var t=function(n,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])})(n,o)};return function(n,o){function e(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),Vj=function(t){function n(n){var o=this,e=n||{};return(o=t.call(this,{stopDown:Mb})||this).condition_=e.condition?e.condition:jl,o.lastAngle_=void 0,o.duration_=void 0!==e.duration?e.duration:250,o}return cl(n,t),n.prototype.handleDragEvent=function(t){if(cc(t)){var n=t.map,o=n.getView();if(o.getConstraints().rotation!==Hf){var e=n.getSize(),r=t.pixel,i=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(void 0!==this.lastAngle_){var a=i-this.lastAngle_;o.adjustRotationInternal(-a)}this.lastAngle_=i}}},n.prototype.handleUpEvent=function(t){return!cc(t)||(t.map.getView().endInteraction(this.duration_),!1)},n.prototype.handleDownEvent=function(t){return!!cc(t)&&!(!Dj(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)},n}(Pa);Xg.default=Vj;var Zg={};var $g={};var _g={};var bl=_g&&_g.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),$j=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return bl(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px",r.top=Math.min(t[1],e[1])+"px",r.width=Math.abs(e[0]-t[0])+"px",r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new bb([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(mf);_g.default=$j;var _j=$g&&$g.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),bh={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},ch=function(t){function n(n,e,o){var r=t.call(this,n)||this;return r.coordinate=e,r.mapBrowserEvent=o,r}return _j(n,t),n}(Ea),ck=function(t){function n(n){var e=t.call(this)||this,o=n||{};return e.box_=new $j(o.className||"ol-dragbox"),e.minArea_=void 0!==o.minArea?o.minArea:64,e.onBoxEnd_=o.onBoxEnd?o.onBoxEnd:qb,e.startPixel_=null,e.condition_=o.condition?o.condition:Dj,e.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:e.defaultBoxEndCondition,e}return _j(n,t),n.prototype.defaultBoxEndCondition=function(t,n,e){var o=e[0]-n[0],r=e[1]-n[1];return o*o+r*r>=this.minArea_},n.prototype.getGeometry=function(){return this.box_.getGeometry()},n.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new ch(bh.BOXDRAG,t.coordinate,t))},n.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new ch(bh.BOXEND,t.coordinate,t))),!1},n.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ch(bh.BOXSTART,t.coordinate,t)),!0)},n}(Pa);$g.default=ck;var _k=Zg&&Zg.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),ek=function(t){function e(e){var o=this,r=e||{},n=r.condition?r.condition:fe;return(o=t.call(this,{condition:n,className:r.className||"ol-dragzoom",minArea:r.minArea,onBoxEnd:$k})||this).duration_=void 0!==r.duration?r.duration:200,o.out_=void 0!==r.out&&r.out,o}return _k(e,t),e}(ck);function $k(){var t=this.getMap(),e=t.getView(),o=t.getSize(),r=this.getGeometry().getExtent();if(this.out_){var n=e.calculateExtentInternal(o),i=hp([t.getPixelFromCoordinateInternal(Bb(r)),t.getPixelFromCoordinateInternal(_b(r))]),a=e.getResolutionForExtentInternal(i,o);Ch(n,1/a),r=n}var $=e.getConstrainedResolution(e.getResolutionForExtentInternal(r,o)),p=e.getConstrainedCenter(Gb(r),$);e.animateInternal({resolution:$,center:p,duration:this.duration_,easing:Ob})}Zg.default=ek;var fh={};var Yb={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Yk=fh&&fh.__extends||function(){var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])})(t,e)};return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),jk=function(o){function t(t){var e=o.call(this,{handleEvent:Xk})||this,r=t||{};return e.defaultCondition_=function(o){return Ng(o)&&Ij(o)},e.condition_=void 0!==r.condition?r.condition:e.defaultCondition_,e.duration_=void 0!==r.duration?r.duration:100,e.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,e}return Yk(t,o),t}(sb);function Xk(o){var t=!1;if(o.type==ba.KEYDOWN){var e=o.originalEvent.keyCode;if(this.condition_(o)&&(e==Yb.DOWN||e==Yb.LEFT||e==Yb.RIGHT||e==Yb.UP)){var r=o.map.getView(),n=r.getResolution()*this.pixelDelta_,i=0,$=0;e==Yb.DOWN?$=-n:e==Yb.LEFT?i=-n:e==Yb.RIGHT?i=n:$=n;var a=[i,$];hg(a,r.getRotation()),tj(r,a,this.duration_),o.preventDefault(),t=!0}}return!t}fh.default=jk;var jh={};var Vk=jh&&jh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nk=function(t){function e(e){var r=t.call(this,{handleEvent:Tk})||this,n=e||{};return r.condition_=n.condition?n.condition:Ij,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Vk(e,t),e}(sb);function Tk(t){var e=!1;if(t.type==ba.KEYDOWN||t.type==ba.KEYPRESS){var r=t.originalEvent.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var n=t.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_,i=n.getView();be(i,o,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}jh.default=nk;var we={};var Sk=we&&we.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),xe={TRACKPAD:"trackpad",WHEEL:"wheel"};we.Mode=xe;var sk=function(t){function e(e){var o=this,i=e||{};return(o=t.call(this,i)||this).totalDelta_=0,o.lastDelta_=0,o.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,o.duration_=void 0!==i.duration?i.duration:250,o.timeout_=void 0!==i.timeout?i.timeout:80,o.useAnchor_=void 0===i.useAnchor||i.useAnchor,o.condition_=i.condition?i.condition:Mg,o.lastAnchor_=null,o.startTime_=void 0,o.timeoutId_,o.mode_=void 0,o.trackpadEventGap_=400,o.trackpadTimeoutId_,o.deltaPerZoom_=300,o}return Sk(e,t),e.prototype.conditionInternal_=function(t){var e=!0;return t.map.getTargetElement().hasAttribute("tabindex")&&(e=ce(t)),e&&this.condition_(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.conditionInternal_(t))return!0;if(t.type!==ba.WHEEL)return!0;t.preventDefault();var e,o=t.map,i=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==ba.WHEEL&&(e=i.deltaY,Lp&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=ve),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?xe.TRACKPAD:xe.WHEEL);var a=o.getView();if(this.mode_===xe.TRACKPAD&&!a.getConstrainResolution())return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=e;var n=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,o),n),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var o=-wa(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;e.getConstrainResolution()&&(o=o?o>0?1:-1:0),be(e,o,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}(sb);we.default=sk;var nh={};var Rk=nh&&nh.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),vk=function(t){function n(n){var e=this,r=n||{},o=r;return o.stopDown||(o.stopDown=Mb),(e=t.call(this,o)||this).anchor_=null,e.lastAngle_=void 0,e.rotating_=!1,e.rotationDelta_=0,e.threshold_=void 0!==r.threshold?r.threshold:.3,e.duration_=void 0!==r.duration?r.duration:250,e}return Rk(n,t),n.prototype.handleDragEvent=function(t){var n=0,e=this.targetPointers[0],r=this.targetPointers[1],o=Math.atan2(r.clientY-e.clientY,r.clientX-e.clientX);if(void 0!==this.lastAngle_){var i=o-this.lastAngle_;this.rotationDelta_+=i,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),n=i}this.lastAngle_=o;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Hf){var h=a.getViewport().getBoundingClientRect(),l=me(this.targetPointers);l[0]-=h.left,l[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(l),this.rotating_&&(a.render(),s.adjustRotationInternal(n,this.anchor_))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Pa);nh.default=vk;var ph={};var Qk=ph&&ph.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yk=function(t){function e(e){var r=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Mb),(r=t.call(this,o)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Qk(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],o=r.clientX-n.clientX,i=r.clientY-n.clientY,a=Math.sqrt(o*o+i*i);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,c=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),u=me(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),s.render(),c.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Pa);ph.default=yk;var rh={};var Ak=rh&&rh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ok={ADD_FEATURES:"addfeatures"},Nk=function(t){function e(e,r,n,o){var i=t.call(this,e)||this;return i.features=n,i.file=r,i.projection=o,i}return Ak(e,t),e}(Ea),Mk=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{handleEvent:La})||this).formatConstructors_=n.formatConstructors?n.formatConstructors:[],r.projection_=n.projection?va(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return Ak(e,t),e.prototype.handleResult_=function(t,e){var r=e.target.result,n=this.getMap(),o=this.projection_;o||(o=n.getView().getProjection());for(var i=this.formatConstructors_,s=[],$=0,a=i.length;$<a;++$){var p=new i[$];if((s=this.tryReadFeatures_(p,r,{featureProjection:o}))&&s.length>0)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(s)),this.dispatchEvent(new Nk(Ok.ADD_FEATURES,t,s,o))},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[fa(e,ba.DROP,Kk,this),fa(e,ba.DRAGENTER,vh,this),fa(e,ba.DRAGOVER,vh,this),fa(e,ba.DROP,vh,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(n){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(ja),this.dropListenKeys_=null)},e}(sb);function Kk(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var o=e.item(r),i=new FileReader;i.addEventListener(ba.LOAD,this.handleResult_.bind(this,o)),i.readAsText(o)}}function vh(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}rh.default=Mk;var wh={};var zn=wh&&wh.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jk=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,i)||this).condition_=i.condition?i.condition:fe,n.lastAngle_=void 0,n.lastMagnitude_=void 0,n.lastScaleDelta_=0,n.duration_=void 0!==i.duration?i.duration:400,n}return zn(e,t),e.prototype.handleDragEvent=function(t){if(cc(t)){var e=t.map,n=e.getSize(),i=t.pixel,o=i[0]-n[0]/2,a=n[1]/2-i[1],r=Math.atan2(a,o),s=Math.sqrt(o*o+a*a),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-r;l.adjustRotationInternal(u)}this.lastAngle_=r,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!cc(t))return!0;var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!cc(t)&&!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0)},e}(Pa);wh.default=Jk;var Zc={};var Ae={};var Lk=Ae&&Ae.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_a=function(e){function t(t){var r=e.call(this)||this;if(r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addEventListener(qa(r.geometryName_),r.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){var n=t;r.setGeometry(n)}else{var o=t;r.setProperties(o)}return r}return Lk(t,e),t.prototype.clone=function(){var e=new t(this.getProperties());e.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&e.setGeometry(r.clone());var n=this.getStyle();return n&&e.setStyle(n),e},t.prototype.getGeometry=function(){return this.get(this.geometryName_)},t.prototype.getId=function(){return this.id_},t.prototype.getGeometryName=function(){return this.geometryName_},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.handleGeometryChange_=function(){this.changed()},t.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(ja(this.geometryChangeKey_),this.geometryChangeKey_=null);var e=this.getGeometry();e&&(this.geometryChangeKey_=fa(e,ba.CHANGE,this.handleGeometryChange_,this)),this.changed()},t.prototype.setGeometry=function(e){this.set(this.geometryName_,e)},t.prototype.setStyle=function(e){this.style_=e,this.styleFunction_=e?Ck(e):void 0,this.changed()},t.prototype.setId=function(e){this.id_=e,this.changed()},t.prototype.setGeometryName=function(e){this.removeEventListener(qa(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=e,this.addEventListener(qa(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},t}(Oa);function Ck(e){return"function"==typeof e?e:(Array.isArray(e)?t=e:(ia("function"==typeof e.getZIndex,41),t=[e]),function(){return t});var t}Ae.createStyleFunction=Ck,Ae.default=_a;var sh={};var Pk=sh&&sh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Kc=function(t){function e(e,r,o){var i=t.call(this)||this;if(void 0!==o&&void 0===r)i.setFlatCoordinates(o,e);else{var s=r||0;i.setCenterAndRadius(e,s,o)}return i}return Pk(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,o){var i=this.flatCoordinates,s=t-i[0],n=e-i[1],a=s*s+n*n;if(a<o){if(0===a)for(var p=0;p<this.stride;++p)r[p]=i[p];else{var d=this.getRadius()/Math.sqrt(a);r[0]=i[0]+d*s,r[1]=i[1]+d*n;for(p=2;p<this.stride;++p)r[p]=i[p]}return r.length=this.stride,a}return o},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,o=t-r[0],i=e-r[1];return o*o+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return Ra(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return aa.CIRCLE},e.prototype.intersectsExtent=function(t){var e=this.getExtent();if(Fa(t,e)){var r=this.getCenter();return t[0]<=r[0]&&t[2]>=r[0]||t[1]<=r[1]&&t[3]>=r[1]||sj(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+r;for(var i=1;i<e;++i)o[e+i]=t[i];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,i=Fk(o,0,t,this.stride);o[i++]=o[0]+e;for(var s=1,n=this.stride;s<n;++s)o[i++]=o[s];o.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),o=this.getStride();this.setCenter(vj(r,0,r.length,o,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),o=this.getStride();this.setCenter(Aj(r,0,r.length,o,t,e,r)),this.changed()},e}(eb);Kc.prototype.transform,sh.default=Kc;var oh={};function qk(r,e,t,i,n,$){var o=NaN,l=NaN,a=(t-e)/i;if(1===a)o=r[e],l=r[e+1];else if(2==a)o=(1-n)*r[e]+n*r[e+i],l=(1-n)*r[e+1]+n*r[e+i+1];else if(0!==a){for(var u=r[e],p=r[e+1],f=0,s=[0],q=e+i;q<t;q+=i){var D=r[q],T=r[q+1];f+=Math.sqrt((D-u)*(D-u)+(T-p)*(T-p)),s.push(f),u=D,p=T}var v=n*f,c=jq(s,v);if(c<0){var g=(v-s[-c-2])/(s[-c-1]-s[-c-2]),x=e+(-c-2)*i;o=kc(r[x],r[x+i],g),l=kc(r[x+1],r[x+i+1],g)}else o=r[e+c*i],l=r[e+c*i+1]}return $?($[0]=o,$[1]=l,$):[o,l]}function kh(r,e,t,i,n,$){if(t==e)return null;var o;if(n<r[e+i-1])return $?((o=r.slice(e,e+i))[i-1]=n,o):null;if(r[t-1]<n)return $?((o=r.slice(t-i,t))[i-1]=n,o):null;if(n==r[e+i-1])return r.slice(e,e+i);for(var l=e/i,a=t/i;l<a;){var u=l+a>>1;n<r[(u+1)*i-1]?a=u:l=u+1}var p=r[l*i-1];if(n==p)return r.slice((l-1)*i,(l-1)*i+i);var f=(n-p)/(r[(l+1)*i-1]-p);o=[];for(var s=0;s<i-1;++s)o.push(kc(r[(l-1)*i+s],r[l*i+s],f));return o.push(n),o}function Uk(r,e,t,i,n,$,o){if(o)return kh(r,e,t[t.length-1],i,n,$);var l;if(n<r[i-1])return $?((l=r.slice(0,i))[i-1]=n,l):null;if(r[r.length-1]<n)return $?((l=r.slice(r.length-i))[i-1]=n,l):null;for(var a=0,u=t.length;a<u;++a){var p=t[a];if(e!=p){if(n<r[e+i-1])return null;if(n<=r[p-1])return kh(r,e,p,i,n,!1);e=p}}return null}function mk(r,n,t,e){for(var $=r[n],i=r[n+1],x=0,Z=n+e;Z<t;Z+=e){var g=r[Z],o=r[Z+1];x+=Math.sqrt((g-$)*(g-$)+(o-i)*(o-i)),$=g,i=o}return x}var Wk=oh&&oh.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xb=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 Wk(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?Na(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<Rb(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Zf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=pa.XYM&&this.layout!=pa.XYZM)return null;var i=void 0!==e&&e;return kh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return Mc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return qk(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},e.prototype.getLength=function(){return mk(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=lg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,pa.XY)},e.prototype.getType=function(){return aa.LINE_STRING},e.prototype.intersectsExtent=function(t){return zd(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=Dd(this.flatCoordinates,0,t,this.stride),this.changed()},e}(eb);oh.default=Xb;var hh={};var Zk=hh&&hh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),eh=function(t){function e(e,r,i){var o=t.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(e[0]))o.setCoordinates(e,r);else if(void 0!==r&&i)o.setFlatCoordinates(r,e),o.ends_=i;else{for(var s=o.getLayout(),n=e,a=[],f=[],l=0,$=n.length;l<$;++l){var p=n[l];0===l&&(s=p.getLayout()),Na(a,p.getFlatCoordinates()),f.push(a.length)}o.setFlatCoordinates(s,a),o.ends_=f}return o}return Zk(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?Na(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,i){return i<Rb(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xf(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pe(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,i))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=pa.XYM&&this.layout!=pa.XYZM||0===this.flatCoordinates.length)return null;var i=void 0!==e&&e,o=void 0!==r&&r;return Uk(this.flatCoordinates,0,this.ends_,this.stride,t,i,o)},e.prototype.getCoordinates=function(){return Cd(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 Xb(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,i=[],o=0,s=0,n=e.length;s<n;++s){var a=e[s],f=new Xb(t.slice(o,a),r);i.push(f),o=a}return i},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,i=this.ends_,o=this.stride,s=0,n=i.length;s<n;++s){var a=i[s],f=qk(e,r,a,o,.5);Na(t,f),r=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=Ln(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,i),new e(r,pa.XY,i)},e.prototype.getType=function(){return aa.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return An(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=gg(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(eb);hh.default=eh;var dh={};var al=dh&&dh.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),qe=function(t){function e(e,r){var o=t.call(this)||this;return r&&!Array.isArray(e[0])?o.setFlatCoordinates(r,e):o.setCoordinates(e,r),o}return al(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?Na(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,o){if(o<Rb(this.getExtent(),t,e))return o;for(var i=this.flatCoordinates,n=this.stride,s=0,a=i.length;s<a;s+=n){var u=Wb(t,e,i[s],i[s+1]);if(u<o){o=u;for(var d=0;d<n;++d)r[d]=i[s+d];r.length=n}}return o},e.prototype.getCoordinates=function(){return Mc(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 kb(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,o=[],i=0,n=t.length;i<n;i+=r){var s=new kb(t.slice(i,i+r),e);o.push(s)}return o},e.prototype.getType=function(){return aa.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,o=0,i=e.length;o<i;o+=r){var n=e[o],s=e[o+1];if(Be(t,n,s))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Dd(this.flatCoordinates,0,t,this.stride),this.changed()},e}(eb);dh.default=qe;var Yg={};function dl(r,e,t,$){for(var n=[],a=Ga(),i=0,o=t.length;i<o;++i){var s=t[i];a=aj(r,e,s[0],$),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),e=s[s.length-1]}return n}var el=Yg&&Yg.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wg=function(t){function e(e,i,r){var o=t.call(this)||this;if(o.endss_=[],o.flatInteriorPointsRevision_=-1,o.flatInteriorPoints_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var s=o.getLayout(),n=e,a=[],h=[],l=0,u=n.length;l<u;++l){var $=n[l];0===l&&(s=$.getLayout());for(var d=a.length,p=$.getEnds(),f=0,c=p.length;f<c;++f)p[f]+=d;Na(a,$.getFlatCoordinates()),h.push(p)}i=s,e=a,r=h}return void 0!==i&&r?(o.setFlatCoordinates(i,e),o.endss_=r):o.setCoordinates(e,i),o}return el(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;Na(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,o=(e=t.getEnds().slice()).length;r<o;++r)e[r]+=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),r=0;r<t;++r)i[r]=this.endss_[r].slice();return new e(this.flatCoordinates.slice(),this.layout,i)},e.prototype.closestPointXY=function(t,e,i,r){return r<Rb(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tn(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.containsXY=function(t,e){return Cn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return Vn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),mi(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Bh(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=dl(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Bn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new qe(this.getFlatInteriorPoints().slice(),pa.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;wn(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=mi(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=In(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,r),new e(i,pa.XY,r)},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 r=this.endss_[t].slice(),o=r[r.length-1];if(0!==e)for(var s=0,n=r.length;s<n;++s)r[s]-=e;return new bb(this.flatCoordinates.slice(e,o),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],o=0,s=0,n=i.length;s<n;++s){var a=i[s].slice(),h=a[a.length-1];if(0!==o)for(var l=0,u=a.length;l<u;++l)a[l]-=o;var $=new bb(e.slice(o,h),t,a);r.push($),o=h}return r},e.prototype.getType=function(){return aa.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return yn(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=Mn(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(eb);Yg.default=Wg;var Vg={};var Ug={};var Rg={};var Kg={};var zj=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.displacement_=t.displacement}return t.prototype.clone=function(){return new t({opacity:this.getOpacity(),scale:this.getScale(),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.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return ca()},t.prototype.getImage=function(t){return ca()},t.prototype.getHitDetectionImage=function(t){return ca()},t.prototype.getImageState=function(){return ca()},t.prototype.getImageSize=function(){return ca()},t.prototype.getHitDetectionImageSize=function(){return ca()},t.prototype.getOrigin=function(){return ca()},t.prototype.getSize=function(){return ca()},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},t.prototype.listenImageChange=function(t){ca()},t.prototype.load=function(){ca()},t.prototype.unlistenImageChange=function(t){ca()},t}();var ll=Kg&&Kg.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),xj=function(t){function i(i){var e=this,r=void 0!==i.rotateWithView&&i.rotateWithView;return(e=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==i.rotation?i.rotation:0,scale:1,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this).canvas_=null,e.hitDetectionCanvas_=null,e.fill_=void 0!==i.fill?i.fill:null,e.origin_=[0,0],e.points_=i.points,e.radius_=void 0!==i.radius?i.radius:i.radius1,e.radius2_=i.radius2,e.angle_=void 0!==i.angle?i.angle:0,e.stroke_=void 0!==i.stroke?i.stroke:null,e.anchor_=null,e.size_=null,e.imageSize_=null,e.hitDetectionImageSize_=null,e.render(),e}return ll(i,t),i.prototype.clone=function(){var t=new i({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},i.prototype.getAnchor=function(){return this.anchor_},i.prototype.getAngle=function(){return this.angle_},i.prototype.getFill=function(){return this.fill_},i.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},i.prototype.getImage=function(t){return this.canvas_},i.prototype.getImageSize=function(){return this.imageSize_},i.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},i.prototype.getImageState=function(){return oa.LOADED},i.prototype.getOrigin=function(){return this.origin_},i.prototype.getPoints=function(){return this.points_},i.prototype.getRadius=function(){return this.radius_},i.prototype.getRadius2=function(){return this.radius2_},i.prototype.getSize=function(){return this.size_},i.prototype.getStroke=function(){return this.stroke_},i.prototype.listenImageChange=function(t){},i.prototype.load=function(){},i.prototype.unlistenImageChange=function(t){},i.prototype.render=function(){var t,i=tc,e=qc,r=0,o=null,s=0,n=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Nc),t=$a(t),void 0===(n=this.stroke_.getWidth())&&(n=Dc),o=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=qc),void 0===(i=this.stroke_.getLineCap())&&(i=tc),void 0===(r=this.stroke_.getMiterLimit())&&(r=Pc));var a=2*(this.radius_+n)+1,l={strokeStyle:t,strokeWidth:n,size:a,lineCap:i,lineDash:o,lineDashOffset:s,lineJoin:e,miterLimit:r},h=Ja(a,a);this.canvas_=h.canvas;var u=a=this.canvas_.width,p=this.getDisplacement();this.draw_(l,h,0,0),this.createHitDetectionCanvas_(l),this.anchor_=[a/2-p[0],a/2+p[1]],this.size_=[a,a],this.imageSize_=[u,u]},i.prototype.draw_=function(t,i,e,r){var o,s,n;i.setTransform(1,0,0,1,0,0),i.translate(e,r),i.beginPath();var a=this.points_;if(a===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(a*=2),o=0;o<=a;o++)s=2*o*Math.PI/a-Math.PI/2+this.angle_,n=o%2==0?this.radius_:l,i.lineTo(t.size/2+n*Math.cos(s),t.size/2+n*Math.sin(s))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=lb),i.fillStyle=$a(h),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,i.setLineDash&&t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke()),i.closePath()},i.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.hitDetectionCanvas_=this.canvas_,this.fill_){var i=this.fill_.getColor(),e=0;if("string"==typeof i&&(i=Eh(i)),null===i?e=1:Array.isArray(i)&&(e=4===i.length?i[3]:1),0===e){var r=Ja(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r,0,0)}}},i.prototype.drawHitDetectionCanvas_=function(t,i,e,r){i.setTransform(1,0,0,1,0,0),i.translate(e,r),i.beginPath();var o=this.points_;if(o===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var s=void 0!==this.radius2_?this.radius2_:this.radius_;s!==this.radius_&&(o*=2);var n=void 0,a=void 0,l=void 0;for(n=0;n<=o;n++)l=2*n*Math.PI/o-Math.PI/2+this.angle_,a=n%2==0?this.radius_:s,i.lineTo(t.size/2+a*Math.cos(l),t.size/2+a*Math.sin(l))}i.fillStyle=lb,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.stroke()),i.closePath()},i}(zj);Kg.default=xj;var nl=Rg&&Rg.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ig=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return nl(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(xj);Rg.default=Ig;var Fg=function(){function o(o){var r=o||{};this.color_=void 0!==r.color?r.color:null}return o.prototype.clone=function(){var r=this.getColor();return new o({color:Array.isArray(r)?r.slice():r||void 0})},o.prototype.getColor=function(){return this.color_},o.prototype.setColor=function(o){this.color_=o},o}();var Yd=function(){function t(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width}return t.prototype.clone=function(){var i=this.getColor();return new t({color:Array.isArray(i)?i.slice():i||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}();var Uc=function(){function e(e){var t=e||{};this.geometry_=null,this.geometryFunction_=hj,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}return e.prototype.clone=function(){var t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new e({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.setRenderer=function(e){this.renderer_=e},e.prototype.getGeometry=function(){return this.geometry_},e.prototype.getGeometryFunction=function(){return this.geometryFunction_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(e){this.fill_=e},e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(e){this.image_=e},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(e){this.stroke_=e},e.prototype.getText=function(){return this.text_},e.prototype.setText=function(e){this.text_=e},e.prototype.getZIndex=function(){return this.zIndex_},e.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=hj,this.geometry_=e},e.prototype.setZIndex=function(e){this.zIndex_=e},e}();function sl(e){var t;if("function"==typeof e)t=e;else{var r;if(Array.isArray(e))r=e;else ia("function"==typeof e.getZIndex,41),r=[e];t=function(){return r}}return t}var lj=null;function ul(e,t){if(!lj){var r=new Fg({color:"rgba(255,255,255,0.4)"}),o=new Yd({color:"#3399CC",width:1.25});lj=[new Uc({image:new Ig({fill:r,stroke:o,radius:5}),fill:r,stroke:o})]}return lj}function Cc(){var e={},t=[255,255,255,1],r=[0,153,255,1];return e[aa.POLYGON]=[new Uc({fill:new Fg({color:[255,255,255,.5]})})],e[aa.MULTI_POLYGON]=e[aa.POLYGON],e[aa.LINE_STRING]=[new Uc({stroke:new Yd({color:t,width:5})}),new Uc({stroke:new Yd({color:r,width:3})})],e[aa.MULTI_LINE_STRING]=e[aa.LINE_STRING],e[aa.CIRCLE]=e[aa.POLYGON].concat(e[aa.LINE_STRING]),e[aa.POINT]=[new Uc({image:new Ig({radius:6,fill:new Fg({color:r}),stroke:new Yd({color:t,width:1.5})}),zIndex:1/0})],e[aa.MULTI_POINT]=e[aa.POINT],e[aa.GEOMETRY_COLLECTION]=e[aa.POLYGON].concat(e[aa.LINE_STRING],e[aa.POINT]),e}function hj(e){return e.getGeometry()}var xl=Ug&&Ug.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fj={RENDER_ORDER:"renderOrder"},cj=function(t){function e(e){var r=this,n=e||{},i=Ca({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return xl(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(fj.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(fj.RENDER_ORDER,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:ul,this.styleFunction_=null===t?void 0:sl(this.style_),this.changed()},e}(Xe);Ug.default=cj;var vg={};var sg={};var ea={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Qd=[ea.FILL];var vb=[ea.STROKE];var Fb=[ea.BEGIN_PATH];var Li=[ea.CLOSE_PATH];var Hl=sg&&sg.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rc=function(t){function e(e,i,r,n){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=n,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Hl(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatCoordinates=function(t,e,i,r,n,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=r);var u,$,l,p=t[e],c=t[e+1],h=this.tmpCoordinate_,d=!0;for(u=e+r;u<i;u+=r)h[0]=t[u],h[1]=t[u+1],(l=De(a,h))!==$?(d&&(this.coordinates[s++]=p,this.coordinates[s++]=c),this.coordinates[s++]=h[0],this.coordinates[s++]=h[1],d=!1):l===xa.INTERSECTING?(this.coordinates[s++]=h[0],this.coordinates[s++]=h[1],d=!1):d=!0,p=h[0],c=h[1],$=l;return(n&&d||u===e+r)&&(this.coordinates[s++]=p,this.coordinates[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o],u=this.appendFlatCoordinates(t,e,a,r,!1,!1);n.push(u),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var r,n,o,s,a,u=t.getType(),$=t.getStride(),l=this.coordinates.length;if(u==aa.MULTI_POLYGON){r=(t=t).getOrientedFlatCoordinates(),s=[];var p=t.getEndss();a=0;for(var c=0,h=p.length;c<h;++c){var d=[];a=this.drawCustomCoordinates_(r,a,p[c],$,d),s.push(d)}this.instructions.push([ea.CUSTOM,l,s,t,i,Bh])}else u==aa.POLYGON||u==aa.MULTI_LINE_STRING?(o=[],r=u==aa.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(r,0,t.getEnds(),$,o),this.instructions.push([ea.CUSTOM,l,o,t,i,Cd])):u==aa.LINE_STRING||u==aa.MULTI_POINT?(r=t.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,$,!1,!1),this.instructions.push([ea.CUSTOM,l,n,t,i,Mc])):u==aa.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([ea.CUSTOM,l,n,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var i=t.getExtent();this.beginGeometryInstruction1_=[ea.BEGIN_GEOMETRY,e,0,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ea.BEGIN_GEOMETRY,e,0,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,r,n=e.length,o=-1;for(t=0;t<n;++t)(r=(i=e[t])[0])==ea.END_GEOMETRY?o=t:r==ea.BEGIN_GEOMETRY&&(i[2]=t,iq(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var r=t.getColor();i.fillStyle=$a(r||lb)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=$a(n||Nc);var o=e.getLineCap();i.lineCap=void 0!==o?o:tc;var s=e.getLineDash();i.lineDash=s?s.slice():ld;var a=e.getLineDashOffset();i.lineDashOffset=a||md;var u=e.getLineJoin();i.lineJoin=void 0!==u?u:qc;var $=e.getWidth();i.lineWidth=void 0!==$?$:Dc;var l=e.getMiterLimit();i.miterLimit=void 0!==l?l:Pc,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=[ea.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[ea.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,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!pc(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[ea.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=pi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Zd(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Oh);sg.default=rc;var fg={};var Kl=fg&&fg.__extends||function(){var t=function(i,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])})(i,o)};return function(i,o){function e(){this.constructor=i}t(i,o),i.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),Hi=function(t){function i(i,o,e,h){var s=t.call(this,i,o,e,h)||this;return s.declutterGroups_=null,s.hitDetectionImage_=null,s.image_=null,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s}return Kl(i,t),i.prototype.drawCoordinates_=function(t,i,o,e){return this.appendFlatCoordinates(t,i,o,e,!1,!1)},i.prototype.drawPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var o=t.getFlatCoordinates(),e=t.getStride(),h=this.coordinates.length,s=this.drawCoordinates_(o,0,o.length,e);this.instructions.push([ea.DRAW_IMAGE,h,s,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ea.DRAW_IMAGE,h,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(i)}},i.prototype.drawMultiPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var o=t.getFlatCoordinates(),e=t.getStride(),h=this.coordinates.length,s=this.drawCoordinates_(o,0,o.length,e);this.instructions.push([ea.DRAW_IMAGE,h,s,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ea.DRAW_IMAGE,h,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(i)}},i.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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)},i.prototype.setImageStyle=function(t,i){var o=t.getAnchor(),e=t.getSize(),h=t.getHitDetectionImage(1),s=t.getImage(1),r=t.getOrigin();this.anchorX_=o[0],this.anchorY_=o[1],this.declutterGroups_=i,this.hitDetectionImage_=h,this.image_=s,this.height_=e[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=e[0]},i}(rc);fg.default=Hi;var eg={};var Nl=eg&&eg.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function s(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}}(),Fi=function(t){function i(i,e,s,n){return t.call(this,i,e,s,n)||this}return Nl(i,t),i.prototype.drawFlatCoordinates_=function(t,i,e,s){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,i,e,s,!1,!1),r=[ea.MOVE_TO_LINE_TO,n,o];return this.instructions.push(r),this.hitDetectionInstructions.push(r),e},i.prototype.drawLineString=function(t,i){var e=this.state,s=e.strokeStyle,n=e.lineWidth;if(void 0!==s&&void 0!==n){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([ea.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],Fb);var o=t.getFlatCoordinates(),r=t.getStride();this.drawFlatCoordinates_(o,0,o.length,r),this.hitDetectionInstructions.push(vb),this.endGeometry(i)}},i.prototype.drawMultiLineString=function(t,i){var e=this.state,s=e.strokeStyle,n=e.lineWidth;if(void 0!==s&&void 0!==n){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([ea.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],Fb);for(var o=t.getEnds(),r=t.getFlatCoordinates(),p=t.getStride(),a=0,h=0,u=o.length;h<u;++h)a=this.drawFlatCoordinates_(r,a,o[h],p);this.hitDetectionInstructions.push(vb),this.endGeometry(i)}},i.prototype.finish=function(){var i=this.state;return null!=i.lastStroke&&i.lastStroke!=this.coordinates.length&&this.instructions.push(vb),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},i.prototype.applyStroke=function(i){null!=i.lastStroke&&i.lastStroke!=this.coordinates.length&&(this.instructions.push(vb),i.lastStroke=this.coordinates.length),i.lastStroke=0,t.prototype.applyStroke.call(this,i),this.instructions.push(Fb)},i}(rc);eg.default=Fi;var dg={};var Ql=dg&&dg.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function s(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}}(),cg=function(t){function i(i,e,s,o){return t.call(this,i,e,s,o)||this}return Ql(i,t),i.prototype.drawFlatCoordinatess_=function(t,i,e,s){var o=this.state,n=void 0!==o.fillStyle,r=void 0!==o.strokeStyle,l=e.length;this.instructions.push(Fb),this.hitDetectionInstructions.push(Fb);for(var h=0;h<l;++h){var a=e[h],$=this.coordinates.length,u=this.appendFlatCoordinates(t,i,a,s,!0,!r),c=[ea.MOVE_TO_LINE_TO,$,u];this.instructions.push(c),this.hitDetectionInstructions.push(c),r&&(this.instructions.push(Li),this.hitDetectionInstructions.push(Li)),i=a}return n&&(this.instructions.push(Qd),this.hitDetectionInstructions.push(Qd)),r&&(this.instructions.push(vb),this.hitDetectionInstructions.push(vb)),i},i.prototype.drawCircle=function(t,i){var e=this.state,s=e.fillStyle,o=e.strokeStyle;if(void 0!==s||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,i),void 0!==e.fillStyle&&this.hitDetectionInstructions.push([ea.SET_FILL_STYLE,lb]),void 0!==e.strokeStyle&&this.hitDetectionInstructions.push([ea.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset]);var n=t.getFlatCoordinates(),r=t.getStride(),l=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,r,!1,!1);var h=[ea.CIRCLE,l];this.instructions.push(Fb,h),this.hitDetectionInstructions.push(Fb,h),void 0!==e.fillStyle&&(this.instructions.push(Qd),this.hitDetectionInstructions.push(Qd)),void 0!==e.strokeStyle&&(this.instructions.push(vb),this.hitDetectionInstructions.push(vb)),this.endGeometry(i)}},i.prototype.drawPolygon=function(t,i){var e=this.state,s=e.fillStyle,o=e.strokeStyle;if(void 0!==s||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,i),void 0!==e.fillStyle&&this.hitDetectionInstructions.push([ea.SET_FILL_STYLE,lb]),void 0!==e.strokeStyle&&this.hitDetectionInstructions.push([ea.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset]);var n=t.getEnds(),r=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(r,0,n,l),this.endGeometry(i)}},i.prototype.drawMultiPolygon=function(t,i){var e=this.state,s=e.fillStyle,o=e.strokeStyle;if(void 0!==s||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,i),void 0!==e.fillStyle&&this.hitDetectionInstructions.push([ea.SET_FILL_STYLE,lb]),void 0!==e.strokeStyle&&this.hitDetectionInstructions.push([ea.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset]);for(var n=t.getEndss(),r=t.getOrientedFlatCoordinates(),l=t.getStride(),h=0,a=0,$=n.length;a<$;++a)h=this.drawFlatCoordinatess_(r,h,n[a],l);this.endGeometry(i)}},i.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var i=this.tolerance;if(0!==i)for(var e=this.coordinates,s=0,o=e.length;s<o;++s)e[s]=Vb(e[s],i);return t.prototype.finish.call(this)},i.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)},i}(rc);dg.default=cg;var Id={};function Tl(h,t,r,$,a){var n,o,C,i,c,e,u,v,p,s=r,x=r,g=0,k=0,m=r;for(n=r;n<$;n+=a){var d=t[n],f=t[n+1];void 0!==i&&(v=d-i,p=f-c,C=Math.sqrt(v*v+p*p),void 0!==e&&(k+=o,Math.acos((e*v+u*p)/(o*C))>h&&(k>g&&(g=k,s=m,x=n),k=0,m=n-a)),o=C,e=v,u=p),i=d,c=f}return(k+=C)>g?[m,n]:[s,x]}var Ul={POINT:"point",LINE:"line"};var Vl=Id&&Id.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bc={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};Id.TEXT_ALIGN=bc;var yi=function(t){function e(e,i,r,s){var o=t.call(this,e,i,r,s)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return Vl(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_,r=this.textStrokeState_,s=this.textState_;if(""!==this.text_&&s&&(i||r)){var o,l,a=this.coordinates.length,n=t.getType(),$=null,h=2,p=2;if(s.placement===Ul.LINE){if(!Fa(this.getBufferedMaxExtent(),t.getExtent()))return;var u=void 0;if($=t.getFlatCoordinates(),p=t.getStride(),n==aa.LINE_STRING)u=[$.length];else if(n==aa.MULTI_LINE_STRING)u=t.getEnds();else if(n==aa.POLYGON)u=t.getEnds().slice(0,1);else if(n==aa.MULTI_POLYGON){var f=t.getEndss();for(u=[],o=0,l=f.length;o<l;++o)u.push(f[o][0])}this.beginGeometry(t,e);for(var d=s.textAlign,c=0,_=void 0,x=0,g=u.length;x<g;++x){if(null==d){var S=Tl(s.maxAngle,$,c,u[x],p);c=S[0],_=S[1]}else _=u[x];for(o=c;o<_;o+=p)this.coordinates.push($[o],$[o+1]);h=this.coordinates.length,c=u[x];var y=this.declutterGroups_?0===x?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(a,h,y),a=h}this.endGeometry(e)}else{var m=null;switch(s.overflow||(m=[]),n){case aa.POINT:case aa.MULTI_POINT:h=($=t.getFlatCoordinates()).length;break;case aa.LINE_STRING:$=t.getFlatMidpoint();break;case aa.CIRCLE:$=t.getCenter();break;case aa.MULTI_LINE_STRING:h=($=t.getFlatMidpoints()).length;break;case aa.POLYGON:$=t.getFlatInteriorPoint(),s.overflow||m.push($[2]/this.resolution),p=3;break;case aa.MULTI_POLYGON:var D=t.getFlatInteriorPoints();for($=[],o=0,l=D.length;o<l;o+=3)s.overflow||m.push(D[o+2]/this.resolution),$.push(D[o],D[o+1]);if(0==(h=$.length))return;}h=this.appendFlatCoordinates($,0,h,p,!1,!1),this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var w=this.pixelRatio;this.instructions.push([ea.DRAW_IMAGE,a,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1,NaN,s.padding==gc?gc:s.padding.map(function(t){return t*w}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,m]),this.hitDetectionInstructions.push([ea.DRAW_IMAGE,a,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1/this.pixelRatio,NaN,s.padding,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,m]),this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Gc,textBaseline:e.textBaseline||rd,scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e,i){var r=this.textStrokeState_,s=this.textState_,o=this.strokeKey_,l=this.textKey_,a=this.fillKey_;this.saveTextStates_();var n=this.pixelRatio,$=bc[s.textBaseline],h=this.textOffsetY_*n,p=this.text_,u=s.scale,f=r?r.lineWidth*u/2:0;this.instructions.push([ea.DRAW_CHARS,t,e,$,i,s.overflow,a,s.maxAngle,n,h,o,f*n,p,l,1]),this.hitDetectionInstructions.push([ea.DRAW_CHARS,t,e,$,i,s.overflow,a,s.maxAngle,1,h,o,f,p,l,1/n])},e.prototype.setTextStyle=function(t,e){var i,r,s;if(t){this.declutterGroups_=e;var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=$a(o.getColor()||lb)):(r=null,this.textFillState_=r);var l=t.getStroke();if(l){(s=this.textStrokeState_)||(s={},this.textStrokeState_=s);var a=l.getLineDash(),n=l.getLineDashOffset(),$=l.getWidth(),h=l.getMiterLimit();s.lineCap=l.getLineCap()||tc,s.lineDash=a?a.slice():ld,s.lineDashOffset=void 0===n?md:n,s.lineJoin=l.getLineJoin()||qc,s.lineWidth=void 0===$?Dc:$,s.miterLimit=void 0===h?Pc:h,s.strokeStyle=$a(l.getColor()||Nc)}else s=null,this.textStrokeState_=s;i=this.textState_;var p=t.getFont()||Ph;hm(p);var u=t.getScale();i.overflow=t.getOverflow(),i.font=p,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||rd,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||gc,i.scale=void 0===u?1:u;var f=t.getOffsetX(),d=t.getOffsetY(),c=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==c&&c,this.textRotation_=void 0===_?0:_,this.strokeKey_=s?("string"==typeof s.strokeStyle?s.strokeStyle:ga(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+ga(r.fillStyle):""}else this.text_=""},e}(rc);Id.default=yi;var Yl={Circle:cg,Default:rc,Image:Hi,LineString:Fi,Polygon:cg,Text:yi},Zl=function(){function e(e,r,t,i,d){this.declutter_=d,this.declutterGroups_=null,this.tolerance_=e,this.maxExtent_=r,this.pixelRatio_=i,this.resolution_=t,this.buildersByZIndex_={}}return e.prototype.addDeclutter=function(e){var r=null;return this.declutter_&&(e?(r=this.declutterGroups_)[0][4]++:(r=[Ga()],this.declutterGroups_=r,r[0].push(1))),r},e.prototype.finish=function(){var e={};for(var r in this.buildersByZIndex_){e[r]=e[r]||{};var t=this.buildersByZIndex_[r];for(var i in t){var d=t[i].finish();e[r][i]=d}}return e},e.prototype.getBuilder=function(e,r){var t=void 0!==e?e.toString():"0",i=this.buildersByZIndex_[t];void 0===i&&(i={},this.buildersByZIndex_[t]=i);var d=i[r];void 0===d&&(d=new(0,Yl[r])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[r]=d);return d},e}();function $l(t,a,r,h,$,e,o,x,M,p,n){for(var P,i,v=[],w=t[a]>t[r-h],J=$.length,N=t[a],l=t[a+1],s=t[a+=h],I=t[a+1],f=0,u=Math.sqrt(Math.pow(s-N,2)+Math.pow(I-l,2)),d=!1,m=0;m<J;++m){for(var q=$[P=w?J-m-1:m],O=x*M(p,q,n),T=e+O/2;a<r-h&&f+u<T;)N=s,l=I,s=t[a+=h],I=t[a+1],f+=u,u=Math.sqrt(Math.pow(s-N,2)+Math.pow(I-l,2));var c=T-f,b=Math.atan2(I-l,s-N);if(w&&(b+=b>0?-Math.PI:Math.PI),void 0!==i){var g=b-i;if(d=d||0!==g,g+=g>Math.PI?-2*Math.PI:g<-Math.PI?2*Math.PI:0,Math.abs(g)>o)return null}i=b;var j=c/u,k=kc(N,s,j),y=kc(l,I,j);v[P]=[k,y,O/2,b,q],e+=O}return d?v:[[v[0][0],v[0][1],v[0][2],v[0][3],$]]}var _f,Gd={},d=arguments[0];!function(t,i){"object"==typeof Gd?Gd=i():"function"==typeof _f&&_f.amd?_f(i):(t=t||self).RBush=i()}(Gd,function(){function t(t,r,e,a,o){!function t(n,r,e,a,o){for(;a>e;){if(a-e>600){var h=a-e+1,s=r-e+1,l=Math.log(h),f=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*f*(h-f)/h)*(s-h/2<0?-1:1),u=Math.max(e,Math.floor(r-s*f/h+p)),m=Math.min(a,Math.floor(r+(h-s)*f/h+p));t(n,r,u,m,o)}var c=n[r],d=e,x=a;for(i(n,e,r),o(n[a],c)>0&&i(n,e,a);d<x;){for(i(n,d,x),d++,x--;o(n[d],c)<0;)d++;for(;o(n[x],c)>0;)x--}0===o(n[e],c)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,o||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return t<i?-1:t>i?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r<i.length;r++)if(n(t,i[r]))return r;return-1}function a(t,i){o(t,0,t.children.length,i,t)}function o(t,i,n,r,e){e||(e=c(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var a=i;a<n;a++){var o=t.children[a];h(e,t.leaf?r(o):o)}return e}function h(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function l(t,i){return t.minY-i.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function m(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function c(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=e)){var h=n+Math.ceil((r-n)/e/2)*e;t(i,h,n,r,a),o.push(n,h,h,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!m(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a<i.children.length;a++){var o=i.children[a],h=i.leaf?r(o):o;m(t,h)&&(i.leaf?n.push(o):u(t,h)?this._all(o,n):e.push(o))}i=e.pop()}return n},r.prototype.collides=function(t){var i=this.data;if(!m(t,i))return!1;for(var n=[];i;){for(var r=0;r<i.children.length;r++){var e=i.children[r],a=i.leaf?this.toBBox(e):e;if(m(t,a)){if(i.leaf||u(t,a))return!0;n.push(e)}}i=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0;i<t.length;i++)this.insert(t[i]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length){if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=c([]),this},r.prototype.remove=function(t,i){if(!t)return this;for(var n,r,a,o=this.data,h=this.toBBox(t),s=[],l=[];o||s.length;){if(o||(o=s.pop(),r=s[s.length-1],n=l.pop(),a=!0),o.leaf){var f=e(t,o.children,i);if(-1!==f)return o.children.splice(f,1),s.push(o),this._condense(s),this}a||o.leaf||!u(o,h)?r?(n++,o=r.children[n],a=!1):o=null:(s.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,i){return t.minX-i.minX},r.prototype.compareMinY=function(t,i){return t.minY-i.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,i){for(var n=[];t;)t.leaf?i.push.apply(i,t.children):n.push.apply(n,t.children),t=n.pop();return i},r.prototype._build=function(t,i,n,r){var e,o=n-i+1,h=this._maxEntries;if(o<=h)return a(e=c(t.slice(i,n+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(o)/Math.log(h)),h=Math.ceil(o/Math.pow(h,r-1))),(e=c([])).leaf=!1,e.height=r;var s=Math.ceil(o/h),l=s*Math.ceil(Math.sqrt(h));d(t,i,n,l,this.compareMinX);for(var f=i;f<=n;f+=l){var p=Math.min(f+l-1,n);d(t,f,p,s,this.compareMinY);for(var u=f;u<=p;u+=s){var m=Math.min(u+s-1,p);e.children.push(this._build(t,u,m,r-1))}}return a(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,i,n,r){for(;r.push(i),!i.leaf&&r.length-1!==n;){for(var e=1/0,a=1/0,o=void 0,h=0;h<i.children.length;h++){var s=i.children[h],l=f(s),p=(u=t,m=s,(Math.max(m.maxX,u.maxX)-Math.min(m.minX,u.minX))*(Math.max(m.maxY,u.maxY)-Math.min(m.minY,u.minY))-l);p<a?(a=p,e=l<e?l:e,o=s):p===a&&l<e&&(e=l,o=s)}i=o||i.children[0]}var u,m;return i},r.prototype._insert=function(t,i,n){var r=n?t:this.toBBox(t),e=[],a=this._chooseSubtree(r,this.data,i,e);for(a.children.push(t),h(a,r);i>=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var o=this._chooseSplitIndex(n,e,r),h=c(n.children.splice(o,n.children.length-o));h.height=n.height,h.leaf=n.leaf,a(n,this.toBBox),a(h,this.toBBox),i?t[i-1].children.push(h):this._splitRoot(n,h)},r.prototype._splitRoot=function(t,i){this.data=c([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,h,s,l,p,u=1/0,m=1/0,c=i;c<=n-i;c++){var d=o(t,0,c,this.toBBox),x=o(t,c,n,this.toBBox),v=(e=d,a=x,h=void 0,s=void 0,l=void 0,p=void 0,h=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),p=Math.min(e.maxY,a.maxY),Math.max(0,l-h)*Math.max(0,p-s)),M=f(d)+f(x);v<u?(u=v,r=c,m=M<m?M:m):v===u&&M<m&&(m=M,r=c)}return r||n-i},r.prototype._chooseSplitAxis=function(t,i,n){var r=t.leaf?this.compareMinX:s,e=t.leaf?this.compareMinY:l;this._allDistMargin(t,i,n,r)<this._allDistMargin(t,i,n,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,i,n,r){t.children.sort(r);for(var e=this.toBBox,a=o(t,0,i,e),s=o(t,n-i,n,e),l=p(a)+p(s),f=i;f<n-i;f++){var u=t.children[f];h(a,t.leaf?e(u):u),l+=p(a)}for(var m=n-i-1;m>=i;m--){var c=t.children[m];h(s,t.leaf?e(c):c),l+=p(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)h(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});var Qb=Ga(),Oc=Za(),mb=[],Ua=[],cb=[],ib=[],im=function(){function t(t,e,r,i){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Za(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,i){var a=t+e+r+i;if(this.labels_[a])return this.labels_[a];var $=i?this.strokeStates[i]:null,p=r?this.fillStates[r]:null,s=this.textStates[e],o=this.pixelRatio,n=s.scale*o,l=bc[s.textAlign||Gc],h=i&&$.lineWidth?$.lineWidth:0,E=t.split("\n"),v=E.length,m=[],u=fm(s.font,E,m),c=gm(s.font),K=c*v,Z=u+h,f=[],d={width:Math.ceil((Z+2)*n),height:Math.ceil((K+h)*n),contextInstructions:f};(1!=n&&f.push("scale",[n,n]),f.push("font",s.font),i)&&(f.push("strokeStyle",$.strokeStyle),f.push("lineWidth",h),f.push("lineCap",$.lineCap),f.push("lineJoin",$.lineJoin),f.push("miterLimit",$.miterLimit),(ue?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(f.push("setLineDash",[$.lineDash]),f.push("lineDashOffset",$.lineDashOffset)));r&&f.push("fillStyle",p.fillStyle),f.push("textBaseline","middle"),f.push("textAlign","center");var _,x=.5-l,g=l*Z+x*h;if(i)for(_=0;_<v;++_)f.push("strokeText",[E[_],g+x*m[_],.5*(h+c)+_*c]);if(r)for(_=0;_<v;++_)f.push("fillText",[E[_],g+x*m[_],.5*(h+c)+_*c]);return this.labels_[a]=d,d},t.prototype.replayTextBackground_=function(t,e,r,i,a,$,p){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,a),t.lineTo.apply(t,e),$&&(this.alignFill_=$[2],this.fill_(t)),p&&(this.setStrokeStyle_(t,p),t.stroke())},t.prototype.replayImageOrLabel_=function(t,e,r,i,a,$,p,s,o,n,l,h,E,v,m,u,c,K){var Z=c||K;e-=a*=E,r-=$*=E;var f=m+n>i.width?i.width-n:m,d=s+l>i.height?i.height-l:s,_=u[3]+f*E+u[1],x=u[0]+d*E+u[2],g=e-u[3],T=r-u[0];(Z||0!==h)&&(mb[0]=g,ib[0]=g,mb[1]=T,Ua[1]=T,Ua[0]=g+_,cb[0]=Ua[0],cb[1]=T+x,ib[1]=cb[1]);var y=null;if(0!==h){var I=e+a,b=r+$;y=rb(Oc,I,b,1,1,h,-I,-b),sa(Oc,mb),sa(Oc,Ua),sa(Oc,cb),sa(Oc,ib),Ra(Math.min(mb[0],Ua[0],cb[0],ib[0]),Math.min(mb[1],Ua[1],cb[1],ib[1]),Math.max(mb[0],Ua[0],cb[0],ib[0]),Math.max(mb[1],Ua[1],cb[1],ib[1]),Qb)}else Ra(g,T,g+_,T+x,Qb);var S=t.canvas,C=K?K[2]*E/2:0,k=Qb[0]-C<=S.width&&Qb[2]+C>=0&&Qb[1]-C<=S.height&&Qb[3]+C>=0;if(v&&(e=Math.round(e),r=Math.round(r)),p){if(!k&&1==p[4])return;Se(p,Qb);var L=k?[t,y?y.slice(0):null,o,i,n,l,f,d,e,r,E]:null;L&&(Z&&L.push(c,K,mb.slice(0),Ua.slice(0),cb.slice(0),ib.slice(0)),p.push(L))}else k&&(Z&&this.replayTextBackground_(t,mb,Ua,cb,ib,c,K),li(t,y,o,i,n,l,f,d,e,r,E))},t.prototype.fill_=function(t){if(this.alignFill_){var e=sa(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,r,i){if(t&&t.length>5){var a=t[4];if(1==a||a==t.length-5){var $={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};var $C6Up$$interop$default=xh(Gd);if(i||(i=new $C6Up$$interop$default.d(9)),!i.collides($)){i.insert($);for(var p=5,s=t.length;p<s;++p){var o=t[p],n=o[0],l=n.globalAlpha;l!==r&&(n.globalAlpha=r),o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),li.apply(void 0,o),l!==r&&(n.globalAlpha=l)}}t.length=5,sc(t)}}return i},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,i){var a=this.textStates[e],$=this.createLabel(t,e,i,r),p=this.strokeStates[r],s=this.pixelRatio,o=bc[a.textAlign||Gc],n=bc[a.textBaseline||rd],l=p&&p.lineWidth?p.lineWidth:0;return{label:$,anchorX:o*($.width/s-2*a.scale)+2*(.5-o)*l,anchorY:n*$.height/s+2*(.5-n)*l}},t.prototype.execute_=function(t,e,r,i,a,$){var p;this.declutterItems.length=0,this.pixelCoordinates_&&pc(e,this.renderedTransform_)?p=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),p=Jb(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),co(this.renderedTransform_,e));for(var s,o,n,l,h,E,v,m,u,c,K,Z,f,d,_,x,g,T=0,y=r.length,I=0,b=0,S=0,C=null,k=null,L=this.coordinateCache_,R=this.viewRotation_,O=Math.round(1e12*Math.atan2(-e[1],e[0]))/1e12,w={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:R},A=this.instructions!=r||this.overlaps?0:200;T<y;){var D=r[T];switch(D[0]){case ea.BEGIN_GEOMETRY:(_=D[1]).getGeometry()?void 0===$||Fa($,D[3])?++T:T=D[2]+1:T=D[2];break;case ea.BEGIN_PATH:b>A&&(this.fill_(t),b=0),S>A&&(t.stroke(),S=0),b||S||(t.beginPath(),l=NaN,h=NaN),++T;break;case ea.CIRCLE:var M=p[I=D[1]],q=p[I+1],N=p[I+2]-M,P=p[I+3]-q,W=Math.sqrt(N*N+P*P);t.moveTo(M+W,q),t.arc(M,q,W,0,2*Math.PI,!0),++T;break;case ea.CLOSE_PATH:t.closePath(),++T;break;case ea.CUSTOM:I=D[1],s=D[2];var j=D[3],B=D[4],F=6==D.length?D[5]:void 0;w.geometry=j,w.feature=_,T in L||(L[T]=[]);var G=L[T];F?F(p,I,s,2,G):(G[0]=p[I],G[1]=p[I+1],G.length=2),B(G,w),++T;break;case ea.DRAW_IMAGE:I=D[1],s=D[2],c=D[3],o=D[4],n=D[5],u=a?null:D[6];var X=D[7],Y=D[8],H=D[9],U=D[10],J=D[11],V=D[12],z=D[13],Q=D[14];if(!c&&D.length>=19){K=D[18],Z=D[19],f=D[20],d=D[21];var tt=this.drawLabelWithPointPlacement_(K,Z,f,d);c=tt.label,D[3]=c;var et=D[22];o=(tt.anchorX-et)*this.pixelRatio,D[4]=o;var rt=D[23];n=(tt.anchorY-rt)*this.pixelRatio,D[5]=n,X=c.height,D[7]=X,Q=c.width,D[14]=Q}var it=void 0;D.length>24&&(it=D[24]);var at=void 0,$t=void 0,pt=void 0;D.length>16?(at=D[15],$t=D[16],pt=D[17]):(at=gc,$t=!1,pt=!1),J&&O?V+=R:J||O||(V-=R);for(var st=0,ot=0;I<s;I+=2)if(!(it&&it[st++]<Q/this.pixelRatio)){if(u){var nt=Math.floor(ot);u.length<nt+1&&((m=Ga()).push(u[0][4]),u.push(m)),m=u[nt]}this.replayImageOrLabel_(t,p[I],p[I+1],c,o,n,m,X,Y,H,U,V,z,i,Q,at,$t?C:null,pt?k:null),m&&(ot===Math.floor(ot)&&this.declutterItems.push(this,m,_),ot+=1/m[4])}++T;break;case ea.DRAW_CHARS:var lt=D[1],ht=D[2],Et=D[3];m=a?null:D[4];var vt=D[5];d=D[6];var mt=D[7],ut=D[8],ct=D[9];f=D[10];var Kt=D[11];K=D[12],Z=D[13];var Zt=D[14],ft=this.textStates[Z],dt=ft.font,_t=ft.scale*ut,xt=void 0;dt in this.widths_?xt=this.widths_[dt]:(xt={},this.widths_[dt]=xt);var gt=mk(p,lt,ht,2),Tt=_t*ii(dt,K,xt);if(vt||Tt<=gt){var yt=this.textStates[Z].textAlign,It=(gt-Tt)*bc[yt],bt=$l(p,lt,ht,2,K,It,mt,_t,ii,dt,xt);if(bt){var St=void 0,Ct=void 0,kt=void 0,Lt=void 0,Rt=void 0;if(f)for(St=0,Ct=bt.length;St<Ct;++St)kt=(Rt=bt[St])[4],Lt=this.createLabel(kt,Z,"",f),o=Rt[2]+Kt,n=Et*Lt.height+2*(.5-Et)*Kt-ct,this.replayImageOrLabel_(t,Rt[0],Rt[1],Lt,o,n,m,Lt.height,1,0,0,Rt[3],Zt,!1,Lt.width,gc,null,null);if(d)for(St=0,Ct=bt.length;St<Ct;++St)kt=(Rt=bt[St])[4],Lt=this.createLabel(kt,Z,d,""),o=Rt[2],n=Et*Lt.height-ct,this.replayImageOrLabel_(t,Rt[0],Rt[1],Lt,o,n,m,Lt.height,1,0,0,Rt[3],Zt,!1,Lt.width,gc,null,null)}}this.declutterItems.push(this,m,_),++T;break;case ea.END_GEOMETRY:if(void 0!==a){var Ot=a(_=D[1]);if(Ot)return Ot}++T;break;case ea.FILL:A?b++:this.fill_(t),++T;break;case ea.MOVE_TO_LINE_TO:for(I=D[1],s=D[2],x=p[I],v=(g=p[I+1])+.5|0,(E=x+.5|0)===l&&v===h||(t.moveTo(x,g),l=E,h=v),I+=2;I<s;I+=2)E=(x=p[I])+.5|0,v=(g=p[I+1])+.5|0,I!=s-2&&E===l&&v===h||(t.lineTo(x,g),l=E,h=v);++T;break;case ea.SET_FILL_STYLE:C=D,this.alignFill_=D[2],b&&(this.fill_(t),b=0,S&&(t.stroke(),S=0)),t.fillStyle=D[1],++T;break;case ea.SET_STROKE_STYLE:k=D,S&&(t.stroke(),S=0),this.setStrokeStyle_(t,D),++T;break;case ea.STROKE:A?S++:t.stroke(),++T;break;default:++T;}}b&&this.fill_(t),S&&t.stroke()},t.prototype.execute=function(t,e,r,i){this.viewRotation_=r,this.execute_(t,e,this.instructions,i,void 0,void 0)},t.prototype.executeHitDetection=function(t,e,r,i,a){return this.viewRotation_=r,this.execute_(t,e,this.hitDetectionInstructions,!0,i,a)},t}();var Mf=[na.POLYGON,na.CIRCLE,na.LINE_STRING,na.IMAGE,na.TEXT,na.DEFAULT],km=function(){function r(r,e,t,i,o,n){this.maxExtent_=r,this.overlaps_=i,this.pixelRatio_=t,this.resolution_=e,this.renderBuffer_=n,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Za(),this.createExecutors_(o)}return r.prototype.clip=function(r,e){var t=this.getClipCoords(e);r.beginPath(),r.moveTo(t[0],t[1]),r.lineTo(t[2],t[3]),r.lineTo(t[4],t[5]),r.lineTo(t[6],t[7]),r.clip()},r.prototype.createExecutors_=function(r){for(var e in r){var t=this.executorsByZIndex_[e];void 0===t&&(t={},this.executorsByZIndex_[e]=t);var i=r[e];for(var o in i){var n=i[o];t[o]=new im(this.resolution_,this.pixelRatio_,this.overlaps_,n)}}},r.prototype.hasExecutors=function(r){for(var e in this.executorsByZIndex_)for(var t=this.executorsByZIndex_[e],i=0,o=r.length;i<o;++i)if(r[i]in t)return!0;return!1},r.prototype.forEachFeatureAtCoordinate=function(r,e,t,i,o,n){var $=2*(i=Math.round(i))+1,c=rb(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-t,-r[0],-r[1]);this.hitDetectionContext_||(this.hitDetectionContext_=Ja($,$));var a,l=this.hitDetectionContext_;l.canvas.width!==$||l.canvas.height!==$?(l.canvas.width=$,l.canvas.height=$):l.clearRect(0,0,$,$),void 0!==this.renderBuffer_&&(a=Ga(),yc(a,r),Zd(a,e*(this.renderBuffer_+i),a));var s,p=nm(i);function u(r){for(var e=l.getImageData(0,0,$,$).data,t=0;t<$;t++)for(var i=0;i<$;i++)if(p[t][i]&&e[4*(i*$+t)+3]>0){var c=void 0;return(!n||s!=na.IMAGE&&s!=na.TEXT||-1!==n.indexOf(r))&&(c=o(r)),c||void l.clearRect(0,0,$,$)}}var E,g,f,v,d,h=Object.keys(this.executorsByZIndex_).map(Number);for(h.sort(xb),E=h.length-1;E>=0;--E){var x=h[E].toString();for(f=this.executorsByZIndex_[x],g=Mf.length-1;g>=0;--g)if(void 0!==(v=f[s=Mf[g]])&&(d=v.executeHitDetection(l,c,t,u,a)))return d}},r.prototype.getClipCoords=function(r){var e=this.maxExtent_;if(!e)return null;var t=e[0],i=e[1],o=e[2],n=e[3],$=[t,i,t,n,o,n,o,i];return Jb($,0,8,2,r,$),$},r.prototype.isEmpty=function(){return Qc(this.executorsByZIndex_)},r.prototype.execute=function(r,e,t,i,o,n){var $=Object.keys(this.executorsByZIndex_).map(Number);$.sort(xb),this.maxExtent_&&(r.save(),this.clip(r,e));var c,a,l,s,p,u,E=o||Mf;for(c=0,a=$.length;c<a;++c){var g=$[c].toString();for(p=this.executorsByZIndex_[g],l=0,s=E.length;l<s;++l){var f=E[l];if(void 0!==(u=p[f]))if(!n||f!=na.IMAGE&&f!=na.TEXT)u.execute(r,e,t,i);else{var v=n[g];v?v.push(u,e.slice(0)):n[g]=[u,e.slice(0)]}}}this.maxExtent_&&r.restore()},r}(),Lf={0:[[!0]]};function wb(r,e,t){var i,o=Math.floor(r.length/2);if(e>=o)for(i=o;i<e;i++)r[i][t]=!0;else if(e<o)for(i=e+1;i<o;i++)r[i][t]=!0}function nm(r){if(void 0!==Lf[r])return Lf[r];for(var e=2*r+1,t=new Array(e),i=0;i<e;i++)t[i]=new Array(e);for(var o=r,n=0,$=0;o>=n;)wb(t,r+o,r+n),wb(t,r+n,r+o),wb(t,r-n,r+o),wb(t,r-o,r+n),wb(t,r-o,r-n),wb(t,r-n,r-o),wb(t,r+n,r-o),wb(t,r+o,r-n),2*(($+=1+2*++n)-o)+1>0&&($+=1-2*(o-=1));return Lf[r]=t,t}function om(r,e,t,i,o,n){for(var $=Object.keys(r).map(Number).sort(xb),c=0,a=$.length;c<a;++c)for(var l=r[$[c].toString()],s=void 0,p=0,u=l.length;p<u;){var E=l[p++];E!==s&&(s=E,n.push({items:E.declutterItems,opacity:i}));var g=l[p++];E.execute(e,g,t,o)}}var uf={};var tf={};var rm=tf&&tf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Dh=function(t){function e(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r}return rm(e,t),e.prototype.getFeatures=function(t){return ca()},e.prototype.prepareFrame=function(t){return ca()},e.prototype.renderFrame=function(t,e){return ca()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(o,a){var n=this.loadedTileCallback.bind(this,r,o);return t.forEachLoadedTile(e,o,a,n)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,o,a){},e.prototype.getDataAtPixel=function(t,e,r){return ca()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===oa.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=oa.LOADED&&e!=oa.ERROR&&t.addEventListener(ba.CHANGE,this.boundHandleImageChange_),e==oa.IDLE&&(t.load(),e=t.getState()),e==oa.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Tb.READY&&t.changed()},e}(vf);tf.default=Dh;var tm=uf&&uf.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),sf=function(t){function r(r){var e=t.call(this,r)||this;return e.container=null,e.renderedResolution,e.tempTransform_=Za(),e.pixelTransform=Za(),e.inversePixelTransform=Za(),e.context=null,e.containerReused=!1,e}return tm(r,t),r.prototype.useContainer=function(t,r,e){var o,n,a=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===a&&($=t.firstElementChild)instanceof HTMLCanvasElement&&(n=$.getContext("2d"));if(n&&n.canvas.style.transform===r?(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=a;var i=o.style;i.position="absolute",i.width="100%",i.height="100%";var $=(n=Ja()).canvas;o.appendChild($),(i=$.style).position="absolute",i.left="0",i.transformOrigin="top left",this.container=o,this.context=n}},r.prototype.clip=function(t,r,e){var o=r.pixelRatio,n=r.size[0]*o/2,a=r.size[1]*o/2,i=r.viewState.rotation,$=Ya(e),p=_b(e),s=Hb(e),f=Bb(e);sa(r.coordinateToPixelTransform,$),sa(r.coordinateToPixelTransform,p),sa(r.coordinateToPixelTransform,s),sa(r.coordinateToPixelTransform,f),t.save(),ki(t,-i,n,a),t.beginPath(),t.moveTo($[0]*o,$[1]*o),t.lineTo(p[0]*o,p[1]*o),t.lineTo(s[0]*o,s[1]*o),t.lineTo(f[0]*o,f[1]*o),t.clip(),ki(t,i,n,a)},r.prototype.clipUnrotated=function(t,r,e){var o=Ya(e),n=_b(e),a=Hb(e),i=Bb(e);sa(r.coordinateToPixelTransform,o),sa(r.coordinateToPixelTransform,n),sa(r.coordinateToPixelTransform,a),sa(r.coordinateToPixelTransform,i);var $=this.inversePixelTransform;sa($,o),sa($,n),sa($,a),sa($,i),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(a[0]),Math.round(a[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.clip()},r.prototype.dispatchRenderEvent_=function(t,r,e){var o=this.getLayer();if(o.hasListener(t)){var n=new nf(t,this.inversePixelTransform,e,r);o.dispatchEvent(n)}},r.prototype.preRender=function(t,r){this.dispatchRenderEvent_(ac.PRERENDER,t,r)},r.prototype.postRender=function(t,r){this.dispatchRenderEvent_(ac.POSTRENDER,t,r)},r.prototype.getRenderTransform=function(t,r,e,o,n,a,i){var $=n/2,p=a/2,s=o/r,f=-s,v=-t[0]+i,m=-t[1];return rb(this.tempTransform_,$,p,s,f,-e,v,m)},r.prototype.getDataAtPixel=function(t,r,e){var o,n=sa(this.inversePixelTransform,t.slice()),a=this.context;try{o=a.getImageData(Math.round(n[0]),Math.round(n[1]),1,1).data}catch(i){return"SecurityError"===i.name?new Uint8Array:o}return 0===o[3]?null:o},r}(Dh);uf.default=sf;function vm(e,t,r,a,o,i,n){var $=e[0]/2,c=e[1]/2,m=Ja($,c);m.imageSmoothingEnabled=!1;for(var g=m.canvas,p=new qi(m,.5,o,null,n),s=r.length,h=Math.floor(16777215/s),l={},C=1;C<=s;++C){var v=r[C-1],M=v.getStyleFunction()||a;if(a){var u=M(v,i);if(u){Array.isArray(u)||(u=[u]);for(var d="#"+("000000"+(C*h).toString(16)).slice(-6),y=0,f=u.length;y<f;++y){var I=u[y],x=I.clone(),S=x.getFill();S&&S.setColor(d);var D=x.getStroke();D&&D.setColor(d),x.setText(void 0);var w=I.getImage();if(w){var T=w.getImageSize();if(!T)continue;var G=document.createElement("canvas");G.width=T[0],G.height=T[1];var j=G.getContext("2d",{alpha:!1});j.fillStyle=d;var q=j.canvas;j.fillRect(0,0,q.width,q.height);var E=T?T[0]:q.width,b=T?T[1]:q.height;Ja(E,b).drawImage(q,0,0),x.setImage(new ak({img:q,imgSize:T,anchor:w.getAnchor(),anchorXUnits:tb.PIXELS,anchorYUnits:tb.PIXELS,offset:w.getOrigin(),size:w.getSize(),opacity:w.getOpacity(),scale:w.getScale(),rotation:w.getRotation(),rotateWithView:w.getRotateWithView()}))}var A=Number(x.getZIndex());(L=l[A])||(L={},l[A]=L,L[aa.POLYGON]=[],L[aa.CIRCLE]=[],L[aa.LINE_STRING]=[],L[aa.POINT]=[]);var N=x.getGeometryFunction()(v);N&&Fa(o,N.getExtent())&&L[N.getType().replace("Multi","")].push(N,x)}}}}for(var O=Object.keys(l).map(Number).sort(xb),R=(C=0,O.length);C<R;++C){var L=l[O[C]];for(var U in L){var z=L[U];for(y=0,f=z.length;y<f;y+=2){p.setStyle(z[y+1]);for(var F=0,P=t.length;F<P;++F)p.setTransform(t[F]),p.drawGeometry(z[y])}}}return document.body.appendChild(m.canvas),m.getImageData(0,0,g.width,g.height)}function wm(e,t,r){var a=[];if(r){var o=4*(Math.round(e[0]/2)+Math.round(e[1]/2)*r.width),i=r.data[o],n=r.data[o+1],$=r.data[o+2]+256*(n+256*i),c=Math.floor(16777215/t.length);$&&$%c==0&&a.push(t[$/c-1])}return a}var rf={};var tb={FRACTION:"fraction",PIXELS:"pixels"};var ed={};var dd={};var hf={};var Cm=hf&&hf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),uk=function(t){function e(e,r,o,n){var p=t.call(this)||this;return p.extent=e,p.pixelRatio_=o,p.resolution=r,p.state=n,p}return Cm(e,t),e.prototype.changed=function(){this.dispatchEvent(ba.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return ca()},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(){ca()},e}(Pb);hf.default=uk;var Em=dd&&dd.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fm=function(t){function e(e,n,i,r,o,a){var $=t.call(this,e,n,i,oa.IDLE)||this;return $.src_=r,$.image_=new Image,null!==o&&($.image_.crossOrigin=o),$.unlisten_=null,$.state=oa.IDLE,$.imageLoadFunction_=a,$}return Em(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=oa.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ab(this.extent)/this.image_.height),this.state=oa.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=oa.IDLE&&this.state!=oa.ERROR||(this.state=oa.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=fd(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(uk);function fd(t,e,n){var i=t;if(i.src&&gj){var r=i.decode(),o=!0;return r.then(function(){o&&e()}).catch(function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())}),function(){o=!1}}var a=[Ec(i,ba.LOAD,e),Ec(i,ba.ERROR,n)];return function(){a.forEach(ja)}}dd.listenImage=fd,dd.default=Fm;var Hm=ed&&ed.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),pk=function(t){function e(e,i,a,n,r,s){var o=t.call(this)||this;return o.hitDetectionImage_=null,o.image_=e||new Image,null!==n&&(o.image_.crossOrigin=n),o.canvas_=s?document.createElement("canvas"):null,o.color_=s,o.unlisten_=null,o.imageState_=r,o.size_=a,o.src_=i,o.tainted_,o}return Hm(e,t),e.prototype.isTainted_=function(t){if(void 0===this.tainted_&&this.imageState_===oa.LOADED){t||(t=Ja(1,1)).drawImage(this.image_,0,0);try{t.getImageData(0,0,1,1),this.tainted_=!1}catch(e){this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(ba.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=oa.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=oa.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.isTainted_()){var e=this.size_[0],i=this.size_[1],a=Ja(e,i);a.fillRect(0,0,e,i),this.hitDetectionImage_=a.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_==oa.IDLE){this.imageState_=oa.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=fd(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(){if(this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");if(t.drawImage(this.image_,0,0),this.isTainted_(t)){var e=this.color_;return t.globalCompositeOperation="multiply",t.fillStyle="rgb("+e[0]+","+e[1]+","+e[2]+")",t.fillRect(0,0,this.image_.width,this.image_.height),t.globalCompositeOperation="destination-in",void t.drawImage(this.image_,0,0)}for(var i=t.getImageData(0,0,this.image_.width,this.image_.height),a=i.data,n=this.color_[0]/255,r=this.color_[1]/255,s=this.color_[2]/255,o=0,h=a.length;o<h;o+=4)a[o]*=n,a[o+1]*=r,a[o+2]*=s;t.putImageData(i,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Pb);function ik(t,e,i,a,n,r){var s=gd.get(e,a,r);return s||(s=new pk(t,e,i,a,n,r),gd.set(e,a,r,s)),s}ed.get=ik,ed.default=pk;var Qa={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Lm=rf&&rf.__extends||function(){var i=function(t,o){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}i(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),ak=function(i){function t(t){var o=this,r=t||{},n=void 0!==r.opacity?r.opacity:1,e=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,c=void 0!==r.rotateWithView&&r.rotateWithView;(o=i.call(this,{opacity:n,rotation:e,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:c})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],o.normalizedAnchor_=null,o.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:Qa.TOP_LEFT,o.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:tb.FRACTION,o.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:tb.FRACTION,o.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var a=void 0!==r.img?r.img:null,h=void 0!==r.imgSize?r.imgSize:null,$=r.src;ia(!(void 0!==$&&a),4),ia(!a||a&&h,5),void 0!==$&&0!==$.length||!a||($=a.src||ga(a)),ia(void 0!==$&&$.length>0,6);var g=void 0!==r.src?oa.IDLE:oa.LOADED;return o.color_=void 0!==r.color?Eh(r.color):null,o.iconImage_=ik(a,$,h,o.crossOrigin_,g,o.color_),o.offset_=void 0!==r.offset?r.offset:[0,0],o.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:Qa.TOP_LEFT,o.origin_=null,o.size_=void 0!==r.size?r.size:null,o}return Lm(t,i),t.prototype.clone=function(){return new t({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:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var i=this.anchor_,t=this.getSize();if(this.anchorXUnits_==tb.FRACTION||this.anchorYUnits_==tb.FRACTION){if(!t)return null;i=this.anchor_.slice(),this.anchorXUnits_==tb.FRACTION&&(i[0]*=t[0]),this.anchorYUnits_==tb.FRACTION&&(i[1]*=t[1])}if(this.anchorOrigin_!=Qa.TOP_LEFT){if(!t)return null;i===this.anchor_&&(i=this.anchor_.slice()),this.anchorOrigin_!=Qa.TOP_RIGHT&&this.anchorOrigin_!=Qa.BOTTOM_RIGHT||(i[0]=-i[0]+t[0]),this.anchorOrigin_!=Qa.BOTTOM_LEFT&&this.anchorOrigin_!=Qa.BOTTOM_RIGHT||(i[1]=-i[1]+t[1])}return this.normalizedAnchor_=i,this.normalizedAnchor_},t.prototype.setAnchor=function(i){this.anchor_=i,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(i){return this.iconImage_.getImage(i)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(i){return this.iconImage_.getHitDetectionImage(i)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var i=this.offset_,t=this.getDisplacement();if(this.offsetOrigin_!=Qa.TOP_LEFT){var o=this.getSize(),r=this.iconImage_.getSize();if(!o||!r)return null;i=i.slice(),this.offsetOrigin_!=Qa.TOP_RIGHT&&this.offsetOrigin_!=Qa.BOTTOM_RIGHT||(i[0]=r[0]-o[0]-i[0]),this.offsetOrigin_!=Qa.BOTTOM_LEFT&&this.offsetOrigin_!=Qa.BOTTOM_RIGHT||(i[1]=r[1]-o[1]-i[1])}return i[0]+=t[0],i[1]+=t[1],this.origin_=i,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(i){this.iconImage_.addEventListener(ba.CHANGE,i)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(i){this.iconImage_.removeEventListener(ba.CHANGE,i)},t}(zj);rf.default=ak;var Nm=vg&&vg.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Wj=function(e){function t(t){var r=e.call(this,t)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=Ga(),r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r}return Nm(t,e),t.prototype.useContainer=function(t,r,i){i<1&&(t=null),e.prototype.useContainer.call(this,t,r,i)},t.prototype.renderFrame=function(e,t){var r=e.pixelRatio,i=e.layerStatesArray[e.layerIndex];_n(this.pixelTransform,1/r,1/r),Kf(this.inversePixelTransform,this.pixelTransform);var n=Pf(this.pixelTransform);this.useContainer(t,n,i.opacity);var a=this.context,o=a.canvas,s=this.replayGroup_;if(!s||s.isEmpty())return!this.containerReused&&o.width>0&&(o.width=0),this.container;var $=Math.round(e.size[0]*r),d=Math.round(e.size[1]*r);o.width!=$||o.height!=d?(o.width=$,o.height=d,o.style.transform!==n&&(o.style.transform=n)):this.containerReused||a.clearRect(0,0,$,d),this.preRender(a,e);var p=e.extent,u=e.viewState,h=u.center,c=u.resolution,l=u.projection,g=u.rotation,m=l.getExtent(),F=this.getLayer().getSource(),f=!1;if(i.extent){var v=Ab(i.extent,l);(f=!fb(v,e.extent)&&Fa(v,e.extent))&&this.clip(a,e,v)}var _=e.viewHints,y=!(_[ya.ANIMATING]||_[ya.INTERACTING]),x=this.getRenderTransform(h,c,g,r,$,d,0),R=this.getLayer().getDeclutter()?{}:null;if(s.execute(a,x,g,y,void 0,R),F.getWrapX()&&l.canWrapX()&&!fb(m,p)){for(var I=p[0],w=ta(m),E=0,T=void 0;I<m[0];){T=w*--E;var C=this.getRenderTransform(h,c,g,r,$,d,T);s.execute(a,C,g,y,void 0,R),I+=w}for(E=0,I=p[2];I>m[2];){T=w*++E;var j=this.getRenderTransform(h,c,g,r,$,d,T);s.execute(a,j,g,y,void 0,R),I-=w}}if(R){var G=e.viewHints,S=!(G[ya.ANIMATING]||G[ya.INTERACTING]);om(R,a,g,1,S,e.declutterItems)}f&&a.restore(),this.postRender(a,e);var A=i.opacity,D=this.container;return A!==parseFloat(D.style.opacity)&&(D.style.opacity=1===A?"":A),this.container},t.prototype.getFeatures=function(e){return new Promise(function(t,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];sa(this.pixelTransform,i);var n=this.renderedCenter_,a=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,$=this.renderedExtent_,d=this.getLayer(),p=[],u=i[0]/2,h=i[1]/2;p.push(this.getRenderTransform(n,a,o,.5,u,h,0).slice());var c=d.getSource(),l=s.getExtent();if(c.getWrapX()&&s.canWrapX()&&!fb(l,$)){for(var g=$[0],m=ta(l),F=0,f=void 0;g<l[0];)f=m*--F,p.push(this.getRenderTransform(n,a,o,.5,u,h,f).slice()),g+=m;for(F=0,g=$[2];g>l[2];)f=m*++F,p.push(this.getRenderTransform(n,a,o,.5,u,h,f).slice()),g-=m}this.hitDetectionImageData_=vm(i,p,this.renderedFeatures_,d.getStyleFunction(),$,a,o)}t(wm(e,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},t.prototype.forEachFeatureAtCoordinate=function(e,t,r,i,n){if(this.replayGroup_){var a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),$={};return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,r,function(e){var t=ga(e);if(!(t in $))return $[t]=!0,i(e,s)},s.getDeclutter()?n:null)}},t.prototype.handleFontsChanged=function(){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},t.prototype.handleStyleImageChange_=function(e){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(e){var t=this.getLayer(),r=t.getSource();if(!r)return!1;var i=e.viewHints[ya.ANIMATING],n=e.viewHints[ya.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(!this.dirty_&&!a&&i||!o&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=e.extent,$=e.viewState,d=$.projection,p=$.resolution,u=e.pixelRatio,h=t.getRevision(),c=t.getRenderBuffer(),l=t.getRenderOrder();void 0===l&&(l=am);var g=$.center.slice(),m=Zd(s,c*p),F=[m.slice()],f=d.getExtent();if(r.getWrapX()&&d.canWrapX()&&!fb(f,e.extent)){var v=ta(f),_=Math.max(ta(m)/2,v);m[0]=f[0]-_,m[2]=f[2]+_,$i(g,d);var y=Xo(F[0],d);y[0]<f[0]&&y[2]<f[2]?F.push([y[0]+v,y[1],y[2]+v,y[3]]):y[0]>f[0]&&y[2]>f[2]&&F.push([y[0]-v,y[1],y[2]-v,y[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==h&&this.renderedRenderOrder_==l&&fb(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var x,R=new Zl(xi(p,u),m,p,u,t.getDeclutter()),I=Ia();if(I){for(var w=0,E=F.length;w<E;++w)r.loadFeatures($c(F[w],d),p,I);x=ic(I,d)}else for(w=0,E=F.length;w<E;++w)r.loadFeatures(F[w],p,d);var T=_l(p,u),C=function(e){var r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,p)),r){var n=this.renderFeature(e,T,r,R,x);this.dirty_=this.dirty_||n}}.bind(this),j=$c(m,d),G=r.getFeaturesInExtent(j);l&&G.sort(l);for(w=0,E=G.length;w<E;++w)C(G[w]);this.renderedFeatures_=G;var S=R.finish(),A=new km(m,p,u,r.getOverlaps(),S,t.getRenderBuffer());return this.renderedResolution_=p,this.renderedRevision_=h,this.renderedRenderOrder_=l,this.renderedExtent_=m,this.renderedRotation_=$.rotation,this.renderedCenter_=g,this.renderedProjection_=d,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},t.prototype.renderFeature=function(e,t,r,i,n){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var o=0,s=r.length;o<s;++o)a=zi(i,e,r[o],t,this.boundHandleStyleImageChange_,n)||a;else a=zi(i,e,r,t,this.boundHandleStyleImageChange_,n);return a},t}(sf);vg.default=Wj;var Pm=Vg&&Vg.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),xc=function(e){function r(r){return e.call(this,r)||this}return Pm(r,e),r.prototype.createRenderer=function(){return new Wj(this)},r}(cj);Vg.default=xc;var id={};var uc={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var Tm=!1;function Um(e,t,r,$){return function(o,a,s){var i=new XMLHttpRequest;i.open("GET","function"==typeof e?e(o,a,s):e,!0),t.getType()==uc.ARRAY_BUFFER&&(i.responseType="arraybuffer"),i.withCredentials=Tm,i.onload=function(e){if(!i.status||i.status>=200&&i.status<300){var a=t.getType(),n=void 0;a==uc.JSON||a==uc.TEXT?n=i.responseText:a==uc.XML?(n=i.responseXML)||(n=new DOMParser().parseFromString(i.responseText,"application/xml")):a==uc.ARRAY_BUFFER&&(n=i.response),n?r.call(this,t.readFeatures(n,{extent:o,featureProjection:s}),t.readProjection(n)):$.call(this)}else $.call(this)}.bind(this),i.onerror=function(){$.call(this)}.bind(this),i.send()}}function Bj(e,t){return Um(e,t,function(e,t){"function"==typeof this.addFeatures&&this.addFeatures(e)},qb)}function Wm(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Qe={};var Ym=Qe&&Qe.__extends||function(){var t=function(r,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])})(r,o)};return function(r,o){function e(){this.constructor=r}t(r,o),r.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),Ne=function(t){function r(r){var o=t.call(this)||this;return o.projection_=va(r.projection),o.attributions_=pj(r.attributions),o.attributionsCollapsible_=void 0===r.attributionsCollapsible||r.attributionsCollapsible,o.loading=!1,o.state_=void 0!==r.state?r.state:Tb.READY,o.wrapX_=void 0!==r.wrapX&&r.wrapX,o}return Ym(r,t),r.prototype.getAttributions=function(){return this.attributions_},r.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},r.prototype.getProjection=function(){return this.projection_},r.prototype.getResolutions=function(){return ca()},r.prototype.getState=function(){return this.state_},r.prototype.getWrapX=function(){return this.wrapX_},r.prototype.refresh=function(){this.changed()},r.prototype.setAttributions=function(t){this.attributions_=pj(t),this.changed()},r.prototype.setState=function(t){this.state_=t,this.changed()},r}(Oa);function pj(t){return t?Array.isArray(t)?function(r){return t}:"function"==typeof t?t:function(r){return[t]}:null}Qe.default=Ne;var Sa={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var pd=function(){function t(t){var $C6Up$$interop$default=xh(Gd);this.rbush_=new $C6Up$$interop$default.d(t),this.items_={}}return t.prototype.insert=function(t,r){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:r};this.rbush_.insert(i),this.items_[ga(r)]=i},t.prototype.load=function(t,r){for(var i=new Array(r.length),e=0,n=r.length;e<n;e++){var o=t[e],s=r[e],u={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[e]=u,this.items_[ga(s)]=u}this.rbush_.load(i)},t.prototype.remove=function(t){var r=ga(t),i=this.items_[r];return delete this.items_[r],null!==this.rbush_.remove(i)},t.prototype.update=function(t,r){var i=this.items_[ga(r)],e=[i.minX,i.minY,i.maxX,i.maxY];vc(e,t)||(this.remove(r),this.insert(t,r))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(r).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,r){return this.forEach_(this.getInExtent(t),r)},t.prototype.forEach_=function(t,r){for(var i,e=0,n=t.length;e<n;e++)if(i=r(t[e]))return i;return i},t.prototype.isEmpty=function(){return Qc(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var r=this.rbush_.toJSON();return Ra(r.minX,r.minY,r.maxX,r.maxY,t)},t.prototype.concat=function(t){for(var r in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[r]=t.items_[r]},t}();var jj=id&&id.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),mc=function(e){function t(t,r){var o=e.call(this,t)||this;return o.feature=r,o}return jj(t,e),t}(Ea);id.VectorSourceEvent=mc;var lc=function(e){function t(t){var r=this,o=t||{};(r=e.call(this,{attributions:o.attributions,projection:void 0,state:Tb.READY,wrapX:void 0===o.wrapX||o.wrapX})||this).loader_=qb,r.format_=o.format,r.overlaps_=void 0===o.overlaps||o.overlaps,r.url_=o.url,void 0!==o.loader?r.loader_=o.loader:void 0!==r.url_&&(ia(r.format_,7),r.loader_=Bj(r.url_,r.format_)),r.strategy_=void 0!==o.strategy?o.strategy:Wm;var i,n,s=void 0===o.useSpatialIndex||o.useSpatialIndex;return r.featuresRtree_=s?new pd:null,r.loadedExtentsRtree_=new pd,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(o.features)?n=o.features:o.features&&(n=(i=o.features).getArray()),s||void 0!==i||(i=new za(n)),void 0!==n&&r.addFeaturesInternal(n),void 0!==i&&r.bindFeaturesCollection_(i),r}return jj(t,e),t.prototype.addFeature=function(e){this.addFeatureInternal(e),this.changed()},t.prototype.addFeatureInternal=function(e){var t=ga(e);if(this.addToIndex_(t,e)){this.setupChangeEvents_(t,e);var r=e.getGeometry();if(r){var o=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new mc(Sa.ADDFEATURE,e))}else this.featuresCollection_&&this.featuresCollection_.remove(e)},t.prototype.setupChangeEvents_=function(e,t){this.featureChangeKeys_[e]=[fa(t,ba.CHANGE,this.handleFeatureChange_,this),fa(t,ub.PROPERTYCHANGE,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(e,t){var r=!0,o=t.getId();return void 0!==o&&(o.toString()in this.idIndex_?r=!1:this.idIndex_[o.toString()]=t),r&&(ia(!(e in this.uidIndex_),30),this.uidIndex_[e]=t),r},t.prototype.addFeatures=function(e){this.addFeaturesInternal(e),this.changed()},t.prototype.addFeaturesInternal=function(e){for(var t=[],r=[],o=[],i=0,n=e.length;i<n;i++){var s=e[i],a=ga(s);this.addToIndex_(a,s)&&r.push(s)}i=0;for(var u=r.length;i<u;i++){s=r[i],a=ga(s);this.setupChangeEvents_(a,s);var $=s.getGeometry();if($){var l=$.getExtent();t.push(l),o.push(s)}else this.nullGeometryFeatures_[a]=s}this.featuresRtree_&&this.featuresRtree_.load(t,o);i=0;for(var p=r.length;i<p;i++)this.dispatchEvent(new mc(Sa.ADDFEATURE,r[i]))},t.prototype.bindFeaturesCollection_=function(e){var t=!1;this.addEventListener(Sa.ADDFEATURE,function(r){t||(t=!0,e.push(r.feature),t=!1)}),this.addEventListener(Sa.REMOVEFEATURE,function(r){t||(t=!0,e.remove(r.feature),t=!1)}),e.addEventListener(ra.ADD,function(e){t||(t=!0,this.addFeature(e.element),t=!1)}.bind(this)),e.addEventListener(ra.REMOVE,function(e){t||(t=!0,this.removeFeature(e.element),t=!1)}.bind(this)),this.featuresCollection_=e},t.prototype.clear=function(e){if(e){for(var t in this.featureChangeKeys_){this.featureChangeKeys_[t].forEach(ja)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new mc(Sa.CLEAR);this.dispatchEvent(o),this.changed()},t.prototype.forEachFeature=function(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},t.prototype.forEachFeatureAtCoordinateDirect=function(e,t){var r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,function(r){return r.getGeometry().intersectsCoordinate(e)?t(r):void 0})},t.prototype.forEachFeatureInExtent=function(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},t.prototype.forEachFeatureIntersectingExtent=function(e,t){return this.forEachFeatureInExtent(e,function(r){if(r.getGeometry().intersectsExtent(e)){var o=t(r);if(o)return o}})},t.prototype.getFeaturesCollection=function(){return this.featuresCollection_},t.prototype.getFeatures=function(){var e;return this.featuresCollection_?e=this.featuresCollection_.getArray():this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Qc(this.nullGeometryFeatures_)||Na(e,Oe(this.nullGeometryFeatures_))),e},t.prototype.getFeaturesAtCoordinate=function(e){var t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t},t.prototype.getFeaturesInExtent=function(e){return this.featuresRtree_?this.featuresRtree_.getInExtent(e):this.featuresCollection_?this.featuresCollection_.getArray():[]},t.prototype.getClosestFeatureToCoordinate=function(e,t){var r=e[0],o=e[1],i=null,n=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],u=t||La;return this.featuresRtree_.forEachInExtent(a,function(e){if(u(e)){var t=e.getGeometry(),$=s;if((s=t.closestPointXY(r,o,n,s))<$){i=e;var l=Math.sqrt(s);a[0]=r-l,a[1]=o-l,a[2]=r+l,a[3]=o+l}}}),i},t.prototype.getExtent=function(e){return this.featuresRtree_.getExtent(e)},t.prototype.getFeatureById=function(e){var t=this.idIndex_[e.toString()];return void 0!==t?t:null},t.prototype.getFeatureByUid=function(e){var t=this.uidIndex_[e];return void 0!==t?t:null},t.prototype.getFormat=function(){return this.format_},t.prototype.getOverlaps=function(){return this.overlaps_},t.prototype.getUrl=function(){return this.url_},t.prototype.handleFeatureChange_=function(e){var t=e.target,r=ga(t),o=t.getGeometry();if(o){var i=o.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,t)):this.featuresRtree_&&this.featuresRtree_.update(i,t)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[r]=t);var n=t.getId();if(void 0!==n){var s=n.toString();this.idIndex_[s]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[s]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[r]=t;this.changed(),this.dispatchEvent(new mc(Sa.CHANGEFEATURE,t))},t.prototype.hasFeature=function(e){var t=e.getId();return void 0!==t?t in this.idIndex_:ga(e)in this.uidIndex_},t.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Qc(this.nullGeometryFeatures_)},t.prototype.loadFeatures=function(e,t,r){var o=this.loadedExtentsRtree_,i=this.strategy_(e,t);this.loading=!1;for(var n=function(e,n){var a=i[e];o.forEachInExtent(a,function(e){return fb(e.extent,a)})||(s.loader_.call(s,a,t,r),o.insert(a,{extent:a.slice()}),s.loading=s.loader_!==qb)},s=this,a=0,u=i.length;a<u;++a)n(a)},t.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),e.prototype.refresh.call(this)},t.prototype.removeLoadedExtent=function(e){var t,r=this.loadedExtentsRtree_;r.forEachInExtent(e,function(r){if(vc(r.extent,e))return t=r,!0}),t&&r.remove(t)},t.prototype.removeFeature=function(e){var t=ga(e);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.removeFeatureInternal(e),this.changed()},t.prototype.removeFeatureInternal=function(e){var t=ga(e);this.featureChangeKeys_[t].forEach(ja),delete this.featureChangeKeys_[t];var r=e.getId();void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[t],this.dispatchEvent(new mc(Sa.REMOVEFEATURE,e))},t.prototype.removeFromIdIndex_=function(e){var t=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===e){delete this.idIndex_[r],t=!0;break}return t},t.prototype.setLoader=function(e){this.loader_=e},t.prototype.setUrl=function(e){ia(this.format_,7),this.setLoader(Bj(e,this.format_))},t}(Ne);id.default=lc;var Zi=Zc&&Zc.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),la={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},sd={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"},td=function(e){function t(t,i){var r=e.call(this,t)||this;return r.feature=i,r}return Zi(t,e),t}(Ea),wi=function(e){function t(t){var i=this,r=t;r.stopDown||(r.stopDown=Mb),(i=e.call(this,r)||this).shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.freehand_=!1,i.source_=t.source?t.source:null,i.features_=t.features?t.features:null,i.snapTolerance_=t.snapTolerance?t.snapTolerance:12,i.type_=t.type,i.mode_=nn(i.type_),i.stopClick_=!!t.stopClick,i.minPoints_=t.minPoints?t.minPoints:i.mode_===la.POLYGON?3:2,i.maxPoints_=t.maxPoints?t.maxPoints:1/0,i.finishCondition_=t.finishCondition?t.finishCondition:La;var o=t.geometryFunction;if(!o)if(i.type_===aa.CIRCLE)o=function(e,t,i){var r=t||new Kc([NaN,NaN]),o=ka(e[0],i),n=Ka(o,ka(e[1],i));r.setCenterAndRadius(o,Math.sqrt(n));var s=Ia();return s&&r.transform(i,s),r};else{var n,s=i.mode_;s===la.POINT?n=kb:s===la.LINE_STRING?n=Xb:s===la.POLYGON&&(n=bb),o=function(e,t,i){var r=t;return r?s===la.POLYGON?e[0].length?r.setCoordinates([e[0].concat([e[0][0]])]):r.setCoordinates([]):r.setCoordinates(e):r=new n(e),r}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,i.overlay_=new xc({source:new lc({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:kn(),updateWhileInteracting:!0}),i.geometryName_=t.geometryName,i.condition_=t.condition?t.condition:Ng,i.freehandCondition_,t.freehand?i.freehandCondition_=Mg:i.freehandCondition_=t.freehandCondition?t.freehandCondition:fe,i.addEventListener(qa($d.ACTIVE),i.updateState_),i}return Zi(t,e),t.prototype.setMap=function(t){e.prototype.setMap.call(this,t),this.updateState_()},t.prototype.getOverlay=function(){return this.overlay_},t.prototype.handleEvent=function(t){t.originalEvent.type===ba.CONTEXTMENU&&t.preventDefault(),this.freehand_=this.mode_!==la.POINT&&this.freehandCondition_(t);var i=t.type===ha.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&t.type===ha.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.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_&&t.type===ha.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),r=!1):this.freehand_&&t.type===ha.POINTERDOWN?r=!1:i?(r=t.type===ha.POINTERMOVE)&&this.freehand_?r=this.handlePointerMove_(t):("mouse"==t.pointerEvent.pointerType||t.type===ha.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t):t.type===ha.DBLCLICK&&(r=!1),e.prototype.handleEvent.call(this,t)&&r},t.prototype.handleDownEvent=function(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new gb(ha.POINTERMOVE,e.map,e.pointerEvent,!1,e.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)},t.prototype.handleUpEvent=function(e){var t=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);var i=this.mode_===la.CIRCLE;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(e)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate):(this.startDrawing_(e),this.mode_===la.POINT&&this.finishDrawing()),t=!1):this.freehand_&&this.abortDrawing(),!t&&this.stopClick_&&e.stopPropagation(),t},t.prototype.handlePointerMove_=function(e){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var t=this.downPx_,i=e.pixel,r=t[0]-i[0],o=t[1]-i[1],n=r*r+o*o;if(this.shouldHandle_=this.freehand_?n>this.squaredClickTolerance_:n<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(e):this.createOrUpdateSketchPoint_(e),!0},t.prototype.atFinish_=function(e){var t=!1;if(this.sketchFeature_){var i=!1,r=[this.finishCoordinate_];if(this.mode_===la.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===la.POLYGON){var o=this.sketchCoords_;i=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var n=e.map,s=0,a=r.length;s<a;s++){var $=r[s],h=n.getPixelFromCoordinate($),p=e.pixel,d=p[0]-h[0],_=p[1]-h[1],c=this.freehand_?1:this.snapTolerance_;if(t=Math.sqrt(d*d+_*_)<=c){this.finishCoordinate_=$;break}}}return t},t.prototype.createOrUpdateSketchPoint_=function(e){var t=e.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new _a(new kb(t)),this.updateSketchFeatures_())},t.prototype.startDrawing_=function(e){var t=e.coordinate,i=e.map.getView().getProjection();this.finishCoordinate_=t,this.mode_===la.POINT?this.sketchCoords_=t.slice():this.mode_===la.POLYGON?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new _a(new Xb(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,i);this.sketchFeature_=new _a,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new td(sd.DRAWSTART,this.sketchFeature_))},t.prototype.modifyDrawing_=function(e){var t,i,r,o=e.coordinate,n=this.sketchFeature_.getGeometry(),s=e.map.getView().getProjection();(this.mode_===la.POINT?i=this.sketchCoords_:this.mode_===la.POLYGON?(i=(t=this.sketchCoords_[0])[t.length-1],this.atFinish_(e)&&(o=this.finishCoordinate_.slice())):i=(t=this.sketchCoords_)[t.length-1],i[0]=o[0],i[1]=o[1],this.geometryFunction_(this.sketchCoords_,n,s),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(o);if(n.getType()==aa.POLYGON&&this.mode_!==la.POLYGON){this.sketchLine_||(this.sketchLine_=new _a);var a=n.getLinearRing(0);(r=this.sketchLine_.getGeometry())?(r.setFlatCoordinates(a.getLayout(),a.getFlatCoordinates()),r.changed()):(r=new Xb(a.getFlatCoordinates(),a.getLayout()),this.sketchLine_.setGeometry(r))}else this.sketchLineCoords_&&(r=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},t.prototype.addToDrawing_=function(e){var t,i,r=this.sketchFeature_.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===la.LINE_STRING?(this.finishCoordinate_=e.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():t=!0),i.push(e.slice()),this.geometryFunction_(i,r,o)):this.mode_===la.POLYGON&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():t=!0),i.push(e.slice()),t&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,r,o)),this.updateSketchFeatures_(),t&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var e,t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===la.LINE_STRING?((e=this.sketchCoords_).splice(-2,1),this.geometryFunction_(e,t,i),e.length>=2&&(this.finishCoordinate_=e[e.length-2].slice())):this.mode_===la.POLYGON&&((e=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,i)),0===e.length&&this.abortDrawing(),this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var e=this.abortDrawing_();if(e){var t=this.sketchCoords_,i=e.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===la.LINE_STRING?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_===la.POLYGON&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_===aa.MULTI_POINT?e.setGeometry(new qe([t])):this.type_===aa.MULTI_LINE_STRING?e.setGeometry(new eh([t])):this.type_===aa.MULTI_POLYGON&&e.setGeometry(new Wg([t])),this.dispatchEvent(new td(sd.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e)}},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),e},t.prototype.abortDrawing=function(){var e=this.abortDrawing_();e&&this.dispatchEvent(new td(sd.DRAWABORT,e))},t.prototype.appendCoordinates=function(e){var t=this.mode_,i=[];t===la.LINE_STRING?i=this.sketchCoords_:t===la.POLYGON&&(i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var r=i.pop(),o=0;o<e.length;o++)this.addToDrawing_(e[o]);this.addToDrawing_(r)},t.prototype.extend=function(e){var t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new td(sd.DRAWSTART,this.sketchFeature_))},t.prototype.updateSketchFeatures_=function(){var e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);var t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)},t.prototype.updateState_=function(){var e=this.getMap(),t=this.getActive();e&&t||this.abortDrawing(),this.overlay_.setMap(t?e:null)},t}(Pa);function kn(){var e=Cc();return function(t,i){return e[t.getGeometry().getType()]}}function ln(e,t){return function(i,r,o){var n=ka(i[0],o),s=ka(i[1],o),a=Math.sqrt(Ka(n,s)),$=r||oc(new Kc(n),e),h=t;if(!t){var p=s[0]-n[0],d=s[1]-n[1];h=Math.atan(d/p)-(p<0?Math.PI:0)}Pg($,n,a,h);var _=Ia();return _&&$.transform(o,_),$}}function mn(){return function(e,t,i){var r=ua(e.map(function(e){return ka(e,i)})),o=[[Bb(r),Hb(r),_b(r),Ya(r),Bb(r)]],n=t;n?n.setCoordinates(o):n=new bb(o);var s=Ia();return s&&n.transform(i,s),n}}function nn(e){var t;return e===aa.POINT||e===aa.MULTI_POINT?t=la.POINT:e===aa.LINE_STRING||e===aa.MULTI_LINE_STRING?t=la.LINE_STRING:e===aa.POLYGON||e===aa.MULTI_POLYGON?t=la.POLYGON:e===aa.CIRCLE&&(t=la.CIRCLE),t}Zc.createRegularPolygon=ln,Zc.createBox=mn,Zc.default=wi;var Hg={};var oi=Hg&&Hg.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qn={EXTENTCHANGED:"extentchanged"},rn=function(e){function t(t){var r=e.call(this,qn.EXTENTCHANGED)||this;return r.extent=t,r}return oi(t,e),t}(Ea),sn=function(e){function t(t){var r=this,n=t||{};return(r=e.call(this,n)||this).extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,t||(t={}),r.extentOverlay_=new xc({source:new lc({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:tn(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new xc({source:new lc({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:un(),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&r.setExtent(t.extent),r}return oi(t,e),t.prototype.snapToVertex_=function(e,t){var r=t.getCoordinateFromPixelInternal(e),n=this.getExtentInternal();if(n){var o=xn(n);o.sort(function(e,t){return Rd(r,e)-Rd(r,t)});var i=o[0],a=Td(r,i),$=t.getPixelFromCoordinateInternal(a);if(Sd(e,$)<=this.pixelTolerance_){var l=t.getPixelFromCoordinateInternal(i[0]),p=t.getPixelFromCoordinateInternal(i[1]),u=Ka($,l),s=Ka($,p),c=Math.sqrt(Math.min(u,s));return this.snappedToVertex_=c<=this.pixelTolerance_,this.snappedToVertex_&&(a=u>s?i[1]:i[0]),a}}return null},t.prototype.handlePointerMove_=function(e){var t=e.pixel,r=e.map,n=this.snapToVertex_(t,r);n||(n=r.getCoordinateFromPixelInternal(t)),this.createOrUpdatePointerFeature_(n)},t.prototype.createOrUpdateExtentFeature_=function(e){var t=this.extentFeature_;return t?e?t.setGeometry(Db(e)):t.setGeometry(void 0):(t=e?new _a(Db(e)):new _a({}),this.extentFeature_=t,this.extentOverlay_.getSource().addFeature(t)),t},t.prototype.createOrUpdatePointerFeature_=function(e){var t=this.vertexFeature_;t?t.getGeometry().setCoordinates(e):(t=new _a(new kb(e)),this.vertexFeature_=t,this.vertexOverlay_.getSource().addFeature(t));return t},t.prototype.handleEvent=function(t){return!t.pointerEvent||(t.type!=ha.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),e.prototype.handleEvent.call(this,t),!1)},t.prototype.handleDownEvent=function(e){var t=e.pixel,r=e.map,n=this.getExtentInternal(),o=this.snapToVertex_(t,r),i=function(e){var t=null,r=null;return e[0]==n[0]?t=n[2]:e[0]==n[2]&&(t=n[0]),e[1]==n[1]?r=n[3]:e[1]==n[3]&&(r=n[1]),null!==t&&null!==r?[t,r]:null};if(o&&n){var a=o[0]==n[0]||o[0]==n[2]?o[0]:null,$=o[1]==n[1]||o[1]==n[3]?o[1]:null;null!==a&&null!==$?this.pointerHandler_=ni(i(o)):null!==a?this.pointerHandler_=hi(i([a,n[1]]),i([a,n[3]])):null!==$&&(this.pointerHandler_=hi(i([n[0],$]),i([n[2],$])))}else o=r.getCoordinateFromPixelInternal(t),this.setExtent([o[0],o[1],o[0],o[1]]),this.pointerHandler_=ni(o);return!0},t.prototype.handleDragEvent=function(e){if(this.pointerHandler_){var t=e.coordinate;this.setExtent(this.pointerHandler_(t)),this.createOrUpdatePointerFeature_(t)}return!0},t.prototype.handleUpEvent=function(e){this.pointerHandler_=null;var t=this.getExtentInternal();return t&&0!==Wd(t)||this.setExtent(null),!1},t.prototype.setMap=function(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),e.prototype.setMap.call(this,t)},t.prototype.getExtent=function(){return $c(this.getExtentInternal(),this.getMap().getView().getProjection())},t.prototype.getExtentInternal=function(){return this.extent_},t.prototype.setExtent=function(e){this.extent_=e||null,this.createOrUpdateExtentFeature_(e),this.dispatchEvent(new rn(this.extent_))},t}(Pa);function tn(){var e=Cc();return function(t,r){return e[aa.POLYGON]}}function un(){var e=Cc();return function(t,r){return e[aa.POINT]}}function ni(e){return function(t){return ua([e,t])}}function hi(e,t){return e[0]==t[0]?function(r){return ua([e,[r[0],t[1]]])}:e[1]==t[1]?function(r){return ua([e,[t[0],r[1]]])}:null}function xn(e){return[[[e[0],e[1]],[e[0],e[3]]],[[e[0],e[3]],[e[2],e[3]]],[[e[2],e[3]],[e[2],e[1]]],[[e[2],e[1]],[e[0],e[1]]]]}Hg.default=sn;var xd={};var ai=xd&&xd.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),_h=0,Vc=1,Xh=[0,0,0,0],fc=[],rg={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"},Ad=function(e){function t(t,r,o){var i=e.call(this,t)||this;return i.features=r,i.mapBrowserEvent=o,i}return ai(t,e),t}(Ea);xd.ModifyEvent=Ad;var Gn=function(e){function t(t){var r,o=e.call(this,t)||this;if(o.boundHandleFeatureChange_=o.handleFeatureChange_.bind(o),o.condition_=t.condition?t.condition:Kj,o.defaultDeleteCondition_=function(e){return kl(e)&&Fj(e)},o.deleteCondition_=t.deleteCondition?t.deleteCondition:o.defaultDeleteCondition_,o.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:Mg,o.vertexFeature_=null,o.vertexSegments_=null,o.lastPixel_=[0,0],o.ignoreNextSingleClick_=!1,o.modified_=!1,o.rBush_=new pd,o.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,o.snappedToVertex_=!1,o.changingFeature_=!1,o.dragSegments_=[],o.overlay_=new xc({source:new lc({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:Kn(),updateWhileAnimating:!0,updateWhileInteracting:!0}),o.SEGMENT_WRITERS_={Point:o.writePointGeometry_.bind(o),LineString:o.writeLineStringGeometry_.bind(o),LinearRing:o.writeLineStringGeometry_.bind(o),Polygon:o.writePolygonGeometry_.bind(o),MultiPoint:o.writeMultiPointGeometry_.bind(o),MultiLineString:o.writeMultiLineStringGeometry_.bind(o),MultiPolygon:o.writeMultiPolygonGeometry_.bind(o),Circle:o.writeCircleGeometry_.bind(o),GeometryCollection:o.writeGeometryCollectionGeometry_.bind(o)},o.source_=null,t.source?(o.source_=t.source,r=new za(o.source_.getFeatures()),o.source_.addEventListener(Sa.ADDFEATURE,o.handleSourceAdd_.bind(o)),o.source_.addEventListener(Sa.REMOVEFEATURE,o.handleSourceRemove_.bind(o))):r=t.features,!r)throw new Error("The modify interaction requires features or a source");return o.features_=r,o.features_.forEach(o.addFeature_.bind(o)),o.features_.addEventListener(ra.ADD,o.handleFeatureAdd_.bind(o)),o.features_.addEventListener(ra.REMOVE,o.handleFeatureRemove_.bind(o)),o.lastPointerEvent_=null,o}return ai(t,e),t.prototype.addFeature_=function(e){var t=e.getGeometry();if(t){var r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),e.addEventListener(ba.CHANGE,this.boundHandleFeatureChange_)},t.prototype.willModifyFeatures_=function(e){this.modified_||(this.modified_=!0,this.dispatchEvent(new Ad(rg.MODIFYSTART,this.features_,e)))},t.prototype.removeFeature_=function(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(ba.CHANGE,this.boundHandleFeatureChange_)},t.prototype.removeFeatureSegmentData_=function(e){var t=this.rBush_,r=[];t.forEach(function(t){e===t.feature&&r.push(t)});for(var o=r.length-1;o>=0;--o){for(var i=r[o],n=this.dragSegments_.length-1;n>=0;--n)this.dragSegments_[n][0]===i&&this.dragSegments_.splice(n,1);t.remove(i)}},t.prototype.setActive=function(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.prototype.setActive.call(this,t)},t.prototype.setMap=function(t){this.overlay_.setMap(t),e.prototype.setMap.call(this,t)},t.prototype.getOverlay=function(){return this.overlay_},t.prototype.handleSourceAdd_=function(e){e.feature&&this.features_.push(e.feature)},t.prototype.handleSourceRemove_=function(e){e.feature&&this.features_.remove(e.feature)},t.prototype.handleFeatureAdd_=function(e){this.addFeature_(e.element)},t.prototype.handleFeatureChange_=function(e){if(!this.changingFeature_){var t=e.target;this.removeFeature_(t),this.addFeature_(t)}},t.prototype.handleFeatureRemove_=function(e){var t=e.element;this.removeFeature_(t)},t.prototype.writePointGeometry_=function(e,t){var r=t.getCoordinates(),o={feature:e,geometry:t,segment:[r,r]};this.rBush_.insert(t.getExtent(),o)},t.prototype.writeMultiPointGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o){var n=r[o],a={feature:e,geometry:t,depth:[o],index:o,segment:[n,n]};this.rBush_.insert(t.getExtent(),a)}},t.prototype.writeLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length-1;o<i;++o){var n=r.slice(o,o+2),a={feature:e,geometry:t,index:o,segment:n};this.rBush_.insert(ua(n),a)}},t.prototype.writeMultiLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o)for(var n=r[o],a=0,s=n.length-1;a<s;++a){var $=n.slice(a,a+2),p={feature:e,geometry:t,depth:[o],index:a,segment:$};this.rBush_.insert(ua($),p)}},t.prototype.writePolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o)for(var n=r[o],a=0,s=n.length-1;a<s;++a){var $=n.slice(a,a+2),p={feature:e,geometry:t,depth:[o],index:a,segment:$};this.rBush_.insert(ua($),p)}},t.prototype.writeMultiPolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),o=0,i=r.length;o<i;++o)for(var n=r[o],a=0,s=n.length;a<s;++a)for(var $=n[a],p=0,m=$.length-1;p<m;++p){var u=$.slice(p,p+2),d={feature:e,geometry:t,depth:[a,o],index:p,segment:u};this.rBush_.insert(ua(u),d)}},t.prototype.writeCircleGeometry_=function(e,t){var r=t.getCenter(),o={feature:e,geometry:t,index:_h,segment:[r,r]},i={feature:e,geometry:t,index:Vc,segment:[r,r]},n=[o,i];o.featureSegments=n,i.featureSegments=n,this.rBush_.insert(Xd(r),o);var a=t,s=Ia();if(s&&this.getMap()){var $=this.getMap().getView().getProjection();a=a.clone().transform(s,$),a=oc(a).transform($,s)}this.rBush_.insert(a.getExtent(),i)},t.prototype.writeGeometryCollectionGeometry_=function(e,t){for(var r=t.getGeometriesArray(),o=0;o<r.length;++o){var i=r[o];(0,this.SEGMENT_WRITERS_[i.getType()])(e,i)}},t.prototype.createOrUpdateVertexFeature_=function(e){var t=this.vertexFeature_;t?t.getGeometry().setCoordinates(e):(t=new _a(new kb(e)),this.vertexFeature_=t,this.overlay_.getSource().addFeature(t));return t},t.prototype.handleEvent=function(t){return!t.pointerEvent||(this.lastPointerEvent_=t,t.map.getView().getInteracting()||t.type!=ha.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(r=!(t.type!=ha.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==ha.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),e.prototype.handleEvent.call(this,t)&&!r);var r},t.prototype.handleDragEvent=function(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e);for(var t=e.coordinate,r=0,o=this.dragSegments_.length;r<o;++r){for(var i=this.dragSegments_[r],n=i[0],a=n.depth,s=n.geometry,$=void 0,p=n.segment,m=i[1];t.length<s.getStride();)t.push(p[m][t.length]);switch(s.getType()){case aa.POINT:$=t,p[0]=t,p[1]=t;break;case aa.MULTI_POINT:($=s.getCoordinates())[n.index]=t,p[0]=t,p[1]=t;break;case aa.LINE_STRING:($=s.getCoordinates())[n.index+m]=t,p[m]=t;break;case aa.MULTI_LINE_STRING:case aa.POLYGON:($=s.getCoordinates())[a[0]][n.index+m]=t,p[m]=t;break;case aa.MULTI_POLYGON:($=s.getCoordinates())[a[1]][a[0]][n.index+m]=t,p[m]=t;break;case aa.CIRCLE:if(p[0]=t,p[1]=t,n.index===_h)this.changingFeature_=!0,s.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0;var u=e.map.getView().getProjection(),d=Sd(ka(s.getCenter(),u),ka(t,u)),x=Ia();if(x){var g=s.clone().transform(x,u);g.setRadius(d),d=g.transform(u,x).getRadius()}s.setRadius(d),this.changingFeature_=!1}}$&&this.setGeometryCoordinates_(s,$)}this.createOrUpdateVertexFeature_(t)},t.prototype.handleDownEvent=function(e){if(!this.condition_(e))return!1;var t=e.coordinate;this.handlePointerAtPixel_(e.pixel,e.map,t),this.dragSegments_.length=0,this.modified_=!1;var r=this.vertexFeature_;if(r){var o=e.map.getView().getProjection(),i=[],n=r.getGeometry().getCoordinates(),a=ua([n]),s=this.rBush_.getInExtent(a),$={};s.sort(Hn);for(var p=0,m=s.length;p<m;++p){var u=s[p],d=u.segment,x=ga(u.feature),g=u.depth;if(g&&(x+="-"+g.join("-")),$[x]||($[x]=new Array(2)),u.geometry.getType()!==aa.CIRCLE||u.index!==Vc){if(!Xa(d[0],n)||$[x][0]){if(!Xa(d[1],n)||$[x][1])ga(d)in this.vertexSegments_&&!$[x][0]&&!$[x][1]&&this.insertVertexCondition_(e)&&i.push([u,n]);else{if((u.geometry.getType()===aa.LINE_STRING||u.geometry.getType()===aa.MULTI_LINE_STRING)&&$[x][0]&&0===$[x][0].index)continue;this.dragSegments_.push([u,1]),$[x][1]=u}}else this.dragSegments_.push([u,0]),$[x][0]=u;}else{var h=Kh(t,u,o);Xa(h,n)&&!$[x][0]&&(this.dragSegments_.push([u,0]),$[x][0]=u)}}i.length&&this.willModifyFeatures_(e);for(var l=i.length-1;l>=0;--l)this.insertVertex_.apply(this,i[l])}return!!this.vertexFeature_},t.prototype.handleUpEvent=function(e){for(var t=this.dragSegments_.length-1;t>=0;--t){var r=this.dragSegments_[t][0],o=r.geometry;if(o.getType()===aa.CIRCLE){var i=o.getCenter(),n=r.featureSegments[0],a=r.featureSegments[1];n.segment[0]=i,n.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(Xd(i),n);var s=o,$=Ia();if($){var p=e.map.getView().getProjection();s=s.clone().transform($,p),s=oc(s).transform(p,$)}this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(ua(r.segment),r)}return this.modified_&&(this.dispatchEvent(new Ad(rg.MODIFYEND,this.features_,e)),this.modified_=!1),!1},t.prototype.handlePointerMove_=function(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)},t.prototype.handlePointerAtPixel_=function(e,t,r){var o=r||t.getCoordinateFromPixel(e),i=t.getView().getProjection(),n=Ab(Xd(o,Xh),i),a=t.getView().getResolution()*this.pixelTolerance_,s=$c(Zd(n,a,Xh),i),$=this.rBush_.getInExtent(s);if($.length>0){$.sort(function(e,t){return Mh(o,e,i)-Mh(o,t,i)});var p=$[0],m=p.segment,u=Kh(o,p,i),d=t.getPixelFromCoordinate(u),x=Sd(e,d);if(x<=this.pixelTolerance_){var g={};if(p.geometry.getType()===aa.CIRCLE&&p.index===Vc)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(u);else{var h=t.getPixelFromCoordinate(m[0]),l=t.getPixelFromCoordinate(m[1]),c=Ka(d,h),_=Ka(d,l);x=Math.sqrt(Math.min(c,_)),this.snappedToVertex_=x<=this.pixelTolerance_,this.snappedToVertex_&&(u=c>_?m[1]:m[0]),this.createOrUpdateVertexFeature_(u);for(var v=1,y=$.length;v<y;++v){var q=$[v].segment;if(!(Xa(m[0],q[0])&&Xa(m[1],q[1])||Xa(m[0],q[1])&&Xa(m[1],q[0])))break;g[ga(q)]=!0}}return g[ga(m)]=!0,void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},t.prototype.insertVertex_=function(e,t){for(var r,o=e.segment,i=e.feature,n=e.geometry,a=e.depth,s=e.index;t.length<n.getStride();)t.push(0);switch(n.getType()){case aa.MULTI_LINE_STRING:case aa.POLYGON:(r=n.getCoordinates())[a[0]].splice(s+1,0,t);break;case aa.MULTI_POLYGON:(r=n.getCoordinates())[a[1]][a[0]].splice(s+1,0,t);break;case aa.LINE_STRING:(r=n.getCoordinates()).splice(s+1,0,t);break;default:return;}this.setGeometryCoordinates_(n,r);var $=this.rBush_;$.remove(e),this.updateSegmentIndices_(n,s,a,1);var p={segment:[o[0],t],feature:i,geometry:n,depth:a,index:s};$.insert(ua(p.segment),p),this.dragSegments_.push([p,1]);var m={segment:[t,o[1]],feature:i,geometry:n,depth:a,index:s+1};$.insert(ua(m.segment),m),this.dragSegments_.push([m,0]),this.ignoreNextSingleClick_=!0},t.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ha.POINTERDRAG){var e=this.lastPointerEvent_;this.willModifyFeatures_(e);var t=this.removeVertex_();return this.dispatchEvent(new Ad(rg.MODIFYEND,this.features_,e)),this.modified_=!1,t}return!1},t.prototype.removeVertex_=function(){var e,t,r,o,i,n,a,s,$,p,m,u=this.dragSegments_,d={},x=!1;for(i=u.length-1;i>=0;--i)p=(r=u[i])[0],m=ga(p.feature),p.depth&&(m+="-"+p.depth.join("-")),m in d||(d[m]={}),0===r[1]?(d[m].right=p,d[m].index=p.index):1==r[1]&&(d[m].left=p,d[m].index=p.index+1);for(m in d){switch($=d[m].right,a=d[m].left,(s=(n=d[m].index)-1)<0&&(s=0),e=t=(o=(p=void 0!==a?a:$).geometry).getCoordinates(),x=!1,o.getType()){case aa.MULTI_LINE_STRING:t[p.depth[0]].length>2&&(t[p.depth[0]].splice(n,1),x=!0);break;case aa.LINE_STRING:t.length>2&&(t.splice(n,1),x=!0);break;case aa.MULTI_POLYGON:e=e[p.depth[1]];case aa.POLYGON:(e=e[p.depth[0]]).length>4&&(n==e.length-1&&(n=0),e.splice(n,1),x=!0,0===n&&(e.pop(),e.push(e[0]),s=e.length-1));}if(x){this.setGeometryCoordinates_(o,t);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==$&&(this.rBush_.remove($),g.push($.segment[1])),void 0!==a&&void 0!==$){var h={depth:p.depth,feature:p.feature,geometry:p.geometry,index:s,segment:g};this.rBush_.insert(ua(h.segment),h)}this.updateSegmentIndices_(o,n,p.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),u.length=0}}return x},t.prototype.setGeometryCoordinates_=function(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1},t.prototype.updateSegmentIndices_=function(e,t,r,o){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(void 0===r||void 0===i.depth||pc(i.depth,r))&&i.index>t&&(i.index+=o)})},t}(Pa);function Hn(e,t){return e.index-t.index}function Mh(e,t,r){var o=t.geometry;if(o.getType()===aa.CIRCLE){var i=o;if(t.index===Vc){var n=Ia();n&&(i=i.clone().transform(n,r));var a=Ka(i.getCenter(),ka(e,r)),s=Math.sqrt(a)-i.getRadius();return s*s}}var $=ka(e,r);return fc[0]=ka(t.segment[0],r),fc[1]=ka(t.segment[1],r),Rd($,fc)}function Kh(e,t,r){var o=t.geometry;if(o.getType()===aa.CIRCLE&&t.index===Vc){var i=o,n=Ia();return n&&(i=i.clone().transform(n,r)),Ib(i.getClosestPoint(ka(e,r)),r)}var a=ka(e,r);return fc[0]=ka(t.segment[0],r),fc[1]=ka(t.segment[1],r),Ib(Td(a,fc),r)}function Kn(){var e=Cc();return function(t,r){return e[aa.POINT]}}xd.default=Gn;var mg={};var yh=mg&&mg.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Nn={SELECT:"select"},On=function(e){function t(t,r,i,o){var n=e.call(this,t)||this;return n.selected=r,n.deselected=i,n.mapBrowserEvent=o,n}return yh(t,e),t}(Ea),Ed={},Qn=function(e){function t(t){var r,i=e.call(this,{handleEvent:Rn})||this,o=t||{};if(i.boundAddFeature_=i.addFeature_.bind(i),i.boundRemoveFeature_=i.removeFeature_.bind(i),i.condition_=o.condition?o.condition:Fj,i.addCondition_=o.addCondition?o.addCondition:Ej,i.removeCondition_=o.removeCondition?o.removeCondition:Ej,i.toggleCondition_=o.toggleCondition?o.toggleCondition:fe,i.multi_=!!o.multi&&o.multi,i.filter_=o.filter?o.filter:La,i.hitTolerance_=o.hitTolerance?o.hitTolerance:0,i.style_=void 0!==o.style?o.style:Sn(),i.features_=o.features||new za,o.layers){if("function"==typeof o.layers)r=o.layers;else{var n=o.layers;r=function(e){return Rc(n,e)}}}else r=La;return i.layerFilter_=r,i.featureLayerAssociation_={},i}return yh(t,e),t.prototype.addFeatureLayerAssociation_=function(e,t){this.featureLayerAssociation_[ga(e)]=t},t.prototype.getFeatures=function(){return this.features_},t.prototype.getHitTolerance=function(){return this.hitTolerance_},t.prototype.getLayer=function(e){return this.featureLayerAssociation_[ga(e)]},t.prototype.setHitTolerance=function(e){this.hitTolerance_=e},t.prototype.setMap=function(t){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),e.prototype.setMap.call(this,t),t?(this.features_.addEventListener(ra.ADD,this.boundAddFeature_),this.features_.addEventListener(ra.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(ra.ADD,this.boundAddFeature_),this.features_.removeEventListener(ra.REMOVE,this.boundRemoveFeature_))},t.prototype.addFeature_=function(e){var t=e.element;this.style_&&this.applySelectedStyle_(t)},t.prototype.removeFeature_=function(e){var t=e.element;this.style_&&this.restorePreviousStyle_(t)},t.prototype.getStyle=function(){return this.style_},t.prototype.applySelectedStyle_=function(e){var t=ga(e);t in Ed||(Ed[t]=e.getStyle()),e.setStyle(this.style_)},t.prototype.restorePreviousStyle_=function(e){var r=ga(e),i=this.getMap().getInteractions().getArray().filter(function(r){return r instanceof t&&r.getStyle()&&-1!==r.getFeatures().getArray().indexOf(e)});i.length>0?e.setStyle(i[i.length-1].getStyle()):(e.setStyle(Ed[r]),delete Ed[r])},t.prototype.removeFeatureLayerAssociation_=function(e){delete this.featureLayerAssociation_[ga(e)]},t}(sb);function Rn(e){if(!this.condition_(e))return!0;var t=this.addCondition_(e),r=this.removeCondition_(e),i=this.toggleCondition_(e),o=!t&&!r&&!i,n=e.map,a=this.getFeatures(),$=[],s=[];if(o){wc(this.featureLayerAssociation_),n.forEachFeatureAtPixel(e.pixel,function(e,t){if(this.filter_(e,t))return s.push(e),this.addFeatureLayerAssociation_(e,t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=a.getLength()-1;l>=0;--l){var u=a.item(l),p=s.indexOf(u);p>-1?s.splice(p,1):(a.remove(u),$.push(u))}0!==s.length&&a.extend(s)}else{n.forEachFeatureAtPixel(e.pixel,function(e,o){if(this.filter_(e,o))return!t&&!i||Rc(a.getArray(),e)?(r||i)&&Rc(a.getArray(),e)&&($.push(e),this.removeFeatureLayerAssociation_(e)):(s.push(e),this.addFeatureLayerAssociation_(e,o)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var c=$.length-1;c>=0;--c)a.remove($[c]);a.extend(s)}return(s.length>0||$.length>0)&&this.dispatchEvent(new On(Nn.SELECT,s,$,e)),!0}function Sn(){var e=Cc();return Na(e[aa.POLYGON],e[aa.LINE_STRING]),Na(e[aa.GEOMETRY_COLLECTION],e[aa.LINE_STRING]),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}mg.default=Qn;var Yf={};var Un=Yf&&Yf.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function fk(e){return e.feature?e.feature:e.element?e.element:void 0}var nc=[],Xn=function(e){function t(t){var r=this,n=t||{},o=n;return o.handleDownEvent||(o.handleDownEvent=La),o.stopDown||(o.stopDown=Mb),(r=e.call(this,o)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new pd,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return Un(t,e),t.prototype.addFeature=function(e,t){var r=void 0===t||t,n=ga(e),o=e.getGeometry();if(o){var i=this.SEGMENT_WRITERS_[o.getType()];i&&(this.indexedFeaturesExtents_[n]=o.getExtent(Ga()),i(e,o))}r&&(this.featureChangeListenerKeys_[n]=fa(e,ba.CHANGE,this.handleFeatureChange_,this))},t.prototype.forEachFeatureAdd_=function(e){this.addFeature(e)},t.prototype.forEachFeatureRemove_=function(e){this.removeFeature(e)},t.prototype.getFeatures_=function(){var e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e},t.prototype.handleEvent=function(t){var r=this.snapTo(t.pixel,t.coordinate,t.map);return r.snapped&&(t.coordinate=r.vertex.slice(0,2),t.pixel=r.vertexPixel),e.prototype.handleEvent.call(this,t)},t.prototype.handleFeatureAdd_=function(e){var t=fk(e);this.addFeature(t)},t.prototype.handleFeatureRemove_=function(e){var t=fk(e);this.removeFeature(t)},t.prototype.handleFeatureChange_=function(e){var t=e.target;if(this.handlingDownUpSequence){var r=ga(t);r in this.pendingFeatures_||(this.pendingFeatures_[r]=t)}else this.updateFeature_(t)},t.prototype.handleUpEvent=function(e){var t=Oe(this.pendingFeatures_);return t.length&&(t.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},t.prototype.removeFeature=function(e,t){var r=void 0===t||t,n=ga(e),o=this.indexedFeaturesExtents_[n];if(o){var i=this.rBush_,a=[];i.forEachInExtent(o,function(t){e===t.feature&&a.push(t)});for(var s=a.length-1;s>=0;--s)i.remove(a[s])}r&&(ja(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},t.prototype.setMap=function(t){var r=this.getMap(),n=this.featuresListenerKeys_,o=this.getFeatures_();r&&(n.forEach(ja),n.length=0,o.forEach(this.forEachFeatureRemove_.bind(this))),e.prototype.setMap.call(this,t),t&&(this.features_?n.push(fa(this.features_,ra.ADD,this.handleFeatureAdd_,this),fa(this.features_,ra.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(fa(this.source_,Sa.ADDFEATURE,this.handleFeatureAdd_,this),fa(this.source_,Sa.REMOVEFEATURE,this.handleFeatureRemove_,this)),o.forEach(this.forEachFeatureAdd_.bind(this)))},t.prototype.snapTo=function(e,t,r){var n=r.getCoordinateFromPixel([e[0]-this.pixelTolerance_,e[1]+this.pixelTolerance_]),o=r.getCoordinateFromPixel([e[0]+this.pixelTolerance_,e[1]-this.pixelTolerance_]),i=ua([n,o]),a=this.rBush_.getInExtent(i);this.vertex_&&!this.edge_&&(a=a.filter(function(e){return e.feature.getGeometry().getType()!==aa.CIRCLE}));var s=!1,$=null,p=null;if(0===a.length)return{snapped:s,vertex:$,vertexPixel:p};for(var u,l=r.getView().getProjection(),h=ka(t,l),m=1/0,d=0;d<a.length;++d){var c=a[d];nc[0]=ka(c.segment[0],l),nc[1]=ka(c.segment[1],l);var g=Rd(h,nc);g<m&&(u=c,m=g)}var G=u.segment;if(this.vertex_&&!this.edge_){var v=r.getPixelFromCoordinate(G[0]),f=r.getPixelFromCoordinate(G[1]),_=Ka(e,v),y=Ka(e,f);Math.sqrt(Math.min(_,y))<=this.pixelTolerance_&&(s=!0,$=_>y?G[1]:G[0],p=r.getPixelFromCoordinate($))}else if(this.edge_){var N=u.feature.getGeometry().getType()===aa.CIRCLE;if(N){var W=u.feature.getGeometry(),x=Ia();x&&(W=W.clone().transform(x,l)),$=Ib(Oo(h,W),l)}else nc[0]=ka(G[0],l),nc[1]=ka(G[1],l),$=Ib(Td(h,nc),l);if(p=r.getPixelFromCoordinate($),Sd(e,p)<=this.pixelTolerance_&&(s=!0,this.vertex_&&!N)){v=r.getPixelFromCoordinate(G[0]),f=r.getPixelFromCoordinate(G[1]),_=Ka(p,v),y=Ka(p,f);Math.sqrt(Math.min(_,y))<=this.pixelTolerance_&&($=_>y?G[1]:G[0],p=r.getPixelFromCoordinate($))}}return s&&(p=[Math.round(p[0]),Math.round(p[1])]),{snapped:s,vertex:$,vertexPixel:p}},t.prototype.updateFeature_=function(e){this.removeFeature(e,!1),this.addFeature(e,!1)},t.prototype.writeCircleGeometry_=function(e,t){var r=this.getMap().getView().getProjection(),n=t,o=Ia();o&&(n=n.clone().transform(o,r));var i=oc(n);o&&i.transform(r,o);for(var a=i.getCoordinates()[0],s=0,$=a.length-1;s<$;++s){var p=a.slice(s,s+2),u={feature:e,segment:p};this.rBush_.insert(ua(p),u)}},t.prototype.writeGeometryCollectionGeometry_=function(e,t){for(var r=t.getGeometriesArray(),n=0;n<r.length;++n){var o=this.SEGMENT_WRITERS_[r[n].getType()];o&&o(e,r[n])}},t.prototype.writeLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length-1;n<o;++n){var i=r.slice(n,n+2),a={feature:e,segment:i};this.rBush_.insert(ua(i),a)}},t.prototype.writeMultiLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length-1;a<s;++a){var $=i.slice(a,a+2),p={feature:e,segment:$};this.rBush_.insert(ua($),p)}},t.prototype.writeMultiPointGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n){var i=r[n],a={feature:e,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}},t.prototype.writeMultiPolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length;a<s;++a)for(var $=i[a],p=0,u=$.length-1;p<u;++p){var l=$.slice(p,p+2),h={feature:e,segment:l};this.rBush_.insert(ua(l),h)}},t.prototype.writePointGeometry_=function(e,t){var r=t.getCoordinates(),n={feature:e,segment:[r,r]};this.rBush_.insert(t.getExtent(),n)},t.prototype.writePolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length-1;a<s;++a){var $=i.slice(a,a+2),p={feature:e,segment:$};this.rBush_.insert(ua($),p)}},t}(Pa);Yf.default=Xn;var Fd={};var Gj=Fd&&Fd.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),Nf={TRANSLATESTART:"translatestart",TRANSLATING:"translating",TRANSLATEEND:"translateend"},bd=function(t){function e(e,r,a,n,o){var i=t.call(this,e)||this;return i.features=r,i.coordinate=a,i.startCoordinate=n,i.mapBrowserEvent=o,i}return Gj(e,t),e}(Ea);Fd.TranslateEvent=bd;var ao=function(t){function e(e){var r,a=this,n=e||{};if((a=t.call(this,n)||this).lastCoordinate_=null,a.startCoordinate_=null,a.features_=void 0!==n.features?n.features:null,n.layers){if("function"==typeof n.layers)r=n.layers;else{var o=n.layers;r=function(t){return Rc(o,t)}}}else r=La;return a.layerFilter_=r,a.filter_=n.filter?n.filter:La,a.hitTolerance_=n.hitTolerance?n.hitTolerance:0,a.lastFeature_=null,a.addEventListener(qa($d.ACTIVE),a.handleActiveChanged_),a}return Gj(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new za([this.lastFeature_]);return this.dispatchEvent(new bd(Nf.TRANSLATESTART,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new za([this.lastFeature_]);return this.dispatchEvent(new bd(Nf.TRANSLATEEND,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],a=e[1]-this.lastCoordinate_[1],n=this.features_||new za([this.lastFeature_]);n.forEach(function(t){var e=t.getGeometry();e.translate(r,a),t.setGeometry(e)}),this.lastCoordinate_=e,this.dispatchEvent(new bd(Nf.TRANSLATING,n,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||Rc(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Pa);Fd.default=ao;var bo=$f&&$f.__extends||function(){var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e])})(t,e)};return function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),rj=function(r){function t(t){return(t=Ca({},t)).controls||(t.controls=$m()),t.interactions||(t.interactions=rl()),r.call(this,t)||this}return bo(t,r),t.prototype.createRenderer=function(){return new ig(this)},t}(Je);$f.default=rj;var eo=.5;var jb=!0;var Ef={};var Df={};var Kd={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var jo=Df&&Df.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t])})(e,t)};return function(e,t){function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),Wi=function(r){function e(e){var t=this,o=e||{},n=Ca({},o);return delete n.preload,delete n.useInterimTilesOnError,(t=r.call(this,n)||this).setPreload(void 0!==o.preload?o.preload:0),t.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),t}return jo(e,r),e.prototype.getPreload=function(){return this.get(Kd.PRELOAD)},e.prototype.setPreload=function(r){this.set(Kd.PRELOAD,r)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Kd.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(r){this.set(Kd.USE_INTERIM_TILES_ON_ERROR,r)},e}(Xe);Df.default=Wi;var qf={};var cf=function(){function t(t,i,n,e){this.minX=t,this.maxX=i,this.minY=n,this.maxY=e}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,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=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 Ue(t,i,n,e,m){return void 0!==m?(m.minX=t,m.maxX=i,m.minY=n,m.maxY=e,m):new cf(t,i,n,e)}var oo=qf&&qf.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Re=function(e){function t(t){var r=e.call(this,t)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Ga(),r.tmpTileRange_=new cf(0,0,0,0),r}return oo(t,e),t.prototype.isDrawableTile=function(e){var t=this.getLayer(),r=e.getState(),i=t.getUseInterimTilesOnError();return r==da.LOADED||r==da.EMPTY||r==da.ERROR&&!i},t.prototype.getTile=function(e,t,r,i){var o=i.pixelRatio,n=i.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(e,t,r,o,n);return s.getState()==da.ERROR&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(da.LOADED)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},t.prototype.loadedTileCallback=function(t,r,i){return!!this.isDrawableTile(i)&&e.prototype.loadedTileCallback.call(this,t,r,i)},t.prototype.prepareFrame=function(e){return!!this.getLayer().getSource()},t.prototype.renderFrame=function(e,t){var r=e.layerStatesArray[e.layerIndex],i=e.viewState,o=i.projection,n=i.resolution,a=i.center,s=i.rotation,l=e.pixelRatio,h=this.getLayer(),p=h.getSource(),$=p.getRevision(),d=p.getTileGridForProjection(o),u=d.getZForResolution(n,p.zDirection),c=d.getResolution(u),m=e.extent,g=r.extent&&Ab(r.extent,o);g&&(m=Lc(m,Ab(r.extent,o)));var T=p.getTilePixelRatio(l),f=Math.round(e.size[0]*T),v=Math.round(e.size[1]*T);if(s){var x=Math.round(Math.sqrt(f*f+v*v));f=x,v=x}var M=c*f/2/T,k=c*v/2/T,y=[a[0]-M,a[1]-k,a[0]+M,a[1]+k],R=d.getTileRangeForExtentAndZ(m,u),_={};_[u]={};var w=this.createLoadedTileFinder(p,o,_),E=this.tmpExtent,S=this.tmpTileRange_;this.newTiles_=!1;for(var C=R.minX;C<=R.maxX;++C)for(var j=R.minY;j<=R.maxY;++j){var P=this.getTile(u,C,j,e);if(this.isDrawableTile(P)){var b=ga(this);if(P.getState()==da.LOADED){_[u][P.tileCoord.toString()]=P;var I=P.inTransition(b);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(P)||(this.newTiles_=!0)}if(1===P.getAlpha(b,e.time))continue}var O=d.getTileCoordChildTileRange(P.tileCoord,S,E),q=!1;O&&(q=w(u+1,O)),q||d.forEachTileCoordParentTileRange(P.tileCoord,w,S,E)}var A=c/n;rb(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/T,1/T,s,-f/2,-v/2);var L=mq(this.pixelTransform);this.useContainer(t,L,r.opacity);var U=this.context,D=U.canvas;Kf(this.inversePixelTransform,this.pixelTransform),rb(this.tempTransform_,f/2,v/2,A,A,0,-f/2,-v/2),D.width!=f||D.height!=v?(D.width=f,D.height=v):this.containerReused||U.clearRect(0,0,f,v),g&&this.clipUnrotated(U,e,g),this.preRender(U,e),this.renderedTiles.length=0;var F,z,Y,Z=Object.keys(_).map(Number);Z.sort(xb),1!==r.opacity||this.containerReused&&!p.getOpaque(e.viewState.projection)?(F=[],z=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var X=Z[K],G=p.getTilePixelSize(X,l,o),Q=d.getResolution(X)/c,N=G[0]*Q*A,B=G[1]*Q*A,H=d.getTileCoordForCoordAndZ(Ya(y),X),J=d.getTileCoordExtent(H),V=sa(this.tempTransform_,[T*(J[0]-y[0])/c,T*(y[3]-J[3])/c]),W=T*p.getGutterForProjection(o),ee=_[X];for(var te in ee){var re=(P=ee[te]).tileCoord,ie=V[0]-(H[1]-re[1])*N,oe=Math.round(ie+N),ne=V[1]-(H[2]-re[2])*B,ae=Math.round(ne+B),se=oe-(C=Math.round(ie)),le=ae-(j=Math.round(ne)),he=u===X;if(!(I=he&&1!==P.getAlpha(ga(this),e.time)))if(F){U.save(),Y=[C,j,C+se,j,C+se,j+le,C,j+le];for(var pe=0,$e=F.length;pe<$e;++pe)if(u!==X&&X<z[pe]){var de=F[pe];U.beginPath(),U.moveTo(Y[0],Y[1]),U.lineTo(Y[2],Y[3]),U.lineTo(Y[4],Y[5]),U.lineTo(Y[6],Y[7]),U.moveTo(de[6],de[7]),U.lineTo(de[4],de[5]),U.lineTo(de[2],de[3]),U.lineTo(de[0],de[1]),U.clip()}F.push(Y),z.push(X)}else U.clearRect(C,j,se,le);this.drawTileImage(P,e,C,j,se,le,W,he,r.opacity),F&&!I&&U.restore(),this.renderedTiles.push(P),this.updateUsedTiles(e.usedTiles,p,P)}}return this.renderedRevision=$,this.renderedResolution=c,this.extentChanged=!this.renderedExtent_||!vc(this.renderedExtent_,y),this.renderedExtent_=y,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(e,p,d,l,o,m,u,h.getPreload()),this.scheduleExpireCache(e,p),this.postRender(U,e),r.extent&&U.restore(),L!==D.style.transform&&(D.style.transform=L),this.container},t.prototype.drawTileImage=function(e,t,r,i,o,n,a,s,l){var h=this.getTileImage(e);if(h){var p=ga(this),$=s?e.getAlpha(p,t.time):1,d=l*$,u=d!==this.context.globalAlpha;u&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(h,a,a,h.width-2*a,h.height-2*a,r,i,o,n),u&&this.context.restore(),1!==$?t.animate=!0:s&&e.endTransition(p)}},t.prototype.getImage=function(){var e=this.context;return e?e.canvas:null},t.prototype.getTileImage=function(e){return e.getImage()},t.prototype.scheduleExpireCache=function(e,t){if(t.canExpireCache()){var r=function(e,t,r){var i=ga(e);i in r.usedTiles&&e.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,t);e.postRenderFunctions.push(r)}},t.prototype.updateUsedTiles=function(e,t,r){var i=ga(t);i in e||(e[i]={}),e[i][r.getKey()]=!0},t.prototype.manageTilePyramid=function(e,t,r,i,o,n,a,s,l){var h=ga(t);h in e.wantedTiles||(e.wantedTiles[h]={});var p,$,d,u,c,m,g=e.wantedTiles[h],T=e.tileQueue;for(m=r.getMinZoom();m<=a;++m)for($=r.getTileRangeForExtentAndZ(n,m,$),d=r.getResolution(m),u=$.minX;u<=$.maxX;++u)for(c=$.minY;c<=$.maxY;++c)a-m<=s?((p=t.getTile(m,u,c,i,o)).getState()==da.IDLE&&(g[p.getKey()]=!0,T.isKeyQueued(p.getKey())||T.enqueue([p,h,r.getTileCoordCenter(p.tileCoord),d])),void 0!==l&&l(p)):t.useTile(m,u,c,o)},t}(sf);Re.prototype.getLayer,qf.default=Re;var qo=Ef&&Ef.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),Qh=function(e){function r(r){return e.call(this,r)||this}return qo(r,e),r.prototype.createRenderer=function(){return new Re(this)},r}(Wi);Ef.default=Qh;function so(e,r){var t=/\{z\}/g,p=/\{x\}/g,o=/\{y\}/g,$=/\{-y\}/g;return function(n,a,l){return n?e.replace(t,n[0].toString()).replace(p,n[1].toString()).replace(o,n[2].toString()).replace($,function(){var e=n[0],t=r.getFullTileRange(e);return ia(t,55),(t.getHeight()-n[2]-1).toString()}):void 0}}function to(e,r){for(var t=e.length,p=new Array(t),o=0;o<t;++o)p[o]=so(e[o],r);return uo(p)}function uo(e){return 1===e.length?e[0]:function(r,t,p){if(r){var o=Bo(r),$=Ub(o,e.length);return e[$](r,t,p)}}}function vo(e,r,t){}function wo(e){var r=[],t=/\{([a-z])-([a-z])\}/.exec(e);if(t){var p=t[1].charCodeAt(0),o=t[2].charCodeAt(0),$=void 0;for($=p;$<=o;++$)r.push(e.replace(t[0],String.fromCharCode($)));return r}if(t=/\{(\d+)-(\d+)\}/.exec(e)){for(var n=parseInt(t[2],10),a=parseInt(t[1],10);a<=n;a++)r.push(e.replace(t[0],a.toString()));return r}return r.push(e),r}function Nh(e,t,$,r){return void 0!==r?(r[0]=e,r[1]=t,r[2]=$,r):[e,t,$]}function Nd(e,t,$){return e+"/"+t+"/"+$}function tk(e){return Nd(e[0],e[1],e[2])}function Ao(e){return e.split("/").map(Number)}function Bo(e){return(e[1]<<e[0])+e[2]}function Co(e,t){var $=e[0],r=e[1],a=e[2];if(t.getMinZoom()>$||$>t.getMaxZoom())return!1;var n,o=t.getExtent();return!(n=o?t.getTileRangeForExtentAndZ(o,$):t.getFullTileRange($))||n.containsXY(r,a)}var ih={};var gh={};var Tg={};var Go=Tg&&Tg.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xg=function(t){function e(e,i,r){var n=t.call(this)||this,o=r||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.hifi=!0,n.key="",n.transition_=void 0===o.transition?250:o.transition,n.transitionStarts_={},n}return Go(e,t),e.prototype.changed=function(){this.dispatchEvent(ba.CHANGE)},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()==da.LOADED)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()==da.LOADED){t.interimTile=null;break}t.getState()==da.LOADING?e=t:t.getState()==da.IDLE?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!==da.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){ca()},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 r=e-i+1e3/60;return r>=this.transition_?1:_i(r/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}(Pb);Tg.default=xg;var Io=gh&&gh.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),bj=function(t){function e(e,i,s,r,n,a){var o=t.call(this,e,i,a)||this;return o.crossOrigin_=r,o.src_=s,o.image_=new Image,null!==r&&(o.image_.crossOrigin=r),o.unlisten_=null,o.tileLoadFunction_=n,o}return Io(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=da.ERROR,this.unlistenImage_(),this.image_=Ko(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=da.LOADED:this.state=da.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==da.ERROR&&(this.state=da.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==da.IDLE&&(this.state=da.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=fd(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(xg);function Ko(){var t=Ja(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}gh.default=bj;var kg={};var Mo=function(){function e(e){this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},e.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},e.prototype.forEach=function(e){for(var t=this.oldest_;t;)e(t.value_,t.key_,this),t=t.newer},e.prototype.get=function(e,t){var r=this.entries_[e];return ia(void 0!==r,15),r===this.newest_?r.value_:(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r,r.value_)},e.prototype.remove=function(e){var t=this.entries_[e];return ia(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var e,t=new Array(this.count_),r=0;for(e=this.newest_;e;e=e.older)t[r++]=e.key_;return t},e.prototype.getValues=function(){var e,t=new Array(this.count_),r=0;for(e=this.newest_;e;e=e.older)t[r++]=e.value_;return t},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},e.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},e.prototype.set=function(e,t){ia(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},e.prototype.setSize=function(e){this.highWaterMark=e},e}();var No=kg&&kg.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),Tf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return No(t,e),t.prototype.expireCache=function(e){for(;this.canExpireCache();){if(this.peekLast().getKey()in e)break;this.pop().release()}},t.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var e=this.peekFirstKey(),t=Ao(e)[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(tk(e.tileCoord)),e.release())}.bind(this))}},t}(Mo);kg.default=Tf;var Sf={};function Qo(e,t,r,a){var o=Ge(r,t,e),$=mh(t,a,r),n=t.getMetersPerUnit();void 0!==n&&($*=n);var i=e.getMetersPerUnit();void 0!==i&&($/=i);var l=e.getExtent();if(!l||vi(l,o)){var s=mh(e,$,o)/$;isFinite(s)&&s>0&&($/=s)}return $}function If(e,t,r,a){var o=r-e,$=a-t,n=Math.sqrt(o*o+$*$);return[Math.round(r+o/n),Math.round(a+$/n)]}function So(e,t,r,a,o,$,n,i,l,s,c){var p=Ja(Math.round(r*e),Math.round(r*t));if(0===l.length)return p.canvas;p.scale(r,r);var u=Ga();l.forEach(function(e,t,r){Se(u,e.extent)});var g=ta(u),v=ab(u),U=Ja(Math.round(r*g/a),Math.round(r*v/a)),m=r/a;l.forEach(function(e,t,r){var a=e.extent[0]-u[0],o=-(e.extent[3]-u[3]),$=ta(e.extent),n=ab(e.extent);U.drawImage(e.image,s,s,e.image.width-2*s,e.image.height-2*s,a*m,o*m,$*m,n*m)});var h=Ya(n);return i.getTriangles().forEach(function(e,t,o){var n=e.source,i=e.target,l=n[0][0],s=n[0][1],c=n[1][0],g=n[1][1],v=n[2][0],m=n[2][1],d=(i[0][0]-h[0])/$,f=-(i[0][1]-h[1])/$,x=(i[1][0]-h[0])/$,P=-(i[1][1]-h[1])/$,C=(i[2][0]-h[0])/$,M=-(i[2][1]-h[1])/$,T=l,E=s;l=0,s=0,c-=T,g-=E,v-=T,m-=E;var j=mp([[c,g,0,0,x-d],[v,m,0,0,C-d],[0,0,c,g,P-f],[0,0,v,m,M-f]]);if(j){p.save(),p.beginPath();var q=(d+x+C)/3,R=(f+P+M)/3,S=If(q,R,d,f),b=If(q,R,x,P),k=If(q,R,C,M);p.moveTo(b[0],b[1]),p.lineTo(S[0],S[1]),p.lineTo(k[0],k[1]),p.clip(),p.transform(j[0],j[2],j[1],j[3],d,f),p.translate(u[0]-T,u[3]-E),p.scale(a/r,-a/r),p.drawImage(U.canvas,0,0),p.restore()}}),c&&(p.save(),p.strokeStyle="black",p.lineWidth=1,i.getTriangles().forEach(function(e,t,r){var a=e.target,o=(a[0][0]-h[0])/$,n=-(a[0][1]-h[1])/$,i=(a[1][0]-h[0])/$,l=-(a[1][1]-h[1])/$,s=(a[2][0]-h[0])/$,c=-(a[2][1]-h[1])/$;p.beginPath(),p.moveTo(i,l),p.lineTo(o,n),p.lineTo(s,c),p.closePath(),p.stroke()}),p.restore()),p.canvas}var To=10,Zh=.25,Vo=function(){function t(t,i,r,o,e,s){this.sourceProj_=t,this.targetProj_=i;var a={},n=_c(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return a[i]||(a[i]=n(t)),a[i]},this.maxSourceExtent_=o,this.errorThresholdSquared_=e*e,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&ta(o)==ta(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ta(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ta(this.targetProj_.getExtent()):null;var h=Ya(r),$=_b(r),u=Hb(r),d=Bb(r),_=this.transformInv_(h),c=this.transformInv_($),l=this.transformInv_(u),p=this.transformInv_(d),m=To+(s?Math.max(0,Math.ceil(Math.log2(Wd(r)/(s*s*256*256)))):0);if(this.addQuad_(h,$,u,d,_,c,l,p,m),this.wrapsXInSource_){var f=1/0;this.triangles_.forEach(function(t,i,r){f=Math.min(f,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])-f>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-f>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-f>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-f>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var r=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-r<this.sourceWorldWidth_/2&&(t.source=i)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,i,r,o,e,s){this.triangles_.push({source:[o,e,s],target:[t,i,r]})},t.prototype.addQuad_=function(t,i,r,o,e,s,a,n,h){var $=ua([e,s,a,n]),u=this.sourceWorldWidth_?ta($)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,_=this.sourceProj_.canWrapX()&&u>.5&&u<1,c=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var l=ua([t,i,r,o]);c=ta(l)/this.targetWorldWidth_>Zh||c}!_&&this.sourceProj_.isGlobal()&&u&&(c=u>Zh||c)}if(c||!this.maxSourceExtent_||Fa($,this.maxSourceExtent_)){if(!(c||isFinite(e[0])&&isFinite(e[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(n[0])&&isFinite(n[1]))){if(!(h>0))return;c=!0}if(h>0){if(!c){var p=[(t[0]+r[0])/2,(t[1]+r[1])/2],m=this.transformInv_(p),f=void 0;if(_)f=(Ub(e[0],d)+Ub(a[0],d))/2-Ub(m[0],d);else f=(e[0]+a[0])/2-m[0];var g=(e[1]+a[1])/2-m[1];c=f*f+g*g>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var W=[(i[0]+r[0])/2,(i[1]+r[1])/2],R=this.transformInv_(W),B=[(o[0]+t[0])/2,(o[1]+t[1])/2],Y=this.transformInv_(B);this.addQuad_(t,i,W,B,e,s,R,Y,h-1),this.addQuad_(B,W,r,o,Y,R,a,n,h-1)}else{var v=[(t[0]+i[0])/2,(t[1]+i[1])/2],I=this.transformInv_(v),x=[(r[0]+o[0])/2,(r[1]+o[1])/2],E=this.transformInv_(x);this.addQuad_(t,v,x,o,e,I,E,n,h-1),this.addQuad_(v,i,r,x,I,s,a,E,h-1)}return}}if(_){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,r,o,e,a,n),this.addTriangle_(t,i,r,e,s,a)}},t.prototype.calculateSourceExtent=function(){var t=Ga();return this.triangles_.forEach(function(i,r,o){var e=i.source;yc(t,e[0]),yc(t,e[1]),yc(t,e[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var Wo=Sf&&Sf.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Rh=function(t){function e(e,r,i,o,l,s,$,n,a,d,p){var u=t.call(this,l,da.IDLE)||this;u.renderEdges_=void 0!==p&&p,u.pixelRatio_=$,u.gutter_=n,u.canvas_=null,u.sourceTileGrid_=r,u.targetTileGrid_=o,u.wrappedTileCoord_=s||l,u.sourceTiles_=[],u.sourcesListenerKeys_=null,u.sourceZ_=0;var c=o.getTileCoordExtent(u.wrappedTileCoord_),_=u.targetTileGrid_.getExtent(),O=u.sourceTileGrid_.getExtent(),T=_?Lc(c,_):c;if(0===Wd(T))return u.state=da.EMPTY,u;var h=e.getExtent();h&&(O=O?Lc(O,h):h);var g=o.getResolution(u.wrappedTileCoord_[0]),W=Gb(T),m=Qo(e,i,W,g);if(!isFinite(m)||m<=0)return u.state=da.EMPTY,u;var f=void 0!==d?d:eo;if(u.triangulation_=new Vo(e,i,T,O,m*f,g),0===u.triangulation_.getTriangles().length)return u.state=da.EMPTY,u;u.sourceZ_=r.getZForResolution(m);var E=u.triangulation_.calculateSourceExtent();if(O&&(e.canWrapX()?(E[1]=wa(E[1],O[1],O[3]),E[3]=wa(E[3],O[1],O[3])):E=Lc(E,O)),Wd(E)){for(var v=r.getTileRangeForExtentAndZ(E,u.sourceZ_),S=v.minX;S<=v.maxX;S++)for(var x=v.minY;x<=v.maxY;x++){var y=a(u.sourceZ_,S,x,$);y&&u.sourceTiles_.push(y)}0===u.sourceTiles_.length&&(u.state=da.EMPTY)}else u.state=da.EMPTY;return u}return Wo(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,i){e&&e.getState()==da.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=da.ERROR;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),i="number"==typeof r?r:r[0],o="number"==typeof r?r:r[1],l=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),$=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=So(i,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),l,$,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=da.LOADED}this.changed()},e.prototype.load=function(){if(this.state==da.IDLE){this.state=da.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,i){var o=e.getState();if(o==da.IDLE||o==da.LOADING){t++;var l=fa(e,ba.CHANGE,function(r){var i=e.getState();i!=da.LOADED&&i!=da.ERROR&&i!=da.EMPTY||(ja(l),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(l)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,r){t.getState()==da.IDLE&&t.load()}),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(ja),this.sourcesListenerKeys_=null},e}(xg);Sf.default=Rh;var Cf={};var Vd={};function Ah(e){var r=e.getDefaultTileGrid();return r||(r=dp(e),e.setDefaultTileGrid(r)),r}function _o(e,r,t){var x=r[0],o=e.getTileCoordCenter(r),$=Ve(t);if(vi($,o))return r;var i=ta($),n=Math.ceil(($[0]-o[0])/i);return o[0]+=i*n,e.getTileCoordForCoordAndZ(o,x)}function ap(e,r,t,x){var o=void 0!==x?x:Xc.TOP_LEFT,$=Oj(e,r,t);return new nj({extent:e,origin:cp(e,o),resolutions:$,tileSize:t})}function bp(e){var r=e||{},t=r.extent||va("EPSG:3857").getExtent(),x={extent:t,minZoom:r.minZoom,tileSize:r.tileSize,resolutions:Oj(t,r.maxZoom,r.tileSize,r.maxResolution)};return new nj(x)}function Oj(e,r,t,x){for(var o=void 0!==r?r:tp,$=ab(e),i=ta(e),n=zb(void 0!==t?t:Jf),E=x>0?x:Math.max(i/n[0],$/n[1]),p=o+1,R=new Array(p),a=0;a<p;++a)R[a]=E/Math.pow(2,a);return R}function dp(e,r,t,x){return ap(Ve(e),r,t,x)}function Ve(e){var r=(e=va(e)).getExtent();if(!r){var t=180*Wa[Da.DEGREES]/e.getMetersPerUnit();r=Ra(-t,-t,t,t)}return r}var fp=[0,0,0],nj=function(){function t(t){var i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,ia(hq(this.resolutions_,function(t,i){return i-t},!0),17),!t.origins)for(var e=0,o=this.resolutions_.length-1;e<o;++e)if(i){if(this.resolutions_[e]/this.resolutions_[e+1]!==i){i=void 0;break}}else i=this.resolutions_[e]/this.resolutions_[e+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,ia(this.origins_.length==this.resolutions_.length,20));var r=t.extent;void 0===r||this.origin_||this.origins_||(this.origin_=Ya(r)),ia(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,ia(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Jf,ia(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==r?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,i){return new cf(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):r&&this.calculateTileRanges_(r)}return t.prototype.forEachTileCoord=function(t,i,e){for(var o=this.getTileRangeForExtentAndZ(t,i),r=o.minX,n=o.maxX;r<=n;++r)for(var s=o.minY,l=o.maxY;s<=l;++s)e([i,r,s])},t.prototype.forEachTileCoordParentTileRange=function(t,i,e,o){var r,n,s,l=null,p=t[0]-1;for(2===this.zoomFactor_?(n=t[1],s=t[2]):l=this.getTileCoordExtent(t,o);p>=this.minZoom;){if(2===this.zoomFactor_?(n=Math.floor(n/2),s=Math.floor(s/2),r=Ue(n,n,s,s,e)):r=this.getTileRangeForExtentAndZ(l,p,e),i(p,r))return!0;--p}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,i,e){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],r=2*t[2];return Ue(o,o+1,r,r+1,i)}var n=this.getTileCoordExtent(t,e);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null},t.prototype.getTileRangeExtent=function(t,i,e){var o=this.getOrigin(t),r=this.getResolution(t),n=zb(this.getTileSize(t),this.tmpSize_),s=o[0]+i.minX*n[0]*r,l=o[0]+(i.maxX+1)*n[0]*r,p=o[1]+i.minY*n[1]*r,h=o[1]+(i.maxY+1)*n[1]*r;return Ra(s,p,l,h,e)},t.prototype.getTileRangeForExtentAndZ=function(t,i,e){var o=fp;this.getTileCoordForXYAndZ_(t[0],t[3],i,!1,o);var r=o[1],n=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],i,!0,o),Ue(r,o[1],n,o[2],e)},t.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]),e=this.getResolution(t[0]),o=zb(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*o[0]*e,i[1]-(t[2]+.5)*o[1]*e]},t.prototype.getTileCoordExtent=function(t,i){var e=this.getOrigin(t[0]),o=this.getResolution(t[0]),r=zb(this.getTileSize(t[0]),this.tmpSize_),n=e[0]+t[1]*r[0]*o,s=e[1]-(t[2]+1)*r[1]*o,l=n+r[0]*o,p=s+r[1]*o;return Ra(n,s,l,p,i)},t.prototype.getTileCoordForCoordAndResolution=function(t,i,e){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,e)},t.prototype.getTileCoordForXYAndResolution_=function(t,i,e,o,r){var n=this.getZForResolution(e),s=e/this.getResolution(n),l=this.getOrigin(n),p=zb(this.getTileSize(n),this.tmpSize_),h=o?.5:0,a=o?.5:0,u=Math.floor((t-l[0])/e+h),$=Math.floor((l[1]-i)/e+a),g=s*u/p[0],d=s*$/p[1];return o?(g=Math.ceil(g)-1,d=Math.ceil(d)-1):(g=Math.floor(g),d=Math.floor(d)),Nh(n,g,d,r)},t.prototype.getTileCoordForXYAndZ_=function(t,i,e,o,r){var n=this.getOrigin(e),s=this.getResolution(e),l=zb(this.getTileSize(e),this.tmpSize_),p=o?.5:0,h=o?.5:0,a=Math.floor((t-n[0])/s+p),u=Math.floor((n[1]-i)/s+h),$=a/l[0],g=u/l[1];return o?($=Math.ceil($)-1,g=Math.ceil(g)-1):($=Math.floor($),g=Math.floor(g)),Nh(e,$,g,r)},t.prototype.getTileCoordForCoordAndZ=function(t,i,e){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,e)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},t.prototype.getZForResolution=function(t,i){var e=Lg(this.resolutions_,t,i||0);return wa(e,this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var i=this.resolutions_.length,e=new Array(i),o=this.minZoom;o<i;++o)e[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=e},t}();var Xi=Vd&&Vd.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uh=function(e){function t(t){var i=e.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX})||this;i.opaque_=void 0!==t.opaque&&t.opaque,i.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,i.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;var r=[256,256],o=t.tileGrid;o&&zb(o.getTileSize(o.getMinZoom()),r);var n="undefined"!=typeof screen,a=n?screen.availWidth||screen.width:1920,p=n?screen.availHeight||screen.height:1080,c=4*Math.ceil(a/r[0])*Math.ceil(p/r[1]);return i.tileCache=new Tf(Math.max(c,t.cacheSize||0)),i.tmpSize=[0,0],i.key_=t.key||"",i.tileOptions={transition:t.transition},i.zDirection=t.zDirection?t.zDirection:0,i}return Xi(t,e),t.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},t.prototype.expireCache=function(e,t){var i=this.getTileCacheForProjection(e);i&&i.expireCache(t)},t.prototype.forEachLoadedTile=function(e,t,i,r){var o=this.getTileCacheForProjection(e);if(!o)return!1;for(var n,a,p,c=!0,l=i.minX;l<=i.maxX;++l)for(var $=i.minY;$<=i.maxY;++$)a=Nd(t,l,$),p=!1,o.containsKey(a)&&(p=(n=o.get(a)).getState()===da.LOADED)&&(p=!1!==r(n)),p||(c=!1);return c},t.prototype.getGutterForProjection=function(e){return 0},t.prototype.getKey=function(){return this.key_},t.prototype.setKey=function(e){this.key_!==e&&(this.key_=e,this.changed())},t.prototype.getOpaque=function(e){return this.opaque_},t.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},t.prototype.getTile=function(e,t,i,r,o){return ca()},t.prototype.getTileGrid=function(){return this.tileGrid},t.prototype.getTileGridForProjection=function(e){return this.tileGrid?this.tileGrid:Ah(e)},t.prototype.getTileCacheForProjection=function(e){var t=this.getProjection();return t&&!Eb(t,e)?null:this.tileCache},t.prototype.getTilePixelRatio=function(e){return this.tilePixelRatio_},t.prototype.getTilePixelSize=function(e,t,i){var r=this.getTileGridForProjection(i),o=this.getTilePixelRatio(t),n=zb(r.getTileSize(e),this.tmpSize);return 1==o?n:bn(n,o,this.tmpSize)},t.prototype.getTileCoordForTileUrlFunction=function(e,t){var i=void 0!==t?t:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=_o(r,e,i)),Co(e,r)?e:null},t.prototype.clear=function(){this.tileCache.clear()},t.prototype.refresh=function(){this.clear(),e.prototype.refresh.call(this)},t.prototype.useTile=function(e,t,i,r){},t}(Ne),Ih=function(e){function t(t,i){var r=e.call(this,t)||this;return r.tile=i,r}return Xi(t,e),t}(Ea);Vd.TileSourceEvent=Ih,Vd.default=Uh;var Bg={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var lp=Cf&&Cf.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qj=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,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.generateTileUrlFunction_=!e.tileUrlFunction,i.tileLoadFunction=e.tileLoadFunction,i.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(i):vo,i.urls=null,e.urls?i.setUrls(e.urls):e.url&&i.setUrl(e.url),i.tileLoadingKeys_={},i}return lp(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,r=ga(i),n=i.getState();n==da.LOADING?(this.tileLoadingKeys_[r]=!0,e=Bg.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=n==da.ERROR?Bg.TILELOADERROR:n==da.LOADED?Bg.TILELOADEND:void 0),null!=e&&this.dispatchEvent(new Ih(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=wo(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(to(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,i){var r=Nd(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(Uh);Cf.default=Qj;var np=ih&&ih.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cj=function(e){function t(t){var i=e.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:pp,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return i.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,i.tileClass=void 0!==t.tileClass?t.tileClass:bj,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,i.renderReprojectionEdges_=!1,i}return np(t,e),t.prototype.canExpireCache=function(){if(!jb)return e.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},t.prototype.expireCache=function(t,i){if(jb){var r=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==r?i:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==r?i:{})}}else e.prototype.expireCache.call(this,t,i)},t.prototype.getGutterForProjection=function(e){return jb&&this.getProjection()&&e&&!Eb(this.getProjection(),e)?0:this.getGutter()},t.prototype.getGutter=function(){return 0},t.prototype.getOpaque=function(t){return!(jb&&this.getProjection()&&t&&!Eb(this.getProjection(),t))&&e.prototype.getOpaque.call(this,t)},t.prototype.getTileGridForProjection=function(t){if(!jb)return e.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(!this.tileGrid||i&&!Eb(i,t)){var r=ga(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Ah(t)),this.tileGridForProjection[r]}return this.tileGrid},t.prototype.getTileCacheForProjection=function(t){if(!jb)return e.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||Eb(i,t))return this.tileCache;var r=ga(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Tf(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},t.prototype.createTile_=function(e,t,i,r,o,n){var l=[e,t,i],c=this.getTileCoordForTileUrlFunction(l,o),a=c?this.tileUrlFunction(c,r,o):void 0,u=new this.tileClass(l,void 0!==a?da.IDLE:da.EMPTY,void 0!==a?a:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=n,u.addEventListener(ba.CHANGE,this.handleTileChange.bind(this)),u},t.prototype.getTile=function(e,t,i,r,o){var n=this.getProjection();if(jb&&n&&o&&!Eb(n,o)){var l=this.getTileCacheForProjection(o),c=[e,t,i],a=void 0,u=tk(c);l.containsKey(u)&&(a=l.get(u));var s=this.getKey();if(a&&a.key==s)return a;var $=this.getTileGridForProjection(n),p=this.getTileGridForProjection(o),h=this.getTileCoordForTileUrlFunction(c,o),d=new Rh(n,$,o,p,c,h,this.getTilePixelRatio(r),this.getGutter(),function(e,t,i,r){return this.getTileInternal(e,t,i,r,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return d.key=s,a?(d.interimTile=a,d.refreshInterimChain(),l.replace(u,d)):l.set(u,d),d}return this.getTileInternal(e,t,i,r,n||o)},t.prototype.getTileInternal=function(e,t,i,r,o){var n=null,l=Nd(e,t,i),c=this.getKey();if(this.tileCache.containsKey(l)){if((n=this.tileCache.get(l)).key!=c){var a=n;n=this.createTile_(e,t,i,r,o,c),a.getState()==da.IDLE?n.interimTile=a.interimTile:n.interimTile=a,n.refreshInterimChain(),this.tileCache.replace(l,n)}}else n=this.createTile_(e,t,i,r,o,c),this.tileCache.set(l,n);return n},t.prototype.setRenderReprojectionEdges=function(e){if(jb&&this.renderReprojectionEdges_!=e){for(var t in this.renderReprojectionEdges_=e,this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}},t.prototype.setTileGridForProjection=function(e,t){if(jb){var i=va(e);if(i){var r=ga(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}},t}(Qj);function pp(e,t){e.getImage().src=t}ih.default=Cj;var ag={};var rp=ag&&ag.__extends||function(){var t=function(o,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])})(o,r)};return function(o,r){function e(){this.constructor=o}t(o,r),o.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),qj=function(t){function o(o){var r=o||{},e=void 0!==r.projection?r.projection:"EPSG:3857",i=void 0!==r.tileGrid?r.tileGrid:bp({extent:Ve(e),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,opaque:r.opaque,projection:e,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return rp(o,t),o}(Cj);ag.default=qj;var _d={};var up=_d&&_d.__extends||function(){var o=function(t,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var r in t)t.hasOwnProperty(r)&&(o[r]=t[r])})(t,r)};return function(t,r){function e(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),Oi="&#169; <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors.";_d.ATTRIBUTION=Oi;var Ni=function(o){function t(t){var r,e=t||{};r=void 0!==e.attributions?e.attributions:[Oi];var n=void 0!==e.crossOrigin?e.crossOrigin:"anonymous",i=void 0!==e.url?e.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return o.call(this,{attributions:r,cacheSize:e.cacheSize,crossOrigin:n,opaque:void 0===e.opaque||e.opaque,maxZoom:void 0!==e.maxZoom?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,url:i,wrapX:e.wrapX,attributionsCollapsible:!1})||this}return up(t,o),t}(qj);_d.default=Ni;var xp=!0;try{new ImageData(10,10)}catch(_){xp=!1}var yp=document.createElement("canvas").getContext("2d");function zp(a,t,e){if(xp)return new ImageData(a,t,e);var $=yp.createImageData(t,e);return $.data.set(a),$}var Ap=zp;var Bp=Ap;function Ek(e){var t=!0;try{new ImageData(10,10)}catch(a){t=!1}function r(e,r,a){return t?new ImageData(e,r,a):{data:e,width:r,height:a}}return function(t){var a,n,i=t.buffers,s=t.meta,o=t.imageOps,u=t.width,h=t.height,l=i.length,f=i[0].byteLength;if(o){var p=new Array(l);for(n=0;n<l;++n)p[n]=r(new Uint8ClampedArray(i[n]),u,h);a=e(p,s).data}else{a=new Uint8ClampedArray(f);var $=new Array(l),c=new Array(l);for(n=0;n<l;++n)$[n]=new Uint8ClampedArray(i[n]),c[n]=[0,0,0,0];for(var _=0;_<f;_+=4){for(var v=0;v<l;++v){var g=$[v];c[v][0]=g[_],c[v][1]=g[_+1],c[v][2]=g[_+2],c[v][3]=g[_+3]}var d=e(c,s);a[_]=d[0],a[_+1]=d[1],a[_+2]=d[2],a[_+3]=d[3]}}return a.buffer}}function Dp(e,t){var r=Object.keys(e.lib||{}).map(function(t){return"var "+t+" = "+e.lib[t].toString()+";"}).concat(["var __minion__ = ("+Ek.toString()+")(",e.operation.toString(),");","self.addEventListener(\"message\", function(event) {"," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),a=new Blob(r,{type:"text/javascript"}),n=URL.createObjectURL(a),i=new Worker(n);return i.addEventListener("message",t),i}function Ep(e,t){var r=Ek(e.operation);return{postMessage:function(e){setTimeout(function(){t({data:{buffer:r(e),meta:e.meta}})},0)}}}function ec(e){var t;this._imageOps=!!e.imageOps;var r=[];if(t=0===e.threads?0:this._imageOps?1:e.threads||1)for(var a=0;a<t;++a)r[a]=Dp(e,this._onWorkerMessage.bind(this,a));else r[0]=Ep(e,this._onWorkerMessage.bind(this,0));this._workers=r,this._queue=[],this._maxQueueLength=e.queue||1/0,this._running=0,this._dataLookup={},this._job=null}ec.prototype.process=function(e,t,r){this._enqueue({inputs:e,meta:t,callback:r}),this._dispatch()},ec.prototype.destroy=function(){for(var e in this)this[e]=null;this._destroyed=!0},ec.prototype._enqueue=function(e){for(this._queue.push(e);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},ec.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var e=this._job=this._queue.shift(),t=e.inputs[0].width,r=e.inputs[0].height,a=e.inputs.map(function(e){return e.data.buffer}),n=this._workers.length;if(this._running=n,1===n)this._workers[0].postMessage({buffers:a,meta:e.meta,imageOps:this._imageOps,width:t,height:r},a);else for(var i=e.inputs[0].data.length,s=4*Math.ceil(i/4/n),o=0;o<n;++o){for(var u=o*s,h=[],l=0,f=a.length;l<f;++l)h.push(a[o].slice(u,u+s));this._workers[o].postMessage({buffers:h,meta:e.meta,imageOps:this._imageOps,width:t,height:r},h)}}},ec.prototype._onWorkerMessage=function(e,t){this._destroyed||(this._dataLookup[e]=t.data,--this._running,0===this._running&&this._resolveJob())},ec.prototype._resolveJob=function(){var e,t,r=this._job,a=this._workers.length;if(1===a)e=new Uint8ClampedArray(this._dataLookup[0].buffer),t=this._dataLookup[0].meta;else{var n=r.inputs[0].data.length;e=new Uint8ClampedArray(n),t=new Array(n);for(var i=4*Math.ceil(n/4/a),s=0;s<a;++s){var o=this._dataLookup[s].buffer,u=s*i;e.set(new Uint8ClampedArray(o),u),t[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},r.callback(null,Bp(e,r.inputs[0].width,r.inputs[0].height),t),this._dispatch()};var Le={};var Hp=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,r){var o;if(r){var e=r.dataProjection?va(r.dataProjection):this.readProjection(t);r.extent&&e&&e.getUnits()===Da.TILE_PIXELS&&(e=va(e)).setWorldExtent(r.extent),o={dataProjection:e,featureProjection:r.featureProjection}}return this.adaptOptions(o)},t.prototype.adaptOptions=function(t){return Ca({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return ca()},t.prototype.readFeature=function(t,r){return ca()},t.prototype.readFeatures=function(t,r){return ca()},t.prototype.readGeometry=function(t,r){return ca()},t.prototype.readProjection=function(t){return ca()},t.prototype.writeFeature=function(t,r){return ca()},t.prototype.writeFeatures=function(t,r){return ca()},t.prototype.writeGeometry=function(t,r){return ca()},t}();function ri(t,r,o){var e,n=o?va(o.featureProjection):null,i=o?va(o.dataProjection):null;if(e=n&&i&&!Eb(n,i)?(r?t.clone():t).transform(r?n:i,r?i:n):t,r&&o&&void 0!==o.decimals){var $=Math.pow(10,o.decimals);e===t&&(e=t.clone()),e.applyTransform(function(t){for(var r=0,o=t.length;r<o;++r)t[r]=Math.round(t[r]*$)/$;return t})}return e}var He={};var Kp=He&&He.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),Th=function(t){function r(){return t.call(this)||this}return Kp(r,t),r.prototype.getType=function(){return uc.JSON},r.prototype.readFeature=function(t,r){return this.readFeatureFromObject(ye(t),this.getReadOptions(t,r))},r.prototype.readFeatures=function(t,r){return this.readFeaturesFromObject(ye(t),this.getReadOptions(t,r))},r.prototype.readFeatureFromObject=function(t,r){return ca()},r.prototype.readFeaturesFromObject=function(t,r){return ca()},r.prototype.readGeometry=function(t,r){return this.readGeometryFromObject(ye(t),this.getReadOptions(t,r))},r.prototype.readGeometryFromObject=function(t,r){return ca()},r.prototype.readProjection=function(t){return this.readProjectionFromObject(ye(t))},r.prototype.readProjectionFromObject=function(t){return ca()},r.prototype.writeFeature=function(t,r){return JSON.stringify(this.writeFeatureObject(t,r))},r.prototype.writeFeatureObject=function(t,r){return ca()},r.prototype.writeFeatures=function(t,r){return JSON.stringify(this.writeFeaturesObject(t,r))},r.prototype.writeFeaturesObject=function(t,r){return ca()},r.prototype.writeGeometry=function(t,r){return JSON.stringify(this.writeGeometryObject(t,r))},r.prototype.writeGeometryObject=function(t,r){return ca()},r}(Hp);function ye(t){if("string"==typeof t){var r=JSON.parse(t);return r||null}return null!==t?t:null}He.default=Th;var og={};var Op=og&&og.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),$h=function(e){function t(t){var r=e.call(this)||this;return r.geometries_=t||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return Op(t,e),t.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(ja),this.changeEventsKeys_.length=0},t.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var e=0,t=this.geometries_.length;e<t;++e)this.changeEventsKeys_.push(fa(this.geometries_[e],ba.CHANGE,this.changed,this))},t.prototype.clone=function(){var e=new t(null);return e.setGeometries(this.geometries_),e},t.prototype.closestPointXY=function(e,t,r,i){if(i<Rb(this.getExtent(),e,t))return i;for(var o=this.geometries_,n=0,s=o.length;n<s;++n)i=o[n].closestPointXY(e,t,r,i);return i},t.prototype.containsXY=function(e,t){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)if(r[i].containsXY(e,t))return!0;return!1},t.prototype.computeExtent=function(e){sc(e);for(var t=this.geometries_,r=0,i=t.length;r<i;++r)Se(e,t[r].getExtent());return e},t.prototype.getGeometries=function(){return zk(this.geometries_)},t.prototype.getGeometriesArray=function(){return this.geometries_},t.prototype.getGeometriesArrayRecursive=function(){for(var e=[],t=this.geometries_,r=0,i=t.length;r<i;++r)t[r].getType()===this.getType()?e=e.concat(t[r].getGeometriesArrayRecursive()):e.push(t[r]);return e},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],i=this.geometries_,o=!1,n=0,s=i.length;n<s;++n){var p=i[n],a=p.getSimplifiedGeometry(e);r.push(a),a!==p&&(o=!0)}if(o){var h=new t(null);return h.setGeometriesArray(r),h}return this.simplifiedGeometryMaxMinSquaredTolerance=e,this},t.prototype.getType=function(){return aa.GEOMETRY_COLLECTION},t.prototype.intersectsExtent=function(e){for(var t=this.geometries_,r=0,i=t.length;r<i;++r)if(t[r].intersectsExtent(e))return!0;return!1},t.prototype.isEmpty=function(){return 0===this.geometries_.length},t.prototype.rotate=function(e,t){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)r[i].rotate(e,t);this.changed()},t.prototype.scale=function(e,t,r){var i=r;i||(i=Gb(this.getExtent()));for(var o=this.geometries_,n=0,s=o.length;n<s;++n)o[n].scale(e,t,i);this.changed()},t.prototype.setGeometries=function(e){this.setGeometriesArray(zk(e))},t.prototype.setGeometriesArray=function(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()},t.prototype.applyTransform=function(e){for(var t=this.geometries_,r=0,i=t.length;r<i;++r)t[r].applyTransform(e);this.changed()},t.prototype.translate=function(e,t){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)r[i].translate(e,t);this.changed()},t.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),e.prototype.disposeInternal.call(this)},t}(Qf);function zk(e){for(var t=[],r=0,i=e.length;r<i;++r)t.push(e[r].clone());return t}og.default=$h;var Rp=Le&&Le.__extends||function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),Ai=function(e){function r(r){var t=this,o=r||{};return(t=e.call(this)||this).dataProjection=va(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(t.defaultFeatureProjection=va(o.featureProjection)),t.geometryName_=o.geometryName,t.extractGeometryName_=o.extractGeometryName,t}return Rp(r,e),r.prototype.readFeatureFromObject=function(e,r){var t=null,o=ff((t="Feature"===e.type?e:{type:"Feature",geometry:e,properties:null}).geometry,r),i=new _a;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in t!==void 0&&i.setGeometryName(t.geometry_name),i.setGeometry(o),"id"in t&&i.setId(t.id),t.properties&&i.setProperties(t.properties,!0),i},r.prototype.readFeaturesFromObject=function(e,r){var t=null;if("FeatureCollection"===e.type){t=[];for(var o=e.features,i=0,$=o.length;i<$;++i)t.push(this.readFeatureFromObject(o[i],r))}else t=[this.readFeatureFromObject(e,r)];return t},r.prototype.readGeometryFromObject=function(e,r){return ff(e,r)},r.prototype.readProjectionFromObject=function(e){var r,t=e.crs;return t?"name"==t.type?r=va(t.properties.name):"EPSG"===t.type?r=va("EPSG:"+t.properties.code):ia(!1,36):r=this.dataProjection,r},r.prototype.writeFeatureObject=function(e,r){r=this.adaptOptions(r);var t={type:"Feature",geometry:null,properties:null},o=e.getId();void 0!==o&&(t.id=o);var i=e.getGeometry();i&&(t.geometry=_e(i,r));var $=e.getProperties();return delete $[e.getGeometryName()],Qc($)||(t.properties=$),t},r.prototype.writeFeaturesObject=function(e,r){r=this.adaptOptions(r);for(var t=[],o=0,i=e.length;o<i;++o)t.push(this.writeFeatureObject(e[o],r));return{type:"FeatureCollection",features:t}},r.prototype.writeGeometryObject=function(e,r){return _e(e,this.adaptOptions(r))},r}(Th);function ff(e,r){if(!e)return null;var t;switch(e.type){case aa.POINT:t=Vp(e);break;case aa.LINE_STRING:t=Wp(e);break;case aa.POLYGON:t=$p(e);break;case aa.MULTI_POINT:t=Yp(e);break;case aa.MULTI_LINE_STRING:t=Xp(e);break;case aa.MULTI_POLYGON:t=Zp(e);break;case aa.GEOMETRY_COLLECTION:t=Up(e);break;default:throw new Error("Unsupported GeoJSON type: "+e.type);}return ri(t,!1,r)}function Up(e,r){var t=e.geometries.map(function(e){return ff(e,r)});return new $h(t)}function Vp(e){return new kb(e.coordinates)}function Wp(e){return new Xb(e.coordinates)}function Xp(e){return new eh(e.coordinates)}function Yp(e){return new qe(e.coordinates)}function Zp(e){return new Wg(e.coordinates)}function $p(e){return new bb(e.coordinates)}function _e(e,r){var t,o=(e=ri(e,!0,r)).getType();switch(o){case aa.POINT:t=fq(e,r);break;case aa.LINE_STRING:t=bq(e,r);break;case aa.POLYGON:t=gq(e,r);break;case aa.MULTI_POINT:t=dq(e,r);break;case aa.MULTI_LINE_STRING:t=cq(e,r);break;case aa.MULTI_POLYGON:t=eq(e,r);break;case aa.GEOMETRY_COLLECTION:t=aq(e,r);break;case aa.CIRCLE:t={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o);}return t}function aq(e,r){return{type:"GeometryCollection",geometries:e.getGeometriesArray().map(function(e){var t=Ca({},r);return delete t.featureProjection,_e(e,t)})}}function bq(e,r){return{type:"LineString",coordinates:e.getCoordinates()}}function cq(e,r){return{type:"MultiLineString",coordinates:e.getCoordinates()}}function dq(e,r){return{type:"MultiPoint",coordinates:e.getCoordinates()}}function eq(e,r){var t;return r&&(t=r.rightHanded),{type:"MultiPolygon",coordinates:e.getCoordinates(t)}}function fq(e,r){return{type:"Point",coordinates:e.getCoordinates()}}function gq(e,r){var t;return r&&(t=r.rightHanded),{type:"Polygon",coordinates:e.getCoordinates(t)}}Le.default=Ai;var Te,Ee={};!function(e,t){"function"==typeof Te&&Te.amd?Te([],t):void 0!==Ee?t():(t(),e.FileSaver={})}(Ee,function(){function e(e,t,o){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){a(n.response,t,o)},n.onerror=function(){console.error("could not download file")},n.send()}function t(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}var n="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof Bd&&Bd.global===Bd?Bd:void 0,a=n.saveAs||("object"!=typeof window||window!==n?function(){}:"download"in HTMLAnchorElement.prototype?function(a,i,r){var c=n.URL||n.webkitURL,l=document.createElement("a");i=i||a.name||"download",l.download=i,l.rel="noopener","string"==typeof a?(l.href=a,l.origin===location.origin?o(l):t(l.href)?e(a,i,r):o(l,l.target="_blank")):(l.href=c.createObjectURL(a),setTimeout(function(){c.revokeObjectURL(l.href)},4e4),setTimeout(function(){o(l)},0))}:"msSaveOrOpenBlob"in navigator?function(n,a,i){if(a=a||n.name||"download","string"!=typeof n)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}(n,i),a);else if(t(n))e(n,a,i);else{var r=document.createElement("a");r.href=n,r.target="_blank",setTimeout(function(){o(r)})}}:function(t,o,a,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return e(t,o,a);var r="application/octet-stream"===t.type,c=/constructor/i.test(n.HTMLElement)||n.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||r&&c)&&"object"==typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},s.readAsDataURL(t)}else{var f=n.URL||n.webkitURL,d=f.createObjectURL(t);i?i.location=d:location.href=d,i=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});n.saveAs=a.saveAs=a,Ee=a});var Fh,kq=new Qh({source:new Ni}),Ff=new lc({wrapX:!1}),Jp=new xc({source:Ff}),zh=new rj({layers:[kq,Jp],target:"map",view:new wd({center:[-11e6,46e5],zoom:4})}),ng=document.getElementById("type"),bm=document.getElementById("export");function Di(){"None"!==ng.value&&(Fh=new wi({source:Ff,type:ng.value,freehand:!0}),zh.addInteraction(Fh))}bm.addEventListener("click",function(e){console.log("clicked");var r=new Ai({dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}).writeFeatures(Ff.getFeatures().map(function(e){var r=e.clone();return r.getGeometry()instanceof Kc&&r.setGeometry(oc(r.getGeometry())),r})),o=new Blob([r],{type:"application/ vnd.geo+json;charset=utf-8"});Ee.saveAs(o,"export.geojson")}),ng.onchange=function(){zh.removeInteraction(Fh),Di()},Di();})();
.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-Index:10}.ol-scale-step-text{bottom:-5px;font-size:12px;z-Index:11}.ol-scale-step-text,.ol-scale-text{position:absolute;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{font-size:14px;text-align:center;bottom:25px}.ol-scale-singlebar{position:relative;height:10px;z-Index:9;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ol-overlaycontainer,.ol-overlaycontainer-stopevent{pointer-events:none}.ol-overlaycontainer-stopevent>*,.ol-overlaycontainer>*{pointer-events:auto}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:hsla(0,0%,100%,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:hsla(0,0%,100%,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-control button span{pointer-events:none}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em)}.ol-attribution ul{margin:0;padding:0 .5em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button,.ol-attribution ul{display:inline-block}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:hsla(0,0%,100%,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:inline-block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:hsla(0,0%,100%,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 2px solid blue;
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-Index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-Index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-Index: 9;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-overlaycontainer, .ol-overlaycontainer-stopevent {
pointer-events: none;
}
.ol-overlaycontainer > *, .ol-overlaycontainer-stopevent > * {
pointer-events: auto;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-size: 1.14em;
font-weight: bold;
text-decoration: none;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-control button span {
pointer-events: none;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
}
.ol-attribution ul {
margin: 0;
padding: 0 .5em;
color: #000;
text-shadow: 0 0 2px #fff;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution ul, .ol-attribution button {
display: inline-block;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: inline-block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button{
bottom: 1px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
This file has been truncated, but you can view the full file.
// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
// eslint-disable-next-line no-global-assign
parcelRequire = (function (modules, cache, entry, globalName) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
var nodeRequire = typeof require === 'function' && require;
function newRequire(name, jumped) {
if (!cache[name]) {
if (!modules[name]) {
// if we cannot find the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
if (!jumped && currentRequire) {
return currentRequire(name, true);
}
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) {
return previousRequire(name, true);
}
// Try the node require function if it exists.
if (nodeRequire && typeof name === 'string') {
return nodeRequire(name);
}
var err = new Error('Cannot find module \'' + name + '\'');
err.code = 'MODULE_NOT_FOUND';
throw err;
}
localRequire.resolve = resolve;
localRequire.cache = {};
var module = cache[name] = new newRequire.Module(name);
modules[name][0].call(module.exports, localRequire, module, module.exports, this);
}
return cache[name].exports;
function localRequire(x){
return newRequire(localRequire.resolve(x));
}
function resolve(x){
return modules[name][1][x] || x;
}
}
function Module(moduleName) {
this.id = moduleName;
this.bundle = newRequire;
this.exports = {};
}
newRequire.isParcelRequire = true;
newRequire.Module = Module;
newRequire.modules = modules;
newRequire.cache = cache;
newRequire.parent = previousRequire;
newRequire.register = function (id, exports) {
modules[id] = [function (require, module) {
module.exports = exports;
}, {}];
};
for (var i = 0; i < entry.length; i++) {
newRequire(entry[i]);
}
if (entry.length) {
// Expose entry point to Node, AMD or browser globals
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
var mainExports = newRequire(entry[entry.length - 1]);
// CommonJS
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = mainExports;
// RequireJS
} else if (typeof define === "function" && define.amd) {
define(function () {
return mainExports;
});
// <script>
} else if (globalName) {
this[globalName] = mainExports;
}
}
// Override the current require with this new one
return newRequire;
})({"node_modules/parcel/src/builtins/bundle-url.js":[function(require,module,exports) {
var bundleURL = null;
function getBundleURLCached() {
if (!bundleURL) {
bundleURL = getBundleURL();
}
return bundleURL;
}
function getBundleURL() {
// Attempt to find the URL of the current script and use that as the base URL
try {
throw new Error();
} catch (err) {
var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g);
if (matches) {
return getBaseURL(matches[0]);
}
}
return '/';
}
function getBaseURL(url) {
return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/';
}
exports.getBundleURL = getBundleURLCached;
exports.getBaseURL = getBaseURL;
},{}],"node_modules/parcel/src/builtins/css-loader.js":[function(require,module,exports) {
var bundle = require('./bundle-url');
function updateLink(link) {
var newLink = link.cloneNode();
newLink.onload = function () {
link.remove();
};
newLink.href = link.href.split('?')[0] + '?' + Date.now();
link.parentNode.insertBefore(newLink, link.nextSibling);
}
var cssTimeout = null;
function reloadCSS() {
if (cssTimeout) {
return;
}
cssTimeout = setTimeout(function () {
var links = document.querySelectorAll('link[rel="stylesheet"]');
for (var i = 0; i < links.length; i++) {
if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {
updateLink(links[i]);
}
}
cssTimeout = null;
}, 50);
}
module.exports = reloadCSS;
},{"./bundle-url":"node_modules/parcel/src/builtins/bundle-url.js"}],"node_modules/ol/ol.css":[function(require,module,exports) {
var reloadCSS = require('_css_loader');
module.hot.dispose(reloadCSS);
module.hot.accept(reloadCSS);
},{"_css_loader":"node_modules/parcel/src/builtins/css-loader.js"}],"node_modules/ol/util.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.abstract = abstract;
exports.getUid = getUid;
exports.VERSION = void 0;
/**
* @module ol/util
*/
/**
* @return {?} Any return.
*/
function abstract() {
return (
/** @type {?} */
function () {
throw new Error('Unimplemented abstract method.');
}()
);
}
/**
* Counter for getUid.
* @type {number}
* @private
*/
var uidCounter_ = 0;
/**
* Gets a unique ID for an object. This mutates the object so that further calls
* with the same object as a parameter returns the same value. Unique IDs are generated
* as a strictly increasing sequence. Adapted from goog.getUid.
*
* @param {Object} obj The object to get the unique ID for.
* @return {string} The unique ID for the object.
* @api
*/
function getUid(obj) {
return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));
}
/**
* OpenLayers version.
* @type {string}
*/
var VERSION = '6.3.1';
exports.VERSION = VERSION;
},{}],"node_modules/ol/AssertionError.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _util = require("./util.js");
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/AssertionError
*/
/**
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
* extended with a `code` property.
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error.
*/
var AssertionError =
/** @class */
function (_super) {
__extends(AssertionError, _super);
/**
* @param {number} code Error code.
*/
function AssertionError(code) {
var _this = this;
var path = _util.VERSION === 'latest' ? _util.VERSION : 'v' + _util.VERSION.split('-')[0];
var message = 'Assertion failed. See https://openlayers.org/en/' + path + '/doc/errors/#' + code + ' for details.';
_this = _super.call(this, message) || this;
/**
* Error code. The meaning of the code can be found on
* https://openlayers.org/en/latest/doc/errors/ (replace `latest` with
* the version found in the OpenLayers script's header comment if a version
* other than the latest is used).
* @type {number}
* @api
*/
_this.code = code;
/**
* @type {string}
*/
_this.name = 'AssertionError'; // Re-assign message, see https://github.com/Rich-Harris/buble/issues/40
_this.message = message;
return _this;
}
return AssertionError;
}(Error);
var _default = AssertionError;
exports.default = _default;
},{"./util.js":"node_modules/ol/util.js"}],"node_modules/ol/CollectionEventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/CollectionEventType
*/
/**
* @enum {string}
*/
var _default = {
/**
* Triggered when an item is added to the collection.
* @event module:ol/Collection.CollectionEvent#add
* @api
*/
ADD: 'add',
/**
* Triggered when an item is removed from the collection.
* @event module:ol/Collection.CollectionEvent#remove
* @api
*/
REMOVE: 'remove'
};
exports.default = _default;
},{}],"node_modules/ol/ObjectEventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/ObjectEventType
*/
/**
* @enum {string}
*/
var _default = {
/**
* Triggered when a property is changed.
* @event module:ol/Object.ObjectEvent#propertychange
* @api
*/
PROPERTYCHANGE: 'propertychange'
};
exports.default = _default;
},{}],"node_modules/ol/obj.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.clear = clear;
exports.isEmpty = isEmpty;
exports.getValues = exports.assign = void 0;
/**
* @module ol/obj
*/
/**
* Polyfill for Object.assign(). Assigns enumerable and own properties from
* one or more source objects to a target object.
* See https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign.
*
* @param {!Object} target The target object.
* @param {...Object} var_sources The source object(s).
* @return {!Object} The modified target object.
*/
var assign = typeof Object.assign === 'function' ? Object.assign : function (target, var_sources) {
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var i = 1, ii = arguments.length; i < ii; ++i) {
var source = arguments[i];
if (source !== undefined && source !== null) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
output[key] = source[key];
}
}
}
}
return output;
};
/**
* Removes all properties from an object.
* @param {Object} object The object to clear.
*/
exports.assign = assign;
function clear(object) {
for (var property in object) {
delete object[property];
}
}
/**
* Polyfill for Object.values(). Get an array of property values from an object.
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values
*
* @param {!Object<K,V>} object The object from which to get the values.
* @return {!Array<V>} The property values.
* @template K,V
*/
var getValues = typeof Object.values === 'function' ? Object.values : function (object) {
var values = [];
for (var property in object) {
values.push(object[property]);
}
return values;
};
/**
* Determine if an object has any properties.
* @param {Object} object The object to check.
* @return {boolean} The object is empty.
*/
exports.getValues = getValues;
function isEmpty(object) {
var property;
for (property in object) {
return false;
}
return !property;
}
},{}],"node_modules/ol/events.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.listen = listen;
exports.listenOnce = listenOnce;
exports.unlistenByKey = unlistenByKey;
var _obj = require("./obj.js");
/**
* @module ol/events
*/
/**
* Key to use with {@link module:ol/Observable~Observable#unByKey}.
* @typedef {Object} EventsKey
* @property {ListenerFunction} listener
* @property {import("./events/Target.js").EventTargetLike} target
* @property {string} type
* @api
*/
/**
* Listener function. This function is called with an event object as argument.
* When the function returns `false`, event propagation will stop.
*
* @typedef {function((Event|import("./events/Event.js").default)): (void|boolean)} ListenerFunction
* @api
*/
/**
* @typedef {Object} ListenerObject
* @property {ListenerFunction} handleEvent
*/
/**
* @typedef {ListenerFunction|ListenerObject} Listener
*/
/**
* Registers an event listener on an event target. Inspired by
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
*
* This function efficiently binds a `listener` to a `this` object, and returns
* a key for use with {@link module:ol/events~unlistenByKey}.
*
* @param {import("./events/Target.js").EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ListenerFunction} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @param {boolean=} opt_once If true, add the listener as one-off listener.
* @return {EventsKey} Unique key for the listener.
*/
function listen(target, type, listener, opt_this, opt_once) {
if (opt_this && opt_this !== target) {
listener = listener.bind(opt_this);
}
if (opt_once) {
var originalListener_1 = listener;
listener = function () {
target.removeEventListener(type, listener);
originalListener_1.apply(this, arguments);
};
}
var eventsKey = {
target: target,
type: type,
listener: listener
};
target.addEventListener(type, listener);
return eventsKey;
}
/**
* Registers a one-off event listener on an event target. Inspired by
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
*
* This function efficiently binds a `listener` as self-unregistering listener
* to a `this` object, and returns a key for use with
* {@link module:ol/events~unlistenByKey} in case the listener needs to be
* unregistered before it is called.
*
* When {@link module:ol/events~listen} is called with the same arguments after this
* function, the self-unregistering listener will be turned into a permanent
* listener.
*
* @param {import("./events/Target.js").EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ListenerFunction} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @return {EventsKey} Key for unlistenByKey.
*/
function listenOnce(target, type, listener, opt_this) {
return listen(target, type, listener, opt_this, true);
}
/**
* Unregisters event listeners on an event target. Inspired by
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
*
* The argument passed to this function is the key returned from
* {@link module:ol/events~listen} or {@link module:ol/events~listenOnce}.
*
* @param {EventsKey} key The key.
*/
function unlistenByKey(key) {
if (key && key.target) {
key.target.removeEventListener(key.type, key.listener);
(0, _obj.clear)(key);
}
}
},{"./obj.js":"node_modules/ol/obj.js"}],"node_modules/ol/Disposable.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/Disposable
*/
/**
* @classdesc
* Objects that need to clean up after themselves.
*/
var Disposable =
/** @class */
function () {
function Disposable() {
/**
* The object has already been disposed.
* @type {boolean}
* @private
*/
this.disposed_ = false;
}
/**
* Clean up.
*/
Disposable.prototype.dispose = function () {
if (!this.disposed_) {
this.disposed_ = true;
this.disposeInternal();
}
};
/**
* Extension point for disposable objects.
* @protected
*/
Disposable.prototype.disposeInternal = function () {};
return Disposable;
}();
var _default = Disposable;
exports.default = _default;
},{}],"node_modules/ol/array.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.binarySearch = binarySearch;
exports.numberSafeCompareFunction = numberSafeCompareFunction;
exports.includes = includes;
exports.linearFindNearest = linearFindNearest;
exports.reverseSubArray = reverseSubArray;
exports.extend = extend;
exports.remove = remove;
exports.find = find;
exports.equals = equals;
exports.stableSort = stableSort;
exports.findIndex = findIndex;
exports.isSorted = isSorted;
/**
* @module ol/array
*/
/**
* Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.
* https://github.com/darkskyapp/binary-search
*
* @param {Array<*>} haystack Items to search through.
* @param {*} needle The item to look for.
* @param {Function=} opt_comparator Comparator function.
* @return {number} The index of the item if found, -1 if not.
*/
function binarySearch(haystack, needle, opt_comparator) {
var mid, cmp;
var comparator = opt_comparator || numberSafeCompareFunction;
var low = 0;
var high = haystack.length;
var found = false;
while (low < high) {
/* Note that "(low + high) >>> 1" may overflow, and results in a typecast
* to double (which gives the wrong results). */
mid = low + (high - low >> 1);
cmp = +comparator(haystack[mid], needle);
if (cmp < 0.0) {
/* Too low. */
low = mid + 1;
} else {
/* Key found or too high */
high = mid;
found = !cmp;
}
}
/* Key not found. */
return found ? low : ~low;
}
/**
* Compare function for array sort that is safe for numbers.
* @param {*} a The first object to be compared.
* @param {*} b The second object to be compared.
* @return {number} A negative number, zero, or a positive number as the first
* argument is less than, equal to, or greater than the second.
*/
function numberSafeCompareFunction(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
/**
* Whether the array contains the given object.
* @param {Array<*>} arr The array to test for the presence of the element.
* @param {*} obj The object for which to test.
* @return {boolean} The object is in the array.
*/
function includes(arr, obj) {
return arr.indexOf(obj) >= 0;
}
/**
* @param {Array<number>} arr Array.
* @param {number} target Target.
* @param {number} direction 0 means return the nearest, > 0
* means return the largest nearest, < 0 means return the
* smallest nearest.
* @return {number} Index.
*/
function linearFindNearest(arr, target, direction) {
var n = arr.length;
if (arr[0] <= target) {
return 0;
} else if (target <= arr[n - 1]) {
return n - 1;
} else {
var i = void 0;
if (direction > 0) {
for (i = 1; i < n; ++i) {
if (arr[i] < target) {
return i - 1;
}
}
} else if (direction < 0) {
for (i = 1; i < n; ++i) {
if (arr[i] <= target) {
return i;
}
}
} else {
for (i = 1; i < n; ++i) {
if (arr[i] == target) {
return i;
} else if (arr[i] < target) {
if (arr[i - 1] - target < target - arr[i]) {
return i - 1;
} else {
return i;
}
}
}
}
return n - 1;
}
}
/**
* @param {Array<*>} arr Array.
* @param {number} begin Begin index.
* @param {number} end End index.
*/
function reverseSubArray(arr, begin, end) {
while (begin < end) {
var tmp = arr[begin];
arr[begin] = arr[end];
arr[end] = tmp;
++begin;
--end;
}
}
/**
* @param {Array<VALUE>} arr The array to modify.
* @param {!Array<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
* @template VALUE
*/
function extend(arr, data) {
var extension = Array.isArray(data) ? data : [data];
var length = extension.length;
for (var i = 0; i < length; i++) {
arr[arr.length] = extension[i];
}
}
/**
* @param {Array<VALUE>} arr The array to modify.
* @param {VALUE} obj The element to remove.
* @template VALUE
* @return {boolean} If the element was removed.
*/
function remove(arr, obj) {
var i = arr.indexOf(obj);
var found = i > -1;
if (found) {
arr.splice(i, 1);
}
return found;
}
/**
* @param {Array<VALUE>} arr The array to search in.
* @param {function(VALUE, number, ?) : boolean} func The function to compare.
* @template VALUE
* @return {VALUE|null} The element found or null.
*/
function find(arr, func) {
var length = arr.length >>> 0;
var value;
for (var i = 0; i < length; i++) {
value = arr[i];
if (func(value, i, arr)) {
return value;
}
}
return null;
}
/**
* @param {Array|Uint8ClampedArray} arr1 The first array to compare.
* @param {Array|Uint8ClampedArray} arr2 The second array to compare.
* @return {boolean} Whether the two arrays are equal.
*/
function equals(arr1, arr2) {
var len1 = arr1.length;
if (len1 !== arr2.length) {
return false;
}
for (var i = 0; i < len1; i++) {
if (arr1[i] !== arr2[i]) {
return false;
}
}
return true;
}
/**
* Sort the passed array such that the relative order of equal elements is preverved.
* See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.
* @param {Array<*>} arr The array to sort (modifies original).
* @param {!function(*, *): number} compareFnc Comparison function.
* @api
*/
function stableSort(arr, compareFnc) {
var length = arr.length;
var tmp = Array(arr.length);
var i;
for (i = 0; i < length; i++) {
tmp[i] = {
index: i,
value: arr[i]
};
}
tmp.sort(function (a, b) {
return compareFnc(a.value, b.value) || a.index - b.index;
});
for (i = 0; i < arr.length; i++) {
arr[i] = tmp[i].value;
}
}
/**
* @param {Array<*>} arr The array to search in.
* @param {Function} func Comparison function.
* @return {number} Return index.
*/
function findIndex(arr, func) {
var index;
var found = !arr.every(function (el, idx) {
index = idx;
return !func(el, idx, arr);
});
return found ? index : -1;
}
/**
* @param {Array<*>} arr The array to test.
* @param {Function=} opt_func Comparison function.
* @param {boolean=} opt_strict Strictly sorted (default false).
* @return {boolean} Return index.
*/
function isSorted(arr, opt_func, opt_strict) {
var compare = opt_func || numberSafeCompareFunction;
return arr.every(function (currentVal, index) {
if (index === 0) {
return true;
}
var res = compare(arr[index - 1], currentVal);
return !(res > 0 || opt_strict && res === 0);
});
}
},{}],"node_modules/ol/functions.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TRUE = TRUE;
exports.FALSE = FALSE;
exports.VOID = VOID;
exports.memoizeOne = memoizeOne;
var _array = require("./array.js");
/**
* @module ol/functions
*/
/**
* Always returns true.
* @returns {boolean} true.
*/
function TRUE() {
return true;
}
/**
* Always returns false.
* @returns {boolean} false.
*/
function FALSE() {
return false;
}
/**
* A reusable function, used e.g. as a default for callbacks.
*
* @return {void} Nothing.
*/
function VOID() {}
/**
* Wrap a function in another function that remembers the last return. If the
* returned function is called twice in a row with the same arguments and the same
* this object, it will return the value from the first call in the second call.
*
* @param {function(...any): ReturnType} fn The function to memoize.
* @return {function(...any): ReturnType} The memoized function.
* @template ReturnType
*/
function memoizeOne(fn) {
var called = false;
/** @type {ReturnType} */
var lastResult;
/** @type {Array<any>} */
var lastArgs;
var lastThis;
return function () {
var nextArgs = Array.prototype.slice.call(arguments);
if (!called || this !== lastThis || !(0, _array.equals)(nextArgs, lastArgs)) {
called = true;
lastThis = this;
lastArgs = nextArgs;
lastResult = fn.apply(this, arguments);
}
return lastResult;
};
}
},{"./array.js":"node_modules/ol/array.js"}],"node_modules/ol/events/Event.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stopPropagation = stopPropagation;
exports.preventDefault = preventDefault;
exports.default = void 0;
/**
* @module ol/events/Event
*/
/**
* @classdesc
* Stripped down implementation of the W3C DOM Level 2 Event interface.
* See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.
*
* This implementation only provides `type` and `target` properties, and
* `stopPropagation` and `preventDefault` methods. It is meant as base class
* for higher level events defined in the library, and works with
* {@link module:ol/events/Target~Target}.
*/
var BaseEvent =
/** @class */
function () {
/**
* @param {string} type Type.
*/
function BaseEvent(type) {
/**
* @type {boolean}
*/
this.propagationStopped;
/**
* The event type.
* @type {string}
* @api
*/
this.type = type;
/**
* The event target.
* @type {Object}
* @api
*/
this.target = null;
}
/**
* Stop event propagation.
* @api
*/
BaseEvent.prototype.preventDefault = function () {
this.propagationStopped = true;
};
/**
* Stop event propagation.
* @api
*/
BaseEvent.prototype.stopPropagation = function () {
this.propagationStopped = true;
};
return BaseEvent;
}();
/**
* @param {Event|import("./Event.js").default} evt Event
*/
function stopPropagation(evt) {
evt.stopPropagation();
}
/**
* @param {Event|import("./Event.js").default} evt Event
*/
function preventDefault(evt) {
evt.preventDefault();
}
var _default = BaseEvent;
exports.default = _default;
},{}],"node_modules/ol/events/Target.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _Disposable = _interopRequireDefault(require("../Disposable.js"));
var _functions = require("../functions.js");
var _Event = _interopRequireDefault(require("./Event.js"));
var _obj = require("../obj.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/events/Target
*/
/**
* @typedef {EventTarget|Target} EventTargetLike
*/
/**
* @classdesc
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
* See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.
*
* There are two important simplifications compared to the specification:
*
* 1. The handling of `useCapture` in `addEventListener` and
* `removeEventListener`. There is no real capture model.
* 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.
* There is no event target hierarchy. When a listener calls
* `stopPropagation` or `preventDefault` on an event object, it means that no
* more listeners after this one will be called. Same as when the listener
* returns false.
*/
var Target =
/** @class */
function (_super) {
__extends(Target, _super);
/**
* @param {*=} opt_target Default event target for dispatched events.
*/
function Target(opt_target) {
var _this = _super.call(this) || this;
/**
* @private
* @type {*}
*/
_this.eventTarget_ = opt_target;
/**
* @private
* @type {!Object<string, number>}
*/
_this.pendingRemovals_ = {};
/**
* @private
* @type {!Object<string, number>}
*/
_this.dispatching_ = {};
/**
* @private
* @type {!Object<string, Array<import("../events.js").Listener>>}
*/
_this.listeners_ = {};
return _this;
}
/**
* @param {string} type Type.
* @param {import("../events.js").Listener} listener Listener.
*/
Target.prototype.addEventListener = function (type, listener) {
if (!type || !listener) {
return;
}
var listeners = this.listeners_[type];
if (!listeners) {
listeners = [];
this.listeners_[type] = listeners;
}
if (listeners.indexOf(listener) === -1) {
listeners.push(listener);
}
};
/**
* Dispatches an event and calls all listeners listening for events
* of this type. The event parameter can either be a string or an
* Object with a `type` property.
*
* @param {import("./Event.js").default|string} event Event object.
* @return {boolean|undefined} `false` if anyone called preventDefault on the
* event object or if any of the listeners returned false.
* @api
*/
Target.prototype.dispatchEvent = function (event) {
/** @type {import("./Event.js").default|Event} */
var evt = typeof event === 'string' ? new _Event.default(event) : event;
var type = evt.type;
if (!evt.target) {
evt.target = this.eventTarget_ || this;
}
var listeners = this.listeners_[type];
var propagate;
if (listeners) {
if (!(type in this.dispatching_)) {
this.dispatching_[type] = 0;
this.pendingRemovals_[type] = 0;
}
++this.dispatching_[type];
for (var i = 0, ii = listeners.length; i < ii; ++i) {
if ('handleEvent' in listeners[i]) {
propagate =
/** @type {import("../events.js").ListenerObject} */
listeners[i].handleEvent(evt);
} else {
propagate =
/** @type {import("../events.js").ListenerFunction} */
listeners[i].call(this, evt);
}
if (propagate === false || evt.propagationStopped) {
propagate = false;
break;
}
}
--this.dispatching_[type];
if (this.dispatching_[type] === 0) {
var pendingRemovals = this.pendingRemovals_[type];
delete this.pendingRemovals_[type];
while (pendingRemovals--) {
this.removeEventListener(type, _functions.VOID);
}
delete this.dispatching_[type];
}
return propagate;
}
};
/**
* @inheritDoc
*/
Target.prototype.disposeInternal = function () {
(0, _obj.clear)(this.listeners_);
};
/**
* Get the listeners for a specified event type. Listeners are returned in the
* order that they will be called in.
*
* @param {string} type Type.
* @return {Array<import("../events.js").Listener>} Listeners.
*/
Target.prototype.getListeners = function (type) {
return this.listeners_[type];
};
/**
* @param {string=} opt_type Type. If not provided,
* `true` will be returned if this event target has any listeners.
* @return {boolean} Has listeners.
*/
Target.prototype.hasListener = function (opt_type) {
return opt_type ? opt_type in this.listeners_ : Object.keys(this.listeners_).length > 0;
};
/**
* @param {string} type Type.
* @param {import("../events.js").Listener} listener Listener.
*/
Target.prototype.removeEventListener = function (type, listener) {
var listeners = this.listeners_[type];
if (listeners) {
var index = listeners.indexOf(listener);
if (index !== -1) {
if (type in this.pendingRemovals_) {
// make listener a no-op, and remove later in #dispatchEvent()
listeners[index] = _functions.VOID;
++this.pendingRemovals_[type];
} else {
listeners.splice(index, 1);
if (listeners.length === 0) {
delete this.listeners_[type];
}
}
}
}
};
return Target;
}(_Disposable.default);
var _default = Target;
exports.default = _default;
},{"../Disposable.js":"node_modules/ol/Disposable.js","../functions.js":"node_modules/ol/functions.js","./Event.js":"node_modules/ol/events/Event.js","../obj.js":"node_modules/ol/obj.js"}],"node_modules/ol/events/EventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/events/EventType
*/
/**
* @enum {string}
* @const
*/
var _default = {
/**
* Generic change event. Triggered when the revision counter is increased.
* @event module:ol/events/Event~BaseEvent#change
* @api
*/
CHANGE: 'change',
/**
* Generic error event. Triggered when an error occurs.
* @event module:ol/events/Event~BaseEvent#error
* @api
*/
ERROR: 'error',
BLUR: 'blur',
CLEAR: 'clear',
CONTEXTMENU: 'contextmenu',
CLICK: 'click',
DBLCLICK: 'dblclick',
DRAGENTER: 'dragenter',
DRAGOVER: 'dragover',
DROP: 'drop',
FOCUS: 'focus',
KEYDOWN: 'keydown',
KEYPRESS: 'keypress',
LOAD: 'load',
RESIZE: 'resize',
TOUCHMOVE: 'touchmove',
WHEEL: 'wheel'
};
exports.default = _default;
},{}],"node_modules/ol/Observable.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unByKey = unByKey;
exports.default = void 0;
var _events = require("./events.js");
var _Target = _interopRequireDefault(require("./events/Target.js"));
var _EventType = _interopRequireDefault(require("./events/EventType.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/Observable
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* An event target providing convenient methods for listener registration
* and unregistration. A generic `change` event is always available through
* {@link module:ol/Observable~Observable#changed}.
*
* @fires import("./events/Event.js").default
* @api
*/
var Observable =
/** @class */
function (_super) {
__extends(Observable, _super);
function Observable() {
var _this = _super.call(this) || this;
/**
* @private
* @type {number}
*/
_this.revision_ = 0;
return _this;
}
/**
* Increases the revision counter and dispatches a 'change' event.
* @api
*/
Observable.prototype.changed = function () {
++this.revision_;
this.dispatchEvent(_EventType.default.CHANGE);
};
/**
* Get the version number for this object. Each time the object is modified,
* its version number will be incremented.
* @return {number} Revision.
* @api
*/
Observable.prototype.getRevision = function () {
return this.revision_;
};
/**
* Listen for a certain type of event.
* @param {string|Array<string>} type The event type or array of event types.
* @param {import("./events.js").ListenerFunction} listener The listener function.
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
* called with an array of event types as the first argument, the return
* will be an array of keys.
* @api
*/
Observable.prototype.on = function (type, listener) {
if (Array.isArray(type)) {
var len = type.length;
var keys = new Array(len);
for (var i = 0; i < len; ++i) {
keys[i] = (0, _events.listen)(this, type[i], listener);
}
return keys;
} else {
return (0, _events.listen)(this,
/** @type {string} */
type, listener);
}
};
/**
* Listen once for a certain type of event.
* @param {string|Array<string>} type The event type or array of event types.
* @param {function(?): ?} listener The listener function.
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
* called with an array of event types as the first argument, the return
* will be an array of keys.
* @api
*/
Observable.prototype.once = function (type, listener) {
if (Array.isArray(type)) {
var len = type.length;
var keys = new Array(len);
for (var i = 0; i < len; ++i) {
keys[i] = (0, _events.listenOnce)(this, type[i], listener);
}
return keys;
} else {
return (0, _events.listenOnce)(this,
/** @type {string} */
type, listener);
}
};
/**
* Unlisten for a certain type of event.
* @param {string|Array<string>} type The event type or array of event types.
* @param {function(?): ?} listener The listener function.
* @api
*/
Observable.prototype.un = function (type, listener) {
if (Array.isArray(type)) {
for (var i = 0, ii = type.length; i < ii; ++i) {
this.removeEventListener(type[i], listener);
}
} else {
this.removeEventListener(type, listener);
}
};
return Observable;
}(_Target.default);
/**
* Removes an event listener using the key returned by `on()` or `once()`.
* @param {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} key The key returned by `on()`
* or `once()` (or an array of keys).
* @api
*/
function unByKey(key) {
if (Array.isArray(key)) {
for (var i = 0, ii = key.length; i < ii; ++i) {
(0, _events.unlistenByKey)(key[i]);
}
} else {
(0, _events.unlistenByKey)(
/** @type {import("./events.js").EventsKey} */
key);
}
}
var _default = Observable;
exports.default = _default;
},{"./events.js":"node_modules/ol/events.js","./events/Target.js":"node_modules/ol/events/Target.js","./events/EventType.js":"node_modules/ol/events/EventType.js"}],"node_modules/ol/Object.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getChangeEventType = getChangeEventType;
exports.default = exports.ObjectEvent = void 0;
var _util = require("./util.js");
var _ObjectEventType = _interopRequireDefault(require("./ObjectEventType.js"));
var _Observable = _interopRequireDefault(require("./Observable.js"));
var _Event = _interopRequireDefault(require("./events/Event.js"));
var _obj = require("./obj.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/Object
*/
/**
* @classdesc
* Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.
*/
var ObjectEvent =
/** @class */
function (_super) {
__extends(ObjectEvent, _super);
/**
* @param {string} type The event type.
* @param {string} key The property name.
* @param {*} oldValue The old value for `key`.
*/
function ObjectEvent(type, key, oldValue) {
var _this = _super.call(this, type) || this;
/**
* The name of the property whose value is changing.
* @type {string}
* @api
*/
_this.key = key;
/**
* The old value. To get the new value use `e.target.get(e.key)` where
* `e` is the event object.
* @type {*}
* @api
*/
_this.oldValue = oldValue;
return _this;
}
return ObjectEvent;
}(_Event.default);
exports.ObjectEvent = ObjectEvent;
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Most non-trivial classes inherit from this.
*
* This extends {@link module:ol/Observable} with observable
* properties, where each property is observable as well as the object as a
* whole.
*
* Classes that inherit from this have pre-defined properties, to which you can
* add your owns. The pre-defined properties are listed in this documentation as
* 'Observable Properties', and have their own accessors; for example,
* {@link module:ol/Map~Map} has a `target` property, accessed with
* `getTarget()` and changed with `setTarget()`. Not all properties are however
* settable. There are also general-purpose accessors `get()` and `set()`. For
* example, `get('target')` is equivalent to `getTarget()`.
*
* The `set` accessors trigger a change event, and you can monitor this by
* registering a listener. For example, {@link module:ol/View~View} has a
* `center` property, so `view.on('change:center', function(evt) {...});` would
* call the function whenever the value of the center property changes. Within
* the function, `evt.target` would be the view, so `evt.target.getCenter()`
* would return the new center.
*
* You can add your own observable properties with
* `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.
* You can listen for changes on that property value with
* `object.on('change:prop', listener)`. You can get a list of all
* properties with {@link module:ol/Object~BaseObject#getProperties}.
*
* Note that the observable properties are separate from standard JS properties.
* You can, for example, give your map object a title with
* `map.title='New title'` and with `map.set('title', 'Another title')`. The
* first will be a `hasOwnProperty`; the second will appear in
* `getProperties()`. Only the second is observable.
*
* Properties can be deleted by using the unset method. E.g.
* object.unset('foo').
*
* @fires ObjectEvent
* @api
*/
var BaseObject =
/** @class */
function (_super) {
__extends(BaseObject, _super);
/**
* @param {Object<string, *>=} opt_values An object with key-value pairs.
*/
function BaseObject(opt_values) {
var _this = _super.call(this) || this; // Call {@link module:ol/util~getUid} to ensure that the order of objects' ids is
// the same as the order in which they were created. This also helps to
// ensure that object properties are always added in the same order, which
// helps many JavaScript engines generate faster code.
(0, _util.getUid)(_this);
/**
* @private
* @type {!Object<string, *>}
*/
_this.values_ = {};
if (opt_values !== undefined) {
_this.setProperties(opt_values);
}
return _this;
}
/**
* Gets a value.
* @param {string} key Key name.
* @return {*} Value.
* @api
*/
BaseObject.prototype.get = function (key) {
var value;
if (this.values_.hasOwnProperty(key)) {
value = this.values_[key];
}
return value;
};
/**
* Get a list of object property names.
* @return {Array<string>} List of property names.
* @api
*/
BaseObject.prototype.getKeys = function () {
return Object.keys(this.values_);
};
/**
* Get an object of all property names and values.
* @return {Object<string, *>} Object.
* @api
*/
BaseObject.prototype.getProperties = function () {
return (0, _obj.assign)({}, this.values_);
};
/**
* @param {string} key Key name.
* @param {*} oldValue Old value.
*/
BaseObject.prototype.notify = function (key, oldValue) {
var eventType;
eventType = getChangeEventType(key);
this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
eventType = _ObjectEventType.default.PROPERTYCHANGE;
this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
};
/**
* Sets a value.
* @param {string} key Key name.
* @param {*} value Value.
* @param {boolean=} opt_silent Update without triggering an event.
* @api
*/
BaseObject.prototype.set = function (key, value, opt_silent) {
if (opt_silent) {
this.values_[key] = value;
} else {
var oldValue = this.values_[key];
this.values_[key] = value;
if (oldValue !== value) {
this.notify(key, oldValue);
}
}
};
/**
* Sets a collection of key-value pairs. Note that this changes any existing
* properties and adds new ones (it does not remove any existing properties).
* @param {Object<string, *>} values Values.
* @param {boolean=} opt_silent Update without triggering an event.
* @api
*/
BaseObject.prototype.setProperties = function (values, opt_silent) {
for (var key in values) {
this.set(key, values[key], opt_silent);
}
};
/**
* Unsets a property.
* @param {string} key Key name.
* @param {boolean=} opt_silent Unset without triggering an event.
* @api
*/
BaseObject.prototype.unset = function (key, opt_silent) {
if (key in this.values_) {
var oldValue = this.values_[key];
delete this.values_[key];
if (!opt_silent) {
this.notify(key, oldValue);
}
}
};
return BaseObject;
}(_Observable.default);
/**
* @type {Object<string, string>}
*/
var changeEventTypeCache = {};
/**
* @param {string} key Key name.
* @return {string} Change name.
*/
function getChangeEventType(key) {
return changeEventTypeCache.hasOwnProperty(key) ? changeEventTypeCache[key] : changeEventTypeCache[key] = 'change:' + key;
}
var _default = BaseObject;
exports.default = _default;
},{"./util.js":"node_modules/ol/util.js","./ObjectEventType.js":"node_modules/ol/ObjectEventType.js","./Observable.js":"node_modules/ol/Observable.js","./events/Event.js":"node_modules/ol/events/Event.js","./obj.js":"node_modules/ol/obj.js"}],"node_modules/ol/Collection.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CollectionEvent = void 0;
var _AssertionError = _interopRequireDefault(require("./AssertionError.js"));
var _CollectionEventType = _interopRequireDefault(require("./CollectionEventType.js"));
var _Object = _interopRequireDefault(require("./Object.js"));
var _Event = _interopRequireDefault(require("./events/Event.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/Collection
*/
/**
* @enum {string}
* @private
*/
var Property = {
LENGTH: 'length'
};
/**
* @classdesc
* Events emitted by {@link module:ol/Collection~Collection} instances are instances of this
* type.
*/
var CollectionEvent =
/** @class */
function (_super) {
__extends(CollectionEvent, _super);
/**
* @param {CollectionEventType} type Type.
* @param {*=} opt_element Element.
* @param {number=} opt_index The index of the added or removed element.
*/
function CollectionEvent(type, opt_element, opt_index) {
var _this = _super.call(this, type) || this;
/**
* The element that is added to or removed from the collection.
* @type {*}
* @api
*/
_this.element = opt_element;
/**
* The index of the added or removed element.
* @type {number}
* @api
*/
_this.index = opt_index;
return _this;
}
return CollectionEvent;
}(_Event.default);
exports.CollectionEvent = CollectionEvent;
/**
* @typedef {Object} Options
* @property {boolean} [unique=false] Disallow the same item from being added to
* the collection twice.
*/
/**
* @classdesc
* An expanded version of standard JS Array, adding convenience methods for
* manipulation. Add and remove changes to the Collection trigger a Collection
* event. Note that this does not cover changes to the objects _within_ the
* Collection; they trigger events on the appropriate object, not on the
* Collection as a whole.
*
* @fires CollectionEvent
*
* @template T
* @api
*/
var Collection =
/** @class */
function (_super) {
__extends(Collection, _super);
/**
* @param {Array<T>=} opt_array Array.
* @param {Options=} opt_options Collection options.
*/
function Collection(opt_array, opt_options) {
var _this = _super.call(this) || this;
var options = opt_options || {};
/**
* @private
* @type {boolean}
*/
_this.unique_ = !!options.unique;
/**
* @private
* @type {!Array<T>}
*/
_this.array_ = opt_array ? opt_array : [];
if (_this.unique_) {
for (var i = 0, ii = _this.array_.length; i < ii; ++i) {
_this.assertUnique_(_this.array_[i], i);
}
}
_this.updateLength_();
return _this;
}
/**
* Remove all elements from the collection.
* @api
*/
Collection.prototype.clear = function () {
while (this.getLength() > 0) {
this.pop();
}
};
/**
* Add elements to the collection. This pushes each item in the provided array
* to the end of the collection.
* @param {!Array<T>} arr Array.
* @return {Collection<T>} This collection.
* @api
*/
Collection.prototype.extend = function (arr) {
for (var i = 0, ii = arr.length; i < ii; ++i) {
this.push(arr[i]);
}
return this;
};
/**
* Iterate over each element, calling the provided callback.
* @param {function(T, number, Array<T>): *} f The function to call
* for every element. This function takes 3 arguments (the element, the
* index and the array). The return value is ignored.
* @api
*/
Collection.prototype.forEach = function (f) {
var array = this.array_;
for (var i = 0, ii = array.length; i < ii; ++i) {
f(array[i], i, array);
}
};
/**
* Get a reference to the underlying Array object. Warning: if the array
* is mutated, no events will be dispatched by the collection, and the
* collection's "length" property won't be in sync with the actual length
* of the array.
* @return {!Array<T>} Array.
* @api
*/
Collection.prototype.getArray = function () {
return this.array_;
};
/**
* Get the element at the provided index.
* @param {number} index Index.
* @return {T} Element.
* @api
*/
Collection.prototype.item = function (index) {
return this.array_[index];
};
/**
* Get the length of this collection.
* @return {number} The length of the array.
* @observable
* @api
*/
Collection.prototype.getLength = function () {
return this.get(Property.LENGTH);
};
/**
* Insert an element at the provided index.
* @param {number} index Index.
* @param {T} elem Element.
* @api
*/
Collection.prototype.insertAt = function (index, elem) {
if (this.unique_) {
this.assertUnique_(elem);
}
this.array_.splice(index, 0, elem);
this.updateLength_();
this.dispatchEvent(new CollectionEvent(_CollectionEventType.default.ADD, elem, index));
};
/**
* Remove the last element of the collection and return it.
* Return `undefined` if the collection is empty.
* @return {T|undefined} Element.
* @api
*/
Collection.prototype.pop = function () {
return this.removeAt(this.getLength() - 1);
};
/**
* Insert the provided element at the end of the collection.
* @param {T} elem Element.
* @return {number} New length of the collection.
* @api
*/
Collection.prototype.push = function (elem) {
if (this.unique_) {
this.assertUnique_(elem);
}
var n = this.getLength();
this.insertAt(n, elem);
return this.getLength();
};
/**
* Remove the first occurrence of an element from the collection.
* @param {T} elem Element.
* @return {T|undefined} The removed element or undefined if none found.
* @api
*/
Collection.prototype.remove = function (elem) {
var arr = this.array_;
for (var i = 0, ii = arr.length; i < ii; ++i) {
if (arr[i] === elem) {
return this.removeAt(i);
}
}
return undefined;
};
/**
* Remove the element at the provided index and return it.
* Return `undefined` if the collection does not contain this index.
* @param {number} index Index.
* @return {T|undefined} Value.
* @api
*/
Collection.prototype.removeAt = function (index) {
var prev = this.array_[index];
this.array_.splice(index, 1);
this.updateLength_();
this.dispatchEvent(new CollectionEvent(_CollectionEventType.default.REMOVE, prev, index));
return prev;
};
/**
* Set the element at the provided index.
* @param {number} index Index.
* @param {T} elem Element.
* @api
*/
Collection.prototype.setAt = function (index, elem) {
var n = this.getLength();
if (index < n) {
if (this.unique_) {
this.assertUnique_(elem, index);
}
var prev = this.array_[index];
this.array_[index] = elem;
this.dispatchEvent(new CollectionEvent(_CollectionEventType.default.REMOVE, prev, index));
this.dispatchEvent(new CollectionEvent(_CollectionEventType.default.ADD, elem, index));
} else {
for (var j = n; j < index; ++j) {
this.insertAt(j, undefined);
}
this.insertAt(index, elem);
}
};
/**
* @private
*/
Collection.prototype.updateLength_ = function () {
this.set(Property.LENGTH, this.array_.length);
};
/**
* @private
* @param {T} elem Element.
* @param {number=} opt_except Optional index to ignore.
*/
Collection.prototype.assertUnique_ = function (elem, opt_except) {
for (var i = 0, ii = this.array_.length; i < ii; ++i) {
if (this.array_[i] === elem && i !== opt_except) {
throw new _AssertionError.default(58);
}
}
};
return Collection;
}(_Object.default);
var _default = Collection;
exports.default = _default;
},{"./AssertionError.js":"node_modules/ol/AssertionError.js","./CollectionEventType.js":"node_modules/ol/CollectionEventType.js","./Object.js":"node_modules/ol/Object.js","./events/Event.js":"node_modules/ol/events/Event.js"}],"node_modules/ol/MapEvent.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _Event = _interopRequireDefault(require("./events/Event.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/MapEvent
*/
/**
* @classdesc
* Events emitted as map events are instances of this type.
* See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map event.
*/
var MapEvent =
/** @class */
function (_super) {
__extends(MapEvent, _super);
/**
* @param {string} type Event type.
* @param {import("./PluggableMap.js").default} map Map.
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
*/
function MapEvent(type, map, opt_frameState) {
var _this = _super.call(this, type) || this;
/**
* The map where the event occurred.
* @type {import("./PluggableMap.js").default}
* @api
*/
_this.map = map;
/**
* The frame state at the time of the event.
* @type {?import("./PluggableMap.js").FrameState}
* @api
*/
_this.frameState = opt_frameState !== undefined ? opt_frameState : null;
return _this;
}
return MapEvent;
}(_Event.default);
var _default = MapEvent;
exports.default = _default;
},{"./events/Event.js":"node_modules/ol/events/Event.js"}],"node_modules/ol/MapBrowserEvent.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _MapEvent = _interopRequireDefault(require("./MapEvent.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/MapBrowserEvent
*/
/**
* @classdesc
* Events emitted as map browser events are instances of this type.
* See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map browser event.
*/
var MapBrowserEvent =
/** @class */
function (_super) {
__extends(MapBrowserEvent, _super);
/**
* @param {string} type Event type.
* @param {import("./PluggableMap.js").default} map Map.
* @param {Event} browserEvent Browser event.
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
*/
function MapBrowserEvent(type, map, browserEvent, opt_dragging, opt_frameState) {
var _this = _super.call(this, type, map, opt_frameState) || this;
/**
* The original browser event.
* @const
* @type {Event}
* @api
*/
_this.originalEvent = browserEvent;
/**
* The map pixel relative to the viewport corresponding to the original browser event.
* @type {?import("./pixel.js").Pixel}
*/
_this.pixel_ = null;
/**
* The coordinate in the user projection corresponding to the original browser event.
* @type {?import("./coordinate.js").Coordinate}
*/
_this.coordinate_ = null;
/**
* Indicates if the map is currently being dragged. Only set for
* `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.
*
* @type {boolean}
* @api
*/
_this.dragging = opt_dragging !== undefined ? opt_dragging : false;
return _this;
}
Object.defineProperty(MapBrowserEvent.prototype, "pixel", {
/**
* The map pixel relative to the viewport corresponding to the original browser event.
* @type {import("./pixel.js").Pixel}
* @api
*/
get: function () {
if (!this.pixel_) {
this.pixel_ = this.map.getEventPixel(this.originalEvent);
}
return this.pixel_;
},
set: function (pixel) {
this.pixel_ = pixel;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MapBrowserEvent.prototype, "coordinate", {
/**
* The coordinate corresponding to the original browser event. This will be in the user
* projection if one is set. Otherwise it will be in the view projection.
* @type {import("./coordinate.js").Coordinate}
* @api
*/
get: function () {
if (!this.coordinate_) {
this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel);
}
return this.coordinate_;
},
set: function (coordinate) {
this.coordinate_ = coordinate;
},
enumerable: true,
configurable: true
});
/**
* Prevents the default browser action.
* See https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault.
* @override
* @api
*/
MapBrowserEvent.prototype.preventDefault = function () {
_super.prototype.preventDefault.call(this);
this.originalEvent.preventDefault();
};
/**
* Prevents further propagation of the current event.
* See https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation.
* @override
* @api
*/
MapBrowserEvent.prototype.stopPropagation = function () {
_super.prototype.stopPropagation.call(this);
this.originalEvent.stopPropagation();
};
return MapBrowserEvent;
}(_MapEvent.default);
var _default = MapBrowserEvent;
exports.default = _default;
},{"./MapEvent.js":"node_modules/ol/MapEvent.js"}],"node_modules/elm-pep/dist/elm-pep.js":[function(require,module,exports) {
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
// Variable to hold current primary touch event identifier.
// iOS needs this since it does not attribute
// identifier 0 to primary touch event.
var primaryTouchId = null;
// Variable to hold mouse pointer captures.
var mouseCaptureTarget = null;
if (!("PointerEvent" in window)) {
// Define {set,release}PointerCapture
definePointerCapture();
// Create Pointer polyfill from mouse events only on non-touch device
if (!("TouchEvent" in window)) {
addMouseToPointerListener(document, "mousedown", "pointerdown");
addMouseToPointerListener(document, "mousemove", "pointermove");
addMouseToPointerListener(document, "mouseup", "pointerup");
}
// Define Pointer polyfill from touch events
addTouchToPointerListener(document, "touchstart", "pointerdown");
addTouchToPointerListener(document, "touchmove", "pointermove");
addTouchToPointerListener(document, "touchend", "pointerup");
}
// Function defining {set,release}PointerCapture from {set,releas}Capture
function definePointerCapture() {
Element.prototype.setPointerCapture = Element.prototype.setCapture;
Element.prototype.releasePointerCapture = Element.prototype.releaseCapture;
}
// Function converting a Mouse event to a Pointer event.
function addMouseToPointerListener(target, mouseType, pointerType) {
target.addEventListener(mouseType, function (mouseEvent) {
var pointerEvent = new MouseEvent(pointerType, mouseEvent);
pointerEvent.pointerId = 1;
pointerEvent.isPrimary = true;
pointerEvent.pointerType = "mouse";
pointerEvent.width = 1;
pointerEvent.height = 1;
pointerEvent.tiltX = 0;
pointerEvent.tiltY = 0;
// pressure is 0.5 if a button is holded
"buttons" in mouseEvent && mouseEvent.buttons !== 0
? (pointerEvent.pressure = 0.5)
: (pointerEvent.pressure = 0);
// if already capturing mouse event, transfer target
// and don't forget implicit release on mouseup.
var target = mouseEvent.target;
if (mouseCaptureTarget !== null) {
target = mouseCaptureTarget;
if (mouseType === "mouseup") {
mouseCaptureTarget = null;
}
}
target.dispatchEvent(pointerEvent);
if (pointerEvent.defaultPrevented) {
mouseEvent.preventDefault();
}
});
}
// Function converting a Touch event to a Pointer event.
function addTouchToPointerListener(target, touchType, pointerType) {
target.addEventListener(touchType, function (touchEvent) {
var changedTouches = touchEvent.changedTouches;
var nbTouches = changedTouches.length;
for (var t = 0; t < nbTouches; t++) {
var pointerEvent = new CustomEvent(pointerType, {
bubbles: true,
cancelable: true
});
pointerEvent.ctrlKey = touchEvent.ctrlKey;
pointerEvent.shiftKey = touchEvent.shiftKey;
pointerEvent.altKey = touchEvent.altKey;
pointerEvent.metaKey = touchEvent.metaKey;
var touch = changedTouches.item(t);
pointerEvent.clientX = touch.clientX;
pointerEvent.clientY = touch.clientY;
pointerEvent.screenX = touch.screenX;
pointerEvent.screenY = touch.screenY;
pointerEvent.pageX = touch.pageX;
pointerEvent.pageY = touch.pageY;
var rect = touch.target.getBoundingClientRect();
pointerEvent.offsetX = touch.clientX - rect.left;
pointerEvent.offsetY = touch.clientY - rect.top;
pointerEvent.pointerId = 1 + touch.identifier;
// Default values for standard MouseEvent fields.
pointerEvent.button = 0;
pointerEvent.buttons = 1;
pointerEvent.movementX = 0;
pointerEvent.movementY = 0;
pointerEvent.region = null;
pointerEvent.relatedTarget = null;
pointerEvent.x = pointerEvent.clientX;
pointerEvent.y = pointerEvent.clientY;
// Pointer event details
pointerEvent.pointerType = "touch";
pointerEvent.width = 1;
pointerEvent.height = 1;
pointerEvent.tiltX = 0;
pointerEvent.tiltY = 0;
pointerEvent.pressure = 1;
// First touch is the primary pointer event.
if (touchType === "touchstart" && primaryTouchId === null) {
primaryTouchId = touch.identifier;
}
pointerEvent.isPrimary = touch.identifier === primaryTouchId;
// If first touch ends, reset primary touch id.
if (touchType === "touchend" && pointerEvent.isPrimary) {
primaryTouchId = null;
}
touchEvent.target.dispatchEvent(pointerEvent);
if (pointerEvent.defaultPrevented) {
touchEvent.preventDefault();
}
}
});
}
},{}],"node_modules/ol/has.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PASSIVE_EVENT_LISTENERS = exports.IMAGE_DECODE = exports.WORKER_OFFSCREEN_CANVAS = exports.DEVICE_PIXEL_RATIO = exports.MAC = exports.WEBKIT = exports.SAFARI = exports.FIREFOX = void 0;
/**
* @module ol/has
*/
var ua = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase() : '';
/**
* User agent string says we are dealing with Firefox as browser.
* @type {boolean}
*/
var FIREFOX = ua.indexOf('firefox') !== -1;
/**
* User agent string says we are dealing with Safari as browser.
* @type {boolean}
*/
exports.FIREFOX = FIREFOX;
var SAFARI = ua.indexOf('safari') !== -1 && ua.indexOf('chrom') == -1;
/**
* User agent string says we are dealing with a WebKit engine.
* @type {boolean}
*/
exports.SAFARI = SAFARI;
var WEBKIT = ua.indexOf('webkit') !== -1 && ua.indexOf('edge') == -1;
/**
* User agent string says we are dealing with a Mac as platform.
* @type {boolean}
*/
exports.WEBKIT = WEBKIT;
var MAC = ua.indexOf('macintosh') !== -1;
/**
* The ratio between physical pixels and device-independent pixels
* (dips) on the device (`window.devicePixelRatio`).
* @const
* @type {number}
* @api
*/
exports.MAC = MAC;
var DEVICE_PIXEL_RATIO = typeof devicePixelRatio !== 'undefined' ? devicePixelRatio : 1;
/**
* The execution context is a worker with OffscreenCanvas available.
* @const
* @type {boolean}
*/
exports.DEVICE_PIXEL_RATIO = DEVICE_PIXEL_RATIO;
var WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope !== 'undefined' && typeof OffscreenCanvas !== 'undefined' && self instanceof WorkerGlobalScope; //eslint-disable-line
/**
* Image.prototype.decode() is supported.
* @type {boolean}
*/
exports.WORKER_OFFSCREEN_CANVAS = WORKER_OFFSCREEN_CANVAS;
var IMAGE_DECODE = typeof Image !== 'undefined' && Image.prototype.decode;
/**
* @type {boolean}
*/
exports.IMAGE_DECODE = IMAGE_DECODE;
var PASSIVE_EVENT_LISTENERS = function () {
var passive = false;
try {
var options = Object.defineProperty({}, 'passive', {
get: function () {
passive = true;
}
});
window.addEventListener('_', null, options);
window.removeEventListener('_', null, options);
} catch (error) {// passive not supported
}
return passive;
}();
exports.PASSIVE_EVENT_LISTENERS = PASSIVE_EVENT_LISTENERS;
},{}],"node_modules/ol/MapBrowserEventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _EventType = _interopRequireDefault(require("./events/EventType.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @module ol/MapBrowserEventType
*/
/**
* Constants for event names.
* @enum {string}
*/
var _default = {
/**
* A true single click with no dragging and no double click. Note that this
* event is delayed by 250 ms to ensure that it is not a double click.
* @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick
* @api
*/
SINGLECLICK: 'singleclick',
/**
* A click with no dragging. A double click will fire two of this.
* @event module:ol/MapBrowserEvent~MapBrowserEvent#click
* @api
*/
CLICK: _EventType.default.CLICK,
/**
* A true double click, with no dragging.
* @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick
* @api
*/
DBLCLICK: _EventType.default.DBLCLICK,
/**
* Triggered when a pointer is dragged.
* @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag
* @api
*/
POINTERDRAG: 'pointerdrag',
/**
* Triggered when a pointer is moved. Note that on touch devices this is
* triggered when the map is panned, so is not the same as mousemove.
* @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove
* @api
*/
POINTERMOVE: 'pointermove',
POINTERDOWN: 'pointerdown',
POINTERUP: 'pointerup',
POINTEROVER: 'pointerover',
POINTEROUT: 'pointerout',
POINTERENTER: 'pointerenter',
POINTERLEAVE: 'pointerleave',
POINTERCANCEL: 'pointercancel'
};
exports.default = _default;
},{"./events/EventType.js":"node_modules/ol/events/EventType.js"}],"node_modules/ol/MapBrowserPointerEvent.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _MapBrowserEvent = _interopRequireDefault(require("./MapBrowserEvent.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/MapBrowserPointerEvent
*/
var MapBrowserPointerEvent =
/** @class */
function (_super) {
__extends(MapBrowserPointerEvent, _super);
/**
* @param {string} type Event type.
* @param {import("./PluggableMap.js").default} map Map.
* @param {PointerEvent} pointerEvent Pointer event.
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
*/
function MapBrowserPointerEvent(type, map, pointerEvent, opt_dragging, opt_frameState) {
var _this = _super.call(this, type, map, pointerEvent, opt_dragging, opt_frameState) || this;
/**
* @const
* @type {PointerEvent}
*/
_this.pointerEvent = pointerEvent;
return _this;
}
return MapBrowserPointerEvent;
}(_MapBrowserEvent.default);
var _default = MapBrowserPointerEvent;
exports.default = _default;
},{"./MapBrowserEvent.js":"node_modules/ol/MapBrowserEvent.js"}],"node_modules/ol/pointer/EventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/pointer/EventType
*/
/**
* Constants for event names.
* @enum {string}
*/
var _default = {
POINTERMOVE: 'pointermove',
POINTERDOWN: 'pointerdown',
POINTERUP: 'pointerup',
POINTEROVER: 'pointerover',
POINTEROUT: 'pointerout',
POINTERENTER: 'pointerenter',
POINTERLEAVE: 'pointerleave',
POINTERCANCEL: 'pointercancel'
};
exports.default = _default;
},{}],"node_modules/ol/MapBrowserEventHandler.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("elm-pep");
var _has = require("./has.js");
var _MapBrowserEventType = _interopRequireDefault(require("./MapBrowserEventType.js"));
var _MapBrowserPointerEvent = _interopRequireDefault(require("./MapBrowserPointerEvent.js"));
var _events = require("./events.js");
var _Target = _interopRequireDefault(require("./events/Target.js"));
var _EventType = _interopRequireDefault(require("./pointer/EventType.js"));
var _EventType2 = _interopRequireDefault(require("./events/EventType.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @module ol/MapBrowserEventHandler
*/
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var MapBrowserEventHandler =
/** @class */
function (_super) {
__extends(MapBrowserEventHandler, _super);
/**
* @param {import("./PluggableMap.js").default} map The map with the viewport to listen to events on.
* @param {number=} moveTolerance The minimal distance the pointer must travel to trigger a move.
*/
function MapBrowserEventHandler(map, moveTolerance) {
var _this = _super.call(this, map) || this;
/**
* This is the element that we will listen to the real events on.
* @type {import("./PluggableMap.js").default}
* @private
*/
_this.map_ = map;
/**
* @type {any}
* @private
*/
_this.clickTimeoutId_;
/**
* @type {boolean}
* @private
*/
_this.dragging_ = false;
/**
* @type {!Array<import("./events.js").EventsKey>}
* @private
*/
_this.dragListenerKeys_ = [];
/**
* @type {number}
* @private
*/
_this.moveTolerance_ = moveTolerance ? moveTolerance * _has.DEVICE_PIXEL_RATIO : _has.DEVICE_PIXEL_RATIO;
/**
* The most recent "down" type event (or null if none have occurred).
* Set on pointerdown.
* @type {PointerEvent}
* @private
*/
_this.down_ = null;
var element = _this.map_.getViewport();
/**
* @type {number}
* @private
*/
_this.activePointers_ = 0;
/**
* @type {!Object<number, boolean>}
* @private
*/
_this.trackedTouches_ = {};
_this.element_ = element;
/**
* @type {?import("./events.js").EventsKey}
* @private
*/
_this.pointerdownListenerKey_ = (0, _events.listen)(element, _EventType.default.POINTERDOWN, _this.handlePointerDown_, _this);
/**
* @type {PointerEvent}
* @private
*/
_this.originalPointerMoveEvent_;
/**
* @type {?import("./events.js").EventsKey}
* @private
*/
_this.relayedListenerKey_ = (0, _events.listen)(element, _EventType.default.POINTERMOVE, _this.relayEvent_, _this);
/**
* @private
*/
_this.boundHandleTouchMove_ = _this.handleTouchMove_.bind(_this);
_this.element_.addEventListener(_EventType2.default.TOUCHMOVE, _this.boundHandleTouchMove_, _has.PASSIVE_EVENT_LISTENERS ? {
passive: false
} : false);
return _this;
}
/**
* @param {PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.emulateClick_ = function (pointerEvent) {
var newEvent = new _MapBrowserPointerEvent.default(_MapBrowserEventType.default.CLICK, this.map_, pointerEvent);
this.dispatchEvent(newEvent);
if (this.clickTimeoutId_ !== undefined) {
// double-click
clearTimeout(this.clickTimeoutId_);
this.clickTimeoutId_ = undefined;
newEvent = new _MapBrowserPointerEvent.default(_MapBrowserEventType.default.DBLCLICK, this.map_, pointerEvent);
this.dispatchEvent(newEvent);
} else {
// click
this.clickTimeoutId_ = setTimeout(function () {
this.clickTimeoutId_ = undefined;
var newEvent = new _MapBrowserPointerEvent.default(_MapBrowserEventType.default.SINGLECLICK, this.map_, pointerEvent);
this.dispatchEvent(newEvent);
}.bind(this), 250);
}
};
/**
* Keeps track on how many pointers are currently active.
*
* @param {PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.updateActivePointers_ = function (pointerEvent) {
var event = pointerEvent;
if (event.type == _MapBrowserEventType.default.POINTERUP || event.type == _MapBrowserEventType.default.POINTERCANCEL) {
delete this.trackedTouches_[event.pointerId];
} else if (event.type == _MapBrowserEventType.default.POINTERDOWN) {
this.trackedTouches_[event.pointerId] = true;
}
this.activePointers_ = Object.keys(this.trackedTouches_).length;
};
/**
* @param {PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.handlePointerUp_ = function (pointerEvent) {
this.updateActivePointers_(pointerEvent);
var newEvent = new _MapBrowserPointerEvent.default(_MapBrowserEventType.default.POINTERUP, this.map_, pointerEvent);
this.dispatchEvent(newEvent); // We emulate click events on left mouse button click, touch contact, and pen
// contact. isMouseActionButton returns true in these cases (evt.button is set
// to 0).
// See http://www.w3.org/TR/pointerevents/#button-states
// We only fire click, singleclick, and doubleclick if nobody has called
// event.stopPropagation() or event.preventDefault().
if (!newEvent.propagationStopped && !this.dragging_ && this.isMouseActionButton_(pointerEvent)) {
this.emulateClick_(this.down_);
}
if (this.activePointers_ === 0) {
this.dragListenerKeys_.forEach(_events.unlistenByKey);
this.dragListenerKeys_.length = 0;
this.dragging_ = false;
this.down_ = null;
}
};
/**
* @param {PointerEvent} pointerEvent Pointer
* event.
* @return {boolean} If the left mouse button was pressed.
* @private
*/
MapBrowserEventHandler.prototype.isMouseActionButton_ = function (pointerEvent) {
return pointerEvent.button === 0;
};
/**
* @param {PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.handlePointerDown_ = function (pointerEvent) {
this.updateActivePointers_(pointerEvent);
var newEvent = new _MapBrowserPointerEvent.default(_MapBrowserEventType.default.POINTERDOWN, this.map_, pointerEvent);
this.dispatchEvent(newEvent);
this.down_ = pointerEvent;
if (this.dragListenerKeys_.length === 0) {
this.dragListenerKeys_.push((0, _events.listen)(document, _MapBrowserEventType.default.POINTERMOVE, this.handlePointerMove_, this), (0, _events.listen)(document, _MapBrowserEventType.default.POINTERUP, this.handlePointerUp_, this),
/* Note that the listener for `pointercancel is set up on
* `pointerEventHandler_` and not `documentPointerEventHandler_` like
* the `pointerup` and `pointermove` listeners.
*
* The reason for this is the following: `TouchSource.vacuumTouches_()`
* issues `pointercancel` events, when there was no `touchend` for a
* `touchstart`. Now, let's say a first `touchstart` is registered on
* `pointerEventHandler_`. The `documentPointerEventHandler_` is set up.
* But `documentPointerEventHandler_` doesn't know about the first
* `touchstart`. If there is no `touchend` for the `touchstart`, we can
* only receive a `touchcancel` from `pointerEventHandler_`, because it is
* only registered there.
*/
(0, _events.listen)(this.element_, _MapBrowserEventType.default.POINTERCANCEL, this.handlePointerUp_, this));
}
};
/**
* @param {PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.handlePointerMove_ = function (pointerEvent) {
// Between pointerdown and pointerup, pointermove events are triggered.
// To avoid a 'false' touchmove event to be dispatched, we test if the pointer
// moved a significant distance.
if (this.isMoving_(pointerEvent)) {
this.dragging_ = true;
var newEvent = new _MapBrowserPointerEvent.default(_MapBrowserEventType.default.POINTERDRAG, this.map_, pointerEvent, this.dragging_);
this.dispatchEvent(newEvent);
}
};
/**
* Wrap and relay a pointer event. Note that this requires that the type
* string for the MapBrowserPointerEvent matches the PointerEvent type.
* @param {PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.relayEvent_ = function (pointerEvent) {
this.originalPointerMoveEvent_ = pointerEvent;
var dragging = !!(this.down_ && this.isMoving_(pointerEvent));
this.dispatchEvent(new _MapBrowserPointerEvent.default(pointerEvent.type, this.map_, pointerEvent, dragging));
};
/**
* Flexible handling of a `touch-action: none` css equivalent: because calling
* `preventDefault()` on a `pointermove` event does not stop native page scrolling
* and zooming, we also listen for `touchmove` and call `preventDefault()` on it
* when an interaction (currently `DragPan` handles the event.
* @param {TouchEvent} event Event.
* @private
*/
MapBrowserEventHandler.prototype.handleTouchMove_ = function (event) {
// Due to https://github.com/mpizenberg/elm-pep/issues/2, `this.originalPointerMoveEvent_`
// may not be initialized yet when we get here on a platform without native pointer events.
if (!this.originalPointerMoveEvent_ || this.originalPointerMoveEvent_.defaultPrevented) {
event.preventDefault();
}
};
/**
* @param {PointerEvent} pointerEvent Pointer
* event.
* @return {boolean} Is moving.
* @private
*/
MapBrowserEventHandler.prototype.isMoving_ = function (pointerEvent) {
return this.dragging_ || Math.abs(pointerEvent.clientX - this.down_.clientX) > this.moveTolerance_ || Math.abs(pointerEvent.clientY - this.down_.clientY) > this.moveTolerance_;
};
/**
* @inheritDoc
*/
MapBrowserEventHandler.prototype.disposeInternal = function () {
if (this.relayedListenerKey_) {
(0, _events.unlistenByKey)(this.relayedListenerKey_);
this.relayedListenerKey_ = null;
}
this.element_.removeEventListener(_EventType2.default.TOUCHMOVE, this.boundHandleTouchMove_);
if (this.pointerdownListenerKey_) {
(0, _events.unlistenByKey)(this.pointerdownListenerKey_);
this.pointerdownListenerKey_ = null;
}
this.dragListenerKeys_.forEach(_events.unlistenByKey);
this.dragListenerKeys_.length = 0;
this.element_ = null;
_super.prototype.disposeInternal.call(this);
};
return MapBrowserEventHandler;
}(_Target.default);
var _default = MapBrowserEventHandler;
exports.default = _default;
},{"elm-pep":"node_modules/elm-pep/dist/elm-pep.js","./has.js":"node_modules/ol/has.js","./MapBrowserEventType.js":"node_modules/ol/MapBrowserEventType.js","./MapBrowserPointerEvent.js":"node_modules/ol/MapBrowserPointerEvent.js","./events.js":"node_modules/ol/events.js","./events/Target.js":"node_modules/ol/events/Target.js","./pointer/EventType.js":"node_modules/ol/pointer/EventType.js","./events/EventType.js":"node_modules/ol/events/EventType.js"}],"node_modules/ol/MapEventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/MapEventType
*/
/**
* @enum {string}
*/
var _default = {
/**
* Triggered after a map frame is rendered.
* @event module:ol/MapEvent~MapEvent#postrender
* @api
*/
POSTRENDER: 'postrender',
/**
* Triggered when the map starts moving.
* @event module:ol/MapEvent~MapEvent#movestart
* @api
*/
MOVESTART: 'movestart',
/**
* Triggered after the map is moved.
* @event module:ol/MapEvent~MapEvent#moveend
* @api
*/
MOVEEND: 'moveend'
};
exports.default = _default;
},{}],"node_modules/ol/MapProperty.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/MapProperty
*/
/**
* @enum {string}
*/
var _default = {
LAYERGROUP: 'layergroup',
SIZE: 'size',
TARGET: 'target',
VIEW: 'view'
};
exports.default = _default;
},{}],"node_modules/ol/render/EventType.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/render/EventType
*/
/**
* @enum {string}
*/
var _default = {
/**
* Triggered before a layer is rendered.
* @event module:ol/render/Event~RenderEvent#prerender
* @api
*/
PRERENDER: 'prerender',
/**
* Triggered after a layer is rendered.
* @event module:ol/render/Event~RenderEvent#postrender
* @api
*/
POSTRENDER: 'postrender',
/**
* Triggered before layers are rendered.
* The event object will not have a `context` set.
* @event module:ol/render/Event~RenderEvent#precompose
* @api
*/
PRECOMPOSE: 'precompose',
/**
* Triggered after all layers are rendered.
* The event object will not have a `context` set.
* @event module:ol/render/Event~RenderEvent#postcompose
* @api
*/
POSTCOMPOSE: 'postcompose',
/**
* Triggered when rendering is complete, i.e. all sources and tiles have
* finished loading for the current viewport, and all tiles are faded in.
* The event object will not have a `context` set.
* @event module:ol/render/Event~RenderEvent#rendercomplete
* @api
*/
RENDERCOMPLETE: 'rendercomplete'
};
exports.default = _default;
},{}],"node_modules/ol/TileState.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/TileState
*/
/**
* @enum {number}
*/
var _default = {
IDLE: 0,
LOADING: 1,
LOADED: 2,
/**
* Indicates that tile loading failed
* @type {number}
*/
ERROR: 3,
EMPTY: 4
};
exports.default = _default;
},{}],"node_modules/ol/asserts.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.assert = assert;
var _AssertionError = _interopRequireDefault(require("./AssertionError.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @module ol/asserts
*/
/**
* @param {*} assertion Assertion we expected to be truthy.
* @param {number} errorCode Error code.
*/
function assert(assertion, errorCode) {
if (!assertion) {
throw new _AssertionError.default(errorCode);
}
}
},{"./AssertionError.js":"node_modules/ol/AssertionError.js"}],"node_modules/ol/structs/PriorityQueue.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DROP = void 0;
var _asserts = require("../asserts.js");
var _obj = require("../obj.js");
/**
* @module ol/structs/PriorityQueue
*/
/**
* @type {number}
*/
var DROP = Infinity;
/**
* @classdesc
* Priority queue.
*
* The implementation is inspired from the Closure Library's Heap class and
* Python's heapq module.
*
* See http://closure-library.googlecode.com/svn/docs/closure_goog_structs_heap.js.source.html
* and http://hg.python.org/cpython/file/2.7/Lib/heapq.py.
*
* @template T
*/
exports.DROP = DROP;
var PriorityQueue =
/** @class */
function () {
/**
* @param {function(T): number} priorityFunction Priority function.
* @param {function(T): string} keyFunction Key function.
*/
function PriorityQueue(priorityFunction, keyFunction) {
/**
* @type {function(T): number}
* @private
*/
this.priorityFunction_ = priorityFunction;
/**
* @type {function(T): string}
* @private
*/
this.keyFunction_ = keyFunction;
/**
* @type {Array<T>}
* @private
*/
this.elements_ = [];
/**
* @type {Array<number>}
* @private
*/
this.priorities_ = [];
/**
* @type {!Object<string, boolean>}
* @private
*/
this.queuedElements_ = {};
}
/**
* FIXME empty description for jsdoc
*/
PriorityQueue.prototype.clear = function () {
this.elements_.length = 0;
this.priorities_.length = 0;
(0, _obj.clear)(this.queuedElements_);
};
/**
* Remove and return the highest-priority element. O(log N).
* @return {T} Element.
*/
PriorityQueue.prototype.dequeue = function () {
var elements = this.elements_;
var priorities = this.priorities_;
var element = elements[0];
if (elements.length == 1) {
elements.length = 0;
priorities.length = 0;
} else {
elements[0] = elements.pop();
priorities[0] = priorities.pop();
this.siftUp_(0);
}
var elementKey = this.keyFunction_(element);
delete this.queuedElements_[elementKey];
return element;
};
/**
* Enqueue an element. O(log N).
* @param {T} element Element.
* @return {boolean} The element was added to the queue.
*/
PriorityQueue.prototype.enqueue = function (element) {
(0, _asserts.assert)(!(this.keyFunction_(element) in this.queuedElements_), 31); // Tried to enqueue an `element` that was already added to the queue
var priority = this.priorityFunction_(element);
if (priority != DROP) {
this.elements_.push(element);
this.priorities_.push(priority);
this.queuedElements_[this.keyFunction_(element)] = true;
this.siftDown_(0, this.elements_.length - 1);
return true;
}
return false;
};
/**
* @return {number} Count.
*/
PriorityQueue.prototype.getCount = function () {
return this.elements_.length;
};
/**
* Gets the index of the left child of the node at the given index.
* @param {number} index The index of the node to get the left child for.
* @return {number} The index of the left child.
* @private
*/
PriorityQueue.prototype.getLeftChildIndex_ = function (index) {
return index * 2 + 1;
};
/**
* Gets the index of the right child of the node at the given index.
* @param {number} index The index of the node to get the right child for.
* @return {number} The index of the right child.
* @private
*/
PriorityQueue.prototype.getRightChildIndex_ = function (index) {
return index * 2 + 2;
};
/**
* Gets the index of the parent of the node at the given index.
* @param {number} index The index of the node to get the parent for.
* @return {number} The index of the parent.
* @private
*/
PriorityQueue.prototype.getParentIndex_ = function (index) {
return index - 1 >> 1;
};
/**
* Make this a heap. O(N).
* @private
*/
PriorityQueue.prototype.heapify_ = function () {
var i;
for (i = (this.elements_.length >> 1) - 1; i >= 0; i--) {
this.siftUp_(i);
}
};
/**
* @return {boolean} Is empty.
*/
PriorityQueue.prototype.isEmpty = function () {
return this.elements_.length === 0;
};
/**
* @param {string} key Key.
* @return {boolean} Is key queued.
*/
PriorityQueue.prototype.isKeyQueued = function (key) {
return key in this.queuedElements_;
};
/**
* @param {T} element Element.
* @return {boolean} Is queued.
*/
PriorityQueue.prototype.isQueued = function (element) {
return this.isKeyQueued(this.keyFunction_(element));
};
/**
* @param {number} index The index of the node to move down.
* @private
*/
PriorityQueue.prototype.siftUp_ = function (index) {
var elements = this.elements_;
var priorities = this.priorities_;
var count = elements.length;
var element = elements[index];
var priority = priorities[index];
var startIndex = index;
while (index < count >> 1) {
var lIndex = this.getLeftChildIndex_(index);
var rIndex = this.getRightChildIndex_(index);
var smallerChildIndex = rIndex < count && priorities[rIndex] < priorities[lIndex] ? rIndex : lIndex;
elements[index] = elements[smallerChildIndex];
priorities[index] = priorities[smallerChildIndex];
index = smallerChildIndex;
}
elements[index] = element;
priorities[index] = priority;
this.siftDown_(startIndex, index);
};
/**
* @param {number} startIndex The index of the root.
* @param {number} index The index of the node to move up.
* @private
*/
PriorityQueue.prototype.siftDown_ = function (startIndex, index) {
var elements = this.elements_;
var priorities = this.priorities_;
var element = elements[index];
var priority = priorities[index];
while (index > startIndex) {
var parentIndex = this.getParentIndex_(index);
if (priorities[parentIndex] > priority) {
elements[index] = elements[parentIndex];
priorities[index] = priorities[parentIndex];
index = parentIndex;
} else {
break;
}
}
elements[index] = element;
priorities[index] = priority;
};
/**
* FIXME empty description for jsdoc
*/
PriorityQueue.prototype.reprioritize = function () {
var priorityFunction = this.priorityFunction_;
var elements = this.elements_;
var priorities = this.priorities_;
var index = 0;
var n = elements.length;
var element, i, priority;
for (i = 0; i < n; ++i) {
element = elements[i];
priority = priorityFunction(element);
if (priority == DROP) {
delete this.queuedElements_[this.keyFunction_(element)];
} else {
priorities[index] = priority;
elements[index++] = element;
}
}
elements.length = index;
priorities.length = index;
this.heapify_();
};
return PriorityQueue;
}();
var _default = PriorityQueue;
exports.default = _default;
},{"../asserts.js":"node_modules/ol/asserts.js","../obj.js":"node_modules/ol/obj.js"}],"node_modules/ol/TileQueue.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTilePriority = getTilePriority;
exports.default = void 0;
var _TileState = _interopRequireDefault(require("./TileState.js"));
var _EventType = _interopRequireDefault(require("./events/EventType.js"));
var _PriorityQueue = _interopRequireWildcard(require("./structs/PriorityQueue.js"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var __extends = void 0 && (void 0).__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
/**
* @module ol/TileQueue
*/
/**
* @typedef {function(import("./Tile.js").default, string, import("./coordinate.js").Coordinate, number): number} PriorityFunction
*/
var TileQueue =
/** @class */
function (_super) {
__extends(TileQueue, _super);
/**
* @param {PriorityFunction} tilePriorityFunction Tile priority function.
* @param {function(): ?} tileChangeCallback Function called on each tile change event.
*/
function TileQueue(tilePriorityFunction, tileChangeCallback) {
var _this = _super.call(this,
/**
* @param {Array} element Element.
* @return {number} Priority.
*/
function (element) {
return tilePriorityFunction.apply(null, element);
},
/**
* @param {Array} element Element.
* @return {string} Key.
*/
function (element) {
return (
/** @type {import("./Tile.js").default} */
element[0].getKey()
);
}) || this;
/** @private */
_this.boundHandleTileChange_ = _this.handleTileChange.bind(_this);
/**
* @private
* @type {function(): ?}
*/
_this.tileChangeCallback_ = tileChangeCallback;
/**
* @private
* @type {number}
*/
_this.tilesLoading_ = 0;
/**
* @private
* @type {!Object<string,boolean>}
*/
_this.tilesLoadingKeys_ = {};
return _this;
}
/**
* @inheritDoc
*/
TileQueue.prototype.enqueue = function (element) {
var added = _super.prototype.enqueue.call(this, element);
if (added) {
var tile = element[0];
tile.addEventListener(_EventType.default.CHANGE, this.boundHandleTileChange_);
}
return added;
};
/**
* @return {number} Number of tiles loading.
*/
TileQueue.prototype.getTilesLoading = function () {
return this.tilesLoading_;
};
/**
* @param {import("./events/Event.js").default} event Event.
* @protected
*/
TileQueue.prototype.handleTileChange = function (event) {
var tile =
/** @type {import("./Tile.js").default} */
event.target;
var state = tile.getState();
if (tile.hifi && state === _TileState.default.LOADED || state === _TileState.default.ERROR || state === _TileState.default.EMPTY) {
tile.removeEventListener(_EventType.default.CHANGE, this.boundHandleTileChange_);
var tileKey = tile.getKey();
if (tileKey in this.tilesLoadingKeys_) {
delete this.tilesLoadingKeys_[tileKey];
--this.tilesLoading_;
}
this.tileChangeCallback_();
}
};
/**
* @param {number} maxTotalLoading Maximum number tiles to load simultaneously.
* @param {number} maxNewLoads Maximum number of new tiles to load.
*/
TileQueue.prototype.loadMoreTiles = function (maxTotalLoading, maxNewLoads) {
var newLoads = 0;
var state, tile, tileKey;
while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads && this.getCount() > 0) {
tile =
/** @type {import("./Tile.js").default} */
this.dequeue()[0];
tileKey = tile.getKey();
state = tile.getState();
if (state === _TileState.default.IDLE && !(tileKey in this.tilesLoadingKeys_)) {
this.tilesLoadingKeys_[tileKey] = true;
++this.tilesLoading_;
++newLoads;
tile.load();
}
}
};
return TileQueue;
}(_PriorityQueue.default);
var _default = TileQueue;
/**
* @param {import('./PluggableMap.js').FrameState} frameState Frame state.
* @param {import("./Tile.js").default} tile Tile.
* @param {string} tileSourceKey Tile source key.
* @param {import("./coordinate.js").Coordinate} tileCenter Tile center.
* @param {number} tileResolution Tile resolution.
* @return {number} Tile priority.
*/
exports.default = _default;
function getTilePriority(frameState, tile, tileSourceKey, tileCenter, tileResolution) {
// Filter out tiles at higher zoom levels than the current zoom level, or that
// are outside the visible extent.
if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {
return _PriorityQueue.DROP;
}
if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {
return _PriorityQueue.DROP;
} // Prioritize the highest zoom level tiles closest to the focus.
// Tiles at higher zoom levels are prioritized using Math.log(tileResolution).
// Within a zoom level, tiles are prioritized by the distance in pixels between
// the center of the tile and the center of the viewport. The factor of 65536
// means that the prioritization should behave as desired for tiles up to
// 65536 * Math.log(2) = 45426 pixels from the focus.
var center = frameState.viewState.center;
var deltaX = tileCenter[0] - center[0];
var deltaY = tileCenter[1] - center[1];
return 65536 * Math.log(tileResolution) + Math.sqrt(deltaX * deltaX + deltaY * deltaY) / tileResolution;
}
},{"./TileState.js":"node_modules/ol/TileState.js","./events/EventType.js":"node_modules/ol/events/EventType.js","./structs/PriorityQueue.js":"node_modules/ol/structs/PriorityQueue.js"}],"node_modules/ol/tilegrid/common.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DEFAULT_TILE_SIZE = exports.DEFAULT_MAX_ZOOM = void 0;
/**
* @module ol/tilegrid/common
*/
/**
* Default maximum zoom for default tile grids.
* @type {number}
*/
var DEFAULT_MAX_ZOOM = 42;
/**
* Default tile size.
* @type {number}
*/
exports.DEFAULT_MAX_ZOOM = DEFAULT_MAX_ZOOM;
var DEFAULT_TILE_SIZE = 256;
exports.DEFAULT_TILE_SIZE = DEFAULT_TILE_SIZE;
},{}],"node_modules/ol/math.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.clamp = clamp;
exports.squaredSegmentDistance = squaredSegmentDistance;
exports.squaredDistance = squaredDistance;
exports.solveLinearSystem = solveLinearSystem;
exports.toDegrees = toDegrees;
exports.toRadians = toRadians;
exports.modulo = modulo;
exports.lerp = lerp;
exports.cosh = void 0;
/**
* @module ol/math
*/
/**
* Takes a number and clamps it to within the provided bounds.
* @param {number} value The input number.
* @param {number} min The minimum value to return.
* @param {number} max The maximum value to return.
* @return {number} The input number if it is within bounds, or the nearest
* number within the bounds.
*/
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
/**
* Return the hyperbolic cosine of a given number. The method will use the
* native `Math.cosh` function if it is available, otherwise the hyperbolic
* cosine will be calculated via the reference implementation of the Mozilla
* developer network.
*
* @param {number} x X.
* @return {number} Hyperbolic cosine of x.
*/
var cosh = function () {
// Wrapped in a iife, to save the overhead of checking for the native
// implementation on every invocation.
var cosh;
if ('cosh' in Math) {
// The environment supports the native Math.cosh function, use it…
cosh = Math.cosh;
} else {
// … else, use the reference implementation of MDN:
cosh = function (x) {
var y =
/** @type {Math} */
Math.exp(x);
return (y + 1 / y) / 2;
};
}
return cosh;
}();
/**
* Returns the square of the closest distance between the point (x, y) and the
* line segment (x1, y1) to (x2, y2).
* @param {number} x X.
* @param {number} y Y.
* @param {number} x1 X1.
* @param {number} y1 Y1.
* @param {number} x2 X2.
* @param {number} y2 Y2.
* @return {number} Squared distance.
*/
exports.cosh = cosh;
function squaredSegmentDistance(x, y, x1, y1, x2, y2) {
var dx = x2 - x1;
var dy = y2 - y1;
if (dx !== 0 || dy !== 0) {
var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);
if (t > 1) {
x1 = x2;
y1 = y2;
} else if (t > 0) {
x1 += dx * t;
y1 += dy * t;
}
}
return squaredDistance(x, y, x1, y1);
}
/**
* Returns the square of the distance between the points (x1, y1) and (x2, y2).
* @param {number} x1 X1.
* @param {number} y1 Y1.
* @param {number} x2 X2.
* @param {number} y2 Y2.
* @return {number} Squared distance.
*/
function squaredDistance(x1, y1, x2, y2) {
var dx = x2 - x1;
var dy = y2 - y1;
return dx * dx + dy * dy;
}
/**
* Solves system of linear equations using Gaussian elimination method.
*
* @param {Array<Array<number>>} mat Augmented matrix (n x n + 1 column)
* in row-major order.
* @return {Array<number>} The resulting vector.
*/
function solveLinearSystem(mat) {
var n = mat.length;
for (var i = 0; i < n; i++) {
// Find max in the i-th column (ignoring i - 1 first rows)
var maxRow = i;
var maxEl = Math.abs(mat[i][i]);
for (var r = i + 1; r < n; r++) {
var absValue = Math.abs(mat[r][i]);
if (absValue > maxEl) {
maxEl = absValue;
maxRow = r;
}
}
if (maxEl === 0) {
return null; // matrix is singular
} // Swap max row with i-th (current) row
var tmp = mat[maxRow];
mat[maxRow] = mat[i];
mat[i] = tmp; // Subtract the i-th row to make all the remaining rows 0 in the i-th column
for (var j = i + 1; j < n; j++) {
var coef = -mat[j][i] / mat[i][i];
for (var k = i; k < n + 1; k++) {
if (i == k) {
mat[j][k] = 0;
} else {
mat[j][k] += coef * mat[i][k];
}
}
}
} // Solve Ax=b for upper triangular matrix A (mat)
var x = new Array(n);
for (var l = n - 1; l >= 0; l--) {
x[l] = mat[l][n] / mat[l][l];
for (var m = l - 1; m >= 0; m--) {
mat[m][n] -= mat[m][l] * x[l];
}
}
return x;
}
/**
* Converts radians to to degrees.
*
* @param {number} angleInRadians Angle in radians.
* @return {number} Angle in degrees.
*/
function toDegrees(angleInRadians) {
return angleInRadians * 180 / Math.PI;
}
/**
* Converts degrees to radians.
*
* @param {number} angleInDegrees Angle in degrees.
* @return {number} Angle in radians.
*/
function toRadians(angleInDegrees) {
return angleInDegrees * Math.PI / 180;
}
/**
* Returns the modulo of a / b, depending on the sign of b.
*
* @param {number} a Dividend.
* @param {number} b Divisor.
* @return {number} Modulo.
*/
function modulo(a, b) {
var r = a % b;
return r * b < 0 ? r + b : r;
}
/**
* Calculates the linearly interpolated value of x between a and b.
*
* @param {number} a Number
* @param {number} b Number
* @param {number} x Value to be interpolated.
* @return {number} Interpolated value.
*/
function lerp(a, b, x) {
return a + x * (b - a);
}
},{}],"node_modules/ol/centerconstraint.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createExtent = createExtent;
exports.none = none;
var _math = require("./math.js");
/**
* @module ol/centerconstraint
*/
/**
* @typedef {function((import("./coordinate.js").Coordinate|undefined), number, import("./size.js").Size, boolean=): (import("./coordinate.js").Coordinate|undefined)} Type
*/
/**
* @param {import("./extent.js").Extent} extent Extent.
* @param {boolean} onlyCenter If true, the constraint will only apply to the view center.
* @param {boolean} smooth If true, the view will be able to go slightly out of the given extent
* (only during interaction and animation).
* @return {Type} The constraint.
*/
function createExtent(extent, onlyCenter, smooth) {
return (
/**
* @param {import("./coordinate.js").Coordinate|undefined} center Center.
* @param {number} resolution Resolution.
* @param {import("./size.js").Size} size Viewport size; unused if `onlyCenter` was specified.
* @param {boolean=} opt_isMoving True if an interaction or animation is in progress.
* @return {import("./coordinate.js").Coordinate|undefined} Center.
*/
function (center, resolution, size, opt_isMoving) {
if (center) {
var viewWidth = onlyCenter ? 0 : size[0] * resolution;
var viewHeight = onlyCenter ? 0 : size[1] * resolution;
var minX = extent[0] + viewWidth / 2;
var maxX = extent[2] - viewWidth / 2;
var minY = extent[1] + viewHeight / 2;
var maxY = extent[3] - viewHeight / 2; // note: when zooming out of bounds, min and max values for x and y may
// end up inverted (min > max); this has to be accounted for
if (minX > maxX) {
minX = (maxX + minX) / 2;
maxX = minX;
}
if (minY > maxY) {
minY = (maxY + minY) / 2;
maxY = minY;
}
var x = (0, _math.clamp)(center[0], minX, maxX);
var y = (0, _math.clamp)(center[1], minY, maxY);
var ratio = 30 * resolution; // during an interaction, allow some overscroll
if (opt_isMoving && smooth) {
x += -ratio * Math.log(1 + Math.max(0, minX - center[0]) / ratio) + ratio * Math.log(1 + Math.max(0, center[0] - maxX) / ratio);
y += -ratio * Math.log(1 + Math.max(0, minY - center[1]) / ratio) + ratio * Math.log(1 + Math.max(0, center[1] - maxY) / ratio);
}
return [x, y];
} else {
return undefined;
}
}
);
}
/**
* @param {import("./coordinate.js").Coordinate=} center Center.
* @return {import("./coordinate.js").Coordinate|undefined} Center.
*/
function none(center) {
return center;
}
},{"./math.js":"node_modules/ol/math.js"}],"node_modules/ol/extent/Corner.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/extent/Corner
*/
/**
* Extent corner.
* @enum {string}
*/
var _default = {
BOTTOM_LEFT: 'bottom-left',
BOTTOM_RIGHT: 'bottom-right',
TOP_LEFT: 'top-left',
TOP_RIGHT: 'top-right'
};
exports.default = _default;
},{}],"node_modules/ol/extent/Relationship.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @module ol/extent/Relationship
*/
/**
* Relationship to an extent.
* @enum {number}
*/
var _default = {
UNKNOWN: 0,
INTERSECTING: 1,
ABOVE: 2,
RIGHT: 4,
BELOW: 8,
LEFT: 16
};
exports.default = _default;
},{}],"node_modules/ol/extent.js":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.boundingExtent = boundingExtent;
exports.buffer = buffer;
exports.clone = clone;
exports.closestSquaredDistanceXY = closestSquaredDistanceXY;
exports.containsCoordinate = containsCoordinate;
exports.containsExtent = containsExtent;
exports.containsXY = containsXY;
exports.coordinateRelationship = coordinateRelationship;
exports.createEmpty = createEmpty;
exports.createOrUpdate = createOrUpdate;
exports.createOrUpdateEmpty = createOrUpdateEmpty;
exports.createOrUpdateFromCoordinate = createOrUpdateFromCoordinate;
exports.createOrUpdateFromCoordinates = createOrUpdateFromCoordinates;
exports.createOrUpdateFromFlatCoordinates = createOrUpdateFromFlatCoordinates;
exports.createOrUpdateFromRings = createOrUpdateFromRings;
exports.equals = equals;
exports.approximatelyEquals = approximatelyEquals;
exports.extend = extend;
exports.extendCoordinate = extendCoordinate;
exports.extendCoordinates = extendCoordinates;
exports.extendFlatCoordinates = extendFlatCoordinates;
exports.extendRings = extendRings;
exports.extendXY = extendXY;
exports.forEachCorner = forEachCorner;
exports.getArea = getArea;
exports.getBottomLeft = getBottomLeft;
exports.getBottomRight = getBottomRight;
exports.getCenter = getCenter;
exports.getCorner = getCorner;
exports.getEnlargedArea = getEnlargedArea;
exports.getForViewAndSize = getForViewAndSize;
exports.getHeight = getHeight;
exports.getIntersectionArea = getIntersectionArea;
exports.getIntersection = getIntersection;
exports.getMargin = getMargin;
exports.getSize = getSize;
exports.getTopLeft = getTopLeft;
exports.getTopRight = getTopRight;
exports.getWidth = getWidth;
exports.intersects = intersects;
exports.isEmpty = isEmpty;
exports.returnOrUpdate = returnOrUpdate;
exports.scaleFromCenter = scaleFromCenter;
exports.intersectsSegment = intersectsSegment;
exports.applyTransform = applyTransform;
exports.wrapX = wrapX;
var _asserts = require("./asserts.js");
var _Corner = _interopRequireDefault(require("./extent/Corner.js"));
var _Relationship = _interopRequireDefault(require("./extent/Relationship.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @module ol/extent
*/
/**
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
* @typedef {Array<number>} Extent
* @api
*/
/**
* Build an extent that includes all given coordinates.
*
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
* @return {Extent} Bounding extent.
* @api
*/
function boundingExtent(coordinates) {
var extent = createEmpty();
for (var i = 0, ii = coordinates.length; i < ii; ++i) {
extendCoordinate(extent, coordinates[i]);
}
return extent;
}
/**
* @param {Array<number>} xs Xs.
* @param {Array<number>} ys Ys.
* @param {Extent=} opt_extent Destination extent.
* @private
* @return {Extent} Extent.
*/
function _boundingExtentXYs(xs, ys, opt_extent) {
var minX = Math.min.apply(null, xs);
var minY = Math.min.apply(null, ys);
var maxX = Math.max.apply(null, xs);
var maxY = Math.max.apply(null, ys);
return createOrUpdate(minX, minY, maxX, maxY, opt_extent);
}
/**
* Return extent increased by the provided value.
* @param {Extent} extent Extent.
* @param {number} value The amount by which the extent should be buffered.
* @param {Extent=} opt_extent Extent.
* @return {Extent} Extent.
* @api
*/
function buffer(extent, value, opt_extent) {
if (opt_extent) {
opt_extent[0] = extent[0] - value;
opt_extent[1] = extent[1] - value;
opt_extent[2] = extent[2] + value;
opt_extent[3] = extent[3] + value;
return opt_extent;
} else {
return [extent[0] - value, extent[1] - value, extent[2] + value, extent[3] + value];
}
}
/**
* Creates a clone of an extent.
*
* @param {Extent} extent Extent to clone.
* @param {Extent=} opt_extent Extent.
* @return {Extent} The clone.
*/
function clone(extent, opt_extent) {
if (opt_extent) {
opt_extent[0] = extent[0];
opt_extent[1] = extent[1];
opt_extent[2] = extent[2];
opt_extent[3] = extent[3];
return opt_extent;
} else {
return extent.slice();
}
}
/**
* @param {Extent} extent Extent.
* @param {number} x X.
* @param {number} y Y.
* @return {number} Closest squared distance.
*/
function closestSquaredDistanceXY(extent, x, y) {
var dx, dy;
if (x < extent[0]) {
dx = extent[0] - x;
} else if (extent[2] < x) {
dx = x - extent[2];
} else {
dx = 0;
}
if (y < extent[1]) {
dy = extent[1] - y;
} else if (extent[3] < y) {
dy = y - extent[3];
} else {
dy = 0;
}
return dx * dx + dy * dy;
}
/**
* Check if the passed coordinate is contained or on the edge of the extent.
*
* @param {Extent} extent Extent.
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
* @return {boolean} The coordinate is contained in the extent.
* @api
*/
function containsCoordinate(extent, coordinate) {
return containsXY(extent, coordinate[0], coordinate[1]);
}
/**
* Check if one extent contains another.
*
* An extent is deemed contained if it lies completely within the other extent,
* including if they share one or more edges.
*
* @param {Extent} extent1 Extent 1.
* @param {Extent} extent2 Extent 2.
* @return {boolean} The second extent is contained by or on the edge of the
* first.
* @api
*/
function containsExtent(extent1, extent2) {
return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] && extent1[1] <= extent2[1] && extent2[3] <= extent1[3];
}
/**
* Check if the passed coordinate is contained or on the edge of the extent.
*
* @param {Extent} extent Extent.
* @param {number} x X coordinate.
* @param {number} y Y coordinate.
* @return {boolean} The x, y values are contained in the extent.
* @api
*/
function containsXY(extent, x, y) {
return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];
}
/**
* Get the relationship between a coordinate and extent.
* @param {Extent} extent The extent.
* @param {import("./coordinate.js").Coordinate} coordinate The coordinate.
* @return {Relationship} The relationship (bitwise compare with
* import("./extent/Relationship.js").Relationship).
*/
function coordinateRelationship(extent, coordinate) {
var minX = extent[0];
var minY = extent[1];
var maxX = extent[2];
var maxY = extent[3];
var x = coordinate[0];
var y = coordinate[1];
var relationship = _Relationship.default.UNKNOWN;
if (x < minX) {
relationship = relationship | _Relationship.default.LEFT;
} else if (x > maxX) {
relationship = relationship | _Relationship.default.RIGHT;
}
if (y < minY) {
relationship = relationship | _Relationship.default.BELOW;
} else if (y > maxY) {
relationship = relationship | _Relationship.default.ABOVE;
}
if (relationship === _Relationship.default.UNKNOWN) {
relationship = _Relationship.default.INTERSECTING;
}
return relationship;
}
/**
* Create an empty extent.
* @return {Extent} Empty extent.
* @api
*/
function createEmpty() {
return [Infinity, Infinity, -Infinity, -Infinity];
}
/**
* Create a new extent or update the provided extent.
* @param {number} minX Minimum X.
* @param {number} minY Minimum Y.
* @param {number} maxX Maximum X.
* @param {number} maxY Maximum Y.
* @param {Extent=} opt_extent Destination extent.
* @return {Extent} Extent.
*/
function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
if (opt_extent) {
opt_extent[0] = minX;
opt_extent[1] = minY;
opt_extent[2] = maxX;
opt_extent[3] = maxY;
return opt_extent;
} else {
return [minX, minY, maxX, maxY];
}
}
/**
* Create a new empty extent or make the provided one empty.
* @param {Extent=} opt_extent Extent.
* @return {Extent} Extent.
*/
function createOrUpdateEmpty(opt_extent) {
return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, opt_extent);
}
/**
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
* @param {Extent=} opt_extent Extent.
* @return {Extent} Extent.
*/
function createOrUpdateFromCoordinate(coordinate, opt_extent) {
var x = coordinate[0];
var y = coordinate[1];
return createOrUpdate(x, y, x, y, opt_extent);
}
/**
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
* @param {Extent=} opt_extent Extent.
* @return {Extent} Extent.
*/
function createOrUpdateFromCoordinates(coordinates, opt_extent) {
var extent = createOrUpdateEmpty(opt_extent);
return extendCoordinates(extent, coordinates);
}
/**
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {Extent=} opt_extent Extent.
* @return {Extent} Extent.
*/
function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {
var extent = createOrUpdateEmpty(opt_extent);
return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);
}
/**
* @param {Array<Array<import("./coordinate.js").Coordinate>>} rings Rings.
* @param {Extent=} opt_extent Extent.
* @return {Extent} Extent.
*/
function createOrUpdateFromRings(rings, opt_extent) {
var extent = createOrUpdateEmpty(opt_extent);
return extendRings(extent, rings);
}
/**
* Determine if two extents are equivalent.
* @param {Extent} extent1 Extent 1.
* @param {Extent} extent2 Extent 2.
* @return {boolean} The two extents are equivalent.
* @api
*/
function equals(extent1, extent2) {
return extent1[0] == extent2[0] && extent1[2] == extent2[2] && extent1[1] == extent2[1] && extent1[3] == extent2[3];
}
/**
* Determine if two extents are approximately equivalent.
* @param {Extent} extent1 Extent 1.
* @param {Extent} extent2 Extent 2.
* @param {number} tolerance Tolerance in extent coordinate units.
* @return {boolean} The two extents differ by less than the tolerance.
*/
function approximatelyEquals(extent1, extent2, tolerance) {
return Math.abs(extent1[0] - extent2[0]) < tolerance && Math.abs(extent1[2] - extent2[2]) < tolerance && Math.abs(extent1[1] - extent2[1]) < tolerance && Math.abs(extent1[3] - extent2[3]) < tolerance;
}
/**
* Modify an extent to include another extent.
* @param {Extent} extent1 The extent to be modified.
* @param {Extent} extent2 The extent that will be included in the first.
* @return {Extent} A reference to the first (extended) extent.
* @api
*/
function extend(extent1, extent2) {
if (extent2[0] < extent1[0]) {
extent1[0] = extent2[0];
}
if (extent2[2] > extent1[2]) {
extent1[2] = extent2[2];
}
if (extent2[1] < extent1[1]) {
extent1[1] = extent2[1];
}
if (extent2[3] > extent1[3]) {
extent1[3] = extent2[3];
}
return extent1;
}
/**
* @param {Extent} extent Extent.
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
*/
function extendCoordinate(extent, coordinate) {
if (coordinate[0] < extent[0]) {
extent[0] = coordinate[0];
}
if (coordinate[0] > extent[2]) {
extent[2] = coordinate[0];
}
if (coordinate[1] < extent[1]) {
extent[1] = coordinate[1];
}
if (coordinate[1] > extent[3]) {
extent[3] = coordinate[1];
}
}
/**
* @param {Extent} extent Extent.
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
* @return {Extent} Extent.
*/
function extendCoordinates(extent, coordinates) {
for (var i = 0, ii = coordinates.length; i < ii; ++i) {
extendCoordinate(extent, coordinates[i]);
}
return extent;
}
/**
* @param {Extent} extent Extent.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @return {Extent} Extent.
*/
function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {
for (; offset < end; offset += stride) {
extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);
}
return extent;
}
/**
* @param {Extent} extent Extent.
* @param {Array<Array<import("./coordinate.js").Coordinate>>} rings Rings.
* @return {Extent} Extent.
*/
function extendRings(extent, rings) {
for (var i = 0, ii = rings.length; i < ii; ++i) {
extendCoordinates(extent, rings[i]);
}
return extent;
}
/**
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment