f&&(u=m,f=E)}f>o&&(c[(u-e)/r]=1,d+r0&&g>f)&&(_<0&&v<_||_==v||_>0&&v>_)?(h=p,c=d):(s[a++]=h,s[a++]=c,l=h,u=c,h=p,c=d)}}return s[a++]=h,s[a++]=c,a}function a(t,e,i,n,r,o,a,h){for(var c=0,l=i.length;c0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Object(n.b)(e,this.renderedAttributions_)){Object(s.d)(this.ulElement_);for(var r=0,o=e.length;r=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 r=t.viewHints;r[j.a.ANIMATING]&&(i=this.loadTilesWhileAnimating_?8:0,n=2),r[j.a.INTERACTING]&&(i=this.loadTilesWhileInteracting_?8:0,n=2)}e.getTilesLoading()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 r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},X.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},X.prototype.getAngle=function(){return this.angle_};var z=X,W=i(21),K="active",U=i(6);function V(t,e,i,n){H(t,e=t.constrainRotation(e,0),i,n)}function H(t,e,i,n){if(void 0!==e){var r=t.getRotation(),o=t.getCenter();void 0!==r&&o&&n>0?t.animate({rotation:e,anchor:i,duration:n,easing:W.b}):t.rotate(e,i)}}function B(t,e,i,n){var r=t.getResolution(),o=t.constrainResolution(r,e,0);if(void 0!==o){var s=t.getResolutions();o=Object(U.a)(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==o&&o!==r){var a=t.getCenter(),h=t.calculateCenterZoom(o,i);h=t.constrainCenter(h),i=[(o*a[0]-r*h[0])/(o-r),(o*a[1]-r*h[1])/(o-r)]}Z(t,o,i,n)}function Z(t,e,i,n){if(e){var r=t.getResolution(),o=t.getCenter();if(void 0!==r&&o&&e!==r&&n)t.animate({resolution:e,anchor:i,duration:n,easing:W.b});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}var q=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(K)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(K,t)},e.prototype.setMap=function(t){this.map_=t},e}(O.a);function J(t){var e=!1;if(t.type==u.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;B(n.getView(),o,r,this.duration_),t.preventDefault(),e=!0}return!e}var Q=function(t){function e(e){t.call(this,{handleEvent:J});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}(q),$=i(34),tt=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},et=function(t){return t.target.getTargetElement()===document.activeElement},it=M.b,nt=function(t){var e=t.originalEvent;return 0==e.button&&!(c.i&&c.d&&e.ctrlKey)},rt=(M.a,function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}),ot=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},st=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},at=function(t){var e=t.pointerEvent;return Object(x.a)(void 0!==e,56),"mouse"==e.pointerType};function ht(t){for(var e=t.length,i=0,n=0,r=0;r=O)&&c.push(E[o],E[o+1]);if(0==(l=c.length))return}l=this.appendFlatCoordinates(c,0,l,u,!1,!1),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(b,a,l),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,i,n){var r,o=n+e+t+i+this.pixelRatio;if(!zt.o.containsKey(o)){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,p=xe[h.textAlign||zt.l],d=n&&s.lineWidth?s.lineWidth:0,f=t.split("\n"),_=f.length,g=[],v=function(t,e,i){for(var n=e.length,r=0,o=0;o=this.transition_?1:Object(s.a)(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}(a.a),l=i(10),u=i(1);function p(){var t=Object(l.a)(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var d=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,s),this.crossOrigin_=r,this.src_=n,this.image_=new Image,null!==r&&(this.image_.crossOrigin=r),this.imageListenerKeys_=null,this.tileLoadFunction_=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==o.a.LOADING&&(this.unlistenImage_(),this.image_=p()),this.interimTile&&this.interimTile.dispose(),this.state=o.a.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=o.a.ERROR,this.unlistenImage_(),this.image_=p(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=o.a.LOADED:this.state=o.a.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==o.a.ERROR&&(this.state=o.a.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==o.a.IDLE&&(this.state=o.a.LOADING,this.changed(),this.imageListenerKeys_=[Object(u.b)(this.image_,h.a.ERROR,this.handleImageError_,this),Object(u.b)(this.image_,h.a.LOAD,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(u.e),this.imageListenerKeys_=null},e}(c);function f(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function _(t,e,i){return t+"/"+e+"/"+i}function g(t){return _(t[0],t[1],t[2])}var v=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(g(e.tileCoord)),e.dispose())},this)}},e}(i(72).a),y=i(16),m=i(0),b=i(6);function O(t,e,i,n){var r=i-t,o=n-e,s=Math.sqrt(r*r+o*o);return[Math.round(i+r/s),Math.round(n+o/s)]}var E=function(t,e,i,n,r){this.sourceProj_=t,this.targetProj_=e;var o={},s=Object(y.getTransform)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=s(t)),o[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Object(m.E)(n)==Object(m.E)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Object(m.E)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Object(m.E)(this.targetProj_.getExtent()):null;var a=Object(m.C)(i),h=Object(m.D)(i),c=Object(m.w)(i),l=Object(m.v)(i),u=this.transformInv_(a),p=this.transformInv_(h),d=this.transformInv_(c),f=this.transformInv_(l);if(this.addQuad_(a,h,c,l,u,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