var t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function e(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e=0||c.match(/cpu (os|iphone os) 15_4 like mac os x/));var d,y=-1!==c.indexOf("webkit")&&-1==c.indexOf("edge"),g=-1!==c.indexOf("macintosh"),v="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,m="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,_="undefined"!=typeof Image&&Image.prototype.decode,x=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}(),b=(d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},d(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),w=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.14.1".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return b(e,t),e}(Error);function C(t,e){if(!t)throw new w(e)}var S,T=new Array(6);function E(t){return P(t,1,0,0,1,0,0)}function O(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],h=e[3],c=e[4],f=e[5];return t[0]=r*l+i*u,t[1]=n*l+o*u,t[2]=r*p+i*h,t[3]=n*p+o*h,t[4]=r*c+i*f+a,t[5]=n*c+o*f+s,t}function P(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function R(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function I(t,e,r){return O(t,P(T,e,0,0,r,0,0))}function M(t,e,r,n,i,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=i*l,t[2]=-n*l,t[3]=i*u,t[4]=a*n*u-s*n*l+e,t[5]=a*i*l+s*i*u+r,t}function k(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];C(0!==n,32);var i=e[0],o=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=i/n,t[4]=(a*u-s*l)/n,t[5]=-(i*u-o*l)/n,t}var F="bottom-left",A="bottom-right",L="top-left",j="top-right",D=0,z=1,G=2,N=4,W=8,X=16;function B(t){for(var e=J(),r=0,n=t.length;ri&&(l|=N),so&&(l|=G),l===D&&(l=z),l}function J(){return[1/0,1/0,-1/0,-1/0]}function $(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function Q(t){return $(1/0,1/0,-1/0,-1/0,t)}function tt(t,e){var r=t[0],n=t[1];return $(r,n,r,n,e)}function et(t,e,r,n,i){return ot(Q(i),t,e,r,n)}function rt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function nt(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function it(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function ot(t,e,r,n,i){for(;re[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function xt(t){return t[2]1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return Et(t,e,r,n)}function Et(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function Ot(t){return t*Math.PI/180}function Pt(t,e){var r=t%e;return r*e<0?r+e:r}function Rt(t,e,r){return t+r*(e-t)}function It(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function Mt(t,e){return Math.floor(It(t,e))}function kt(t,e){return Math.ceil(It(t,e))}var Ft=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,At=/^([a-z]*)$|^hsla?\(.*\)$/i;function Lt(t){return"string"==typeof t?t:Gt(t)}var jt=function(){var t={},e=0;return function(r){var n;if(t.hasOwnProperty(r))n=t[r];else{if(e>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--e)}n=function(t){var e,r,n,i,o;At.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}(t));if(Ft.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),r=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),i=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,l&&(i=(i<<4)+i)),o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?zt(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),zt(o)):C(!1,14);return o}(r),t[r]=n,++e}return n}}();function Dt(t){return Array.isArray(t)?t:jt(t)}function zt(t){return t[0]=wt(t[0]+.5|0,0,255),t[1]=wt(t[1]+.5|0,0,255),t[2]=wt(t[2]+.5|0,0,255),t[3]=wt(t[3],0,1),t}function Gt(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}var Nt=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=Wt(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=Wt(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function Wt(t,e,r){return e+":"+t+":"+(r?Lt(r):"null")}var Xt=new Nt,Bt=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),Vt="propertychange",qt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=l,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(t),Jt="change",$t="error",Qt="contextmenu",te="click",ee="dblclick",re="keydown",ne="keypress",ie="load",oe="resize",ae="touchmove",se="wheel";function le(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var a={target:t,type:e,listener:r};return t.addEventListener(e,r),a}function ue(t,e,r,n){return le(t,e,r,n,!0)}function pe(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Zt(t))}var he=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ce=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return he(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Jt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var We=Ge;function Xe(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function Be(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function Ve(t,e){if(e.canWrapX()){var r=mt(e.getExtent()),n=function(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]n[2])){var o=r||mt(n);i=Math.floor((t[0]-n[0])/o)}return i}(t,e,r);n&&(t[0]-=n*r)}return t}var qe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ze=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r}return qe(e,t),e.prototype.dispatchRenderEvent=function(t,e){u()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;M(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),k(n,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var l,u=e.viewState;function p(t,e,r,n){return i.call(o,e,t?r:null,n)}var h=u.projection,c=Ve(t.slice(),h),f=[[0,0]];if(h.canWrapX()&&n){var d=mt(h.getExtent());f.push([-d,0],[d,0])}for(var y=e.layerStatesArray,g=y.length,v=[],m=[],_=0;_=0;--x){var b=y[x],w=b.layer;if(w.hasRenderer()&&Ne(b,u)&&a.call(s,w)){var C=w.getRenderer(),S=w.getSource();if(C&&S){var T=S.getWrapX()?c:t,E=p.bind(null,b.managed);m[0]=T[0]+f[_][0],m[1]=T[1]+f[_][1],l=C.forEachFeatureAtCoordinate(m,e,r,E,v)}if(l)return l}}if(0!==v.length){var O=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*O})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){return u()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,a,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){u()},e.prototype.scheduleExpireIconCache=function(t){Xt.canExpireCache()&&t.postRenderFunctions.push(Ke)},e}(t);function Ke(t,e){Xt.expire()}var Ye=Ze,Ue=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),He=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Ue(e,t),e}(Bt),Je=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),$e=["style","variant","weight","size","lineHeight","family"],Qe=function(t){var e=t.match(Je);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=$e.length;n=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(ke,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&Ne(l,o)&&i(u)){var p=u.getRenderer().getDataAtPixel(t,e,r);if(p){var h=n(u,p);if(h)return h}}}},e}(Ye),br="add",wr="remove",Cr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sr="length",Tr=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return Cr(e,t),e}(Bt),Er=function(t){function e(e,r){var n=t.call(this)||this;n.on,n.once,n.un;var i=r||{};if(n.unique_=!!i.unique,n.array_=e||[],n.unique_)for(var o=0,a=n.array_.length;o0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(pe(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ae,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(pe(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(pe),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Ht),Xr="postrender",Br="movestart",Vr="moveend",qr="loadstart",Zr="loadend",Kr="layergroup",Yr="size",Ur="target",Hr="view",Jr=1/0,$r=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Zt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=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_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){C(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Jr&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=lt;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a],n[e]=n[a],e=a}r[e]=i,n[e]=o},t.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==Qr||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}($r);var sn="Point",ln="LineString",un="LinearRing",pn="Polygon",hn="MultiPoint",cn="MultiLineString",fn="MultiPolygon",dn="GeometryCollection",yn="Circle",gn={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},vn={};vn[gn.RADIANS]=6370997/(2*Math.PI),vn[gn.DEGREES]=2*Math.PI*6370997/360,vn[gn.FEET]=.3048,vn[gn.METERS]=1,vn[gn.USFEET]=1200/3937;var mn=gn,_n=0,xn=1,bn={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},wn=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||vn[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),Cn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sn=6378137*Math.PI,Tn=[-Sn,-Sn,Sn,Sn],En=[-180,-85,180,85],On=6378137*Math.log(Math.tan(Math.PI/2)),Pn=function(t){function e(e){return t.call(this,{code:e,units:mn.METERS,extent:Tn,global:!0,worldExtent:En,getPointResolution:function(t,e){return t/Ct(e[1]/6378137)}})||this}return Cn(e,t),e}(wn),Rn=[new Pn("EPSG:3857"),new Pn("EPSG:102100"),new Pn("EPSG:102113"),new Pn("EPSG:900913"),new Pn("http://www.opengis.net/def/crs/EPSG/0/3857"),new Pn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function In(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;aOn?s=On:s<-On&&(s=-On),o[a+1]=s}return o}function Mn(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Wn=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function ni(t,e){return t}function ii(t,e,r){return function(n,i,o,a,s){if(n){if(!i&&!e)return n;var l=e?0:o[0]*i,u=e?0:o[1]*i,p=s?s[0]:0,h=s?s[1]:0,c=t[0]+l/2+p,f=t[2]-l/2+p,d=t[1]+u/2+h,y=t[3]-u/2+h;c>f&&(f=c=(f+c)/2),d>y&&(y=d=(y+d)/2);var g=wt(n[0],c,f),v=wt(n[1],d,y);if(a&&r&&i){var m=30*i;g+=-m*Math.log(1+Math.max(0,c-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-f)/m),v+=-m*Math.log(1+Math.max(0,d-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-y)/m)}return[g,v]}}}function oi(t){return t}function ai(t,e,r,n){var i=mt(e)/r[0],o=dt(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function si(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),wt(n,r/2,2*e)}function li(t,e,r,n,i){return function(o,a,s,l){if(void 0!==o){var u=n?ai(t,n,s,i):t;return(void 0===r||r)&&l?si(o,u,e):wt(o,e,u)}}}function ui(t){return void 0!==t?0:void 0}function pi(t){return void 0!==t?t:void 0}function hi(t){return Math.pow(t,3)}function ci(t){return 1-hi(1-t)}function fi(t){return 3*t*t-2*t*t*t}function di(t){return t}Kn(Rn),Kn(jn),$n=Rn,Qn=In,ti=Mn,jn.forEach((function(t){$n.forEach((function(e){Gn(t,e,Qn),Gn(e,t,ti)}))}));var yi="XY",gi="XYZ",vi="XYM",mi="XYZM";function _i(t,e,r,n,i,o){for(var a=o||[],s=0,l=e;l1)s=r;else{if(c>0){for(var f=0;fi&&(i=u),o=s,a=l}return i}function Mi(t,e,r,n,i){for(var o=0,a=r.length;o0;){for(var h=u.pop(),c=u.pop(),f=0,d=t[c],y=t[c+1],g=t[h],v=t[h+1],m=c+n;mf&&(p=m,f=_)}f>i&&(l[(p-e)/n]=1,c+n0&&y>f)&&(d<0&&g0&&g>d)?(s=h,l=c):(o[a++]=s,o[a++]=l,u=s,p=l,s=h,l=c)}}return o[a++]=s,o[a++]=l,a}function Gi(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;lo&&(u-s)*(o-l)-(i-s)*(p-l)>0&&a++:p<=o&&(u-s)*(o-l)-(i-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function Qi(t,e,r,n,i,o){if(0===r.length)return!1;if(!$i(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;ab&&Qi(t,r,n,i,p=(h+c)/2,y)&&(x=p,b=w),h=c}return isNaN(x)&&(x=o[a]),s?(s.push(x,y,b),s):[x,y,b]}function eo(t,e,r,n,i){for(var o=[],a=0,s=r.length;a=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||ro(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=H(t,e),o=H(t,r);if(i===z||o===z)n=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],h=e[1],c=r[0],f=r[1],d=(f-h)/(c-p),y=void 0,g=void 0;o&G&&!(i&G)&&(n=(y=c-(f-u)/d)>=a&&y<=l),n||!(o&N)||i&N||(n=(g=f-(c-l)*d)>=s&&g<=u),n||!(o&W)||i&W||(n=(y=c-(f-s)/d)>=a&&y<=l),n||!(o&X)||i&X||(n=(g=f-(c-a)*d)>=s&&g<=u)}return n}(i,t,e)})))))}function io(t,e,r,n,i){if(!function(t,e,r,n,i){return!!(no(t,e,r,n,i)||$i(t,e,r,n,i[0],i[1])||$i(t,e,r,n,i[0],i[3])||$i(t,e,r,n,i[2],i[1])||$i(t,e,r,n,i[2],i[3]))}(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o0}function so(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;ah&&f1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n0},e.prototype.getInteracting=function(){return this.hints_[xn]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(_n,-this.hints_[_n]);for(var e=0,r=this.animations_.length;e=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o0?l/s.duration:1;u>=1?(s.complete=!0,u=1):i=!1;var p=s.easing(u);if(s.sourceCenter){var h=s.sourceCenter[0],c=s.sourceCenter[1],f=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var y=h+p*(f-h),g=c+p*(d-c);this.targetCenter_=[y,g]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var m=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,m,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var x=1===p?Pt(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var b=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(b,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(i){this.animations_[r]=null,this.setHint(_n,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=n[0].callback;w&&vo(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,n,i,o=this.getCenterInternal();return void 0!==o&&(Be(r=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),i=e,(n=r)[0]+=+i[0],n[1]+=+i[1]),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],n=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?ei(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(bn.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return function(t,e){return t}(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();C(r,1);var n=this.getResolution();C(void 0!==n,2);var i=this.getRotation();return C(void 0!==i,3),ft(r,n,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(bn.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(ni(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),n=mt(t)/r[0],i=dt(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(bn.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/e;return function(t){return Math.log(r/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),r=this.padding_;return r&&(e=[e[0]-r[1]-r[3],e[1]-r[0]-r[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),r=this.getRotation(),n=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();n=_o(n,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,r)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,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,n,i=this.minZoom_||0;if(this.resolutions_){var o=r(this.resolutions_,t,1);i=o,e=this.resolutions_[o],n=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,n=this.zoomFactor_;return i+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=wt(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,wt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(C(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))C(!xt(t),25),r=fo(n=ni(t,this.getProjection()));else if(t.getType()===yn){var n;(r=fo(n=ni(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ht(n))}else{r=t}this.fitInternal(r,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),r=Math.cos(e),n=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,h=i.length;p0&&t[1]>0}function wo(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Co=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function So(t){t instanceof We?t.setMapInternal(null):t instanceof kr&&t.getLayers().forEach(So)}function To(t,e){if(t instanceof We)t.setMapInternal(e);else if(t instanceof kr)for(var r=t.getLayers().getArray(),n=0,i=r.length;n=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[_n]||i[xn]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!o(e,this.renderedAttributions_)){or(this.ulElement_);for(var n=0,i=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:ci}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains("ol-hidden");i||0!==r?i&&0!==r&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=n}this.rotation_=r}},e}(Po),Fo=ko,Ao=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lo=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInClassName?n.zoomInClassName:i+"-in",s=void 0!==n.zoomOutClassName?n.zoomOutClassName:i+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",u=void 0!==n.zoomOutLabel?n.zoomOutLabel:"–",p=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",h=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=a,c.setAttribute("type","button"),c.title=p,c.appendChild("string"==typeof l?document.createTextNode(l):l),c.addEventListener(te,r.handleClick_.bind(r,o),!1);var f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=h,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(te,r.handleClick_.bind(r,-o),!1);var d=i+" ol-unselectable ol-control",y=r.element;return y.className=d,y.appendChild(c),y.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return Ao(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:ci})):e.setZoom(n)}}},e}(Po),jo="bottom-left",Do="bottom-center",zo="bottom-right",Go="center-left",No="center-center",Wo="center-right",Xo="top-left",Bo="top-center",Vo="top-right",qo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zo="element",Ko="map",Yo="offset",Uo="position",Ho="positioning",Jo=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un,r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",r.element.style.position="absolute",r.element.style.pointerEvents="auto";var n=e.autoPan;return n&&"object"!=typeof n&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),r.autoPan=n||!1,r.rendered={transform_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addChangeListener(Zo,r.handleElementChanged),r.addChangeListener(Ko,r.handleMapChanged),r.addChangeListener(Yo,r.handleOffsetChanged),r.addChangeListener(Uo,r.handlePositionChanged),r.addChangeListener(Ho,r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(void 0!==e.positioning?e.positioning:Xo),void 0!==e.position&&r.setPosition(e.position),r}return qo(e,t),e.prototype.getElement=function(){return this.get(Zo)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Ko)||null},e.prototype.getOffset=function(){return this.get(Yo)},e.prototype.getPosition=function(){return this.get(Uo)},e.prototype.getPositioning=function(){return this.get(Ho)},e.prototype.handleElementChanged=function(){or(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(ir(this.element),pe(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=le(t,Xr,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Zo,t)},e.prototype.setMap=function(t){this.set(Ko,t)},e.prototype.setOffset=function(t){this.set(Yo,t)},e.prototype.setPosition=function(t){this.set(Uo,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Uo)){var r=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),i=this.getRect(n,[er(n),rr(n)]),o=t||{},a=void 0===o.margin?20:o.margin;if(!Y(r,i)){var s=i[0]-r[0],l=r[2]-i[2],u=i[1]-r[1],p=r[3]-i[3],h=[0,0];if(s<0?h[0]=s-a:l<0&&(h[0]=Math.abs(l)+a),u<0?h[1]=u-a:p<0&&(h[1]=Math.abs(p)+a),0!==h[0]||0!==h[1]){var c=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(c);if(!f)return;var d=[f[0]+h[0],f[1]+h[1]],y=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:y.duration,easing:y.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),n=r.left+window.pageXOffset,i=r.top+window.pageYOffset;return[n,i,n+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(Ho,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(r,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,n=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+n[0])+"px",a=Math.round(t[1]+n[1])+"px",s="0%",l="0%";i==zo||i==Wo||i==Vo?s="-100%":i!=Do&&i!=No&&i!=Bo||(s="-50%"),i==jo||i==Do||i==zo?l="-100%":i!=Go&&i!=No&&i!=Wo||(l="-50%");var u="translate(".concat(s,", ").concat(l,") translate(").concat(o,", ").concat(a,")");this.rendered.transform_!=u&&(this.rendered.transform_=u,r.transform=u,r.msTransform=u)},e.prototype.getOptions=function(){return this.options},e}(ge),$o=Jo;var Qo="active",ta=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ea(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:ci})}}var ra=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return ta(e,t),e.prototype.getActive=function(){return this.get(Qo)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Qo,t)},e.prototype.setMap=function(t){this.map_=t},e}(ge),na=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ia=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return na(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Dr.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;ea(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(ra),oa=ia,aa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function sa(t){for(var e=t.length,r=0,n=0,i=0;i0}}else if(t.type==Dr.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Dr.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===Dr.POINTERDOWN||e===Dr.POINTERDRAG||e===Dr.POINTERUP}(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==Dr.POINTERUP?delete this.trackedPointers_[r]:(t.type==Dr.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=Kt(this.trackedPointers_)}},e}(ra);function ua(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(la),ba=xa,wa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ca=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:s})||this).condition_=n.condition?n.condition:pa,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return wa(e,t),e.prototype.handleDragEvent=function(t){if(va(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==ui){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;r.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!va(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!va(t)&&(!(!fa(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(la),Sa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ta=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return Sa(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+r,n.top=Math.min(t[1],e[1])+r,n.width=Math.abs(e[0]-t[0])+r,n.height=Math.abs(e[1]-t[1])+r},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new co([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(t),Ea=Ta,Oa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pa="boxstart",Ra="boxdrag",Ia="boxend",Ma="boxcancel",ka=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return Oa(e,t),e}(Bt),Fa=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new Ea(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(r.onBoxEnd=n.onBoxEnd),r.startPixel_=null,r.condition_=n.condition?n.condition:fa,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return Oa(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new ka(Ra,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new ka(e?Ia:Ma,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ka(Pa,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(la),Aa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),La=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:ya;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return Aa(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),r=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(r),i=e.getResolutionForExtentInternal(n),o=e.getResolution()/i;(r=r.clone()).scale(o*o)}e.fitInternal(r,{duration:this.duration_,easing:ci})},e}(Fa),ja=37,Da=38,za=39,Ga=40,Na=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wa=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return da(t)&&ga(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Na(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==re){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(n==Ga||n==ja||n==za||n==Da)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,a=0,s=0;n==Ga?s=-o:n==ja?a=-o:n==za?a=o:s=o;var l=[a,s];Be(l,i.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:di,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(ra),Xa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ba=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:ga,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Xa(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==re||t.type==ne){var r=t.originalEvent,n=r.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var i=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;ea(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(ra),Va=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),qa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Za="trackpad",Ka="wheel",Ya=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var i=n.condition?n.condition:ca;return r.condition_=n.onFocusOnly?ua(ha,i):i,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return qa(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==se)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==se&&(e=n.deltaY,f&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=v),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Za:Ka);var o=r.getView();if(this.mode_===Za&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-wt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),ea(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(ra),Ua=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ha=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=s),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return Ua(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==ui){var l=a.getViewport().getBoundingClientRect(),u=sa(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(la),Ja=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$a=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=s),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Ja(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=sa(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(la),Qa="arraybuffer",ts="json",es="text",rs="xml",ns=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),is=function(t){function e(e){var r=t.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return ns(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(pe(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=le(t,Jt,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(C("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(ge);var os=is;function as(t,r,n,i,o,a,s){var l,u,p=(n-r)/i;if(1===p)l=r;else if(2===p)l=r,u=o;else if(0!==p){for(var h=t[r],c=t[r+1],f=0,d=[0],y=r+i;y>1)],r))<0?s=i+1:(l=i,u=!o);return u?s:~s}(d,m);_<0?(u=(m-d[-_-2])/(d[-_-1]-d[-_-2]),l=r+(-_-2)*i):l=r+_*i}var x=s>1?s:2,b=a||new Array(x);for(y=0;y>1;ir;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Cs(t,e,Math.max(r,Math.floor(e-a*l/o+u)),Math.min(n,Math.floor(e+(o-a)*l/o+u)),i)}var p=t[e],h=r,c=n;for(Ss(t,r,e),i(t[n],p)>0&&Ss(t,r,n);h0;)c--}0===i(t[r],p)?Ss(t,r,c):Ss(t,++c,n),c<=e&&(r=c+1),e<=c&&(n=c-1)}}function Ss(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Ts(t,e){return te?1:0}class Es{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const r=[];if(!Ds(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)}_split(t,e){const r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n),a=zs(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Ps(r,this.toBBox),Ps(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,e){this.data=zs([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ps(this.data,this.toBBox)}_chooseSplitIndex(t,e,r){let n,i=1/0,o=1/0;for(let a=e;a<=r-e;a++){const e=Rs(t,0,a,this.toBBox),s=Rs(t,a,r,this.toBBox),l=Ls(e,s),u=Fs(e)+Fs(s);l=e;n--){const e=t.children[n];Is(a,t.leaf?i(e):e),s+=As(a)}return s}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)Is(e[n],t)}_condense(t){for(let e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():Ps(t[r],this.toBBox)}}function Os(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n=t.minX&&e.maxY>=t.minY}function zs(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gs(t,e,r,n,i){const o=[e,r];for(;o.length;){if((r=o.pop())-(e=o.pop())<=n)continue;const a=e+Math.ceil((r-e)/n/2)*n;ws(t,a,e,r,i),o.push(e,a,a,r)}}var Ns=0,Ws=1,Xs=2,Bs=3,Vs=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=wo(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return u()},t.prototype.getImage=function(t){return u()},t.prototype.getHitDetectionImage=function(){return u()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return u()},t.prototype.getImageSize=function(){return u()},t.prototype.getOrigin=function(){return u()},t.prototype.getSize=function(){return u()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=wo(t)},t.prototype.listenImageChange=function(t){u()},t.prototype.load=function(){u()},t.prototype.unlistenImageChange=function(t){u()},t}(),qs=Vs;function Zs(t){return Array.isArray(t)?Gt(t):t}var Ks=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ys=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return Ks(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var r=this.renderOptions_,n=tr(r.size*t,r.size*t);this.draw_(r,n,t),e=n.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Xs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,r){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,i=void 0===this.radius2_?n:this.radius2_;if(nh&&(this.instructions.push([gl.CUSTOM,h,o,t,r,Ni]),this.hitDetectionInstructions.push([gl.CUSTOM,h,o,t,n||r,Ni]));break;case sn:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([gl.CUSTOM,h,o,t,r]),this.hitDetectionInstructions.push([gl.CUSTOM,h,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[gl.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[gl.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,i,o=e.length,a=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[gl.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[gl.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,a=t.lineDashOffset,s=t.lineJoin,l=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!o(t.currentLineDash,i)||t.currentLineDashOffset!=a||t.currentLineJoin!=s||t.currentLineWidth!=l||t.currentMiterLimit!=u)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=a,t.currentLineJoin=s,t.currentLineWidth=l,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[gl.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=q(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;V(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(vl),xl=_l,bl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wl=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return bl(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([gl.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([gl.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([gl.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([gl.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(xl),Cl=wl,Sl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tl=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return Sl(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,r,n,!1,!1),a=[gl.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([gl.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ar,0],dl);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(fl),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([gl.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],dl);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=o.length;ut&&(v>g&&(g=v,d=m,y=o),v=0,m=o-i)),a=s,p=c,h=f),l=_,u=x}return(v+=s)>g?[m,o]:[d,y]}var kl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fl={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Al=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return kl(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o=this.coordinates,a=o.length,s=t.getType(),l=null,u=t.getStride();if(i.placement!==Il||s!=ln&&s!=cn&&s!=pn&&s!=fn){var p=i.overflow?null:[];switch(s){case sn:case hn:l=t.getFlatCoordinates();break;case ln:l=t.getFlatMidpoint();break;case yn:l=t.getCenter();break;case cn:l=t.getFlatMidpoints(),u=2;break;case pn:l=t.getFlatInteriorPoint(),i.overflow||p.push(l[2]/this.resolution),u=3;break;case fn:var h=t.getFlatInteriorPoints();l=[];for(w=0,C=h.length;wP[2]}else T=x>E;var R,I=Math.PI,M=[],k=w+n===e;if(g=0,v=C,c=t[e=w],f=t[e+1],k){m(),R=Math.atan2(f-y,c-d),T&&(R+=R>0?-I:I);var F=(E+x)/2,A=(O+b)/2;return M[0]=[F,A,(S-o)/2,R,i],M}for(var L=0,j=i.length;L0?-I:I),void 0!==R){var z=D-R;if(z+=z>I?-2*I:z<-I?2*I:0,Math.abs(z)>a)return null}R=D;for(var G=L,N=0;L0&&t.push("\n",""),t.push(e,""),t}var ou=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,a=r?this.fillStates[r]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=Array.isArray(t),h=nu(p?t[0]:t,s.textAlign||"center"),c=n&&o.lineWidth?o.lineWidth:0,f=p?t:t.split("\n").reduce(iu,[]),d=function(t,e){for(var r=[],n=[],i=[],o=0,a=0,s=0,l=0,u=0,p=e.length;u<=p;u+=2){var h=e[u];if("\n"!==h&&u!==p){var c=e[u+1]||t.font,f=gr(c,h);r.push(f),a+=f;var d=dr(c);n.push(d),l=Math.max(l,d)}else o=Math.max(o,a),i.push(a),a=0,s+=l}return{width:o,height:s,widths:r,heights:n,lineWidths:i}}(s,f),y=d.width,g=d.height,v=d.widths,_=d.heights,x=d.lineWidths,b=y+c,w=[],C=(b+2)*u[0],S=(g+c)*u[1],T={width:C<0?Math.floor(C):Math.ceil(C),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:w};(1==u[0]&&1==u[1]||w.push("scale",u),n)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",c),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(m?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));r&&w.push("fillStyle",a.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var E,O=.5-h,P=h*b+O*c,R=[],I=[],M=0,k=0,F=0,A=0,L=0,j=f.length;Lt?t-l:i,x=o+u>e?e-u:o,b=f[3]+_*h[0]+f[1],w=f[0]+x*h[1]+f[2],C=v-f[3],S=m-f[0];return(d||0!==p)&&(Jl[0]=C,tu[0]=C,Jl[1]=S,$l[1]=S,$l[0]=C+b,Ql[0]=$l[0],Ql[1]=S+w,tu[1]=Ql[1]),0!==p?(R(g=M([1,0,0,1,0,0],r,n,1,1,p,-r,-n),Jl),R(g,$l),R(g,Ql),R(g,tu),$(Math.min(Jl[0],$l[0],Ql[0],tu[0]),Math.min(Jl[1],$l[1],Ql[1],tu[1]),Math.max(Jl[0],$l[0],Ql[0],tu[0]),Math.max(Jl[1],$l[1],Ql[1],tu[1]),Hl)):$(Math.min(C,C+b),Math.min(S,S+w),Math.max(C,C+b),Math.max(S,S+w),Hl),c&&(v=Math.round(v),m=Math.round(m)),{drawImageX:v,drawImageY:m,drawImageW:_,drawImageH:x,originX:l,originY:u,declutterBox:{minX:Hl[0],minY:Hl[1],maxX:Hl[2],maxY:Hl[3],value:y},canvasTransform:g,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a){var s=!(!o&&!a),l=n.declutterBox,u=t.canvas,p=a?a[2]*n.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Jl,$l,Ql,tu,o,a),mr(t,n.canvasTransform,i,r,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=R(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,n){var i=this.textStates[e],o=this.createLabel(t,e,n,r),a=this.strokeStates[r],s=this.pixelRatio,l=nu(Array.isArray(t)?t[0]:t,i.textAlign||"center"),u=Fl[i.textBaseline||"middle"],p=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*i.scale[0])+2*(.5-l)*p,anchorY:u*o.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,r,n,i,a,s,l){var u,p,h;this.pixelCoordinates_&&o(r,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=_i(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),p=this.renderedTransform_,h=r,p[0]=h[0],p[1]=h[1],p[2]=h[2],p[3]=h[3],p[4]=h[4],p[5]=h[5]);for(var c,f,d,y,g,v,m,_,x,b,w,C,S,T,E,O,P=0,R=n.length,I=0,M=0,k=0,F=null,A=null,L=this.coordinateCache_,j=this.viewRotation_,D=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:j},G=this.instructions!=n||this.overlaps?0:200;PG&&(this.fill_(t),M=0),k>G&&(t.stroke(),k=0),M||k||(t.beginPath(),y=NaN,g=NaN),++P;break;case gl.CIRCLE:var W=u[I=N[1]],X=u[I+1],B=u[I+2]-W,V=u[I+3]-X,q=Math.sqrt(B*B+V*V);t.moveTo(W+q,X),t.arc(W,X,q,0,2*Math.PI,!0),++P;break;case gl.CLOSE_PATH:t.closePath(),++P;break;case gl.CUSTOM:I=N[1],c=N[2];var Z=N[3],K=N[4],Y=6==N.length?N[5]:void 0;z.geometry=Z,z.feature=S,P in L||(L[P]=[]);var U=L[P];Y?Y(u,I,c,2,U):(U[0]=u[I],U[1]=u[I+1],U.length=2),K(U,z),++P;break;case gl.DRAW_IMAGE:I=N[1],c=N[2],_=N[3],f=N[4],d=N[5];var H=N[6],J=N[7],$=N[8],Q=N[9],tt=N[10],et=N[11],rt=N[12],nt=N[13],it=N[14];if(!_&&N.length>=19){x=N[18],b=N[19],w=N[20],C=N[21];var ot=this.drawLabelWithPointPlacement_(x,b,w,C);_=ot.label,N[3]=_;var at=N[22];f=(ot.anchorX-at)*this.pixelRatio,N[4]=f;var st=N[23];d=(ot.anchorY-st)*this.pixelRatio,N[5]=d,H=_.height,N[6]=H,nt=_.width,N[13]=nt}var lt=void 0;N.length>24&&(lt=N[24]);var ut=void 0,pt=void 0,ht=void 0;N.length>16?(ut=N[15],pt=N[16],ht=N[17]):(ut=sr,pt=!1,ht=!1),tt&&D?et+=j:tt||D||(et-=j);for(var ct=0;Ir)break;var s=n[a];s||(s=[],n[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,n.length);i0){if(!a||c!==ql&&c!==Yl||-1!==a.indexOf(t)){var u=(f[n]-3)/4,p=i-u%s,d=i-(u/s|0),y=o(t,e,p*p+d*d);if(y)return y}h.clearRect(0,0,s,s);break}}var y,g,v,m,_,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(e),y=x.length-1;y>=0;--y){var b=x[y].toString();for(v=this.executorsByZIndex_[b],g=su.length-1;g>=0;--g)if(void 0!==(m=v[c=su[g]])&&(_=m.executeHitDetection(h,l,n,d,p)))return _}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return _i(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Yt(this.executorsByZIndex_)},t.prototype.execute=function(t,r,n,i,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(e),this.maxExtent_&&(t.save(),this.clip(t,n));var u,p,h,c,f,d,y=a||su;for(s&&l.reverse(),u=0,p=l.length;u0,6);var p=void 0!==n.src?Ns:Xs;return r.color_=void 0!==n.color?Dt(n.color):null,r.iconImage_=function(t,e,r,n,i,o){var a=Xt.get(e,n,o);return a||(a=new Eu(t,e,r,n,i,o),Xt.set(e,n,o,a)),a}(l,u,void 0!==r.imgSize_?r.imgSize_:null,r.crossOrigin_,p,r.color_),r.offset_=void 0!==n.offset?n.offset:[0,0],r.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:mu,r.origin_=null,r.size_=void 0!==n.size?n.size:null,r}return Ou(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==du||this.anchorYUnits_==du){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==du&&(t[0]*=e[0]),this.anchorYUnits_==du&&(t[1]*=e[1])}if(this.anchorOrigin_!=mu){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=_u&&this.anchorOrigin_!=vu||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=gu&&this.anchorOrigin_!=vu||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=mu){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=_u&&this.offsetOrigin_!=vu||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=gu&&this.offsetOrigin_!=vu||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Jt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Jt,t)},e}(qs),Ru=Pu,Iu=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=wo(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new tl({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Rl,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=wo(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Mu=Iu;var ku={Point:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Xs)return;var l=t.getBuilder(r.getZIndex(),ql);l.setImageStyle(a,o),l.drawPoint(e,n)}if(s&&s.getText()){var u=t.getBuilder(r.getZIndex(),Yl);u.setTextStyle(s,o),u.drawText(e,n)}},LineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),Zl);a.setFillStrokeStyle(null,o),a.drawLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Yl);l.setTextStyle(s),l.drawText(e,n)}},Polygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Kl);s.setFillStrokeStyle(o,a),s.drawPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Yl);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Xs)return;var l=t.getBuilder(r.getZIndex(),ql);l.setImageStyle(a,o),l.drawMultiPoint(e,n)}if(s&&s.getText()){var u=(i||t).getBuilder(r.getZIndex(),Yl);u.setTextStyle(s,o),u.drawText(e,n)}},MultiLineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),Zl);a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Yl);l.setTextStyle(s),l.drawText(e,n)}},MultiPolygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(a||o){var s=t.getBuilder(r.getZIndex(),Kl);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Yl);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,r,n,i){var o,a,s=e.getGeometriesArray();for(o=0,a=s.length;o */ read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<>1,p=-7,h=r?i-1:0,c=r?-1:1,f=t[e+h];for(h+=c,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+h],h+=c,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+h],h+=c,p-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,p=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?c/l:c*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=p?(s=0,a=p):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*y}},ep=np,rp=tp;function np(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}np.Varint=0,np.Fixed64=1,np.Bytes=2,np.Fixed32=5;var ip="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function op(t){return t.type===np.Bytes?t.readVarint()+t.pos:t.pos+1}function ap(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function sp(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function lp(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _p(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}np.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=vp(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_p(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=vp(this.buf,this.pos)+4294967296*vp(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=vp(this.buf,this.pos)+4294967296*_p(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=rp.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=rp.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return ap(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return ap(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return ap(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return ap(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return ap(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return ap(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ip?function(t,e,r){return ip.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i239?4:l>223?3:l>191?2:1;if(i+p>r)break;1===p?l<128&&(u=l):2===p?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===p?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=p}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==np.Bytes)return t.push(this.readVarint(e));var r=op(this);for(t=t||[];this.pos127;);else if(e===np.Bytes)this.pos=this.readVarint()+this.pos;else if(e===np.Fixed32)this.pos+=4;else{if(e!==np.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&sp(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),rp.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),rp.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&sp(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,np.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,lp,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,up,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,cp,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pp,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,hp,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,fp,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,dp,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,yp,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,gp,e)},writeBytesField:function(t,e){this.writeTag(t,np.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,np.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,np.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,np.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,np.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,np.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,np.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,np.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,np.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,np.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var xp=[1,0,0,1,0,0],bp=function(){function t(t,e,r,n,i){this.styleFunction,this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===sn?tt(this.flatCoordinates_):et(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=ht(this.getExtent());this.flatInteriorPoints_=to(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ms(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=eo(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=as(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,o=r.length;n>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>p&&(n.push(u),p=u),r.push(s,l),u+=2):7===o?u>p&&(r.push(r[p],r[p+1]),u+=2):C(!1,59)}u>p&&(n.push(u),p=u)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var r;1===t?r=1===e?sn:hn:2===t?r=1===e?ln:cn:3===t&&(r=pn);return r}(i,l.length);if(this.featureClass_===wp)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection);else{var p=void 0;if(u==pn){var h=function(t,e){for(var r=[],n=0,i=0,o=0,a=e.length;o1?new bs(s,yi,h):new co(s,yi,l)}else p=u===sn?new Hi(s,yi):u===ln?new hs(s,yi):u===pn?new co(s,yi,l):u===hn?new vs(s,yi):u===cn?new ds(s,yi,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var c=Xu(p,!1,r);n.setGeometry(c),void 0!==o&&n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return Qa},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=qn(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new ep(t),a=o.readFields(Tp,{}),s=[];for(var l in a)if(!r||-1!=r.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;i.setExtent(p);for(var h=0,c=u.length;h>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function Op(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.post)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){u()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:hi(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}(Ht),Ap=Fp,Lp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var jp,Dp=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.crossOrigin_=i,s.src_=n,s.key=n,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return Lp(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=en,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=rn,this.unlistenImage_(),this.image_=((t=tr(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=en:this.state=nn,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==rn&&(this.state=Qr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Qr&&(this.state=tn,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Cu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ap),zp=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=Jn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&mt(n)==mt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?mt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?mt(this.targetProj_.getExtent()):null;var l=gt(r),u=vt(r),p=pt(r),h=ut(r),c=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(p),y=this.transformInv_(h),g=10+(o?Math.max(0,Math.ceil(St(lt(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,p,h,c,f,d,y,g),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,r){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r.5&&p<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=mt(B([t,e,r,n]))/this.targetWorldWidth_>.25||f;!c&&this.sourceProj_.isGlobal()&&p&&(f=p>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||_t(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var y=[(t[0]+r[0])/2,(t[1]+r[1])/2],g=this.transformInv_(y),v=void 0;if(c)v=(Pt(i[0],h)+Pt(a[0],h))/2-Pt(g[0],h);else v=(i[0]+a[0])/2-g[0];var m=(i[1]+a[1])/2-g[1];f=v*v+m*m>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var _=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(_),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,_,b,i,o,x,w,l-1),this.addQuad_(b,_,r,n,w,x,a,s,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(C),T=[(r[0]+n[0])/2,(r[1]+n[1])/2],E=this.transformInv_(T);this.addQuad_(t,C,T,n,i,S,E,s,l-1),this.addQuad_(C,e,r,T,S,o,a,E,l-1)}return}}if(c){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,r,n,i,a,s),0==(14&d)&&this.addTriangle_(t,r,e,i,a,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,s,i),0==(7&d)&&this.addTriangle_(e,n,r,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;it(t,i[0]),it(t,i[1]),it(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();function Gp(t,e,r,n,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(n,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(r,i)),t.restore()}function Np(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Wp(t,e,r,n){var i,o=(i=r,Jn(e,t)(i,void 0,i.length)),a=Zn(e,n,r),s=e.getMetersPerUnit();void 0!==s&&(a*=s);var l=t.getMetersPerUnit();void 0!==l&&(a/=l);var u=t.getExtent();if(!u||K(u,o)){var p=Zn(t,a,o)/a;isFinite(p)&&p>0&&(a/=p)}return a}function Xp(t,e,r,n,i,o,a,s,l,u,p,h){var c=tr(Math.round(r*t),Math.round(r*e));if(h||qt(c,Ip),0===l.length)return c.canvas;function f(t){return Math.round(t*r)/r}c.scale(r,r),c.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){nt(d,t.extent)}));var y=mt(d),g=dt(d),v=tr(Math.round(r*y/n),Math.round(r*g/n));h||qt(v,Ip);var m=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=mt(t.extent),a=dt(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*m,i*m,o*m,a*m)}));var _=gt(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],y=a[1][1],g=a[2][0],m=a[2][1],x=f((s[0][0]-_[0])/o),b=f(-(s[0][1]-_[1])/o),w=f((s[1][0]-_[0])/o),C=f(-(s[1][1]-_[1])/o),S=f((s[2][0]-_[0])/o),T=f(-(s[2][1]-_[1])/o),E=l,O=u;l=0,u=0;var P=function(t){for(var e=t.length,r=0;ri&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r],t[r]=s;for(var l=r+1;l=0;c--){h[c]=t[c][e]/t[c][c];for(var f=c-1;f>=0;f--)t[f][e]-=t[f][c]*h[c]}return h}([[p-=E,y-=O,0,0,w-x],[g-=E,m-=O,0,0,S-x],[0,0,p,y,C-b],[0,0,g,m,T-b]]);if(P){if(c.save(),c.beginPath(),function(){if(void 0===jp){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gp(t,4,5,4,0),Gp(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;jp=Np(e,0)||Np(e,4)||Np(e,8)}return jp}()||!h){c.moveTo(w,C);for(var R=x-w,I=b-C,M=0;M<4;M++)c.lineTo(w+f((M+1)*R/4),C+f(M*I/3)),3!=M&&c.lineTo(w+f((M+1)*R/4),C+f((M+1)*I/3));c.lineTo(S,T)}else c.moveTo(w,C),c.lineTo(x,b),c.lineTo(S,T);c.clip(),c.transform(P[0],P[2],P[1],P[3],x,b),c.translate(d[0]-E,d[3]-O),c.scale(n/r,-n/r),c.drawImage(v.canvas,0,0),c.restore()}})),p&&(c.save(),c.globalCompositeOperation="source-over",c.strokeStyle="black",c.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-_[0])/o,a=-(n[0][1]-_[1])/o,s=(n[1][0]-_[0])/o,l=-(n[1][1]-_[1])/o,u=(n[2][0]-_[0])/o,p=-(n[2][1]-_[1])/o;c.beginPath(),c.moveTo(s,l),c.lineTo(i,a),c.lineTo(u,p),c.closePath(),c.stroke()})),c.restore()),c.canvas}var Bp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vp=function(t){function e(e,r,n,i,o,a,s,l,u,p,h,c){var f=t.call(this,o,Qr,{interpolate:!!c})||this;f.renderEdges_=void 0!==h&&h,f.pixelRatio_=s,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=r,f.targetTileGrid_=i,f.wrappedTileCoord_=a||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=i.getTileCoordExtent(f.wrappedTileCoord_),y=f.targetTileGrid_.getExtent(),g=f.sourceTileGrid_.getExtent(),v=y?yt(d,y):d;if(0===lt(v))return f.state=nn,f;var m=e.getExtent();m&&(g=g?yt(g,m):m);var _=i.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,r,n){var i=ht(r),o=Wp(t,e,i,n);return(!isFinite(o)||o<=0)&&st(r,(function(r){return o=Wp(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,v,_);if(!isFinite(x)||x<=0)return f.state=nn,f;var b=void 0!==p?p:.5;if(f.triangulation_=new zp(e,n,v,g,x*b,_),0===f.triangulation_.getTriangles().length)return f.state=nn,f;f.sourceZ_=r.getZForResolution(x);var w=f.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(w[1]=wt(w[1],g[1],g[3]),w[3]=wt(w[3],g[1],g[3])):w=yt(w,g)),lt(w)){for(var C=r.getTileRangeForExtentAndZ(w,f.sourceZ_),S=C.minX;S<=C.maxX;S++)for(var T=C.minY;T<=C.maxY;T++){var E=u(f.sourceZ_,S,T,s);E&&f.sourceTiles_.push(E)}0===f.sourceTiles_.length&&(f.state=nn)}else f.state=nn;return f}return Bp(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==en&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=rn;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Xp(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=en}this.changed()},e.prototype.load=function(){if(this.state==Qr){this.state=tn,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==Qr||i==tn){t++;var o=le(e,Jt,(function(r){var n=e.getState();n!=en&&n!=rn&&n!=nn||(pe(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,r){t.getState()==Qr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(pe),this.sourcesListenerKeys_=null},e}(Ap),qp=function(){function t(t,e,r,n){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Zp(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new qp(t,e,r,n)}var Kp=qp,Yp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Up=function(t){function r(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Kp(0,0,0,0),r}return Yp(r,t),r.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==en||r==nn||r==rn&&!n},r.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,r,i,o);return s.getState()==rn&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(en)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},r.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=R(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!K(i,n))return null;for(var o=e.pixelRatio,a=e.viewState.projection,s=e.viewState,l=r.getRenderSource(),u=l.getTileGridForProjection(s.projection),p=l.getTilePixelRatio(e.pixelRatio),h=u.getZForResolution(s.resolution);h>=u.getMinZoom();--h){var c=u.getTileCoordForCoordAndZ(n,h),f=l.getTile(h,c[1],c[2],o,a);if(!(f instanceof Dp||f instanceof Vp))return null;if(f.getState()===en){var d=u.getOrigin(h),y=wo(u.getTileSize(h)),g=u.getResolution(h),v=Math.floor(p*((n[0]-d[0])/g-c[1]*y[0])),m=Math.floor(p*((d[1]-n[1])/g-c[2]*y[1]));return this.getImageData(f.getImage(),v,m)}}return null},r.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},r.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},r.prototype.renderFrame=function(t,r){var n=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,a=i.resolution,s=i.center,l=i.rotation,u=t.pixelRatio,p=this.getLayer(),c=p.getSource(),f=c.getRevision(),d=c.getTileGridForProjection(o),y=d.getZForResolution(a,c.zDirection),g=d.getResolution(y),v=t.extent,_=n.extent&&ni(n.extent);_&&(v=yt(v,ni(n.extent)));var x=c.getTilePixelRatio(u),b=Math.round(t.size[0]*x),w=Math.round(t.size[1]*x);if(l){var C=Math.round(Math.sqrt(b*b+w*w));b=C,w=C}var T=g*b/2/x,E=g*w/2/x,O=[s[0]-T,s[1]-E,s[0]+T,s[1]+E],P=d.getTileRangeForExtentAndZ(v,y),I={};I[y]={};var F=this.createLoadedTileFinder(c,o,I),A=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var j=P.minX;j<=P.maxX;++j)for(var D=P.minY;D<=P.maxY;++D){var z=this.getTile(y,j,D,t);if(this.isDrawableTile(z)){var G=h(this);if(z.getState()==en){I[y][z.tileCoord.toString()]=z;var N=z.inTransition(G);this.newTiles_||!N&&-1!==this.renderedTiles.indexOf(z)||(this.newTiles_=!0)}if(1===z.getAlpha(G,t.time))continue}var W=d.getTileCoordChildTileRange(z.tileCoord,L,A),X=!1;W&&(X=F(y+1,W)),X||d.forEachTileCoordParentTileRange(z.tileCoord,F,L,A)}var B=g/a;M(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-b/2,-w/2);var V=function(t){var e="matrix("+t.join(", ")+")";if(m)return e;var r=S||(S=document.createElement("div"));return r.style.transform=e,r.style.transform}(this.pixelTransform);this.useContainer(r,V,n.opacity,this.getBackground(t));var q=this.context,Z=q.canvas;k(this.inversePixelTransform,this.pixelTransform),M(this.tempTransform,b/2,w/2,B,B,0,-b/2,-w/2),Z.width!=b||Z.height!=w?(Z.width=b,Z.height=w):this.containerReused||q.clearRect(0,0,b,w),_&&this.clipUnrotated(q,t,_),c.getInterpolate()||qt(q,Ip),this.preRender(q,t),this.renderedTiles.length=0;var K,Y,U,H=Object.keys(I).map(Number);H.sort(e),1!==n.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(K=[],Y=[]):H=H.reverse();for(var J=H.length-1;J>=0;--J){var $=H[J],Q=c.getTilePixelSize($,u,o),tt=d.getResolution($)/g,et=Q[0]*tt*B,nt=Q[1]*tt*B,it=d.getTileCoordForCoordAndZ(gt(O),$),ot=d.getTileCoordExtent(it),at=R(this.tempTransform,[x*(ot[0]-O[0])/g,x*(O[3]-ot[3])/g]),st=x*c.getGutterForProjection(o),lt=I[$];for(var ut in lt){var pt=(z=lt[ut]).tileCoord,ht=it[1]-pt[1],ct=Math.round(at[0]-(ht-1)*et),ft=it[2]-pt[2],dt=Math.round(at[1]-(ft-1)*nt),vt=ct-(j=Math.round(at[0]-ht*et)),mt=dt-(D=Math.round(at[1]-ft*nt)),xt=y===$,bt=!1;if(!(N=xt&&1!==z.getAlpha(h(this),t.time)))if(K){U=[j,D,j+vt,D,j+vt,D+mt,j,D+mt];for(var wt=0,Ct=K.length;wt0)r([]);else{var m=gt(c.getTileCoordExtent(i.wrappedTileCoord)),_=[(f[0]-m[0])/p,(m[1]-f[1])/p],x=i.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),b=i.hitDetectionImageData[a];if(!b&&!this.animatingOrInteracting_){var w=wo(c.getTileSize(c.getZForResolution(p))),C=this.renderedRotation_;b=function(t,r,n,i,o,a,s){var l=tr(.5*t[0],.5*t[1]);l.imageSmoothingEnabled=!1;for(var u=l.canvas,p=new fu(l,.5,o,null,s),h=n.length,c=Math.floor(16777215/h),f={},d=1;d<=h;++d){var y=n[d-1],g=y.getStyleFunction()||i;if(i){var v=g(y,a);if(v){Array.isArray(v)||(v=[v]);for(var m="#"+("000000"+(d*c).toString(16)).slice(-6),_=0,x=v.length;_=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=r},r.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,a=n.rotation,s=e.size,l=Math.round(s[0]*r),u=Math.round(s[1]*r),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,c=p.getTileCoordExtent(t.wrappedTileCoord),f=p.getTileCoordExtent(h,this.tmpExtent)[0]-c[0];return O(I(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},r.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[_n]||n[xn]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),a=o.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=o.getOpacity();for(var u=rh[a],p=e.viewState,c=p.rotation,f=o.getSource(),d=f.getTileGridForProjection(p.projection).getZForResolution(p.resolution,f.zDirection),y=this.renderedTiles,g=[],v=[],m=y.length-1;m>=0;--m){var _=y[m],x=_.executorGroups[h(o)].filter((function(t){return t.hasExecutors(u)}));if(0!==x.length){for(var b=this.getTileRenderTransform(_,e),w=_.tileCoord[0],C=!1,S=x[0].getClipCoords(b),T=0,E=g.length;T0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return C(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return C(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){C(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function fh(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function dh(t,e,r){return t+"/"+e+"/"+r}function yh(t){return dh(t[0],t[1],t[2])}function gh(t){return t.split("/").map(Number)}var vh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=gh(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(yh(e.tileCoord)),e.release())}.bind(this))}},e}(ch),_h="tileloadstart",xh="tileloadend",bh="tileloaderror",wh=[0,0,0],Ch=function(){function t(t){var r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,C(function(t,r,n){var i=r||e;return t.every((function(e,r){if(0===r)return!0;var o=i(t[r-1],e);return!(o>0||n&&0===o)}))}(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var n=0,i=this.resolutions_.length-1;n=this.minZoom;){if(e(s,2===this.zoomFactor_?Zp(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(a,s,r)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]this.maxZoom||e0?n:Math.max(a/s[0],o/s[1]),u=i+1,p=new Array(u),h=0;hr||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,e,r,n){},e}(zu),kh=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return Ih(e,t),e}(Bt),Fh=Mh;function Ah(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){return a?t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],r=e.getFullTileRange(t);return C(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function Lh(t,e){for(var r=t.length,n=new Array(r),i=0;i=200&&s.status<300){var n=e.getType(),l=void 0;n==ts||n==es?l=s.responseText:n==rs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):n==Qa&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var qh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zh=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=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:Kh,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:Dp,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return qh(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Un(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Un(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Un(e,t)){var r=h(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Th(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Un(e,t))return this.tileCache;var r=h(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new mh(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),l=s?this.tileUrlFunction(s,n,i):void 0,u=new this.tileClass(a,void 0!==l?Qr:nn,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(Jt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Un(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],l=void 0,u=yh(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var h=this.getTileGridForProjection(o),c=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new Vp(o,h,i,c,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=p,l?(d.interimTile=l,d.refreshInterimChain(),a.replace(u,d)):a.set(u,d),d}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=dh(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var l=o;o=this.createTile_(t,e,r,n,i,s),l.getState()==Qr?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,s),this.tileCache.set(a,o);return o},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 r=qn(t);if(r){var n=h(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(zh);function Kh(t,e){t.getImage().src=e}var Yh=Zh,Uh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Hh(t,e,r,n){var i=document.createElement("script"),o="olc_"+h(e);function a(){delete window[o],i.parentNode.removeChild(i)}i.async=!0,i.src=t+(-1==t.indexOf("?")?"?":"&")+(n||"callback")+"="+o;var s=setTimeout((function(){a(),r&&r()}),1e4);window[o]=function(t){clearTimeout(s),a(),e(t)},document.getElementsByTagName("head")[0].appendChild(i)}!function(t){function e(e){var r=this,n="Unexpected response status: "+e.status;return(r=t.call(this,n)||this).name="ResponseError",r.response=e,r}Uh(e,t)}(Error),function(t){function e(e){var r=t.call(this,"Failed to issue request")||this;return r.name="ClientError",r.client=e,r}Uh(e,t)}(Error);var Jh,$h=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qh=function(t){function e(e){var r=this,n=e||{},i=qt({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,r.setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return $h(e,t),e.prototype.getPreload=function(){return this.get(oh)},e.prototype.setPreload=function(t){this.set(oh,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ah)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ah,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(We),tc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ec=function(t){function e(e){return t.call(this,e)||this}return tc(e,t),e.prototype.createRenderer=function(){return new Hp(this)},e}(Qh),rc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nc=function(t){function e(e){var r=e||{},n=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(n=r.interpolate);var i=void 0!==r.projection?r.projection:"EPSG:3857",o=void 0!==r.tileGrid?r.tileGrid:Eh({extent:Rh(i),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:n,opaque:r.opaque,projection:i,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return rc(e,t),e}(Yh),ic=nc,oc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ac=function(t){function e(e){var r,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate),r=void 0!==n.attributions?n.attributions:['© OpenStreetMap contributors.'];var o=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",a=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:o,interpolate:i,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return oc(e,t),e}(ic),sc=ac,lc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uc=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r)||this;return s.src_=n,s.extent_=i,s.preemptive_=o,s.grid_=null,s.keys_=null,s.data_=null,s.jsonp_=a,s}return lc(e,t),e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),r=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),n=this.grid_[Math.floor((1-r)*this.grid_.length)];if("string"!=typeof n)return null;var i=n.charCodeAt(Math.floor(e*n.length));i>=93&&i--,i>=35&&i--;var o=null;if((i-=32)in this.keys_){var a=this.keys_[i];o=this.data_&&a in this.data_?this.data_[a]:a}return o},e.prototype.forDataAtCoordinate=function(t,e,r){this.state==nn&&!0===r?(this.state=Qr,ue(this,Jt,(function(r){e(this.getData(t))}),this),this.loadInternal_()):!0===r?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=rn,this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=en,this.changed()},e.prototype.loadInternal_=function(){if(this.state==Qr)if(this.state=tn,this.jsonp_)Hh(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(r)}else this.handleError_()},e.prototype.onXHRError_=function(t){this.handleError_()},e.prototype.load=function(){this.preemptive_?this.loadInternal_():this.setState(nn)},e}(Ap),pc=function(t){function e(e){var r=t.call(this,{projection:qn("EPSG:3857"),state:Le,zDirection:e.zDirection})||this;if(r.preemptive_=void 0===e.preemptive||e.preemptive,r.tileUrlFunction_=jh,r.template_=void 0,r.jsonp_=e.jsonp||!1,e.url)if(r.jsonp_)Hh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var n=new XMLHttpRequest;n.addEventListener("load",r.onXHRLoad_.bind(r)),n.addEventListener("error",r.onXHRError_.bind(r)),n.open("GET",e.url),n.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):C(!1,51);return r}return lc(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,r,n){if(this.tileGrid){var i=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,i);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,r,n)}else!0===n?setTimeout((function(){r(null)}),0):r(null)},e.prototype.handleTileJSONError=function(){this.setState(De)},e.prototype.handleTileJSONResponse=function(t){var e,r=qn("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=Hn(r,n);e=bt(t.bounds,i)}var o=Rh(n),a=t.minzoom||0,s=Eh({extent:o,maxZoom:t.maxzoom||22,minZoom:a});this.tileGrid=s,this.template_=t.template;var l=t.grids;if(l){if(this.tileUrlFunction_=Lh(l,s),void 0!==t.attribution){var u=void 0!==e?e:o;this.setAttributions((function(e){return _t(u,e.extent)?[t.attribution]:null}))}this.setState(je)}else this.setState(De)},e.prototype.getTile=function(t,e,r,n,i){var o=dh(t,e,r);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),l=this.tileUrlFunction_(s,n,i),u=new uc(a,void 0!==l?Qr:nn,void 0!==l?l:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,u),u},e.prototype.useTile=function(t,e,r){var n=dh(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Fh),hc=pc,cc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function fc(t){return(t=Math.round(t))<0?0:t>255?255:t}function dc(t){return t<0?0:t>1?1:t}function yc(t){return"%"===t[t.length-1]?fc(parseFloat(t)/100*255):fc(parseInt(t))}function gc(t){return"%"===t[t.length-1]?dc(parseFloat(t)/100):dc(parseFloat(t))}function vc(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{Jh={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in cc)return cc[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=gc(a.pop());case"rgb":return 3!==a.length?null:[yc(a[0]),yc(a[1]),yc(a[2]),s];case"hsla":if(4!==a.length)return null;s=gc(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=gc(a[1]),p=gc(a[2]),h=p<=.5?p*(u+1):p+u-p*u,c=2*p-h;return[fc(255*vc(c,h,l+1/3)),fc(255*vc(c,h,l)),fc(255*vc(c,h,l-1/3)),s];default:return null}}return null}}catch(t){}var mc=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};mc.parse=function(t){if(t){if(t instanceof mc)return t;if("string"==typeof t){var e=Jh(t);if(e)return new mc(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},mc.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},mc.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},mc.black=new mc(0,0,0,1),mc.white=new mc(1,1,1,1),mc.transparent=new mc(0,0,0,0),mc.red=new mc(1,0,0,1),mc.blue=new mc(0,0,1,1);var _c=mc;function xc(t){return"object"==typeof t?["literal",t]:t}function bc(t,e){var r=t.stops;if(!r)return function(t,e){var r=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",r]:r;if("enum"===e.type)return["match",r,Object.keys(e.values),r,t.default];var n=["color"===e.type?"to-color":e.type,r,xc(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}(t,e);var n=r&&"object"==typeof r[0][0],i=n||void 0!==t.property,o=n||!i;return r=r.map((function(t){return!i&&e.tokens&&"string"==typeof t[1]?[t[0],Pc(t[1])]:[t[0],xc(t[1])]})),n?function(t,e,r){for(var n={},i={},o=[],a=0;a3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(r))}function Oc(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Pc(t){for(var e=["concat"],r=/{([^{}]+)}/g,n=0,i=r.exec(t);null!==i;i=r.exec(t)){var o=t.slice(n,r.lastIndex-i[0].length);n=r.lastIndex,o.length>0&&e.push(o),e.push(["get",i[1]])}if(1===e.length)return t;if(n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Vc=[kc,Fc,Ac,Lc,jc,Nc,Dc,Xc(zc),Wc];function qc(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!qc(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Vc;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function rf(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof _c)return!0;if(t instanceof Uc)return!0;if(t instanceof $c)return!0;if(t instanceof tf)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in pf)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=pf[s],n++}else o=zc;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Xc(o,a)}else r=pf[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var cf=hf,ff=function(t){this.type=Nc,this.sections=t};ff.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Fc)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,Xc(Ac))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,jc)))return null;var p=n[n.length-1];p.scale=s,p.font=l,p.textColor=u}else{var h=e.parse(t[o],1,zc);if(!h)return null;var c=h.type.kind;if("string"!==c&&"value"!==c&&"null"!==c&&"resolvedImage"!==c)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new ff(n)},ff.prototype.evaluate=function(t){return new $c(this.sections.map((function(e){var r=e.content.evaluate(t);return nf(r)===Wc?new Hc("",r,null,null,null):new Hc(of(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ff.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},yf.prototype.eachChild=function(t){t(this.input)},yf.prototype.outputDefined=function(){return!1},yf.prototype.serialize=function(){return["image",this.input.serialize()]};var gf=yf,vf={"to-boolean":Lc,"to-color":jc,"to-number":Fc,"to-string":Ac},mf=function(t,e){this.type=t,this.args=e};mf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=vf[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ef(e[0],e[1],e[2],e[3])))return new _c(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new uf(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Rf(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(n*o*8192),Math.round(i*o*8192)]}function If(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i==0&&n*o<=0&&i*a<=0}function Mf(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function kf(t,e){for(var r=!1,n=0,i=e.length;n0&&h<0||p<0&&h>0}function Lf(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}Of(e,t)}function Wf(t,e,r,n){var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[];if(!t)return a;for(var s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Kf(t,e)&&(r=!1)})),r}var Yf=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Yf.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Yf(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Yf.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Yf.prototype.eachChild=function(){},Yf.prototype.outputDefined=function(){return!1},Yf.prototype.serialize=function(){return["var",this.name]};var Uf=Yf,Hf=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Mc),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};Hf.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Hf.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new cf(e,[t]):"coerce"===r?new _f(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof sf)&&"resolvedImage"!==o.type.kind&&$f(o)){var l=new wf;try{o=new sf(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Hf.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Hf(this.registry,n,e||null,i,this.errors)},Hf.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Rc(n,t))},Hf.prototype.checkSubtype=function(t,e){var r=qc(t,e);return r&&this.error(r),r};var Jf=Hf;function $f(t){if(t instanceof Uf)return $f(t.boundExpression);if(t instanceof Sf&&"error"===t.name)return!1;if(t instanceof Ef)return!1;if(t instanceof Vf)return!1;var e=t instanceof _f||t instanceof cf,r=!0;return t.eachChild((function(t){r=e?r&&$f(t):r&&t instanceof sf})),!!r&&(qf(t)&&Kf(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Qf(t,e){for(var r,n,i=t.length-1,o=0,a=i,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],r<=e){if(s===i||ee))throw new uf("Input is not a number.");a=s-1}return 0}var td=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new td(i,r,n)},td.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Qf(e,n)].evaluate(t)},td.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ed=td,rd=nd;function nd(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}function id(t,e,r){return t*(1-r)+e*r}nd.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},nd.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},nd.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},nd.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},nd.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var od=Object.freeze({__proto__:null,number:id,color:function(t,e,r){return new _c(id(t.r,e.r,r),id(t.g,e.g,r),id(t.b,e.b,r),id(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return id(t,e[n],r)}))}}),ad=4/29,sd=6/29,ld=3*sd*sd,ud=Math.PI/180,pd=180/Math.PI;function hd(t){return t>.008856451679035631?Math.pow(t,1/3):t/ld+ad}function cd(t){return t>sd?t*t*t:ld*(t-ad)}function fd(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function dd(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yd(t){var e=dd(t.r),r=dd(t.g),n=dd(t.b),i=hd((.4124564*e+.3575761*r+.1804375*n)/.95047),o=hd((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-hd((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function gd(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*cd(e),r=.95047*cd(r),n=1.08883*cd(n),new _c(fd(3.2404542*r-1.5371385*e-.4985314*n),fd(-.969266*r+1.8760108*e+.041556*n),fd(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function vd(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var md={forward:yd,reverse:gd,interpolate:function(t,e,r){return{l:id(t.l,e.l,r),a:id(t.a,e.a,r),b:id(t.b,e.b,r),alpha:id(t.alpha,e.alpha,r)}}},_d={forward:function(t){var e=yd(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*pd;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*ud,r=t.c;return gd({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:vd(t.h,e.h,r),c:id(t.c,e.c,r),l:id(t.l,e.l,r),alpha:id(t.alpha,e.alpha,r)}}},xd=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Fc)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=jc:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var y=e.parse(c,d,u);if(!y)return null;u=u||y.type,l.push([h,y])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new xd(u,r,n,i,l):e.error("Type "+Bc(u)+" is not interpolatable.")},xd.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Qf(e,n),a=e[o],s=e[o+1],l=xd.interpolationFactor(this.interpolation,n,a,s),u=r[o].evaluate(t),p=r[o+1].evaluate(t);return"interpolate"===this.operator?od[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?_d.reverse(_d.interpolate(_d.forward(u),_d.forward(p),l)):md.reverse(md.interpolate(md.forward(u),md.forward(p),l))},xd.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new uf("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new uf("Array index must be an integer, but found "+e+" instead.");return r[e]},Od.prototype.eachChild=function(t){t(this.index),t(this.input)},Od.prototype.outputDefined=function(){return!1},Od.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Pd=Od,Rd=function(t,e){this.type=Lc,this.needle=t,this.haystack=e};Rd.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,zc),n=e.parse(t[2],2,zc);return r&&n?Zc(r.type,[Lc,Ac,Fc,kc,zc])?new Rd(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Bc(r.type)+" instead"):null},Rd.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!Kc(e,["boolean","string","number","null"]))throw new uf("Expected first argument to be of type boolean, string, number or null, but found "+Bc(nf(e))+" instead.");if(!Kc(r,["string","array"]))throw new uf("Expected second argument to be of type array or string, but found "+Bc(nf(r))+" instead.");return r.indexOf(e)>=0},Rd.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Rd.prototype.outputDefined=function(){return!0},Rd.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Id=Rd,Md=function(t,e,r){this.type=Fc,this.needle=t,this.haystack=e,this.fromIndex=r};Md.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,zc),n=e.parse(t[2],2,zc);if(!r||!n)return null;if(!Zc(r.type,[Lc,Ac,Fc,kc,zc]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Bc(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Fc);return i?new Md(r,n,i):null}return new Md(r,n)},Md.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Kc(e,["boolean","string","number","null"]))throw new uf("Expected first argument to be of type boolean, string, number or null, but found "+Bc(nf(e))+" instead.");if(!Kc(r,["string","array"]))throw new uf("Expected second argument to be of type array or string, but found "+Bc(nf(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Md.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Md.prototype.outputDefined=function(){return!1},Md.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var kd=Md,Fd=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};Fd.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,nf(c)))return null}else r=nf(c);if(void 0!==i[String(c)])return u.error("Branch labels must be unique.");i[String(c)]=o.length}var f=e.parse(l,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,zc);if(!d)return null;var y=e.parse(t[t.length-1],t.length-1,n);return y?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Fd(r,n,d,i,o,y):null},Fd.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(nf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Fd.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Fd.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Fd.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,zc),n=e.parse(t[2],2,Fc);if(!r||!n)return null;if(!Zc(r.type,[Xc(zc),Ac,zc]))return e.error("Expected first argument to be of type array or string, but found "+Bc(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Fc);return i?new Dd(r.type,r,n,i):null}return new Dd(r.type,r,n)},Dd.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Kc(e,["string","array"]))throw new uf("Expected first argument to be of type array or string, but found "+Bc(nf(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Dd.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Dd.prototype.outputDefined=function(){return!1},Dd.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zd=Dd;function Gd(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Nd(t,e,r,n){return 0===n.compare(e,r)}function Wd(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Lc,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,zc);if(!o)return null;if(!Gd(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Bc(o.type)+"'.");var a=e.parse(t[2],2,zc);if(!a)return null;if(!Gd(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Bc(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Bc(o.type)+"' and '"+Bc(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new cf(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new cf(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Gc)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=nf(o),l=nf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new uf('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=nf(o),p=nf(a);if("string"!==u.kind||"string"!==p.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}var Xd=Wd("==",(function(t,e,r){return e===r}),Nd),Bd=Wd("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Nd(0,e,r,n)})),Vd=Wd("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Zd=Wd("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Kd=Wd(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Yd=function(t,e,r,n,i){this.type=Ac,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Yd.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Fc);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Ac)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Ac)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Fc)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Fc))?null:new Yd(r,i,o,a,s)},Yd.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Yd.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Yd.prototype.outputDefined=function(){return!1},Yd.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ud=Yd,Hd=function(t){this.type=Fc,this.input=t};Hd.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Bc(r.type)+" instead."):new Hd(r):null},Hd.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new uf("Expected value to be of type string or array, but found "+Bc(nf(e))+" instead.")},Hd.prototype.eachChild=function(t){t(this.input)},Hd.prototype.outputDefined=function(){return!1},Hd.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Jd={"==":Xd,"!=":Bd,">":qd,"<":Vd,">=":Kd,"<=":Zd,array:cf,at:Pd,boolean:cf,case:jd,coalesce:Sd,collator:Ef,format:df,image:gf,in:Id,"index-of":kd,interpolate:wd,"interpolate-hcl":wd,"interpolate-lab":wd,length:Hd,let:Ed,literal:sf,match:Ad,number:cf,"number-format":Ud,object:cf,slice:zd,step:ed,string:cf,"to-boolean":_f,"to-color":_f,"to-number":_f,"to-string":_f,var:Uf,within:Vf};function $d(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=ef(r,n,i,a);if(s)throw new uf(s);return new _c(r/255*a,n/255*a,i/255*a,a)}function Qd(t,e){return t in e}function ty(t,e){var r=e[t];return void 0===r?null:r}function ey(t){return{type:t}}Sf.register(Jd,{error:[{kind:"error"},[Ac],function(t,e){var r=e[0];throw new uf(r.evaluate(t))}],typeof:[Ac,[zc],function(t,e){return Bc(nf(e[0].evaluate(t)))}],"to-rgba":[Xc(Fc,4),[jc],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[jc,[Fc,Fc,Fc],$d],rgba:[jc,[Fc,Fc,Fc,Fc],$d],has:{type:Lc,overloads:[[[Ac],function(t,e){return Qd(e[0].evaluate(t),t.properties())}],[[Ac,Dc],function(t,e){var r=e[0],n=e[1];return Qd(r.evaluate(t),n.evaluate(t))}]]},get:{type:zc,overloads:[[[Ac],function(t,e){return ty(e[0].evaluate(t),t.properties())}],[[Ac,Dc],function(t,e){var r=e[0],n=e[1];return ty(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[zc,[Ac],function(t,e){return ty(e[0].evaluate(t),t.featureState||{})}],properties:[Dc,[],function(t){return t.properties()}],"geometry-type":[Ac,[],function(t){return t.geometryType()}],id:[zc,[],function(t){return t.id()}],zoom:[Fc,[],function(t){return t.globals.zoom}],pitch:[Fc,[],function(t){return t.globals.pitch||0}],"distance-from-center":[Fc,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[Fc,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Fc,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[Fc,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[zc,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Fc,ey(Fc),function(t,e){for(var r=0,n=0,i=e;n":[Lc,[Ac,zc],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Lc,[zc],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Lc,[Ac,zc],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Lc,[zc],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Lc,[Ac,zc],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Lc,[zc],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Lc,[zc],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Lc,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Lc,[Xc(Ac)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Lc,[Xc(zc)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Lc,[Ac,Xc(zc)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Lc,[Ac,Xc(zc)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Lc,overloads:[[[Lc,Lc],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[ey(Lc),function(t,e){for(var r=0,n=e;r-1}(e))return iy([new Rc("","zoom expressions not supported")]);var o=hy(r);if(!o&&!i)return iy([new Rc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Rc)return iy([o]);if(o instanceof wd&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return iy([new Rc("",'"interpolate" expressions cannot be used with this property')]);if(!o)return ny(new ly(n?"constant":"source",t.value));var a=o instanceof wd?o.interpolation:void 0;return ny(new uy(n?"camera":"composite",t.value,o.labels,a))}function hy(t){var e=null;if(t instanceof Ed)e=hy(t.result);else if(t instanceof Sd)for(var r=0,n=t.args;r":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function dy(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e",">=","<","<=","to-boolean"]);function xy(t,e){return te?1:0}function by(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===r||"<="===r||">="===r?Cy(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(wy))):"all"===r?["all"].concat(t.slice(1).map(wy)):"none"===r?["all"].concat(t.slice(1).map(wy).map(Ey)):"in"===r?Sy(t[1],t.slice(2)):"!in"===r?Ey(Sy(t[1],t.slice(2))):"has"===r?Ty(t[1]):"!has"===r?Ey(Ty(t[1])):"within"!==r||t}function Cy(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Sy(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(xy)]]:["filter-in-small",t,["literal",e]]}}function Ty(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ey(t){return["!",t]}var Oy=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Py(t,e){var r={};for(var n in t)"ref"!==n&&(r[n]=t[n]);return Oy.forEach((function(t){t in e&&(r[t]=e[t])})),r}var Ry={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},Iy=/(italic|oblique)$/i,My={},ky=function(t,e,r){var n=My[t];if(!n){Array.isArray(t)||(t=[t]);for(var i=400,o="normal",a=[],s=0,l=t.length;s1?u[u.length-2].toLowerCase():"";if(p==h||p==h.replace("-","")||c+"-"+p==h){i=Ry[h],u.pop(),c&&h.startsWith(c)&&u.pop();break}}"number"==typeof p&&(i=p);var f=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==f.indexOf(" ")&&(f='"'+f+'"'),a.push(f)}n=My[t]=[o,i,a]}return n[0]+" "+n[1]+" "+e+"px"+(r?"/"+r:"")+" "+n[2]};function Fy(t){return t*Math.PI/180}var Ay=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Ly(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var r=document.createElement("canvas");return r.width=t,r.height=e,r}var jy,Dy=Array(256).join(" ");function zy(t,e){if(e>=.05){for(var r="",n=t.split("\n"),i=Dy.slice(0,Math.round(e/.1)),o=0,a=n.length;o0&&(r+="\n"),r+=n[o].split("").join(i);return r}return t}function Gy(){return jy||(jy=Ly(1,1).getContext("2d")),jy}function Ny(t,e){return Gy().measureText(t).width+(t.length-1)*e}var Wy={};function Xy(t,e,r,n){if(-1!==t.indexOf("\n")){for(var i=t.split("\n"),o=[],a=0,s=i.length;a1){var h=Gy();h.font=e;for(var c=h.measureText("M").width*r,f="",d=[],y=0,g=p.length;y1;++_){var b=d[_];if(Ny(b,n)<.35*c){var w=_>0?Ny(d[_-1],n):1/0,C=_.7*c&&Ny(O,n)<.6*c){var P=E.split(" "),R=P.pop();Ny(R,n)<.2*c&&(d[S]=P.join(" "),d[S+1]=R+" "+O),T-=1}}u=d.join("\n")}else u=t;u=zy(u,n),Wy[l]=u}return u}var By,Vy,qy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Zy={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},Ky={},Yy={zoom:0};function Uy(t,e,r,n,i,o,a){var s=t.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});var l,u=o[s];if(!u[r]){var p=(t[e]||Ky)[r],h=fy[e+"_"+t.type][r];void 0===p&&(p=h.default);var c=(l=p,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in ry);if(!c&&oy(p)&&(p=bc(p,h),c=!0),c){var f=function(t,e){var r=py(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}(p,h);u[r]=f.evaluate.bind(f)}else"color"==h.type&&(p=_c.parse(p)),u[r]=function(){return p}}return Yy.zoom=n,u[r](Yy,i,a)}function Hy(t,e,r,n,i){return i||console.warn("No filterCache provided to evaluateFilter()"),t in i||(i[t]=yy(e).filter),Yy.zoom=n,i[t](Yy,r)}function Jy(t,e){if(t){if(0===t.a||0===e)return;var r=t.a;return e=void 0===e?1:e,0===r?"transparent":"rgba("+Math.round(255*t.r/r)+","+Math.round(255*t.g/r)+","+Math.round(255*t.b/r)+","+r*e+")"}return t}var $y=/^([^]*)\{(.*)\}([^]*)$/;function Qy(t,e){var r;do{if(r=t.match($y)){var n=e[r[2]]||"";t=r[1]+n+r[3]}}while(r);return t}function tg(t,e,r,n,i,o,a){if(void 0===n&&(n=Ay),void 0===i&&(i=void 0),void 0===o&&(o=void 0),void 0===a&&(a=void 0),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:o}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(s=t.data.image,l=[s.width,s.height])}))}for(var h,c=function(t){t=t.slice();for(var e=Object.create(null),r=0;r=C.maxzoom)){var I=C.filter;if(!I||Hy(S,I,c,p,m)){var M=void 0,k=void 0,F=void 0,A=void 0,L=void 0,j=void 0,D=w.index;if(3==h&&("fill"==C.type||"fill-extrusion"==C.type))if(k=Uy(C,"paint",C.type+"-opacity",p,c,v,d),C.type+"-pattern"in E){var z=Uy(C,"paint",C.type+"-pattern",p,c,v,d);if(z){var G="string"==typeof z?Qy(z,o):z.toString();if(s&&i&&i[G]){++_,(j=R[_])&&j.getFill()&&!j.getStroke()&&!j.getText()||(j=new sl({fill:new tl}),R[_]=j),F=j.getFill(),j.setZIndex(D);var N=G+"."+k,W=g[N];if(!W){var X=i[G],B=Ly(X.width,X.height),V=B.getContext("2d");V.globalAlpha=k,V.drawImage(s,X.x,X.y,X.width,X.height,0,0,X.width,X.height),W=V.createPattern(B,"repeat"),g[N]=W}F.setColor(W)}}}else M=Jy(Uy(C,"paint",C.type+"-color",p,c,v,d),k),C.type+"-outline-color"in E&&(L=Jy(Uy(C,"paint",C.type+"-outline-color",p,c,v,d),k)),L||(L=M),(M||L)&&(++_,(!(j=R[_])||M&&!j.getFill()||!M&&j.getFill()||L&&!j.getStroke()||!L&&j.getStroke()||j.getText())&&(j=new sl({fill:M?new tl:void 0,stroke:L?new rl:void 0}),R[_]=j),M&&(F=j.getFill()).setColor(M),L&&((A=j.getStroke()).setColor(L),A.setWidth(.5)),j.setZIndex(D));if(1!=h&&"line"==C.type){M=!("line-pattern"in E)&&"line-color"in E?Jy(Uy(C,"paint","line-color",p,c,v,d),Uy(C,"paint","line-opacity",p,c,v,d)):void 0;var q=Uy(C,"paint","line-width",p,c,v,d);M&&q>0&&(++_,(j=R[_])&&j.getStroke()&&!j.getFill()&&!j.getText()||(j=new sl({stroke:new rl}),R[_]=j),(A=j.getStroke()).setLineCap(Uy(C,"layout","line-cap",p,c,v,d)),A.setLineJoin(Uy(C,"layout","line-join",p,c,v,d)),A.setMiterLimit(Uy(C,"layout","line-miter-limit",p,c,v,d)),A.setColor(M),A.setWidth(q),A.setLineDash(E["line-dasharray"]?Uy(C,"paint","line-dasharray",p,c,v,d).map((function(t){return t*q})):null),j.setZIndex(D))}var Z=!1,K=null,Y=0,U=void 0,H=void 0,J=void 0;if((1==h||2==h)&&"icon-image"in T){var $=Uy(C,"layout","icon-image",p,c,v,d);if($){U="string"==typeof $?Qy($,o):$.toString();var Q=void 0;if(s&&i&&i[U]){var tt=Uy(C,"layout","icon-rotation-alignment",p,c,v,d);if(2==h){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var rt=et.getExtent();if(Math.sqrt(Math.max(Math.pow((rt[2]-rt[0])/r,2),Math.pow((rt[3]-rt[1])/r,2)))>150){var nt="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(Vy||(Vy=new wp("Point",By=[NaN,NaN],[],{},null)),Q=Vy,By[0]=nt[0],By[1]=nt[1],"line"===Uy(C,"layout","symbol-placement",p,c,v,d)&&"map"===tt)for(var it=et.getStride(),ot=et.getFlatCoordinates(),at=0,st=ot.length-it;at=ct&&nt[0]<=dt&&nt[1]>=ft&&nt[1]<=yt){Y=Math.atan2(ut-ht,pt-lt);break}}}}}if(2!==h||Q){var gt=Uy(C,"layout","icon-size",p,c,v,d),vt=void 0!==E["icon-color"]?Uy(C,"paint","icon-color",p,c,v,d):null;if(!vt||0!==vt.a){var mt=U+"."+gt;if(null!==vt&&(mt+="."+vt),!(H=y[mt])){var _t=i[U];H=new Ru({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[_t.width,_t.height],offset:[_t.x,_t.y],rotateWithView:"map"===tt,scale:gt/_t.pixelRatio,displacement:"icon-offset"in T?Uy(C,"layout","icon-offset",p,c,v,d).map((function(t){return-t*_t.pixelRatio})):void 0}),y[mt]=H}}H&&(++_,(j=R[_])&&j.getImage()&&!j.getFill()&&!j.getStroke()||(j=new sl,R[_]=j),j.setGeometry(Q),H.setRotation(Y+Fy(Uy(C,"layout","icon-rotate",p,c,v,d))),H.setOpacity(Uy(C,"paint","icon-opacity",p,c,v,d)),H.setAnchor(Zy[Uy(C,"layout","icon-anchor",p,c,v,d)]),j.setImage(H),K=j.getText(),j.setText(void 0),j.setZIndex(D),Z=!0,J=!1)}else J=!0}}}if(1==h&&"circle"===C.type){++_,(j=R[_])&&j.getImage()&&!j.getFill()&&!j.getStroke()||(j=new sl,R[_]=j);var xt="circle-radius"in E?Uy(C,"paint","circle-radius",p,c,v,d):5,bt=Jy(Uy(C,"paint","circle-stroke-color",p,c,v,d),Uy(C,"paint","circle-stroke-opacity",p,c,v,d)),wt=Jy(Uy(C,"paint","circle-color",p,c,v,d),Uy(C,"paint","circle-opacity",p,c,v,d)),Ct=Uy(C,"paint","circle-stroke-width",p,c,v,d),St=xt+"."+bt+"."+wt+"."+Ct;(H=y[St])||(H=new $s({radius:xt,stroke:bt&&Ct>0?new rl({width:Ct,color:bt}):void 0,fill:wt?new tl({color:wt}):void 0}),y[St]=H),j.setImage(H),K=j.getText(),j.setText(void 0),j.setGeometry(void 0),j.setZIndex(D),Z=!0}var Tt=void 0,Et=void 0,Ot=void 0,Pt=void 0,Rt=void 0,It=void 0;if("text-field"in T){Pt=Math.round(Uy(C,"layout","text-size",p,c,v,d));var Mt=Uy(C,"layout","text-font",p,c,v,d);Ot=Uy(C,"layout","text-line-height",p,c,v,d),(Et=ky(a?a(Mt):Mt,Pt,Ot)).includes("sans-serif")||(Et+=",sans-serif"),Rt=Uy(C,"layout","text-letter-spacing",p,c,v,d),It=Uy(C,"layout","text-max-width",p,c,v,d);var kt=Uy(C,"layout","text-field",p,c,v,d);Tt="object"==typeof kt&&kt.sections?1===kt.sections.length?kt.toString():kt.sections.reduce((function(t,e,r){var n=e.fontStack?e.fontStack.split(","):Mt,i=ky(a?a(n):n,Pt*(e.scale||1),Ot),o=e.text;if("\n"===o)return t.push("\n",""),t;if(2!=h){for(var s=0,l=(o=Xy(o,i,It,Rt).split("\n")).length;s0&&t.push("\n",""),t.push(o[s],i);return t}t.push(zy(o,Rt),i)}),[]):Qy(kt,o).trim(),k=Uy(C,"paint","text-opacity",p,c,v,d)}if(Tt&&k&&!J){Z||(++_,(j=R[_])&&j.getText()&&!j.getFill()&&!j.getStroke()||(j=new sl,R[_]=j),j.setImage(void 0),j.setGeometry(void 0)),j.getText()||j.setText(K||new Mu({padding:[2,2,2,2]})),K=j.getText();var Ft=T["text-transform"];"uppercase"==Ft?Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toUpperCase()})):Tt.toUpperCase():"lowercase"==Ft&&(Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toLowerCase()})):Tt.toLowerCase());var At=Array.isArray(Tt)?Tt:2==h?zy(Tt,Rt):Xy(Tt,Et,It,Rt);K.setText(At),K.setFont(Et),K.setRotation(Fy(Uy(C,"layout","text-rotate",p,c,v,d)));var Lt=Uy(C,"layout","text-anchor",p,c,v,d),jt=Z||1==h?"point":Uy(C,"layout","symbol-placement",p,c,v,d);K.setPlacement(jt),K.setOverflow("point"===jt);var Dt=Uy(C,"paint","text-halo-width",p,c,v,d),zt=Uy(C,"layout","text-offset",p,c,v,d),Gt=Uy(C,"paint","text-translate",p,c,v,d),Nt=0,Wt=0;if("point"==jt){var Xt="center";-1!==Lt.indexOf("left")?(Xt="left",Wt=Dt):-1!==Lt.indexOf("right")&&(Xt="right",Wt=-Dt),K.setTextAlign(Xt);var Bt=Uy(C,"layout","text-rotation-alignment",p,c,v,d);K.setRotateWithView("map"==Bt)}else K.setMaxAngle(Fy(Uy(C,"layout","text-max-angle",p,c,v,d))*Tt.length/At.length),K.setTextAlign(),K.setRotateWithView(!1);var Vt="middle";0==Lt.indexOf("bottom")?(Vt="bottom",Nt=-Dt-.5*(Ot-1)*Pt):0==Lt.indexOf("top")&&(Vt="top",Nt=Dt+.5*(Ot-1)*Pt),K.setTextBaseline(Vt),K.setOffsetX(zt[0]*Pt+Wt+Gt[0]),K.setOffsetY(zt[1]*Pt+Nt+Gt[1]),P.setColor(Jy(Uy(C,"paint","text-color",p,c,v,d),k)),K.setFill(P);var qt=Jy(Uy(C,"paint","text-halo-color",p,c,v,d),k);if(qt){O.setColor(qt),Dt*=2;var Zt=.5*Pt;O.setWidth(Dt<=Zt?Dt:Zt),K.setStroke(O)}else K.setStroke(void 0);var Kt=Uy(C,"layout","text-padding",p,c,v,d),Yt=K.getPadding();Kt!==Yt[0]&&(Yt[0]=Kt,Yt[1]=Kt,Yt[2]=Kt,Yt[3]=Kt),j.setZIndex(D)}}}}return _>-1?(R.length=_+1,R):void 0}};return t.setStyle(I),t.set("mapbox-source",h),t.set("mapbox-layers",d),t.set("mapbox-featurestate",{}),I}function eg(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}new Qu;const rg=document.getElementById("Map");if(rg){const t=new ec({source:new sc}),e=new xo({minZoom:0,maxZoom:23,zoom:0,multiWorld:!0,showFullExtent:!0}),r=new Nu({layers:[t],target:"Map",view:e});(ng="./",fetch(ng,ig).then(eg)).then((t=>{var n,i,o,a;let s;if(t.maxzoom&&t.maxzoome.getMinZoom()&&e.setMinZoom(t.minzoom),t.bounds||(t.bounds=[-180,-85,180,85]),r.getView().fit((n=t.bounds,i=qn("EPSG:4326"),o=qn("EPSG:3857"),bt(n,Jn(i,o),void 0,a)),{padding:[5,5,5,5]}),"pbf"===t.format){s=new lh({declutter:!0,source:new Bh({format:new Rp,url:t.tiles[0]})});const e={version:8,sources:{overlay:{type:"vector",tiles:t.tiles,minzoom:t.minzoom,maxzoom:t.maxzoom}},layers:[]};t.vector_layers.forEach(((t,r)=>{e.layers.push({id:`overlay-poly-' ${r}`,source:"overlay","source-layer":t.id,filter:["==","$type","Polygon"],type:"fill",paint:{"fill-color":"orange","fill-opacity":.5,"fill-outline-color":"red"}}),e.layers.push({id:`overlay-line-' ${r}`,source:"overlay","source-layer":t.id,filter:["==","$type","LineString"],type:"line",paint:{"line-color":"red","line-opacity":.75,"line-width":2}}),e.layers.push({id:`overlay-point-' ${r}`,source:"overlay","source-layer":t.id,filter:["==","$type","Point"],type:"circle",paint:{"circle-radius":6,"circle-color":"#F00","circle-opacity":1}})})),tg(s,e,"overlay")}else s=new ec({source:new ic({url:t.tiles[0],minZoom:t.minzoom||0,maxZoom:t.maxzoom||23})});if(r.addLayer(s),t.grids&&t.grids.length>0){var l=new hc({tileJSON:t});const n=new ec({source:l});r.addLayer(n);const i=document.getElementById("Info");infoOverlay=new $o({element:i,offset:[15,15],stopEvent:!1}),r.addOverlay(infoOverlay);const o=t=>{const r=e.getResolution();l.forDataAtCoordinateAndResolution(t,r,(e=>{rg.style.cursor=e?"pointer":"",e&&(i.innerHTML=`\n Data keys:\n
\n (see console for the full object)\n
\n ${JSON.stringify(Object.keys(e))}\n `,console.log(e)),infoOverlay.setPosition(e?t:void 0)}))};r.on("pointermove",(t=>{if(t.dragging)return;const e=r.getEventCoordinate(t.originalEvent);o(e)}))}}))}var ng,ig;