-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbundle.js
8 lines (8 loc) · 226 KB
/
bundle.js
1
2
3
4
5
6
7
8
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}([function(t){t.exports=JSON.parse('{"b":-69563.34,"c":73154.51,"d":-64572.1328,"e":78145.72,"a":4}')},function(t,e,i){"use strict";t.exports=o,t.exports.default=o;var n=i(11);function o(t,e){if(!(this instanceof o))return new o(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,n,o){o||(o=_(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var r,s=e;s<i;s++)r=t.children[s],h(o,t.leaf?n(r):r);return o}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,o,r){for(var s,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=o||(s=e+Math.ceil((i-e)/o/2)*o,n(t,s,e,i,r),a.push(e,s,s,i))}o.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!f(t,e))return i;for(var o,r,s,a,h=[];e;){for(o=0,r=e.children.length;o<r;o++)s=e.children[o],f(t,a=e.leaf?n(s):s)&&(e.leaf?i.push(s):d(t,a)?this._all(s,i):h.push(s));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!f(t,e))return!1;for(var n,o,r,s,a=[];e;){for(n=0,o=e.children.length;n<o;n++)if(r=e.children[n],f(t,s=e.leaf?i(r):r)){if(e.leaf||d(t,s))return!0;a.push(r)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);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 o=this.data;this.data=n,n=o}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=_([]),this},remove:function(t,e){if(!t)return this;for(var i,n,o,s,a=this.data,h=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=u.pop(),s=!0),a.leaf&&-1!==(o=r(t,a.children,e)))return a.children.splice(o,1),l.push(a),this._condense(l),this;s||a.leaf||!d(a,h)?n?(i++,a=n.children[i],s=!1):a=null:(l.push(a),u.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var o,r=i-e+1,a=this._maxEntries;if(r<=a)return s(o=_(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,n-1))),(o=_([])).leaf=!1,o.height=n;var h,l,u,c,p=Math.ceil(r/a),d=p*Math.ceil(Math.sqrt(a));for(g(t,e,i,d,this.compareMinX),h=e;h<=i;h+=d)for(g(t,h,u=Math.min(h+d-1,i),p,this.compareMinY),l=h;l<=u;l+=p)c=Math.min(l+p-1,u),o.children.push(this._build(t,l,c,n-1));return s(o,this.toBBox),o},_chooseSubtree:function(t,e,i,n){for(var o,r,s,a,h,l,u,p,d,f;n.push(e),!e.leaf&&n.length-1!==i;){for(u=p=1/0,o=0,r=e.children.length;o<r;o++)h=c(s=e.children[o]),d=t,f=s,(l=(Math.max(f.maxX,d.maxX)-Math.min(f.minX,d.minX))*(Math.max(f.maxY,d.maxY)-Math.min(f.minY,d.minY))-h)<p?(p=l,u=h<u?h:u,a=s):l===p&&h<u&&(u=h,a=s);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,o=i?t:n(t),r=[],s=this._chooseSubtree(o,this.data,e,r);for(s.children.push(t),h(s,o);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(o,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var r=this._chooseSplitIndex(i,o,n),a=_(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,o,r,s,h,l,u,p,d,f,_,g,v,y;for(l=u=1/0,n=e;n<=i-e;n++)o=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),d=o,f=r,_=void 0,g=void 0,v=void 0,y=void 0,_=Math.max(d.minX,f.minX),g=Math.max(d.minY,f.minY),v=Math.min(d.maxX,f.maxX),y=Math.min(d.maxY,f.maxY),s=Math.max(0,v-_)*Math.max(0,y-g),h=c(o)+c(r),s<l?(l=s,p=n,u=h<u?h:u):s===l&&h<u&&(u=h,p=n);return p},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,o)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var o,r,s=this.toBBox,l=a(t,0,e,s),u=a(t,i-e,i,s),c=p(l)+p(u);for(o=e;o<i-e;o++)r=t.children[o],h(l,t.leaf?s(r):r),c+=p(l);for(o=i-e-1;o>=e;o--)r=t.children[o],h(u,t.leaf?s(r):r),c+=p(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():s(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},,,,,,,,,,function(t,e,i){t.exports=function(){"use strict";function t(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function e(t,e){return t<e?-1:t>e?1:0}return function(i,n,o,r,s){!function e(i,n,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,h=n-o+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(h-a/2<0?-1:1),p=Math.max(o,Math.floor(n-h*u/a+c)),d=Math.min(r,Math.floor(n+(a-h)*u/a+c));e(i,n,p,d,s)}var f=i[n],_=o,g=r;for(t(i,o,n),s(i[r],f)>0&&t(i,o,r);_<g;){for(t(i,_,g),_++,g--;s(i[_],f)<0;)_++;for(;s(i[g],f)>0;)g--}0===s(i[o],f)?t(i,o,g):t(i,++g,r),g<=n&&(o=g+1),n<=g&&(r=g-1)}}(i,n,o||0,r||i.length-1,s||e)}}()},function(t,e,i){"use strict";function n(){return function(){throw new Error("Unimplemented abstract method.")}()}i.r(e);var o=0;function r(t){return t.ol_uid||(t.ol_uid=String(++o))}var s="5.3.3",a=function(t){function e(e){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===s?s:"v"+s.split("-")[0])+"/doc/errors/#"+e+" for details.";t.call(this,i),this.code=e,this.name="AssertionError",this.message=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),h={ADD:"add",REMOVE:"remove"},l="propertychange",u="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),o=1,r=arguments.length;o<r;++o){var s=i[o];if(null!=s)for(var a in s)s.hasOwnProperty(a)&&(n[a]=s[a])}return n};function c(t){for(var e in t)delete t[e]}function p(t){var e;for(e in t)return!1;return!e}function d(t,e,i,n){for(var o,r=0,s=t.length;r<s;++r)if((o=t[r]).listener===e&&o.bindTo===i)return n&&(o.deleteIndex=r),o}function f(t,e){var i=_(t);return i?i[e]:void 0}function _(t,e){var i=t.ol_lm;return!i&&e&&(i=t.ol_lm={}),i}function g(t,e){var i=f(t,e);if(i){for(var n=0,o=i.length;n<o;++n)t.removeEventListener(e,i[n].boundListener),c(i[n]);i.length=0;var r=_(t);r&&(delete r[e],0===Object.keys(r).length&&function(t){delete t.ol_lm}(t))}}function v(t,e,i,n,o){var r=_(t,!0),s=r[e];s||(s=r[e]=[]);var a=d(s,i,n,!1);return a?o||(a.callOnce=!1):(a={bindTo:n,callOnce:!!o,listener:i,target:t,type:e},t.addEventListener(e,function(t){var e=function(e){var i=t.listener,n=t.bindTo||t.target;return t.callOnce&&E(t),i.call(n,e)};return t.boundListener=e,e}(a)),s.push(a)),a}function y(t,e,i,n){return v(t,e,i,n,!0)}function m(t,e,i,n){var o=f(t,e);if(o){var r=d(o,i,n,!0);r&&E(r)}}function E(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var e=f(t.target,t.type);if(e){var i="deleteIndex"in t?t.deleteIndex:e.indexOf(t);-1!==i&&e.splice(i,1),0===e.length&&g(t.target,t.type)}c(t)}}var x=function(){this.disposed_=!1};x.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},x.prototype.disposeInternal=function(){};var T=x;function S(){return!0}function R(){return!1}function C(){}var w=function(t){this.propagationStopped,this.type=t,this.target=null};function I(t){t.stopPropagation()}w.prototype.preventDefault=function(){this.propagationStopped=!0},w.prototype.stopPropagation=function(){this.propagationStopped=!0};var O=w,L=function(t){function e(){t.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addEventListener=function(t,e){var i=this.listeners_[t];i||(i=this.listeners_[t]=[]),-1===i.indexOf(e)&&i.push(e)},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new O(t):t,i=e.type;e.target=this;var n,o=this.listeners_[i];if(o){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var r=0,s=o.length;r<s;++r)if(!1===o[r].call(this,e)||e.propagationStopped){n=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var a=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];a--;)this.removeEventListener(i,C);delete this.dispatching_[i]}return n}},e.prototype.disposeInternal=function(){!function(t){var e=_(t);if(e)for(var i in e)g(t,i)}(this)},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 i=this.listeners_[t];if(i){var n=i.indexOf(e);t in this.pendingRemovals_?(i[n]=C,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t])}},e}(T),M={CHANGE:"change",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"};var b=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent(M.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=v(this,t[o],e);return n}return v(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=y(this,t[o],e);return n}return y(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var i=0,n=t.length;i<n;++i)m(this,t[i],e);else m(this,t,e)},e}(L),P=function(t){function e(e,i,n){t.call(this,e),this.key=i,this.oldValue=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O),A={};function D(t){return A.hasOwnProperty(t)?A[t]:A[t]="change:"+t}var F=function(t){function e(e){t.call(this),r(this),this.values_={},void 0!==e&&this.setProperties(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return Object.keys(this.values_)},e.prototype.getProperties=function(){return u({},this.values_)},e.prototype.notify=function(t,e){var i;i=D(t),this.dispatchEvent(new P(i,t,e)),i=l,this.dispatchEvent(new P(i,t,e))},e.prototype.set=function(t,e,i){if(i)this.values_[t]=e;else{var n=this.values_[t];this.values_[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.unset=function(t,e){if(t in this.values_){var i=this.values_[t];delete this.values_[t],e||this.notify(t,i)}},e}(b),k="length",G=function(t){function e(e,i){t.call(this,e),this.element=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O),N=function(t){function e(e,i){t.call(this);var n=i||{};if(this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(var o=0,r=this.array_.length;o<r;++o)this.assertUnique_(this.array_[o],o);this.updateLength_()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(k)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new G(h.ADD,e))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new G(h.REMOVE,e)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new G(h.REMOVE,n)),this.dispatchEvent(new G(h.ADD,e))}else{for(var o=i;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(k,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new a(58)},e}(F),Y=function(t){function e(e,i,n){t.call(this,e),this.map=i,this.frameState=void 0!==n?n:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O),X=function(t){function e(e,i,n,o,r){t.call(this,e,i,r),this.originalEvent=n,this.pixel=i.getEventPixel(n),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==o&&o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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}(Y),j="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",K=-1!==j.indexOf("firefox"),W=-1!==j.indexOf("safari")&&-1==j.indexOf("chrom"),U=-1!==j.indexOf("webkit")&&-1==j.indexOf("edge"),z=-1!==j.indexOf("macintosh"),B=window.devicePixelRatio||1,Z=function(){var t=!1;try{t=!!document.createElement("canvas").getContext("2d").setLineDash}catch(t){}return t}(),H=(navigator,"ontouchstart"in window),V="PointerEvent"in window,q=!!navigator.msPointerEnabled,J={SINGLECLICK:"singleclick",CLICK:M.CLICK,DBLCLICK:M.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Q=function(t){function e(e,i,n,o,r){t.call(this,e,i,n.originalEvent,o,r),this.pointerEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(X),$={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},tt=function(t,e){this.dispatcher=t,this.mapping_=e};tt.prototype.getEvents=function(){return Object.keys(this.mapping_)},tt.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var et=tt,it=1,nt="mouse";function ot(t){if(!this.isEventSimulatedFromTouch_(t)){it.toString()in this.pointerMap&&this.cancel(t);var e=lt(t,this.dispatcher);this.pointerMap[it.toString()]=t,this.dispatcher.down(e,t)}}function rt(t){if(!this.isEventSimulatedFromTouch_(t)){var e=lt(t,this.dispatcher);this.dispatcher.move(e,t)}}function st(t){if(!this.isEventSimulatedFromTouch_(t)){var e=this.pointerMap[it.toString()];if(e&&e.button===t.button){var i=lt(t,this.dispatcher);this.dispatcher.up(i,t),this.cleanupMouse()}}}function at(t){if(!this.isEventSimulatedFromTouch_(t)){var e=lt(t,this.dispatcher);this.dispatcher.enterOver(e,t)}}function ht(t){if(!this.isEventSimulatedFromTouch_(t)){var e=lt(t,this.dispatcher);this.dispatcher.leaveOut(e,t)}}function lt(t,e){var i=e.cloneEvent(t,t),n=i.preventDefault;return i.preventDefault=function(){t.preventDefault(),n()},i.pointerId=it,i.isPrimary=!0,i.pointerType=nt,i}var ut=function(t){function e(e){var i={mousedown:ot,mousemove:rt,mouseup:st,mouseover:at,mouseout:ht};t.call(this,e,i),this.pointerMap=e.pointerMap,this.lastTouches=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isEventSimulatedFromTouch_=function(t){for(var e=this.lastTouches,i=t.clientX,n=t.clientY,o=0,r=e.length,s=void 0;o<r&&(s=e[o]);o++){var a=Math.abs(i-s[0]),h=Math.abs(n-s[1]);if(a<=25&&h<=25)return!0}return!1},e.prototype.cancel=function(t){var e=lt(t,this.dispatcher);this.dispatcher.cancel(e,t),this.cleanupMouse()},e.prototype.cleanupMouse=function(){delete this.pointerMap[it.toString()]},e}(et),ct=["","unavailable","touch","pen","mouse"];function pt(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)}function dt(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)}function ft(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)}function _t(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)}function gt(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)}function vt(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)}function yt(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)}function mt(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)}var Et=function(t){function e(e){var i={MSPointerDown:pt,MSPointerMove:dt,MSPointerUp:ft,MSPointerOut:_t,MSPointerOver:gt,MSPointerCancel:vt,MSGotPointerCapture:mt,MSLostPointerCapture:yt};t.call(this,e,i),this.pointerMap=e.pointerMap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=ct[t.pointerType]),e},e.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},e}(et);function xt(t){this.dispatcher.fireNativeEvent(t)}function Tt(t){this.dispatcher.fireNativeEvent(t)}function St(t){this.dispatcher.fireNativeEvent(t)}function Rt(t){this.dispatcher.fireNativeEvent(t)}function Ct(t){this.dispatcher.fireNativeEvent(t)}function wt(t){this.dispatcher.fireNativeEvent(t)}function It(t){this.dispatcher.fireNativeEvent(t)}function Ot(t){this.dispatcher.fireNativeEvent(t)}var Lt=function(t){function e(e){var i={pointerdown:xt,pointermove:Tt,pointerup:St,pointerout:Rt,pointerover:Ct,pointercancel:wt,gotpointercapture:Ot,lostpointercapture:It};t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(et),Mt=!1,bt=function(t){function e(e,i,n){t.call(this,e),this.originalEvent=i;var o=n||{};this.buttons=function(t){var e;if(t.buttons||Mt)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e}(o),this.pressure=function(t,e){var i=0;i=t.pressure?t.pressure:e?.5:0;return i}(o,this.buttons),this.bubbles="bubbles"in o&&o.bubbles,this.cancelable="cancelable"in o&&o.cancelable,this.view="view"in o?o.view:null,this.detail="detail"in o?o.detail:null,this.screenX="screenX"in o?o.screenX:0,this.screenY="screenY"in o?o.screenY:0,this.clientX="clientX"in o?o.clientX:0,this.clientY="clientY"in o?o.clientY:0,this.ctrlKey="ctrlKey"in o&&o.ctrlKey,this.altKey="altKey"in o&&o.altKey,this.shiftKey="shiftKey"in o&&o.shiftKey,this.metaKey="metaKey"in o&&o.metaKey,this.button="button"in o?o.button:0,this.relatedTarget="relatedTarget"in o?o.relatedTarget:null,this.pointerId="pointerId"in o?o.pointerId:0,this.width="width"in o?o.width:0,this.height="height"in o?o.height:0,this.tiltX="tiltX"in o?o.tiltX:0,this.tiltY="tiltY"in o?o.tiltY:0,this.pointerType="pointerType"in o?o.pointerType:"",this.hwTimestamp="hwTimestamp"in o?o.hwTimestamp:0,this.isPrimary="isPrimary"in o&&o.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O);!function(){try{var t=new MouseEvent("click",{buttons:1});Mt=1===t.buttons}catch(t){}}();var Pt=bt;function At(t,e){return t>e?1:t<e?-1:0}function Dt(t,e,i){var n,o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return t[n-1]-e<e-t[n]?n-1:n}return o-1}function Ft(t,e,i){for(;e<i;){var n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function kt(t,e){for(var i=Array.isArray(e)?e:[e],n=i.length,o=0;o<n;o++)t[t.length]=i[o]}function Gt(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Nt(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)}function Yt(t){this.processTouches_(t,this.moveOverOut_)}function Xt(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)}function jt(t){this.processTouches_(t,this.cancelOut_)}var Kt=function(t){function e(e,i){var n={touchstart:Nt,touchmove:Yt,touchend:Xt,touchcancel:jt};t.call(this,e,n),this.pointerMap=e.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_,this.dedupTimeout_=2500}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},e.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&it.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},e.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},e.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},e.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},e.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},e.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.radiusX||0,i.height=e.radiusY||0,i.pressure=e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},e.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),n=i.length;function o(){t.preventDefault()}for(var r=0;r<n;++r){var s=this.touchToPointer_(t,i[r]);s.preventDefault=o,e.call(this,t,s)}},e.prototype.findTouch_=function(t,e){for(var i=t.length,n=0;n<i;n++){if(t[n].identifier===e)return!0}return!1},e.prototype.vacuumTouches_=function(t){var e=t.touches,i=Object.keys(this.pointerMap),n=i.length;if(n>=e.length){for(var o=[],r=0;r<n;++r){var s=Number(i[r]),a=this.pointerMap[s];s==it||this.findTouch_(e,s-2)||o.push(a.out)}for(var h=0;h<o.length;++h)this.cancelOut_(t,o[h])}},e.prototype.overDown_=function(t,e){this.pointerMap[e.pointerId]={target:e.target,out:e,outTarget:e.target},this.dispatcher.over(e,t),this.dispatcher.enter(e,t),this.dispatcher.down(e,t)},e.prototype.moveOverOut_=function(t,e){var i=e,n=this.pointerMap[i.pointerId];if(n){var o=n.out,r=n.outTarget;this.dispatcher.move(i,t),o&&r!==i.target&&(o.relatedTarget=i.target,i.relatedTarget=r,o.target=r,i.target?(this.dispatcher.leaveOut(o,t),this.dispatcher.enterOver(i,t)):(i.target=r,i.relatedTarget=null,this.cancelOut_(t,i))),n.out=i,n.outTarget=i.target}},e.prototype.upOut_=function(t,e){this.dispatcher.up(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},e.prototype.cancelOut_=function(t,e){this.dispatcher.cancel(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},e.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},e.prototype.dedupSynthMouse_=function(t){var e=this.mouseSource.lastTouches,i=t.changedTouches[0];if(this.isPrimaryTouch_(i)){var n=[i.clientX,i.clientY];e.push(n),setTimeout(function(){var t,i,o;i=n,o=(t=e).indexOf(i),o>-1&&t.splice(o,1)},this.dedupTimeout_)}},e}(et),Wt=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]],Ut=function(t){function e(e){t.call(this),this.element_=e,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.registerSources=function(){if(V)this.registerSource("native",new Lt(this));else if(q)this.registerSource("ms",new Et(this));else{var t=new ut(this);this.registerSource("mouse",t),H&&this.registerSource("touch",new Kt(this,t))}this.register_()},e.prototype.registerSource=function(t,e){var i=e,n=i.getEvents();n&&(n.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},e.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.addEvents_(i.getEvents())}},e.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.removeEvents_(i.getEvents())}},e.prototype.eventHandler_=function(t){var e=t.type,i=this.eventMap_[e];i&&i(t)},e.prototype.addEvents_=function(t){t.forEach(function(t){v(this.element_,t,this.eventHandler_,this)}.bind(this))},e.prototype.removeEvents_=function(t){t.forEach(function(t){m(this.element_,t,this.eventHandler_,this)}.bind(this))},e.prototype.cloneEvent=function(t,e){for(var i={},n=0,o=Wt.length;n<o;n++){var r=Wt[n][0];i[r]=t[r]||e[r]||Wt[n][1]}return i},e.prototype.down=function(t,e){this.fireEvent($.POINTERDOWN,t,e)},e.prototype.move=function(t,e){this.fireEvent($.POINTERMOVE,t,e)},e.prototype.up=function(t,e){this.fireEvent($.POINTERUP,t,e)},e.prototype.enter=function(t,e){t.bubbles=!1,this.fireEvent($.POINTERENTER,t,e)},e.prototype.leave=function(t,e){t.bubbles=!1,this.fireEvent($.POINTERLEAVE,t,e)},e.prototype.over=function(t,e){t.bubbles=!0,this.fireEvent($.POINTEROVER,t,e)},e.prototype.out=function(t,e){t.bubbles=!0,this.fireEvent($.POINTEROUT,t,e)},e.prototype.cancel=function(t,e){this.fireEvent($.POINTERCANCEL,t,e)},e.prototype.leaveOut=function(t,e){this.out(t,e),this.contains_(t.target,t.relatedTarget)||this.leave(t,e)},e.prototype.enterOver=function(t,e){this.over(t,e),this.contains_(t.target,t.relatedTarget)||this.enter(t,e)},e.prototype.contains_=function(t,e){return!(!t||!e)&&t.contains(e)},e.prototype.makeEvent=function(t,e,i){return new Pt(t,i,e)},e.prototype.fireEvent=function(t,e,i){var n=this.makeEvent(t,e,i);this.dispatchEvent(n)},e.prototype.fireNativeEvent=function(t){var e=this.makeEvent(t.type,t,t);this.dispatchEvent(e)},e.prototype.wrapMouseEvent=function(t,e){return this.makeEvent(t,lt(e,this),e)},e.prototype.disposeInternal=function(){this.unregister_(),t.prototype.disposeInternal.call(this)},e}(L),zt=function(t){function e(e,i){t.call(this),this.map_=e,this.clickTimeoutId_,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*B:B,this.down_=null;var n=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new Ut(n),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=v(this.pointerEventHandler_,$.POINTERDOWN,this.handlePointerDown_,this),this.relayedListenerKey_=v(this.pointerEventHandler_,$.POINTERMOVE,this.relayEvent_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.emulateClick_=function(t){var e=new Q(J.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Q(J.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Q(J.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==J.POINTERUP||e.type==J.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==J.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Q(J.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new Q(J.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new Ut(document),this.dragListenerKeys_.push(v(this.documentPointerEventHandler_,J.POINTERMOVE,this.handlePointerMove_,this),v(this.documentPointerEventHandler_,J.POINTERUP,this.handlePointerUp_,this),v(this.pointerEventHandler_,J.POINTERCANCEL,this.handlePointerUp_,this)))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Q(J.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}t.preventDefault()},e.prototype.relayEvent_=function(t){var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Q(t.type,this.map_,t,e))},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(E(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(E(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),t.prototype.disposeInternal.call(this)},e}(L),Bt="postrender",Zt="movestart",Ht="moveend",Vt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},qt="postcompose",Jt="precompose",Qt="render",$t="rendercomplete",te={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};function ee(t,e){if(!t)throw new a(e)}var ie=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};ie.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,c(this.queuedElements_)},ie.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},ie.prototype.enqueue=function(t){ee(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},ie.prototype.getCount=function(){return this.elements_.length},ie.prototype.getLeftChildIndex_=function(t){return 2*t+1},ie.prototype.getRightChildIndex_=function(t){return 2*t+2},ie.prototype.getParentIndex_=function(t){return t-1>>1},ie.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},ie.prototype.isEmpty=function(){return 0===this.elements_.length},ie.prototype.isKeyQueued=function(t){return t in this.queuedElements_},ie.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},ie.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t<n>>1;){var a=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),l=h<n&&i[h]<i[a]?h:a;e[t]=e[l],i[t]=i[l],t=l}e[t]=o,i[t]=r,this.siftDown_(s,t)},ie.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,o=i[e],r=n[e];e>t;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},ie.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e<a;++e)(i=n(t=o[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(r[s]=i,o[s++]=t);o.length=s,r.length=s,this.heapify_()};var ne=function(t){function e(e,i){t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()}),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&v(e[0],M.CHANGE,this.handleTileChange,this);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===te.LOADED||i===te.ERROR||i===te.EMPTY||i===te.ABORT){m(e,M.CHANGE,this.handleTileChange,this);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,n,o,r=0,s=!1;this.tilesLoading_<t&&r<e&&this.getCount()>0;)o=(n=this.dequeue()[0]).getKey(),(i=n.getState())===te.ABORT?s=!0:i!==te.IDLE||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++r,n.load());0===r&&s&&this.tileChangeCallback_()},e}(ie),oe=42,re=256;function se(t,e,i){return Math.min(Math.max(t,e),i)}var ae="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function he(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var h=((t-i)*s+(e-n)*a)/(s*s+a*a);h>1?(i=o,n=r):h>0&&(i+=s*h,n+=a*h)}return le(t,e,i,n)}function le(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function ue(t){return t*Math.PI/180}function ce(t,e){var i=t%e;return i*e<0?i+e:i}function pe(t,e,i){return t+i*(e-t)}function de(t){return t}function fe(t,e){return void 0!==t?0:void 0}function _e(t,e){return void 0!==t?t+e:void 0}var ge=0,ve=1,ye="center",me="resolution",Ee="rotation";function xe(t,e){return t[0]+=e[0],t[1]+=e[1],t}function Te(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function Se(t,e){return t[0]*=e,t[1]*=e,t}function Re(t){return Math.pow(t,3)}function Ce(t){return 1-Re(1-t)}function we(t){return 3*t*t-2*t*t*t}function Ie(t){return t}var Oe={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Le={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Me(t){for(var e=Ne(),i=0,n=t.length;i<n;++i)We(e,t[i]);return e}function be(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Pe(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Ae(t,e,i){var n,o;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(o=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*o}function De(t,e){return ke(t,e[0],e[1])}function Fe(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ke(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function Ge(t,e){var i=t[0],n=t[1],o=t[2],r=t[3],s=e[0],a=e[1],h=Le.UNKNOWN;return s<i?h|=Le.LEFT:s>o&&(h|=Le.RIGHT),a<n?h|=Le.BELOW:a>r&&(h|=Le.ABOVE),h===Le.UNKNOWN&&(h=Le.INTERSECTING),h}function Ne(){return[1/0,1/0,-1/0,-1/0]}function Ye(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function Xe(t){return Ye(1/0,1/0,-1/0,-1/0,t)}function je(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Ke(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function We(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function Ue(t,e){for(var i=0,n=e.length;i<n;++i)We(t,e[i]);return t}function ze(t,e,i,n,o){for(;i<n;i+=o)Be(t,e[i],e[i+1]);return t}function Be(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function Ze(t){var e=0;return ri(t)||(e=ni(t)*$e(t)),e}function He(t){return[t[0],t[1]]}function Ve(t){return[t[2],t[1]]}function qe(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Je(t,e){var i;return e===Oe.BOTTOM_LEFT?i=He(t):e===Oe.BOTTOM_RIGHT?i=Ve(t):e===Oe.TOP_LEFT?i=ei(t):e===Oe.TOP_RIGHT?i=ii(t):ee(!1,13),i}function Qe(t,e,i,n,o){var r=e*n[0]/2,s=e*n[1]/2,a=Math.cos(i),h=Math.sin(i),l=r*a,u=r*h,c=s*a,p=s*h,d=t[0],f=t[1],_=d-l+p,g=d-l-p,v=d+l-p,y=d+l+p,m=f-u-c,E=f-u+c,x=f+u+c,T=f+u-c;return Ye(Math.min(_,g,v,y),Math.min(m,E,x,T),Math.max(_,g,v,y),Math.max(m,E,x,T),o)}function $e(t){return t[3]-t[1]}function ti(t,e,i){var n=i||[1/0,1/0,-1/0,-1/0];return oi(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):Xe(n),n}function ei(t){return[t[0],t[3]]}function ii(t){return[t[2],t[3]]}function ni(t){return t[2]-t[0]}function oi(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ri(t){return t[2]<t[0]||t[3]<t[1]}var si={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"},ai={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function hi(t,e,i,n,o,r){for(var s=r||[],a=0,h=e;h<i;h+=n){var l=t[h],u=t[h+1];s[a++]=o[0]*l+o[2]*u+o[4],s[a++]=o[1]*l+o[3]*u+o[5]}return r&&s.length!=a&&(s.length=a),s}
/**
* @license
* Latitude/longitude spherical geodesy formulae taken from
* http://www.movable-type.co.uk/scripts/latlong.html
* Licensed under CC-BY-3.0.
*/
var li=6371008.8;function ui(t,e,i){var n=i||li,o=ue(t[1]),r=ue(e[1]),s=(r-o)/2,a=ue(e[0]-t[0])/2,h=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(o)*Math.cos(r);return 2*n*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}var ci={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},pi={};pi[ci.DEGREES]=2*Math.PI*6370997/360,pi[ci.FEET]=.3048,pi[ci.METERS]=1,pi[ci.USFEET]=1200/3937;var di=ci,fi=function(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};fi.prototype.canWrapX=function(){return this.canWrapX_},fi.prototype.getCode=function(){return this.code_},fi.prototype.getExtent=function(){return this.extent_},fi.prototype.getUnits=function(){return this.units_},fi.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||pi[this.units_]},fi.prototype.getWorldExtent=function(){return this.worldExtent_},fi.prototype.getAxisOrientation=function(){return this.axisOrientation_},fi.prototype.isGlobal=function(){return this.global_},fi.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},fi.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},fi.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},fi.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},fi.prototype.setWorldExtent=function(t){this.worldExtent_=t},fi.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},fi.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var _i=fi,gi=6378137,vi=Math.PI*gi,yi=[-vi,-vi,vi,vi],mi=[-180,-85,180,85],Ei=function(t){function e(e){t.call(this,{code:e,units:di.METERS,extent:yi,global:!0,worldExtent:mi,getPointResolution:function(t,e){return t/ae(e[1]/gi)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(_i),xi=[new Ei("EPSG:3857"),new Ei("EPSG:102100"),new Ei("EPSG:102113"),new Ei("EPSG:900913"),new Ei("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ei("urn:ogc:def:crs:EPSG::3857"),new Ei("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ti(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=vi,a=0;a<n;a+=o){r[a]=s*t[a]/180;var h=gi*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));h>s?h=s:h<-s&&(h=-s),r[a+1]=h}return r}function Si(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;s<n;s+=o)r[s]=180*t[s]/vi,r[s+1]=360*Math.atan(Math.exp(t[s+1]/gi))/Math.PI-90;return r}var Ri=[-180,-90,180,90],Ci=6378137*Math.PI/180,wi=function(t){function e(e,i){t.call(this,{code:e,units:di.DEGREES,extent:Ri,axisOrientation:i,global:!0,metersPerUnit:Ci,worldExtent:Ri})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(_i),Ii=[new wi("CRS:84"),new wi("EPSG:4326","neu"),new wi("urn:ogc:def:crs:EPSG::4326","neu"),new wi("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new wi("urn:ogc:def:crs:OGC:1.3:CRS84"),new wi("urn:ogc:def:crs:OGC:2:84"),new wi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new wi("urn:x-ogc:def:crs:EPSG:4326","neu")],Oi={};var Li,Mi,bi,Pi={};function Ai(t,e,i){var n=t.getCode(),o=e.getCode();n in Pi||(Pi[n]={}),Pi[n][o]=i}function Di(t,e,i){var n;if(void 0!==e){for(var o=0,r=t.length;o<r;++o)e[o]=t[o];n=e}else n=t.slice();return n}function Fi(t,e,i){if(void 0!==e&&t!==e){for(var n=0,o=t.length;n<o;++n)e[n]=t[n];t=e}return t}function ki(t){!function(t,e){Oi[t]=e}(t.getCode(),t),Ai(t,t,Di)}function Gi(t){return"string"==typeof t?Oi[t]||null:t||null}function Ni(t,e,i,n){var o,r=(t=Gi(t)).getPointResolutionFunc();if(r)o=r(e,i);else if(t.getUnits()==di.DEGREES&&!n||n==di.DEGREES)o=e;else{var s=Ki(t,Gi("EPSG:4326")),a=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];o=(ui((a=s(a,a,2)).slice(0,2),a.slice(2,4))+ui(a.slice(4,6),a.slice(6,8)))/2;var h=n?pi[n]:t.getMetersPerUnit();void 0!==h&&(o/=h)}return o}function Yi(t){!function(t){t.forEach(ki)}(t),t.forEach(function(e){t.forEach(function(t){e!==t&&Ai(e,t,Di)})})}function Xi(t,e){return t?"string"==typeof t?Gi(t):t:Gi(e)}function ji(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?i:Ki(t,e)===Di&&i}function Ki(t,e){var i=function(t,e){var i;return t in Pi&&e in Pi[t]&&(i=Pi[t][e]),i}(t.getCode(),e.getCode());return i||(i=Fi),i}function Wi(t,e){return Ki(Gi(t),Gi(e))}function Ui(t,e,i){return Wi(e,i)(t,void 0,t.length)}Yi(xi),Yi(Ii),Li=xi,Mi=Ti,bi=Si,Ii.forEach(function(t){Li.forEach(function(e){Ai(t,e,Mi),Ai(e,t,bi)})});var zi=new Array(6);function Bi(t){return Hi(t,1,0,0,1,0,0)}function Zi(t,e){var i=t[0],n=t[1],o=t[2],r=t[3],s=t[4],a=t[5],h=e[0],l=e[1],u=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*h+o*l,t[1]=n*h+r*l,t[2]=i*u+o*c,t[3]=n*u+r*c,t[4]=i*p+o*d+s,t[5]=n*p+r*d+a,t}function Hi(t,e,i,n,o,r,s){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t[4]=r,t[5]=s,t}function Vi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function qi(t,e){var i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Ji(t,e,i){return Zi(t,Hi(zi,e,0,0,i,0,0))}function Qi(t,e,i){return Zi(t,Hi(zi,1,0,0,1,e,i))}function $i(t,e,i,n,o,r,s,a){var h=Math.sin(r),l=Math.cos(r);return t[0]=n*l,t[1]=o*h,t[2]=-n*h,t[3]=o*l,t[4]=s*n*l-a*n*h+e,t[5]=s*o*h+a*o*l+i,t}var tn=[1,0,0,1,0,0];function en(t){var e;return t==ai.XY?e=2:t==ai.XYZ||t==ai.XYM?e=3:t==ai.XYZM&&(e=4),e}var nn=function(t){function e(){t.call(this),this.layout=ai.XY,this.stride=2,this.flatCoordinates=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeExtent=function(t){return e=this.flatCoordinates,i=0,n=this.flatCoordinates.length,o=this.stride,ze(Xe(t),e,i,n,o);var e,i,n,o},e.prototype.getCoordinates=function(){return n()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(c(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];var i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[e]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=en(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){n()},e.prototype.setLayout=function(t,e,i){var n;if(t)n=en(t);else{for(var o=0;o<i;++o){if(0===e.length)return this.layout=ai.XY,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=ai.XY:3==t?e=ai.XYZ:4==t&&(e=ai.XYZM);return e}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();!function(t,e,i,n,o,r,s){for(var a=s||[],h=Math.cos(o),l=Math.sin(o),u=r[0],c=r[1],p=0,d=e;d<i;d+=n){var f=t[d]-u,_=t[d+1]-c;a[p++]=u+f*h-_*l,a[p++]=c+f*l+_*h;for(var g=d+2;g<d+n;++g)a[p++]=t[g]}s&&a.length!=p&&(a.length=p)}(i,0,i.length,n,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var n=e;void 0===n&&(n=t);var o=i;o||(o=qe(this.getExtent()));var r=this.getFlatCoordinates();if(r){var s=this.getStride();!function(t,e,i,n,o,r,s,a){for(var h=a||[],l=s[0],u=s[1],c=0,p=e;p<i;p+=n){var d=t[p]-l,f=t[p+1]-u;h[c++]=l+o*d,h[c++]=u+r*f;for(var _=p+2;_<p+n;++_)h[c++]=t[_]}a&&h.length!=c&&(h.length=c)}(r,0,r.length,s,t,n,o,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();!function(t,e,i,n,o,r,s){for(var a=s||[],h=0,l=e;l<i;l+=n){a[h++]=t[l]+o,a[h++]=t[l+1]+r;for(var u=l+2;u<l+n;++u)a[h++]=t[u]}s&&a.length!=h&&(a.length=h)}(i,0,i.length,n,t,e,i),this.changed()}},e}(function(t){function e(){t.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return n()},e.prototype.closestPointXY=function(t,e,i,o){return n()},e.prototype.containsXY=function(t,e){return!1},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return n()},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){n()},e.prototype.scale=function(t,e,i){n()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return n()},e.prototype.getType=function(){return n()},e.prototype.applyTransform=function(t){n()},e.prototype.intersectsExtent=function(t){return n()},e.prototype.translate=function(t,e){n()},e.prototype.transform=function(t,e){var i=Gi(t),n=i.getUnits()==di.TILE_PIXELS?function(t,n,o){var r=i.getExtent(),s=i.getWorldExtent(),a=$e(s)/$e(r);return $i(tn,s[0],s[3],a,-a,0,0,0),hi(t,0,t.length,o,tn,n),Wi(i,e)(t,n,o)}:Wi(i,e);return this.applyTransform(n),this},e}(F));function on(t,e,i,n){for(var o=0,r=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],h=t[e+1];o+=s*a-r*h,r=a,s=h}return o/2}function rn(t,e,i,n){for(var o=0,r=0,s=i.length;r<s;++r){var a=i[r];o+=on(t,e,a,n),e=a}return o}function sn(t,e,i,n,o,r,s){var a,h=t[e],l=t[e+1],u=t[i]-h,c=t[i+1]-l;if(0===u&&0===c)a=e;else{var p=((o-h)*u+(r-l)*c)/(u*u+c*c);if(p>1)a=i;else{if(p>0){for(var d=0;d<n;++d)s[d]=pe(t[e+d],t[i+d],p);return void(s.length=n)}a=e}}for(var f=0;f<n;++f)s[f]=t[a+f];s.length=n}function an(t,e,i,n,o){var r=t[e],s=t[e+1];for(e+=n;e<i;e+=n){var a=t[e],h=t[e+1],l=le(r,s,a,h);l>o&&(o=l),r=a,s=h}return o}function hn(t,e,i,n,o){for(var r=0,s=i.length;r<s;++r){var a=i[r];o=an(t,e,a,n,o),e=a}return o}function ln(t,e,i,n,o,r,s,a,h,l,u){if(e==i)return l;var c,p;if(0===o){if((p=le(s,a,t[e],t[e+1]))<l){for(c=0;c<n;++c)h[c]=t[e+c];return h.length=n,p}return l}for(var d=u||[NaN,NaN],f=e+n;f<i;)if(sn(t,f-n,f,n,s,a,d),(p=le(s,a,d[0],d[1]))<l){for(l=p,c=0;c<n;++c)h[c]=d[c];h.length=n,f+=n}else f+=n*Math.max((Math.sqrt(p)-Math.sqrt(l))/o|0,1);if(r&&(sn(t,i-n,e,n,s,a,d),(p=le(s,a,d[0],d[1]))<l)){for(l=p,c=0;c<n;++c)h[c]=d[c];h.length=n}return l}function un(t,e,i,n,o,r,s,a,h,l,u){for(var c=u||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];l=ln(t,e,f,n,o,r,s,a,h,l,c),e=f}return l}function cn(t,e,i,n){for(var o=0,r=i.length;o<r;++o)for(var s=i[o],a=0;a<n;++a)t[e++]=s[a];return e}function pn(t,e,i,n,o){for(var r=o||[],s=0,a=0,h=i.length;a<h;++a){var l=cn(t,e,i[a],n);r[s++]=l,e=l}return r.length=s,r}function dn(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a<i;a+=n)r[s++]=t.slice(a,a+n);return r.length=s,r}function fn(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];r[s++]=dn(t,e,l,n,r[s]),e=l}return r.length=s,r}function _n(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];r[s++]=fn(t,e,l,n,r[s]),e=l[l.length-1]}return r.length=s,r}function gn(t,e,i,n,o,r,s){var a=(i-e)/n;if(a<3){for(;e<i;e+=n)r[s++]=t[e],r[s++]=t[e+1];return s}var h=new Array(a);h[0]=1,h[a-1]=1;for(var l=[e,i-n],u=0;l.length>0;){for(var c=l.pop(),p=l.pop(),d=0,f=t[p],_=t[p+1],g=t[c],v=t[c+1],y=p+n;y<c;y+=n){var m=he(t[y],t[y+1],f,_,g,v);m>d&&(u=y,d=m)}d>o&&(h[(u-e)/n]=1,p+n<u&&l.push(p,u),u+n<c&&l.push(u,c))}for(var E=0;E<a;++E)h[E]&&(r[s++]=t[e+E*n],r[s++]=t[e+E*n+1]);return s}function vn(t,e){return e*Math.round(t/e)}function yn(t,e,i,n,o,r,s){if(e==i)return s;var a,h,l=vn(t[e],o),u=vn(t[e+1],o);e+=n,r[s++]=l,r[s++]=u;do{if(a=vn(t[e],o),h=vn(t[e+1],o),(e+=n)==i)return r[s++]=a,r[s++]=h,s}while(a==l&&h==u);for(;e<i;){var c=vn(t[e],o),p=vn(t[e+1],o);if(e+=n,c!=a||p!=h){var d=a-l,f=h-u,_=c-l,g=p-u;d*g==f*_&&(d<0&&_<d||d==_||d>0&&_>d)&&(f<0&&g<f||f==g||f>0&&g>f)?(a=c,h=p):(r[s++]=a,r[s++]=h,l=a,u=h,a=c,h=p)}}return r[s++]=a,r[s++]=h,s}function mn(t,e,i,n,o,r,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=yn(t,e,u,n,o,r,s),a.push(s),e=u}return s}var En=function(t){function e(e,i){t.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?this.setCoordinates(e,i):this.setFlatCoordinates(i,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){return n<Ae(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(an(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ln(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.getArea=function(){return on(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,ai.XY)},e.prototype.getType=function(){return si.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=cn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(nn),xn=function(t){function e(e,i){t.call(this),this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){var o=this.flatCoordinates,r=le(t,e,o[0],o[1]);if(r<n){for(var s=this.stride,a=0;a<s;++a)i[a]=o[a];return i.length=s,r}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return e=this.flatCoordinates,i=t,n=e[0],o=e[1],Ye(n,o,n,o,i);var e,i,n,o},e.prototype.getType=function(){return si.POINT},e.prototype.intersectsExtent=function(t){return ke(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=function(t,e,i,n){for(var o=0,r=i.length;o<r;++o)t[e++]=i[o];return e}(this.flatCoordinates,0,t,this.stride),this.changed()},e}(nn);function Tn(t,e,i,n,o){return!function(t,e,i){var n;return(n=e.call(i,He(t)))?n:(n=e.call(i,Ve(t)))?n:(n=e.call(i,ii(t)))?n:(n=e.call(i,ei(t)))||!1}(o,function(o){return!Sn(t,e,i,n,o[0],o[1])})}function Sn(t,e,i,n,o,r){for(var s=0,a=t[i-n],h=t[i-n+1];e<i;e+=n){var l=t[e],u=t[e+1];h<=r?u>r&&(l-a)*(r-h)-(o-a)*(u-h)>0&&s++:u<=r&&(l-a)*(r-h)-(o-a)*(u-h)<0&&s--,a=l,h=u}return 0!==s}function Rn(t,e,i,n,o,r){if(0===i.length)return!1;if(!Sn(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s<a;++s)if(Sn(t,i[s-1],i[s],n,o,r))return!1;return!0}function Cn(t,e,i,n,o,r,s){for(var a,h,l,u,c,p,d,f=o[r+1],_=[],g=0,v=i.length;g<v;++g){var y=i[g];for(u=t[y-n],p=t[y-n+1],a=e;a<y;a+=n)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(l=(f-p)/(d-p)*(c-u)+u,_.push(l)),u=c,p=d}var m=NaN,E=-1/0;for(_.sort(At),u=_[0],a=1,h=_.length;a<h;++a){c=_[a];var x=Math.abs(c-u);x>E&&Rn(t,e,i,n,l=(u+c)/2,f)&&(m=l,E=x),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,f,E),s):[m,f,E]}function wn(t,e,i,n,o){var r=ze([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!oi(o,r)&&(!!Fe(o,r)||(r[0]>=o[0]&&r[2]<=o[2]||(r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o,r){for(var s,a=[t[e],t[e+1]],h=[];e+n<i;e+=n){if(h[0]=t[e+n],h[1]=t[e+n+1],s=o.call(r,a,h))return s;a[0]=h[0],a[1]=h[1]}return!1}(t,e,i,n,function(t,e){return function(t,e,i){var n=!1,o=Ge(t,e),r=Ge(t,i);if(o===Le.INTERSECTING||r===Le.INTERSECTING)n=!0;else{var s,a,h=t[0],l=t[1],u=t[2],c=t[3],p=e[0],d=e[1],f=i[0],_=i[1],g=(_-d)/(f-p);r&Le.ABOVE&&!(o&Le.ABOVE)&&(n=(s=f-(_-c)/g)>=h&&s<=u),n||!(r&Le.RIGHT)||o&Le.RIGHT||(n=(a=_-(f-u)*g)>=l&&a<=c),n||!(r&Le.BELOW)||o&Le.BELOW||(n=(s=f-(_-l)/g)>=h&&s<=u),n||!(r&Le.LEFT)||o&Le.LEFT||(n=(a=_-(f-h)*g)>=l&&a<=c)}return n}(o,t,e)}))))}function In(t,e,i,n,o){if(!function(t,e,i,n,o){return!!wn(t,e,i,n,o)||(!!Sn(t,e,i,n,o[0],o[1])||(!!Sn(t,e,i,n,o[0],o[3])||(!!Sn(t,e,i,n,o[2],o[1])||!!Sn(t,e,i,n,o[2],o[3]))))}(t,e,i[0],n,o))return!1;if(1===i.length)return!0;for(var r=1,s=i.length;r<s;++r)if(Tn(t,i[r-1],i[r],n,o)&&!wn(t,i[r-1],i[r],n,o))return!1;return!0}function On(t,e,i,n){for(;e<i-n;){for(var o=0;o<n;++o){var r=t[e+o];t[e+o]=t[i-n+o],t[i-n+o]=r}e+=n,i-=n}}function Ln(t,e,i,n){for(var o=0,r=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],h=t[e+1];o+=(a-r)*(h+s),r=a,s=h}return o>0}function Mn(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;s<a;++s){var h=i[s],l=Ln(t,e,h,n);if(0===s){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;e=h}return!0}function bn(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;s<a;++s){var h=i[s],l=Ln(t,e,h,n);(0===s?r&&l||!r&&!l:r&&!l||!r&&l)&&On(t,e,h,n),e=h}return e}var Pn=function(t){function e(e,i,n){t.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&n?(this.setFlatCoordinates(i,e),this.ends_=n):this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendLinearRing=function(t){this.flatCoordinates?kt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,i,n){return n<Ae(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(hn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),un(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return Rn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return rn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?bn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,fn(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=qe(this.getExtent());this.flatInteriorPoint_=Cn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new xn(this.getFlatInteriorPoint(),ai.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new En(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],o=0,r=0,s=i.length;r<s;++r){var a=i[r],h=new En(e.slice(o,a),t);n.push(h),o=a}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Mn(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=bn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=mn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new e(i,ai.XY,n)},e.prototype.getType=function(){return si.POLYGON},e.prototype.intersectsExtent=function(t){return In(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=pn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(nn),An=Pn;function Dn(t){var e=t[0],i=t[1],n=t[2],o=t[3],r=[e,i,e,o,n,o,n,i,e,i];return new Pn(r,ai.XY,[r.length])}var Fn=0;function kn(t,e){setTimeout(function(){t(e)},0)}function Gn(t){return!(t.sourceCenter&&t.targetCenter&&!function(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var Nn=function(t){function e(e){t.call(this);var i=u({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=Xi(i.projection,"EPSG:3857"),this.applyOptions_(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyOptions_=function(t){var e={};e[ye]=void 0!==t.center?t.center:null;var i=function(t){var e,i,n,o=void 0!==t.minZoom?t.minZoom:Fn,r=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;i=a[o],n=void 0!==a[r]?a[r]:a[a.length-1],e=function(t){return function(e,i,n){if(void 0!==e){var o=Dt(t,e,n);o=se(o+i,0,t.length-1);var r=Math.floor(o);if(o!=r&&r<t.length-1){var s=t[r]/t[r+1];return t[r]/Math.pow(s,o-r)}return t[r]}}}(a)}else{var h=Xi(t.projection,"EPSG:3857"),l=h.getExtent(),u=(l?Math.max(ni(l),$e(l)):360*pi[di.DEGREES]/h.getMetersPerUnit())/re/Math.pow(2,Fn),c=u/Math.pow(2,28-Fn);void 0!==(i=t.maxResolution)?o=0:i=u/Math.pow(s,o),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,r):u/Math.pow(s,r):c),r=o+Math.floor(Math.log(i/n)/Math.log(s)),n=i/Math.pow(s,r-o),e=function(t,e,i){return function(n,o,r){if(void 0!==n){var s=-r/2+.5,a=Math.floor(Math.log(e/n)/Math.log(t)+s),h=Math.max(a+o,0);return void 0!==i&&(h=Math.min(h,i)),e/Math.pow(t,h)}}}(s,i,r-o)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:o,zoomFactor:s}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=i.minZoom;var n=function(t){return void 0!==t.extent?(e=t.extent,function(t){return t?[se(t[0],e[0],e[2]),se(t[1],e[1],e[3])]:void 0}):de;var e}(t),o=i.constraint,r=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=o||ue(5),function(t,e){return void 0!==t?Math.abs(t+e)<=r?0:t+e:void 0}):!1===e?_e:"number"==typeof e?(i=e,n=2*Math.PI/i,function(t,e){return void 0!==t?t=Math.floor((t+e)/n+.5)*n:void 0}):_e}return fe;var i,n;var o,r}(t);this.constraints_={center:n,resolution:o,rotation:r},void 0!==t.resolution?e[me]=t.resolution:void 0!==t.zoom&&(e[me]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(e[me]=se(Number(this.getResolution()||e[me]),this.minResolution_,this.maxResolution_))),e[Ee]=void 0!==t.rotation?t.rotation:0,this.setProperties(e),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=u({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenter(),e.rotation=this.getRotation(),u({},e,t)},e.prototype.animate=function(t){var e,i=arguments,n=arguments.length;if(n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var o=arguments[n-1];return o.center&&this.setCenter(o.center),void 0!==o.zoom&&this.setZoom(o.zoom),void 0!==o.rotation&&this.setRotation(o.rotation),void(e&&kn(e,!0))}for(var r=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),h=this.getRotation(),l=[],u=0;u<n;++u){var c=i[u],p={start:r,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||we};if(c.center&&(p.sourceCenter=s,p.targetCenter=c.center,s=p.targetCenter),void 0!==c.zoom?(p.sourceResolution=a,p.targetResolution=this.constrainResolution(this.maxResolution_,c.zoom-this.minZoom_,0),a=p.targetResolution):c.resolution&&(p.sourceResolution=a,p.targetResolution=c.resolution,a=p.targetResolution),void 0!==c.rotation){p.sourceRotation=h;var d=ce(c.rotation-h+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=h+d,h=p.targetRotation}p.callback=e,Gn(p)?p.complete=!0:r+=p.duration,l.push(p)}this.animations_.push(l),this.setHint(ge,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[ge]>0},e.prototype.getInteracting=function(){return this.hints_[ve]>0},e.prototype.cancelAnimations=function(){this.setHint(ge,-this.hints_[ge]);for(var t=0,e=this.animations_.length;t<e;++t){var i=this.animations_[t];i[0].callback&&kn(i[0].callback,!1)}this.animations_.length=0},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r<s;++r){var a=n[r];if(!a.complete){var h=t-a.start,l=a.duration>0?h/a.duration:1;l>=1?(a.complete=!0,l=1):o=!1;var u=a.easing(l);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+u*(a.targetCenter[0]-c),f=p+u*(a.targetCenter[1]-p);this.set(ye,[d,f])}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);a.anchor&&this.set(ye,this.calculateCenterZoom(_,a.anchor)),this.set(me,_)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===u?ce(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);a.anchor&&this.set(ye,this.calculateCenterRotate(g,a.anchor)),this.set(Ee,g)}if(e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(ge,-1);var v=n[0].callback;v&&kn(v,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenter();return void 0!==n&&(Te(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),xe(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenter(),o=this.getResolution();void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]);return i},e.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+r(this)+'"]',i=document.querySelector(e);if(i){var n=getComputedStyle(i);t[0]=parseInt(n.width,10),t[1]=parseInt(n.height,10)}return t},e.prototype.constrainCenter=function(t){return this.constraints_.center(t)},e.prototype.constrainResolution=function(t,e,i){var n=e||0,o=i||0;return this.constraints_.resolution(t,n,o)},e.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},e.prototype.getCenter=function(){return this.get(ye)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_(),i=this.getCenter();ee(i,1);var n=this.getResolution();ee(void 0!==n,2);var o=this.getRotation();return ee(void 0!==o,3),Qe(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(me)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){var i=e||this.getSizeFromViewport_(),n=ni(t)/i[0],o=$e(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(Ee)},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/o}},e.prototype.getState=function(t){var e=this.getCenter(),i=this.getProjection(),n=this.getResolution(),o=n/t,r=this.getRotation();return{center:[Math.round(e[0]/o)*o,Math.round(e[1]/o)*o],projection:void 0!==i?i:null,resolution:n,rotation:r,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=Dt(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},e.prototype.fit=function(t,e){var i,n=e||{},o=n.size;o||(o=this.getSizeFromViewport_()),ee(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)?(ee(!ri(t),25),i=Dn(t)):t.getType()===si.CIRCLE?(i=Dn(t=t.getExtent())).rotate(this.getRotation(),qe(t)):i=t;var r,s=void 0!==n.padding?n.padding:[0,0,0,0],a=void 0===n.constrainResolution||n.constrainResolution,h=void 0!==n.nearest&&n.nearest;r=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.constrainResolution(this.maxResolution_,n.maxZoom-this.minZoom_,0):0;for(var l=i.getFlatCoordinates(),u=this.getRotation(),c=Math.cos(-u),p=Math.sin(-u),d=1/0,f=1/0,_=-1/0,g=-1/0,v=i.getStride(),y=0,m=l.length;y<m;y+=v){var E=l[y]*c-l[y+1]*p,x=l[y]*p+l[y+1]*c;d=Math.min(d,E),f=Math.min(f,x),_=Math.max(_,E),g=Math.max(g,x)}var T=this.getResolutionForExtent([d,f,_,g],[o[0]-s[1]-s[3],o[1]-s[0]-s[2]]);if(T=isNaN(T)?r:Math.max(T,r),a){var S=this.constrainResolution(T,0,0);!h&&S<T&&(S=this.constrainResolution(S,-1,0)),T=S}p=-p;var R=(d+_)/2,w=(f+g)/2,I=[(R+=(s[1]-s[3])/2*T)*c-(w+=(s[0]-s[2])/2*T)*p,w*c+R*p],O=n.callback?n.callback:C;void 0!==n.duration?this.animate({resolution:T,center:I,duration:n.duration,easing:n.easing},O):(this.setResolution(T),this.setCenter(I),kn(O,!0))},e.prototype.centerOn=function(t,e,i){var n=this.getRotation(),o=Math.cos(-n),r=Math.sin(-n),s=t[0]*o-t[1]*r,a=t[1]*o+t[0]*r,h=this.getResolution(),l=(s+=(e[0]/2-i[0])*h)*o-(a+=(i[1]-e[1]/2)*h)*(r=-r),u=a*o+s*r;this.setCenter([l,u])},e.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},e.prototype.rotate=function(t,e){if(void 0!==e){var i=this.calculateCenterRotate(t,e);this.setCenter(i)}this.setRotation(t)},e.prototype.setCenter=function(t){this.set(ye,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.set(me,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setRotation=function(t){this.set(Ee,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e}(F);function Yn(t,e){var i=document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function Xn(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function jn(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var Kn={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"},Wn=function(t){function e(e){t.call(this);var i=u({},e);i[Kn.OPACITY]=void 0!==e.opacity?e.opacity:1,i[Kn.VISIBLE]=void 0===e.visible||e.visible,i[Kn.Z_INDEX]=e.zIndex,i[Kn.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,i[Kn.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,this.setProperties(i),this.state_=null,this.type}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return this.type},e.prototype.getLayerState=function(){var t=this.state_||{layer:this,managed:!0};return t.opacity=se(this.getOpacity(),0,1),t.sourceState=this.getSourceState(),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=this.getZIndex()||0,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),this.state_=t,t},e.prototype.getLayersArray=function(t){return n()},e.prototype.getLayerStatesArray=function(t){return n()},e.prototype.getExtent=function(){return this.get(Kn.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(Kn.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(Kn.MIN_RESOLUTION)},e.prototype.getOpacity=function(){return this.get(Kn.OPACITY)},e.prototype.getSourceState=function(){return n()},e.prototype.getVisible=function(){return this.get(Kn.VISIBLE)},e.prototype.getZIndex=function(){return this.get(Kn.Z_INDEX)},e.prototype.setExtent=function(t){this.set(Kn.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(Kn.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(Kn.MIN_RESOLUTION,t)},e.prototype.setOpacity=function(t){this.set(Kn.OPACITY,t)},e.prototype.setVisible=function(t){this.set(Kn.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(Kn.Z_INDEX,t)},e}(F),Un={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},zn={LAYERS:"layers"},Bn=function(t){function e(e){var i=e||{},n=u({},i);delete n.layers;var o=i.layers;t.call(this,n),this.layersListenerKeys_=[],this.listenerKeys_={},v(this,D(zn.LAYERS),this.handleLayersChanged_,this),o?Array.isArray(o)?o=new N(o.slice(),{unique:!0}):ee("function"==typeof o.getArray,43):o=new N(void 0,{unique:!0}),this.setLayers(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(E),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(v(t,h.ADD,this.handleLayersAdd_,this),v(t,h.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(E);c(this.listenerKeys_);for(var i=t.getArray(),n=0,o=i.length;n<o;n++){var s=i[n];this.listenerKeys_[r(s)]=[v(s,l,this.handleLayerChange_,this),v(s,M.CHANGE,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[r(e)]=[v(e,l,this.handleLayerChange_,this),v(e,M.CHANGE,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=r(t.element);this.listenerKeys_[e].forEach(E),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(zn.LAYERS)},e.prototype.setLayers=function(t){this.set(zn.LAYERS,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});for(var n=this.getLayerState(),o=i,r=e.length;o<r;o++){var s=e[o];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),void 0!==n.extent&&(void 0!==s.extent?s.extent=ti(s.extent,n.extent):s.extent=n.extent)}return e},e.prototype.getSourceState=function(){return Un.READY},e}(Wn);function Zn(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}var Hn=function(t){function e(e){t.call(this);var i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,n,o,r={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Bn({layers:t.layers});r[Vt.LAYERGROUP]=s,r[Vt.TARGET]=t.target,r[Vt.VIEW]=void 0!==t.view?t.view:new Nn,void 0!==t.controls&&(Array.isArray(t.controls)?i=new N(t.controls.slice()):(ee("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new N(t.interactions.slice()):(ee("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new N(t.overlays.slice()):(ee("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new N;return{controls:i,interactions:n,keyboardEventTarget:e,overlays:o,values:r}}(e);this.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,this.loadTilesWhileAnimating_=void 0!==e.loadTilesWhileAnimating&&e.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==e.loadTilesWhileInteracting&&e.loadTilesWhileInteracting,this.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:B,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+(H?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var n=[M.CLICK,M.DBLCLICK,M.MOUSEDOWN,M.TOUCHSTART,M.MSPOINTERDOWN,J.POINTERDOWN,M.MOUSEWHEEL,M.WHEEL],o=0,r=n.length;o<r;++o)v(this.overlayContainerStopEvent_,n[o],I);for(var s in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new zt(this,e.moveTolerance),J)v(this.mapBrowserEventHandler_,J[s],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,v(this.viewport_,M.CONTEXTMENU,this.handleBrowserEvent,this),v(this.viewport_,M.WHEEL,this.handleBrowserEvent,this),v(this.viewport_,M.MOUSEWHEEL,this.handleBrowserEvent,this),this.controls=i.controls||new N,this.interactions=i.interactions||new N,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=this.createRenderer(),this.handleResize_,this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new ne(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},v(this,D(Vt.LAYERGROUP),this.handleLayerGroupChanged_,this),v(this,D(Vt.VIEW),this.handleViewChanged_,this),v(this,D(Vt.SIZE),this.handleSizeChanged_,this),v(this,D(Vt.TARGET),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach(function(t){t.setMap(this)}.bind(this)),v(this.controls,h.ADD,function(t){t.element.setMap(this)},this),v(this.controls,h.REMOVE,function(t){t.element.setMap(null)},this),this.interactions.forEach(function(t){t.setMap(this)}.bind(this)),v(this.interactions,h.ADD,function(t){t.element.setMap(this)},this),v(this.interactions,h.REMOVE,function(t){t.element.setMap(null)},this),this.overlays_.forEach(this.addOverlayInternal_.bind(this)),v(this.overlays_,h.ADD,function(t){this.addOverlayInternal_(t.element)},this),v(this.overlays_,h.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)},this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),m(this.viewport_,M.CONTEXTMENU,this.handleBrowserEvent,this),m(this.viewport_,M.WHEEL,this.handleBrowserEvent,this),m(this.viewport_,M.MOUSEWHEEL,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(removeEventListener(M.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var n=this.getCoordinateFromPixel(t),o=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,r=void 0!==i.layerFilter?i.layerFilter:S;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=null;return this.forEachFeatureAtPixel(t,function(t){i||(i=[]),i.push(t)},e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var n=i||{},o=void 0!==n.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,r=n.layerFilter||S;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,e,null,r,null)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixel(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:S,o=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Vt.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){var e=this.frameState_;return e?qi(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Vt.LAYERGROUP)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getPixelFromCoordinate=function(t){var e=this.frameState_;return e?qi(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Vt.SIZE)},e.prototype.getView=function(){return this.get(Vt.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,i,n){var o=this.frameState_;if(!(o&&e in o.wantedTiles))return 1/0;if(!o.wantedTiles[e][t.getKey()])return 1/0;var r=i[0]-o.focus[0],s=i[1]-o.focus[1];return 65536*Math.log(n)+Math.sqrt(r*r+s*s)/n},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new X(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var e=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var i=e.length-1;i>=0;i--){var n=e[i];if(n.getActive())if(!n.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;o[ge]&&(i=this.loadTilesWhileAnimating_?8:0,n=2),o[ve]&&(i=this.loadTilesWhileInteracting_?8:0,n=2)}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}!t||!this.hasListener($t)||t.animate||this.tileQueue_.getTilesLoading()||function t(e){for(var i=0,n=e.length;i<n;++i){var o=e[i];if("function"==typeof o.getLayers)return t(o.getLayers().getArray());var r=o.getSource();if(r&&r.loading)return!0}return!1}(this.getLayers().getArray())||this.renderer_.dispatchRenderEvent($t,t);for(var r=this.postRenderFunctions_,s=0,a=r.length;s<a;++s)r[s](this,t);r.length=0},e.prototype.handleSizeChanged_=function(){this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)E(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[v(n,M.KEYDOWN,this.handleBrowserEvent,this),v(n,M.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(M.RESIZE,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),jn(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(M.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(E(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(E(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",r(t)),this.viewPropertyListenerKey_=v(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=v(t,M.CHANGE,this.handleViewPropertyChanged_,this)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(E),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[v(t,l,this.render,this),v(t,M.CHANGE,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e,i=this.getSize(),n=this.getView(),o=[1/0,1/0,-1/0,-1/0],s=this.frameState_,a=null;if(void 0!==i&&function(t){return t[0]>0&&t[1]>0}(i)&&n&&n.isDef()){for(var h=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},c=0,p=l.length;c<p;++c)u[r(l[c].layer)]=l[c];e=n.getState(this.pixelRatio_),a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:o,focus:this.focus_?this.focus_:e.center,index:this.frameIndex_++,layerStates:u,layerStatesArray:l,pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:h,wantedTiles:{}}}if(a&&(a.extent=Qe(e.center,e.resolution,e.rotation,a.size,o)),this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),s)(!this.previousExtent_||!ri(this.previousExtent_)&&!je(a.extent,this.previousExtent_))&&(this.dispatchEvent(new Y(Zt,this,s)),this.previousExtent_=Xe(this.previousExtent_));this.previousExtent_&&!a.viewHints[ge]&&!a.viewHints[ve]&&!je(a.extent,this.previousExtent_)&&(this.dispatchEvent(new Y(Ht,this,a)),Pe(a.extent,this.previousExtent_))}this.dispatchEvent(new Y(Bt,this,a)),setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(Vt.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(Vt.SIZE,t)},e.prototype.setTarget=function(t){this.set(Vt.TARGET,t)},e.prototype.setView=function(t){this.set(Vt.VIEW,t)},e.prototype.skipFeature=function(t){this.skippedFeatureUids_[r(t)]=!0,this.render()},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0)},e.prototype.unskipFeature=function(t){delete this.skippedFeatureUids_[r(t)],this.render()},e}(F);var Vn,qn,Jn=function(t){function e(e){t.call(this),this.element=e.element?e.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=e.render?e.render:C,e.target&&this.setTarget(e.target)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){jn(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&jn(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)E(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==C&&this.listenerKeys.push(v(t,Bt,this.render,this)),t.render())},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(F),Qn="ol-hidden",$n="ol-unselectable",to="ol-control",eo="ol-collapsed",io=(qn={},function(t){if(Vn||(Vn=document.createElement("div").style),!(t in qn)){Vn.font=t;var e=Vn.fontFamily;if(Vn.font="",!e)return null;qn[t]=e.split(/,\s?/)}return qn[t]});function no(t,e){return t.visible&&e>=t.minResolution&&e<t.maxResolution}var oo=function(t){function e(e){var i=u({},e);delete i.source,t.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,e.map&&this.setMap(e.map),v(this,D(Kn.SOURCE),this.handleSourcePropertyChange_,this);var n=e.source?e.source:null;this.setSource(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Kn.SOURCE)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Un.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(E(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=v(t,M.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(E(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(E(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=v(t,Jt,function(t){var e=t,i=this.getLayerState();i.managed=!1,void 0===this.getZIndex()&&(i.zIndex=1/0),e.frameState.layerStatesArray.push(i),e.frameState.layerStates[r(this)]=i},this),this.mapRenderKey_=v(this,M.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Kn.SOURCE,t)},e}(Wn);function ro(t){this.updateElement_(t.frameState)}var so=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||ro,target:i.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===i.collapsed||i.collapsed,this.overrideCollapsible_=void 0!==i.collapsible,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var n=void 0!==i.className?i.className:"ol-attribution",o=void 0!==i.tipLabel?i.tipLabel:"Attributions",r=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r):this.collapseLabel_=r;var s=void 0!==i.label?i.label:"i";"string"==typeof s?(this.label_=document.createElement("span"),this.label_.textContent=s):this.label_=s;var a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(a),v(h,M.CLICK,this.handleClick_,this);var l=n+" "+$n+" "+to+(this.collapsed_&&this.collapsible_?" "+eo:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=l,u.appendChild(this.ulElement_),u.appendChild(h),this.renderedAttributions_=[],this.renderedVisible_=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=t.layerStatesArray,o=t.viewState.resolution,r=0,s=n.length;r<s;++r){var a=n[r];if(no(a,o)){var h=a.layer.getSource();if(h){var l=h.getAttributions();if(l){var u=l(t);if(u)if(this.overrideCollapsible_||!1!==h.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(u))for(var c=0,p=u.length;c<p;++c)u[c]in e||(i.push(u[c]),e[u[c]]=!0);else u in e||(i.push(u),e[u]=!0)}}}}return i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Gt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n<o;++n){var r=document.createElement("li");r.innerHTML=e[n],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(eo),this.collapsed_?Xn(this.collapseLabel_,this.label_):Xn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e}(Jn);function ao(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(Qn);o||0!==i?o&&0!==i&&this.element.classList.remove(Qn):this.element.classList.add(Qn)}this.label_.style.msTransform=n,this.label_.style.webkitTransform=n,this.label_.style.transform=n}this.rotation_=i}}var ho=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||ao,target:i.target});var n=void 0!==i.className?i.className:"ol-rotate",o=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof o?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=o):(this.label_=o,this.label_.classList.add("ol-compass"));var r=i.tipLabel?i.tipLabel:"Reset rotation",s=document.createElement("button");s.className=n+"-reset",s.setAttribute("type","button"),s.title=r,s.appendChild(this.label_),v(s,M.CLICK,this.handleClick_,this);var a=n+" "+$n+" "+to,h=this.element;h.className=a,h.appendChild(s),this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Qn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:Ce}):t.setRotation(0))},e}(Jn),lo=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target});var n=void 0!==i.className?i.className:"ol-zoom",o=void 0!==i.delta?i.delta:1,r=void 0!==i.zoomInLabel?i.zoomInLabel:"+",s=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",a=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",h=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=n+"-in",l.setAttribute("type","button"),l.title=a,l.appendChild("string"==typeof r?document.createTextNode(r):r),v(l,M.CLICK,this.handleClick_.bind(this,o));var u=document.createElement("button");u.className=n+"-out",u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof s?document.createTextNode(s):s),v(u,M.CLICK,this.handleClick_.bind(this,-o));var c=n+" "+$n+" "+to,p=this.element;p.className=c,p.appendChild(l),p.appendChild(u),this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var n=e.constrainResolution(i,t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:n,duration:this.duration_,easing:Ce})):e.setResolution(n)}}},e}(Jn);var uo=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};uo.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},uo.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},uo.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},uo.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},uo.prototype.getAngle=function(){return this.angle_};var co=uo,po="active";function fo(t,e,i,n){e=t.constrainRotation(e,0),_o(t,e,i,n)}function _o(t,e,i,n){if(void 0!==e){var o=t.getRotation(),r=t.getCenter();void 0!==o&&r&&n>0?t.animate({rotation:e,anchor:i,duration:n,easing:Ce}):t.rotate(e,i)}}function go(t,e,i,n){var o=t.getResolution(),r=t.constrainResolution(o,e,0);if(void 0!==r){var s=t.getResolutions();r=se(r,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==r&&r!==o){var a=t.getCenter(),h=t.calculateCenterZoom(r,i);h=t.constrainCenter(h),i=[(r*a[0]-o*h[0])/(r-o),(r*a[1]-o*h[1])/(r-o)]}vo(t,r,i,n)}function vo(t,e,i,n){if(e){var o=t.getResolution(),r=t.getCenter();if(void 0!==o&&r&&e!==o&&n)t.animate({resolution:e,anchor:i,duration:n,easing:Ce});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}var yo=function(t){function e(e){t.call(this),e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getActive=function(){return this.get(po)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(po,t)},e.prototype.setMap=function(t){this.map_=t},e}(F);function mo(t){var e=!1;if(t.type==J.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;go(n.getView(),r,o,this.duration_),t.preventDefault(),e=!0}return!e}var Eo=function(t){function e(e){t.call(this,{handleEvent:mo});var i=e||{};this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yo),xo=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},To=function(t){return t.target.getTargetElement()===document.activeElement},So=S,Ro=function(t){var e=t.originalEvent;return 0==e.button&&!(U&&z&&e.ctrlKey)},Co=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},wo=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Io=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Oo=function(t){var e=t.pointerEvent;return ee(void 0!==e,56),"mouse"==e.pointerType};function Lo(t){for(var e=t.length,i=0,n=0,o=0;o<e;o++)i+=t[o].clientX,n+=t[o].clientY;return[i/e,n/e]}var Mo=function(t){function e(e){var i=e||{};t.call(this,i),i.handleDownEvent&&(this.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(this.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(this.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(this.handleUpEvent=i.handleUpEvent),i.stopDown&&(this.stopDown=i.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==J.POINTERDRAG)this.handleDragEvent(t);else if(t.type==J.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==J.POINTERDOWN){var n=this.handleDownEvent(t);n&&t.preventDefault(),this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==J.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===J.POINTERDOWN||e===J.POINTERDRAG||e===J.POINTERUP}(t)){var e=t.pointerEvent,i=e.pointerId.toString();t.type==J.POINTERUP?delete this.trackedPointers_[i]:t.type==J.POINTERDOWN?this.trackedPointers_[i]=e:i in this.trackedPointers_&&(this.trackedPointers_[i]=e),this.targetPointers=function(t){var e=[];for(var i in t)e.push(t[i]);return e}(this.trackedPointers_)}},e}(yo),bo=function(t){function e(e){t.call(this,{stopDown:R});var i=e||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1,this.condition_=i.condition?i.condition:Co,this.noKinetic_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().setHint(ve,1));var e=this.targetPointers,i=Lo(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var n=this.lastCentroid[0]-i[0],o=i[1]-this.lastCentroid[1],r=t.map.getView(),s=[n,o];Se(s,r.getResolution()),Te(s,r.getRotation()),xe(s,r.getCenter()),s=r.constrainCenter(s),r.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),r=i.getCenter(),s=e.getPixelFromCoordinate(r),a=e.getCoordinateFromPixel([s[0]-n*Math.cos(o),s[1]-n*Math.sin(o)]);i.animate({center:i.constrainCenter(a),duration:500,easing:Ce})}return this.panning_&&(this.panning_=!1,i.setHint(ve,-1)),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Mo),Po=function(t){function e(e){var i=e||{};t.call(this,{stopDown:R}),this.condition_=i.condition?i.condition:xo,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){if(Oo(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==fe){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_,a=i.getRotation();_o(i,a-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){if(!Oo(t))return!0;var e=t.map.getView();e.setHint(ve,-1);var i=e.getRotation();return fo(e,i,void 0,this.duration_),!1},e.prototype.handleDownEvent=function(t){return!!Oo(t)&&(!(!Ro(t)||!this.condition_(t))&&(t.map.getView().setHint(ve,1),this.lastAngle_=void 0,!0))},e}(Mo),Ao=function(t){function e(e){t.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new An([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(T),Do="boxstart",Fo="boxdrag",ko="boxend",Go=function(t){function e(e,i,n){t.call(this,e),this.coordinate=i,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O);function No(){var t,e,i=this.getMap(),n=i.getView(),o=i.getSize(),r=this.getGeometry().getExtent();if(this.out_){var s=n.calculateExtent(o),a=(t=[i.getPixelFromCoordinate(He(r)),i.getPixelFromCoordinate(ii(r))],Ue(Xe(e),t));!function(t,e){var i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}(s,1/n.getResolutionForExtent(a,o)),r=s}var h=n.constrainResolution(n.getResolutionForExtent(r,o)),l=qe(r);l=n.constrainCenter(l),n.animate({resolution:h,center:l,duration:this.duration_,easing:Ce})}var Yo=function(t){function e(e){var i=e||{},n=i.condition?i.condition:wo;t.call(this,{condition:n,className:i.className||"ol-dragzoom",onBoxEnd:No}),this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){t.call(this);var i=e||{};this.box_=new Ao(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.onBoxEnd_=i.onBoxEnd?i.onBoxEnd:C,this.startPixel_=null,this.condition_=i.condition?i.condition:So,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:this.defaultBoxEndCondition}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){Oo(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Go(Fo,t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!Oo(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new Go(ko,t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!!Oo(t)&&(!(!Ro(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Go(Do,t.coordinate,t)),!0))},e}(Mo)),Xo={LEFT:37,UP:38,RIGHT:39,DOWN:40};function jo(t){var e=!1;if(t.type==M.KEYDOWN){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==Xo.DOWN||i==Xo.LEFT||i==Xo.RIGHT||i==Xo.UP)){var n=t.map.getView(),o=n.getResolution()*this.pixelDelta_,r=0,s=0;i==Xo.DOWN?s=-o:i==Xo.LEFT?r=-o:i==Xo.RIGHT?r=o:s=o;var a=[r,s];Te(a,n.getRotation()),function(t,e,i){var n=t.getCenter();if(n){var o=t.constrainCenter([n[0]+e[0],n[1]+e[1]]);i?t.animate({duration:i,easing:Ie,center:o}):t.setCenter(o)}}(n,a,this.duration_),t.preventDefault(),e=!0}}return!e}var Ko=function(t){function e(e){t.call(this,{handleEvent:jo});var i=e||{};this.defaultCondition_=function(t){return Co(t)&&Io(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yo);function Wo(t){var e=!1;if(t.type==M.KEYDOWN||t.type==M.KEYPRESS){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var n=t.map,o=i=="+".charCodeAt(0)?this.delta_:-this.delta_;go(n.getView(),o,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}var Uo=function(t){function e(e){t.call(this,{handleEvent:Wo});var i=e||{};this.condition_=i.condition?i.condition:Io,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yo),zo="trackpad",Bo="wheel",Zo=function(t){function e(e){var i=e||{};t.call(this,i),this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.condition_=i.condition?i.condition:So,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(ve,-1)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==M.WHEEL&&e!==M.MOUSEWHEEL)return!0;t.preventDefault();var i,n=t.map,o=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==M.WHEEL?(i=o.deltaY,K&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=B),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==M.MOUSEWHEEL&&(i=-o.wheelDeltaY,W&&(i/=3)),0===i)return!1;var r=Date.now();if(void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?zo:Bo),this.mode_===zo){var s=n.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint(ve,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),h=s.getMinResolution(),l=s.getMaxResolution(),u=0;if(a<h?(a=Math.max(a,h/this.trackpadZoomBuffer_),u=1):a>l&&(a=Math.min(a,l*this.trackpadZoomBuffer_),u=-1),this.lastAnchor_){var c=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(c))}return s.setResolution(a),0===u&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,i>0?-1:1),easing:Ce,anchor:this.lastAnchor_,duration:this.duration_}),u>0?s.animate({resolution:h,easing:Ce,anchor:this.lastAnchor_,duration:500}):u<0&&s.animate({resolution:l,easing:Ce,anchor:this.lastAnchor_,duration:500}),this.startTime_=r,!1}this.delta_+=i;var p=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),p),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();go(e,-se(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=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}(yo),Ho=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=R),t.call(this,n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==fe){var h=s.getViewport().getBoundingClientRect(),l=Lo(this.targetPointers);if(l[0]-=h.left,l[1]-=h.top,this.anchor_=s.getCoordinateFromPixel(l),this.rotating_){var u=a.getRotation();s.render(),_o(a,u+e,this.anchor_)}}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(ve,-1),this.rotating_){var i=e.getRotation();fo(e,i,this.anchor_,this.duration_)}return!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().setHint(ve,1),!0}return!1},e}(Mo),Vo=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=R),t.call(this,n),this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,h=a.getView(),l=h.getResolution(),u=h.getMaxResolution(),c=h.getMinResolution(),p=l*e;p>u?(e=u/l,p=u):p<c&&(e=c/l,p=c),1!=e&&(this.lastScaleDelta_=e);var d=a.getViewport().getBoundingClientRect(),f=Lo(this.targetPointers);f[0]-=d.left,f[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(f),a.render(),vo(h,p,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();e.setHint(ve,-1);var i=e.getResolution();if(this.constrainResolution_||i<e.getMinResolution()||i>e.getMaxResolution()){var n=this.lastScaleDelta_-1;!function(t,e,i,n,o){e=t.constrainResolution(e,0,o),vo(t,e,i,n)}(e,i,this.anchor_,this.duration_,n)}return!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().setHint(ve,1),!0}return!1},e}(Mo);var qo=.5,Jo={IDLE:0,LOADING:1,LOADED:2,ERROR:3},Qo=function(t){function e(e,i,n,o,r){var s=void 0!==r?Jo.IDLE:Jo.LOADED;t.call(this,e,i,n,s),this.loader_=void 0!==r?r:null,this.canvas_=o,this.error_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Jo.ERROR):this.state=Jo.LOADED,this.changed()},e.prototype.load=function(){this.state==Jo.IDLE&&(this.state=Jo.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(function(t){function e(e,i,n,o){t.call(this),this.extent=e,this.pixelRatio_=n,this.resolution=i,this.state=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(M.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return n()},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(){n()},e}(L)),$o={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"},tr="image",er=function(t){function e(e,i,n,o,r){t.call(this,e),this.vectorContext=i,this.frameState=n,this.context=o,this.glContext=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O),ir=function(t){function e(e){t.call(this),this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(M.CLEAR)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},e.prototype.get=function(t){var e=this.entries_[t];return ee(void 0!==e,15),e===this.newest_?e.value_:(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e,e.value_)},e.prototype.remove=function(t){var e=this.entries_[t];return ee(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},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 t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){ee(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(L),nr=[0,0,0,1],or=[],rr=[0,0,0,1],sr=[0,0,0,0],ar=new ir,hr={},lr=null,ur={},cr=function(){var t,e,i=60,n=hr,o="32px ",r=["monospace","serif"],s=r.length,a="wmytzilWMYTZIL@#/&?$%10";function h(t){for(var i=pr(),n=100;n<=700;n+=300){for(var h=n+" ",l=!0,u=0;u<s;++u){var c=r[u];if(i.font=h+o+c,e=i.measureText(a).width,t!=c){i.font=h+o+t+","+c;var p=i.measureText(a).width;l=l&&p!=e}}if(l)return!0}return!1}function l(){var e=!0;for(var o in n)n[o]<i&&(h(o)?(n[o]=i,c(ur),lr=null,ar.clear()):(++n[o],e=!1));e&&(clearInterval(t),t=void 0)}return function(e){var o=io(e);if(o)for(var r=0,s=o.length;r<s;++r){var a=o[r];a in n||(n[a]=i,h(a)||(n[a]=0,void 0===t&&(t=setInterval(l,32))))}}}();function pr(){return lr||(lr=Yn(1,1)),lr}var dr,fr,_r=(fr=ur,function(t){var e=fr[t];return null==e&&(dr||((dr=document.createElement("span")).textContent="M",dr.style.margin=dr.style.padding="0 !important",dr.style.position="absolute !important",dr.style.left="-99999px !important"),dr.style.font=t,document.body.appendChild(dr),e=fr[t]=dr.offsetHeight,document.body.removeChild(dr)),e});function gr(t,e){var i=pr();return t!=i.font&&(i.font=t),i.measureText(e).width}function vr(t,e,i,n){0!==e&&(t.translate(i,n),t.rotate(e),t.translate(-i,-n))}var yr=[1,0,0,1,0,0];function mr(t,e,i,n,o,r,s,a,h,l,u){var c;1!=i&&(c=t.globalAlpha,t.globalAlpha=c*i),e&&t.setTransform.apply(t,e),t.drawImage(n,o,r,s,a,h,l,s*u,a*u),c&&(t.globalAlpha=c),e&&t.setTransform.apply(t,yr)}var Er=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,xr=/^([a-z]*)$/i;function Tr(t){return"string"==typeof t?t:Rr(t)}!function(){var t={},e=0}();function Sr(t){return t[0]=se(t[0]+.5|0,0,255),t[1]=se(t[1]+.5|0,0,255),t[2]=se(t[2]+.5|0,0,255),t[3]=se(t[3],0,1),t}function Rr(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function Cr(t){return Array.isArray(t)?Rr(t):t}var wr=function(){};wr.prototype.drawCustom=function(t,e,i){},wr.prototype.drawGeometry=function(t){},wr.prototype.setStyle=function(t){},wr.prototype.drawCircle=function(t,e){},wr.prototype.drawFeature=function(t,e){},wr.prototype.drawGeometryCollection=function(t,e){},wr.prototype.drawLineString=function(t,e){},wr.prototype.drawMultiLineString=function(t,e){},wr.prototype.drawMultiPoint=function(t,e){},wr.prototype.drawMultiPolygon=function(t,e){},wr.prototype.drawPoint=function(t,e){},wr.prototype.drawPolygon=function(t,e){},wr.prototype.drawText=function(t,e){},wr.prototype.setFillStrokeStyle=function(t,e){},wr.prototype.setImageStyle=function(t,e){},wr.prototype.setTextStyle=function(t,e){};var Ir=wr,Or=function(t){function e(e,i,n,o,r){t.call(this),this.context_=e,this.pixelRatio_=i,this.extent_=n,this.transform_=o,this.viewRotation_=r,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var o=hi(t,e,i,2,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);var h=this.imageRotation_;this.imageRotateWithView_&&(h+=this.viewRotation_);for(var l=0,u=o.length;l<u;l+=2){var c=o[l]-this.imageAnchorX_,p=o[l+1]-this.imageAnchorY_;if(0!==h||1!=this.imageScale_){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;$i(s,d,f,this.imageScale_,this.imageScale_,h,-d,-f),r.setTransform.apply(r,s)}r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}0===h&&1==this.imageScale_||r.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(r.globalAlpha=a)}},e.prototype.drawText_=function(t,e,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=hi(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=n){var a=o[e]+this.textOffsetX_,h=o[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_){var l=$i(this.tmpLocalTransform_,a,h,this.textScale_,this.textScale_,s,-a,-h);r.setTransform.apply(r,l)}this.textStrokeState_&&r.strokeText(this.text_,a,h),this.textFillState_&&r.fillText(this.text_,a,h)}0===s&&1==this.textScale_||r.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,i,n,o){var r=this.context_,s=hi(t,e,i,n,this.transform_,this.pixelCoordinates_);r.moveTo(s[0],s[1]);var a=s.length;o&&(a-=2);for(var h=2;h<a;h+=2)r.lineTo(s[h],s[h+1]);return o&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var o=0,r=i.length;o<r;++o)e=this.moveToLineTo_(t,e,i[o],n,!0);return e},e.prototype.drawCircle=function(t){if(oi(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var n=t.getFlatCoordinates();if(n){var o=t.getStride();return hi(n,0,n.length,o,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],o=Math.sqrt(i*i+n*n),r=this.context_;r.beginPath(),r.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.drawGeometry=function(t){switch(t.getType()){case si.POINT:this.drawPoint(t);break;case si.LINE_STRING:this.drawLineString(t);break;case si.POLYGON:this.drawPolygon(t);break;case si.MULTI_POINT:this.drawMultiPoint(t);break;case si.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case si.MULTI_POLYGON:this.drawMultiPolygon(t);break;case si.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case si.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&oi(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){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){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(oi(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){var e=t.getExtent();if(oi(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),o=0,r=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,h=r.length;a<h;++a)o=this.moveToLineTo_(n,o,r[a],s,!1);i.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(oi(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(oi(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),n=0,o=t.getEndss(),r=t.getStride();e.beginPath();for(var s=0,a=o.length;s<a;++s){var h=o[s];n=this.drawRings_(i,n,h,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=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=e.lineCap=t.lineCap),Z&&(Gt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,Z&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=e.font=t.font),i.textAlign!=n&&(i.textAlign=e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:Cr(i||nr)}}else this.fillState_=null;if(e){var n=e.getColor(),o=e.getLineCap(),r=e.getLineDash(),s=e.getLineDashOffset(),a=e.getLineJoin(),h=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==o?o:"round",lineDash:r||or,lineDashOffset:s||0,lineJoin:void 0!==a?a:"round",lineWidth:this.pixelRatio_*(void 0!==h?h:1),miterLimit:void 0!==l?l:10,strokeStyle:Cr(n||rr)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),n=t.getOrigin(),o=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=o[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageWidth_=o[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:Cr(i||nr)}}else this.textFillState_=null;var n=t.getStroke();if(n){var o=n.getColor(),r=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),h=n.getLineJoin(),l=n.getWidth(),u=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:"round",lineDash:s||or,lineDashOffset:a||0,lineJoin:void 0!==h?h:"round",lineWidth:void 0!==l?l:1,miterLimit:void 0!==u?u:10,strokeStyle:Cr(o||rr)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),_=t.getRotation(),g=t.getScale(),v=t.getText(),y=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==_?_:0,this.textScale_=this.pixelRatio_*(void 0!==g?g:1)}else this.text_=""},e}(Ir),Lr=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function Mr(t,e,i){return e+":"+t+":"+(i?Tr(i):"null")}Lr.prototype.clear=function(){this.cache_={},this.cacheSize_=0},Lr.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},Lr.prototype.get=function(t,e,i){var n=Mr(t,e,i);return n in this.cache_?this.cache_[n]:null},Lr.prototype.set=function(t,e,i,n){var o=Mr(t,e,i);this.cache_[o]=n,++this.cacheSize_},Lr.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var br=new Lr;function Pr(t,e){br.expire()}function Ar(t,e){return t.zIndex-e.zIndex}var Dr=[],Fr=function(t){function e(e){t.call(this,e);var i=e.getViewport();this.context_=Yn(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=$n,i.insertBefore(this.canvas_,i.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap(),n=this.context_;if(i.hasListener(t)){var o=e.extent,r=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),h=new Or(n,r,o,a,s),l=new er(t,h,e,n,null);i.dispatchEvent(l)}},e.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,n=this.canvas_.height/2,o=t.pixelRatio/e.resolution,r=-o,s=-e.rotation,a=-e.center[0],h=-e.center[1];return $i(this.transform_,i,n,o,r,s,a,h)},e.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,n=Math.round(t.size[0]*i),o=Math.round(t.size[1]*i);this.canvas_.width!=n||this.canvas_.height!=o?(this.canvas_.width=n,this.canvas_.height=o):e.clearRect(0,0,n,o);var r=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchRenderEvent(Jt,t);var s=t.layerStatesArray;!function(t,e){var i,n=t.length,o=Array(t.length);for(i=0;i<n;i++)o[i]={index:i,value:t[i]};for(o.sort(function(t,i){return e(t.value,i.value)||t.index-i.index}),i=0;i<t.length;i++)t[i]=o[i].value}(s,Ar),r&&(e.save(),vr(e,r,n/2,o/2));var a,h,l=t.viewState.resolution;for(a=0,h=s.length;a<h;++a){var u=s[a],c=u.layer,p=this.getLayerRenderer(c);no(u,l)&&u.sourceState==Un.READY&&(p.prepareFrame(t,u)&&p.composeFrame(t,u,e))}r&&e.restore(),this.dispatchRenderEvent(qt,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o,r,s){var a,h,l=e.viewState.resolution,u=e.layerStatesArray,c=u.length,p=qi(e.pixelToCoordinateTransform,t.slice());for(h=c-1;h>=0;--h){var d=u[h],f=d.layer;if(no(d,l)&&r.call(s,f))if(a=this.getLayerRenderer(f).forEachLayerAtCoordinate(p,e,i,n,o))return a}},e.prototype.registerLayerRenderers=function(e){t.prototype.registerLayerRenderers.call(this,e);for(var i=0,n=e.length;i<n;++i){var o=e[i];r=o,Dr.indexOf(r)>=0||Dr.push(o)}var r},e}(function(t){function e(e){t.call(this),this.map_=e,this.layerRenderers_={},this.layerRendererListeners_={},this.layerRendererConstructors_=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){n()},e.prototype.registerLayerRenderers=function(t){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,t)},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;$i(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),function(t){var e,i=(e=t)[0]*e[3]-e[1]*e[2];ee(0!==i,32);var n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],h=t[5];t[0]=s/i,t[1]=-o/i,t[2]=-r/i,t[3]=n/i,t[4]=(r*h-s*a)/i,t[5]=-(n*h-o*a)/i}(Vi(n,i))},e.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,s,a){var h,l=e.viewState,u=l.resolution;function c(t,i){var s=e.layerStates[r(i)].managed;if(!(r(t)in e.skippedFeatureUids)||s)return n.call(o,t,s?i:null)}var p=l.projection,d=t;if(p.canWrapX()){var f=p.getExtent(),_=ni(f),g=t[0];if(g<f[0]||g>f[2])d=[g+_*Math.ceil((f[0]-g)/_),t[1]]}var v,y=e.layerStatesArray;for(v=y.length-1;v>=0;--v){var m=y[v],E=m.layer;if(no(m,u)&&s.call(a,E)){var x=this.getLayerRenderer(E),T=E.getSource();if(T&&(h=x.forEachFeatureAtCoordinate(T.getWrapX()?d:t,e,i,c)),h)return h}}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,r,s,a){return n()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,S,this,n,o)},e.prototype.getLayerRenderer=function(t){var e=r(t);if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,n=0,o=this.layerRendererConstructors_.length;n<o;++n){var s=this.layerRendererConstructors_[n];if(s.handles(t)){i=s.create(this,t);break}}if(!i)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[e]=i,this.layerRendererListeners_[e]=v(i,M.CHANGE,this.handleLayerRendererChange_,this),i},e.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},e.prototype.getLayerRenderers=function(){return this.layerRenderers_},e.prototype.getMap=function(){return this.map_},e.prototype.handleLayerRendererChange_=function(){this.map_.render()},e.prototype.removeLayerRendererByKey_=function(t){var e=this.layerRenderers_[t];return delete this.layerRenderers_[t],E(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],e},e.prototype.removeUnusedLayerRenderers_=function(t,e){for(var i in this.layerRenderers_)e&&i in e.layerStates||this.removeLayerRendererByKey_(i).dispose()},e.prototype.renderFrame=function(t){n()},e.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Pr)},e.prototype.scheduleRemoveUnusedLayerRenderers=function(t){for(var e in this.layerRenderers_)if(!(e in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},e}(T)),kr=function(t){function e(e){t.call(this,e),this.renderedResolution,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n,r=e.size[1]*n,s=e.viewState.rotation,a=ei(i),h=ii(i),l=Ve(i),u=He(i);qi(e.coordinateToPixelTransform,a),qi(e.coordinateToPixelTransform,h),qi(e.coordinateToPixelTransform,l),qi(e.coordinateToPixelTransform,u),t.save(),vr(t,-s,o/2,r/2),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),vr(t,s,o/2,r/2)},e.prototype.dispatchComposeEvent_=function(t,e,i,n){var o=this.getLayer();if(o.hasListener(t)){var r=i.size[0]*i.pixelRatio,s=i.size[1]*i.pixelRatio,a=i.viewState.rotation;vr(e,-a,r/2,s/2);var h=void 0!==n?n:this.getTransform(i,0),l=new Or(e,i.pixelRatio,i.extent,h,i.viewState.rotation),u=new er(t,l,i,e,null);o.dispatchEvent(u),vr(e,a,r/2,s/2)}},e.prototype.forEachLayerAtCoordinate=function(t,e,i,n,o){return this.forEachFeatureAtCoordinate(t,e,i,S)?n.call(o,this.getLayer(),null):void 0},e.prototype.postCompose=function(t,e,i,n){this.dispatchComposeEvent_(qt,t,e,n)},e.prototype.preCompose=function(t,e,i){this.dispatchComposeEvent_(Jt,t,e,i)},e.prototype.dispatchRenderEvent=function(t,e,i){this.dispatchComposeEvent_(Qt,t,e,i)},e.prototype.getTransform=function(t,e){var i=t.viewState,n=t.pixelRatio,o=n*t.size[0]/2,r=n*t.size[1]/2,s=n/i.resolution,a=-s,h=-i.rotation,l=-i.center[0]+e,u=-i.center[1];return $i(this.transform_,o,r,s,a,h,l,u)},e.prototype.composeFrame=function(t,e,i){n()},e.prototype.prepareFrame=function(t,e){return n()},e}(function(t){function e(e){t.call(this),this.layer_=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){return t.forEachLoadedTile(e,n,o,function(t){i[n]||(i[n]={}),i[n][t.tileCoord.toString()]=t})}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n){},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleImageChange_=function(t){t.target.getState()===Jo.LOADED&&this.renderIfReadyAndVisible()},e.prototype.hasFeatureAtCoordinate=function(t,e){return!1},e.prototype.loadImage=function(t){var e=t.getState();return e!=Jo.LOADED&&e!=Jo.ERROR&&v(t,M.CHANGE,this.handleImageChange_,this),e==Jo.IDLE&&(t.load(),e=t.getState()),e==Jo.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Un.READY&&this.changed()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var n=r(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i,n){var o=r(e),s=i.toString();o in t?s in t[o]?t[o][s].extend(n):t[o][s]=n:(t[o]={},t[o][s]=n)},e.prototype.manageTilePyramid=function(t,e,i,n,o,s,a,h,l,u){var c=r(e);c in t.wantedTiles||(t.wantedTiles[c]={});var p,d,f,_,g,v,y=t.wantedTiles[c],m=t.tileQueue;for(v=i.getMinZoom();v<=a;++v)for(d=i.getTileRangeForExtentAndZ(s,v,d),f=i.getResolution(v),_=d.minX;_<=d.maxX;++_)for(g=d.minY;g<=d.maxY;++g)a-v<=h?((p=e.getTile(v,_,g,n,o)).getState()==te.IDLE&&(y[p.getKey()]=!0,m.isKeyQueued(p.getKey())||m.enqueue([p,c,i.getTileCoordCenter(p.tileCoord),f])),void 0!==l&&l.call(u,p)):e.useTile(v,_,g,o)},e}(b)),Gr=function(t){function e(e){t.call(this,e),this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0],this.hitCanvasContext_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.composeFrame=function(t,e,i){this.preCompose(i,t);var n=this.getImage();if(n){var o=e.extent,r=void 0!==o&&!Fe(o,t.extent)&&oi(o,t.extent);r&&this.clip(i,t,o);var s=this.getImageTransform(),a=i.globalAlpha;i.globalAlpha=e.opacity;var h=s[4],l=s[5],u=n.width*s[0],c=n.height*s[3];u>=.5&&c>=.5&&i.drawImage(n,0,0,+n.width,+n.height,Math.round(h),Math.round(l),Math.round(u),Math.round(c)),i.globalAlpha=a,r&&i.restore()}this.postCompose(i,t,e)},e.prototype.getImage=function(){return n()},e.prototype.getImageTransform=function(){return n()},e.prototype.forEachLayerAtCoordinate=function(t,e,i,n,o){if(this.getImage()){var r=qi(this.coordinateToCanvasPixelTransform,t.slice());Se(r,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=Yn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return s[3]>0?n.call(o,this.getLayer(),s):void 0}},e}(kr),Nr=function(t){function e(i){if(t.call(this,i),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,i.getType()===$o.VECTOR)for(var n=0,o=Dr.length;n<o;++n){var r=Dr[n];if(r!==e&&r.handles(i)){this.vectorRenderer_=new r(i);break}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.vectorRenderer_&&this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.prepareFrame=function(t,e){var i,n=t.pixelRatio,o=t.size,r=t.viewState,s=r.center,a=r.resolution,h=this.getLayer().getSource(),l=t.viewHints,c=this.vectorRenderer_,p=t.extent;if(c||void 0===e.extent||(p=ti(p,e.extent)),!l[ge]&&!l[ve]&&!ri(p)){var d=r.projection,f=this.skippedFeatures_;if(c){var _=c.context,g=u({},t,{size:[ni(p)/a,$e(p)/a],viewState:u({},t.viewState,{rotation:0})}),v=Object.keys(g.skippedFeatureUids).sort();i=new Qo(p,a,n,_.canvas,function(t){!c.prepareFrame(g,e)||!c.replayGroupChanged&&Gt(f,v)||(_.canvas.width=g.size[0]*n,_.canvas.height=g.size[1]*n,c.compose(_,g,e),f=v,t())})}else i=h.getImage(p,a,n,d);i&&this.loadImage(i)&&(this.image_=i,this.skippedFeatures_=f)}if(this.image_){var y=(i=this.image_).getExtent(),m=i.getResolution(),E=i.getPixelRatio(),x=n*m/(a*E),T=$i(this.imageTransform_,n*o[0]/2,n*o[1]/2,x,x,0,E*(y[0]-s[0])/m,E*(s[1]-y[3])/m);$i(this.coordinateToCanvasPixelTransform,n*o[0]/2-T[4],n*o[1]/2-T[5],n/a,-n/a,0,-s[0],-s[1]),this.renderedResolution=m*n/E}return!!this.image_},e.prototype.forEachFeatureAtCoordinate=function(e,i,n,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,i,n,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,i,n,o)},e}(Gr);Nr.handles=function(t){return t.getType()===$o.IMAGE||t.getType()===$o.VECTOR&&t.getRenderMode()===tr},Nr.create=function(t,e){return new Nr(e)};var Yr=Nr,Xr=function(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n};function jr(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new Xr(t,e,i,n)}Xr.prototype.contains=function(t){return this.containsXY(t[1],t[2])},Xr.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},Xr.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},Xr.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},Xr.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)},Xr.prototype.getHeight=function(){return this.maxY-this.minY+1},Xr.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},Xr.prototype.getWidth=function(){return this.maxX-this.minX+1},Xr.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Kr=Xr,Wr=function(t){function e(e,i){t.call(this,e),this.context=i?null:Yn(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new Kr(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==te.LOADED||i==te.EMPTY||i==te.ERROR&&!n},e.prototype.getTile=function(t,e,i,n,o){var r=this.getLayer(),s=r.getSource().getTile(t,e,i,n,o);return s.getState()==te.ERROR&&(r.getUseInterimTilesOnError()?r.getPreload()>0&&(this.newTiles_=!0):s.setState(te.LOADED)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},e.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,n=t.size,o=t.viewState,s=o.projection,a=o.resolution,h=o.center,l=this.getLayer(),u=l.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(s),d=p.getZForResolution(a,this.zDirection),f=p.getResolution(d),_=Math.round(a/f)||1,g=t.extent;if(void 0!==e.extent&&(g=ti(g,e.extent)),ri(g))return!1;var v=p.getTileRangeForExtentAndZ(g,d),y=p.getTileRangeExtent(d,v),m=u.getTilePixelRatio(i),E={};E[d]={};var x,T,S,R=this.createLoadedTileFinder(u,s,E),C=t.viewHints,w=C[ge]||C[ve],I=this.tmpExtent,O=this.tmpTileRange_;for(this.newTiles_=!1,T=v.minX;T<=v.maxX;++T)for(S=v.minY;S<=v.maxY;++S)if(!(Date.now()-t.time>16&&w)){if(x=this.getTile(d,T,S,i,s),this.isDrawableTile_(x)){var L=r(this);if(x.getState()==te.LOADED){E[d][x.tileCoord.toString()]=x;var M=x.inTransition(L);this.newTiles_||!M&&-1!==this.renderedTiles.indexOf(x)||(this.newTiles_=!0)}if(1===x.getAlpha(L,t.time))continue}var b=p.getTileCoordChildTileRange(x.tileCoord,O,I),P=!1;b&&(P=R(d+1,b)),P||p.forEachTileCoordParentTileRange(x.tileCoord,R,null,O,I)}var A=f*i/m*_;if(!(this.renderedResolution&&Date.now()-t.time>16&&w)&&(this.newTiles_||!this.renderedExtent_||!Fe(this.renderedExtent_,g)||this.renderedRevision!=c||_!=this.oversampling_||!w&&A!=this.renderedResolution)){var D=this.context;if(D){var F=u.getTilePixelSize(d,i,s),k=Math.round(v.getWidth()*F[0]/_),G=Math.round(v.getHeight()*F[1]/_),N=D.canvas;N.width!=k||N.height!=G?(this.oversampling_=_,N.width=k,N.height=G):((this.renderedExtent_&&!je(y,this.renderedExtent_)||this.renderedRevision!=c)&&D.clearRect(0,0,k,G),_=this.oversampling_)}this.renderedTiles.length=0;var Y,X,j,K,W,U,z,B,Z,H,V=Object.keys(E).map(Number);for(V.sort(function(t,e){return t===d?1:e===d?-1:t>e?1:t<e?-1:0}),K=0,W=V.length;K<W;++K)for(var q in j=V[K],X=u.getTilePixelSize(j,i,s),Y=p.getResolution(j)/f,z=m*u.getGutterForProjection(s),B=E[j])x=B[q],T=((U=p.getTileCoordExtent(x.getTileCoord(),I))[0]-y[0])/f*m/_,S=(y[3]-U[3])/f*m/_,Z=X[0]*Y/_,H=X[1]*Y/_,this.drawTileImage(x,t,e,T,S,Z,H,z,d===j),this.renderedTiles.push(x);this.renderedRevision=c,this.renderedResolution=f*i/m*_,this.renderedExtent_=y}var J=this.renderedResolution/a,Q=$i(this.imageTransform_,i*n[0]/2,i*n[1]/2,J,J,0,(this.renderedExtent_[0]-h[0])/this.renderedResolution*i,(h[1]-this.renderedExtent_[3])/this.renderedResolution*i);return $i(this.coordinateToCanvasPixelTransform,i*n[0]/2-Q[4],i*n[1]/2-Q[5],i/a,-i/a,0,-h[0],-h[1]),this.updateUsedTiles(t.usedTiles,u,d,v),this.manageTilePyramid(t,u,p,i,s,g,d,l.getPreload()),this.scheduleExpireCache(t,u),this.renderedTiles.length>0},e.prototype.drawTileImage=function(t,e,i,n,o,s,a,h,l){var u=this.getTileImage(t);if(u){var c=r(this),p=l?t.getAlpha(c,e.time):1,d=this.getLayer().getSource();1!==p||d.getOpaque(e.viewState.projection)||this.context.clearRect(n,o,s,a);var f=p!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,h,h,u.width-2*h,u.height-2*h,n,o,s,a),f&&this.context.restore(),1!==p?e.animate=!0:l&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.getTileImage=function(t){return t.getImage()},e}(Gr);Wr.handles=function(t){return t.getType()===$o.TILE},Wr.create=function(t,e){return new Wr(e)},Wr.prototype.getLayer;var Ur=Wr,zr=i(1),Br=i.n(zr),Zr=function(){};Zr.prototype.getReplay=function(t,e){return n()},Zr.prototype.isEmpty=function(){return n()},Zr.prototype.addDeclutter=function(t){return n()};var Hr=Zr,Vr={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function qr(t,e,i,n){for(var o=t[e],r=t[e+1],s=0,a=e+n;a<i;a+=n){var h=t[a],l=t[a+1];s+=Math.sqrt((h-o)*(h-o)+(l-r)*(l-r)),o=h,r=l}return s}function Jr(t,e,i,n,o,r,s,a){for(var h,l,u,c=[],p=t[e]>t[i-n],d=o.length,f=t[e],_=t[e+1],g=t[e+=n],v=t[e+1],y=0,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(v-_,2)),E="",x=0,T=0;T<d;++T){l=p?d-T-1:T;var S=o.charAt(l),R=r(E=p?S+E:E+S)-x;x+=R;for(var C=s+R/2;e<i-n&&y+m<C;)f=g,_=v,g=t[e+=n],v=t[e+1],y+=m,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(v-_,2));var w=C-y,I=Math.atan2(v-_,g-f);if(p&&(I+=I>0?-Math.PI:Math.PI),void 0!==u){var O=I-u;if(O+=O>Math.PI?-2*Math.PI:O<-Math.PI?2*Math.PI:0,Math.abs(O)>a)return null}var L=w/m,M=pe(f,g,L),b=pe(_,v,L);u==I?(p&&(h[0]=M,h[1]=b,h[2]=R/2),h[4]=E):(x=R,h=[M,b,R/2,I,E=S],p?c.unshift(h):c.push(h),u=I),s+=R}return c}var Qr={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},$r=[Qr.FILL],ts=[Qr.STROKE],es=[Qr.BEGIN_PATH],is=[Qr.CLOSE_PATH],ns=Qr,os=[Vr.POLYGON,Vr.CIRCLE,Vr.LINE_STRING,Vr.IMAGE,Vr.TEXT,Vr.DEFAULT],rs={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ss=[1/0,1/0,-1/0,-1/0],as=[1,0,0,1,0,0],hs=function(t){function e(e,i,n,o,r,s){t.call(this),this.declutterTree=s,this.tolerance=e,this.maxExtent=i,this.overlaps=r,this.pixelRatio=o,this.maxLineWidth=0,this.resolution=n,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replayTextBackground_=function(t,e,i,n,o,r,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,o),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},e.prototype.replayImage_=function(t,e,i,n,o,r,s,a,h,l,u,c,p,d,f,_,g,v){var y=g||v;e-=o*=p,i-=r*=p;var m,E,x,T,S=f+l>n.width?n.width-l:f,R=a+u>n.height?n.height-u:a,C=_[3]+S*p+_[1],w=_[0]+R*p+_[2],I=e-_[3],O=i-_[0];(y||0!==c)&&(m=[I,O],E=[I+C,O],x=[I+C,O+w],T=[I,O+w]);var L=null;if(0!==c){var M=e+o,b=i+r;L=$i(as,M,b,1,1,c,-M,-b),Xe(ss),We(ss,qi(as,m)),We(ss,qi(as,E)),We(ss,qi(as,x)),We(ss,qi(as,T))}else Ye(I,O,I+C,O+w,ss);var P=t.canvas,A=v?v[2]*p/2:0,D=ss[0]-A<=P.width&&ss[2]+A>=0&&ss[1]-A<=P.height&&ss[3]+A>=0;if(d&&(e=Math.round(e),i=Math.round(i)),s){if(!D&&1==s[4])return;Ke(s,ss);var F=D?[t,L?L.slice(0):null,h,n,l,u,S,R,e,i,p]:null;F&&y&&F.push(g,v,m,E,x,T),s.push(F)}else D&&(y&&this.replayTextBackground_(t,m,E,x,T,g,v),mr(t,L,h,n,l,u,S,R,e,i,p))},e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatCoordinates=function(t,e,i,n,o,r){var s=this.coordinates.length,a=this.getBufferedMaxExtent();r&&(e+=n);var h,l,u,c=[t[e],t[e+1]],p=[NaN,NaN],d=!0;for(h=e+n;h<i;h+=n)p[0]=t[h],p[1]=t[h+1],(u=Ge(a,p))!==l?(d&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):u===Le.INTERSECTING?(this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):d=!0,c[0]=p[0],c[1]=p[1],l=u;return(o&&d||h===e+n)&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),s},e.prototype.drawCustomCoordinates_=function(t,e,i,n,o){for(var r=0,s=i.length;r<s;++r){var a=i[r],h=this.appendFlatCoordinates(t,e,a,n,!1,!1);o.push(h),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var n,o,r,s,a,h=t.getType(),l=t.getStride(),u=this.coordinates.length;if(h==si.MULTI_POLYGON){n=(t=t).getOrientedFlatCoordinates(),s=[];var c=t.getEndss();a=0;for(var p=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(n,a,c[p],l,f),s.push(f)}this.instructions.push([ns.CUSTOM,u,s,t,i,_n])}else h==si.POLYGON||h==si.MULTI_LINE_STRING?(r=[],n=h==si.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(n,0,t.getEnds(),l,r),this.instructions.push([ns.CUSTOM,u,r,t,i,fn])):h==si.LINE_STRING||h==si.MULTI_POINT?(n=t.getFlatCoordinates(),o=this.appendFlatCoordinates(n,0,n.length,l,!1,!1),this.instructions.push([ns.CUSTOM,u,o,t,i,dn])):h==si.POINT&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([ns.CUSTOM,u,o,t,i]));this.endGeometry(t,e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ns.BEGIN_GEOMETRY,e,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ns.BEGIN_GEOMETRY,e,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){},e.prototype.fill_=function(t){if(this.alignFill_){var e=qi(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.setTransform.apply(t,yr)},e.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],Z&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},e.prototype.renderDeclutter_=function(t,e){if(t&&t.length>5){var i=t[4];if(1==i||i==t.length-5){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(n)){this.declutterTree.insert(n);for(var o=5,r=t.length;o<r;++o){var s=t[o];s&&(s.length>11&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),mr.apply(void 0,s))}}t.length=5,Xe(t)}}},e.prototype.replay_=function(t,e,i,n,o,s,a){var h;this.pixelCoordinates_&&Gt(e,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=hi(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Vi(this.renderedTransform_,e));for(var l,u,c,d,f,_,g,v,y,m,E,x,T=!p(i),S=0,R=n.length,C=0,w=0,I=0,O=null,L=null,M=this.coordinateCache_,b=this.viewRotation_,P={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:b},A=this.instructions!=n||this.overlaps?0:200;S<R;){var D=n[S];switch(D[0]){case ns.BEGIN_GEOMETRY:m=D[1],T&&i[r(m)]||!m.getGeometry()?S=D[2]:void 0===a||oi(a,m.getGeometry().getExtent())?++S:S=D[2]+1;break;case ns.BEGIN_PATH:w>A&&(this.fill_(t),w=0),I>A&&(t.stroke(),I=0),w||I||(t.beginPath(),d=f=NaN),++S;break;case ns.CIRCLE:var F=h[C=D[1]],k=h[C+1],G=h[C+2]-F,N=h[C+3]-k,Y=Math.sqrt(G*G+N*N);t.moveTo(F+Y,k),t.arc(F,k,Y,0,2*Math.PI,!0),++S;break;case ns.CLOSE_PATH:t.closePath(),++S;break;case ns.CUSTOM:C=D[1],l=D[2];var X=D[3],j=D[4],K=6==D.length?D[5]:void 0;P.geometry=X,P.feature=m,S in M||(M[S]=[]);var W=M[S];K?K(h,C,l,2,W):(W[0]=h[C],W[1]=h[C+1],W.length=2),j(W,P),++S;break;case ns.DRAW_IMAGE:C=D[1],l=D[2],y=D[3],u=D[4],c=D[5],v=s?null:D[6];var U=D[7],z=D[8],B=D[9],Z=D[10],H=D[11],V=D[12],q=D[13],J=D[14],Q=void 0,$=void 0,tt=void 0;for(D.length>16?(Q=D[15],$=D[16],tt=D[17]):(Q=sr,$=tt=!1),H&&(V+=b);C<l;C+=2)this.replayImage_(t,h[C],h[C+1],y,u,c,v,U,z,B,Z,V,q,o,J,Q,$?O:null,tt?L:null);this.renderDeclutter_(v,m),++S;break;case ns.DRAW_CHARS:var et=D[1],it=D[2],nt=D[3];v=s?null:D[4];var ot=D[5],rt=D[6],st=D[7],at=D[8],ht=D[9],lt=D[10],ut=D[11],ct=D[12],pt=D[13],dt=D[14],ft=qr(h,et,it,2),_t=at(ct);if(ot||_t<=ft){var gt=this.textStates[pt].textAlign,vt=Jr(h,et,it,2,ct,at,(ft-_t)*rs[gt],st);if(vt){var yt=void 0,mt=void 0,Et=void 0,xt=void 0,Tt=void 0;if(lt)for(yt=0,mt=vt.length;yt<mt;++yt)Et=(Tt=vt[yt])[4],xt=this.getImage(Et,pt,"",lt),u=Tt[2]+ut,c=nt*xt.height+2*(.5-nt)*ut-ht,this.replayImage_(t,Tt[0],Tt[1],xt,u,c,v,xt.height,1,0,0,Tt[3],dt,!1,xt.width,sr,null,null);if(rt)for(yt=0,mt=vt.length;yt<mt;++yt)Et=(Tt=vt[yt])[4],xt=this.getImage(Et,pt,rt,""),u=Tt[2],c=nt*xt.height-ht,this.replayImage_(t,Tt[0],Tt[1],xt,u,c,v,xt.height,1,0,0,Tt[3],dt,!1,xt.width,sr,null,null)}}this.renderDeclutter_(v,m),++S;break;case ns.END_GEOMETRY:if(void 0!==s){var St=s(m=D[1]);if(St)return St}++S;break;case ns.FILL:A?w++:this.fill_(t),++S;break;case ns.MOVE_TO_LINE_TO:for(C=D[1],l=D[2],E=h[C],g=(x=h[C+1])+.5|0,(_=E+.5|0)===d&&g===f||(t.moveTo(E,x),d=_,f=g),C+=2;C<l;C+=2)_=(E=h[C])+.5|0,g=(x=h[C+1])+.5|0,C!=l-2&&_===d&&g===f||(t.lineTo(E,x),d=_,f=g);++S;break;case ns.SET_FILL_STYLE:O=D,this.alignFill_=D[2],w&&(this.fill_(t),w=0,I&&(t.stroke(),I=0)),t.fillStyle=D[1],++S;break;case ns.SET_STROKE_STYLE:L=D,I&&(t.stroke(),I=0),this.setStrokeStyle_(t,D),++S;break;case ns.STROKE:A?I++:t.stroke(),++S;break;default:++S}}w&&this.fill_(t),I&&t.stroke()},e.prototype.replay=function(t,e,i,n,o){this.viewRotation_=i,this.replay_(t,e,n,this.instructions,o,void 0,void 0)},e.prototype.replayHitDetection=function(t,e,i,n,o,r){return this.viewRotation_=i,this.replay_(t,e,n,this.hitDetectionInstructions,!0,o,r)},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;t<o;++t)(n=(i=e[t])[0])==ns.END_GEOMETRY?r=t:n==ns.BEGIN_GEOMETRY&&(i[2]=t,Ft(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Cr(n||nr)}else i.fillStyle=void 0;if(e){var o=e.getColor();i.strokeStyle=Cr(o||rr);var r=e.getLineCap();i.lineCap=void 0!==r?r:"round";var s=e.getLineDash();i.lineDash=s?s.slice():or;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var h=e.getLineJoin();i.lineJoin=void 0!==h?h:"round";var l=e.getWidth();i.lineWidth=void 0!==l?l:1;var u=e.getMiterLimit();i.miterLimit=void 0!==u?u:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t,e){var i=t.fillStyle,n=[ns.SET_FILL_STYLE,i];return"string"!=typeof i&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ns.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,i){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!Gt(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=h)},e.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[ns.END_GEOMETRY,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Pe(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;be(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Ir),ls=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,n){return this.appendFlatCoordinates(t,e,i,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([ns.DRAW_IMAGE,o,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ns.DRAW_IMAGE,o,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([ns.DRAW_IMAGE,o,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ns.DRAW_IMAGE,o,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.finish=function(){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},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(1),r=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=n[0]},e}(hs),us=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatCoordinates(t,e,i,n,!1,!1),s=[ns.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ns.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],es);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(ts),this.endGeometry(t,e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ns.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],es);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),h=0,l=0,u=r.length;l<u;++l)h=this.drawFlatCoordinates_(s,h,r[l],a);this.hitDetectionInstructions.push(ts),this.endGeometry(t,e)}},e.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(ts),this.reverseHitDetectionInstructions(),this.state=null},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(ts),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(es)},e}(hs),cs=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var o=this.state,r=void 0!==o.fillStyle,s=null!=o.strokeStyle,a=i.length;this.instructions.push(es),this.hitDetectionInstructions.push(es);for(var h=0;h<a;++h){var l=i[h],u=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,n,!0,!s),p=[ns.MOVE_TO_LINE_TO,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(is),this.hitDetectionInstructions.push(is)),e=l}return r&&(this.instructions.push($r),this.hitDetectionInstructions.push($r)),s&&(this.instructions.push(ts),this.hitDetectionInstructions.push(ts)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ns.SET_FILL_STYLE,Tr(nr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ns.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatCoordinates(r,0,r.length,s,!1,!1);var h=[ns.CIRCLE,a];this.instructions.push(es,h),this.hitDetectionInstructions.push(es,h),this.hitDetectionInstructions.push($r),void 0!==i.fillStyle&&this.instructions.push($r),void 0!==i.strokeStyle&&(this.instructions.push(ts),this.hitDetectionInstructions.push(ts)),this.endGeometry(t,e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ns.SET_FILL_STYLE,Tr(nr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ns.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,r,a),this.endGeometry(t,e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ns.SET_FILL_STYLE,Tr(nr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ns.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),h=0,l=0,u=r.length;l<u;++l)h=this.drawFlatCoordinatess_(s,h,r[l],a);this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t)for(var e=this.coordinates,i=0,n=e.length;i<n;++i)e[i]=vn(e[i],t)},e.prototype.setFillStrokeStyles_=function(t){var e=this.state;void 0!==e.fillStyle&&this.updateFillStyle(e,this.createFill,t),void 0!==e.strokeStyle&&this.updateStrokeStyle(e,this.applyStroke)},e}(hs);function ps(t,e,i,n,o){var r,s,a,h,l,u,c,p,d,f=i,_=i,g=0,v=0,y=i;for(r=i;r<n;r+=o){var m=e[r],E=e[r+1];void 0!==h&&(p=m-h,d=E-l,a=Math.sqrt(p*p+d*d),void 0!==u&&(v+=s,Math.acos((u*p+c*d)/(s*a))>t&&(v>g&&(g=v,f=y,_=r),v=0,y=r-o)),s=a,u=p,c=d),h=m,l=E}return(v+=a)>g?[y,r]:[f,_]}var ds="line";var fs={Circle:cs,Default:hs,Image:ls,LineString:us,Polygon:cs,Text:function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},ar.prune()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r,s,a=this.coordinates.length,h=t.getType(),l=null,u=2,c=2;if(o.placement===ds){if(!oi(this.getBufferedMaxExtent(),t.getExtent()))return;var p;if(l=t.getFlatCoordinates(),c=t.getStride(),h==si.LINE_STRING)p=[l.length];else if(h==si.MULTI_LINE_STRING)p=t.getEnds();else if(h==si.POLYGON)p=t.getEnds().slice(0,1);else if(h==si.MULTI_POLYGON){var d=t.getEndss();for(p=[],r=0,s=d.length;r<s;++r)p.push(d[r][0])}this.beginGeometry(t,e);for(var f,_=o.textAlign,g=0,v=0,y=p.length;v<y;++v){if(null==_){var m=ps(o.maxAngle,l,g,p[v],c);g=m[0],f=m[1]}else f=p[v];for(r=g;r<f;r+=c)this.coordinates.push(l[r],l[r+1]);u=this.coordinates.length,g=p[v],this.drawChars_(a,u,this.declutterGroup_),a=u}this.endGeometry(t,e)}else{var E=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),x=E.width/this.pixelRatio;switch(h){case si.POINT:case si.MULTI_POINT:u=(l=t.getFlatCoordinates()).length;break;case si.LINE_STRING:l=t.getFlatMidpoint();break;case si.CIRCLE:l=t.getCenter();break;case si.MULTI_LINE_STRING:u=(l=t.getFlatMidpoints()).length;break;case si.POLYGON:if(l=t.getFlatInteriorPoint(),!o.overflow&&l[2]/this.resolution<x)return;c=3;break;case si.MULTI_POLYGON:var T=t.getFlatInteriorPoints();for(l=[],r=0,s=T.length;r<s;r+=3)(o.overflow||T[r+2]/this.resolution>=x)&&l.push(T[r],T[r+1]);if(0==(u=l.length))return}u=this.appendFlatCoordinates(l,0,u,c,!1,!1),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(E,a,u),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,i,n){var o,r=n+e+t+i+this.pixelRatio;if(!ar.containsKey(r)){var s=n?this.strokeStates[n]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,h=this.textStates[e]||this.textState_,l=this.pixelRatio,u=h.scale*l,c=rs[h.textAlign||"center"],p=n&&s.lineWidth?s.lineWidth:0,d=t.split("\n"),f=d.length,_=[],g=function(t,e,i){for(var n=e.length,o=0,r=0;r<n;++r){var s=gr(t,e[r]);o=Math.max(o,s),i.push(s)}return o}(h.font,d,_),v=_r(h.font),y=v*f,m=g+p,E=Yn(Math.ceil(m*u),Math.ceil((y+p)*u));o=E.canvas,ar.set(r,o),1!=u&&E.scale(u,u),E.font=h.font,n&&(E.strokeStyle=s.strokeStyle,E.lineWidth=p,E.lineCap=s.lineCap,E.lineJoin=s.lineJoin,E.miterLimit=s.miterLimit,Z&&s.lineDash.length&&(E.setLineDash(s.lineDash),E.lineDashOffset=s.lineDashOffset)),i&&(E.fillStyle=a.fillStyle),E.textBaseline="middle",E.textAlign="center";var x,T=.5-c,S=c*o.width/u+T*p;if(n)for(x=0;x<f;++x)E.strokeText(d[x],S+T*_[x],.5*(p+v)+x*v);if(i)for(x=0;x<f;++x)E.fillText(d[x],S+T*_[x],.5*(p+v)+x*v)}return ar.get(r)},e.prototype.drawTextImage_=function(t,e,i){var n=this.textState_,o=this.textStrokeState_,r=this.pixelRatio,s=rs[n.textAlign||"center"],a=rs[n.textBaseline],h=o&&o.lineWidth?o.lineWidth:0,l=s*t.width/r+2*(.5-s)*h,u=a*t.height/r+2*(.5-a)*h;this.instructions.push([ns.DRAW_IMAGE,e,i,t,(l-this.textOffsetX_)*r,(u-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,t.width,n.padding==sr?sr:n.padding.map(function(t){return t*r}),!!n.backgroundFill,!!n.backgroundStroke]),this.hitDetectionInstructions.push([ns.DRAW_IMAGE,e,i,t,(l-this.textOffsetX_)*r,(u-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/r,t.width,n.padding,!!n.backgroundFill,!!n.backgroundStroke])},e.prototype.drawChars_=function(t,e,i){var n=this.textStrokeState_,o=this.textState_,r=this.textFillState_,s=this.strokeKey_;n&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:n.strokeStyle,lineCap:n.lineCap,lineDashOffset:n.lineDashOffset,lineWidth:n.lineWidth,lineJoin:n.lineJoin,miterLimit:n.miterLimit,lineDash:n.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:o.font,textAlign:o.textAlign||"center",scale:o.scale});var h=this.fillKey_;r&&(h in this.fillStates||(this.fillStates[h]={fillStyle:r.fillStyle}));var l=this.pixelRatio,u=rs[o.textBaseline],c=this.textOffsetY_*l,p=this.text_,d=o.font,f=o.scale,_=n?n.lineWidth*f/2:0,g=this.widths_[d];g||(this.widths_[d]=g={}),this.instructions.push([ns.DRAW_CHARS,t,e,u,i,o.overflow,h,o.maxAngle,function(t){var e=g[t];return e||(e=g[t]=gr(d,t)),e*f*l},c,s,_*l,p,a,1]),this.hitDetectionInstructions.push([ns.DRAW_CHARS,t,e,u,i,o.overflow,h,o.maxAngle,function(t){var e=g[t];return e||(e=g[t]=gr(d,t)),e*f},c,s,_,p,a,1/l])},e.prototype.setTextStyle=function(t,e){var i,n,o;if(t){this.declutterGroup_=e;var s=t.getFill();s?((n=this.textFillState_)||(n=this.textFillState_={}),n.fillStyle=Cr(s.getColor()||nr)):n=this.textFillState_=null;var a=t.getStroke();if(a){(o=this.textStrokeState_)||(o=this.textStrokeState_={});var h=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),c=a.getMiterLimit();o.lineCap=a.getLineCap()||"round",o.lineDash=h?h.slice():or,o.lineDashOffset=void 0===l?0:l,o.lineJoin=a.getLineJoin()||"round",o.lineWidth=void 0===u?1:u,o.miterLimit=void 0===c?10:c,o.strokeStyle=Cr(a.getColor()||rr)}else o=this.textStrokeState_=null;i=this.textState_;var p=t.getFont()||"10px sans-serif";cr(p);var d=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()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||sr,i.scale=void 0===d?1:d;var f=t.getOffsetX(),_=t.getOffsetY(),g=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===_?0:_,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===v?0:v,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:r(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+r(n.fillStyle):""}else this.text_=""},e}(hs)},_s=function(t){function e(e,i,n,o,r,s,a){t.call(this),this.declutterTree_=s,this.declutterGroup_=null,this.tolerance_=e,this.maxExtent_=i,this.overlaps_=r,this.pixelRatio_=o,this.resolution_=n,this.renderBuffer_=a,this.replaysByZIndex_={},this.hitDetectionContext_=Yn(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addDeclutter=function(t){var e=null;return this.declutterTree_&&(t?(e=this.declutterGroup_)[4]++:(e=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),e},e.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},e.prototype.hasReplays=function(t){for(var e in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[e],n=0,o=t.length;n<o;++n)if(t[n]in i)return!0;return!1},e.prototype.finish=function(){for(var t in this.replaysByZIndex_){var e=this.replaysByZIndex_[t];for(var i in e)e[i].finish()}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s){var a,h=2*(n=Math.round(n))+1,l=$i(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),u=this.hitDetectionContext_;u.canvas.width!==h||u.canvas.height!==h?(u.canvas.width=h,u.canvas.height=h):u.clearRect(0,0,h,h),void 0!==this.renderBuffer_&&(We(a=[1/0,1/0,-1/0,-1/0],t),be(a,e*(this.renderBuffer_+n),a));var c,p,d=function(t){if(void 0!==gs[t])return gs[t];for(var e=2*t+1,i=new Array(e),n=0;n<e;n++)i[n]=new Array(e);var o=t,r=0,s=0;for(;o>=r;)vs(i,t+o,t+r),vs(i,t+r,t+o),vs(i,t-r,t+o),vs(i,t-o,t+r),vs(i,t-o,t-r),vs(i,t-r,t-o),vs(i,t+r,t-o),vs(i,t+o,t-r),2*((s+=1+2*++r)-o)+1>0&&(s+=1-2*(o-=1));return gs[t]=i,i}(n);function f(t){for(var e=u.getImageData(0,0,h,h).data,i=0;i<h;i++)for(var n=0;n<h;n++)if(d[i][n]&&e[4*(n*h+i)+3]>0){var o=void 0;return(!c||p!=Vr.IMAGE&&p!=Vr.TEXT||-1!==c.indexOf(t))&&(o=r(t)),o||void u.clearRect(0,0,h,h)}}this.declutterTree_&&(c=this.declutterTree_.all().map(function(t){return t.value}));var _,g,v,y,m,E=Object.keys(this.replaysByZIndex_).map(Number);for(E.sort(At),_=E.length-1;_>=0;--_){var x=E[_].toString();for(v=this.replaysByZIndex_[x],g=os.length-1;g>=0;--g)if(void 0!==(y=v[p=os[g]]))if(!s||p!=Vr.IMAGE&&p!=Vr.TEXT){if(m=y.replayHitDetection(u,l,i,o,f,a))return m}else{var T=s[x];T?T.push(y,l.slice(0)):s[x]=[y,l.slice(0)]}}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return hi(s,0,8,2,t,s),s},e.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",n=this.replaysByZIndex_[i];void 0===n&&(n={},this.replaysByZIndex_[i]=n);var o=n[e];void 0===o&&(o=new(0,fs[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),n[e]=o);return o},e.prototype.getReplays=function(){return this.replaysByZIndex_},e.prototype.isEmpty=function(){return p(this.replaysByZIndex_)},e.prototype.replay=function(t,e,i,n,o,r,s){var a=Object.keys(this.replaysByZIndex_).map(Number);a.sort(At),t.save(),this.clip(t,e);var h,l,u,c,p,d,f=r||os;for(h=0,l=a.length;h<l;++h){var _=a[h].toString();for(p=this.replaysByZIndex_[_],u=0,c=f.length;u<c;++u){var g=f[u];if(d=p[g],void 0!==d)if(!s||g!=Vr.IMAGE&&g!=Vr.TEXT)d.replay(t,e,i,n,o);else{var v=s[_];v?v.push(d,e.slice(0)):s[_]=[d,e.slice(0)]}}}t.restore()},e}(Hr),gs={0:[[!0]]};function vs(t,e,i){var n,o=Math.floor(t.length/2);if(e>=o)for(n=o;n<e;n++)t[n][i]=!0;else if(e<o)for(n=e+1;n<o;n++)t[n][i]=!0}var ys=_s,ms=.5,Es={Point:function(t,e,i,n){var o=i.getImage();if(o){if(o.getImageState()!=Jo.LOADED)return;var r=t.getReplay(i.getZIndex(),Vr.IMAGE);r.setImageStyle(o,t.addDeclutter(!1)),r.drawPoint(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Vr.TEXT);a.setTextStyle(s,t.addDeclutter(!!o)),a.drawText(e,n)}},LineString:function(t,e,i,n){var o=i.getStroke();if(o){var r=t.getReplay(i.getZIndex(),Vr.LINE_STRING);r.setFillStrokeStyle(null,o),r.drawLineString(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Vr.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,n)}},Polygon:function(t,e,i,n){var o=i.getFill(),r=i.getStroke();if(o||r){var s=t.getReplay(i.getZIndex(),Vr.POLYGON);s.setFillStrokeStyle(o,r),s.drawPolygon(e,n)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),Vr.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}},MultiPoint:function(t,e,i,n){var o=i.getImage();if(o){if(o.getImageState()!=Jo.LOADED)return;var r=t.getReplay(i.getZIndex(),Vr.IMAGE);r.setImageStyle(o,t.addDeclutter(!1)),r.drawMultiPoint(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Vr.TEXT);a.setTextStyle(s,t.addDeclutter(!!o)),a.drawText(e,n)}},MultiLineString:function(t,e,i,n){var o=i.getStroke();if(o){var r=t.getReplay(i.getZIndex(),Vr.LINE_STRING);r.setFillStrokeStyle(null,o),r.drawMultiLineString(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Vr.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,n)}},MultiPolygon:function(t,e,i,n){var o=i.getFill(),r=i.getStroke();if(r||o){var s=t.getReplay(i.getZIndex(),Vr.POLYGON);s.setFillStrokeStyle(o,r),s.drawMultiPolygon(e,n)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),Vr.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n){var o,r,s=e.getGeometriesArray();for(o=0,r=s.length;o<r;++o){(0,Es[s[o].getType()])(t,s[o],i,n)}},Circle:function(t,e,i,n){var o=i.getFill(),r=i.getStroke();if(o||r){var s=t.getReplay(i.getZIndex(),Vr.CIRCLE);s.setFillStrokeStyle(o,r),s.drawCircle(e,n)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),Vr.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}}};function xs(t,e){return parseInt(r(t),10)-parseInt(r(e),10)}function Ts(t,e){var i=Ss(t,e);return i*i}function Ss(t,e){return ms*t/e}function Rs(t,e,i,n,o,r){var s=!1,a=i.getImage();if(a){var h=a.getImageState();h==Jo.LOADED||h==Jo.ERROR?a.unlistenImageChange(o,r):(h==Jo.IDLE&&a.load(),h=a.getImageState(),a.listenImageChange(o,r),s=!0)}return function(t,e,i,n){var o=i.getGeometryFunction()(e);if(!o)return;var r=o.getSimplifiedGeometry(n);if(i.getRenderer())!function t(e,i,n,o){if(i.getType()==si.GEOMETRY_COLLECTION){for(var r=i.getGeometries(),s=0,a=r.length;s<a;++s)t(e,r[s],n,o);return}var h=e.getReplay(n.getZIndex(),Vr.DEFAULT);h.drawCustom(i,o,n.getRenderer())}(t,r,i,e);else{(0,Es[r.getType()])(t,r,i,e)}}(t,e,i,n),s}var Cs=function(t){function e(e){t.call(this,e),this.declutterTree_=e.getDeclutter()?Br()(9,void 0):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=Yn(),v(ar,M.CLEAR,this.handleFontsChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){m(ar,M.CLEAR,this.handleFontsChanged_,this),t.prototype.disposeInternal.call(this)},e.prototype.compose=function(t,e,i){var n=e.extent,o=e.pixelRatio,r=i.managed?e.skippedFeatureUids:{},s=e.viewState,a=s.projection,h=s.rotation,l=a.getExtent(),u=this.getLayer().getSource(),c=this.getTransform(e,0),p=i.extent,d=void 0!==p;d&&this.clip(t,e,p);var f=this.replayGroup_;if(f&&!f.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var _,g=this.getLayer(),v=0,y=0,m=1!==i.opacity,E=g.hasListener(Qt);if(m||E){var x=t.canvas.width,T=t.canvas.height;if(h){var S=Math.round(Math.sqrt(x*x+T*T));v=(S-x)/2,y=(S-T)/2,x=T=S}this.context.canvas.width=x,this.context.canvas.height=T,_=this.context}else _=t;var R=_.globalAlpha;m||(_.globalAlpha=i.opacity),_!=t&&_.translate(v,y);var C=e.viewHints,w=!(C[ge]||C[ve]),I=e.size[0]*o,O=e.size[1]*o;if(vr(_,-h,I/2,O/2),f.replay(_,c,h,r,w),u.getWrapX()&&a.canWrapX()&&!Fe(l,n)){for(var L,M=n[0],b=ni(l),P=0;M<l[0];)L=b*--P,c=this.getTransform(e,L),f.replay(_,c,h,r,w),M+=b;for(P=0,M=n[2];M>l[2];)L=b*++P,c=this.getTransform(e,L),f.replay(_,c,h,r,w),M-=b}if(vr(_,h,I/2,O/2),E&&this.dispatchRenderEvent(_,e,c),_!=t){if(m){var A=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(_.canvas,-v,-y),t.globalAlpha=A}else t.drawImage(_.canvas,-v,-y);_.translate(-v,-y)}m||(_.globalAlpha=R)}d&&t.restore()},e.prototype.composeFrame=function(t,e,i){var n=this.getTransform(t,0);this.preCompose(i,t,n),this.compose(i,t,e),this.postCompose(i,t,e,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){if(this.replayGroup_){var s=e.viewState.resolution,a=e.viewState.rotation,h=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,s,a,i,{},function(t){var e=r(t);if(!(e in l))return l[e]=!0,n.call(o,t,h)},null)}},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e){var i=this.getLayer(),n=i.getSource(),o=t.viewHints[ge],r=t.viewHints[ve],s=i.getUpdateWhileAnimating(),a=i.getUpdateWhileInteracting();if(!this.dirty_&&!s&&o||!a&&r)return!0;var h=t.extent,l=t.viewState,u=l.projection,c=l.resolution,p=t.pixelRatio,d=i.getRevision(),f=i.getRenderBuffer(),_=i.getRenderOrder();void 0===_&&(_=xs);var g=be(h,f*c),v=l.projection.getExtent();if(n.getWrapX()&&l.projection.canWrapX()&&!Fe(v,t.extent)){var y=ni(v),m=Math.max(ni(g)/2,y);g[0]=v[0]-m,g[2]=v[2]+m}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==_&&Fe(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var E=new ys(Ss(c,p),g,c,p,n.getOverlaps(),this.declutterTree_,i.getRenderBuffer());n.loadFeatures(g,c,u);var x=function(t){var e,n=t.getStyleFunction()||i.getStyleFunction();if(n&&(e=n(t,c)),e){var o=this.renderFeature(t,c,p,e,E);this.dirty_=this.dirty_||o}}.bind(this);if(_){var T=[];n.forEachFeatureInExtent(g,function(t){T.push(t)}),T.sort(_);for(var S=0,R=T.length;S<R;++S)x(T[S])}else n.forEachFeatureInExtent(g,x);return E.finish(),this.renderedResolution_=c,this.renderedRevision_=d,this.renderedRenderOrder_=_,this.renderedExtent_=g,this.replayGroup_=E,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,o){if(!n)return!1;var r=!1;if(Array.isArray(n))for(var s=0,a=n.length;s<a;++s)r=Rs(o,t,n[s],Ts(e,i),this.handleStyleImageChange_,this)||r;else r=Rs(o,t,n,Ts(e,i),this.handleStyleImageChange_,this);return r},e}(kr);Cs.handles=function(t){return t.getType()===$o.VECTOR},Cs.create=function(t,e){return new Cs(e)};var ws=Cs,Is={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"},Os={image:[Vr.POLYGON,Vr.CIRCLE,Vr.LINE_STRING,Vr.IMAGE,Vr.TEXT],hybrid:[Vr.POLYGON,Vr.LINE_STRING]},Ls={image:[Vr.DEFAULT],hybrid:[Vr.IMAGE,Vr.TEXT,Vr.DEFAULT],vector:os},Ms=function(t){function e(e){t.call(this,e,!0),this.declutterTree_=e.getDeclutter()?Br()(9,void 0):null,this.dirty_=!1,this.renderedLayerRevision_,this.tmpTransform_=[1,0,0,1,0,0];var i=e.getRenderMode();this.zDirection=i===Is.VECTOR?1:0,i!==Is.VECTOR&&(this.context=Yn()),v(ar,M.CLEAR,this.handleFontsChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){m(ar,M.CLEAR,this.handleFontsChanged_,this),t.prototype.disposeInternal.call(this)},e.prototype.getTile=function(e,i,n,o,r){var s=t.prototype.getTile.call(this,e,i,n,o,r);return s.getState()===te.LOADED&&(this.createReplayGroup_(s,o,r),this.context&&this.renderTileImage_(s,o,r)),s},e.prototype.getTileImage=function(t){var e=this.getLayer();return t.getImage(e)},e.prototype.prepareFrame=function(e,i){var n=this.getLayer().getRevision();return this.renderedLayerRevision_!=n&&(this.renderedTiles.length=0),this.renderedLayerRevision_=n,t.prototype.prepareFrame.call(this,e,i)},e.prototype.createReplayGroup_=function(t,e,i){var n=this,o=this.getLayer(),r=o.getRevision(),s=o.getRenderOrder()||null,a=t.getReplayState(o);if(a.dirty||a.renderedRevision!=r||a.renderedRenderOrder!=s){for(var h=o.getSource(),l=h.getTileGrid(),u=h.getTileGridForProjection(i).getResolution(t.tileCoord[0]),c=t.extent,p=function(r,p){var d=t.getTile(t.tileKeys[r]);if(d.getState()==te.LOADED){var f=d.tileCoord,_=l.getTileCoordExtent(f),g=ti(c,_),v=je(_,g)?null:be(g,o.getRenderBuffer()*u,n.tmpExtent),y=d.getProjection(),m=!1;ji(i,y)||(m=!0,d.setProjection(i)),a.dirty=!1;var E=new ys(0,g,u,e,h.getOverlaps(),n.declutterTree_,o.getRenderBuffer()),x=Ts(u,e),T=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,u)),e){var n=this.renderFeature(t,x,e,E);this.dirty_=this.dirty_||n,a.dirty=a.dirty||n}},S=d.getFeatures();s&&s!==a.renderedRenderOrder&&S.sort(s);for(var R=0,C=S.length;R<C;++R){var w=S[R];m&&(y.getUnits()==di.TILE_PIXELS&&(y.setWorldExtent(_),y.setExtent(d.getExtent())),w.getGeometry().transform(y,i)),v&&!oi(v,w.getGeometry().getExtent())||T.call(n,w)}E.finish(),d.setReplayGroup(o,t.tileCoord.toString(),E)}},d=0,f=t.tileKeys.length;d<f;++d)p(d);a.renderedRevision=r,a.renderedRenderOrder=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){var s=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var h,l,u,c,p=this.getLayer(),d={},f=this.renderedTiles;for(u=0,c=f.length;u<c;++u){var _=f[u];if(De(h=be(_.extent,i*s,h),t))for(var g=0,v=_.tileKeys.length;g<v;++g){var y=_.getTile(_.tileKeys[g]);if(y.getState()==te.LOADED){var m=y.getReplayGroup(p,_.tileCoord.toString());l=l||m.forEachFeatureAtCoordinate(t,s,a,i,{},function(t){var e=r(t);if(!(e in d))return d[e]=!0,n.call(o,t,p)},null)}}}return l},e.prototype.getReplayTransform_=function(t,e){var i=this.getLayer().getSource().getTileGrid(),n=t.tileCoord,o=i.getResolution(n[0]),r=e.viewState,s=e.pixelRatio,a=r.resolution/s,h=i.getTileCoordExtent(n,this.tmpExtent),l=r.center,u=ei(h),c=e.size,p=Math.round(s*c[0]/2),d=Math.round(s*c[1]/2);return $i(this.tmpTransform_,p,d,o/a,o/a,r.rotation,(u[0]-l[0])/o,(l[1]-u[1])/o)},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&void 0!==this.renderedLayerRevision_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.postCompose=function(e,i,n){var o=this.getLayer(),r=o.getRenderMode();if(r!=Is.IMAGE){var s,a,h=o.getDeclutter()?{}:null,l=o.getSource(),u=Ls[r],c=i.pixelRatio,p=i.viewState.rotation,d=i.size;p&&vr(e,-p,s=Math.round(c*d[0]/2),a=Math.round(c*d[1]/2)),h&&this.declutterTree_.clear();for(var f=i.viewHints,_=!(f[ge]||f[ve]),g=this.renderedTiles,v=l.getTileGridForProjection(i.viewState.projection),y=[],m=[],E=g.length-1;E>=0;--E){var x=g[E];if(x.getState()!=te.ABORT)for(var T=x.tileCoord,S=v.getTileCoordExtent(T,this.tmpExtent)[0]-x.extent[0],R=void 0,C=0,w=x.tileKeys.length;C<w;++C){var I=x.getTile(x.tileKeys[C]);if(I.getState()==te.LOADED){var O=I.getReplayGroup(o,T.toString());if(O&&O.hasReplays(u)){R||(R=this.getTransform(i,S));var L=I.tileCoord[0],M=O.getClipCoords(R);e.save(),e.globalAlpha=n.opacity;for(var b=0,P=y.length;b<P;++b){var A=y[b];L<m[b]&&(e.beginPath(),e.moveTo(M[0],M[1]),e.lineTo(M[2],M[3]),e.lineTo(M[4],M[5]),e.lineTo(M[6],M[7]),e.moveTo(A[6],A[7]),e.lineTo(A[4],A[5]),e.lineTo(A[2],A[3]),e.lineTo(A[0],A[1]),e.clip())}O.replay(e,R,p,{},_,u,h),e.restore(),y.push(M),m.push(L)}}}}h&&function(t,e,i,n){for(var o=Object.keys(t).map(Number).sort(At),r={},s=0,a=o.length;s<a;++s)for(var h=t[o[s].toString()],l=0,u=h.length;l<u;){var c=h[l++],p=h[l++];c.replay(e,p,i,r,n)}}(h,e,p,_),p&&vr(e,p,s,a)}t.prototype.postCompose.call(this,e,i,n)},e.prototype.renderFeature=function(t,e,i,n){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var r=0,s=i.length;r<s;++r)o=Rs(n,t,i[r],e,this.handleStyleImageChange_,this)||o;else o=Rs(n,t,i,e,this.handleStyleImageChange_,this);return o},e.prototype.renderTileImage_=function(t,e,i){var n=this.getLayer(),o=t.getReplayState(n),r=n.getRevision(),s=Os[n.getRenderMode()];if(s&&o.renderedTileRevision!==r){o.renderedTileRevision=r;var a=t.wrappedTileCoord,h=a[0],l=n.getSource(),u=l.getTileGridForProjection(i),c=u.getResolution(h),p=t.getContext(n),d=l.getTilePixelSize(h,e,i);p.canvas.width=d[0],p.canvas.height=d[1];for(var f=u.getTileCoordExtent(a,this.tmpExtent),_=0,g=t.tileKeys.length;_<g;++_){var v=t.getTile(t.tileKeys[_]);if(v.getState()==te.LOADED){var y=e/c,m=Bi(this.tmpTransform_);Ji(m,y,-y),Qi(m,-f[0],-f[3]),v.getReplayGroup(n,t.tileCoord.toString()).replay(p,m,0,{},!0,s)}}}},e}(Ur);Ms.handles=function(t){return t.getType()===$o.VECTOR_TILE},Ms.create=function(t,e){return new Ms(e)};var bs=Ms,Ps=function(t){function e(e){(e=u({},e)).controls||(e.controls=function(t){var e=t||{},i=new N;return(void 0===e.zoom||e.zoom)&&i.push(new lo(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new ho(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new so(e.attributionOptions)),i}()),e.interactions||(e.interactions=function(t){var e=t||{},i=new N,n=new co(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Po),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Eo({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new bo({condition:e.onFocusOnly?To:void 0,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Ho),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Vo({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Ko),i.push(new Uo({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Zo({condition:e.onFocusOnly?To:void 0,constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Yo({duration:e.zoomDuration})),i}()),t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){var t=new Fr(this);return t.registerLayerRenderers([Yr,Ur,ws,bs]),t},e}(Hn),As="preload",Ds="useInterimTilesOnError",Fs=function(t){function e(e){var i=e||{},n=u({},i);delete n.preload,delete n.useInterimTilesOnError,t.call(this,n),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=$o.TILE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPreload=function(){return this.get(As)},e.prototype.setPreload=function(t){this.set(As,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Ds)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Ds,t)},e}(oo);Fs.prototype.getSource;var ks=Fs,Gs=function(t){function e(e,i,n){t.call(this);var o=n||{};this.tileCoord=e,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===o.transition?250:o.transition,this.transitionStarts_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(M.CHANGE)},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()==te.LOADED)return 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()==te.LOADED){t.interimTile=null;break}t.getState()==te.LOADING?e=t:t.getState()==te.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){this.state=t,this.changed()},e.prototype.load=function(){},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 n=e-i+1e3/60;return n>=this.transition_?1:Re(n/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}(L);function Ns(){var t=Yn(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var Ys=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,s),this.crossOrigin_=o,this.src_=n,this.image_=new Image,null!==o&&(this.image_.crossOrigin=o),this.imageListenerKeys_=null,this.tileLoadFunction_=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==te.LOADING&&(this.unlistenImage_(),this.image_=Ns()),this.interimTile&&this.interimTile.dispose(),this.state=te.ABORT,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=te.ERROR,this.unlistenImage_(),this.image_=Ns(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=te.LOADED:this.state=te.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==te.ERROR&&(this.state=te.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==te.IDLE&&(this.state=te.LOADING,this.changed(),this.imageListenerKeys_=[y(this.image_,M.ERROR,this.handleImageError_,this),y(this.image_,M.LOAD,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(E),this.imageListenerKeys_=null},e}(Gs);function Xs(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function js(t,e,i){return t+"/"+e+"/"+i}function Ks(t){return js(t[0],t[1],t[2])}var Ws=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast(),i=e.tileCoord[0].toString();if(i in t&&t[i].contains(e.tileCoord))break;this.pop().dispose()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Ks(e.tileCoord)),e.dispose())},this)}},e}(ir);function Us(t,e,i,n){var o=i-t,r=n-e,s=Math.sqrt(o*o+r*r);return[Math.round(i+o/s),Math.round(n+r/s)]}function zs(t,e,i,n,o,r,s,a,h,l,u){var c=Yn(Math.round(i*t),Math.round(i*e));if(0===h.length)return c.canvas;c.scale(i,i);var p=[1/0,1/0,-1/0,-1/0];h.forEach(function(t,e,i){Ke(p,t.extent)});var d=ni(p),f=$e(p),_=Yn(Math.round(i*d/n),Math.round(i*f/n)),g=i/n;h.forEach(function(t,e,i){var n=t.extent[0]-p[0],o=-(t.extent[3]-p[3]),r=ni(t.extent),s=$e(t.extent);_.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,n*g,o*g,r*g,s*g)});var v=ei(s);return a.getTriangles().forEach(function(t,e,o){var s=t.source,a=t.target,h=s[0][0],l=s[0][1],u=s[1][0],d=s[1][1],f=s[2][0],g=s[2][1],y=(a[0][0]-v[0])/r,m=-(a[0][1]-v[1])/r,E=(a[1][0]-v[0])/r,x=-(a[1][1]-v[1])/r,T=(a[2][0]-v[0])/r,S=-(a[2][1]-v[1])/r,R=h,C=l;h=0,l=0;var w=function(t){for(var e=t.length,i=0;i<e;i++){for(var n=i,o=Math.abs(t[i][i]),r=i+1;r<e;r++){var s=Math.abs(t[r][i]);s>o&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var h=i+1;h<e;h++)for(var l=-t[h][i]/t[i][i],u=i;u<e+1;u++)i==u?t[h][u]=0:t[h][u]+=l*t[i][u]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[u-=R,d-=C,0,0,E-y],[f-=R,g-=C,0,0,T-y],[0,0,u,d,x-m],[0,0,f,g,S-m]]);if(w){c.save(),c.beginPath();var I=(y+E+T)/3,O=(m+x+S)/3,L=Us(I,O,y,m),M=Us(I,O,E,x),b=Us(I,O,T,S);c.moveTo(M[0],M[1]),c.lineTo(L[0],L[1]),c.lineTo(b[0],b[1]),c.clip(),c.transform(w[0],w[2],w[1],w[3],y,m),c.translate(p[0]-R,p[3]-C),c.scale(n/i,-n/i),c.drawImage(_.canvas,0,0),c.restore()}}),u&&(c.save(),c.strokeStyle="black",c.lineWidth=1,a.getTriangles().forEach(function(t,e,i){var n=t.target,o=(n[0][0]-v[0])/r,s=-(n[0][1]-v[1])/r,a=(n[1][0]-v[0])/r,h=-(n[1][1]-v[1])/r,l=(n[2][0]-v[0])/r,u=-(n[2][1]-v[1])/r;c.beginPath(),c.moveTo(a,h),c.lineTo(o,s),c.lineTo(l,u),c.closePath(),c.stroke()}),c.restore()),c.canvas}var Bs=function(t,e,i,n,o){this.sourceProj_=t,this.targetProj_=e;var r={},s=Wi(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return r[e]||(r[e]=s(t)),r[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&ni(n)==ni(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ni(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ni(this.targetProj_.getExtent()):null;var a=ei(i),h=ii(i),l=Ve(i),u=He(i),c=this.transformInv_(a),p=this.transformInv_(h),d=this.transformInv_(l),f=this.transformInv_(u);if(this.addQuad_(a,h,l,u,c,p,d,f,10),this.wrapsXInSource_){var _=1/0;this.triangles_.forEach(function(t,e,i){_=Math.min(_,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])-_>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-_>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-_>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-_>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}r={}};Bs.prototype.addTriangle_=function(t,e,i,n,o,r){this.triangles_.push({source:[n,o,r],target:[t,e,i]})},Bs.prototype.addQuad_=function(t,e,i,n,o,r,s,a,h){var l=Me([o,r,s,a]),u=this.sourceWorldWidth_?ni(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&u>.5&&u<1,d=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=ni(Me([t,e,i,n]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)}if(d||!this.maxSourceExtent_||oi(l,this.maxSourceExtent_)){if(!(d||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(h>0))return;d=!0}if(h>0){if(!d){var f,_=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(_);if(p)f=(ce(o[0],c)+ce(s[0],c))/2-ce(g[0],c);else f=(o[0]+s[0])/2-g[0];var v=(o[1]+s[1])/2-g[1];d=f*f+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var y=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(y),E=[(n[0]+t[0])/2,(n[1]+t[1])/2],x=this.transformInv_(E);this.addQuad_(t,e,y,E,o,r,m,x,h-1),this.addQuad_(E,y,i,n,x,m,s,a,h-1)}else{var T=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(T),R=[(i[0]+n[0])/2,(i[1]+n[1])/2],C=this.transformInv_(R);this.addQuad_(t,T,R,n,o,S,C,a,h-1),this.addQuad_(T,e,i,R,S,r,s,C,h-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,n,o,s,a),this.addTriangle_(t,e,i,o,r,s)}},Bs.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,i,n){var o=e.source;We(t,o[0]),We(t,o[1]),We(t,o[2])}),t},Bs.prototype.getTriangles=function(){return this.triangles_};var Zs=Bs,Hs=function(t){function e(e,i,n,o,r,s,a,h,l,u,c){t.call(this,r,te.IDLE),this.renderEdges_=void 0!==c&&c,this.pixelRatio_=a,this.gutter_=h,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=o,this.wrappedTileCoord_=s||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var p=o.getTileCoordExtent(this.wrappedTileCoord_),d=this.targetTileGrid_.getExtent(),f=this.sourceTileGrid_.getExtent(),_=d?ti(p,d):p;if(0!==Ze(_)){var g=e.getExtent();g&&(f=f?ti(f,g):g);var v=o.getResolution(this.wrappedTileCoord_[0]),y=function(t,e,i,n){var o=Ui(i,e,t),r=Ni(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var h=t.getExtent();if(!h||De(h,o)){var l=Ni(t,r,o)/r;isFinite(l)&&l>0&&(r/=l)}return r}(e,n,qe(_),v);if(!isFinite(y)||y<=0)this.state=te.EMPTY;else{var m=void 0!==u?u:qo;if(this.triangulation_=new Zs(e,n,_,f,y*m),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(y);var E=this.triangulation_.calculateSourceExtent();if(f&&(e.canWrapX()?(E[1]=se(E[1],f[1],f[3]),E[3]=se(E[3],f[1],f[3])):E=ti(E,f)),Ze(E)){for(var x=i.getTileRangeForExtentAndZ(E,this.sourceZ_),T=x.minX;T<=x.maxX;T++)for(var S=x.minY;S<=x.maxY;S++){var R=l(this.sourceZ_,T,S,a);R&&this.sourceTiles_.push(R)}0===this.sourceTiles_.length&&(this.state=te.EMPTY)}else this.state=te.EMPTY}else this.state=te.EMPTY}}else this.state=te.EMPTY}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==te.LOADING&&this.unlistenSources_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==te.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=te.ERROR;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=zs(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=te.LOADED}this.changed()},e.prototype.load=function(){if(this.state==te.IDLE){this.state=te.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(o==te.IDLE||o==te.LOADING){t++;var r=v(e,M.CHANGE,function(i){var n=e.getState();n!=te.LOADED&&n!=te.ERROR&&n!=te.EMPTY||(E(r),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,i){t.getState()==te.IDLE&&t.load()}),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(E),this.sourcesListenerKeys_=null},e}(Gs);function Vs(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,h){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,function(){return(-s[2]-1).toString()}).replace(r,function(){var t=s[0],i=e.getFullTileRange(t);return ee(i,55),(i.getHeight()+s[2]).toString()}):void 0}}function qs(t,e){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=Vs(t[o],e);return function(t){if(1===t.length)return t[0];return function(e,i,n){if(e){var o=ce(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[o](e,i,n)}}}(n)}function Js(t,e,i){}function Qs(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var $s=function(t){function e(e){t.call(this),this.projection_=Gi(e.projection),this.attributions_=Qs(e.attributions),this.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,this.loading=!1,this.state_=void 0!==e.state?e.state:Un.READY,this.wrapX_=void 0!==e.wrapX&&e.wrapX}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return n()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Qs(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(F),ta=[0,0,0],ea=function(t){var e,i,n,o;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,ee((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||At,e.every(function(t,o){if(0===o)return!0;var r=n(e[o-1],t);return!(r>0||i&&0===r)})),17),!t.origins)for(var r=0,s=this.resolutions_.length-1;r<s;++r)if(o){if(this.resolutions_[r]/this.resolutions_[r+1]!==o){o=void 0;break}}else o=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=o,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,ee(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=ei(a)),ee(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,ee(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:re,ee(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){return new Kr(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):a&&this.calculateTileRanges_(a)};ea.prototype.forEachTileCoord=function(t,e,i){for(var n=this.getTileRangeForExtentAndZ(t,e),o=n.minX,r=n.maxX;o<=r;++o)for(var s=n.minY,a=n.maxY;s<=a;++s)i([e,o,s])},ea.prototype.forEachTileCoordParentTileRange=function(t,e,i,n,o){var r,s,a,h=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],a=t[2]):h=this.getTileCoordExtent(t,o);l>=this.minZoom;){if(r=2===this.zoomFactor_?jr(s=Math.floor(s/2),s,a=Math.floor(a/2),a,n):this.getTileRangeForExtentAndZ(h,l,n),e.call(i,l,r))return!0;--l}return!1},ea.prototype.getExtent=function(){return this.extent_},ea.prototype.getMaxZoom=function(){return this.maxZoom},ea.prototype.getMinZoom=function(){return this.minZoom},ea.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},ea.prototype.getResolution=function(t){return this.resolutions_[t]},ea.prototype.getResolutions=function(){return this.resolutions_},ea.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],o=2*t[2];return jr(n,n+1,o,o+1,e)}var r=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},ea.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),o=this.getResolution(t),r=Zn(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*r[0]*o,a=n[0]+(e.maxX+1)*r[0]*o;return Ye(s,n[1]+e.minY*r[1]*o,a,n[1]+(e.maxY+1)*r[1]*o,i)},ea.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=ta;this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n);var o=n[1],r=n[2];return this.getTileCoordForXYAndZ_(t[2],t[3],e,!0,n),jr(o,n[1],r,n[2],i)},ea.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Zn(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]+(t[2]+.5)*n[1]*i]},ea.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),o=Zn(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*o[0]*n,s=i[1]+t[2]*o[1]*n;return Ye(r,s,r+o[0]*n,s+o[1]*n,e)},ea.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},ea.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,o){var r=this.getZForResolution(i),s=i/this.getResolution(r),a=this.getOrigin(r),h=Zn(this.getTileSize(r),this.tmpSize_),l=n?.5:0,u=n?0:.5,c=Math.floor((t-a[0])/i+l),p=Math.floor((e-a[1])/i+u),d=s*c/h[0],f=s*p/h[1];return n?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),Xs(r,d,f,o)},ea.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,o){var r=this.getOrigin(i),s=this.getResolution(i),a=Zn(this.getTileSize(i),this.tmpSize_),h=n?.5:0,l=n?0:.5,u=Math.floor((t-r[0])/s+h),c=Math.floor((e-r[1])/s+l),p=u/a[0],d=c/a[1];return n?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),Xs(i,p,d,o)},ea.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},ea.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},ea.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},ea.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},ea.prototype.getZForResolution=function(t,e){return se(Dt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},ea.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i};var ia=ea;function na(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,i,n){return function(t,e,i,n){var o=void 0!==n?n:Oe.TOP_LEFT,r=oa(t,e,i);return new ia({extent:t,origin:Je(t,o),resolutions:r,tileSize:i})}(ra(t),e,i,n)}(t),t.setDefaultTileGrid(e)),e}function oa(t,e,i){for(var n=void 0!==e?e:oe,o=$e(t),r=ni(t),s=Zn(void 0!==i?i:re),a=Math.max(r/s[0],o/s[1]),h=n+1,l=new Array(h),u=0;u<h;++u)l[u]=a/Math.pow(2,u);return l}function ra(t){var e=(t=Gi(t)).getExtent();if(!e){var i=180*pi[di.DEGREES]/t.getMetersPerUnit();e=Ye(-i,-i,i,i)}return e}var sa=function(t){function e(e){t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX}),this.opaque_=void 0!==e.opaque&&e.opaque,this.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,this.tileGrid=void 0!==e.tileGrid?e.tileGrid:null,this.tileCache=new Ws(e.cacheSize),this.tmpSize=[0,0],this.key_=e.key||"",this.tileOptions={transition:e.transition}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,n){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var r,s,a,h=!0,l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u)s=js(e,l,u),a=!1,o.containsKey(s)&&(a=(r=o.get(s)).getState()===te.LOADED)&&(a=!1!==n(r)),a||(h=!1);return h},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,r){return n()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:na(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!ji(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,o,r,s=this.getTileGridForProjection(i),a=this.getTilePixelRatio(e),h=Zn(s.getTileSize(t),this.tmpSize);return 1==a?h:(n=h,o=a,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=n[0]*o+.5|0,r[1]=n[1]*o+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],o=t.getTileCoordCenter(e),r=ra(i);if(De(r,o))return e;var s=ni(r),a=Math.ceil((r[0]-o[0])/s);return o[0]+=s*a,t.getTileCoordForCoordAndZ(o,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],o=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r,s=e.getExtent();return!(r=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||r.containsXY(n,o)}(t,n)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,i,n){},e}($s),aa=function(t){function e(e,i){t.call(this,e),this.tile=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O),ha="tileloadstart",la="tileloadend",ua="tileloaderror";function ca(t,e){t.getImage().src=e}var pa=function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",o=void 0!==i.tileGrid?i.tileGrid:function(t){var e=t||{},i=e.extent||Gi("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:oa(i,e.maxZoom,e.tileSize)};return new ia(n)}({extent:ra(n),maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:ca,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this.tileClass=void 0!==e.tileClass?e.tileClass:Ys,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[n];o.expireCache(o==i?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!ji(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!ji(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!ji(e,t)){var i=r(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=na(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||ji(e,t))return this.tileCache;var i=r(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Ws(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,o,r){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,o),h=a?this.tileUrlFunction(a,n,o):void 0,l=new this.tileClass(s,void 0!==h?te.IDLE:te.EMPTY,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=r,v(l,M.CHANGE,this.handleTileChange,this),l},e.prototype.getTile=function(t,e,i,n,o){var r=this.getProjection();if(r&&o&&!ji(r,o)){var s,a=this.getTileCacheForProjection(o),h=[t,e,i],l=Ks(h);a.containsKey(l)&&(s=a.get(l));var u=this.getKey();if(s&&s.key==u)return s;var c=this.getTileGridForProjection(r),p=this.getTileGridForProjection(o),d=this.getTileCoordForTileUrlFunction(h,o),f=new Hs(r,c,o,p,h,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return f.key=u,s?(f.interimTile=s,f.refreshInterimChain(),a.replace(l,f)):a.set(l,f),f}return this.getTileInternal(t,e,i,n,r||o)},e.prototype.getTileInternal=function(t,e,i,n,o){var r=null,s=js(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((r=this.tileCache.get(s)).key!=a){var h=r;r=this.createTile_(t,e,i,n,o,a),h.getState()==te.IDLE?r.interimTile=h.interimTile:r.interimTile=h,r.refreshInterimChain(),this.tileCache.replace(s,r)}}else r=this.createTile_(t,e,i,n,o,a),this.tileCache.set(s,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Gi(t);if(i){var n=r(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(function(t){function e(e){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}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):Js,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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,n=r(i),o=i.getState();o==te.LOADING?(this.tileLoadingKeys_[n]=!0,e=ha):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=o==te.ERROR?ua:o==te.LOADED||o==te.ABORT?la:void 0),null!=e&&this.dispatchEvent(new aa(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=this.urls=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n,o=i[1].charCodeAt(0),r=i[2].charCodeAt(0);for(n=o;n<=r;++n)e.push(t.replace(i[0],String.fromCharCode(n)));return e}if(i=i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(qs(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,i){var n=js(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(sa))),da="projection";function fa(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}var _a=function(t){function e(e){var i=e||{},n=document.createElement("div");n.className=void 0!==i.className?i.className:"ol-mouse-position",t.call(this,{element:n,render:i.render||fa,target:i.target}),v(this,D(da),this.handleProjectionChanged_,this),i.coordinateFormat&&this.setCoordinateFormat(i.coordinateFormat),i.projection&&this.setProjection(i.projection),this.undefinedHTML_=void 0!==i.undefinedHTML?i.undefinedHTML:" ",this.renderOnMouseOut_=!!this.undefinedHTML_,this.renderedHTML_=n.innerHTML,this.mapProjection_=null,this.transform_=null,this.lastMouseMovePixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},e.prototype.getProjection=function(){return this.get(da)},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.lastMouseMovePixel_=e.getEventPixel(t),this.updateHTML_(this.lastMouseMovePixel_)},e.prototype.handleMouseOut=function(t){this.updateHTML_(null),this.lastMouseMovePixel_=null},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var i=e.getViewport();this.listenerKeys.push(v(i,M.MOUSEMOVE,this.handleMouseMove,this),v(i,M.TOUCHSTART,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(v(i,M.MOUSEOUT,this.handleMouseOut,this),v(i,M.TOUCHEND,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set("coordinateFormat",t)},e.prototype.setProjection=function(t){this.set(da,Gi(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var i=this.getProjection();this.transform_=i?Ki(this.mapProjection_,i):Fi}var n=this.getMap().getCoordinateFromPixel(t);if(n){this.transform_(n,n);var o=this.getCoordinateFormat();e=o?o(n):n.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e}(Jn),ga=i(0);const va=new _i({code:"ZOOMIFY",units:"pixels",extent:[ga.b,-ga.e,ga.c,-ga.d]});var ya;new Ps({target:"map",controls:[new _a({coordinateFormat:(ya=0,function(t){return function(t,e){return function(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}(t,"{x}, {y}",e)}(t,ya)})})],layers:[new ks({source:new pa({url:"./tiles/{z}/{x}/{y}.png",projection:va})})],view:new Nn({center:[0,0],zoom:0,minZoom:0,maxZoom:ga.a,projection:va,extent:va.getExtent()})})}]);